-
2
- #1
PNachtwey
Electrical
- Oct 9, 2004
- 778
If you do a search for CTM PID you will find many links that point to about the same data on different universities websites. The link I will use is this one
They are similar with the layout changing a bit.
In previous posts I have made it clear I am not a fan of using Matlab to teach control theory because it really doesn't. The professors are lazy and seem to rely on that fact that one can get an answer easily with Matlab, but these exercises really don't teach control theory. Another complaint I have is that professor seem to just copy what has been done before without much thought about improving the material or knowledge level. This topic will make you think if you stick with it.
To start with the tutorial lists 5 functions that will be used. There is NO explanation as to how these functions work or why. I used learning MathCad. Mathcad doesn't have these built in function so I had to make them myself.
Stepping down the characteristics of the P, I and D Terms.
The description of the P term says that increasing the P term will cause the system to overshoot more but why?
The description of the derivative gain says that Kd adds to the ability to anticipate error. This is very wrong. The derivative term adds damping by trying to maintain the same error.
In the description of the integrator gain it a drawback to using the integrator error is that it makes the system sluggish. Why? It also mentions that the integrator may take time to unwind. This is true with incompetent design.
The table of controller gains and how they affect the response is only helpful in a naive way. Student do not get heavily in debt to learn this. One can find lots of documents that say this gain does this and that gain does that but these documents provide no real insight.
Step down to equation 6. This equation will be used a lot as the open loop transfer function for the various methods of control. A little Matlab code results in the plot of the response. OK. It is pretty and simple to obtain but so what? The document does not go into the why the response is the way it is. The document should go into that there are two real poles at -5+sqrt(5) and -5-sqrt(5). The pole at -5-sqrt(5) will decay relatively quickly leaving the poles at -5+sqrt(5) to decay slowly. Since the time constant is the inverse of the pole the time constant is 1/(5+sqrt(5))). It takes 5 time constants to get within 1% of the final value.
Work it out and compare with the plot.
Now step down to equation 7. A proportional gain is added. In the Matlab code the proportional gain was arbitrarily set to 300. This results in the poles being at -5+i*sqrt(295) and -5-i*sqrt(295). Obviously this
results in an oscillatory response. The real part of two poles is at -5 to the time constants are 0.2 seconds. You can the time it takes to get to steady state is more than 5 time constants. There is no mention of why. The best explanation is two cars waiting at a traffic light. Both will accelerate using a time constant of 0.2 seconds but the second car must wait for the first car to accelerate. If you want to simulate 10 cars accelerating at a traffic light use 10 FOPDT transfer functions in series.
In my Mathcad pdf I wanted a critically damped response so Kp = 5. This results in the characteristic equation being (s+5)^2. If Kp is over 5 the response will be under damped. The sqrt for the pole location will be imaginary. BTW, I computed the real part of the pole by dividing the 10 by 2 the real part pole location will be at -5. I computed the sqrt term by taking half of 10 and squaring it. This results in 25. In the CTM example Kp = 200 so Kp+300-25=295 since the this is more 25 the result is imaginary.
compare with my Mathcad P only. I provide a lot more detail. I show how to compute the controller gains by selecting the response I want. Everyone else does it the other way around.
This is long enough. I will continue with the PD, PI and PID examples if anybody is interested. The proportional and derivative example can be enlightening but the CTM example doesn't provide much insight.
Peter Nachtwey
Delta Computer Systems
They are similar with the layout changing a bit.
In previous posts I have made it clear I am not a fan of using Matlab to teach control theory because it really doesn't. The professors are lazy and seem to rely on that fact that one can get an answer easily with Matlab, but these exercises really don't teach control theory. Another complaint I have is that professor seem to just copy what has been done before without much thought about improving the material or knowledge level. This topic will make you think if you stick with it.
To start with the tutorial lists 5 functions that will be used. There is NO explanation as to how these functions work or why. I used learning MathCad. Mathcad doesn't have these built in function so I had to make them myself.
Stepping down the characteristics of the P, I and D Terms.
The description of the P term says that increasing the P term will cause the system to overshoot more but why?
The description of the derivative gain says that Kd adds to the ability to anticipate error. This is very wrong. The derivative term adds damping by trying to maintain the same error.
In the description of the integrator gain it a drawback to using the integrator error is that it makes the system sluggish. Why? It also mentions that the integrator may take time to unwind. This is true with incompetent design.
The table of controller gains and how they affect the response is only helpful in a naive way. Student do not get heavily in debt to learn this. One can find lots of documents that say this gain does this and that gain does that but these documents provide no real insight.
Step down to equation 6. This equation will be used a lot as the open loop transfer function for the various methods of control. A little Matlab code results in the plot of the response. OK. It is pretty and simple to obtain but so what? The document does not go into the why the response is the way it is. The document should go into that there are two real poles at -5+sqrt(5) and -5-sqrt(5). The pole at -5-sqrt(5) will decay relatively quickly leaving the poles at -5+sqrt(5) to decay slowly. Since the time constant is the inverse of the pole the time constant is 1/(5+sqrt(5))). It takes 5 time constants to get within 1% of the final value.
Work it out and compare with the plot.
Now step down to equation 7. A proportional gain is added. In the Matlab code the proportional gain was arbitrarily set to 300. This results in the poles being at -5+i*sqrt(295) and -5-i*sqrt(295). Obviously this
results in an oscillatory response. The real part of two poles is at -5 to the time constants are 0.2 seconds. You can the time it takes to get to steady state is more than 5 time constants. There is no mention of why. The best explanation is two cars waiting at a traffic light. Both will accelerate using a time constant of 0.2 seconds but the second car must wait for the first car to accelerate. If you want to simulate 10 cars accelerating at a traffic light use 10 FOPDT transfer functions in series.
In my Mathcad pdf I wanted a critically damped response so Kp = 5. This results in the characteristic equation being (s+5)^2. If Kp is over 5 the response will be under damped. The sqrt for the pole location will be imaginary. BTW, I computed the real part of the pole by dividing the 10 by 2 the real part pole location will be at -5. I computed the sqrt term by taking half of 10 and squaring it. This results in 25. In the CTM example Kp = 200 so Kp+300-25=295 since the this is more 25 the result is imaginary.
compare with my Mathcad P only. I provide a lot more detail. I show how to compute the controller gains by selecting the response I want. Everyone else does it the other way around.
This is long enough. I will continue with the PD, PI and PID examples if anybody is interested. The proportional and derivative example can be enlightening but the CTM example doesn't provide much insight.
Peter Nachtwey
Delta Computer Systems