Skip to content

Commit

Permalink
Plane: Quadplane: use new motors thrust linearization, don't send air…
Browse files Browse the repository at this point in the history
… density ratio
  • Loading branch information
IamPete1 authored and tridge committed Apr 17, 2023
1 parent be275e2 commit 5f56a60
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
6 changes: 0 additions & 6 deletions ArduPlane/ArduPlane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -511,12 +511,6 @@ void Plane::update_alt()
{
barometer.update();

#if HAL_QUADPLANE_ENABLED
if (quadplane.available()) {
quadplane.motors->set_air_density_ratio(barometer.get_air_density_ratio());
}
#endif

// calculate the sink rate.
float sink_rate;
Vector3f vel;
Expand Down
6 changes: 3 additions & 3 deletions ArduPlane/tailsitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,11 +302,11 @@ void Tailsitter::output(void)
*/
if (!is_negative(transition_throttle_vtol)) {
// Q_TAILSIT_THR_VT is positive use it until transition is complete
throttle = motors->actuator_to_thrust(MIN(transition_throttle_vtol*0.01,1.0));
throttle = motors->thr_lin.actuator_to_thrust(MIN(transition_throttle_vtol*0.01,1.0));
} else {
throttle = motors->get_throttle_hover();
// work out equivelent motors throttle level for cruise
throttle = MAX(throttle,motors->actuator_to_thrust(plane.aparm.throttle_cruise.get() * 0.01));
throttle = MAX(throttle,motors->thr_lin.actuator_to_thrust(plane.aparm.throttle_cruise.get() * 0.01));
}

SRV_Channels::set_output_scaled(SRV_Channel::k_rudder, 0.0);
Expand All @@ -321,7 +321,7 @@ void Tailsitter::output(void)

// convert the hover throttle to the same output that would result if used via AP_Motors
// apply expo, battery scaling and SPIN min/max.
throttle = motors->thrust_to_actuator(throttle);
throttle = motors->thr_lin.thrust_to_actuator(throttle);

// override AP_MotorsTailsitter throttles during back transition

Expand Down

0 comments on commit 5f56a60

Please sign in to comment.