Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

Minimizing PCI-7344 Velocity Error

I am setting up a 3 phase bdcm with 4096 count incremental encoder to be controlled by a PCI-7344.
 
I my particular application I want to go constant velocity of 40 RPM and I need as accurate a velocity as I can get.
 
The best I can achieve right now is approximately 2.5% velocity error (speed fluctuates between 41 and 39 RPM).
 
I have two questions:
 
1.  How can I best optimze the PCI-7344 axis for the most precise velocity control?
 
2.  What is the best velocity error percentage I can expect with this configuration?
 
Thanks,
 
Joe
 
 
0 Kudos
Message 1 of 15
(6,103 Views)

joe,

"1.  How can I best optimze the PCI-7344 axis for the most precise velocity control?"

Make sure you have tuned your PID control loop as best as possible.  Below is document which talks about how to tune your control loop.

Understanding Servo Tune

"2.  What is the best velocity error percentage I can expect with this configuration?"
 
This really depends on the system you are trying to control and how well your servo has been tuned.  I really can't tell you if your RPM can be more accurate than 39 to 41.  It really depends on your system (how powerfull you motor is, how much inertia is in the system, the dynamics of the system, the drive you are using, etc. etc.).
 
I would look at the following document...
 
10 Essential Technologies for High-Performance Motion Control

Pay close attention to section 10:Advanced Feedback Techniques

Also, there are a control loop constants like Feedforward Gains, Velocity Feedback Gain, etc. that might help increase the accuracy of your velocity.

Lorne Hengst
Application Engineer
National Instruments

Message 2 of 15
(6,087 Views)
Joe,

depending on your mechanical setup you may also consider the usage of a secondary feedback device that is mounted behind a gear or transmission to provide better velocity control. This is also described in the "Understanding Servo Tune" document that Lorne has added as a link to his posting. I just want to stress this feature as it can reduce velocity errors effectively if there is any kind of backlash in your system.

In any case you should tune the system conservatively as a system that is tuned very stiffly will result in more or less signification oscillations in the velocity profile, even if the control loop is far away from being unstable.

Best regards,

Jochen Klier
National Instruments Germany
0 Kudos
Message 3 of 15
(6,076 Views)
Thank you both for your replies.  I wanted to clarify what I am really trying to do here and get your feedback once more.
 
1.  I need to run the motor described in the original post in both position mode and constant velocity mode.  In position mode, I need to be able to drive to any encoder position to within 1 encoder count.  In velocity mode, I will need to to 40 RPM with a tolerance of 0.05 RPM maximum.
 
2.  When initially configuring this system, I anticipated being able to use the PCI-7344 for both position and velocity control.  In actuality, the PCI-7344 works perfectly for positioning but I was not able to achieve any where near the 0.05 RPM tolerance I need for speed.  I went through both the AutoTune function of NI-Motion and manually tuned per the Servo Tuning white paper you mention.  I even tried connecting the encoder incremental signals to another encoder channel on the PCI-7344 card and using that as secondary velocity feedback.  (there is no gearing or exernal loading in my system, just a motor driving an encoder)
 
3.  To prove the motor/encoder was capable of meeting a speed tolerance of 0.05 RPM, I configured my motor drive for velocity mode and fed the incremental encoder signals into the drive itself for velocity feedback (analog velocity loop).  When the drive was manually commanded for 40 RPM in this mode, I was able to obtain speed variation on the order of 0.02 RPM.
 
From these test results, I have come up with a couple of possible conclusions:
 
1.  I have something set up wrong that is causing the PCI-7344 velocity mode operation to not work properly.
 
2.  The PCI-7344 is primarly closing a position loop, and doesn't contain the capability to have a seperate independent velocity mode loop.
 
I am trying to figure out which of these two conclusions is true or not true.  (maybe both are wrong).  At this point, I am using only NI-Motion to configure the PCI-7344.
 
What I ultimately need is to be able to command from a computer that the motor either run a specific velocity (within about .12%) or that the motor drive to a specific position and hold to within 1 encoder count.  If the PCI-7344 can't provide this performance, then I am leaning to replacing both the PCI-7344 and my current brushless motor drive with a more sophistocated motor driver that can be commanded by the computer directly over RS232 or ethernet.
 
If you can offer any guidance as to how I might get the PCI-7344 to operate in such a way to meet these requirements, I would appreciate it.  In order to work correctly, I think I will need a dedicated velocity loop for the system when running in velocity mode.  The PCI-7344 doesn't seem to have this capability.
 
Thanks,
 
Joe
 
 
0 Kudos
Message 4 of 15
(6,068 Views)
Joe,
 
Well...  Good questions, good comments, fun problem.  If I were to tell you right now that you should be able to control your Servo well enough to achieve 40 RPM with +/- 0.05 error, I would be lieing.  Why, because I have never tried it before.  So, before I stick my foot in my mouth and overpromise the 7344, I think I will need to see if I can't achieve this kind of accuracy myself.
 
You said...
"there is no gearing or exernal loading in my system, just a motor driving an encoder"
 
If this is the case, I should be able to connect any servo to my 7344 and if I am able to keep the motor spinning at 40 RPM within +/- 0.05 RPM error, then I will have proved that the 7344 is not the weak link in your motion control system, and thus... you should keep your 7344 and possibly look into a new motor and/or drive, or readjust your PID settings.
 
So... give me a few days (I am out on Vacation Thursday and Friday) and I should have an answer regarding whether or not this should be possible.
 
I have a quick question...
What is the purpose of your motor if it is not loaded?  Do you have a fan connected to it (this would still be considered a load)?  Am I missing something?
 
I am looking forward to testing this out and I will be able to give you some pointers on how to improve your PID constants if I am able to get it to work on my end.
 
Lorne Hengst
Application Engineer
National Instruments
Message 5 of 15
(6,046 Views)
Lorne,
 
You had asked about what the system was actually driving.  A mirror is mounted onto the motor rotor and the motor turns the mirror at a constant speed.  (This is a scanning application.)  The inertia of the motor and encoder swamp the inertia of the mirror, so the motor basically has no external loading.
 
Thanks again for your help.
 
Joe
0 Kudos
Message 6 of 15
(6,023 Views)
Joe,
 
Thanks for the info about your system.
 
I have made some progress tuning my servo over here for a constant 40 RPM.  Initially I was seeing the exact same behavior you were reporting.  I am using an external counter to verify the velocity I am trying to achieve and at first I was getting a veloicty anywhere between 37 RPM and 42 RPM.  After making some changing in my approach to tuning the servo I have been able to get the actual RPMs to stay between 39.2 RPM and 40.15 RPM (a huge improvement).  I think I can get much better control if I use a higher resolution encoder (which I am currently working on acquiring).  I am currently using a 500 count encoder and have tuned the motor so well that I am always within -1 to 1 count of where the motor is supposed to be.  I believe that if I use an encoder with 4 times the resolution, that I should be able to achieve 4 times the accuracy.
 
Below is the approach I took which allowed me to achieve my current accuracy.
1.  I left my Kd constant at 0 and used Kv instead.  The Kv constant is extremely similar to Kd, but the Kv constant works much better when trying to achieve precise velocity control, because it is a direct measurement of the motor's velocity instead of the derivative of the position changes of the motor.  Making this change reduced my constant following error from 30 counts to 6 or 7 counts.
 
2.  I tuned the motor using the step response tool available in Measurement Automation Explorer (MAX).  The catch is that I did not use the default "Step Length" of 1000, rather I tuned my servo so that I had a perfect step response for a step length of 4.  The reason I tuned the servo to a step length of 4 instead of 1000 is that a step of 4 more closely simulates the movement of a servo during constant velocity move.  When doing a constant velocity move, the servo is recieving a constant command to move the servo a few steps over and over again.  For example if I tell the motor to move at a constant velocity of 10 RPM, then the NI-Motion driver (using PID) calculates a target position for the motor.  The result is a continuous sequence of individual position moves that result in a constant velocity.  The sequency of moves might look like below...
Move to 10, Move to 12, Move to 14, Move to 16, etc., etc.
Likewise if we were trying to move at 20 RPM instead of 10 RPM, the sequence of moves might look like...
Move to 10, Move to 14, Move to 18, Move to 22, etc., etc.
in essence doubling the velocity of the move.
So, tuning to a step response of 4 will result in a servo better tuned for constant velocity, as opposed to tuning to a step response of 1000 which will tune a servo for large position moves.
Using this approach I was able to reduce my following error from 6 or 7 counts to -1 to 1 count.
 
My final values for the PID loop were...
Kp = 550
Kd = 0
Ki = 50
Kv = 15000
and a loop rate of 250us.
 
Like I said above, I believe I can achieve better precision with a high count encoder.  Once I get my hands on a higher count encoder I will post an update.
 
Lorne Hengst
Application Engineer
National Instruments
Message 7 of 15
(6,006 Views)
Lorne,
 
That sounds like great progress! 
 
Since I already have the high resolution encoder, I should be able to obtain the performance I need by just using the tuning method that you describe.  The system I am working with is at another location, so I won't be able to test this tuning method for a few weeks, but I am surely going to give it a try.
 
Let me know what you find out when you get your higher res encoder.
 
Thanks so much for your help.
 
Joe
0 Kudos
Message 8 of 15
(6,004 Views)
joej85,
 
Bad news...  We do not have an encoder over here with greater than 500 counts (2000 edges).  I heard there was one lurking around the halls, but noone knows where it is located.  It does not look like I will be able to test this any further unless the encoder fairy visits me soon.
 
Lorne Hengst
Application Engineer
National Instruments
0 Kudos
Message 9 of 15
(5,966 Views)
Lorne,
 
Thanks for all your help.  I think you have directed me to the right path to take.  My motor won't be available for a few weeks as well, but I will try your recommendations the next opportunity I get.
 
I will try to remember to post a followup once I am able to test.
 
Thanks,
 
Joe
0 Kudos
Message 10 of 15
(5,963 Views)