Emergency stop
Every CNC system should have an emergency stop. CNC machines are often very
powerful, and can do serious harm to people in a second. The emergency stop
should be easy to reach, and should stop the machine as soon as possible.
Different emergencies require different best approaches. The emergency stop
is the system designed to stop a machine in its tracks as soon as possible.
This is mainly designed for the case where the machine moves in an unexpected
way and there's a risk of causing harm to an object or person. Other scenario's,
like a fire hazard, require a different approach like cutting the power.
Cut all power
The most common e-stop for home CNC boards are simple "cut all power" buttons.
In essense, you wire the e-stop to your main power supply, and once hit, it
will kill the power to the board, steppers and motor.
While cutting all power is a good idea, it is not necessarily the best approach.
Cutting power means that your spindle and motor will stop based on inertia,
which can take a while. Steppers will also loose all power, which implies
that the force of the spindle alone might move the machine. While being able to
cut the power is a good idea, there are better options for emergency stops.
Controlled stop
A controlled stop is often the best approach. A controlled stop means that
the firmware will attempt to stop the machine in its tracks as soon as
possible, and notifies the VFD (or other spindle controller) that the spindle
should stop as soon as possible and hit the brakes.
If the spindle has a braking resistor attached, stopping the spindle can be done
very quickly. If not, VFD's can still force a controlled stop faster than
using simple inertia.
Wiring
All boards have a fast input for emergency stops. Wiring the GND and STOP
pins to a button is sufficient for an e-stop.
Configuration
The pin that is often used for an e-stop is the "reset pin". The reset pin
triggers a firmware reset. A firmware reset is the best approach for a
controlled stop, because the first thing the firmware does is initialize
the spindle at zero speed (effectively braking as fast as possible) and
stop all steppers (Motors will stay engaged if your idle_ms value is 255).
control:
safety_door_pin: NO_PIN
reset_pin: gpio.16
Users should assume that a reset will loose the position of the machine.
Basically this implies you need to re-home when a reset is triggered.
Combination with cutting power
Reset could be used in parallel with a true e-stop. Combined with a timed
relay, you can cut the power after a few seconds to ensure the machine
and everything related is powered down after a controlled stop.