TradHeli: Change to throttle controller to allow swash plate collective to move, even if disarmed, if we are in Acro or Stab. This is slightly dangerous... as a user could cause a problem if they do not follow the proper usage procedures. If they do not route the ESC through the APM, but instead direct to Rx. And then if they do not Arm, they could take off in Stab mode while disarmed, but then when they switch to Alt_Hold, it will drop the collective to the bottom and they will fall. This can be saved by switching back to Stab. And it requires operation outside of the normal operating procedure.

This change is being made because most heli users expect to be able to check the swash plate operation before arming and taking off.
This commit is contained in:
Robert Lefebvre 2013-07-04 22:55:12 -04:00 committed by Randy Mackay
parent cea0812b82
commit b4863dc997

View File

@ -1842,20 +1842,32 @@ void update_throttle_mode(void)
if(ap.do_flip) // this is pretty bad but needed to flip in AP modes.
return;
// do not run throttle controllers if motors disarmed
#if FRAME_CONFIG == HELI_FRAME
if (control_mode == STABILIZE){
motors.stab_throttle = true;
} else {
motors.stab_throttle = false;
}
// allow swash collective to move if we are in manual throttle modes, even if disarmed
if( !motors.armed() ) {
if ( !(throttle_mode == THROTTLE_MANUAL) && !(throttle_mode == THROTTLE_MANUAL_TILT_COMPENSATED)){
throttle_accel_deactivate(); // do not allow the accel based throttle to override our command
return;
}
}
#else // HELI_FRAME
// do not run throttle controllers if motors disarmed
if( !motors.armed() ) {
set_throttle_out(0, false);
throttle_accel_deactivate(); // do not allow the accel based throttle to override our command
set_target_alt_for_reporting(0);
return;
}
#if FRAME_CONFIG == HELI_FRAME
if (control_mode == STABILIZE){
motors.stab_throttle = true;
} else {
motors.stab_throttle = false;
}
#endif // HELI_FRAME
switch(throttle_mode) {