Cannot connect limit switches on pins 9 10 and 12 arduino

Got a real mystery here. I decided to upgrade my CNC Router with closed loop steppers. Using an Arduino Uno 3 with grbl 1.1, closed loop drives and motors controlled with UGS. There are two N.O. switches in parrellel on each axis.
If I enable hardstop ($21=1) I get the typical Error and Alarm message in UGS.
I unplugged the switches and still happens.
I ohm'd to ground - nothing.
I moved the Arduino outside the control box figuring Noise.
Only if I remove the switch connections to pins 9. 10, and 12 can I run.
So for chuckles and grins I took a 6" wire, stripped one end and when I touch it to pins 9, 10, or 12 I get the alarm! I don't get it. Maybe an Excorsism?
Not comfortable running my cnc without Hardstops.

No code, no schematic, nothing to look at here. Nothing that anyone could even begin to use to try to figure the problem.

Are you looking for help? Or just for someone to commiserate?

3 Likes

That is a wise decision.

Your problem is not unexpected, and your wiring may be the root cause. Since hardware is involved, it’s crucial to provide an accurate, annotated schematic of your circuit as it is currently wired. Please note that Fritzing diagrams are not considered proper schematics; they are wiring diagrams and are often not helpful for troubleshooting.

What You Need Yo Post:

  1. Start With An Annotated Schematic: Show all connections, including power, ground, and power sources. This helps us understand how your circuit is set up and identify any potential issues.
  2. Links To Technical Information: Provide links to technical documentation for each hardware device used in your setup. Avoid links to sales sites like Amazon, as they usually lack the necessary technical details. We need complete specifications to help you effectively.
  3. Additional Information Needed: If the above details are incorrect, more information is required. Tell us what hardware and software you are using, the format of any data (like map data), and how your system determines its position. For example, if your project involves a robot, describe how it navigates and what computers are involved.

Why Do We Ask:

We have no way of knowing the specifics of your setup unless you provide that information. Clear and detailed descriptions enable us to offer the most accurate help possible. Without these details, it’s difficult to diagnose and solve the issues you're experiencing.

2 Likes

Gilshultz,
So appreciative that you responded to my issue. I spend a disproportionate amount of my time troubleshooting via Email and phone on industrial machines with customers around the world. Correct information is critical. Too often people say they checked what I asked but for some reason they didn't which ends up taking numerous Emails and phone calls but eventually it comes out that they didn't. Ugh!! Hate that.
Good news and bad news..... Good news is your reply and questions helped me corner the issue. You spoke about grounding and wiring so it led me to focus on that so I went ahead and disconnected everything to the Arduino then connected one wire at a time until the fault occured, which was when I connected the Pulse+ and Direction+ from the stepper drive(s). If I kill the 48vdc power supply to the drivers I can leave everything connected and have no Fault but as soon as I hit the Power ON switch I get a fault. So the bad news is I have a serious EMI issue.
If you can offer a sound and robust solution, lay it on me. If it helps I left attachments that I intended to send you had I not isolated the problem. The "CNC Schematic" is a tad crude but it represents what I have done for my Sainsmart CNC router. I gutted the control and repurposed the case by adding a 48vdc power supply (for the stepper drivers), the Arduino UNO, three closed loop stepper drivers along with 3 closed loop nema 23 stepper motors. I am using the PWM output from pin 11 to a PWM 0-10volt booster to a VFD to run a spindle. I use a Dell laptop windows 10 with UGS to control the CNC router.
Notes:

  • Commons/Grounds - Nowhere are the Arduino Commons connected to the case or chassi. The shields for the encoder harnesses are connected to the case. The case is grounded to the AC outlet.
  • Also notice that on the Stepper drives that the COM and PUL- and DIR- are all jumpered together.......something I picked up on YouTube.
  • I downloaded GRBL 1.1 (at least I think I did). On all the on-line directions on how to exactly add it to the Arduino IDE Library, I could not download it the same way. First I unzipped the downloaded file, then carrot to GRBL file but then I had to zip its contents. Only then would it load. Arduino DTE simply would not let me load a file unless it was a "zip file". In any case at least it loaded into the library then to Arduino UNO. Strange is when I open my UGS, and select "Firmware" all these others pop up (below) that I have never seen before. That is why I say "I think" I have GRBL 1.1. Whatever I have, my router runs just fine.

Kind regards,
John Agliata

(Attachment Arduino pin assignments.docx is missing)

(attachments)



CL57T Full Datasheet Closed Loop Stepper Driver.pdf (1.21 MB)

I'm glad to hear you're making progress. One suggestion: try using external pull-up resistors for the switches, as the internal ones in the Arduino aren’t very strong. I prefer about 1mA through the contact, based on past experience where we needed that much current to keep the contacts clean, otherwise, we used dry-switching devices.