DIY CNC Mill - Random Limit Switch Errors

More
23 Dec 2025 15:51 #340423 by zippoffs
Hello, I'm new to the forum. I have spent the past year and a half building my own CNC mill that runs on LinuxCNC, and it is mostly done now. Except that I can't get it to finish a program because it keeps thinking that the limit switches have been triggered even though they haven't.

I built this mill from scratch. It is made entirely of aluminum plate and extrusions. It has NEMA23 closed loop steppers, SFU1204 ballscrews, HGH20CA linear rails, a 2.2kw 220v 3 phase spindle and 2.2kw VFD, a "5 axis" parallel port breakout board, a Dell OptiPlex 990 with a parallel port card and running LinuxCNC (obviously). For limit/home switches I have it set up to where one limit switch doubles as a home switch, and all six switches are normally closed and in series all going to one input pin. The limit switches are generic micro switches, and the limit/home switches are Metrol CS067B. I have 24V running through the switches, so I'm using a 24v to 5v optocoupler board to bring the signal down to 5v for the breakout board. The Metrol switch wires are not shielded, but because they cost $67 a piece, I don't want to mess with that. The wires for the other switches are shielded.

This is what happens when I try to run a program: I home the machine, import the program into Axis, hit run, and it could be 1, 5, or 60 seconds later that it suddenly stops the machine because a limit switch was supposedly hit. It doesn't seem to happen consistently. I originally had the VFD next to the other electronics in a copper mesh cage, but ended up making a sheet metal box for it and moving it away (and took the spindle cable out of the cable chain that also held other wires). I thought that would prevent any EMI from interfering with the other electronics. But that didn't fix it. I have narrowed it down to an issue between the spindle/VFD and the breakout board. I can run a program perfectly fine with everything on except for the spindle/VFD, so it can't be the steppers or drivers. I have tried running 24v directly to the optocoupler board, bypassing the switches, but it still triggers. I have tried completely bypassing the limit switch circuit by jumping the input pin on the breakout board to ground, and it still triggers. I have spent hours researching this, and I have tried almost everything. I have my VFD in a Faraday cage. I'm using a shielded spindle cable with the shielding grounded at both ends. I have the signal wires shielded and grounded. I don't know what I'm doing wrong.

I have spent weeks trying to diagnose this, and now I am only more confused. Part of the problem is that I'm only 18 and I'm not an electrical engineer (I'm not even a mechanical engineer yet!), and I'm learning a lot of this for the first time. I have run out of things to try, and I would really appreciate any help I can get. Thank you in advance!
Attachments:

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

More
23 Dec 2025 20:26 #340433 by tommylight
Replied by tommylight on topic DIY CNC Mill - Random Limit Switch Errors
Interference issues, as seen on your second picture where the high voltage/power stuff is very close to parallel port/BOB, and messy wiring.
First make sure the grounding is OK, then move low voltage stuff as far from high voltage stuff as possible, use short cables, no spaghetti! :)

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

More
23 Dec 2025 21:34 #340440 by zippoffs
Replied by zippoffs on topic DIY CNC Mill - Random Limit Switch Errors
I probably do need to go through all my grounding. However, everything functions properly if I run the program with the VFD turned off. So I don't think there is interference coming from the stuff right by the breakout board. But I have the VFD in a faraday cage, and the spindle cable shielding is grounded at both ends. What more can I do to contain the interference? Or do I need a faraday cage around the breakout board?

Do the 220v lines going from the breaker box to the VFD also emit interference?

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

Moderators: piasdom
Time to create page: 0.047 seconds
Powered by Kunena Forum