Hey, I'm new here and I'm looking for help on my cnc router limit switches because I don't really know what I'm doing. I built my very first cnc router this summer and it is working now. I have the CNC shield 3.0 and I'm running GRBL 1.1. Only the limit switches does not work. I first did it with the NO configuration and it did work. Then I wanted to go NC instead since that's the better way to go. In the picture you can see how I wired the switches, for all axis 2 nc switches in series, connecting to x+, y+ and z+ on the shield. When I set hard limits on and try to jog any of the axis I get an instantaneous alarm. I have tried tried inverting the limit switches by switching $5. Any help will be highly appreciated! -Meyer
Check the continuity of your wires and switches? NC limits throws an error if your wiring has a break, that's why it's considered best practice (as well as grounded wires being theoretically somewhat less noise-prone). Of course if it breaks in such a way that it shorts to ground, that's no help. You want $5=1, so that grbl interprets 5V as limit active (because the pullup resistor is still functional, and NC means the signal pin is normally grounded) Also try connected directly to the Arduino without the shield.
And if it its a fake shield (better to support Protoneer the creator) keep in mind the fakes are Grbl 0.8 pinout (Protoneer sells the correct shield) and on Grbl 0.8 Z Limit and Spindle pwm swopped placed in Grbl 0.9 already so you got to wire the Z limit to one of the spindle pins (i dont have the exact ones on hand as i'd rather support the creator, but that should be enough to go look for the differences from)
Thank you for your responses. I have checked the continuity of the wires, in the setup wizard it shows that all the limit switches work fine. Also I measured 5v on the shield pins so I'm guessing it it fine. And it is a fake shield as I bought it from banggood. I had to disable the variable spindel from the library to get the z limit to work. This issue seems quite stange to me because the limit switches seem to work, when I activate one of the switches it sets the alarm off but for some reason the alarm sets off as soon as I try to move any of the axis. Also, I got one more problem. When the router makes its first retraction from the model origin to the start point it does not retract in the retraction height. Instead it goes down to the first milling layer of the first milling operation and retracts in that height, inside the work piece. I make my nc programs in fusion and there is no setting for the first retraction. I probably could edit the g-code manually but thats not really a solution to the problem but rather a bypass. Got any advice for that?
It does a G53 Z-10 move Your Z should home upward so that G53Z-10 is at the top just before hitting the switch. G53 = Machine coordinates
Ok so is the problem the machine makes the first retraction in a height that is defined by the machine home coordinates that I have not set? If so how does the machine define its origo if there is no home? I made another nc code for the same piece with fusion and now it retracted like 20mm above the stock. It seems a bit random.
Homing sets machine coordinates. The randomness comes from "where was Z when Grbl last reset" (which you can use to fake homing by parking z high, then resetting, but you have limits right so enable homing, better of the two)
Machine coordinates are defined by your home switches. When you have no home switches, it's pretty much wherever the machine is when you turn grbl on- if you jog to one top corner and reset grbl you've "faked the home". Your working coordinate system (WCS, usually G54) origin is defined wherever you want it to be, as an offset from your G53 origin. There are several G-codes to set, adjust or probe in your WCS. In theory, your Z home switch is at the top of the axis, almost as far up as it can travel before crashing into the end of the rail. That's where the post processor is assuming it is. As far as I'm aware, CONTROL hides the G53 coordinate system and only shows you current WCS coords, so you can't really see how one interacts with the other or when G53 is reset properly. Theoretically to avoid confusing newbies, but it just seems to be more confusing dealing with a coordinate system they can't even see- you're not the first to post about it. Maybe an optional show/hide G53 window somewhere, Peter? Obviously the best option is to get your homing working. Personally I'd flip back to NO, run shielded wire and ceramic 104 caps and be done with it.
Thanks, very helpful information! You were right about the switches, it is a noise problem. I just confirmed it by shorting out the x+, y+ and z+ limit pins and the machine worked. When I released one of the shorts it stopped and gave an alarm, as it should. Im going to add some capacitors and see if that helps.
I put some capacitors to the limit switch wires and shortened the wires as much as I could and the limits are working now. I set the home and it works also. Everything on the machine works now as it should, thanks a lot for helping me out!