Some Basic Modeling Thoughts

See therefore some definitions for example in: http://home.arcor.de/janch/janch/_control/20070428-controldoc /
Aim is compensating by approbiate means if high quality counts:
- process and controller time response: F1(s)*F2(s) => K - set point SP and process value PV: e = PV - SP => 0 - ITAE criteria: Integral[0...t] t*Abs(e)*dt => MIN, if applicable
Open loop (feedforward): K = 1
If you have data you can approach this with a feedforward model like: http://home.arcor.de/janch/janch/_control/20070504-controldoc /
Page 1 Controller fits to process: result v2 = u
process A1 = 0.333 A2 = 0.00106 A3 = 0.0000844 controller B1 = 0.333 B2 = 0.00106 B3 = 0.0000844
Page 2 Controller does not fit to process: result v2 ~ u
process A1 = 0.333 A2 = 0.00106 A3 = 0.0000844 controller B1 = 0.333 B2 = 0.00106 B3 = 0.0000819 -3%
In closed loop with
K0 v2/u = 1/(1+1/(100 *0.97)) = 0.989 ~ 1 K00 v2/u = 1/(1+1/(1000*0.97)) = 0.999 ~ 1 K=oo v2/u = 1
Can be 'corrected' with an integrator!
Used definite filter for limiting speed v2' and acceleration v2''! This can be applied to any process values.
Page 3 Example filter (jerk 3rd order) in series
0.000033275*u''' + 0.003025*u'' + 0.11*u' + 1 = w
If MATLAB used correctly it will produce the same result as I have found. No doubt!
Used and recommended program (free usable): http://www.softintegration.com/webservices/control /
--
Regards/Gre http://home.arcor.de/janch/janch/menue.htm
Jan C. Hoffmann eMail aktuell: snipped-for-privacy@nospam.arcornews.de
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

At feed forward is a gain that is multiplied by the set point and its derivatives. In this case there would be three feed forwards: Kv velocity feed forward Ka acceleration feed forward Kj jerk feed forward. A position feed forward is not required because it is a type 1 system.
In my example only the position set point changes. All the derivatives are 0 so there is no need for feed forwards unless one is trying to follow a different motion profile like a sine wave.
I know what the feed forward gains should be. K=1 is not right for any of the feed forwards.

Have you tried? We would like to see the script.
I think you should think about some basic models ( very basic ). Assume the plant is an RC circuit with a time constant of 1 sec so the model looks like this: 1/(s+1) The controller has a limited output from 0 to 10 volts and we want to charge the capacitor to 7 volts and then change the set point to 3 volts.
Note, one could just have the controller output 7 volts and then 3 volts but the goal is to get to the set point faster than the 1 second time constant would allow. About 3 seconds would be a good time.
Remember, the output of the controller is limited to 0 to 10 volts.
Peter Nachtwey
Peter Nachtwey
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
napisa(a):
(...)

It's a very nice example for time optimal control (30 year old example or more :)).
--
Mikolaj

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
: napisa(a): : : (...) : > I think you should think about some basic models ( very basic ). : > Assume the plant is an RC circuit with a time constant of 1 sec so the : > model looks like this: : > 1/(s+1) : > The controller has a limited output from 0 to 10 volts and we want to : > charge the capacitor to 7 volts and then change the set point to 3 : > volts. : > : > Note, one could just have the controller output 7 volts and then 3 : > volts but the goal is to get to the set point faster than the 1 second : > time constant would allow. About 3 seconds would be a good time. : > : > Remember, the output of the controller is limited to 0 to 10 volts. : > : > Peter Nachtwey : : It's a very nice example for time optimal control : (30 year old example or more :)). Yes, but maybe JCH will understand that the RC circuit can't be charged and discharged instantly when the control output is only 0-10 volts..
Peter Nachtwey
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
[...]

I used a 3rd order filter for smoothing (keep PV acceleration in limits). Then follows a 100% time compensation in sequence F2(s)=controller and F1(s)=process. So I could derive the controller output v2.
Again:
F1(s)F2(s)=1 1st modeling F2(s)F1(s)=1 2nd modeling
See Page1 (Jan) and Page 2 (Peter): http://home.arcor.de/janch/janch/_news/20070507-nachtwey /
I tried to keep the controller output in the range 0.2 to 1. This can be interpreted as of being in 2...10V or 4...20mA or just 0...100% (2V=0%! life zero). That's standard.

I haven't MATLAB. I use a program that I have written myself. The mathematics is the same!
Remark: MATLAB solves only linear differential equations! My program solves nonlinear equations as well.
--
Regards/Gre http://home.arcor.de/janch/janch/menue.htm
Jan C. Hoffmann eMail aktuell: snipped-for-privacy@nospam.arcornews.de
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
On Fri, 04 May 2007 14:37:57 +0200, JCH wrote:

You're kidding, right?
Try varying the plant in a realistic manner, say by varying the overall gain by a factor of 20%, or by adding in unmodeled dynamics that change the phase of the transfer function by 20 degrees at your desired operating frequency, or put in nonlinearities that _really_ change the behavior. Then combine that with a plant that is unstable, or marginally stable -- then see how well you do with pole-zero cancellation.
--
Tim Wescott
Control systems and communications consulting
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
: You're kidding, right? Finally, there are some others paying attention. : : Try varying the plant in a realistic manner, say by varying the overall : gain by a factor of 20%, or by adding in unmodeled dynamics that change : the phase of the transfer function by 20 degrees at your desired operating : frequency, or put in nonlinearities that _really_ change the behavior.
If the system varies that much then there is no solution that isn't extremely complicated and expensive. No PID will do the job. At this point one must get the mechanical designers to do a better job of designing their systems.
Then : combine that with a plant that is unstable, or marginally stable -- then : see how well you do with pole-zero cancellation.
The plant I presented is stable but will ring. I have said before it wasn't meant to be a system that one can be easily tuned by tweaking and a lot of coffeer. I have Mathcad work sheets that show that the same system will control nicely and almost the same even if the gain, damping factor and natural frequency have a standard deviation of 5%. Have you ever done this type of analysis? I have. I have Mathcad work sheets where I can change the standard deviation and see the differences in response. I must know all of this. I know I can identify as system much better than that. Some system identification techniques return the norm or the sum of square errors. I can tell by that how well the system identification has been.
If your system varies by 20% then you should get a new mechanical desiginer. I teach course in how to make system easier to control. I don't expect perfection but there is a limit to which the control people should put up with. If your system doesn't come with a transfer function then it hasn't been designed. Yes, I am a hard ass. I will get to non-linear systems later. At this point we still need to convince JCH that there is power or energy rate limit that the controller can't exceed.
Peter Nachtwey
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Peter Nachtwey wrote:

You were doing a fine job with him on your own.

20% variations in gain and 20 degree variations in phase are extreme, but should be well within what a well-designed PID loop can handle -- at least without going unstable. I normally design for 60 degrees phase margin and 6dB (i.e. a factor of 2 variation) of gain margin; I'll go less than this, but only under protest. Even a loop that's designed to 45 degrees and 3dB gain variation would absorb the quoted variations. It wouldn't be graceful about it, but it would remain stable.
His method would blow up in his face.

I suspect that your loops would handle a 20% variation just fine -- in fact, I gather that your hydraulic actuators vary by a good fraction of that within one stroke. Sometime when you have time to spare give it a try with your current spreadsheets -- and if you fail, rethink your methodology.
Rare earth magnets vary their field strength under temperature variations, and so does the resistivity of copper wire. Nonlinear systems can be coped with (sometimes) by treating them as linear systems that vary unexpectedly. When you're designing a system to operate correctly from 0 feet to 10000, from -40 degrees to +55 C, with some of the motors driven from raw aircraft power that can vary from 21 to 32 volts, over all possible manufacturing variations as well as variations due to aging, other environmental factors and possibly poor servicing you should darn well make a robust system!
If you're using pneumatic controllers you're going to see variations in your plant performance with supply pressure, and I strongly suspect that you'll see variations in the effective spring constants with temperature as the air density changes. I'm sure you know far better than I how to design around these issues -- but I bet that once a system gets out into the field there's more variation in there than you're happy to admit to.
--

Tim Wescott
Wescott Design Services
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
wrote in message : : > : You're kidding, right? : > Finally, there are some others paying attention. : : You were doing a fine job with him on your own. : : > : : > : Try varying the plant in a realistic manner, say by varying the overall : > : gain by a factor of 20%, or by adding in unmodeled dynamics that change : > : the phase of the transfer function by 20 degrees at your desired operating : > : frequency, or put in nonlinearities that _really_ change the behavior. : > : > If the system varies that much then there is no solution that isn't : > extremely complicated and expensive. No PID will do the job. At this point : > one must get the mechanical designers to do a better job of designing their : > systems. : > : 20% variations in gain and 20 degree variations in phase are extreme, : but should be well within what a well-designed PID loop can handle -- at : least without going unstable. I normally design for 60 degrees phase : margin and 6dB (i.e. a factor of 2 variation) of gain margin; I'll go : less than this, but only under protest. Even a loop that's designed to : 45 degrees and 3dB gain variation would absorb the quoted variations. : It wouldn't be graceful about it, but it would remain stable. : : His method would blow up in his face.
Yes, but part of that is becasue he doesn't see the flaws of implementing the plant and controller as one function. There are output limits, quantizing and sample rate limitations that are ignored. This is why I object to built in functions like Matlab and Scilab have where one can simulate the the closed loop transfer function as a whole. One doesn't worry about how good the estimate of the plants acceleration or jerk is when it is written in the s domain, but just try this in discrete time. I vary my plant parameters and truncate the estimated positions to the resolution of the feedback device I am simulating in my worksheets. I have found feedback resolution to be one of the main performance limiting factors. Direct s domain to continuous time conversion does not show this.
Peter Nachtwey
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
napisa(a):
(...)

(...)
When object is stable and easy to control and disturbances are very small, and modeling error are also very small then JHC probably don't blow everything. Inversing object however is not safe technique. Why? There is a lot of literature about this and about far better methods. Whole control theory is about how to control without inversing the object (which is quite often impossible at all). And what about starting condition in his model?
--
Mikolaj

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
: napisa(a): : : (...) : > The plant I presented is stable but will ring. I have said before it : > wasn't : > meant to be a system that one can be easily tuned by tweaking and a lot : > of : > coffeer. I have Mathcad work sheets that show that the same system will : > control nicely and almost the same even if the gain, damping factor and : > natural frequency have a standard deviation of 5%. Have you ever done : > this : > type of analysis? I have. : (...) : > Peter Nachtwey : : When object is stable and easy to control : and disturbances are very small, : and modeling error are also very small : then JHC probably don't blow everything.
Don't you see? It is the fact that JCH combines the controller and the plant together so that power limitations are ignored! It is the fact that JCH's transfer function ends up being k/(k+1) which implies there is no lag in response. Just a little gain difference. That implies the ability to transfer huge amounts of energy which isn't reallistic..
Peter Nachtwey
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
napisa(a):

Yes, I see that. I'm trying to reproduce JHC's revers model method to show how bad it is. He say's he used it in practice but doesn't show any details so it's hard to guess what is he exactly doing or trying to say. He is also very chaotic and changes subject without any warning so I feel lost.
--
Mikolaj

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload


Peter is on the right track. He tries to simulates a PD2D (PD3) without I-action and found a very good result. Times ago I hadn't a computer and did the same in practice if it was necessary. I was doing it directly on a plant.
Both have the same characteristic controller behavior. He found it with the try and error method. If he would compensate the transfer funfunction as I do he would get the same results if using the data I used.
He has just to limit the leading input signal u so that acceleration is kept in limits. I used a filter of 3rd order. That's all.
--
Regards/Gre http://home.arcor.de/janch/janch/menue.htm
Jan C. Hoffmann eMail aktuell: snipped-for-privacy@nospam.arcornews.de
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
: > napisa(a): : > : >> Don't you see? It is the fact that JCH combines the controller and the : >> plant together so that power limitations are ignored! It is the fact : >> that : >> JCH's transfer function ends up being k/(k+1) which implies there is no : >> lag : >> in response. Just a little gain difference. That implies the ability to : >> transfer huge amounts of energy which isn't reallistic.. : >> : >> Peter Nachtwey : > : > Yes, I see that. : > I'm trying to reproduce JHC's revers model method : > to show how bad it is. He say's he used it in practice : > but doesn't show any details so it's hard to guess : > what is he exactly doing or trying to say. : : : Peter is on the right track. He tries to simulates a PD2D (PD3) without : I-action and found a very good result
I can do this with an integrator gain too. No problem
. Times ago I hadn't a computer and did : the same in practice if it was necessary. I was doing it directly on a : plant. : : Both have the same characteristic controller behavior. He found it with the : try and error method.
Who is he? I did NOT use trial and error!. I used pole placement.
If he would compensate the transfer funfunction as I : do he would get the same results if using the data I used.
Who is he?
: He has just to limit the leading input signal u so that acceleration is kept : in limits. I used a filter of 3rd order. That's all.
In my example I am using the pole placement to limited the acceleration. The acceleration is also limited by the fact that the controller can only output +/- 10volts and the amplifier and plant only have a gain of 3 position units per second per volt. .
Peter Nachtwey
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
If you have some spare time I'd like to see a solution:
Target position Actual position Control position
over time in your case 0 to 10 Volts 'without scratching' the limits. Starting at 6 Volts.
The target position should be as I showed in: Page 2, value w http://home.arcor.de/janch/janch/_control/20070428-controldoc /
Some information about max. velocity and max. acceleration would be nice.
Thanks.
--
Regards/Gre http://home.arcor.de/janch/janch/menue.htm
Jan C. Hoffmann eMail aktuell: snipped-for-privacy@nospam.arcornews.de
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
: : If you have some spare time I'd like to see a solution: : : Target position : Actual position : Control position
If you look at the graph you can see I have all those values plotted.
I have another version of the same system only following a sine wave
ftp://ftp.deltacompsys.com/public/NG/Mathcad%20-%20T1C1%20PD2D%20SineWave%20NG.pdf
Nornally I use feed forwards and an integrator. The feed forwards allow tracking with very little error. The closed loop control is just there for non-linearities and changes in load. : : over time in your case 0 to 10 Volts 'without scratching' the limits. : Starting at 6 Volts.
? Perhap the sine wave work sheet will answer your question. I use both for testing. Notice that some of the other tuning solution work better when not being driven in to saturation.
: : The target position should be as I showed in: Page 2, value w : http://home.arcor.de/janch/janch/_control/20070428-controldoc / : : Some information about max. velocity and max. acceleration would be nice. : Would you look? I plot the velocity and acceleration. I have update the original work sheet a few times now.
Peter Nachtwey
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Only the 'model' is combined on the computer. Nothing else. See the red box in http://home.arcor.de/janch/janch/_control/20070428-controldoc / Fig. 2
If you use 4...20mA the process may be 100 miles away from the controller.
Remark: The 4...20mA DC signals are independent from electrical resistence! That's the purpose using DC.
--
Regards/Gre http://home.arcor.de/janch/janch/menue.htm
Jan C. Hoffmann eMail aktuell: snipped-for-privacy@nospam.arcornews.de
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Let's just 'assume' that you have to fulfill a benchmark test like: http://home.arcor.de/janch/janch/_news/20070507-nachtwey /
and your customer is happy with the tuning.
But he wants to see what happens if the setpoint is moved from 0.2...1 (0...100%): http://home.arcor.de/janch/janch/_news/20070508-wescott /
That seems to be realistic. Note that anything is still adjustable.
--
Regards/Gre http://home.arcor.de/janch/janch/menue.htm
Jan C. Hoffmann eMail aktuell: snipped-for-privacy@nospam.arcornews.de
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.