|
|
|
@ -206,41 +206,36 @@ void AP_MotorsCoax::output_disarmed()
@@ -206,41 +206,36 @@ void AP_MotorsCoax::output_disarmed()
|
|
|
|
|
output_min(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// output_test - spin each motor for a moment to allow the user to confirm the motor order and spin direction
|
|
|
|
|
void AP_MotorsCoax::output_test() |
|
|
|
|
// output_test - spin a motor at the pwm value specified
|
|
|
|
|
// motor_seq is the motor's sequence number from 1 to the number of motors on the frame
|
|
|
|
|
// pwm value is an actual pwm value that will be output, normally in the range of 1000 ~ 2000
|
|
|
|
|
void AP_MotorsCoax::output_test(uint8_t motor_seq, int16_t pwm) |
|
|
|
|
{ |
|
|
|
|
// Send minimum values to all motors
|
|
|
|
|
output_min(); |
|
|
|
|
|
|
|
|
|
// spin motor 1
|
|
|
|
|
hal.scheduler->delay(1000); |
|
|
|
|
hal.rcout->write(pgm_read_byte(&_motor_to_channel_map[AP_MOTORS_MOT_3]), _rc_throttle.radio_min + _min_throttle); |
|
|
|
|
hal.scheduler->delay(1000); |
|
|
|
|
hal.rcout->write(pgm_read_byte(&_motor_to_channel_map[AP_MOTORS_MOT_3]), _rc_throttle.radio_min); |
|
|
|
|
hal.scheduler->delay(2000);
|
|
|
|
|
|
|
|
|
|
// spin motor 2
|
|
|
|
|
hal.scheduler->delay(1000); |
|
|
|
|
hal.rcout->write(pgm_read_byte(&_motor_to_channel_map[AP_MOTORS_MOT_4]), _rc_throttle.radio_min + _min_throttle); |
|
|
|
|
hal.scheduler->delay(1000); |
|
|
|
|
hal.rcout->write(pgm_read_byte(&_motor_to_channel_map[AP_MOTORS_MOT_4]), _rc_throttle.radio_min); |
|
|
|
|
hal.scheduler->delay(2000);
|
|
|
|
|
|
|
|
|
|
// flap servo 1
|
|
|
|
|
hal.rcout->write(pgm_read_byte(&_motor_to_channel_map[AP_MOTORS_MOT_1]), _servo1.radio_min); |
|
|
|
|
hal.scheduler->delay(1000); |
|
|
|
|
hal.rcout->write(pgm_read_byte(&_motor_to_channel_map[AP_MOTORS_MOT_1]), _servo1.radio_max); |
|
|
|
|
hal.scheduler->delay(1000); |
|
|
|
|
hal.rcout->write(pgm_read_byte(&_motor_to_channel_map[AP_MOTORS_MOT_1]), _servo1.radio_trim); |
|
|
|
|
hal.scheduler->delay(2000); |
|
|
|
|
|
|
|
|
|
// flap servo 2
|
|
|
|
|
hal.rcout->write(pgm_read_byte(&_motor_to_channel_map[AP_MOTORS_MOT_2]), _servo2.radio_min); |
|
|
|
|
hal.scheduler->delay(1000); |
|
|
|
|
hal.rcout->write(pgm_read_byte(&_motor_to_channel_map[AP_MOTORS_MOT_2]), _servo2.radio_max); |
|
|
|
|
hal.scheduler->delay(1000); |
|
|
|
|
hal.rcout->write(pgm_read_byte(&_motor_to_channel_map[AP_MOTORS_MOT_2]), _servo2.radio_trim); |
|
|
|
|
// exit immediately if not armed
|
|
|
|
|
if (!_flags.armed) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Send minimum values to all motors
|
|
|
|
|
output_min(); |
|
|
|
|
// output to motors and servos
|
|
|
|
|
switch (motor_seq) { |
|
|
|
|
case 1: |
|
|
|
|
// flap servo 1
|
|
|
|
|
hal.rcout->write(pgm_read_byte(&_motor_to_channel_map[AP_MOTORS_MOT_1]), pwm); |
|
|
|
|
break; |
|
|
|
|
case 2: |
|
|
|
|
// flap servo 2
|
|
|
|
|
hal.rcout->write(pgm_read_byte(&_motor_to_channel_map[AP_MOTORS_MOT_2]), pwm); |
|
|
|
|
break; |
|
|
|
|
case 3: |
|
|
|
|
// motor 1
|
|
|
|
|
hal.rcout->write(pgm_read_byte(&_motor_to_channel_map[AP_MOTORS_MOT_3]), pwm); |
|
|
|
|
break; |
|
|
|
|
case 4: |
|
|
|
|
// motor 2
|
|
|
|
|
hal.rcout->write(pgm_read_byte(&_motor_to_channel_map[AP_MOTORS_MOT_4]), pwm); |
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
|
// do nothing
|
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|