Roy Vegard Ovesen wrote:
På 29.09.2005 00:47 CEST skrev Hans-Georg Wunder
Behaviour with delta_u_n = 0 and an input jump function of 0.6
Saturation at the beginning
o Time, reference,input,output
21:56:54,0,0,0
21:56:55,0,0,0
21:56:56,0,0,0
21:56:57,0,0,0
21:56:58,0,0,0
21:56:59,0,0.6,0.02549999999999999 Here the P-part is missing There
has to be a jump to u_max
You should not set the input to 0.6. You should set the reference to 0.6.
The input is the process value, and the reference is the set point. You
can not set the process value directly. If you could then you would not
need a controller at all ;-).
The test is done in an open loop configuration. The only difference
between the input value and the reference value is the sign.
Here the test results with the step response of the reference
Same test with change of the reference value.
Time, reference,input,output
08:51:03,0,0,0
08:51:04,0,0,0
08:51:05,0,0,0
08:51:06,0,0,0
08:51:07,0.6,0,-0.0195 Jump to 0.6 into saturation,
output is negative due to Kp=-1
08:51:08,0.6,0,-0.08000000000000006 P-Part ist missing
08:51:09,0.6,0,-0.1405000000000001
08:51:10,0.6,0,-0.2010000000000001
08:51:11,0.6,0,-0.2615000000000002
08:51:12,0.6,0,-0.3225000000000002
08:51:13,0.6,0,-0.3830000000000003
08:51:14,0.6,0,-0.4435000000000003
08:51:15,0.6,0,-0.4990000000000004
08:51:16,0.6,0,-0.4990000000000004
In your example here it does not matter, results would have been similar
if you set the reference to 0.6. But you have to remember this when you
use live values with your controllers.
The patch committed by Erik:
http://cvs.flightgear.org/cgi-bin/viewcvs/viewcvs.cgi/source/src/Autopilot/xmlauto.cxx.diff?r1=1.19&r2=1.20&cvsroot=FlightGear-0.9
should fix this. This is what would happen when you set
delta_u_n = u_max - u_n_1 :
delta_u_n > (u_max - u_n_1)
0.6 > (0.5 - 0.0) : true
delta_u_n = u_max - u_n_1 = 0.5 - 0.0 = 0.5
u_n = u_n_1 + delta_u_n = 0.0 + 0.5 = 0.5
and at the next time step let's assume that delta_u_n
is still 0.6:
0.6 > (0.5 - 0.5) : true
delta_u_n = 0.5 - 0.5 = 0.0
u_n = 0.5 + 0.0 = 0.5
u_n jumps to u_max and stays there as long as delta_u_n
is positive.
With this patch, the controller gets out of sync. Here the test results.
But only, when the windup is used.
Sorry, that it is so long.
Behaviour with delta_u_n =u_max - u_n_1 (Patch fromj Erik) and an input
jump function on the reference input of 0.2. Not Saturation at the
beginning
Time, reference,input,output
08:50:46,0,0,0
08:50:47,0,0,0
08:50:48,0,0,0
08:50:49,0,0,0
08:50:50,0,0,0
08:50:51,0.2,0,-0.2086666666666668 P-Part
08:50:52,0.2,0,-0.229166666666667 Integrator-Part
08:50:53,0.2,0,-0.2498333333333339
08:50:54,0.2,0,-0.2701666666666668
08:50:55,0.2,0,-0.2906666666666664
08:50:56,0.2,0,-0.3111666666666659
08:50:57,0.2,0,-0.3313333333333323
08:50:58,0.2,0,-0.3514999999999986
08:50:59,0.2,0,-0.3721666666666648
08:51:00,0.2,0,-0.3926666666666644 Here the reference
value changed from 0.2 to 0
08:51:01,0,0,-0.2114999999999975 There the P-Part = 0
ond we only the the I-Part
08:51:02,0,0,-0.2114999999999975
08:51:03,0,0,-0.2114999999999975
08:51:04,0,0,-0.2114999999999975
08:51:05,0,0,-0.2114999999999975
08:51:06,0,0,-0.2114999999999975
08:51:07,0,0,-0.2114999999999975
08:51:08,0,0,-0.2114999999999975
08:51:10,0,0,-0.2114999999999975
08:51:11,0,0,-0.2114999999999975
08:51:12,0,0,-0.2114999999999975
08:51:13,0,0,-0.2114999999999975
08:51:14,0,0,-0.2114999999999975
08:51:15,0,0,-0.2114999999999975
08:51:16,0,0,-0.2114999999999975
08:51:17,0,0,-0.2114999999999975
08:51:18,0,0,-0.2114999999999975
08:51:19,0,0,-0.2114999999999975
08:51:20,0,0,-0.2114999999999975
08:51:21,-0.2,0,-0.006166666666664115 Here the reference value change
from 0 to 0.2
08:51:22,-0.2,0,0.01416666666666921 The P-Part is added to
the output value
08:51:23,-0.2,0,0.03450000000000255 The I-Part is added to
the output value
08:51:24,-0.2,0,0.05483333333333595
08:51:25,-0.2,0,0.07533333333333593
08:51:26,-0.2,0,0.09566666666666916
08:51:27,-0.2,0,0.1161666666666691
08:51:28,-0.2,0,0.1368333333333358
08:51:29,-0.2,0,0.1571666666666694
08:51:30,-0.2,0,0.1776666666666697
08:51:31,-0.2,0,0.1983333333333365
08:51:32,-0.2,0,0.2186666666666701
08:51:33,-0.2,0,0.2390000000000037
08:51:34,-0.2,0,0.2596666666666703
08:51:35,-0.2,0,0.2800000000000032
08:51:36,-0.2,0,0.3001666666666693
08:51:37,-0.2,0,0.3208333333333356
08:51:38,-0.2,0,0.3410000000000019
08:51:39,-0.2,0,0.3615000000000015
08:51:40,-0.2,0,0.3820000000000011
08:51:41,-0.2,0,0.4026666666666674
08:51:42,-0.2,0,0.423166666666667
08:51:43,0,0,0.2316666666666668 Here the reference
value change from -0.2 to 0
08:51:44,0,0,0.2316666666666668 The P-Part is
subtracted and we have only the I-Part
08:51:45,0,0,0.2316666666666668
08:51:46,0,0,0.2316666666666668
08:51:47,0,0,0.2316666666666668
08:51:48,0,0,0.2316666666666668
08:51:49,0,0,0.2316666666666668
08:51:50,0,0,0.2316666666666668
08:51:51,0,0,0.2316666666666668
08:51:52,0,0,0.2316666666666668
08:51:54,0,0,0.2316666666666668
and so on. The remaining I-Part is responsible for reducing the stady
state error.
Every works fine, when there is no saturation.
Time, reference,input,output
09:09:55,0,0,0
09:09:56,0,0,0
09:09:57,0,0,0
09:09:58,0,0,0
09:09:59,0,0,0
09:10:00,0,0,0
09:10:01,0.6,0,-0.4999999999999999 Jump into saturation. Thats OK.
Only a P-Part, no I-Part
09:10:02,0.6,0,-0.4999999999999999
09:10:03,0.6,0,-0.4999999999999999
09:10:04,0.6,0,-0.4999999999999999
09:10:05,0.6,0,-0.4999999999999999
09:10:06,0.6,0,-0.4999999999999999
09:10:07,0.6,0,-0.4999999999999999
09:10:08,0.6,0,-0.4999999999999999
09:10:09,0.6,0,-0.4999999999999999
09:10:10,0.6,0,-0.4999999999999999
09:10:11,0.6,0,-0.4999999999999999
09:10:12,0.6,0,-0.4999999999999999
09:10:13,0.6,0,-0.4999999999999999
09:10:15,0,0,0.0999999999999999 Here the output value should
return to zero, because there is no I-Part
09:10:16,0,0,0.0999999999999999
09:10:17,0,0,0.0999999999999999
09:10:18,0,0,0.0999999999999999
09:10:19,0,0,0.0999999999999999
09:10:20,0,0,0.0999999999999999
09:10:21,0,0,0.0999999999999999
09:10:22,0,0,0.0999999999999999
09:10:23,0,0,0.0999999999999999
In this example, the output flips from the min saturation
to max-saturation. In a two phase controller (climb - altitude),
it impossible to control the aircraft.
Time, reference,input,output
09:22:08,0,0,0
09:22:09,0,0,0
09:22:10,0,0,0
09:22:11,0,0,0
09:22:12,0,0,0
09:22:13,0,0,0
09:22:14,0,0,0
09:22:15,1.1,0,-0.4999999999999999
09:22:16,1.1,0,-0.4999999999999999
09:22:17,1.1,0,-0.4999999999999999
09:22:18,1.1,0,-0.4999999999999999
09:22:19,1.1,0,-0.4999999999999999
09:22:20,1.1,0,-0.4999999999999999
09:22:21,1.1,0,-0.4999999999999999
09:22:22,1.1,0,-0.4999999999999999
09:22:23,1.1,0,-0.4999999999999999
09:22:24,0,0,0.4999999999999999
09:22:25,0,0,0.4999999999999999
09:22:26,0,0,0.4999999999999999
09:22:27,0,0,0.4999999999999999
09:22:28,0,0,0.4999999999999999
09:22:30,0,0,0.4999999999999999
09:22:31,0,0,0.4999999999999999
09:22:32,0,0,0.4999999999999999
The problem is, that the change of input is store in ep_n.
Only the changes are given to the output. But in saturation
the change is not given to the output because of the windup logic
The controller gets out of sync
Same test with delta_u_n =u_max - u_n_1 and ep_n = (ep_n * u_max
)/(delta_u_n+ u_n_1 );
(My solution. Meanwhile I think it is not necessary to change the
edf_n-value, because the windup
logic is for the integrator part, but I am not completly convinced.
09:50:32,0,0,0
09:50:33,0,0,0
09:50:34,0,0,0
09:50:35,0,0,0
09:50:36,1.1,0,-0.4999999999999999 Jump into min saturation
09:50:37,1.1,0,-0.4999999999999999
09:50:38,1.1,0,-0.4999999999999999
09:50:39,1.1,0,-0.4999999999999999
09:50:40,1.1,0,-0.4999999999999999
09:50:41,0,0,-0.001753948409718153 Back to zero
09:50:42,0,0,-0.001753948409718153
09:50:43,0,0,-0.001753948409718153
09:50:44,0,0,-0.001753948409718153
09:50:45,0,0,-0.001753948409718153
09:50:46,0,0,-0.001753948409718153
09:50:47,0,0,-0.001753948409718153
09:50:49,0,0,-0.001753948409718153
09:50:50,0,0,-0.001753948409718153
09:50:51,0,0,-0.001753948409718153
09:50:52,0,0,-0.001753948409718153
09:50:53,0,0,-0.001753948409718153
09:50:54,0,0,-0.001753948409718153
09:50:55,0,0,-0.001753948409718153
09:50:56,0,0,-0.001753948409718153
09:50:57,0,0,-0.001753948409718153
09:50:58,-1,0,0.4999999999999999 Jump into max saturation
09:50:59,-1,0,0.4999999999999999
09:51:00,-1,0,0.4999999999999999
09:51:01,-1,0,0.4999999999999999
09:51:02,-1,0,0.4999999999999999
09:51:03,-1,0,0.4999999999999999
09:51:04,-1,0,0.4999999999999999
09:51:05,-1,0,0.4999999999999999
09:51:06,0,0,0.001995887497800386 Back to zero and normal
operation below saturation
09:51:07,0,0,0.001995887497800386
09:51:08,0,0,0.001995887497800386
09:51:09,0,0,0.001995887497800386
09:51:10,0,0,0.001995887497800386
09:51:11,0,0,0.001995887497800386
09:51:12,0.1,0,-0.1069207791688662
09:51:13,0.1,0,-0.1169207791688661
09:51:14,0.1,0,-0.1270874458355327
09:51:15,0.1,0,-0.1371707791688663
09:51:16,0.1,0,-0.1472541125021998
09:51:17,0.1,0,-0.1572541125022001
09:51:18,0.1,0,-0.1674207791688669
09:51:19,0.1,0,-0.1775041125022005
09:51:20,0.1,0,-0.1876707791688674
09:51:21,0.1,0,-0.1976707791688676
09:51:22,0.1,0,-0.2076707791688679
09:51:23,0.1,0,-0.2177541125022014
09:51:24,0.1,0,-0.2278374458355349
09:51:25,0.1,0,-0.2378374458355352
09:51:26,0.1,0,-0.2479207791688688
09:51:27,0.1,0,-0.2580041125022013
09:51:28,0.1,0,-0.2680041125022002
09:51:29,0.1,0,-0.2780874458355324
09:51:30,0.1,0,-0.288004112502198
09:51:31,0.1,0,-0.2981707791688636 Jump in reference give a
jump in output and a slow change on the I-part
09:51:32,-0.1,0,-0.09833744583552971
09:51:33,-0.1,0,-0.08817077916886315
09:51:34,-0.1,0,-0.07808744583552991
09:51:35,-0.1,0,-0.06808744583553002
09:51:36,-0.1,0,-0.05808744583553004
09:51:37,-0.1,0,-0.04808744583552998
09:51:38,-0.1,0,-0.03800411250219658
09:51:39,-0.1,0,-0.02792077916886321
09:51:40,-0.1,0,-0.01783744583552989
09:51:41,-0.1,0,-0.007837445835529883
09:51:42,-0.1,0,0.002329220831136784
09:51:43,-0.1,0,0.01232922083113679
09:51:44,-0.1,0,0.02249588749780346
09:51:45,-0.1,0,0.03257922083113678
09:51:46,-0.1,0,0.04257922083113685
09:51:47,-0.1,0,0.05257922083113691
09:51:48,-0.1,0,0.06266255416447031
09:51:49,-0.1,0,0.07282922083113688
09:51:50,-0.1,0,0.07307922083113688
This should work in any situation.
P.S.: The test result for delta_u_n = u_max - U
Here I lost control, because it was to late.
Hans-Georg
What? Where are the results for delta_u_n = u_max - u_n_1?
Am I right in assuming that the results you presented her were
for version 1.19 of xmlauto.cxx and _not_ version 1.20 of xmlauto.cxx?
I use the version 1.19 and change the code and recompiled it
--
Roy Vegard Ovesen
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d