Plane: Use tecs to control the throttle during takeoff

This commit is contained in:
Michael du Breuil 2015-04-15 15:54:06 -07:00 committed by Andrew Tridgell
parent 04e9141881
commit 78a3ce46b9
5 changed files with 8 additions and 16 deletions

View File

@ -1195,9 +1195,8 @@ static void handle_auto_mode(void)
case MAV_CMD_NAV_TAKEOFF:
takeoff_calc_roll();
takeoff_calc_pitch();
// max throttle for takeoff
channel_throttle->servo_out = takeoff_throttle();
calc_throttle();
break;
case MAV_CMD_NAV_LAND:

View File

@ -805,7 +805,11 @@ static void set_servos(void)
min_throttle = 0;
}
if (control_mode == AUTO && flight_stage == AP_SpdHgtControl::FLIGHT_TAKEOFF) {
max_throttle = takeoff_throttle();
if(aparm.takeoff_throttle_max != 0) {
max_throttle = aparm.takeoff_throttle_max;
} else {
max_throttle = aparm.throttle_max;
}
}
channel_throttle->servo_out = constrain_int16(channel_throttle->servo_out,
min_throttle,

View File

@ -464,7 +464,6 @@ public:
AP_Float takeoff_tdrag_speed1;
AP_Float takeoff_rotate_speed;
AP_Int8 takeoff_throttle_slewrate;
AP_Int8 takeoff_throttle_max;
AP_Int8 level_roll_limit;
AP_Int8 flapin_channel;
AP_Int8 flaperon_output;

View File

@ -453,7 +453,7 @@ const AP_Param::Info var_info[] PROGMEM = {
// @Range: 0 100
// @Increment: 1
// @User: Advanced
GSCALAR(takeoff_throttle_max, "TKOFF_THR_MAX", 0),
ASCALAR(takeoff_throttle_max, "TKOFF_THR_MAX", 0),
// @Param: THR_SLEWRATE
// @DisplayName: Throttle slew rate

View File

@ -170,13 +170,3 @@ return_zero:
return 0;
}
/*
return throttle percentage for takeoff
*/
static uint8_t takeoff_throttle(void)
{
if (g.takeoff_throttle_max != 0) {
return g.takeoff_throttle_max;
}
return aparm.throttle_max;
}