GRBL limit switch alarm problem

I choose NO switches.

Interesting, I just put two wires together and plug the pin, without switches connection and alarm start up.

I set
$5=0
$21=1
$22=1

They still alarm problem.

My CNC shield is smooth to control MPCNC but sadly, switches has problem :cry:

Why have you set$22=1? By enabling homing GRBL will enter alarm mode at boot up to force you to home the machine. If you do not make progress one step at a time you will never understand what is going on.

Set $22=0 and reboot the Uno. That’s me done.

Check my GRBl command 

Grbl 0.9j ['$' for help]
>>> $$
$0 = 10    (step pulse, usec)
$1 = 25    (step idle delay, msec)
$2 = 0    (step port invert mask:00000000)
$3 = 0    (dir port invert mask:00000000)
$4 = 0    (step enable invert, bool)
$5 = 0    (limit pins invert, bool) 
$6 = 0    (probe pin invert, bool)
$10 = 3    (status report mask:00000011)
$11 = 0.010    (junction deviation, mm)
$12 = 0.002    (arc tolerance, mm)
$13 = 0    (report inches, bool)
$20 = 0    (soft limits, bool)
$21 = 1    (hard limits, bool)
$22 = 0    (homing cycle, bool)
$23 = 3    (homing dir invert mask:00000011)
$24 = 25.000    (homing feed, mm/min)
$25 = 500.000    (homing seek, mm/min)
$26 = 250    (homing debounce, msec)
$27 = 1.000    (homing pull-off, mm)
$100 = 250.000    (x, step/mm)
$101 = 250.000    (y, step/mm)
$102 = 250.000    (z, step/mm)
$110 = 500.000    (x max rate, mm/min)
$111 = 500.000    (y max rate, mm/min)
$112 = 500.000    (z max rate, mm/min)
$120 = 10.000    (x accel, mm/sec^2)
$121 = 10.000    (y accel, mm/sec^2)
$122 = 10.000    (z accel, mm/sec^2)
$130 = 200.000    (x max travel, mm)
$131 = 200.000    (y max travel, mm)
$132 = 200.000    (z max travel, mm)
ok
>>> $G
[G0 G54 G17 G21 G90 G94 M0 M5 M9 T0 F0. S0.]
ok
An unexpected error was detected: ALARM: Hard limit
[Reset to continue]

Alarm is still error

In my experience, there are no $ configuration settings that will compensate for noise in the endstop circuits. I tried both maximizing the debounce value ($26) and enabling the software debounce in the config.h and recompiling and neither had an observable positive effect - I still saw the phantom triggered endstops using the $ command.

You have to solve noise at the hardware level. Shielded cables for the endstops is one possible approach. I’m using shielded cables, but my motor and endstop wires all run inside the shield together, so that’s probably contributing to my noise problem rather than mitigating it. My solution of slipping a 104 ceramic capacitor into each endswitch connector at the shield has been 100% effective since I put i in place over a week ago.

You can set $21=0 to keep the alerts from stopping you from working. You can also use the $ command on the console line to check the status of switches without enabling any of $20, $21, or $22 by setting each of them to 0. I’ve found that is the least annoying way to troubleshoot the issue, or to just work without endstops for a while. I’d send several (up to a dozen)$ commands in rapid succession and (without touching any of the switches) my Y and Z axes as well as my Z probe would sometimes show as tripped. While I would only see these sometimes with the $ command, the hard limit would trip every single time. This made homing impossible and soft limits ineffective.

Adding the capacitors completely solved my noise issue and allowed me to easily get hard limits, soft limits, homing and a probe all set up an operating reliably.

1 Like

Can you show me circuit picture or drawing how to install Capacitator on CNC shiels but I don’t get clear
Switches wiring system with noise prevent and it only show me Arduino without CNC shield.

I just slid the capacitor leads into the dupont connector. No soldering or crimping, no change to the board.

I suppose if you wanted to make it permanent you could solder a capacitor between each endstop pin and ground on the bottom of the shield.

I tried do this and still not work, and I think better use Min and Max and hard limit is active $21 only without use $20,$22,$23.

I cant wait to successfully to use MPCNC as soon and I hope so.

If you have noise in the end stop wiring, $21=1 is going to continually put the machine in an alarm state. Leave $21=0 and you should be able to run the machine with no problems.

I will say it again - You do not need endstops at all in order to use the machine. As long as your gcode commands don’t try to move things too far the job will run successfully. Even if the gcode moves things too far, the worst that will happen is your motor will skip steps. This actually happened to me when I ran my second crown - I started too far to the left and the x axis ran out of room. The motor skipped steps. so the carving ended up looking funny, but no damage was done to the machine. These stepper motors are not strong enough to bend conduit or break the belts or plastic pieces.

1 Like

I wonder that is good idea, if I add red LED and replay to help protect stepper motor and belt, if roller hit switch then red light switch on and the stepper motor will switch off when replay is active, if I see red light on and then I go check computer to fix and make sure correct of control with MPCNC.

You can certainly try an alternate protection technique like that, but again, I think you’re investing a fairly large effort to protect against a very small risk. Have you tried running the machine to its physical limit and seeing what happens? On mine the belt stretches a little (maybe 1 mm) then the motor starts skipping steps, which means the pulleys no longer turn, so theres no damage to the pulley or the belt or the printed parts of the machine. Just a sort of clunking noise from the motors, but no damage there either.

Many programs will allow you to do a “dry run” or “air cut” keeping the tool above the workpiece and moving the machine though the cut program as a test. This lets you be sure you’ve got the work in a place where the job will run without exceeding the machine’s movement envelope. Just another way to be comfortable running without endstops.

If you decide to try the relay, don’t put it between the stepper motors and their drivers. Disconnecting the motor when the driver is active will almost certainly permanently ruin the driver chip.

Many people (myself included) have an emergency stop on their machines. Exactly what stops depends on how you wire this switch. The grbl shield provides pins for what it calls an e-stop button, which resets the arduino uno. I did not use this. My e-stop button cuts off all electricity into the controller and machine, killing the spindle, arduino, stepper motors, and 2 accessory relays, same as if I were to pull the power cord out of the wall. I havent had to use it while a job was running, but I have tested it and I know when i hit it everything will stop.

I never felt the need to hit the e-stop when, before i got my noise problem fixed, the machine reached its limits of movement and started losing steps.

Another quick comment about safety. You cannot trust any machine with a spindle running at 20-30,000 rpm unsupervised. There are stories on these forums and numerous videos on the web of spindles crashing into workpieces and friction from the collet starting fires literally in seconds. All those chips make excellent kindling, and things escalate terrifyingly fast.

I’ve run several 3D printers, and am not worried about leaving the room while they run. I don’t leave the house, but will get a snack, use the restroom, answer a phone call, etc. I don’t currently have a webcam on any of them but am considering adding one so i can have a longer leash while big jobs run for hours.

I will never leave the room while the MPCNC is running a job. The job gets paused and the spindle turned off if I need to leave it alone for any reason for any length of time.

That’s a risk I just wont take. I have smoke alams and a nice big fire extinguisher on the shop wall right next to the door. I still won’t trust this machine (or any spindle or laser cutter) unsupervised.

2 Likes

After a near fire while sitting with my machine it happens that fast. I never go anywhere while its running

I found Alarm problem, it is from Stepper motor wires near to end stop pin that cause alarm, I think wrap the paper foil to the wires for end-stop switches and stepper motor.

that is good idea?

You’re basically making your own shielding that way. If it works for you, great. The endstop wires could be picking up the noise from anywhere along their length so you might not get results just shielding near the board. Personally, I would also be worried I would accidentally short something if the foil is exposed.

Hello @ttraband and everyone.

I found inside store room has bit problem with electricity, When I walked with
barefoot and go to store room, I start to test MPCNC and I touched metal case square of front the USB and I get little bit shock on my finger.

I put digital meter’s negative pin on top USB’s metal case and and I hold Positive pin with my hand, the meter showed me 105 Volt AC with small current output, that is mind blow.

The plug or main circuit breakers of store room don’t have an earth to protect from shock.

I realized that is big problem with CNC shield, i will call to Electricity Repair come to check.

1 Like

Maybe it wasn’t noise effect’s fault,

Interesting. I hope they get your wiring sorted out and into a safe condition.

1 Like

I’d where rubber soled shoes till it was fixed for sure

1 Like

Electricity done repair and he said earth cable was missed and he put new one.

So shock is gone now, I try all switches but it still error and it always showed me false alarm message and there are nothing solve and CNC shield is not good maker.

I decide put all switches connection E-Stop pin because there are no alarm error.

I want to know how to set CNC home without switches?

Glad to hear your wiring is sorted out. Sorry it didn’t resolve the noise problem in the endstop wiring.

The eStop pin on the CNC shield is wired to the restart button of the Arduino. I don’t think you want your endstops resetting the microprocessor.

When running a CNC job, the job itself uses “work coordinates.” Limit switches establish “machine coordinates.” There are some tasks (tool changes, cutting multiples of the same job in a set of fixtures) where machine coordinates are helpful, but they are not needed to run a job.

To run without endstops, first make the following configuration changes to grbl:
$20 = 0 (disable soft limits)
$21 = 0 (disable hard limits)
$22 = 0 (disable the homing cycle)

You could also set $5 and $23 = 0 but that’s really just returning them to the “out of the box” defaults. They won’t have any effect on your work. Nor will $24-27.

By default, when the grbl controller starts up it begins in an alarm state. You can modify this by recompiling the firmware, but you can also just start each session by “unlocking” the machine. In cncjs there’s an “Unlock” button for this at the top right of the screen. You can also send $X from a console to kill the alarm lock. The machine should now be ready to move, using gcode commands or the buttons in your control software.

From here on out, you should be able to follow the instructions in the Docs sections.

Load the gcode into your gcode sending program. Install and secure the workpiece to the machine.

You’ll need to tell the controller the location where you want the job origin (X=0, Y=0 and Z=0) to be. This needs to be set relative to where you’ve physically attached the workpiece in the machine. Most often the job origin is set to the left hand corner (minimum X travel) nearest the front of the machine (minimum Y travel) of an imaginary box inside of which all the cuts are made, and with the tip of the tool just touching the top surface of the workpiece. Once the tool is in the desired origin position, execute the command
G92 X0 Y0 Z0.
This will set the work coordinate origins for all 3 axis to the current position. You can also do this one axis at a time, if needed. For example, after changing tools you may want to get the new tool touching a the top surface of the workpiece and send G92 Z0 to reset the Z origin without changing X or Y. Once the origin is set, you can move the machine around however you like, but when you start the job all instructions will be run relative to where the job origin was set.

The Crown gcode that Ryan has built as a test is a good example of this. When you load the gcode in a gcode sender that includes a preview, you can see that none of the lines in the crown touch the origin, but all moves are relative to the job 0,0,0 coordinates. Ryan has also included the G92 command in his pre-built gcode. This is not universal practice, as folks have their own preferred methods for setting up and starting their jobs. Options include telling the software you use to generate gcode for your jobs to include the G92 command, setting up macro buttons in your gcode sender, or doing it manually.

Once you’ve got the workpiece fixed in place and the origin set, you may want to move the tool up a little bit then move the machine to the extents of X and Y motion within the job (many gcode senders display this information) to be sure all the moves are completely within the mechanical limits of the machine before starting the job. This is sometimes referred to as an “air cut.” If something is out of whack, you figure that out without ruining a work piece.

Good Luck!

1 Like