All Articles / Application Notes

Controller Feature: Stall Detection and Recovery

By Stephen Hunt, Firmware Team

Published on Sep. 08, 2022

Introduction

In a perfect world motion systems would always move exactly as instructed. But in reality, motion systems have physical limitations - they can only respond so quick or move so fast. When a motion system runs up against its physical limits, it will fail to keep up with the planned motion trajectory and stall. So, it is important for high performance motion systems to be able to detect and respond to stalls.

Stall Detection

To detect a stall, which is simply a prolonged deviation from the planned trajectory, Zaber products use position encoders to measure the deviation. As such, only products with a position encoder can detect stalls.

What Zaber controllers will consider a stall is configurable. It is defined by

  • The cloop.timeout setting, which determines the minimum amount of time the axis must be considered stalled before it is reported and acted upon by the controller, and
  • a criterion to determine whether an axis is stalling at a particular point in time.

All electro-mechanical systems, including Zaber's products, have some unavoidable amount of damping that limits how fast they can respond to any force, so it is normal for them to deviate slightly from a planned trajectory for a short period of time. This is what cloop.timeout accounts for. However, after a certain amount of time it becomes increasingly likely that the deviation from the target position will grow, at which point the controller needs to respond to prevent undesired or damaging behaviour.

The stall criterion depends on the type of motor the controller is driving. On stepper motors the criterion is determined by the cloop.stall.detect.mode setting. It defines two different criteria for a stall:

  • In mode 0, a stall is registered when an axis fails to move towards its target.
  • In mode 1, a stall is registered when the encoder-measured position error, encoder.pos.error, exceeds the tolerance defined by cloop.stall.tolerance.

On direct drive (linear motor or voice coil) products, the stall criterion is not configurable. Instead, a stall is registered after a moving axis fails to keep up with the motion trajectory despite the motor applying maximum drive effort.

If an axis satisfies the stall criterion but for a period shorter than cloop.timeout, it is not reported or acted upon by the controller.

Stall Recovery

In many cases, Zaber products can recover from a stall and continue towards the target. This is true for most move commands. If an axis did recover from a stall, it will be indicated with the WS (Stalled with Recovery) warning flag.

This recovery behaviour can be disabled by setting cloop.recovery.enable to 0. In which case, the controller will stop the axis, set the FS (Stalled and Stopped) warning flag, and blink the blue LED in response to a stall. The setting cloop.stall.action configures whether the axis will try to stop instantly (with infinite acceleration) or in a slightly slower and more controlled manner.

There are some situations in which the controller's recovery options are very limited. Notably, during streamed motion and sinusoidal motion the axis will stop in response to stalls, even if cloop.recovery.enable is enabled. If that happens, at least one of FS (Stalled and Stopped) or FP (Interpolated Path Deviation) warning flags will be set, depending on the situation.

Stall Prevention

If an axis is stalling you can consider some of the following corrective strategies:

As always, please contact us if you require any assistance setting up your Zaber product. We will be happy to help.