How to make the USB I/O turn off relays on M30 or Estop?

More
7 years 9 months ago - 7 years 9 months ago #124926 by jwatte
If I understand these proposals correctly, I need to change or update the PathPilot implementation to detect these changes and update the output relay state.

I'm hoping for a solution that doesn't require me to re-apply it after each update to the PathPilot software.

It sounds like the least-bad solution for me would be to start a new process that polls the existing HAL pins, and applies the appropriate M codes to send the commands to the relays, when it detect changes in the HAL pins. This, then, leads me to my next question, in another topic in this thread, about how PathPilot decides what processes to start, and how I can make it start some new file that I "drop into" the installation. (It's still something I need to remember to do, but at least it doesn't modify files in place at that point. I could even have a shell startup job that auto-installed it if not present.)

forum.linuxcnc.org/pathpilot/35890-how-d...ython-files-to-start
Last edit: 7 years 9 months ago by jwatte.

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

More
7 years 9 months ago #124930 by andypugh
No.

Updating Pathpilot won't change your HAL files, those are your config and should be left alone by updates to LinuxCNC.

The and2 logic will go in the HAL file, it isn't a change to the software itself, just a re-routing of the signals from G-code to the IO board.

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

More
7 years 9 months ago #124933 by PCW
Maybe a better solution is in hardware (only supply power to the USB output relays if out of ESTOP), then even a complete PC crash would turn off the outputs...

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

More
7 years 9 months ago - 7 years 9 months ago #124935 by smgvbest
In the Pathpilot postgui hal file the USBIO pins are defined as
Code:
# USBIO net usbio-enabled tormach.usbio-enabled => usbio.enabled net dig-out-0 tormach.usbio-output-0 net dig-out-1 tormach.usbio-output-1 net dig-out-2 tormach.usbio-output-2 net dig-out-3 tormach.usbio-output-3 net dig-out-4 tormach.usbio-output-4 net dig-out-5 tormach.usbio-output-5 net dig-out-6 tormach.usbio-output-6 net dig-out-7 tormach.usbio-output-7 net dig-out-8 tormach.usbio-output-8 net dig-out-9 tormach.usbio-output-9 net dig-out-10 tormach.usbio-output-10 net dig-out-11 tormach.usbio-output-11 net dig-out-12 tormach.usbio-output-12 net dig-out-13 tormach.usbio-output-13 net dig-out-14 tormach.usbio-output-14 net dig-out-15 tormach.usbio-output-15

I'm not the best with hal command but couldn't you take the ESTOP and use a AND to cause one of the dig-out-# lines to includes the estop

There is also what might be a point in the UI where M30 is checked for to rewind the gcode window. you may be able to inserts a MDI command to do what you want with a relay there. may not be ideal but as mentioned M30 is not a remapped code.
Last edit: 7 years 9 months ago by smgvbest.

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

More
7 years 9 months ago - 7 years 9 months ago #124938 by andypugh

smgvbest wrote: In the Pathpilot postgui hal file the USBIO pins are defined as

Code:
# USBIO net usbio-enabled tormach.usbio-enabled => usbio.enabled net dig-out-0 tormach.usbio-output-0


So, edit that file to look like
Code:
loadrt and2 count=16 addf and2.0 servo-thread addf and2.1 servo-thread addf and2.2 servo-thread addf and2.3 servo-thread addf and2.4 servo-thread addf and2.5 servo-thread addf and2.6 servo-thread addf and2.7 servo-thread addf and2.8 servo-thread addf and2.9 servo-thread addf and2.10 servo-thread addf and2.11 servo-thread addf and2.12 servo-thread addf and2.13 servo-thread addf and2.14 servo-thread addf and2.15 servo-thread net running halui.program-is-running net running and2.0in0 and2.1.in0 and2.2.in0 and2.3.in0 net running and2.4.in0 and2.5.in0 and2.6.in0 and2.7.in0 net running and2.8.in0 and2.9.in0 and2.10.in0 and2.11.in0 net running and2.12.in0 and2.13.in0 and2.14.in0 and2.15.in0 net dig-out-1 and2.0.in1 net dig-out-1-latched and2.0.out => tormach.usbio-output-0 net dig-out-2 and2.1.in1 net dig-out-1-latched and2.1.out => tormach.usbio-output-1 net dig-out-3 and2.2.in1 net dig-out-1-latched and2.2.out => tormach.usbio-output-2 net dig-out-4 tand2.3.in1 net dig-out-1-latched and2.3.out => tormach.usbio-output-3 net dig-out-5 and2.4.in1 net dig-out-1-latched and2.4.out => tormach.usbio-output-4 net dig-out-6 and2.5.in1 net dig-out-1-latched and2.5.out => tormach.usbio-output-5 net dig-out-7 and2.6.in1 net dig-out-1-latched and2.6.out => tormach.usbio-output-6 net dig-out-8 and2.7.in1 net dig-out-1-latched and2.7.out => tormach.usbio-output-7 net dig-out-9 and2.8.in1 net dig-out-1-latched and2.8.out => tormach.usbio-output-8 net dig-out-10 and2.9.in1 net dig-out-1-latched and2.9.out => tormach.usbio-output-9 net dig-out-11 and2.10.in1 net dig-out-1-latched and2.10.out => tormach.usbio-output-10 net dig-out-12 and2.11.in1 net dig-out-1-latched and2.11.out => tormach.usbio-output-11 net dig-out-13 and2.12.in1 net dig-out-1-latched and2.12.out => tormach.usbio-output-12 net dig-out-14 and2.13.in1 net dig-out-1-latched and2.13.out => tormach.usbio-output-13 net dig-out-15 and2.14.in1 net dig-out-1-latched and2.14.out => tormach.usbio-output-14 net dig-out-15 and2.15.in1 net dig-out-1-latched and2.14.out => tormach.usbio-output-15
Last edit: 7 years 9 months ago by andypugh.
The following user(s) said Thank You: jwatte

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

More
7 years 9 months ago - 7 years 9 months ago #124979 by jwatte
Thanks for the suggestions! I'll compare this to the "status polling Python" option, and see what I come up with.

FWIW, the "configs" live in the v2.1.6/configs/tormach_mill files, and each new update creates a new v2.x.y directory and re-links the "tmc" symlink to that new directory. Perhaps the updater copies over the old configs verbatim? We shall see.
Last edit: 7 years 9 months ago by jwatte.

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

Time to create page: 0.058 seconds
Powered by Kunena Forum