Re: [Emc-users] Q for Andy

2023-09-10 Thread gene heskett

On 9/9/23 10:43, gene heskett wrote:

On 9/9/23 05:09, andy pugh wrote:

On Sat, 9 Sept 2023 at 02:01, gene heskett  wrote:


What is the datatype of your mux2?


float ack the man 9 page


Use mux_generic instead, that supports all datatypes.


Thanks Andy, sounds like it should work.

Cheers, Gene Heskett.


Another question Andy, I have an idea for an index check that needs an 
edge module output to a breakout board pin. I intend to use that to 
strobe an led for one servo-thread duration. Can you suggest an LED that 
I could bang at 100ma for 1 millisecond and survive? One that is not 
florescense boosted to white based, that lags too much. I'm trying to 
find whatever is making schloppy threads when I have to peck tap a 
bigger hole that I don't have the ponies to tap single pass.


I have to rebuild much of that piece of hal, and I may as well see if I 
can find the Z error while I'm doing this.


Cheers, Gene Heskett.
--
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page 



___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Q for Andy

2023-09-09 Thread gene heskett

On 9/9/23 05:09, andy pugh wrote:

On Sat, 9 Sept 2023 at 02:01, gene heskett  wrote:


What is the datatype of your mux2?


float ack the man 9 page


Use mux_generic instead, that supports all datatypes.


Thanks Andy, sounds like it should work.

Cheers, Gene Heskett.
--
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page 



___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Q for Andy

2023-09-09 Thread andy pugh
On Sat, 9 Sept 2023 at 02:01, gene heskett  wrote:

> > What is the datatype of your mux2?
>
> float ack the man 9 page

Use mux_generic instead, that supports all datatypes.

-- 
atp
"A motorcycle is a bicycle with a pandemonium attachment and is
designed for the especial use of mechanical geniuses, daredevils and
lunatics."
— George Fitch, Atlanta Constitution Newspaper, 1912


___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Q for Andy

2023-09-08 Thread gene heskett

On 9/8/23 12:28, Viesturs Lācis wrote:

piektd., 2023. g. 8. sept., plkst. 19:07 — lietotājs gene heskett
() rakstīja:





Now I've another data missmatch, since when is a "not" not a true/false
invertor? I can't feed it into a mux2 in for the sample to hold???






https://linuxcnc.org/docs/2.6/html/man/man9/mux2.9.html says that mux2
inputs are floats, not output is bit

Viesturs

So I've found but I'm making (slow) progress on re-inventing this wheel 
anyway.  This hal code has had several boatloads of stuff added to it 
over the last decade.  Needs a really good re-organization.  This 
machine has learned quite a few new dance steps since it followed me 
home under an open bed lid over the back end of a 99 GMC pu from the 
grizzly store in Lycoming PA over a decade ago. I'm not done, but am at 
the stage where the next step is go rip out 3 wires feeding the spindle 
controller and move them to the 7i76 spin pins before I can bring in the 
reversal speed profiles in series with spinout.  PID's are bipolar, 
spinout is not which complicates things a bit. Half tempted to just 
change all the steppers to stepper/servo's & cut the power bill by 75% 
at some point, but at 88 I'm also running out of time to do it.  I am 
using them for all new construction though as they are a whole new 
ballgame. Gets rid of all PID cus its in the controller. If the 
controller can't get the motor to where its told to go, linuxcnc is shut 
down in its tracks. Tested to beat the band, has yet to do it mid-job. 
And because the controllers internal pid error controls the motor 
current, motors run cold and very quiet at working speeds, like Casper 
the Ghost is turning the cranks.


Thanks Viesturs


___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Cheers, Gene Heskett.
--
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page 



___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Q for Andy

2023-09-08 Thread gene heskett

On 9/8/23 12:22, andy pugh wrote:

On Fri, 8 Sept 2023 at 17:07, gene heskett  wrote:


Now I've another data missmatch, since when is a "not" not a true/false
invertor? I can't feed it into a mux2 in for the sample to hold???


What is the datatype of your mux2?


float ack the man 9 page

However in thinking thru that paragragh of hal code, its all bit from 
the input from the drivers on, to there and effectively so is the halui 
input that bangs the e-stop off. Everything in that chain except the 
mux2 is bit wise stuff. I've tested the code thru multiple times, and it 
is working as designed for an f2 toggle, which also comes on in an alarm 
state for about 1 second and it does block that momentary alarm just 
fine. So the existing code is actually working.


The problem on the sixty40 shows at lcnc launch init, requiring an extra 
hit on ctl-space to clear the messages it emmits due to the default no 
power state its in at that time.  So I am wondering if I can "not" the 
signal and correct that later.  I'll give that some thought later. Since 
that output is a bit switched by an opto, the possibility of a free 
inversion by rewiring comes to mind.


Future project, I've left comments in the hal file FFR. Thanks Andy

Now back to the GO704 and its missing spindir signel, which is also a 
bit,  But since I was running the former pwmgen in mode2, I don't think 
I ever developed a dir signal because the mode2 is biplar. 2 separate 
pwm signals IOW.  Fun, games and headaches but it sure keeps me out of 
the bars.


Thanks Andy.

Works for me:

andypugh@rm-one:~/linuxcnc-dev$ halrun
halcmd: loadrt not count=1
Note: Using POSIX realtime
halcmd: loadrt mux_generic config=bb2
halcmd: net test not.0.out mux-gen.00.in-bit-01
halcmd: show sig
Signals:
Type  Value  Name (linked to)
bit   FALSE  test
  ==> mux-gen.00.in-bit-01
  <== not.0.out



Cheers, Gene Heskett.
--
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page 



___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Q for Andy

2023-09-08 Thread Viesturs Lācis
piektd., 2023. g. 8. sept., plkst. 19:07 — lietotājs gene heskett
() rakstīja:
>
> >
> Now I've another data missmatch, since when is a "not" not a true/false
> invertor? I can't feed it into a mux2 in for the sample to hold???
> >
>

https://linuxcnc.org/docs/2.6/html/man/man9/mux2.9.html says that mux2
inputs are floats, not output is bit

Viesturs


___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Q for Andy

2023-09-08 Thread andy pugh
On Fri, 8 Sept 2023 at 17:07, gene heskett  wrote:

> Now I've another data missmatch, since when is a "not" not a true/false
> invertor? I can't feed it into a mux2 in for the sample to hold???

What is the datatype of your mux2?

Works for me:

andypugh@rm-one:~/linuxcnc-dev$ halrun
halcmd: loadrt not count=1
Note: Using POSIX realtime
halcmd: loadrt mux_generic config=bb2
halcmd: net test not.0.out mux-gen.00.in-bit-01
halcmd: show sig
Signals:
Type  Value  Name (linked to)
bit   FALSE  test
 ==> mux-gen.00.in-bit-01
 <== not.0.out

-- 
atp
"A motorcycle is a bicycle with a pandemonium attachment and is
designed for the especial use of mechanical geniuses, daredevils and
lunatics."
— George Fitch, Atlanta Constitution Newspaper, 1912


___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Q for Andy

2023-09-08 Thread gene heskett

On 9/8/23 08:54, andy pugh wrote:

On Fri, 8 Sept 2023 at 12:30, gene heskett  wrote:


The problem is the analog i/o sample_hold, I need the digital equ so I
don't have to do a jillion S32-float conversions.


I don't know why sample-hold is only S32, it would be much more useful
if it was configurable.

However, you can fake a sample-hold with a mux (this is something that
I have done several times)

If you feed the output of a mux back to the input-1 and the value to
be sampled to input-0, then you have a sample-hold.

mux_generic can be configured for any datatype (and even to convert
between datatypes, but that won't work if it's configured for
sample_hold as the output feeds back to the input so needs to be the
same datatype.

Now I've another data missmatch, since when is a "not" not a true/false 
invertor? I can't feed it into a mux2 in for the sample to hold???




Cheers, Gene Heskett.
--
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page 



___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Q for Andy

2023-09-08 Thread gene heskett

On 9/8/23 08:54, andy pugh wrote:

On Fri, 8 Sept 2023 at 12:30, gene heskett  wrote:


The problem is the analog i/o sample_hold, I need the digital equ so I
don't have to do a jillion S32-float conversions.


I don't know why sample-hold is only S32, it would be much more useful
if it was configurable.

However, you can fake a sample-hold with a mux (this is something that
I have done several times)


So have I but had forgotten it. Sadly I've reached that age where I have 
forgotten what, if anything I had for breakfast.


I can also use that to block the error inputs from the stepper/servo 
controllers on the sixty40 mill which don't cancel that signal until 
fully functional at powerup. Set a timer to hold the error from getting 
to the e-stop for 100 milliseconds at powerup. Powerup to the machine 
and possibly its lighting is controlled by the F2 state on most of my 
machines, F2 off, machine is cold. Which is what those drivers need to 
re-enable after they've errored.  Well tested on the Sheldon and its pi,
did the same on the sixty40 but neither machine has ever faulted running 
gcode. They also use the error as a current modulator banging the motor 
with everything the psu has for about 2 miliseconds, if that fails, the 
shut the motor off and issue the alarm, stopping linuxcnc in its tracks 
with no broken tools, but run them at very low currants if moving 
easily. And all 4 of them run cold unless that 3NM as B on the sixty40, 
a twin of this one is spinning the chuck at more than 200 rpms, runs 
around 350 for a couple hours making that vice screw. Its spinning the 
motor 5x the chucks rpms.  Warms it up a bit.



If you feed the output of a mux back to the input-1 and the value to
be sampled to input-0, then you have a sample-hold.


Thank you Andy. That is exactly what I need.


mux_generic can be configured for any datatype (and even to convert
between datatypes, but that won't work if it's configured for
sample_hold as the output feeds back to the input so needs to be the
same datatype.




Cheers, Gene Heskett.
--
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page 



___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Q for Andy

2023-09-08 Thread andy pugh
On Fri, 8 Sept 2023 at 12:30, gene heskett  wrote:

> The problem is the analog i/o sample_hold, I need the digital equ so I
> don't have to do a jillion S32-float conversions.

I don't know why sample-hold is only S32, it would be much more useful
if it was configurable.

However, you can fake a sample-hold with a mux (this is something that
I have done several times)

If you feed the output of a mux back to the input-1 and the value to
be sampled to input-0, then you have a sample-hold.

mux_generic can be configured for any datatype (and even to convert
between datatypes, but that won't work if it's configured for
sample_hold as the output feeds back to the input so needs to be the
same datatype.


-- 
atp
"A motorcycle is a bicycle with a pandemonium attachment and is
designed for the especial use of mechanical geniuses, daredevils and
lunatics."
— George Fitch, Atlanta Constitution Newspaper, 1912


___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


[Emc-users] Q for Andy

2023-09-08 Thread gene heskett

Greetings Andy;

I'm having a hell of a time rebuilding my GO704 for a different A axis 
that involves moving the spindle controls to the spin pins on a 7i76, 
getting rid of both pwmgens in my current config.


The problem is the analog i/o sample_hold, I need the digital equ so I 
don't have to do a jillion S32-float conversions.


Is there such a critter and I'm too old to see it?

What I need is a detector that compares the state of the spindle.0.out 
with the current state of what is sent to hm2_5i25.0.7i76.0.0.spindir pin.
An xor2 does that and I'll use its output as a flipflop clk to clock the 
new state into the spindle controller. But I need a sample_hold to hold 
the current direction state until other logic has stopped the spindle.


Using motion's signal, which does not stop the spindle when reversing, 
slams a 30 amp breaker in the service box but with my old code I'm 
inserting a stop delay that doesn't allow the reverse signal thru until 
the encoder says its stopped, but I have to use additional delays by 
ramping the speed with a linear3 to keep it within the Z axis's ability 
to follow for rigid tapping. By taking advantage of Jon's pwm-servo's 4 
quadrant control and controlling the motors slowdown and speedups in the 
other direction, I recover the energy in the motor, which seriously over 
voltages the caps in the spindle power supply for a few milliseconds, 
running that 126 volt supply with 2 65 volt caps in series, up to around 
170 volts but then uses that energy to accellerate the motor in the 
other direction. Currantly this takes around 350 milliseconds from 3000 
fwd to -3000 reverse and vice-versa, and because most of it is recovered 
by the stop, the shop lights don't blink and I run it on a 20 amp 
breaker. Sounds crazy, but I've been doing it for about a decade. Zero 
problems.


But I need a digital sample_hold. Can this be cobbled up with flipflops?

Cheers, Gene Heskett.
--
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page 


___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users