Low voltage limit/home switch configuration

  • Autumn Reign
  • Away
  • New Member
  • New Member
More
29 Nov 2025 19:18 #339444 by Autumn Reign
Low voltage limit/home switch configuration was created by Autumn Reign
I have finally gotten my first LinuxCNC machine homing! It is a XXYZA machine. I am quite happy with my progress and everything I have learned. The machine appears to be holding tolerances well while jogging and I am very excited to start running gcode here shortly. 

However, I am getting an oddity with my home switches while homing. It's a low voltage system for signals and having spent a lot more time with all of this I realize that a 12 or 24 volt communication voltage and some daughter cards would have kept some of my troubles in the realm of programming and less in the realm of electrical engineering. I have a 6i25 running to a bank of CL86Y's and 4 functioning home switches (XYZA) from 0V to GPIO pins that are normally closed, one for each axis. I think I am making some sort of pullup/pulldown or other fundamental signal error in my home switches.

With my attached hal/ini configs while homing if I start with switches depressed everything homes great. X and A homing are disabled while I am playing with settings but they work when enabled. Halshow shows my switches working as expected. Diag goes "yellow" when the switch is hit and resumes "red" when released. Sometimes I have seen an unexpected flicker, and the shielded wire is not yet grounded. All other cables are shielded and grounded so I think EMI is minimal, but I will be grounding the shield shortly regardless. However, if I start off of switches the axis will pulse forward and then stop after a move of no even length and throw an error about not being on a switch when backing up, as if it was transitioning from search_vel to latch_vel.

I don't mind starting the machine homing by hand, but I am concerned my home switches are triggering the 6i25 IO while I would be normally operating. This seems like it cannot be a great thing to be doing, but maybe it would not be relevant. 

If you have any suggestions to get more reliable performance, I would appreciate leaning on all of your experience. 

File Attachment:

File Name: Autumn_2025-11-29.ini
File Size:6 KB

File Attachment:

File Name: Autumn_2025-11-29.hal
File Size:15 KB
Attachments:

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

More
29 Nov 2025 20:41 #339448 by rodw
You have not said what voltage you are using.
The rationale behind 24 volts being more or less standard for industrial systems is that it is more resistant to triggering from noise because a much greater voltage fluctuation is required to trigger false readings.

I think you have already diagnosed the issue.
Also using an industrial power supply like a Meanwell MDR-60-24 won't break the bank. I have lost count of people reporting issues when they use 5 volt plug packs...

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

  • tommylight
  • tommylight's Avatar
  • Away
  • Moderator
  • Moderator
More
29 Nov 2025 21:11 #339453 by tommylight
Replied by tommylight on topic Low voltage limit/home switch configuration
some examples form my machines, see on the right side a row of 3 relays, those are for inputs and they isolate the machine part from electronic part, so less interference and no need for good shielded cables (i can no find good cables here):
forum.linuxcnc.org/show-your-stuff/38547...uild?start=30#165873
Or the "arduino" relays as seen here
forum.linuxcnc.org/show-your-stuff/38547...ild?start=110#172157

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

  • Autumn Reign
  • Away
  • New Member
  • New Member
More
30 Nov 2025 02:15 - 30 Nov 2025 02:27 #339468 by Autumn Reign
Replied by Autumn Reign on topic Low voltage limit/home switch configuration
5V. GPIO without modification, Mesa default voltage with an inherent 3.3v swing. It's triggering my steppers well doing a 5v to 1.7v swing from high to low. You can see in my configs how I am doing inverted output to get clean steps with sinking vs sourcing. I don't have space in the box for another PSU and the daughter cards, and I am out of time to putz with an ideal solution.

I'm mostly asking if I've done something dumb from a code perspective, and if there is a good way to be more reliable with voltage swing. If my configs are correct I can swap to 5V source and invert my sink/source and be just as voltage tolerant as my step generation.

Professionally I use 3.3v signal logic with a 2.5v swing near amperage's that are an order of magnitude higher than here. I'm a little surprised to see the default as "just go for higher voltage" as my training has more leaned towards isolation being optimal. Again, I am out of my depth on this topic for CNC control so any disagreement or confusion is entirely intended to be constructive and for the purpose of learning.
Last edit: 30 Nov 2025 02:27 by Autumn Reign.

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

  • Autumn Reign
  • Away
  • New Member
  • New Member
More
30 Nov 2025 02:26 #339469 by Autumn Reign
Replied by Autumn Reign on topic Low voltage limit/home switch configuration
Yeah, nice relay/opto isolation is how I have now learned is a way better way to be doing this. Those exact arduino relays are what I use in some of my home IoT projects that I have started months after this CNC was begun.

I've applied some topics I have explored at work that involved signal analysis and curve best fit at 400KHz sample rates and very low voltage and taken some bad conclusions from that in the design of this machine's controls.

My main priority with this post is to confirm that I am not doing something dumb with my ini/hal and that my errors are from voltage latching oddities and not code. I can explain purchases and delays to my wife if I made a mistake, it's a little harder to justify when I only think I have made an error :)

Thanks for your insight.
The following user(s) said Thank You: tommylight

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

Time to create page: 0.066 seconds
Powered by Kunena Forum