mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-18 22:05:15 +03:00
Added deadband to fixedWingPitchToThrottleCorrection for testing
This commit is contained in:
parent
19e882fea3
commit
9ef10703de
1 changed files with 14 additions and 1 deletions
|
@ -463,7 +463,20 @@ int16_t applyFixedWingMinSpeedController(timeUs_t currentTimeUs)
|
||||||
|
|
||||||
int16_t fixedWingPitchToThrottleCorrection(int16_t pitch)
|
int16_t fixedWingPitchToThrottleCorrection(int16_t pitch)
|
||||||
{
|
{
|
||||||
return DECIDEGREES_TO_DEGREES(pitch) * navConfig()->fw.pitch_to_throttle;
|
const int16_t pitch_to_throttle_deadband = 30;
|
||||||
|
|
||||||
|
if (pitch > pitch_to_throttle_deadband) {
|
||||||
|
// Above positive pitch deadband
|
||||||
|
return DECIDEGREES_TO_DEGREES(pitch - pitch_to_throttle_deadband) * navConfig()->fw.pitch_to_throttle;
|
||||||
|
}
|
||||||
|
else if (pitch < -pitch_to_throttle_deadband) {
|
||||||
|
// Below negative pitch deadband
|
||||||
|
return DECIDEGREES_TO_DEGREES(pitch + pitch_to_throttle_deadband) * navConfig()->fw.pitch_to_throttle;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// Inside deadband
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void applyFixedWingPitchRollThrottleController(navigationFSMStateFlags_t navStateFlags, timeUs_t currentTimeUs)
|
void applyFixedWingPitchRollThrottleController(navigationFSMStateFlags_t navStateFlags, timeUs_t currentTimeUs)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue