- Configuring LinuxCNC
- Basic Configuration
- Adding external switch for emergency stop and feed override
Adding external switch for emergency stop and feed override
- suraj9735
-
Topic Author
- Offline
- Senior Member
-
Less
More
- Posts: 77
- Thank you received: 1
05 Jul 2025 01:01 - 05 Jul 2025 01:03 #331290
by suraj9735
Adding external switch for emergency stop and feed override was created by suraj9735
Dear LinuxCNC User,
I have bare minimum code of .ini and .hal file that perfectly working for single axis linear stage. Now, I want to add two switches one for emergency stop and another for feed override. I am planning to use pin 0 for emergency stop and pin 1 for feed override of Mesa 7i95 board.
Kindly provide the necessary pieces of code that need to be added in .hal and .ini file. explain the logic of the connection because I am not an expert of editing the .hal file.
The wiring I am planning for these switches are following..
either 0 or 5 volt to pin 1 using external DC power supply (I don't have switch currently but will buy it soon)
Continuous Analog voltage from 0-5 volt at pin 2 using another DC Power supply
GND, 0 volt at pin 3, because it is common ground for pin 0 and pin 1.
I am using linuxcnc 2.9.2
Thanks.
I have bare minimum code of .ini and .hal file that perfectly working for single axis linear stage. Now, I want to add two switches one for emergency stop and another for feed override. I am planning to use pin 0 for emergency stop and pin 1 for feed override of Mesa 7i95 board.
Kindly provide the necessary pieces of code that need to be added in .hal and .ini file. explain the logic of the connection because I am not an expert of editing the .hal file.
The wiring I am planning for these switches are following..
either 0 or 5 volt to pin 1 using external DC power supply (I don't have switch currently but will buy it soon)
Continuous Analog voltage from 0-5 volt at pin 2 using another DC Power supply
GND, 0 volt at pin 3, because it is common ground for pin 0 and pin 1.
I am using linuxcnc 2.9.2
Thanks.
Last edit: 05 Jul 2025 01:03 by suraj9735.
Please Log in or Create an account to join the conversation.
- Benb
-
- Offline
- Elite Member
-
Less
More
- Posts: 171
- Thank you received: 58
06 Jul 2025 18:34 - 06 Jul 2025 18:37 #331405
by Benb
Replied by Benb on topic Adding external switch for emergency stop and feed override
My understanding, you would like to add a hardware estop and potentiometer to set feed override to your Mesa 7i95.
Since I have never configured a 7i95 I used Microsoft AI Copilot to generate add ons to hal and ini. see attached.
A quick scan of the 7i95 manual did not show any reference to an analog input, you may need to open a new discussion in the board interface section of the forum and see if there is a custom file that can convert one of 7i95 pwm pins to accept 5v analog input.
Note if you encounter errors when testing ask copilot for help, it seems to be well trained with linuxcnc configuration.
Since I have never configured a 7i95 I used Microsoft AI Copilot to generate add ons to hal and ini. see attached.
A quick scan of the 7i95 manual did not show any reference to an analog input, you may need to open a new discussion in the board interface section of the forum and see if there is a custom file that can convert one of 7i95 pwm pins to accept 5v analog input.
Note if you encounter errors when testing ask copilot for help, it seems to be well trained with linuxcnc configuration.
Last edit: 06 Jul 2025 18:37 by Benb.
The following user(s) said Thank You: suraj9735
Please Log in or Create an account to join the conversation.
- PCW
-
- Offline
- Moderator
-
Less
More
- Posts: 18955
- Thank you received: 5236
06 Jul 2025 21:26 #331413
by PCW
Replied by PCW on topic Adding external switch for emergency stop and feed override
The 7I95/7I95T has no analog input so an encoder is probably a better choice
( Using either a high speed encoder or a MPG on the isolated inputs )
Another possibility is to add a 7I73 which has analog/encoder/keypad support
( Using either a high speed encoder or a MPG on the isolated inputs )
Another possibility is to add a 7I73 which has analog/encoder/keypad support
The following user(s) said Thank You: suraj9735
Please Log in or Create an account to join the conversation.
- suraj9735
-
Topic Author
- Offline
- Senior Member
-
Less
More
- Posts: 77
- Thank you received: 1
07 Jul 2025 09:09 #331439
by suraj9735
Replied by suraj9735 on topic Adding external switch for emergency stop and feed override
Update,
I have successfully added the emergency stop button. The problem was with the Mesa 7i95 board's nomenclature used for input/output pins. I was using the wrong pin (hm2_7i95.0.gpio.000.in). The correct input 00 pin for the Mesa 7i95 board is inmux 00 pin (hm2_7i95.0.inmux.00.input-00). Below is the code added to the hal file...
net estop-out iocontrol.0.user-enable-in
net external-estop-in hm2_7i95.0.inmux.00.input-00 => iocontrol.0.emc-enable-in
The next problem is still pending about the feed override.
Thank you, Benb and PCW, for your input. You are correct that I want to control feed override using external analog voltage control (cRIO-9045, NI-9775, LabVIEW Software). I have never modified the Mesa default pin configuration, and I am trying to search for how to modify the Mesa board pin configuration. It would be great if I could use the motor or encoder pin for analog input. I request that you give me more ideas/references to do the same. As PCW suggests, "The 7I95/7I95T has no analog input, so an encoder is probably a better choice." Kindly give more hints on how to use the encoder to control the feed override using external analog voltage control (cRIO-9045, NI-9775, LabVIEW Software)
Another idea I am thinking about is serial communication using the serial port available in the Mesa board; there are two serial communication ports (serial 1, serial 2). But at the moment no idea how to do this as well.
Another thing I was trying to identify was the pin/parameter that is responsible for feed override. In Axis GUI, there is a button for feed override, but I am not able to locate the corresponding pin and parameter in the Halshow Configuration window. I do locate one pin, but it is saying it is not writable. A screenshot is attached.
Thanks
I have successfully added the emergency stop button. The problem was with the Mesa 7i95 board's nomenclature used for input/output pins. I was using the wrong pin (hm2_7i95.0.gpio.000.in). The correct input 00 pin for the Mesa 7i95 board is inmux 00 pin (hm2_7i95.0.inmux.00.input-00). Below is the code added to the hal file...
net estop-out iocontrol.0.user-enable-in
net external-estop-in hm2_7i95.0.inmux.00.input-00 => iocontrol.0.emc-enable-in
The next problem is still pending about the feed override.
Thank you, Benb and PCW, for your input. You are correct that I want to control feed override using external analog voltage control (cRIO-9045, NI-9775, LabVIEW Software). I have never modified the Mesa default pin configuration, and I am trying to search for how to modify the Mesa board pin configuration. It would be great if I could use the motor or encoder pin for analog input. I request that you give me more ideas/references to do the same. As PCW suggests, "The 7I95/7I95T has no analog input, so an encoder is probably a better choice." Kindly give more hints on how to use the encoder to control the feed override using external analog voltage control (cRIO-9045, NI-9775, LabVIEW Software)
Another idea I am thinking about is serial communication using the serial port available in the Mesa board; there are two serial communication ports (serial 1, serial 2). But at the moment no idea how to do this as well.
Another thing I was trying to identify was the pin/parameter that is responsible for feed override. In Axis GUI, there is a button for feed override, but I am not able to locate the corresponding pin and parameter in the Halshow Configuration window. I do locate one pin, but it is saying it is not writable. A screenshot is attached.
Thanks
Please Log in or Create an account to join the conversation.
- suraj9735
-
Topic Author
- Offline
- Senior Member
-
Less
More
- Posts: 77
- Thank you received: 1
07 Jul 2025 15:37 #331453
by suraj9735
Replied by suraj9735 on topic Adding external switch for emergency stop and feed override
Update,
Earlier, the HALUI was not loaded, so I was not able to find the feed override pin in Halshow. Now I have added the section for HALUI and the corresponding pin (halui.feed-override.value) of the feed override is visible in Halshow. But this pin is OUT direction, which means not writable or can not change its value for testing in Halshow only. Attached is one image of the pins available under the feed override tree. I am looking for a pin that takes input and changes the feed override. kindly help! Or share the sample .ini and .hal files for the same purpose
Earlier, the HALUI was not loaded, so I was not able to find the feed override pin in Halshow. Now I have added the section for HALUI and the corresponding pin (halui.feed-override.value) of the feed override is visible in Halshow. But this pin is OUT direction, which means not writable or can not change its value for testing in Halshow only. Attached is one image of the pins available under the feed override tree. I am looking for a pin that takes input and changes the feed override. kindly help! Or share the sample .ini and .hal files for the same purpose
Please Log in or Create an account to join the conversation.
- PCW
-
- Offline
- Moderator
-
Less
More
- Posts: 18955
- Thank you received: 5236
07 Jul 2025 17:57 #331470
by PCW
Replied by PCW on topic Adding external switch for emergency stop and feed override
If you use an encoder for feed override, the counts would connect to:
halui.feed-override.counts
halui.feed-override.counts
Please Log in or Create an account to join the conversation.
- Configuring LinuxCNC
- Basic Configuration
- Adding external switch for emergency stop and feed override
Time to create page: 0.128 seconds