mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-13 11:29:58 +03:00
Angle pitch offset (for wings) (#14009)
* angle pitch offset (for wings) * made angle_pitch_offset int16, and changed direction to follow BF convention * Update src/main/blackbox/blackbox.c Co-authored-by: Jan Post <Rm2k-Freak@web.de> --------- Co-authored-by: Jan Post <Rm2k-Freak@web.de>
This commit is contained in:
parent
56a3688d7d
commit
89f2ec9880
5 changed files with 12 additions and 0 deletions
|
@ -252,6 +252,7 @@ void resetPidProfile(pidProfile_t *pidProfile)
|
|||
.tpa_speed_max_voltage = 2520,
|
||||
.tpa_speed_pitch_offset = 0,
|
||||
.yaw_type = YAW_TYPE_RUDDER,
|
||||
.angle_pitch_offset = 0,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -496,6 +497,12 @@ STATIC_UNIT_TESTED FAST_CODE_NOINLINE float pidLevel(int axis, const pidProfile_
|
|||
float angleTarget = angleLimit * currentPidSetpoint * maxSetpointRateInv;
|
||||
// use acro rates for the angle target in both horizon and angle modes, converted to -1 to +1 range using maxRate
|
||||
|
||||
#ifdef USE_WING
|
||||
if (axis == FD_PITCH) {
|
||||
angleTarget += (float)pidProfile->angle_pitch_offset / 10.0f;
|
||||
}
|
||||
#endif // USE_WING
|
||||
|
||||
#ifdef USE_GPS_RESCUE
|
||||
angleTarget += gpsRescueAngle[axis] / 100.0f; // Angle is in centidegrees, stepped on roll at 10Hz but not on pitch
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue