]> git.mxchange.org Git - flightgear.git/commitdiff
Fix broken anti windup if the proportional gain runs into the nonlinear area and...
authortorsten <torsten>
Fri, 19 Mar 2010 20:35:47 +0000 (20:35 +0000)
committerTim Moore <timoore33@gmail.com>
Sat, 20 Mar 2010 17:46:19 +0000 (18:46 +0100)
Also fix the wrong debug message.

src/Autopilot/xmlauto.cxx

index 9875ba52448ddefa667309325ced2186da69808c..2a3349ad8cad64da9d8c2a603093a7497e70a48d 100644 (file)
@@ -615,7 +615,7 @@ void FGPISimpleController::update( double dt ) {
                           << " error = " << error
                           << endl;
 
-        double prop_comp = error * Kp.get_value();
+        double prop_comp = clamp(error * Kp.get_value());
         int_sum += error * Ki.get_value() * dt;
 
 
@@ -628,7 +628,7 @@ void FGPISimpleController::update( double dt ) {
                           << " int_sum = " << int_sum << endl;
 
         set_output_value( clamped_output );
-        if ( debug ) cout << "output = " << output << endl;
+        if ( debug ) cout << "output = " << clamped_output << endl;
     }
 }