Fixed-Wing Control

This section covers libraries specifically for fixed-wing aircraft.

AP_TECS (Total Energy Control System)

Header: libraries/AP_TECS/AP_TECS.h

Description: AP_TECS is the Total Energy Control System for fixed-wing aircraft. It manages throttle and pitch to control both airspeed and altitude simultaneously using energy-based control algorithms.

Key Features:

  • Combined airspeed and altitude control

  • Energy-based control algorithm

  • Climb rate and sink rate limits

  • Gliding mode support

  • Landing flare control

Warning

doxygenclass: Cannot find class “AP_TECS” in doxygen xml output for project “ArduPilot” from directory: /home/runner/work/APMapi/APMapi/docs/../build/output-xml

Key Methods:

  • update_50hz() - Update TECS (call at 50Hz)

  • update_pitch_throttle() - Calculate pitch and throttle demands

  • get_throttle_demand() - Get throttle output (0-1)

  • get_pitch_demand() - Get pitch angle demand (radians)

  • get_target_airspeed() - Get target airspeed (m/s)

  • get_max_climbrate() - Get maximum climb rate (m/s)

  • get_max_sinkrate() - Get maximum sink rate (m/s)

Usage Example:

#include <AP_TECS.h>

AP_TECS *tecs = AP_TECS::get_singleton();

// In main loop (50Hz)
ahrs.update();
gps->update();

// Update TECS
tecs->update_50hz();
tecs->update_pitch_throttle(target_altitude, target_airspeed);

// Get control outputs
float throttle = tecs->get_throttle_demand();
float pitch = tecs->get_pitch_demand();

// Apply to servos
// servo->set_output(SRV_Channel:: throttle, throttle);
// servo->set_output(SRV_Channel::pitch, pitch);

AP_Landing (Fixed-Wing Landing)

Header: libraries/AP_Landing/AP_Landing.h

Description: Fixed-wing landing logic including flare control and approach management.

Key Features:

  • Flare height management

  • Approach path control

  • Automatic landing

  • Stall recovery

Usage Example:

#include <AP_Landing.h>

AP_Landing *landing = AP_Landing::get_singleton();

// Check if in landing phase
if (landing->is_in_landing_phase()) {
    // Get landing parameters
    float flare_angle = landing->get_flare_angle();
    float flare_alt = landing->get_flare_alt();
}

AP_FixedWing (Fixed-Wing Parameters)

Header: libraries/AP_FixedWing/AP_FixedWing.h

Description: Fixed-wing specific parameters and settings.

Key Parameters:

  • THR_MIN, THR_MAX - Throttle limits

  • AIRSPD_MIN, AIRSPD_MAX - Airspeed limits

  • TRIM_THROTTLE - Cruise throttle

  • ROLL_LIMIT - Maximum roll angle

  • PITCH_MIN, PITCH_MAX - Pitch limits

  • TECS_MODE - TECS mode selection


AC_AttitudeControl_FW (Fixed-Wing Attitude Control)

Header: libraries/AC_AttitudeControl/AC_AttitudeControl_FW.h

Description: Fixed-wing specific attitude control for roll, pitch, and yaw.

Key Features:

  • Roll control

  • Pitch control

  • Yaw control

  • Speed control

  • Rudder mixing

Usage Example:

AC_AttitudeControl_FW *attitude_fw = AC_AttitudeControl_FW::get_singleton();

// Set targets
attitude_fw->set_roll(roll_angle_rad);
attitude_fw->set_pitch(pitch_angle_rad);
attitude_fw->set_yaw(yaw_rate_rad);

// Run controller
attitude_fw->rate_controller_run();

See Also