Re: [Flightgear-devel] PID Controller =?iso-8859-1?q?Bug??=

2005-09-29 Thread Roy Vegard Ovesen
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.02549   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 ;-).

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.19r2=1.20cvsroot=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. 

P.S.: The test result for delta_u_n = u_max - U

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?

--
Roy Vegard Ovesen


___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-devel] PID Controller =?iso-8859-1?q?Bug??=

2005-09-29 Thread Hans-Georg Wunder

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.02549   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.08006P-Part ist missing
 08:51:09,0.6,0,-0.14050001
 08:51:10,0.6,0,-0.2011
 08:51:11,0.6,0,-0.26150002
 08:51:12,0.6,0,-0.32250002
 08:51:13,0.6,0,-0.3833
 08:51:14,0.6,0,-0.44350003
 08:51:15,0.6,0,-0.4994
 08:51:16,0.6,0,-0.4994



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.19r2=1.20cvsroot=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.2088 P-Part
 08:50:52,0.2,0,-0.2291667  Integrator-Part
 08:50:53,0.2,0,-0.24983339
 08:50:54,0.2,0,-0.27016668
 08:50:55,0.2,0,-0.2904
 08:50:56,0.2,0,-0.31116659
 08:50:57,0.2,0,-0.33133323
 08:50:58,0.2,0,-0.35149986
 08:50:59,0.2,0,-0.37216648
 08:51:00,0.2,0,-0.39266644 Here the reference 
value changed from 0.2 to 0
 08:51:01,0,0,-0.21149975   There the P-Part = 0 
ond we only the the I-Part

 08:51:02,0,0,-0.21149975
 08:51:03,0,0,-0.21149975
 08:51:04,0,0,-0.21149975
 08:51:05,0,0,-0.21149975
 08:51:06,0,0,-0.21149975
 08:51:07,0,0,-0.21149975
 08:51:08,0,0,-0.21149975
 08:51:10,0,0,-0.21149975
 08:51:11,0,0,-0.21149975
 08:51:12,0,0,-0.21149975
 08:51:13,0,0,-0.21149975
 08:51:14,0,0,-0.21149975
 08:51:15,0,0,-0.21149975
 08:51:16,0,0,-0.21149975
 08:51:17,0,0,-0.21149975
 08:51:18,0,0,-0.21149975
 08:51:19,0,0,-0.21149975
 08:51:20,0,0,-0.21149975
 08:51:21,-0.2,0,-0.0061664115  Here the reference value change 
from 0 to 0.2
 08:51:22,-0.2,0,0.014166921The P-Part is added to 
the output value
 08:51:23,-0.2,0,0.034500255The I-Part is added to 
the output value

 08:51:24,-0.2,0,0.054833595
 08:51:25,-0.2,0,0.075333593
 08:51:26,-0.2,0,0.095666916
 08:51:27,-0.2,0,0.11616691
 08:51:28,-0.2,0,0.13683358
 08:51:29,-0.2,0,0.15716694
 08:51:30,-0.2,0,0.17766697
 08:51:31,-0.2,0,0.19833365
 08:51:32,-0.2,0,0.21866701
 08:51:33,-0.2,0,0.23900037
 08:51:34,-0.2,0,0.25966703
 08:51:35,-0.2,0,0.2832
 08:51:36,-0.2,0,0.30016693
 08:51:37,-0.2,0,0.32083356
 08:51:38,-0.2,0,0.34100019
 08:51:39,-0.2,0,0.36150015
 08:51:40,-0.2,0,0.38200011
 08:51:41,-0.2,0,0.40266674
 08:51:42,-0.2,0,0.4231667
 08:51:43,0,0,0.2318Here the reference 
value change from -0.2 to 0
 08:51:44,0,0,0.2318The P-Part is 
subtracted and we have only the I-Part

 08:51:45,0,0,0.2318