|
|
|
@ -727,9 +727,35 @@ void Plane::servos_twin_engine_mix(void)
@@ -727,9 +727,35 @@ void Plane::servos_twin_engine_mix(void)
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
Set the flight control servos based on the current calculated values |
|
|
|
|
Set throttle,attitude(in Attitude.cpp), and tilt servos for forced flare by RCx_OPTION switch for landing in FW mode |
|
|
|
|
For Fixed Wind modes with manual throttle control only. Forces tilts up and throttle to THR_MIN. |
|
|
|
|
Throttle stick must be in idle deadzone. This allows non-momentary switch to be used and quick bailouts |
|
|
|
|
for go-arounds. Also helps prevent propstrike after landing with switch release on ground. |
|
|
|
|
*/ |
|
|
|
|
void Plane::force_flare(void) |
|
|
|
|
{ |
|
|
|
|
if (!quadplane.in_transition() && !control_mode->is_vtol_mode() && !auto_throttle_mode && channel_throttle->in_trim_dz() && flare_switch_active) { |
|
|
|
|
int32_t tilt = -SERVO_MAX; //this is tilts up for a normal tiltrotor
|
|
|
|
|
if (quadplane.tilt.tilt_type == QuadPlane::TILT_TYPE_BICOPTER) { |
|
|
|
|
tilt = 0; // this is tilts up for a Bicopter
|
|
|
|
|
} |
|
|
|
|
if (quadplane.is_tailsitter()) { |
|
|
|
|
tilt = SERVO_MAX; //this is tilts up for a tailsitter
|
|
|
|
|
} |
|
|
|
|
SRV_Channels::set_output_scaled(SRV_Channel::k_motor_tilt, tilt); |
|
|
|
|
SRV_Channels::set_output_scaled(SRV_Channel::k_tiltMotorLeft, tilt); |
|
|
|
|
SRV_Channels::set_output_scaled(SRV_Channel::k_tiltMotorRight, tilt); |
|
|
|
|
float throttle_min = MAX(aparm.throttle_min.get(),0); //allows ICE to run if used but accounts for reverse thrust setups
|
|
|
|
|
if (arming.is_armed()) { //prevent running motors if unarmed
|
|
|
|
|
SRV_Channels::set_output_scaled(SRV_Channel::k_throttle, throttle_min); |
|
|
|
|
SRV_Channels::set_output_scaled(SRV_Channel::k_throttleLeft, throttle_min); |
|
|
|
|
SRV_Channels::set_output_scaled(SRV_Channel::k_throttleRight, throttle_min); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* Set the flight control servos based on the current calculated values
|
|
|
|
|
|
|
|
|
|
This function operates by first building up output values for |
|
|
|
|
channels using set_servo() and set_radio_out(). Using |
|
|
|
@ -885,7 +911,6 @@ void Plane::set_servos(void)
@@ -885,7 +911,6 @@ void Plane::set_servos(void)
|
|
|
|
|
servos_output(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
run configured output mixer. This takes calculated servo_out values |
|
|
|
|
for each channel and calculates PWM values, then pushes them to |
|
|
|
@ -902,6 +927,9 @@ void Plane::servos_output(void)
@@ -902,6 +927,9 @@ void Plane::servos_output(void)
|
|
|
|
|
quadplane.tailsitter_output(); |
|
|
|
|
quadplane.tiltrotor_bicopter(); |
|
|
|
|
|
|
|
|
|
// support forced flare option
|
|
|
|
|
force_flare(); |
|
|
|
|
|
|
|
|
|
// run vtail and elevon mixers
|
|
|
|
|
servo_output_mixers(); |
|
|
|
|
|
|
|
|
|