Welcome to Our Community

Some features disabled for guests. Register Today.

Arduino Nano and Limit Switch inputs for Mach 3

Discussion in 'General Electronics' started by Ken Hall, Sep 1, 2022.

  1. Ken Hall

    Ken Hall New
    Builder

    Joined:
    Feb 23, 2015
    Messages:
    24
    Likes Received:
    3
    As many know Mach 3 is limited to 5 inputs. I use mine for E-Stop, Probe, Z home, X home, and Y home. My previous machine was a Gatton design made with 1 in ply, which was pretty forgiving if you ran into the end, especially with 13 mm lead screws. 8 mm lead screws don't laik you hitting the end, they bend, and sometimes they don't return to the proper straightness. I wanted limit switches for my X and Y-axis so I designed some software that when an LS was triggered, an E-Stop would occur, and as long as the switch was activated, the axis could not be moved, although E-Stop could be reset as it was only tripped for .25 of a second, the enable line to the stepper drivers was kept low to prevent going deeper into the end and finally possibly hitting a hard end. An enable toggle switch had to be switched as well as Mach 3's E-Stop being reset in order to move the offending axis(s), requiring operator intervention and protecting the machine from damage. The program worked perfectly on my desk and some solderless boards, but in the machine, not so good. First I had the E-Stop relay chattering its silly coils off, sounded like a locust at night. Solved that one by making common ground for all circuits. Then I had random trips of the E-Stop Relay, sometimes in a few minutes sometimes as long as an hour or more. I was monitoring 6 limit switches and even with all of them disconnected, this would happen. Replaced all wiring with shielded cables, added grounding to all parts of the machine, ie. extrusions and spindle motor, which should have already been grounded, but not the outside of it. Relayed out all the electronics, power supplies, and Arduino and added some terminal strips andI was finally able to run the machine for 8 hours in a test program that moved the X and Y-axis in all kinds of patterns and speeds.
    I used the Nano because I already had a breakout board for it, it is small and I had one of those too. The same program works on the Uno and Mega, so it did not matter which one, but where it fit was the decision maker.
    My electrical panel is a 1/2 in ply and has on it the VFD, two P/S's a buck converter, a UC100 and Breakout board combination, 4 stepper motor drivers, and the actual item that resolved the above problem an RC filter with a Schmidt inverter followed by a normal inverter as the Arduino was looking for a low on the input and I did not want to rewrite the code again as it worked. I hope this may help someone. The diagram is below.
    Input filtering for Debounce.jpg Red is +5 and Green is ground.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice