Re: PID control for speed-following speed



leo wrote:
On 6 Sep., 05:36, Tim Wescott <t...@xxxxxxxxxxxxxxxx> wrote:
On Fri, 05 Sep 2008 06:45:21 -0700, leo wrote:
I want to programm in C++ PID control to tracking the speed of belts.
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
Clearly, the one that works best for you.

What candidates are you considering?

What are your constraints? (processing power, memory size, timer widths,
Dear Mr.Wescott

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?

So you are saying that during the acceleration of your 'master' axis your 'slave' axis doesn't keep up?

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
.



Relevant Pages

  • Re: Belt trick for spin 3/2
    ... fixed axis with rotation angle going from 0 degrees to 360 degrees to ... The first time, the buckle is passed beneath, the second time it is passed ... respect to the belt, ... The axis isn't fixed, ...
    (sci.physics.research)
  • Re: fanuc 6MB 4th axis parameter -- setting dia?
    ... is there a parameter in a fanuc 6MB controller to tell ... the amount of time you desire for the move to be completed within. ... a uniform rate for each axis. ...
    (alt.machines.cnc)
  • Re: Belt trick for spin 3/2
    ... fixed axis with rotation angle going from 0 degrees to 360 degrees to ... The first time, the buckle is passed beneath, the second time it is passed ... consequence because the belt is very thin. ...
    (sci.physics.research)
  • Re: Belt trick for spin 3/2
    ... As I am discriminated on sci.physics.research by the moderators Herr Phillip ... consequence because the belt is very thin. ... he can not observe what the belt trick is about. ... with a fixed axis is performed, which corresponds to a subgroup SOU. ...
    (sci.math)
  • Re: CAT45?
    ... I ran a 4 axis sunstrand with that controller on it.....back in ~1984 or ... --But hardly anybody had contouring rotary axis capability back then so the ... Compression molds just from mold shops in the immediate area. ... Ya those spindle drives were finicky. ...
    (alt.machines.cnc)