Browse Source

Emile's Fixes

mission-4.1.18
Jason Short 13 years ago
parent
commit
c7c16a5b0f
  1. 20
      ArduCopter/motors_hexa.pde

20
ArduCopter/motors_hexa.pde

@ -5,8 +5,8 @@ @@ -5,8 +5,8 @@
static void init_motors_out()
{
#if INSTANT_PWM == 0
APM_RC.SetFastOutputChannels( _BV(MOT_1) | _BV(MOT_2) | _BV(MOT_3) | _BV(MOT_4)
| _BV(MOT_5) | _BV(MOT_6) );
APM_RC.SetFastOutputChannels(_BV(MOT_1) | _BV(MOT_2) | _BV(MOT_3) | _BV(MOT_4)
| _BV(MOT_5) | _BV(MOT_6));
#endif
}
@ -77,10 +77,10 @@ static void output_motors_armed() @@ -77,10 +77,10 @@ static void output_motors_armed()
// Tridge's stability patch
for (int m = 0; m <= 6; m++) {
for (int m = 0; m <= 6; m++){
int c = ch_of_mot(m);
int c_opp = ch_of_mot(m^1); // m^1 is the opposite motor. c_opp is channel of opposite motor.
if (motor_out[c] > out_max) {
int c_opp = ch_of_mot(m ^ 1); // m ^ 1 is the opposite motor. c_opp is channel of opposite motor.
if(motor_out[c] > out_max){
motor_out[c_opp] -= motor_out[c] - out_max;
motor_out[c] = out_max;
}
@ -108,7 +108,7 @@ static void output_motors_armed() @@ -108,7 +108,7 @@ static void output_motors_armed()
// this filter slows the acceleration of motors vs the deceleration
// Idea by Denny Rowland to help with his Yaw issue
for(int8_t m = 0; m <= 6; m++ ) {
for(int8_t m = 0; m <= 6; m++){
int c = ch_of_mot(m);
if(motor_filtered[c] < motor_out[c]){
motor_filtered[c] = (motor_out[c] + motor_filtered[c]) / 2;
@ -143,7 +143,7 @@ static void output_motors_disarmed() @@ -143,7 +143,7 @@ static void output_motors_disarmed()
}
// fill the motor_out[] array for HIL use
for (unsigned char i = 0; i < 8; i++) {
for (unsigned char i = 0; i < 8; i++){
motor_out[i] = g.rc_3.radio_min;
}
@ -168,7 +168,6 @@ static void output_motor_test() @@ -168,7 +168,6 @@ static void output_motor_test()
motor_out[MOT_6] = g.rc_3.radio_min;
if(g.frame_orientation == X_FRAME){
APM_RC.OutputCh(MOT_3, g.rc_3.radio_min);
delay(4000);
APM_RC.OutputCh(MOT_5, g.rc_3.radio_min + 100);
@ -199,10 +198,7 @@ static void output_motor_test() @@ -199,10 +198,7 @@ static void output_motor_test()
APM_RC.OutputCh(MOT_3, g.rc_3.radio_min + 100);
delay(300);
}
} else { /* PLUS_FRAME */
APM_RC.OutputCh(MOT_5, g.rc_3.radio_min);
delay(4000);
APM_RC.OutputCh(MOT_1, g.rc_3.radio_min + 100);
@ -234,8 +230,6 @@ static void output_motor_test() @@ -234,8 +230,6 @@ static void output_motor_test()
delay(300);
}
}
APM_RC.OutputCh(MOT_1, motor_out[MOT_1]);
APM_RC.OutputCh(MOT_2, motor_out[MOT_2]);
APM_RC.OutputCh(MOT_3, motor_out[MOT_3]);

Loading…
Cancel
Save