Helicopter: More intuitive yaw direction configuration for the common cases

This commit is contained in:
Matthias Grob 2022-08-30 11:32:19 +02:00 committed by Beat Küng
parent f233f2167e
commit 115cf4d572
No known key found for this signature in database
GPG Key ID: 866DB5F0E24821BB
2 changed files with 9 additions and 5 deletions

View File

@ -134,10 +134,9 @@ void ActuatorEffectivenessHelicopter::updateSetpoint(const matrix::Vector<float,
// actuator mapping
actuator_sp(0) = mainMotorEnaged() ? throttle : NAN;
actuator_sp(1) = control_sp(ControlAxis::YAW)
actuator_sp(1) = control_sp(ControlAxis::YAW) * _geometry.yaw_sign
+ fabsf(collective_pitch) * _geometry.yaw_collective_pitch_scale
+ throttle * _geometry.yaw_throttle_scale;
actuator_sp(1) *= _geometry.yaw_sign;
for (int i = 0; i < _geometry.num_swash_plate_servos; i++) {
actuator_sp(_first_swash_plate_servo_index + i) = collective_pitch

View File

@ -449,6 +449,7 @@ parameters:
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.
A negative value is needed when positive thrust of the tail rotor rotates the vehicle opposite to the main rotor turn direction.
tail_output += CA_HELI_YAW_CP_S * collective_pitch
type: float
@ -462,6 +463,7 @@ parameters:
short: Scale for yaw compensation based on throttle
long: |
This allows to add a proportional factor of the throttle command to the yaw command.
A negative value is needed when positive thrust of the tail rotor rotates the vehicle opposite to the main rotor turn direction.
tail_output += CA_HELI_YAW_TH_S * throttle
type: float
@ -472,9 +474,12 @@ parameters:
default: 0.0
CA_HELI_YAW_CCW:
description:
short: Change yaw direction
short: Main rotor turns counter-clockwise
long: |
By default, positive thrust of the tail rotor is expected to rotate the vehicle clockwise. Set this parameter to true if the tail rotor provides thrust in the other direciton.
Default configuration is for a clockwise turning main rotor and
positive thrust of the tail rotor is expected to rotate the vehicle clockwise.
Set this parameter to true if the tail rotor provides thrust in counter-clockwise direction
which is mostly the case when the main rotor turns counter-clockwise.
type: boolean
default: 0
@ -930,7 +935,7 @@ mixer:
name: CA_HELI_YAW_CP_S
- label: 'Yaw compensation scale based on throttle'
name: CA_HELI_YAW_TH_S
- label: 'Yaw direction is CCW'
- label: 'Main rotor turns counter-clockwise'
name: CA_HELI_YAW_CCW
- label: 'Throttle spoolup time'
name: COM_SPOOLUP_TIME