Well, maybe not chewing gum but here is how to chain multiple estop_latches together. In this example, there are three e-stop inputs which flow from latch0 =>latch1 >=latch2 => stop the machine
First, we need to do the usual stuff
Code:
loadrt estop_latch count=3
addf estop-latch.0 servo-thread
addf estop-latch.1 servo-thread
addf estop-latch.2 servo-thread
And then hook the first one up to Linuxcnc iocontrol stuff.
Code:
net latch-ok-in iocontrol.0.user-enable-out
So now we can simply chain each ok_out to the next ok_in to create a chain
Code:
net latch-ok-in => estop-latch.0.ok-in
net latch0-out <= estop-latch.0.ok-out
net latch0-out => estop-latch.1.ok-in
net latch1-out <= estop-latch.1.ok-out
net latch1-out => estop-latch.2.ok-in
and you need to make sure there is a reset signal for each latch. This bit was not obvious from my reading of the documents.
Code:
net latch-reset iocontrol.0.user-request-enable
net latch-reset => estop-latch.0.reset
net latch-reset => estop-latch.1.reset
net latch-reset => estop-latch.2.reset
and we need to get the last estop in the chain tell LinuxCNC we have an estop
Code:
net latch-out iocontrol.0.emc-enable-in <= estop-latch.2.ok-out
and then connect your various inputs to estop_latch.n.fault_in
Code:
# --- EXTERNAL ESTOP SWITCH ---
net external-estop <= hm2_7i76e.0.7i76.0.0.input-00
net external-estop => estop-latch.0.fault-in
# --- PENDANT ESTOP SWITCH ---
net pendant-estop <= hm2_7i76e.0.7i76.0.0.input-26-not
net pendant-estop => estop-latch.1.fault-in
# --- TORCH BREAKAWAY E-STOP ---
net torch-breakaway <= hm2_7i76e.0.7i76.0.0.input-06
net torch-breakaway => estop-latch.2.fault-in
And finally save the estop state to trigger lights and relays.
Code:
net estop-out estop-latch.2.fault-out
In my case I have a red warning light and a stepper disable relay that will switch 5 volts to the stepper drive enable inputs.
Code:
# --- E-STOP STEPPER DRIVE DISABLE ---
net estop-out hm2_7i76e.0.7i76.0.0.output-05
# --- E-STOP RED WARNING LIGHT ---
net estop-out hm2_7i76e.0.7i76.0.0.output-00
So putting it all together this is what I got
Code:
loadrt estop_latch count=3
addf estop-latch.0 servo-thread
addf estop-latch.1 servo-thread
addf estop-latch.2 servo-thread
# --- ESTOP CHAIN STARTS ---
net latch-reset iocontrol.0.user-request-enable
net latch0-ok-in iocontrol.0.user-enable-out
net latch0-ok-in => estop-latch.0.ok-in
net latch0-out <= estop-latch.0.ok-out
net latch0-out => estop-latch.1.ok-in
net latch1-out <= estop-latch.1.ok-out
net latch1-out => estop-latch.2.ok-in
net latch-reset => estop-latch.0.reset
net latch-reset => estop-latch.1.reset
net latch-reset => estop-latch.2.reset
net latch-out iocontrol.0.emc-enable-in <= estop-latch.2.ok-out
net estop-out estop-latch.2.fault-out
# --- EXTERNAL ESTOP SWITCH ---
net external-estop <= hm2_7i76e.0.7i76.0.0.input-00
net external-estop => estop-latch.0.fault-in
# --- PENDANT ESTOP SWITCH ---
net pendant-estop <= hm2_7i76e.0.7i76.0.0.input-26-not
net pendant-estop => estop-latch.1.fault-in
# --- TORCH BREAKAWAY E-STOP ---
net torch-breakaway <= hm2_7i76e.0.7i76.0.0.input-06
net torch-breakaway => estop-latch.2.fault-in
# --- E-STOP STEPPER DRIVE DISABLE ---
net estop-out hm2_7i76e.0.7i76.0.0.output-05
# --- E-STOP RED WARNING LIGHT ---
net estop-out hm2_7i76e.0.7i76.0.0.output-00
# --- ESTOP CHAIN ENDS ---
I think I'll extend my warning light system to flash the red light at various frequencies so you know visually which signal caused the estop.
Well look at that, I educated myself!