This is the test to deal with big props with lots of inertia. We use a low pass filter on positive acceleration.

This commit is contained in:
Jason Short 2011-12-23 14:29:07 -08:00
parent fa2fa37f3b
commit ce11f48809
5 changed files with 95 additions and 32 deletions

View File

@ -97,12 +97,25 @@ static void output_motors_armed()
}
#endif
APM_RC.OutputCh(CH_1, motor_out[CH_1]);
APM_RC.OutputCh(CH_2, motor_out[CH_2]);
APM_RC.OutputCh(CH_3, motor_out[CH_3]);
APM_RC.OutputCh(CH_4, motor_out[CH_4]);
APM_RC.OutputCh(CH_7, motor_out[CH_7]);
APM_RC.OutputCh(CH_8, motor_out[CH_8]);
// this filter slows the acceleration of motors vs the deceleration
// Idea by Denny Rowland to help with his Yaw issue
for(int8_t i = CH_1; i <= CH_8; i++ ) {
if(i == CH_5 || i == CH_6)
continue;
if(motor_filtered[i] < motor_out[i]){
motor_filtered[i] = (motor_out[i] + motor_filtered[i]) / 2;
}else{
// don't filter
motor_filtered[i] = motor_out[i];
}
}
APM_RC.OutputCh(CH_1, motor_filtered[CH_1]);
APM_RC.OutputCh(CH_2, motor_filtered[CH_2]);
APM_RC.OutputCh(CH_3, motor_filtered[CH_3]);
APM_RC.OutputCh(CH_4, motor_filtered[CH_4]);
APM_RC.OutputCh(CH_7, motor_filtered[CH_7]);
APM_RC.OutputCh(CH_8, motor_filtered[CH_8]);
#if INSTANT_PWM == 1
// InstantPWM

View File

@ -148,14 +148,27 @@ static void output_motors_armed()
}
#endif
APM_RC.OutputCh(CH_1, motor_out[CH_1]);
APM_RC.OutputCh(CH_2, motor_out[CH_2]);
APM_RC.OutputCh(CH_3, motor_out[CH_3]);
APM_RC.OutputCh(CH_4, motor_out[CH_4]);
APM_RC.OutputCh(CH_7, motor_out[CH_7]);
APM_RC.OutputCh(CH_8, motor_out[CH_8]);
APM_RC.OutputCh(CH_10, motor_out[CH_10]);
APM_RC.OutputCh(CH_11, motor_out[CH_11]);
// this filter slows the acceleration of motors vs the deceleration
// Idea by Denny Rowland to help with his Yaw issue
for(int8_t i = CH_1; i <= CH_11; i++ ) {
if(i == CH_5 || i == CH_6 || i == CH_9)
continue;
if(motor_filtered[i] < motor_out[i]){
motor_filtered[i] = (motor_out[i] + motor_filtered[i]) / 2;
}else{
// don't filter
motor_filtered[i] = motor_out[i];
}
}
APM_RC.OutputCh(CH_1, motor_filtered[CH_1]);
APM_RC.OutputCh(CH_2, motor_filtered[CH_2]);
APM_RC.OutputCh(CH_3, motor_filtered[CH_3]);
APM_RC.OutputCh(CH_4, motor_filtered[CH_4]);
APM_RC.OutputCh(CH_7, motor_filtered[CH_7]);
APM_RC.OutputCh(CH_8, motor_filtered[CH_8]);
APM_RC.OutputCh(CH_10, motor_filtered[CH_10]);
APM_RC.OutputCh(CH_11, motor_filtered[CH_11]);
#if INSTANT_PWM == 1
// InstantPWM

View File

@ -116,14 +116,27 @@ static void output_motors_armed()
}
#endif
APM_RC.OutputCh(CH_1, motor_out[CH_1]);
APM_RC.OutputCh(CH_2, motor_out[CH_2]);
APM_RC.OutputCh(CH_3, motor_out[CH_3]);
APM_RC.OutputCh(CH_4, motor_out[CH_4]);
APM_RC.OutputCh(CH_7, motor_out[CH_7]);
APM_RC.OutputCh(CH_8, motor_out[CH_8]);
APM_RC.OutputCh(CH_10, motor_out[CH_10]);
APM_RC.OutputCh(CH_11, motor_out[CH_11]);
// this filter slows the acceleration of motors vs the deceleration
// Idea by Denny Rowland to help with his Yaw issue
for(int8_t i = CH_1; i <= CH_11; i++ ) {
if(i == CH_5 || i == CH_6 || i == CH_9)
continue;
if(motor_filtered[i] < motor_out[i]){
motor_filtered[i] = (motor_out[i] + motor_filtered[i]) / 2;
}else{
// don't filter
motor_filtered[i] = motor_out[i];
}
}
APM_RC.OutputCh(CH_1, motor_filtered[CH_1]);
APM_RC.OutputCh(CH_2, motor_filtered[CH_2]);
APM_RC.OutputCh(CH_3, motor_filtered[CH_3]);
APM_RC.OutputCh(CH_4, motor_filtered[CH_4]);
APM_RC.OutputCh(CH_7, motor_filtered[CH_7]);
APM_RC.OutputCh(CH_8, motor_filtered[CH_8]);
APM_RC.OutputCh(CH_10, motor_filtered[CH_10]);
APM_RC.OutputCh(CH_11, motor_filtered[CH_11]);
#if INSTANT_PWM == 1
// InstantPWM

View File

@ -89,10 +89,21 @@ static void output_motors_armed()
}
#endif
APM_RC.OutputCh(CH_1, motor_out[CH_1]);
APM_RC.OutputCh(CH_2, motor_out[CH_2]);
APM_RC.OutputCh(CH_3, motor_out[CH_3]);
APM_RC.OutputCh(CH_4, motor_out[CH_4]);
// this filter slows the acceleration of motors vs the deceleration
// Idea by Denny Rowland to help with his Yaw issue
for(int8_t i=CH_1; i <= CH_4; i++ ) {
if(motor_filtered[i] < motor_out[i]){
motor_filtered[i] = (motor_out[i] + motor_filtered[i]) / 2;
}else{
// don't filter
motor_filtered[i] = motor_out[i];
}
}
APM_RC.OutputCh(CH_1, motor_filtered[CH_1]);
APM_RC.OutputCh(CH_2, motor_filtered[CH_2]);
APM_RC.OutputCh(CH_3, motor_filtered[CH_3]);
APM_RC.OutputCh(CH_4, motor_filtered[CH_4]);
#if INSTANT_PWM == 1
// InstantPWM

View File

@ -106,12 +106,25 @@ static void output_motors_armed()
}
#endif
APM_RC.OutputCh(CH_1, motor_out[CH_1]);
APM_RC.OutputCh(CH_2, motor_out[CH_2]);
APM_RC.OutputCh(CH_3, motor_out[CH_3]);
APM_RC.OutputCh(CH_4, motor_out[CH_4]);
APM_RC.OutputCh(CH_7, motor_out[CH_7]);
APM_RC.OutputCh(CH_8, motor_out[CH_8]);
// this filter slows the acceleration of motors vs the deceleration
// Idea by Denny Rowland to help with his Yaw issue
for(int8_t i = CH_1; i <= CH_8; i++ ) {
if(i == CH_5 || i == CH_6)
continue;
if(motor_filtered[i] < motor_out[i]){
motor_filtered[i] = (motor_out[i] + motor_filtered[i]) / 2;
}else{
// don't filter
motor_filtered[i] = motor_out[i];
}
}
APM_RC.OutputCh(CH_1, motor_filtered[CH_1]);
APM_RC.OutputCh(CH_2, motor_filtered[CH_2]);
APM_RC.OutputCh(CH_3, motor_filtered[CH_3]);
APM_RC.OutputCh(CH_4, motor_filtered[CH_4]);
APM_RC.OutputCh(CH_7, motor_filtered[CH_7]);
APM_RC.OutputCh(CH_8, motor_filtered[CH_8]);
#if INSTANT_PWM == 1
// InstantPWM