Comment on page
Stall detection aims to prevent VEX Motors from overheating or tripping a Resettable Fuse by detecting high-current stall conditions in software.
Current sensing is the industry-standard method of detecting abnormal motor conditions. By inserting a small-valued resistor (typically 10-100 milliohms) in series with the motor and measuring the differential voltage across it, the current through the motor can be measured. High currents indicate a large power draw that will eventually trip a fuse or overheating sensor. Neither the VEX Cortex FETs nor the VEX Motor Controller modules have current sensing resistors available, so this method is generally infeasible for use in the VEX Robotics Challenge.
A less invasive way of measuring current stems from the fact that a current-carrying wire produces a magnetic field. By passing the motor wire in close proximity to a sensor which can detect small changes in magnetic field direction (a Hall-effect sensor), the current flow can be determined. This method measures current indirectly, so it does not influence the power delivered to the motor and should be legal for use in an actual competition; however, the magnetic fields generated by running motors can also influence the reading.
Perhaps the most logical method of detecting a stall would be to monitor the shaft rotation rate and detect when it is not rotating using a VEX Shaft Encoder. While simple, possible problems emerge, as the level of rotation that constitutes a stall is not well-defined. In addition, when running a motor at a low PWM duty cycle or using active braking, periods of slow to no rotation are expected. Therefore, code using this method generally cannot trip instantaneously and must adjust the definition of a stall according to the current output PWM duty cycle.
Since VEX motors have a relatively consistent power curve due to the internal gearing, an attached encoder could be used to infer the current draw, given the current output speed and PWM level.
An interesting alternative for stall detection comes from the use of the backwards electromotive force, or Back-EMF, generated by the motor while it is not being powered. This method briefly disconnects motors from power a few times per second and measures the voltage across the motor terminals; as the motor coasts on inertia, it generates a voltage corresponding to its rotation rate. Stalled motors will have little to no Back EMF voltage, while fast-spinning free run motors or motors on heavy mechanical assemblies will generate more. As this method provides approximate odometry information as well, it can be used in the same way as the rotation rate sensing method to detect stalls.
Voltage sensing is passive and is connected in parallel with the motor, so it may be legal for use as an external sensing device.