mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-22 07:44:03 -04:00
Plane: added scaling for Q_TAILSIT_VFGAIN
this scales the vectoring in fixed wing flight to remove the impact of surface speed scaling and add throttle scaling
This commit is contained in:
parent
a0fcef6ceb
commit
96c2a5c77c
@ -108,11 +108,13 @@ void QuadPlane::tailsitter_output(void)
|
||||
|
||||
// in forward flight: set motor tilt servos and throttles using FW controller
|
||||
if (tailsitter.vectored_forward_gain > 0) {
|
||||
// remove scaling from surface speed scaling and apply throttle scaling
|
||||
const float scaler = plane.control_mode == &plane.mode_manual?1:(tilt_throttle_scaling() / plane.get_speed_scaler());
|
||||
// thrust vectoring in fixed wing flight
|
||||
float aileron = SRV_Channels::get_output_scaled(SRV_Channel::k_aileron);
|
||||
float elevator = SRV_Channels::get_output_scaled(SRV_Channel::k_elevator);
|
||||
tilt_left = (elevator + aileron) * tailsitter.vectored_forward_gain;
|
||||
tilt_right = (elevator - aileron) * tailsitter.vectored_forward_gain;
|
||||
tilt_left = (elevator + aileron) * tailsitter.vectored_forward_gain * scaler;
|
||||
tilt_right = (elevator - aileron) * tailsitter.vectored_forward_gain * scaler;
|
||||
}
|
||||
SRV_Channels::set_output_scaled(SRV_Channel::k_tiltMotorLeft, tilt_left);
|
||||
SRV_Channels::set_output_scaled(SRV_Channel::k_tiltMotorRight, tilt_right);
|
||||
|
Loading…
Reference in New Issue
Block a user