Setting up a 3 position switch for manual spindle forward reverse and off.

More
06 May 2022 18:45 #242158 by PhilCNC
Right now I have the spindle forward and reverse hooked up to this switch, but the middle position is simply no signal, therefore I must turn the spindle off by clicking the button on the screen. I think I could use a NOR gate connected to the two signals on the mesa board to determine when to trigger the manual spindle stop, but I really don't know how to implement this in the HAL file or if I need to use something like classic ladder. Your help is greatly appreciated. HAL file and picture of lathe control panel attached.
Attachments:

Please Log in or Create an account to join the conversation.

More
06 May 2022 19:50 #242168 by andypugh
You need to build your own nor from not and or

linuxcnc.org/docs/stable/html/man/man9/not.9.html
linuxcnc.org/docs/stable/html/man/man9/or2.9.html

But it might be that you just need an or2 connected to the "on" input of the drive?

Please Log in or Create an account to join the conversation.

More
06 May 2022 20:02 #242171 by PhilCNC
Thanks for the advice, I'll try to implement it. I don't know how to do this with the 2nd way you described, the spindle drive takes an enable signal and a forward/reverse signal from the Mesa 7i76E so there isn't an easy way to hook up directly to the drive.

Please Log in or Create an account to join the conversation.

More
06 May 2022 21:59 #242180 by PhilCNC
Ok I've implemented the or2 and not into my hal file. I'm getting an error now, "Signal name 'not.0.in' must not be the same as a pin. Did you omit the signal name?

I don't know why I'm getting this. 
Attachments:

Please Log in or Create an account to join the conversation.

More
06 May 2022 22:03 #242181 by PhilCNC
It works! Here's the solution


net spindle-manual-cw <= hm2_7i76e.0.7i76.0.0.input-28 => or2.0.in0
net spindle-manual-ccw <= hm2_7i76e.0.7i76.0.0.input-27 => or2.0.in1
net arf not.0.in <= or2.0.out
net spindle-manual-stop <= not.0.out

the letters can be anything.
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

Time to create page: 0.163 seconds
Powered by Kunena Forum