Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

Following error in closed loop stepper control with 7340

Hello
I am using a PCI-7340 to control a 1-axis stepper motor, using a Primatics drive. When running in open-loop mode, the positioning is smooth and accurate. When I run in closed loop mode, there is a large (up to 1500 unit) following error, and the stepper makes large jumps at the end of each move to compensate for this. This even happens when using MAX to perform 1-d interactive mode.
The stepper is 6400 steps per revolution, and the optical encoder I am using is 600 counts across A/A-and B/B-, and so has 2400 pulses per revolution.
I can command an open-loop movement of 6400 steps, and each time the encoder counts 2400 pulses, even at very fast speeds, so I am not missing encoder pulses and the encoder is wired in the correct direction.
So why would I suddenly have large following errors when I switch to closed loop mode? Also, it seems to run half the velocity (only going 500 steps/s when commanded to go 1000 steps/s) in closed loop, when in open loop it was the correct velocity (this shows up on the Misc Plots graph)
 
Thank you

Data Science Automation

CTA, CLA, CLED
SHAZAM!
0 Kudos
Message 1 of 3
(4,616 Views)
 

It looks like you have already done most of the troubleshooting but please verify that you have really done everything that is described here:

Title:   
Stepper Motors Work in Open Loop Mode, But Do Not in Closed Loop with Encoder Feedback

Problem:   
I can command my motion controller to move a stepper motor to a target position in open loop mode. When I configure it to run in closed loop mode, the motors behave strangely and never move to the target position. Why is this?

Solution:
   
These are some other symptoms you might see:

  • Motor moves to a position in one direction, then moves in the reverse direction, toggles between two positions 3 times, and eventually stops.

  • Motor moves to a position, then moves in the same direction 3 times and eventually stops.

  • Motor moves in one direction and an error occurs.

Here are some troubleshooting tips for these problems:

  1. Verify that the correct values for stepper and encoder resolution are entered in Measurement and Automation Explorer. You can find the stepper resolution under Axis Configuration >> Stepper Settings and the encoder resolution under Encoder Settings. If you are not sure what the "steps per revolution" value should be, you can configure the stepper motor to run in open loop mode. You can then move the stepper motor until it has turned one revolution. You can enter the total number of steps for the Stepper "Steps Per Revolution" value under Axis Configuration. To figure out what the "encoder counts per revolution" value should be, you can configure the axis for closed loop stepper mode. Press "Kill," which should de-energize the axis. Then turn the motor shaft one revolution to get the encoder counts per revolution.

  2. Verify that the phases of the encoder are correct. To test this, swap phase A and B of the encoder.

  3. Verify that the encoder is working properly. Use an oscilloscope to make sure that both phases of the encoder are generating a pulse train.

Note: Closed loop steppers work differently from closed loop servos. Instead of adjusting the output on each PID iteration like a servo system, closed loop steppers will do a pull-in move at the end of a move to adjust for any difference between the target position and the encoder feedback. By default, it will attempt the pull-in move three times. This can be adjusted to any number between 0 and 32,767 using the SetU32 VI in LabVIEW or the flex_setu32 function in C/VB with the "Pull-in Tries" attribute.
This text is from a knowledgebase article that is currently taken from the web for review.
If these hints don't help please check if there is a gear between the motor and the encoder. In this case you would have to take into account the gearing ratio when entering the steps/rev and counts/rev settings.

Please also make sure that you are using the latest NI-motion version which can be found here.

I hope this helps,

Jochen Klier
National Instruments Germany

 
Message 2 of 3
(4,605 Views)
Thank  you Jochen,
It seems that the problem was coming from having the second encoder on that axis enabled in MAX, after disabling the second encoder, closed loop operation worked fine.
So it was either that, or the case that is equally frustrating to user and tech support that it "magically started working"....
 
Cheers!

Data Science Automation

CTA, CLA, CLED
SHAZAM!
Message 3 of 3
(4,590 Views)