I hope, this description is not to long, but I think it is very important to have a working controller code First the test results, at the end you will find the test decription for the test controller and a little nasal script for logging.

o Behaviour with delta_u_n = 0 and an input jump function of 0.2 No saturation at the beginning.

Time, reference,input,output
 21:59:17,0,0,0
 21:59:18,0,0,0
21:59:19,0,0.2,0.2008333333333333 Here I changed the input value from 0 to 0.2 and we see the proportionel gain of -1 (P-part)
 21:59:20,0,0.2,0.2211666666666665   Here the integrator part is added.
 21:59:21,0,0.2,0.2414999999999997
 21:59:22,0,0.2,0.2618333333333332
 21:59:23,0,0.2,0.2820000000000002
 21:59:24,0,0.2,0.3025000000000005
 21:59:25,0,0.2,0.3228333333333342
 21:59:26,0,0.2,0.3428333333333345
 21:59:27,0,0.2,0.3631666666666682
 21:59:28,0,0.2,0.3835000000000018
 21:59:29,0,0.2,0.4038333333333355
 21:59:30,0,0.2,0.4243333333333358
 21:59:31,0,0.2,0.4446666666666694
 21:59:32,0,0.2,0.4650000000000031
 21:59:33,0,0.2,0.4853333333333367
21:59:34,0,0.2,0.4995000000000036 Here the windup logic limits the output value to 0.5
 21:59:35,0,0.2,0.4995000000000036
 21:59:36,0,0.2,0.4995000000000036
 21:59:37,0,0.2,0.4995000000000036
 21:59:38,0,0.2,0.4995000000000036
 21:59:39,0,0.2,0.4995000000000036
 21:59:40,0,0.2,0.4995000000000036
 21:59:41,0,0.2,0.4995000000000036
 21:59:42,0,0.2,0.4995000000000036
 21:59:43,0,0.2,0.4995000000000036
 21:59:44,0,0.2,0.4995000000000036
 21:59:45,0,0.2,0.4995000000000036

Everything is fine !!!!!!!!!
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
 21:57:00,0,0.6,0.08800000000000003
 21:57:01,0,0.6,0.1505000000000001
 21:57:02,0,0.6,0.2130000000000001
 21:57:03,0,0.6,0.2730000000000002
 21:57:04,0,0.6,0.3335000000000002
 21:57:05,0,0.6,0.3935000000000003
 21:57:06,0,0.6,0.4530000000000003
 21:57:07,0,0.6,0.4995000000000004

Kind regards

Hans-Georg

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

Test controller:

  <pid-controller>
    <name>Test controller</name>
    <debug>false</debug>
    <enable>
      <prop>/autopilot/test/status</prop>
      <value>go</value>
    </enable>
    <input>
      <prop>/autopilot/test/input</prop>
    </input>
    <reference>
      <prop>/autopilot/test/reference</prop>
    </reference>
    <output>
      <prop>/autopilot/test/output</prop>
    </output>
    <config>
      <Kp>-1</Kp>                      <!-- proportional gain -->
      <beta>1</beta>                 <!-- input value weighing factor -->
      <alpha>1</alpha>             <!-- low pass filter weighing factor -->
      <gamma>0.0</gamma>     <!-- input value weighing factor for -->
<!-- unfiltered derivative error -->
      <Ti>1</Ti>                        <!-- integrator time -->
      <Td>0</Td>                      <!-- derivator time -->
      <u_min>-0.5</u_min>      <!-- minimum output clamp -->
      <u_max>0.5</u_max>      <!-- maximum output clamp -->
    </config>
  </pid-controller>


For logging puposes I wrote a little nasal script:

#
#  Function to log
#
print_test = func {
     ref_log    = getprop("/autopilot/test/reference");
     input_log  = getprop("/autopilot/test/input");
     output_log         = getprop("/autopilot/test/output");
     time_log   = getprop("/sim/time/gmt-string");

     print(time_log,",",ref_log,",", input_log,",",output_log);

# Re-schedule the next call
   if(getprop("/autopilot/test/status") != "go") {
     print("Log disabled");
      } else {
#    print("Set timer");
    settimer(print_test,1);
      }
}

Kind regards

Hans-Georg

_______________________________________________
Flightgear-devel mailing list
[email protected]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d

Reply via email to