This content is not available in your preferred language.

The content is shown in another available language. Your browser may include features that can help translate the text.

Following Error in a Motion Control System

Updated Apr 18, 2023

Reported In

Hardware

  • PCI-7334
  • PXI-7332
  • PXI-7330
  • PXI-7348
  • PXI-7340

Software

  • Measurement and Automation Explorer (MAX)
  • LabVIEW Base

Driver

  • NI-Motion

Operating System

  • Windows

Issue Details

What is a following error, and how does it affect my motion application?

Solution

The controller (NI 73xx motion controller's family) compares the feedback signal to its commanded signal to verify that the motor is following the command. The difference between these values is called the following error.

Following Error showing up in MAX



Why does my application report that the following error limit has been exceeded when I command a move?

There is an adjustable limit to the allowed following error during a move. When the limit is exceeded, an error condition is created that reports a fault on this limit. A following error condition can be caused by any combination of mechanical defects, improper inputs/outputs, and control loop flaws. Although following error conditions can be difficult to debug, the most common causes are listed below:
  • Cause 1: Encoder input resolution is set incorrectly
To increase feedback accuracy, NI motion controllers read every edge of an encoder feedback signal. With a quadrature encoder, this results in four edges (rising and falling on lines A and B) for every quadrature pulse of the encoder. Thus, if your quadrature encoder is rated at 2000 quadrature pulses per revolution, the controller will actually read 8000 edges per revolution – and each of these is considered a count.​

If the polarity of your encoder is reversed, you can also switch the polarity in MAX. To change the polarity of your encoders, select the axis on which the problem is occurring and find the encoder entry. On the encoder tab change the polarity of either A or B, but not both and the index if it is being used.
  • Cause 2: Command or feedback wires are reversed
When a command is issued in the positive direction, does the feedback signal return a positive movement? If the feedback signal indicates negative movement, either the polarity of the analog output to the motor or the phase (A, B) of the encoder has been switched. Verify the proper wiring connections to remedy this situation. 

If the polarity of your encoder is reversed, you can also switch the polarity in MAX. To change the polarity of your encoders, select the axis on which the problem is occurring and find the encoder entry. On the encoder tab change the polarity of either A or B, but not both and the index if it is being used.
  • Cause 3: Improperly tuned PID loop in a servomotor system
Because NI servomotor controllers are designed for use in varied applications, the PID control loop must be configured for use in each specific situation. Properly tuning the loop (setting the Kp, Kd, Ki, etc. parameters) in MAX is necessary to ensure that the motor will respond as expected. If the system responds to a command by vibrating or moving erratically, the control loop may be out of tune. Considerations for tuning your motion system can be found in Understanding Servo Tune.
  • Cause 4: Commanding a move that is too fast
A very high-velocity move requires a responsive motion system. If high-velocity or high-acceleration commands regularly result in following error conditions, the motor/stage setup may be incapable of reaching the target velocity or acceleration. (Causes vary widely, and could include excess friction, misaligned mechanical parts, or insufficient motor torque.) It may be necessary to adjust the mechanical setup or command a lower velocity/acceleration.

Additional Information

NI 73xx motion controllers contain an on-board PID control loop that allows them to use position and velocity feedback to adjust their command signal. This feedback, read from either analog voltage or pulse-train encoder signals, indicates the actual position/velocity of the motor. 

When setting the Encoder Counts Per Revolution input in Measurement & Automation Explorer (MAX), it is common to mistake this value for the encoder's physical resolution. Instead, this setting needs to hold the corresponding number of counts read by the controller, which is four times that resolution.

Changing the maximum allowed following error 

In MAX, the following error can be set for each axis. To do this, go to Devices and Interfaces»PCI-73xx»Default 73xx Settings»Axis x»Trajectory Settings. Also, when commanding moves using the 1-D Interactive or 2-D Interactive​ screens in MAX, navigate to the Advanced tab at the bottom of the screen. In the Advanced Trajectory Parameters group, adjust the value labeled Following Error. When using the FlexMotion API for LabVIEW, use the Load Following Error VI to set the number of counts allowed.

When programming in C or Visual Basic, use the flex_load_follow_err function.