Multiple Input to E-Stop Configuration
26 Oct 2015 20:22 - 26 Oct 2015 20:28 #64289
by Askjerry
Multiple Input to E-Stop Configuration was created by Askjerry
I have three axis on my mill using the Geckodrive G320 DC Motor type drivers. When in normal operation, the ERR pin is at 5v (logic high) and if/when the drive fails, the pin goes to 0v (logic low). I have two Stainsmart boards connected to my dual parallel ports, the relay (Pin 14) of the second board is configured to apply a 5v reset signal to the drives to reset them at start up, and if an error occurs. (There are diodes to isolate each signal, etc.)
On my pyVCP panel, I have three indicators to let me know which, if any of the drives may have failed. I also have the mill set up to accept an external E-STOP signal to halt everything. All this works flawlessly so far. The three signals in the pyVCP are named GECKO-X, GECKO-Y, and GECKO-Z... a LOW signal makes the FAIL image pop up.
Parallel Port 0, Pin P13 = E-STOP (Active/Triggered Low)
Parallel Port 1, Pin P10 = X-Axis Err
Parallel Port 1, Pin P11 = Y-Axis Err
Parallel Port 1, Pin P12 = Z-Axis Err
Here is the issue... if any ONE or MORE of the error pins goes low... I need to trigger the E-STOP pin. (Logic Low)
There are two ways to accomplish this...
1) Connect a physical 4-Input NAND gate chip to the three pins and tie the remaining pin to high. (Or to another E-Stop switch.)
2) Write a HAL component to evaluate the three inputs and react accordingly.
I was looking at the software method... but both the AND function and the OR function only take 2 inputs as I understand them.
I know I could AND signal 1 and signal 2, then AND the result with signal 3... but that just seems too clunky to me.
Is there a software solution or should I just build the circuit and drop it into my interface matrix?
Thoughts?
Suggestions?
Thanks!
On my pyVCP panel, I have three indicators to let me know which, if any of the drives may have failed. I also have the mill set up to accept an external E-STOP signal to halt everything. All this works flawlessly so far. The three signals in the pyVCP are named GECKO-X, GECKO-Y, and GECKO-Z... a LOW signal makes the FAIL image pop up.
Parallel Port 0, Pin P13 = E-STOP (Active/Triggered Low)
Parallel Port 1, Pin P10 = X-Axis Err
Parallel Port 1, Pin P11 = Y-Axis Err
Parallel Port 1, Pin P12 = Z-Axis Err
Here is the issue... if any ONE or MORE of the error pins goes low... I need to trigger the E-STOP pin. (Logic Low)
There are two ways to accomplish this...
1) Connect a physical 4-Input NAND gate chip to the three pins and tie the remaining pin to high. (Or to another E-Stop switch.)
2) Write a HAL component to evaluate the three inputs and react accordingly.
I was looking at the software method... but both the AND function and the OR function only take 2 inputs as I understand them.
I know I could AND signal 1 and signal 2, then AND the result with signal 3... but that just seems too clunky to me.
Is there a software solution or should I just build the circuit and drop it into my interface matrix?
Thoughts?
Suggestions?
Thanks!
Last edit: 26 Oct 2015 20:28 by Askjerry.
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
Less
More
- Posts: 5007
- Thank you received: 1441
26 Oct 2015 21:40 #64299
by Todd Zuercher
Replied by Todd Zuercher on topic Multiple Input to E-Stop Configuration
There is already a pin in motion for connecting a servo amp fault. (axis.N.amp-fault-in)
linuxcnc.org/docs/html/man/man9/motion.9.html
But this doesn't put the machine into e-stop, just power off. (F2) but this isn't necessarily all bad.
other software options would be to use a series of or2s, use lut5, or use classic ladder.
using the or2 is a bit clunky but it can work.
input0=>or2.0.in0
input1=>or2.0.in1
input2=>or2.1.in0
or2.0.out=>or2.1.in1
input3=>or2.2.in0
or2.1.out=>or2.2.in1
or2.2.out=>what ever signal
linuxcnc.org/docs/html/man/man9/motion.9.html
But this doesn't put the machine into e-stop, just power off. (F2) but this isn't necessarily all bad.
other software options would be to use a series of or2s, use lut5, or use classic ladder.
using the or2 is a bit clunky but it can work.
input0=>or2.0.in0
input1=>or2.0.in1
input2=>or2.1.in0
or2.0.out=>or2.1.in1
input3=>or2.2.in0
or2.1.out=>or2.2.in1
or2.2.out=>what ever signal
Please Log in or Create an account to join the conversation.
26 Oct 2015 22:00 - 26 Oct 2015 22:51 #64301
by andypugh
www.linuxcnc.org/docs/html/man/man9/logic.9.html
Up to 16 inputs. And LUT5 will work too.
For 32 inputs you could use "bitwise" but that is rather more trouble.
[Edit] On further reflection, LUT5 is probably the most convenient as that lets you chose whether you want to e-stop on positive or negative logic for each input.
Replied by andypugh on topic Multiple Input to E-Stop Configuration
I was looking at the software method... but both the AND function and the OR function only take 2 inputs as I understand them.
www.linuxcnc.org/docs/html/man/man9/logic.9.html
Up to 16 inputs. And LUT5 will work too.
For 32 inputs you could use "bitwise" but that is rather more trouble.
[Edit] On further reflection, LUT5 is probably the most convenient as that lets you chose whether you want to e-stop on positive or negative logic for each input.
Last edit: 26 Oct 2015 22:51 by andypugh.
Please Log in or Create an account to join the conversation.
26 Oct 2015 22:57 - 26 Oct 2015 23:03 #64305
by Askjerry
Replied by Askjerry on topic Multiple Input to E-Stop Configuration
Yes, the logic will work... I just need to tinker with it now and understand the syntax... but yes... 3 inputs, one output... then tie that to E-Stop... perfect.
I'll post code once I figure it out.
So far... from what I read...
loadrt logic count=1
addf logic.0 base-thread
net pyvcp.GECKO-X => logic.0.in-00
net pyvcp.GECKO-Y => logic.0.in-01
net pyvcp.GECKO-Z => logic.0.in-02
net GECKO-ERR <= logic.0.and
If any input or combination of inputs drop to zero then GECKO-ERR should equal ZERO.
I still have issues with figuring out net connections... so I'll have to play around with this... but I have the concept...
then once I get the logic command to work... I know that in my HAL file I have the following set up by stepconfig......
net estop-ext => parport.0.pin.13.in
net estop-out <= iocontrol.0.user-enable-out
net estop-ext => iocontrol.0.emc-enable-in
So it looks like I have to net GECKO-ERR to estop-ext to complete the logic... I'll start working on that...
Getting the nets right is always my stumbling block...
Thanks!
Jerry
I'll post code once I figure it out.
So far... from what I read...
loadrt logic count=1
addf logic.0 base-thread
net pyvcp.GECKO-X => logic.0.in-00
net pyvcp.GECKO-Y => logic.0.in-01
net pyvcp.GECKO-Z => logic.0.in-02
net GECKO-ERR <= logic.0.and
If any input or combination of inputs drop to zero then GECKO-ERR should equal ZERO.
I still have issues with figuring out net connections... so I'll have to play around with this... but I have the concept...
then once I get the logic command to work... I know that in my HAL file I have the following set up by stepconfig......
net estop-ext => parport.0.pin.13.in
net estop-out <= iocontrol.0.user-enable-out
net estop-ext => iocontrol.0.emc-enable-in
So it looks like I have to net GECKO-ERR to estop-ext to complete the logic... I'll start working on that...
Getting the nets right is always my stumbling block...
Thanks!
Jerry
Last edit: 26 Oct 2015 23:03 by Askjerry.
Please Log in or Create an account to join the conversation.
26 Oct 2015 23:33 #64309
by andypugh
Will give you a 3-input OR gate
Replied by andypugh on topic Multiple Input to E-Stop Configuration
loadrt logic count=1
loadrt logic count=1 personality=0x203
Please Log in or Create an account to join the conversation.
27 Oct 2015 00:06 #64312
by Askjerry
Replied by Askjerry on topic Multiple Input to E-Stop Configuration
Ah.... ok...
I still think it must be an AND function... all three must be in LOGIC-1 state to have a NOT ESTOP
So...
loadrt logic count=1 personality=0x103
addf logic.0 base-thread
And I'm also thinking I need to point directly to the parallel port inputs, not the pvVCP indicators...
net parport.1.pin.10.in => logic.0.in-00
net parport.1.pin.11.in => logic.0.in-01
net parport.1.pin.12.in => logic.0.in-02
net GECKO-ERR <= logic.0.and
Right?
I still think it must be an AND function... all three must be in LOGIC-1 state to have a NOT ESTOP
So...
loadrt logic count=1 personality=0x103
addf logic.0 base-thread
And I'm also thinking I need to point directly to the parallel port inputs, not the pvVCP indicators...
net parport.1.pin.10.in => logic.0.in-00
net parport.1.pin.11.in => logic.0.in-01
net parport.1.pin.12.in => logic.0.in-02
net GECKO-ERR <= logic.0.and
Right?
Please Log in or Create an account to join the conversation.
27 Oct 2015 00:30 #64314
by andypugh
Servo thread will be fine.
You actually probably need to link to the signals, if the pins are already connected.
Replied by andypugh on topic Multiple Input to E-Stop Configuration
addf logic.0 base-thread[/color]
Servo thread will be fine.
And I'm also thinking I need to point directly to the parallel port inputs, not the pvVCP indicators...
You actually probably need to link to the signals, if the pins are already connected.
Please Log in or Create an account to join the conversation.
27 Oct 2015 00:58 #64320
by Askjerry
Replied by Askjerry on topic Multiple Input to E-Stop Configuration
Ah... servo-thread is then the slower of the two... not cycled as often... and less likely to slow down the machine...
I got them mixed up... which means... I need to revisit some of my other configurations as well. (blush)
I got them mixed up... which means... I need to revisit some of my other configurations as well. (blush)
Please Log in or Create an account to join the conversation.
27 Oct 2015 14:00 - 27 Oct 2015 14:09 #64337
by Askjerry
Replied by Askjerry on topic Multiple Input to E-Stop Configuration
Major accomplishment. (For me anyway...)
I have 4 inputs from the "real world"... if any one or more fails (goes low) then the machine MUST stop... ESTOP active.
It took some fiddling... but I got it... and it works well. I needed to use the "NOT" and the "LOGIC" functions together to make it happen.
I want to personally thank Andy Pugh for all his help... I could not have figured it out on my own... THANKS!
I hope this helps someone else with their system too!
Jerry
I have 4 inputs from the "real world"... if any one or more fails (goes low) then the machine MUST stop... ESTOP active.
- ERR Signal from X-Axis Gecko Drive
- ERR Signal from Y-Axis Gecko Drive
- ERR Signal from Z-Axis Gecko Drive
- A Big RED ESTOP SWITCH mounted on the mill
It took some fiddling... but I got it... and it works well. I needed to use the "NOT" and the "LOGIC" functions together to make it happen.
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Geckodrive Error Reporting and Reset System
# --------------------------------------------------------------------------------------------------
loadrt not count=1 # Load 1 instance of the "NOT" routine.
addf not.0 servo-thread # Apply to servo-thread
loadrt timedelay count=1 # Load 1 instance of the "TIMEDELAY" routine.
addf timedelay.0 servo-thread # Apply to servo-thread
setp timedelay.0.on-delay 0.05 # Set delay to determine switch push to 0.05 sec.
setp timedelay.0.off-delay 5.0 # Set the delay time to 5.0 sec.
# --------------------------------------------------------------------------------------------------
# read the "gecko-clear" button and apply it to the time delay input, then invert and
# send the signal to the parallel port #2, pin 14... hold it for the full time delay.
net gecko-clear-in <= timedelay.0.in <= pyvcp.GECKO-RESET
net gecko-post-timer <= timedelay.0.out
net gecko-post-timer => not.0.in
net gecko-post-invert <= not.0.out => parport.1.pin-14-out
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
net panel-GECKO-X <= parport.1.pin-10-in => pyvcp.GECKO-X
net panel-GECKO-Y <= parport.1.pin-11-in => pyvcp.GECKO-Y
net panel-GECKO-Z <= parport.1.pin-12-in => pyvcp.GECKO-Z
# --------------------------------------------------------------------------------------------------
# Geckodrive Error to ESTOP system
# --------------------------------------------------------------------------------------------------
net estop-switch <= parport.0.pin-13-in
net estop-ext => iocontrol.0.emc-enable-in
net estop-out <= iocontrol.0.user-enable-out
# --------------------------------------------------------------------------------------------------
# Use the "LOGIC" function to evaluate four (4) inputs... if any fail, act accordingly.
loadrt logic count=1 personality=0x104 # 1xx is AND, 2xx is OR, and 3xx is XOR logic sets.
addf logic.0 servo-thread
net panel-GECKO-X => logic.0.in-00 # Input 1 of 4 from X-Axis
net panel-GECKO-Y => logic.0.in-01 # Input 2 of 4 from Y-Axis
net panel-GECKO-Z => logic.0.in-02 # Input 3 of 4 from Z-Axis
net estop-switch => logic.0.in-03 # Input 4 of 4 from Big Red Button on Mill
net estop-ext <= logic.0.and # Apply the final output to the ESTOP system
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# End of Configuration
I want to personally thank Andy Pugh for all his help... I could not have figured it out on my own... THANKS!
I hope this helps someone else with their system too!
Jerry
Last edit: 27 Oct 2015 14:09 by Askjerry.
Please Log in or Create an account to join the conversation.
27 Oct 2015 23:13 #64357
by andypugh
Replied by andypugh on topic Multiple Input to E-Stop Configuration
If you wanted to make it slightly simpler you could do away with the "not" function and simply invert the sense parallel port pin output.
Please Log in or Create an account to join the conversation.
Time to create page: 0.094 seconds