AC_AttitudeControl: allow for tail pass-thru in ACRO mode

this allows for all channels to be passed through
This commit is contained in:
Andrew Tridgell 2015-06-22 15:49:25 +10:00 committed by Randy Mackay
parent 42023eb17a
commit eeb97800ae
2 changed files with 17 additions and 4 deletions

View File

@ -14,9 +14,10 @@ const AP_Param::GroupInfo AC_AttitudeControl_Heli::var_info[] PROGMEM = {
// passthrough_bf_roll_pitch_rate_yaw - passthrough the pilots roll and pitch inputs directly to swashplate for flybar acro mode
void AC_AttitudeControl_Heli::passthrough_bf_roll_pitch_rate_yaw(float roll_passthrough, float pitch_passthrough, float yaw_rate_bf)
{
// store roll and pitch passthroughs
// store roll, pitch and passthroughs
_passthrough_roll = roll_passthrough;
_passthrough_pitch = pitch_passthrough;
_passthrough_yaw = yaw_rate_bf;
// set rate controller to use pass through
_flags_heli.flybar_passthrough = true;
@ -86,7 +87,11 @@ void AC_AttitudeControl_Heli::rate_controller_run()
} else {
rate_bf_to_motor_roll_pitch(_rate_bf_target.x, _rate_bf_target.y);
}
_motors.set_yaw(rate_bf_to_motor_yaw(_rate_bf_target.z));
if (_flags_heli.tail_passthrough) {
_motors.set_yaw(_passthrough_yaw);
} else {
_motors.set_yaw(rate_bf_to_motor_yaw(_rate_bf_target.z));
}
}
//

View File

@ -45,8 +45,12 @@ public:
// use_leaky_i - controls whether we use leaky i term for body-frame to motor output stage
void use_leaky_i(bool leaky_i) { _flags_heli.leaky_i = leaky_i; }
// use_flybar_passthrough - controls whether we pass-through control inputs to swash-plate
void use_flybar_passthrough(bool passthrough) { _flags_heli.flybar_passthrough = passthrough; }
// use_flybar_passthrough - controls whether we pass-through
// control inputs to swash-plate and tail
void use_flybar_passthrough(bool passthrough, bool tail_passthrough) {
_flags_heli.flybar_passthrough = passthrough;
_flags_heli.tail_passthrough = tail_passthrough;
}
// user settable parameters
static const struct AP_Param::GroupInfo var_info[];
@ -60,6 +64,7 @@ private:
uint8_t limit_yaw : 1; // 1 if we have requested larger yaw angle than tail servo can physically move
uint8_t leaky_i : 1; // 1 if we should use leaky i term for body-frame rate to motor stage
uint8_t flybar_passthrough : 1; // 1 if we should pass through pilots roll & pitch input directly to swash-plate
uint8_t tail_passthrough : 1; // 1 if we should pass through pilots yaw input to tail
} _flags_heli;
//
@ -80,6 +85,9 @@ private:
// pass through for roll and pitch
int16_t _passthrough_roll;
int16_t _passthrough_pitch;
// pass through for yaw if tail_passthrough is set
int16_t _passthrough_yaw;
// LPF filters to act on Rate Feedforward terms to linearize output.
// Due to complicated aerodynamic effects, feedforwards acting too fast can lead