The purpose of a door safety switch is to prevent users being exposed to the laser beam while the laser is in operation. The swich is mounted on the lid, and so is sometimes called a lid switch. If a person opens the lid then the controller will halt its operation and shut down the laser beam. Closing the lid and pressing resume (either within the software interface or the physical resume button) will continue the laser operation.
To install a door safety switch, you need to wire up a microswitch to the pins as shown on the drawing below. To restart the laser, the resume function waits a few seconds (dwell time) before resuming. This originates from its CNC heritage, where a system waits for the spindle to be ready.
If you have Mini Gerbil firmware update 12353 or beyond, you’ll need to configure $97=1 to enable the safety door switch.
Technically speaking you could perform a similar function to the controller based door switch (below) by wiring the pause button as a door safety switch, but that’s not covered in this blog.
In GRBL, adding a safety lid feature is done via a NC microswitch. NC stands for normally closed at rest (with no pressure on the switch). Since we mount the NC microswitch on the K40 chassis near by the lid, the lid will press the micro switch when the lid is closed, so the contacts will be open when the lid is closed. When a user opens the lid, the micro switch is released and goes into its NC state closing the contact.
This GRBL implementation of the door safety switch is counter to standard industrial safety design. So think of it more like a convenience reminder than a true safety feature. In a robust safety design, if the safety circuit itself becomes open-circuit, the dangerous element will be locked out. This design recognises that when wiring faults occur, they’re more likely to cause open circuits than closed circuits. The most likely reason that GRBL chose not to implement the standard industrial safety design is because many GRBL users don’t want to use a safety lid switch, and the non-standard avoided presenting those users with a safety alarm lockout until the user implemented a lid switch (or at least a short circuit). Having said that, the whole idea of implementing a safety switch via a microcontroller and firmware is counter to standard industrial safety design anyway – safety hates complexity. So the better solution is to simply utilise Option 1 below.
If you’d prefer to use the standard safety design, there’s a few options:
- design your own safety switch circuit independent of the controller. This could utilise a Normally Open (N.O.) contact on the limit switch in series with the laser enable switch on the front panel, the emergency stop switch or the WP (water protect) terminal of the power supply. When the lid opens, the terminals are open, and the laser cannot fire. Ensure you don’t switch mains voltage through the safety switch – this would introduce risk of electrocution should the wiring degrade.
- wait until a GRBL firmware update makes the safety design configurable
- design a DIY circuit to invert the signal between the lid switch and the Mini Gerbil. A theoretical downside is accidental disconnection of the circuit from the Mini Gerbil and this would deactivate the safety feature.
- there may be a mechanical solution – if somehow the switch can be installed such that the switch is pressed in when the lid is opened. But don’t make anything fancy (which could go wrong) and thus provide a false sense of security.
Assuming you’re happy with the non-standard safety design, back to the current GRBL design: The wiring is simple – the micro switch NC pin goes to the safety door pin on the Mini Gerbil and micro switch Common in goes to ground on the Mini Gerbil. The Safety Door and Ground pins are on break out connectors called J1 and J2. Make sure that you bundle the wiring neatly together and away from the laser output and return line (high tension cables also known as high voltage). Also keep the lines away from the mains AC wiring so it does not pickup any noise signals.
Aim to use KK254 Molex type connectors or similar (example from Australian retailer Jaycar https://www.jaycar.com.au/4-pin-0-1-header-with-crimp-pins-2-54-pitch/p/HM3404) The pitch is 2.54mm. Farnell and Element14 and RS online have them as well. (Molex, KK 254 Female Connector, 2.54mm Pitch, 4 Way, 1 Row)