AP_Motors: actuator_spin_up renamed to include _to_ground_idle

This commit is contained in:
Randy Mackay 2019-01-21 20:13:00 +09:00
parent e2bd502b83
commit 1fa335a77b
7 changed files with 16 additions and 16 deletions

View File

@ -83,8 +83,8 @@ void AP_MotorsCoax::output_to_motors()
for (uint8_t i=0; i<NUM_ACTUATORS; i++) {
rc_write_angle(AP_MOTORS_MOT_1+i, _spin_up_ratio * _actuator_out[i] * AP_MOTORS_COAX_SERVO_INPUT_RANGE);
}
set_actuator_with_slew(_actuator[5], actuator_spin_up());
set_actuator_with_slew(_actuator[6], actuator_spin_up());
set_actuator_with_slew(_actuator[5], actuator_spin_up_to_ground_idle());
set_actuator_with_slew(_actuator[6], actuator_spin_up_to_ground_idle());
rc_write(AP_MOTORS_MOT_5, output_to_pwm(_actuator[5]));
rc_write(AP_MOTORS_MOT_6, output_to_pwm(_actuator[6]));
break;

View File

@ -87,7 +87,7 @@ void AP_MotorsMatrix::output_to_motors()
// sends output to motors when armed but not flying
for (i=0; i<AP_MOTORS_MAX_NUM_MOTORS; i++) {
if (motor_enabled[i]) {
set_actuator_with_slew(_actuator[i], actuator_spin_up());
set_actuator_with_slew(_actuator[i], actuator_spin_up_to_ground_idle());
}
}
break;

View File

@ -437,8 +437,8 @@ void AP_MotorsMulticopter::set_actuator_with_slew(float& actuator_output, float
actuator_output = constrain_float(input, output_slew_limit_dn, output_slew_limit_up);
}
// gradually increase actuator output maximum limit
float AP_MotorsMulticopter::actuator_spin_up() const
// gradually increase actuator output to spin_min
float AP_MotorsMulticopter::actuator_spin_up_to_ground_idle() const
{
return constrain_float(_spin_up_ratio, 0.0f, 1.0f) * _spin_min;
}

View File

@ -124,8 +124,8 @@ protected:
// adds slew rate limiting to actuator output if MOT_SLEW_TIME > 0 and not shutdown
void set_actuator_with_slew(float& actuator_output, float input);
// gradually increase actuator output maximum limit
float actuator_spin_up() const;
// gradually increase actuator output to ground idle
float actuator_spin_up_to_ground_idle() const;
// apply any thrust compensation for the frame
virtual void thrust_compensation(void) {}

View File

@ -86,8 +86,8 @@ void AP_MotorsSingle::output_to_motors()
for (uint8_t i=0; i<NUM_ACTUATORS; i++) {
rc_write_angle(AP_MOTORS_MOT_1+i, _spin_up_ratio * _actuator_out[i] * AP_MOTORS_SINGLE_SERVO_INPUT_RANGE);
}
set_actuator_with_slew(_actuator[5], actuator_spin_up());
set_actuator_with_slew(_actuator[6], actuator_spin_up());
set_actuator_with_slew(_actuator[5], actuator_spin_up_to_ground_idle());
set_actuator_with_slew(_actuator[6], actuator_spin_up_to_ground_idle());
rc_write(AP_MOTORS_MOT_5, output_to_pwm(_actuator[5]));
rc_write(AP_MOTORS_MOT_6, output_to_pwm(_actuator[6]));
break;

View File

@ -90,10 +90,10 @@ void AP_MotorsTailsitter::output_to_motors()
SRV_Channels::set_output_pwm(SRV_Channel::k_throttleRight, get_pwm_output_min());
break;
case GROUND_IDLE:
throttle_pwm = output_to_pwm(actuator_spin_up());
set_actuator_with_slew(_actuator[1], actuator_spin_up());
SRV_Channels::set_output_pwm(SRV_Channel::k_throttleLeft, output_to_pwm(actuator_spin_up()));
SRV_Channels::set_output_pwm(SRV_Channel::k_throttleRight, output_to_pwm(actuator_spin_up()));
throttle_pwm = output_to_pwm(actuator_spin_up_to_ground_idle());
set_actuator_with_slew(_actuator[1], actuator_spin_up_to_ground_idle());
SRV_Channels::set_output_pwm(SRV_Channel::k_throttleLeft, output_to_pwm(actuator_spin_up_to_ground_idle()));
SRV_Channels::set_output_pwm(SRV_Channel::k_throttleRight, output_to_pwm(actuator_spin_up_to_ground_idle()));
break;
case SPOOL_UP:
case THROTTLE_UNLIMITED:

View File

@ -87,9 +87,9 @@ void AP_MotorsTri::output_to_motors()
break;
case GROUND_IDLE:
// sends output to motors when armed but not flying
set_actuator_with_slew(_actuator[1], actuator_spin_up());
set_actuator_with_slew(_actuator[2], actuator_spin_up());
set_actuator_with_slew(_actuator[4], actuator_spin_up());
set_actuator_with_slew(_actuator[1], actuator_spin_up_to_ground_idle());
set_actuator_with_slew(_actuator[2], actuator_spin_up_to_ground_idle());
set_actuator_with_slew(_actuator[4], actuator_spin_up_to_ground_idle());
rc_write(AP_MOTORS_MOT_1, output_to_pwm(_actuator[1]));
rc_write(AP_MOTORS_MOT_2, output_to_pwm(_actuator[2]));
rc_write(AP_MOTORS_MOT_4, output_to_pwm(_actuator[4]));