mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-14 01:43:33 +08:00
VTOL: remove some pwm hackery leftovers from legacy mixing systems
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
committed by
Daniel Agar
parent
d948fcd72b
commit
828f629413
@@ -289,11 +289,6 @@ void Standard::update_transition_state()
|
||||
if (_param_vt_b_trans_ramp.get() > FLT_EPSILON) {
|
||||
mc_weight = time_since_trans_start / _param_vt_b_trans_ramp.get();
|
||||
}
|
||||
|
||||
// set idle speed for MC actuators
|
||||
if (!_flag_idle_mc) {
|
||||
_flag_idle_mc = true;
|
||||
}
|
||||
}
|
||||
|
||||
mc_weight = math::constrain(mc_weight, 0.0f, 1.0f);
|
||||
|
||||
@@ -255,10 +255,6 @@ void Tailsitter::update_transition_state()
|
||||
// calculate pitching rate - and constrain to at least 0.1s transition time
|
||||
const float trans_pitch_rate = M_PI_2_F / math::max(_param_vt_b_trans_dur.get(), 0.1f);
|
||||
|
||||
if (!_flag_idle_mc) {
|
||||
_flag_idle_mc = true;
|
||||
}
|
||||
|
||||
if (tilt > 0.01f) {
|
||||
_q_trans_sp = Quatf(AxisAnglef(_trans_rot_axis,
|
||||
time_since_trans_start * trans_pitch_rate)) * _q_trans_start;
|
||||
|
||||
@@ -363,11 +363,6 @@ void Tiltrotor::update_transition_state()
|
||||
|
||||
} else if (_vtol_schedule.flight_mode == vtol_mode::TRANSITION_BACK) {
|
||||
|
||||
// set idle speed for rotary wing mode
|
||||
if (!_flag_idle_mc) {
|
||||
_flag_idle_mc = true;
|
||||
}
|
||||
|
||||
// tilt rotors back once motors are idle
|
||||
if (time_since_trans_start > BACKTRANS_THROTTLE_DOWNRAMP_DUR_S) {
|
||||
|
||||
@@ -528,19 +523,6 @@ void Tiltrotor::fill_actuator_outputs()
|
||||
_actuators_out_0->timestamp = _actuators_out_1->timestamp = hrt_absolute_time();
|
||||
}
|
||||
|
||||
/*
|
||||
* Increase combined thrust of MC propellers if motors are tilted. Assumes that all MC motors are tilted equally.
|
||||
*/
|
||||
|
||||
float Tiltrotor::thrust_compensation_for_tilt()
|
||||
{
|
||||
// only compensate for tilt angle up to 0.5 * max tilt
|
||||
float compensated_tilt = math::constrain(_tilt_control, 0.0f, 0.5f);
|
||||
|
||||
// increase vertical thrust by 1/cos(tilt), limit to [-1,0]
|
||||
return math::constrain(_v_att_sp->thrust_body[2] / cosf(compensated_tilt * M_PI_2_F), -1.0f, 0.0f);
|
||||
}
|
||||
|
||||
void Tiltrotor::blendThrottleAfterFrontTransition(float scale)
|
||||
{
|
||||
const float tecs_throttle = _v_att_sp->thrust_body[0];
|
||||
@@ -553,7 +535,6 @@ void Tiltrotor::blendThrottleDuringBacktransition(float scale, float target_thro
|
||||
_thrust_transition = scale * target_throttle + (1.0f - scale) * _last_thr_in_fw_mode;
|
||||
}
|
||||
|
||||
|
||||
float Tiltrotor::timeUntilMotorsAreUp()
|
||||
{
|
||||
return BACKTRANS_THROTTLE_DOWNRAMP_DUR_S + BACKTRANS_MOTORS_UPTILT_DUR_S;
|
||||
|
||||
@@ -58,7 +58,6 @@ public:
|
||||
void update_mc_state() override;
|
||||
void update_fw_state() override;
|
||||
void waiting_on_tecs() override;
|
||||
float thrust_compensation_for_tilt();
|
||||
void blendThrottleAfterFrontTransition(float scale) override;
|
||||
|
||||
private:
|
||||
|
||||
@@ -97,10 +97,6 @@ void VtolType::parameters_update()
|
||||
|
||||
void VtolType::update_mc_state()
|
||||
{
|
||||
if (!_flag_idle_mc) {
|
||||
_flag_idle_mc = true;
|
||||
}
|
||||
|
||||
resetAccelToPitchPitchIntegrator();
|
||||
|
||||
// copy virtual attitude setpoint to real attitude setpoint
|
||||
@@ -124,10 +120,6 @@ void VtolType::update_mc_state()
|
||||
|
||||
void VtolType::update_fw_state()
|
||||
{
|
||||
if (_flag_idle_mc) {
|
||||
_flag_idle_mc = false;
|
||||
}
|
||||
|
||||
resetAccelToPitchPitchIntegrator();
|
||||
_last_thr_in_fw_mode = _actuators_fw_in->control[actuator_controls_s::INDEX_THROTTLE];
|
||||
|
||||
|
||||
@@ -77,14 +77,6 @@ enum VtolForwardActuationMode {
|
||||
ENABLE_ABOVE_MPC_LAND_ALT2_WITHOUT_LAND
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Used to specify if min or max pwm values should be altered
|
||||
*/
|
||||
enum class pwm_limit_type {
|
||||
TYPE_MINIMUM = 0,
|
||||
TYPE_MAXIMUM
|
||||
};
|
||||
|
||||
class VtolAttitudeControl;
|
||||
|
||||
class VtolType : public ModuleParams
|
||||
@@ -198,8 +190,6 @@ protected:
|
||||
struct vehicle_thrust_setpoint_s *_thrust_setpoint_0;
|
||||
struct vehicle_thrust_setpoint_s *_thrust_setpoint_1;
|
||||
|
||||
bool _flag_idle_mc = false; //false = "idle is set for fixed wing mode"; true = "idle is set for multicopter mode"
|
||||
|
||||
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_yaw_weight = 1.0f; // weight for multicopter attitude controller yaw output
|
||||
|
||||
Reference in New Issue
Block a user