Not sure if this info will help others or not - I’m gradually getting the limit switch thing closer to a resolution. Much of the info below is from another thread on the same subject.
On my machine (1000x1000 X Carve) I’ve installed additional limit switches, so I now have a switch on each end of both the X and Y axis and a single switch on the top of the Z axis. These are all Normally Open switches, wired in parallel pairs (the two X switches in parallel and ditto for the two Y switches)
Using Easel (through the Inventables site) I ran the Machine setup program which (for me) was the easiest way to “enable” the homing switches in GRBL. I’ve no doubt there’s probably a simple command for doing this via Universal Gcode Sender (UGS), however I’m all for taking the simple path wherever possible.
The advantages of using Easel to set up Homing is that it has a series of test sequences which allows you to
- Enable homing
- Test each switch
- reset the homing direction if it’s wrong etc
Having enabled homing, I can now use the “$H” homing command to home the machine (ignore the “”)
I then set up “Soft Limits” by
- Homing the machine to find X0, Y0, Z0
- Using the “jog” feature in UGS (arrow keys on my keyboard) to move each axis to what I considered as its safe maximum travel and then recording the X, Y and Z position for each.
- Entering each soft limit via the UGS command line (“$130=790” for the X axis, “$131=790” for the Y axis and “$132=80” for the Z Axis - without the inverted comma’s of course). GRBL should respond with “ok” after entering each command. Note these limits are all unique to my machine - yours WILL be different.
- These settings are confirmed by sending the $$ command - GRBL will respond with a list of all current settings where you’ll be able to check your entries have been added.
I then enabled “Hard Limits” in GRBL by sending the “$21=1” command (GRBL should again respond with “ok”)
- Now when I manually “jog” the machine along an axis to the point where one of the limit switches is closed, the machine will stop and generate an alarm.
- To reset this alarm, I have to manually move the machine away from the offending limit switch, reset the alarm (“$X”) and re-set the machine (“Soft Reset” in UGS)
Note I’ve only played with this briefly - there may be a better way to reset the alarm.
So to summarise, I’ve now got:
- Homing enabled - the command $H will send the machine to 0, 0, 0,
- Soft Limits are enabled - This means the controller will not accept commands the exceed the maximum limits set for each axis, in theory, avoiding crashing into the end axis for X, Y and (sometimes) Z
- Hard Limits are now enabled - If I manually move an axis too far, the machine will stop & generate an alarm
- Important note - the Z axis “soft limit” will be pretty much useless unless you use the same tool and tool length every time. Anytime you put a longer tool into the machine, you’ll either need to reset the limit, or just make sure you’re not likely to cut into your table/waste-board
Is this the final setup - certainly not. I’ve already had problems with false alarms due to noise issues with the switch wiring (I did use shielded cable for the new switches, but I’ve not yet connected to the controller - I assume this would go to ground, but that’s TBA). I’ll shortly be adding a DeWalt unit to replace the current tiny spindle, so I’m kinda hoping that running the power cable for this separately will reduce the noise a little also. Finally, I’m exploring the option of waiting in a capacitor & some additional resistors to reduce noise even further.
For reference, see here for a list & description of some of the GRBL commands and what they do Configuring Grbl v0.9 · grbl/grbl Wiki · GitHub
For interest, below are a couple of images on how I fitted the additional switches - not the neatest or best option, however it suited some of the restrictions I have with the way I’ve configured my machine.
Please also excuse the somewhat crude table set-up I’m using at the moment which is an odd combination of T Slot channels, threaded holes and multi-piece wasteboard. I’ll get around to something better when I stop tinkering…