forked from Archive/PX4-Autopilot
VTOL: always set min PWM, not only once on entering a new VTOL phase
Upon a parameter change, pwm_out resets the minimum PWM. VTOL needs to change the min PWM to the actual set idle PWM. Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
parent
b7e563bdbe
commit
b4e66b76a3
|
@ -314,11 +314,6 @@ void Standard::update_transition_state()
|
||||||
}
|
}
|
||||||
|
|
||||||
set_all_motor_state(motor_state::ENABLED);
|
set_all_motor_state(motor_state::ENABLED);
|
||||||
|
|
||||||
// set idle speed for MC actuators
|
|
||||||
if (!_flag_idle_mc) {
|
|
||||||
_flag_idle_mc = set_idle_mc();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mc_weight = math::constrain(mc_weight, 0.0f, 1.0f);
|
mc_weight = math::constrain(mc_weight, 0.0f, 1.0f);
|
||||||
|
|
|
@ -244,10 +244,6 @@ void Tailsitter::update_transition_state()
|
||||||
|
|
||||||
const float trans_pitch_rate = M_PI_2_F / _params->back_trans_duration;
|
const float trans_pitch_rate = M_PI_2_F / _params->back_trans_duration;
|
||||||
|
|
||||||
if (!_flag_idle_mc) {
|
|
||||||
_flag_idle_mc = set_idle_mc();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tilt > 0.01f) {
|
if (tilt > 0.01f) {
|
||||||
_q_trans_sp = Quatf(AxisAnglef(_trans_rot_axis,
|
_q_trans_sp = Quatf(AxisAnglef(_trans_rot_axis,
|
||||||
time_since_trans_start * trans_pitch_rate)) * _q_trans_start;
|
time_since_trans_start * trans_pitch_rate)) * _q_trans_start;
|
||||||
|
|
|
@ -366,12 +366,6 @@ void Tiltrotor::update_transition_state()
|
||||||
// turn on all MC motors
|
// turn on all MC motors
|
||||||
set_all_motor_state(motor_state::ENABLED);
|
set_all_motor_state(motor_state::ENABLED);
|
||||||
|
|
||||||
|
|
||||||
// set idle speed for rotary wing mode
|
|
||||||
if (!_flag_idle_mc) {
|
|
||||||
_flag_idle_mc = set_idle_mc();
|
|
||||||
}
|
|
||||||
|
|
||||||
// tilt rotors back
|
// tilt rotors back
|
||||||
if (_tilt_control > _params_tiltrotor.tilt_mc) {
|
if (_tilt_control > _params_tiltrotor.tilt_mc) {
|
||||||
_tilt_control = _params_tiltrotor.tilt_fw -
|
_tilt_control = _params_tiltrotor.tilt_fw -
|
||||||
|
|
|
@ -136,9 +136,7 @@ bool VtolType::init()
|
||||||
|
|
||||||
void VtolType::update_mc_state()
|
void VtolType::update_mc_state()
|
||||||
{
|
{
|
||||||
if (!_flag_idle_mc) {
|
set_idle_mc();
|
||||||
_flag_idle_mc = set_idle_mc();
|
|
||||||
}
|
|
||||||
|
|
||||||
resetAccelToPitchPitchIntegrator();
|
resetAccelToPitchPitchIntegrator();
|
||||||
|
|
||||||
|
@ -155,9 +153,7 @@ void VtolType::update_mc_state()
|
||||||
|
|
||||||
void VtolType::update_fw_state()
|
void VtolType::update_fw_state()
|
||||||
{
|
{
|
||||||
if (_flag_idle_mc) {
|
set_idle_fw();
|
||||||
_flag_idle_mc = !set_idle_fw();
|
|
||||||
}
|
|
||||||
|
|
||||||
resetAccelToPitchPitchIntegrator();
|
resetAccelToPitchPitchIntegrator();
|
||||||
|
|
||||||
|
|
|
@ -218,8 +218,6 @@ protected:
|
||||||
|
|
||||||
struct Params *_params;
|
struct Params *_params;
|
||||||
|
|
||||||
bool _flag_idle_mc = false; //false = "idle is set for fixed wing mode"; true = "idle is set for multicopter mode"
|
|
||||||
|
|
||||||
bool _pusher_active = false;
|
bool _pusher_active = false;
|
||||||
float _mc_roll_weight = 1.0f; // weight for multicopter attitude controller roll output
|
float _mc_roll_weight = 1.0f; // weight for multicopter attitude controller roll output
|
||||||
float _mc_pitch_weight = 1.0f; // weight for multicopter attitude controller pitch output
|
float _mc_pitch_weight = 1.0f; // weight for multicopter attitude controller pitch output
|
||||||
|
|
Loading…
Reference in New Issue