Re: PID control for speed-following speed
- From: Tim Wescott <tim@xxxxxxxxxxxxxxxx>
- Date: Sun, 07 Sep 2008 21:14:32 -0700
leo wrote:
On 6 Sep., 05:36, Tim Wescott <t...@xxxxxxxxxxxxxxxx> wrote:So you are saying that during the acceleration of your 'master' axis your 'slave' axis doesn't keep up?On Fri, 05 Sep 2008 06:45:21 -0700, leo wrote:Dear Mr.WescottI want to programm in C++ PID control to tracking the speed of belts.Clearly, the one that works best for you.
For example I have belt 1 with speed V1 and I have to follow this speed
with other axis (gearing).The speed of belt 1 can be changed with
deceleration and acceleration every time. Can somebody help me which
algorith is the best one?
Best regards
Leo
What candidates are you considering?
What are your constraints? (processing power, memory size, timer widths,
I read your article in Embedded Systems and I see this code:
typedef struct
{
double dState; // Last position input
double iState; // Integrator state
double iMax, iMin;
// Maximum and minimum allowable integrator state
double iGain, // integral gain
pGain, // proportional gain
dGain; // derivative gain
} SPid;
double UpdatePID(SPid * pid, double error, double position)
{
double pTerm,
dTerm, iTerm;
pTerm = pid->pGain * error;
// calculate the proportional term
// calculate the integral state with appropriate limiting
pid->iState += error;
if (pid->iState > pid->iMax) pid->iState = pid->iMax;
else if (pid->iState
<
pid->iMin) pid->iState = pid->iMin;
iTerm = pid->iGain * iState; // calculate the integral term
dTerm = pid->dGain * (position - pid->dState);
pid->dState = position;
return pTerm + iTerm - dTerm;
}
In my system input is speed and this speed is ramp. I simulate this
code in my system with sample rate 2 msec
,input acceleration was 20 000 mm/sec^2 and max.speed was 1000 mm/
sec.It means, I start belt for example
from 500 mm/sec to 1000 mm/sec with acceleration 20 000mm/sec^2 and I
want to synchronize my axis with this belt.
What I see is that I have always smaller value than input and I don't
have velocity of input (error is about30-40 mm/sec).If input value
is constant, then I can reach this velocity. Can you help me?
This is not surprising -- a PID controller reacts to external stimuli, but it doesn't do anything 'proactive'. You need to do something that will keep the two axes more tightly coupled.
Consider the following approaches:
1. Speed up the response of your 'slave' axis. If you've already pushed it's bandwidth to your stability limits and you're not working well enough, then you're done with this one.
2. Feed the same command, appropriately scaled, to both 'master' and 'slave'. If you are running encoders and sufficiently synchronized controllers, then only glitches will keep the two axes from being in synchronization. Glitches happen, so augment the speed command to the slave with the error between it and the master.
3. Feed the motor drive signal, appropriately scaled, from the master to the slave, and add it to the slave's controller output. If the dynamics of the two axes are sufficiently close, then this will keep them acting together.
4. Make sure that your physical mechanisms even have the potential to stay synchronized as closely as you need in the environment that you're putting them. Two slow mechanisms, subject to strong disturbances and needing to stay tightly coupled, may not be sufficient to this task no matter how fancy the controllers you use are.
--
Tim Wescott
Wescott Design Services
http://www.wescottdesign.com
Do you need to implement control loops in software?
"Applied Control Theory for Embedded Systems" gives you just what it says.
See details at http://www.wescottdesign.com/actfes/actfes.html
.
- References:
- PID control for speed-following speed
- From: leo
- Re: PID control for speed-following speed
- From: Tim Wescott
- Re: PID control for speed-following speed
- From: leo
- PID control for speed-following speed
- Prev by Date: Re: GEaring two axis
- Next by Date: temperature control
- Previous by thread: Re: PID control for speed-following speed
- Next by thread: Re: PID control for speed-following speed
- Index(es):
Relevant Pages
|