I would like to know how to connect GPIO to LinuxCNC’s E-Stop chain.

More
19 Nov 2025 01:46 #338681 by EdWorks
My SetupRaspberry Pi 5 8GBByte2Bot Parallel Port Raspberry Pi HatByte2Bot 5 Axis CNC Interface Adapter Parallel Breakout Board For Stepper Motor DriversPicture 1My wiring is as follows:Picture2

The motors move, the home switches register as functioning, the probe is not hooked up and the eStop appears to do nothing.From LinuxCNC V2.9.7 Documentation PDF Page 1854.9.3.7 External ESTOP button The standard_pinout.hal file assumes no external ESTOP button. For more information on an external E-Stop see the estop_latch man page.Yet from 2 pages earlier in LinuxCNC V2.9.7 Documentation PDF Page 183 I see this line in the HAL file:# create a signal for the estop loopbacknet estop-loop iocontrol.0.user-enable-out iocontrol.0.emc-enable-in I assume “man page” is a typo and this is unnecessary if I am trying to connect it to  GPIO25. A search of the document looking for “estop_latch” only reveals this on page 254Picture 3So my estop is on pin10, but that is GPIO25 on the Pi 5. I must refer to it as such.In my .Hal file I have the following lines:loadrt hal_gpio inputs=GPIO7,GPIO8,GPIO25,GPIO12,GPIO13 outputs=GPIO5,GPIO6,GPIO11,GPIO9,GPIO10,GPIO23,GPIO16,GPIO17,GPIO19,GPIO20,GPIO21,GPIO22,GPIO24,GPIO26net estop-out   <= hal_gpio.GPIO25-in  ornet estop-ext <= hal_gpio.GPIO25-in Using tools I can identify that all my limit switches are being read, but I have nothing to suggest the estop is being read.I have added“Addf gpio-input servo-thread” as recommended by ChatGPT, and that is not read by the programThe advice I am looking for is:
I would like to know how to connect GPIO25 to LinuxCNC’s E-Stop chain.I have tried:

net estop-out hal_GPIO.GPIO25.out => iocontrol.0.emc-enable-inand any variation thereof I could think of, failed.Eventually, I lost control of my servos and only when I removed all lines I gained control of F1, which controls the estop and F2, which powers the servos. 
Attachments:

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

  • tommylight
  • tommylight's Avatar
  • Away
  • Moderator
  • Moderator
More
19 Nov 2025 01:53 #338683 by tommylight
Stop posting new topics with the same question and tittle.

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

More
19 Nov 2025 02:00 #338685 by unknown
Undo everything ChatGPT suggests and never ever use it again for anything related to Linuxcnc.

Far better to visit this thread
forum.linuxcnc.org/47-hal-examples/25861-external-e-stop#26684

You may have to invert the estop signal, as when you press the estop you are providing a 0v signal. You may also need to check whether the inputs to the estop are tied hi or low when the Estop is pressed.

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

More
19 Nov 2025 02:00 #338686 by EdWorks
I'm not sure what norm I have violated?

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

More
19 Nov 2025 02:03 #338687 by unknown
There were 2 new threads submitted by yourself with the same heading.

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

More
19 Nov 2025 02:06 #338688 by EdWorks
Yes, I have a jaundiced view of ChatGPT but I try to exhaust my resources before coming here.
I will check the link.
If you would like to read the question as formatted, check here:

acrobat.adobe.com/id/urn:aaid:sc:VA6C2:0...f2-9441-faf83de82c31

Thanks.

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

More
19 Nov 2025 02:11 #338689 by unknown
Come here first.

Too many times users have received info from chatgpt that make absolutely no sense.

Google searching for "linuxcnc estop latch" gives the link above as the 4th result.
Or you could use the search function of the forum.

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

More
19 Nov 2025 02:11 #338690 by EdWorks
Ahh, no discernible action when I hit SUBMIT the first time. I can wait it out in the future.

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

More
19 Nov 2025 02:31 #338694 by EdWorks
If I use the following code which has the one missing dash error that I corrected:

# estop
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 <= parport.0.pin-in-10-not

The bug-a-boo for me is how do I tie the GPIO25 to the remote-estop. Do I change the last line to:
net remote-estop estop-latch.0.fault-in <= hal_gpio.GPIO25-in-10-not

?

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

  • tommylight
  • tommylight's Avatar
  • Away
  • Moderator
  • Moderator
More
19 Nov 2025 03:10 #338696 by tommylight
Depends on what the machine has for an e-stop chain and that is wired, but for small machines that can not do much harm, a simple and single input and a single output are all that is needed:
# --- ESTOP-EXT ---
net estop-ext <= [HMOT](CARD0).7i84.0.2.input-14
net estop-ext => [HMOT](CARD0).7i84.1.1.output-08
That will just loop back the e-stop signal from the button to whatever is connected to the output pin. This works perfectly well on most machines (example is from my 3.5 ton Mazak lathe) as the output is wired to existing e-stop loop on the machine.
That will not allow the machine to come on when the button is pressed and will allow enabling the machine when button is reset.
E-stop latch should be used only when more logic is required by LinuxCNC, and/or more inputs and outputs.

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

Time to create page: 0.116 seconds
Powered by Kunena Forum