mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
Helicopter: add yaw compensation from throttle CA_HELI_YAW_TH_S
This commit is contained in:
parent
554d965a2d
commit
9ba6f4efb7
@ -58,6 +58,7 @@ ActuatorEffectivenessHelicopter::ActuatorEffectivenessHelicopter(ModuleParams *p
|
||||
}
|
||||
|
||||
_param_handles.yaw_collective_pitch_scale = param_find("CA_HELI_YAW_CP_S");
|
||||
_param_handles.yaw_throttle_scale = param_find("CA_HELI_YAW_TH_S");
|
||||
|
||||
updateParams();
|
||||
}
|
||||
@ -88,6 +89,7 @@ void ActuatorEffectivenessHelicopter::updateParams()
|
||||
}
|
||||
|
||||
param_get(_param_handles.yaw_collective_pitch_scale, &_geometry.yaw_collective_pitch_scale);
|
||||
param_get(_param_handles.yaw_throttle_scale, &_geometry.yaw_throttle_scale);
|
||||
}
|
||||
|
||||
bool
|
||||
@ -138,7 +140,8 @@ void ActuatorEffectivenessHelicopter::updateSetpoint(const matrix::Vector<float,
|
||||
|
||||
actuator_sp(0) = throttle;
|
||||
actuator_sp(1) = control_sp(ControlAxis::YAW)
|
||||
+ fabsf(collective_pitch) * _geometry.yaw_collective_pitch_scale;
|
||||
+ fabsf(collective_pitch) * _geometry.yaw_collective_pitch_scale
|
||||
+ throttle * _geometry.yaw_throttle_scale;
|
||||
|
||||
for (int i = 0; i < _geometry.num_swash_plate_servos; i++) {
|
||||
actuator_sp(_first_swash_plate_servo_index + i) = collective_pitch
|
||||
|
||||
@ -55,6 +55,7 @@ public:
|
||||
float throttle_curve[NUM_CURVE_POINTS];
|
||||
float pitch_curve[NUM_CURVE_POINTS];
|
||||
float yaw_collective_pitch_scale;
|
||||
float yaw_throttle_scale;
|
||||
};
|
||||
|
||||
ActuatorEffectivenessHelicopter(ModuleParams *parent);
|
||||
@ -82,6 +83,7 @@ private:
|
||||
param_t throttle_curve[NUM_CURVE_POINTS];
|
||||
param_t pitch_curve[NUM_CURVE_POINTS];
|
||||
param_t yaw_collective_pitch_scale;
|
||||
param_t yaw_throttle_scale;
|
||||
};
|
||||
ParamHandles _param_handles{};
|
||||
|
||||
|
||||
@ -444,7 +444,7 @@ parameters:
|
||||
default: [0.05, 0.15, 0.25, 0.35, 0.45]
|
||||
CA_HELI_YAW_CP_S:
|
||||
description:
|
||||
short: Yaw scaling by collective pitch
|
||||
short: Scale for yaw compensation based on collective pitch
|
||||
long: |
|
||||
This allows to add a proportional factor of the collective pitch command to the yaw command.
|
||||
|
||||
@ -455,6 +455,19 @@ parameters:
|
||||
min: -2
|
||||
max: 2
|
||||
default: 0.0
|
||||
CA_HELI_YAW_TH_S:
|
||||
description:
|
||||
short: Scale for yaw compensation based on throttle
|
||||
long: |
|
||||
This allows to add a proportional factor of the throttle command to the yaw command.
|
||||
|
||||
tail_output += CA_HELI_YAW_TH_S * throttle
|
||||
type: float
|
||||
decimal: 3
|
||||
increment: 0.1
|
||||
min: -2
|
||||
max: 2
|
||||
default: 0.0
|
||||
|
||||
# Others
|
||||
CA_FAILURE_MODE:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user