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:
Silvan Fuhrer 2021-05-20 17:45:28 +02:00
parent b7e563bdbe
commit b4e66b76a3
5 changed files with 2 additions and 23 deletions

View File

@ -314,11 +314,6 @@ void Standard::update_transition_state()
}
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);

View File

@ -244,10 +244,6 @@ void Tailsitter::update_transition_state()
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) {
_q_trans_sp = Quatf(AxisAnglef(_trans_rot_axis,
time_since_trans_start * trans_pitch_rate)) * _q_trans_start;

View File

@ -366,12 +366,6 @@ void Tiltrotor::update_transition_state()
// turn on all MC motors
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
if (_tilt_control > _params_tiltrotor.tilt_mc) {
_tilt_control = _params_tiltrotor.tilt_fw -

View File

@ -136,9 +136,7 @@ bool VtolType::init()
void VtolType::update_mc_state()
{
if (!_flag_idle_mc) {
_flag_idle_mc = set_idle_mc();
}
set_idle_mc();
resetAccelToPitchPitchIntegrator();
@ -155,9 +153,7 @@ void VtolType::update_mc_state()
void VtolType::update_fw_state()
{
if (_flag_idle_mc) {
_flag_idle_mc = !set_idle_fw();
}
set_idle_fw();
resetAccelToPitchPitchIntegrator();

View File

@ -218,8 +218,6 @@ protected:
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;
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