diff options
author | Thomas Gubler <thomasgubler@gmail.com> | 2014-01-02 12:26:07 -0800 |
---|---|---|
committer | Thomas Gubler <thomasgubler@gmail.com> | 2014-01-02 12:26:07 -0800 |
commit | 065badf980d2de7288ed2b41d3a476132f3d1f78 (patch) | |
tree | e94c9ca7c865a9c38cdb3e6bb6f2f232e89d6ea6 /src | |
parent | b2ef7f506cd433fb30332d7ab3e27134334f362f (diff) | |
parent | c4c652e9c629a11c5b113d4d26773fb54ff62af5 (diff) | |
download | px4-firmware-065badf980d2de7288ed2b41d3a476132f3d1f78.tar.gz px4-firmware-065badf980d2de7288ed2b41d3a476132f3d1f78.tar.bz2 px4-firmware-065badf980d2de7288ed2b41d3a476132f3d1f78.zip |
Merge pull request #576 from PX4/tecs_climbout
tecs: change pitch on climbout #559
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/external_lgpl/tecs/tecs.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lib/external_lgpl/tecs/tecs.cpp b/src/lib/external_lgpl/tecs/tecs.cpp index a733ef1d2..1d5c85699 100644 --- a/src/lib/external_lgpl/tecs/tecs.cpp +++ b/src/lib/external_lgpl/tecs/tecs.cpp @@ -404,10 +404,18 @@ void TECS::_update_pitch(void) // Apply max and min values for integrator state that will allow for no more than // 5deg of saturation. This allows for some pitch variation due to gusts before the // integrator is clipped. Otherwise the effectiveness of the integrator will be reduced in turbulence + // During climbout/takeoff, bias the demanded pitch angle so that zero speed error produces a pitch angle + // demand equal to the minimum value (which is )set by the mission plan during this mode). Otherwise the + // integrator has to catch up before the nose can be raised to reduce speed during climbout. float gainInv = (_integ5_state * _timeConst * CONSTANTS_ONE_G); float temp = SEB_error + SEBdot_error * _ptchDamp + SEBdot_dem * _timeConst; + if (_climbOutDem) + { + temp += _PITCHminf * gainInv; + } _integ7_state = constrain(_integ7_state, (gainInv * (_PITCHminf - 0.0783f)) - temp, (gainInv * (_PITCHmaxf + 0.0783f)) - temp); + // Calculate pitch demand from specific energy balance signals _pitch_dem_unc = (temp + _integ7_state) / gainInv; |