Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/Settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -7208,7 +7208,7 @@ Fixed wing only. Pitch angle based bias for TPA. Used as a proxy for airspeed wh

### tpa_rate

Throttle based PID attenuation(TPA) reduces influence of PDFF on ROLL and PITCH of multi-rotor, PIDFF on ROLL,PITCH,YAW OF fixed_wing as throttle increases. On multirotor, For every 1% throttle after the TPA breakpoint, P is reduced by the TPA rate. for fixedwing modifies PIDFF. See **PID Attenuation and scaling** Wiki for full details.
Throttle PID attenuation (TPA) changes affect of PDFF on ROLL and PITCH of multi-rotor or PIDFF on ROLL, PITCH and YAW of fixed_wing as throttle changes. On multirotor PDFF is reduced by the TPA rate for every 1% throttle increase after the TPA breakpoint (Note: tpa_rate is limited to max of 100 for multirotor). For fixed wing it modifies PIDFF with additional pitch related throttle compensation if tpa_pitch_compensation set. See **PID Attenuation and scaling** Wiki for full details.

| Default | Min | Max |
| --- | --- | --- |
Expand Down
8 changes: 4 additions & 4 deletions docs/development/msp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1994,7 +1994,7 @@ When the MSP JSON specification changes, bump `msp_messages.json` version:
| `dynamicThrottlePID` | `uint8_t` | 1 | Dynamic Throttle PID (TPA) value (`currentControlRateProfile->throttle.dynPID`) |
| `throttleMid` | `uint8_t` | 1 | Throttle Midpoint (`currentControlRateProfile->throttle.rcMid8`) |
| `throttleExpo` | `uint8_t` | 1 | Throttle Expo (`currentControlRateProfile->throttle.rcExpo8`) |
| `tpaBreakpoint` | `uint16_t` | 2 | Throttle PID Attenuation (TPA) breakpoint (`currentControlRateProfile->throttle.pa_breakpoint`) |
| `tpaBreakpoint` | `uint16_t` | 2 | Throttle PID Attenuation (TPA) breakpoint (`currentControlRateProfile->throttle.tpa_breakpoint`) |
| `rcYawExpo` | `uint8_t` | 1 | Yaw RC Expo (`currentControlRateProfile->stabilized.rcYawExpo8`) |

**Notes:** Superseded by `MSP2_INAV_RATE_PROFILE` which includes manual rates/expos.
Expand Down Expand Up @@ -2421,7 +2421,7 @@ When the MSP JSON specification changes, bump `msp_messages.json` version:
| `dynamicThrottlePID` | `uint8_t` | 1 | Sets `currentControlRateProfile->throttle.dynPID` (constrained) |
| `throttleMid` | `uint8_t` | 1 | Sets `currentControlRateProfile->throttle.rcMid8` |
| `throttleExpo` | `uint8_t` | 1 | Sets `currentControlRateProfile->throttle.rcExpo8` |
| `tpaBreakpoint` | `uint16_t` | 2 | Sets `currentControlRateProfile->throttle.pa_breakpoint` |
| `tpaBreakpoint` | `uint16_t` | 2 | Sets `currentControlRateProfile->throttle.tpa_breakpoint` |
| `rcYawExpo` | `uint8_t` | 1 | (Optional) Sets `currentControlRateProfile->stabilized.rcYawExpo8` |

**Reply Payload:** **None**
Expand Down Expand Up @@ -3315,7 +3315,7 @@ When the MSP JSON specification changes, bump `msp_messages.json` version:
| `throttleMid` | `uint8_t` | 1 | Throttle Midpoint (`currentControlRateProfile->throttle.rcMid8`) |
| `throttleExpo` | `uint8_t` | 1 | Throttle Expo (`currentControlRateProfile->throttle.rcExpo8`) |
| `dynamicThrottlePID` | `uint8_t` | 1 | TPA value (`currentControlRateProfile->throttle.dynPID`) |
| `tpaBreakpoint` | `uint16_t` | 2 | TPA breakpoint (`currentControlRateProfile->throttle.pa_breakpoint`) |
| `tpaBreakpoint` | `uint16_t` | 2 | TPA breakpoint (`currentControlRateProfile->throttle.tpa_breakpoint`) |
| `stabRcExpo` | `uint8_t` | 1 | Stabilized Roll/Pitch Expo (`currentControlRateProfile->stabilized.rcExpo8`) |
| `stabRcYawExpo` | `uint8_t` | 1 | Stabilized Yaw Expo (`currentControlRateProfile->stabilized.rcYawExpo8`) |
| `stabRollRate` | `uint8_t` | 1 | Stabilized Roll Rate (`currentControlRateProfile->stabilized.rates[FD_ROLL]`) |
Expand All @@ -3336,7 +3336,7 @@ When the MSP JSON specification changes, bump `msp_messages.json` version:
| `throttleMid` | `uint8_t` | 1 | Sets `currentControlRateProfile->throttle.rcMid8` |
| `throttleExpo` | `uint8_t` | 1 | Sets `currentControlRateProfile->throttle.rcExpo8` |
| `dynamicThrottlePID` | `uint8_t` | 1 | Sets `currentControlRateProfile->throttle.dynPID` |
| `tpaBreakpoint` | `uint16_t` | 2 | Sets `currentControlRateProfile->throttle.pa_breakpoint` |
| `tpaBreakpoint` | `uint16_t` | 2 | Sets `currentControlRateProfile->throttle.tpa_breakpoint` |
| `stabRcExpo` | `uint8_t` | 1 | Sets `currentControlRateProfile->stabilized.rcExpo8` |
| `stabRcYawExpo` | `uint8_t` | 1 | Sets `currentControlRateProfile->stabilized.rcYawExpo8` |
| `stabRollRate` | `uint8_t` | 1 | Sets `currentControlRateProfile->stabilized.rates[FD_ROLL]` (constrained) |
Expand Down
8 changes: 4 additions & 4 deletions docs/development/msp/msp_messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -4022,7 +4022,7 @@
{
"name": "tpaBreakpoint",
"ctype": "uint16_t",
"desc": "Throttle PID Attenuation (TPA) breakpoint (`currentControlRateProfile->throttle.pa_breakpoint`)",
"desc": "Throttle PID Attenuation (TPA) breakpoint (`currentControlRateProfile->throttle.tpa_breakpoint`)",
"units": ""
},
{
Expand Down Expand Up @@ -5127,7 +5127,7 @@
{
"name": "tpaBreakpoint",
"ctype": "uint16_t",
"desc": "Sets `currentControlRateProfile->throttle.pa_breakpoint`",
"desc": "Sets `currentControlRateProfile->throttle.tpa_breakpoint`",
"units": ""
},
{
Expand Down Expand Up @@ -7447,7 +7447,7 @@
{
"name": "tpaBreakpoint",
"ctype": "uint16_t",
"desc": "TPA breakpoint (`currentControlRateProfile->throttle.pa_breakpoint`)",
"desc": "TPA breakpoint (`currentControlRateProfile->throttle.tpa_breakpoint`)",
"units": ""
},
{
Expand Down Expand Up @@ -7541,7 +7541,7 @@
{
"name": "tpaBreakpoint",
"ctype": "uint16_t",
"desc": "Sets `currentControlRateProfile->throttle.pa_breakpoint`",
"desc": "Sets `currentControlRateProfile->throttle.tpa_breakpoint`",
"units": ""
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/main/blackbox/blackbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -2057,7 +2057,7 @@ static bool blackboxWriteSysinfo(void)
BLACKBOX_PRINT_HEADER_LINE("thr_mid", "%d", currentControlProfile->throttle.rcMid8);
BLACKBOX_PRINT_HEADER_LINE("thr_expo", "%d", currentControlProfile->throttle.rcExpo8);
BLACKBOX_PRINT_HEADER_LINE("tpa_rate", "%d", currentControlProfile->throttle.dynPID);
BLACKBOX_PRINT_HEADER_LINE("tpa_breakpoint", "%d", currentControlProfile->throttle.pa_breakpoint);
BLACKBOX_PRINT_HEADER_LINE("tpa_breakpoint", "%d", currentControlProfile->throttle.tpa_breakpoint);
BLACKBOX_PRINT_HEADER_LINE("rates", "%d,%d,%d", currentControlProfile->stabilized.rates[ROLL],
currentControlProfile->stabilized.rates[PITCH],
currentControlProfile->stabilized.rates[YAW]);
Expand Down
2 changes: 1 addition & 1 deletion src/main/fc/control_profile.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void pgResetFn_controlProfiles(controlConfig_t *instance)
.rcExpo8 = SETTING_THR_EXPO_DEFAULT,
.dynPID = SETTING_TPA_RATE_DEFAULT,
.dynPID_on_YAW = SETTING_TPA_ON_YAW_DEFAULT,
.pa_breakpoint = SETTING_TPA_BREAKPOINT_DEFAULT,
.tpa_breakpoint = SETTING_TPA_BREAKPOINT_DEFAULT,
.fixedWingTauMs = SETTING_FW_TPA_TIME_CONSTANT_DEFAULT,
.apa_pow = SETTING_APA_POW_DEFAULT,
.tpa_pitch_compensation = SETTING_TPA_PITCH_COMPENSATION_DEFAULT
Expand Down
6 changes: 3 additions & 3 deletions src/main/fc/control_profile_config_struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ typedef struct controlConfig_s {
uint8_t rcExpo8;
uint8_t dynPID;
bool dynPID_on_YAW;
uint16_t pa_breakpoint; // Breakpoint where TPA is activated
uint16_t fixedWingTauMs; // Time constant of airplane TPA PT1-filter
uint16_t apa_pow; // Use airspeed instead of throttle position for TPA calculation,0 to disable
uint16_t tpa_breakpoint; // Breakpoint where TPA is activated
Comment thread
qodo-free-for-open-source-projects[bot] marked this conversation as resolved.
uint16_t fixedWingTauMs; // Time constant of airplane TPA PT1-filter
uint16_t apa_pow; // Use airspeed instead of throttle position for TPA calculation,0 to disable
uint8_t tpa_pitch_compensation; // Pitch angle based throttle compensation for fixed wing
} throttle;

Expand Down
12 changes: 6 additions & 6 deletions src/main/fc/fc_msp.c
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ static bool mspFcProcessOutCommand(uint16_t cmdMSP, sbuf_t *dst, mspPostProcessF
sbufWriteU8(dst, currentControlProfile->throttle.dynPID);
sbufWriteU8(dst, currentControlProfile->throttle.rcMid8);
sbufWriteU8(dst, currentControlProfile->throttle.rcExpo8);
sbufWriteU16(dst, currentControlProfile->throttle.pa_breakpoint);
sbufWriteU16(dst, currentControlProfile->throttle.tpa_breakpoint);
sbufWriteU8(dst, currentControlProfile->stabilized.rcYawExpo8);
break;

Expand All @@ -820,7 +820,7 @@ static bool mspFcProcessOutCommand(uint16_t cmdMSP, sbuf_t *dst, mspPostProcessF
sbufWriteU8(dst, currentControlProfile->throttle.rcMid8);
sbufWriteU8(dst, currentControlProfile->throttle.rcExpo8);
sbufWriteU8(dst, currentControlProfile->throttle.dynPID);
sbufWriteU16(dst, currentControlProfile->throttle.pa_breakpoint);
sbufWriteU16(dst, currentControlProfile->throttle.tpa_breakpoint);

// stabilized
sbufWriteU8(dst, currentControlProfile->stabilized.rcExpo8);
Expand Down Expand Up @@ -2150,15 +2150,15 @@ typedef struct PACKED {
uint8_t dynPID;
uint8_t throttleRcMid8;
uint8_t throttleRcExpo8;
uint16_t throttlePaBreakpoint;
uint16_t throttleTpaBreakpoint;
} mspSetRcTuning_t;
STATIC_ASSERT(sizeof(mspSetRcTuning_t) == 10, mspSetRcTuning_t_size);

typedef struct PACKED {
uint8_t throttleRcMid8;
uint8_t throttleRcExpo8;
uint8_t throttleDynPID;
uint16_t throttlePaBreakpoint;
uint16_t throttleTpaBreakpoint;
uint8_t stabilizedRcExpo8;
uint8_t stabilizedRcYawExpo8;
uint8_t stabilizedRollRate;
Expand Down Expand Up @@ -2312,7 +2312,7 @@ static mspResult_e mspFcProcessInCommand(uint16_t cmdMSP, sbuf_t *src)
currentControlProfile_p->throttle.dynPID = MIN(pkt.dynPID, SETTING_TPA_RATE_MAX);
currentControlProfile_p->throttle.rcMid8 = pkt.throttleRcMid8;
currentControlProfile_p->throttle.rcExpo8 = pkt.throttleRcExpo8;
currentControlProfile_p->throttle.pa_breakpoint = pkt.throttlePaBreakpoint;
currentControlProfile_p->throttle.tpa_breakpoint = pkt.throttleTpaBreakpoint;

if (dataSize > sizeof(mspSetRcTuning_t)) {
uint8_t rcYawExpo8;
Expand Down Expand Up @@ -2343,7 +2343,7 @@ static mspResult_e mspFcProcessInCommand(uint16_t cmdMSP, sbuf_t *src)
currentControlProfile_p->throttle.rcMid8 = pkt.throttleRcMid8;
currentControlProfile_p->throttle.rcExpo8 = pkt.throttleRcExpo8;
currentControlProfile_p->throttle.dynPID = pkt.throttleDynPID;
currentControlProfile_p->throttle.pa_breakpoint = pkt.throttlePaBreakpoint;
currentControlProfile_p->throttle.tpa_breakpoint = pkt.throttleTpaBreakpoint;

// stabilized
currentControlProfile_p->stabilized.rcExpo8 = pkt.stabilizedRcExpo8;
Expand Down
2 changes: 1 addition & 1 deletion src/main/fc/rc_adjustments.c
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ static void applyStepAdjustment(controlConfig_t *controlConfig, uint8_t adjustme
applyAdjustmentU8(ADJUSTMENT_TPA, &controlConfig->throttle.dynPID, delta, 0, SETTING_TPA_RATE_MAX);
break;
case ADJUSTMENT_TPA_BREAKPOINT:
applyAdjustmentU16(ADJUSTMENT_TPA_BREAKPOINT, &controlConfig->throttle.pa_breakpoint, delta, PWM_RANGE_MIN, PWM_RANGE_MAX);
applyAdjustmentU16(ADJUSTMENT_TPA_BREAKPOINT, &controlConfig->throttle.tpa_breakpoint, delta, PWM_RANGE_MIN, PWM_RANGE_MAX);
break;
case ADJUSTMENT_FW_TPA_TIME_CONSTANT:
applyAdjustmentU16(ADJUSTMENT_FW_TPA_TIME_CONSTANT, &controlConfig->throttle.fixedWingTauMs, delta, SETTING_FW_TPA_TIME_CONSTANT_MIN, SETTING_FW_TPA_TIME_CONSTANT_MAX);
Expand Down
4 changes: 2 additions & 2 deletions src/main/fc/settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1457,15 +1457,15 @@ groups:
min: 0
max: 200
- name: tpa_rate
description: "Throttle based PID attenuation(TPA) reduces influence of PDFF on ROLL and PITCH of multi-rotor, PIDFF on ROLL,PITCH,YAW OF fixed_wing as throttle increases. On multirotor, For every 1% throttle after the TPA breakpoint, P is reduced by the TPA rate. for fixedwing modifies PIDFF. See **PID Attenuation and scaling** Wiki for full details."
description: "Throttle PID attenuation (TPA) changes affect of PDFF on ROLL and PITCH of multi-rotor or PIDFF on ROLL, PITCH and YAW of fixed_wing as throttle changes. On multirotor PDFF is reduced by the TPA rate for every 1% throttle increase after the TPA breakpoint (Note: tpa_rate is limited to max of 100 for multirotor). For fixed wing it modifies PIDFF with additional pitch related throttle compensation if tpa_pitch_compensation set. See **PID Attenuation and scaling** Wiki for full details."
default_value: 0
field: throttle.dynPID
min: 0
max: 200
- name: tpa_breakpoint
description: "See tpa_rate."
default_value: 1500
field: throttle.pa_breakpoint
field: throttle.tpa_breakpoint
min: PWM_RANGE_MIN
max: PWM_RANGE_MAX
- name: tpa_pitch_compensation
Expand Down
Loading
Loading