Advanced Search

Search Results (Searched for: estop_latch)

  • tuxcnc
  • tuxcnc
25 Mar 2025 18:52

Remora - ethernet NVEM / EC300 / EC500 cnc board

Category: Computers and Hardware

External e-stop (fault) on EC500 input.
loadrt estop_latch
addf estop-latch.0 servo-thread
net estop-loopout       iocontrol.0.emc-enable-in       <= estop-latch.0.ok-out
net user-enable-out     iocontrol.0.user-enable-out     => remora.enable
net estop-loopin        remora.status                   => estop-latch.0.ok-in => estop-latch.0.reset
net estop-reset         iocontrol.0.user-request-enable => remora.reset
net remote-estp         estop-latch.0.fault-in          <= remora.input.02.not
 
  • rodw
  • rodw's Avatar
23 Feb 2025 07:36
Replied by rodw on topic estop issue

estop issue

Category: HAL

You should use estop-latch

Why?
-
Yes, there are instances when it is very useful, but not on simple/hobby/small machines, and especially not for beginners.

The video (not mine) explains why. My last couple of machines I used a safety relay so estop is external and I utilised an external reset button but I did test and consider using user_request_enable. You should not depend on a software estop if you have ired one in anyway.

QT dragon works well with my setup (as does Axis) I don't use estop_latch with it.
  • tommylight
  • tommylight's Avatar
23 Feb 2025 00:29
Replied by tommylight on topic estop issue

estop issue

Category: HAL

You should use estop-latch

Why?
-
Yes, there are instances when it is very useful, but not on simple/hobby/small machines, and especially not for beginners.
  • rodw
  • rodw's Avatar
23 Feb 2025 00:05
Replied by rodw on topic estop issue

estop issue

Category: HAL

You should use estop-latch
There is an example in hal examples on the forum
and this video
  • MTTI
  • MTTI's Avatar
17 Feb 2025 08:16
Replied by MTTI on topic New and Working RTAI debs for 2.9

New and Working RTAI debs for 2.9

Category: Installing LinuxCNC

Thanks for this answer.

I would like to install RTAI due to the jitter in my setup, which is around 70k.
I'm using 4 stepper motors with encoders (closed loop) and a USC board from PICO.

Sometimes, though not very often, I get an "Unexpected realtime delay" message.
Do you think this could be related to the jitter amount?

I've tried every optimization I could find in the BIOS...
 
Just having a look at the PICO config, is the base thread used ? From a quick look nothing appears to attach to the base thread. Which would lead me to think that a simple RT_PREEMPT kernel would be suffice. The PICO board would seem to operate in a simialr way to a mesa 7i90 using the EPP protocol. IE using the parallel port to send timing info to a FPGA.


 

You're right, into the HAL file, there is only mention of servo-thread:
# Generated by stepconf 1.1 at Tue Jan 28 10:21:07 2025
# Si vous modifiez ce fichier, il sera
# écrasé quand vous relancerez Stepconf
loadrt [KINS]KINEMATICS

loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS num_spindles=[TRAJ]SPINDLES

# next load the PID module, for four PID loops
loadrt pid num_chan=4

loadrt  plasmac

loadrt hal_ppmc epp_dir=1 

# make some signals for the scope for tuning.
loadrt ddt count=4
# add components for E-stop logic
loadrt estop_latch count=1
loadrt and2 count=1

# set up the realtime thread
# read inputs first
addf ppmc.0.read servo-thread
# then run the motion controller
addf motion-command-handler servo-thread
addf and2.0 servo-thread
addf estop-latch.0 servo-thread
addf motion-controller servo-thread
# then the PID loops
addf pid.0.do-pid-calcs servo-thread
addf pid.1.do-pid-calcs servo-thread
addf pid.2.do-pid-calcs servo-thread
addf pid.3.do-pid-calcs servo-thread
# write outputs last
addf ppmc.0.write servo-thread


# ---PLASMA INPUT DEBOUNCE---
loadrt dbounce names=db_breakaway,db_float,db_ohmic,db_arc-ok
addf db_float     servo-thread
addf db_ohmic     servo-thread
addf db_breakaway servo-thread
addf db_arc-ok    servo-thread

# ---JOINT ASSOCIATED WITH THE Z AXIS---
net plasmac:axis-position joint.2.pos-fb => plasmac.axis-z-position

# ---PLASMA INPUTS---
# ---all modes---
net plasmac:float-switch   => db_float.in
net plasmac:breakaway      => db_breakaway.in
net plasmac:ohmic-probe    => db_ohmic.in
net plasmac:ohmic-sense-in   => plasmac.ohmic-sense-in
# ---modes 0 & 1
net plasmac:arc-voltage-in => plasmac.arc-voltage-in
# ---modes 1 & 2
net plasmac:arc-ok-in      => db_arc-ok.in
# ---mode 2
net plasmac:move-up        => plasmac.move-up
net plasmac:move-down      => plasmac.move-down

# ---PLASMA OUTPUTS---
# ---all modes---
net plasmac:ohmic-enable   <= plasmac.ohmic-enable
net plasmac:scribe-arm     <= plasmac.scribe-arm
net plasmac:scribe-on      <= plasmac.scribe-on

# connect limit/home switch outputs to motion controller
net Xminlim <= ppmc.0.din.01.in
net Xminlim => joint.0.neg-lim-sw-in
net Xmaxlim <= ppmc.0.din.02.in
net Xmaxlim => joint.0.pos-lim-sw-in
net Xhome <= ppmc.0.din.00.in
net Xhome => joint.0.home-sw-in

net Yminlim <= ppmc.0.din.05.in
net Yminlim => joint.1.neg-lim-sw-in
net Ymaxlim <= ppmc.0.din.06.in
net Ymaxlim => joint.1.pos-lim-sw-in
net Yhome <= ppmc.0.din.04.in
net Yhome => joint.1.home-sw-in

net Zminlim <= ppmc.0.din.09.in
net Zminlim => joint.2.neg-lim-sw-in
net Zmaxlim <= ppmc.0.din.10.in
net Zmaxlim => joint.2.pos-lim-sw-in
net Zhome <= ppmc.0.din.08.in
net Zhome => joint.2.home-sw-in

net Aminlim <= ppmc.0.din.12.in
net Aminlim => joint.3.neg-lim-sw-in
net Amaxlim <= ppmc.0.din.13.in
net Amaxlim => joint.3.pos-lim-sw-in
net Ahome <= ppmc.0.din.11.in
net Ahome => joint.3.home-sw-in


# connect index pulses to motion controller
# uncomment these lines only if you have a Rev 2 USC board
# newsig Xindex bit
# newsig Yindex  bit
# newsig Zindex bit
# newsig Aindex bit
# linksp Xindex <= ppmc.0.encoder.00.index-enable
# linksp Xindex => joint.0.index-enable
# linksp Yindex <= ppmc.0.encoder.01.index-enable
# linksp Yindex => joint.1.index-enable
# linksp Zindex <= ppmc.0.encoder.02.index-enable
# linksp Zindex => joint.2.index-enable
# linksp Aindex <= ppmc.0.encoder.03.index-enable
# linksp Aindex => joint.3.index-enable

#
# Connect I/O controller I/Os
#

# connect e-stop write/sense to I/O controller
# and univstep's fault with estop's output, so  estop FF is reset, but
#      prevent continued estop signal from univstep from holding FF cleared
net ppmcEstop ppmc.0.din.15.in-not
net ppmcEstop and2.0.in0
net EstopOkIn estop-latch.0.fault-in
net EstopOkIn and2.0.out
net EstopOkOut <= ppmc.0.dout.07.out
net EstopOkOut iocontrol.0.emc-enable-in
net EstopOkOut estop-latch.0.ok-out
net EstopOkOut and2.0.in1
net emc-estop-out iocontrol.0.user-enable-out
net emc-estop-out estop-latch.0.ok-in
net emc-estop-reset iocontrol.0.user-request-enable
net emc-estop-reset estop-latch.0.reset

net emc-estop-out estop-latch.0.ok-in 

# connect spindle fwd/rev to I/O controller
net SpindleFwd <= ppmc.0.dout.00.out
net SpindleFwd => spindle.0.forward
net SpindleRev <= ppmc.0.dout.01.out
net SpindleRev => spindle.0.reverse

# connect spindle brake to I/O controller
net SpindleBrakeOn <= ppmc.0.dout.02.out
net SpindleBrakeOn => spindle.0.brake

# connect mist/flood coolant to I/O controller
net MistOn <= ppmc.0.dout.03.out
net MistOn => iocontrol.0.coolant-mist
net FloodOn <= ppmc.0.dout.04.out
net FloodOn => iocontrol.0.coolant-flood


# connect position feedback signals to encoders
net Xpos-fb <= ppmc.0.encoder.00.position
net Ypos-fb <= ppmc.0.encoder.01.position
net Zpos-fb <= ppmc.0.encoder.02.position
net Apos-fb <= ppmc.0.encoder.03.position

# get feedback scaling from ini file
setp ppmc.0.encoder.00.scale [JOINT_0]INPUT_SCALE
setp ppmc.0.encoder.01.scale [JOINT_1]INPUT_SCALE
setp ppmc.0.encoder.02.scale [JOINT_2]INPUT_SCALE
setp ppmc.0.encoder.03.scale [JOINT_3]INPUT_SCALE

# connect PID output signals to step generators
net Xoutput => ppmc.0.stepgen.00.velocity
net Youtput => ppmc.0.stepgen.01.velocity
net Zoutput => ppmc.0.stepgen.02.velocity
net Aoutput => ppmc.0.stepgen.03.velocity

# connect axis enables to step generators
net Xenable => ppmc.0.stepgen.00.enable
net Yenable => ppmc.0.stepgen.01.enable
net Zenable => ppmc.0.stepgen.02.enable
net Aenable => ppmc.0.stepgen.03.enable

# set output scaling from ini file
# input and output scales should (normally) be the same for a USC
setp ppmc.0.stepgen.00.scale [JOINT_0]OUTPUT_SCALE
setp ppmc.0.stepgen.01.scale [JOINT_1]OUTPUT_SCALE
setp ppmc.0.stepgen.02.scale [JOINT_2]OUTPUT_SCALE
setp ppmc.0.stepgen.03.scale [JOINT_3]OUTPUT_SCALE

# add a couple of tuning test links
# if these are useful will want to add them to the other axes as well
# or make these setup with the tuning script
# net Xoutput ddt.0.in
# net Xpos-fb ddt.1.in


# HAL config file for servos -- expanded from core_servo.hal
# for a full four axis setup

# create four position feedback signals

# connect position feedback to PID loop
net Xpos-fb => pid.0.feedback
net Ypos-fb => pid.1.feedback
net Zpos-fb => pid.2.feedback
net Apos-fb => pid.3.feedback

# connect position feedback to motion module
net Xpos-fb => joint.0.motor-pos-fb
net Ypos-fb => joint.1.motor-pos-fb
net Zpos-fb => joint.2.motor-pos-fb
net Apos-fb => joint.3.motor-pos-fb

# create PID to DAC output signals

# connect output signals to output of PID loops
net Xoutput <= pid.0.output
net Youtput <= pid.1.output
net Zoutput <= pid.2.output
net Aoutput <= pid.3.output

# set PID loop output limits to +/-1.00
setp pid.0.maxoutput [JOINT_0]PID_MAX_VEL
setp pid.1.maxoutput [JOINT_1]PID_MAX_VEL
setp pid.2.maxoutput [JOINT_2]PID_MAX_VEL
setp pid.3.maxoutput [JOINT_3]PID_MAX_VEL

# set PID loop gains
setp pid.0.Pgain [JOINT_0]P
setp pid.0.Igain [JOINT_0]I
setp pid.0.Dgain [JOINT_0]D
setp pid.0.bias [JOINT_0]BIAS
setp pid.0.FF0 [JOINT_0]FF0
setp pid.0.FF1 [JOINT_0]FF1
setp pid.0.FF2 [JOINT_0]FF2
setp pid.0.deadband [JOINT_0]DEADBAND

setp pid.1.Pgain [JOINT_1]P
setp pid.1.Igain [JOINT_1]I
setp pid.1.Dgain [JOINT_1]D
setp pid.1.bias [JOINT_1]BIAS
setp pid.1.FF0 [JOINT_1]FF0
setp pid.1.FF1 [JOINT_1]FF1
setp pid.1.FF2 [JOINT_1]FF2
setp pid.1.deadband [JOINT_1]DEADBAND

setp pid.2.Pgain [JOINT_2]P
setp pid.2.Igain [JOINT_2]I
setp pid.2.Dgain [JOINT_2]D
setp pid.2.bias [JOINT_2]BIAS
setp pid.2.FF0 [JOINT_2]FF0
setp pid.2.FF1 [JOINT_2]FF1
setp pid.2.FF2 [JOINT_2]FF2
setp pid.2.deadband [JOINT_2]DEADBAND

setp pid.3.Pgain [JOINT_3]P
setp pid.3.Igain [JOINT_3]I
setp pid.3.Dgain [JOINT_3]D
setp pid.3.bias [JOINT_3]BIAS
setp pid.3.FF0 [JOINT_3]FF0
setp pid.3.FF1 [JOINT_3]FF1
setp pid.3.FF2 [JOINT_3]FF2
setp pid.3.deadband [JOINT_3]DEADBAND

# create four position command signals

# connect position commands to motion controller
net Xpos-cmd <= joint.0.motor-pos-cmd
net Ypos-cmd <= joint.1.motor-pos-cmd
net Zpos-cmd <= joint.2.motor-pos-cmd
net Apos-cmd <= joint.3.motor-pos-cmd

# connect position commands to PID input
net Xpos-cmd => pid.0.command
net Ypos-cmd => pid.1.command
net Zpos-cmd => pid.2.command
net Apos-cmd => pid.3.command

# create bit signals to enable/disable the PID loops

# connect the signals to the motion controller
net Xenable <= joint.0.amp-enable-out
net Yenable <= joint.1.amp-enable-out
net Zenable <= joint.2.amp-enable-out
net Aenable <= joint.3.amp-enable-out

# connect the signals to the PID blocks
net Xenable => pid.0.enable
net Yenable => pid.1.enable
net Zenable => pid.2.enable
net Aenable => pid.3.enable

But i'm not an expert in this type of configuration...
  • rodw
  • rodw's Avatar
16 Jan 2025 07:56 - 16 Jan 2025 07:57
Replied by rodw on topic First Start Up - E Stops

First Start Up - E Stops

Category: General LinuxCNC Questions

Well, looks like you have
# --- ESTOP-EXT ---
net estop-ext     <=  hm2_7i96s.0.inm.00.input-03

so you should remove or comment out this line
net remote-estop estop-latch.0.fault-in <= hm2_[HOSTMOT2](7i96S).0.gpio.04.in_not
and replace it with this
net estop-ext  => estop-latch.0.fault-in
  • notJamesLee
  • notJamesLee
16 Jan 2025 04:06
Replied by notJamesLee on topic First Start Up - E Stops

First Start Up - E Stops

Category: General LinuxCNC Questions

okay so i went to that linked tutorial I commented out the existing estop loop and ended up actually testing code from the last entry on the first page (copied and pasted below) but modified with my pin for the estop.
Code i am using:
loadrt estop_latch addf estop-latch.0 servo-thread net estop-loopout iocontrol.0.emc-enable-in <= estop-latch.0.ok-out net estop-loopin iocontrol.0.user-enable-out => estop-latch.0.ok-in net estop-reset iocontrol.0.user-request-enable => estop-latch.0.reset net remote-estop estop-latch.0.fault-in <= hm2_[HOSTMOT2](7i96s).0.gpio.040.in_not



Now i am getting a similar error where it it thinks pins are double assigned. Should I have commented out other pin assignments? Or could i not be assinging the pin corectly? 
error message:
.hal:258: Signal 'a-pos-fb' can not add OUT pin 'hm2_7i96s.0.encoder.00.position'. It already has OUT pin ' hm2_7i96s.0.stepgen.03.position-fb' 2034
  • notJamesLee
  • notJamesLee
15 Jan 2025 06:10 - 15 Jan 2025 16:50
Replied by notJamesLee on topic First Start Up - E Stops

First Start Up - E Stops

Category: General LinuxCNC Questions

Thanks for the reply.

I added the code in the linked tutorial, does that bind it to a specific pin? It looks like the last line (below) assigns it to pin10? should I change this to the pin i have mine currently wired to? 
net remote-estop estop-latch.0.fault-in <= parport.0.pin-in10-not
The video so far is very informative and ill use it as a reference when im out working on it tomorrow but no info on how to daisy chain them. I assume since they're NC i can just wire them in series to one input pin? or is that a no-no? 
  • rodw
  • rodw's Avatar
15 Jan 2025 03:00
Replied by rodw on topic First Start Up - E Stops

First Start Up - E Stops

Category: General LinuxCNC Questions

The better way is to use estop_latch. There is a tutorial here
forum.linuxcnc.org/47-hal-examples/25861-external-e-stop
it is possible to daisy chain multiple estop_latch components together but its not documented anywhere
I found drawing a diagram of the connections helps to work it out.
Here is  video which may be useful

 
  • Benb
  • Benb's Avatar
29 Dec 2024 04:18

Physical safety relay and software estop latch working together?

Category: HAL

Hi Thomas,
For the block diagram conversion to Hal netlisting  I use Eagle2hal its documentated in lthe inuxcnc wiki (old but works for me). However if I had to start again I would learn Ed Nisley's Kicad to HAL the source code is in Python  also the Kicad people are planning to release a schematic API in their next release this would make it easy to make run time changes to the schematic capture and animate the schematic with realtime values.

gist.github.com/ednisley/cd69ad5a899226067d7a4a92c2114568
 
  • thomaseg
  • thomaseg
28 Dec 2024 09:19

Physical safety relay and software estop latch working together?

Category: HAL

The hardwired diagram shows two normally open contacts in series  KM1 AND KM2 indicating that the Estop is active. The rest of the circuit is similar to what you had in mind. Please do not add a screen (UI) estop or reset buttons; make it a habit to only use the external hardwired estop and reset push buttons otherwise you defeat the use of a safety system. The hal block diagram I use it to generate the hal file but it might help you understand what the hal net file does.

    

I like your diagrams, what do you use to make them?

I'm not 100% sure the above diagram will work exactly like this with my setup, however your input sparked an idea to solve my "circular dependency" problem between the software and hardware latches: I need to use a "oneshot"-component to connect the two latches instead of connecting them directly(and thereby creating the problematic circular dependency). Sounds obvious now, not sure why i didn't see that option the other day. So thanks for the input, i think i have a viable way to solve this now!

rodw post=317388 userid=20660
iocontrol.0.user-request-enable can be used as an estop reset signal (eg in place of S6). A short pulse is sent on this output for this purpose. I chose to just stick with the external reset button and connect to iocontrol.0.emc-enable-in, I used a relay on your S6 circuit to do this

Thanks! I couldn't wrap my head around this at first, but i think i got the gist of it now. I'll try to implement this short pulse and post the solution here for future reference.

​​​​​​​Thanks!
  • Benb
  • Benb's Avatar
27 Dec 2024 01:10

Physical safety relay and software estop latch working together?

Category: HAL

The hardwired diagram shows two normally open contacts in series  KM1 AND KM2 indicating that the Estop is active. The rest of the circuit is similar to what you had in mind. Please do not add a screen (UI) estop or reset buttons; make it a habit to only use the external hardwired estop and reset push buttons otherwise you defeat the use of a safety system. The hal block diagram I use it to generate the hal file but it might help you understand what the hal net file does.

 

#
# Load realtime Components and their counts

loadrt and2         count= 1
loadrt edge         count= 1
loadrt or2            count= 1

#
# Add functions to threads

addf and2.0         servo-thread 
addf or2.0            servo-thread 
addf edge.0         servo-thread 

#
# Set parameters

setp edge.0.in-edge          0
setp edge.0.out-width-ns   20000   

#
# Connect Pins with Wires

net external-ereset        and2.0.in0  
net external-estop         or2.0.in0  
net n.1                           or2.0.out  edge.0.in  
net n.2                           edge.0.out  halui.estop.activate  
net n.5                           halui.estop.reset  and2.0.out  
net soft-estop-active      halui.estop.is-activated  and2.0.in1  
net software-estop         or2.0.in1   
  • rodw
  • rodw's Avatar
26 Dec 2024 05:22

Physical safety relay and software estop latch working together?

Category: HAL

iocontrol.0.user-request-enable can be used as an estop reset signal (eg in place of S6). A short pulse is sent on this output for this purpose. I chose to just stick with the external reset button and connect to iocontrol.0.emc-enable-in, I used a relay on your S6 circuit to do this

If you want an internal estop and an external estop, multiple instances of estop-latch component should let you do this.
  • thomaseg
  • thomaseg
25 Dec 2024 21:44 - 25 Dec 2024 21:48

Physical safety relay and software estop latch working together?

Category: HAL

Hi,

I've been spending the last couple of days trying to figure out how to make the "software estop" work together with my safety relay. But i'm going in circles and i need a kick from someone, maybe you?

First off, i have this physical circuit to handle the emergency stop logic in hardware:
 
...the idea is that estop should work without any software involvement. And everything should be as redundant as could be. I have dual (safety) contactors(KM1 + KM2) that cuts power to all drives and at the same time prevents resetting the estop-circuit in cause of failure. I have a proper estop-button(it's redundant contacts, but only shown as one here in S5). On top of that i have added an inline relay, K13, which can be triggered by software, aswell as the wire "1" which goes to an input in LinuxCNC in order to tell it the state of the safety relay. There is a short delay(~0,5sec) between the two sets of relays in the safety relay, so ideally the signal to LinuxCNC should be able to tell the servos to emergency stop just before the power is killed. 

So far, so good. Everything works just like i want it. The latching works excellent and the signals to and from LinuxCNC also works as expected....

However, i'm totally going in circles when i try to add an estop latch inside LinuxCNC to work in conjunction with the hardware safety relay. I took inspiration from a thread from the user Unlogic  who seem to have it working. But i end up having a latch #1 that depends on latch #2 that depends on latch #1 again....ehh... so currently i'm just having the inputs tied into LinuxCNC like this:
net estop-loopout iocontrol.0.emc-enable-in    <= lcec.0.DI1.din-0     # This is the signal from wire "1"
net estop-relay   iocontrol.0.user-enable-out  => lcec.0.DO1.dout-3   # This is relay K13
..this "sorta works" and prevents anything powering on before LinuxCNC has booted properly. However the UI experience is kinda bad as i have to press a button extra and there is not really any feedback to the user :-(

SO, the question: Has anyone got a combination of a physical safetyrelay and an estop latch to work "like it should"? I'd be very interested in seeing how others have solved this issue...

/Thomas
Displaying 16 - 30 out of 42 results.
Time to create page: 1.016 seconds
Powered by Kunena Forum