Closed Loop Stepper Movement is Inaccurate
Primary Software: Driver Software>>NI-Motion/FlexMotion
Primary Software Version: 7.6
Primary Software Fixed Version: N/A
Secondary Software: N/A
Hardware: Motion Control>>Controllers
Problem: I have a closed loop system setup on my stepper motor to ensure that my movements are accurate; however, when I command the motor to move, it does not move to the appropriate location. Why is this happening?
Solution: This behavior can often be seen when the stepper motor has a higher resolution than the encoder (more steps per revolution on the motor than counts per revolution on the encoder). The reason this occurs can best be illustrated with an example:
Example Setup
- Stepper Motor
- NI Motion Controller
- A stepper motor with 200 steps per revolution
- An encoder with 20 counts per revolution
- MAX is set to do 3 pull-in moves
Open Loop Scenario
- The system is commanded to go to a position of 9.
- The controller sends out 9 pulses.
- The motor moves 9 steps.
- Since there is no feedback providing position data to the controller, it assumes that since it sent out 9 steps for the motor to move that the motor is in the correct position.
Closed Loop Scenario
- The system is commanded to go to a position of 9.
- The controller sends out 9 pulses.
- The motor moves 9 steps.
- The controller checks its position and sees that it is still at a position 0 because it has not received an encoder pulse yet.
- Because the controller thinks the motor hasn't moved (Still at position 0 because it hasn't received an encoder pulse), it commands the stepper to step 9 more times as its first pull in move.
- This causes the motor to move to a position of 18 steps from its original position.
- The controller checks its position and thinks that it is only at of position 10 because it has only received one encoder pulse (1 encoder pulse = 10 stepper steps).
- Because the controller thinks the motor is still at a position of 10, it sends 1 reverse step as its second pull in move.
- This causes the motor to move to a position of 17 steps from its original position. .
- The controller checks its position and thinks that it is still at a position of 10 because it has only received one encoder pulse.
- Because the controller thinks it is still at a position of 10, it commands the stepper to move 1 more step in the reverse direction in an attempt to get to a position of 9 as it's third and final pull in move.
- Finally the motor moves to its final position of 16 steps from its original position and stays there because it has completed all of the pull in attempts.
Below is an illustration of the Closed Loop Scenario:
Figure 1. Illustration of the Closed Loop Scenario
Because the controller does not compensate for what it perceives as position error in open loop mode, the motor always goes to the same commanded position. In closed loop mode, the motor is bouncing around inside a single encoder pulse trying to find a certain position.
There are several recommendations that can be made towards correcting this behavior:
Hardware Changes
Setup your system so that there are more encoder counts per revolution than steps per revolution. This could be done in one of three ways:
- Reduce the number of microsteps.
- Use a higher resolution encoder
- Use a lower resolution stepper motor
Software ChangesAll of these settings are at
Device and Interfaces»NI-Motion Devices»Default 73xx Configuration»Axis x»Axis Configuration»Stepper Settings.
- Turn off pull-in moves by setting the number of pull-in tries to 0 in MAX.
- Use an open loop configuration.
- Make the pull-in window smaller in MAX.
Related Links: NI Developer Zone: Stepper MotorsKnowledgeBase 27QARKOA: Stepper Motors will Work in Open Loop Mode, But Behave Incorrectly in Closed Loop Mode
Attachments:
Report Date: 05/02/2007
Last Updated: 05/09/2008
Document ID: 491HBUP9