Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

PD controller - linear velocity term

Solved!
Go to solution

I have a PD position controller in LabVIEW sending current (force) commands to a linear servotube actuator through an amplifier.  So far I've tried reading position data with a linear potentiometer, and taking a derivative to find velocity (for the D term in PD).  The system seems more stable with proportional control only.  This makes sense after having just read in Ogata's "Modern Control Theory" that potentiometer signal is not suitable for differentiation due to the noise it produces.  Questions:  What are my options?  Is differentiating a linear encoder signal just as problematic?

 

Thanks

 

Maciek

0 Kudos
Message 1 of 8
(5,073 Views)

Maciek,

 

a good way to eliminate noise issues, that indeed tend to cause issues with the D term of a controller is increasing the range of the derivative calculation. Instead of calculating the derivative between two consecutive iterations, you should calculate it for the actual feedback value and another feedback value that was sampled several iterations ago (e. g. 3 or 4). From my experience this makes the D term much more useable.

 

I have read in another thread, that you are not running your control environment in a real-time environment. This is not recommended and it will make it very hard for you to get stable control behavior. In fact a stable loop rate is at least as important as good PID values. This is one of the reasons, why there is a huge market for realtime environments...

 

Kind regards,

Jochen

Message 2 of 8
(5,067 Views)

Jochen,

 

Thank you for the very valuable response.  I was going to migrate the system over to RT later down the road, but after your post it should happen by the end of this week, since we have RT expertise in our lab.

 

Is increasing the range of derivative calculation in essence a lot like implementing a filter?  Or should this be done in addition to filtering the signal first?

Do you agree that introducing a filter into the feedback loop adds dynamics, which have to be accounted for during controller design?

 

Maciek

0 Kudos
Message 3 of 8
(5,053 Views)
Solution
Accepted by Maciekdp

Maciek,

 

moving to RT should result in a much better system behavior and tuning should become easier.

Increasing the range for the derivative calculation is not really comparable to the usage of a filter. As you have already stated, filters add their own dynamics to the system, especially if you use higher order filters.

 

Jochen

Message 4 of 8
(5,032 Views)

I have the system running in RT now, and the performance is greatly improved, but in order to achieve proper controller contribution from the D term (versus that of the P term), I had to "guess" at the proper dt input into the derivative block.  I'm specifying an acquisition rate in Hz, but in RT, the while loop timing is done in microseconds.  What are the proper units of the dt term? I attached a screenshot.

 

maciek

0 Kudos
Message 5 of 8
(5,004 Views)

The unit of dt determines the unit of dx/dt.

 

Example:

If x = position in encoder counts, then dx/dt = velocity.

If the unit of dt = seconds, then dx/dt = velocity in encoder counts per second, but if you specify dt in minutes, you will get the velocity in encoder counts per minute.

 

I hope that helps,

Jochen

0 Kudos
Message 6 of 8
(4,995 Views)

I'm using a linear potentiometer to read position in meters.  For the D term, I need velocity.

 

In realtime, I'm specifying an acquisition rate of 1000Hz, so a new signal is acquired every 1 milisecond.  The while-loop period (amount of time between subsequent iterations) is specified in microsenconds.  I'm running my loop at the same rate as signal acquisition.  In my case, it's 1000 microseconds, because that is equivalent to 1 milisecond.  Now the derivative block lies inside the while-loop.  In that case, should the dt term be specified using microseconds?  If so, in my case that should be 1000 miliseconds (since the signal is acquired every 1 milisecond = 1000 microseconds).  But this value gives me a D component of the controller signal, which is very weak, and has no visible impact on the system's response.  In order to achieve proper D term magnitude, I had to divide the 1000 miliseconds by a number which I found by trial and error (100,000), giving me a dt of 0.01  I'd like to understand where this number came from.

 

Related question:  Do I have to run my control loop at the same rate as that at which I'm acquiring feedback?

 

Maciek

0 Kudos
Message 7 of 8
(4,983 Views)

Maciek,

 

I'm sorry, but I can't add much to my last post. The derivative function just returns the slope of your input signal. dt is the denominator of the result, so if you normalize the unit to 1 miliseconds (dt = 1), the result will be 1000 times smaller, than if you normalize to seconds (dt = 0.001). The derivative function is just a mathematical function. Mapping the outcome to physical values is up to you. You can either use a different value for dt or multiply the necessary scaling factor into the D term.

 

From the control loops point of view it's important to get feedback signals with low dead time. If you run the acquisition at a higher rate (e. g. 10 times higher), make sure, that you use the latest value for your PID calculation.

 

Jochen

0 Kudos
Message 8 of 8
(4,959 Views)