bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
bitsim::control::FixedWingAutopilot Class Reference

Holds airspeed, altitude and course with loops closed one inside the other, as in Beard and McLain, chapter 6. More...

#include <fixed_wing_autopilot.h>

Public Types

enum class  AltitudeMode { HOLD , CLIMB , DESCEND }

Public Member Functions

 FixedWingAutopilot (const dynamics::FixedWingParameters &parameters, const FixedWingAutopilotDesign &design={})
dynamics::FixedWingControls update (const dynamics::FixedWingDynamics &aircraft, const FixedWingCommands &commands, real_t dt)
 The controls for the commands, after dt [s].
real_t roll_hold (real_t phi_c, real_t phi, real_t p) const
real_t course_hold (real_t chi_c, real_t chi, real_t dt)
real_t sideslip_hold (real_t beta, real_t dt)
real_t pitch_hold (real_t theta_c, real_t theta, real_t q) const
real_t altitude_hold (real_t h_c, real_t h, real_t dt)
real_t airspeed_with_throttle (real_t Va_c, real_t Va, real_t dt)
real_t airspeed_with_pitch (real_t Va_c, real_t Va, real_t dt)
void reset ()
 Forget the integrators.
const FixedWingAutopilotGains & gains () const noexcept
const FixedWingAutopilotDesign & design () const noexcept
const dynamics::FixedWingTrim & trim () const noexcept
AltitudeMode altitude_mode () const noexcept

Detailed Description

Holds airspeed, altitude and course with loops closed one inside the other, as in Beard and McLain, chapter 6.

  • Lateral: the course loop sets a bank, the roll loop the aileron; the rudder holds the sideslip at 0, so the turns are coordinated.
  • Longitudinal: within altitude_band of the commanded altitude, the altitude loop sets a pitch, the pitch loop the elevator, and the throttle holds the airspeed. Further below, it climbs at full throttle and the pitch holds the airspeed; further above, it descends at idle.

The gains come from the linearised aircraft at a trim: each loop is designed for a damping and a natural frequency, and each outer loop is a number of times slower than the loop inside it. The integrators stop while what they drive is at its limit.

Member Enumeration Documentation

◆ AltitudeMode

Enumerator
HOLD 
CLIMB 
DESCEND 

Constructor & Destructor Documentation

◆ FixedWingAutopilot()

bitsim::control::FixedWingAutopilot::FixedWingAutopilot ( const dynamics::FixedWingParameters & parameters,
const FixedWingAutopilotDesign & design = {} )

Member Function Documentation

◆ airspeed_with_pitch()

real_t bitsim::control::FixedWingAutopilot::airspeed_with_pitch ( real_t Va_c,
real_t Va,
real_t dt )

◆ airspeed_with_throttle()

real_t bitsim::control::FixedWingAutopilot::airspeed_with_throttle ( real_t Va_c,
real_t Va,
real_t dt )

◆ altitude_hold()

real_t bitsim::control::FixedWingAutopilot::altitude_hold ( real_t h_c,
real_t h,
real_t dt )

◆ altitude_mode()

AltitudeMode bitsim::control::FixedWingAutopilot::altitude_mode ( ) const
inlinenoexcept

◆ course_hold()

real_t bitsim::control::FixedWingAutopilot::course_hold ( real_t chi_c,
real_t chi,
real_t dt )

◆ design()

const FixedWingAutopilotDesign & bitsim::control::FixedWingAutopilot::design ( ) const
inlinenoexcept

◆ gains()

const FixedWingAutopilotGains & bitsim::control::FixedWingAutopilot::gains ( ) const
inlinenoexcept

◆ pitch_hold()

real_t bitsim::control::FixedWingAutopilot::pitch_hold ( real_t theta_c,
real_t theta,
real_t q ) const

◆ reset()

void bitsim::control::FixedWingAutopilot::reset ( )

Forget the integrators.

◆ roll_hold()

real_t bitsim::control::FixedWingAutopilot::roll_hold ( real_t phi_c,
real_t phi,
real_t p ) const

◆ sideslip_hold()

real_t bitsim::control::FixedWingAutopilot::sideslip_hold ( real_t beta,
real_t dt )

◆ trim()

const dynamics::FixedWingTrim & bitsim::control::FixedWingAutopilot::trim ( ) const
inlinenoexcept

◆ update()

dynamics::FixedWingControls bitsim::control::FixedWingAutopilot::update ( const dynamics::FixedWingDynamics & aircraft,
const FixedWingCommands & commands,
real_t dt )

The controls for the commands, after dt [s].


The documentation for this class was generated from the following files: