This project designs an Altitude Tracking Autopilot for the Boeing 747.
Based on a linearized longitudinal dynamics model, it applies an Inner Loop / Outer Loop cascade control architecture.
The B747 longitudinal dynamics are represented in state-space form:
State vector and input vector:
| State | Meaning |
|---|---|
| Forward speed deviation (from trim) | |
| Vertical velocity | |
| Pitch rate | |
| Pitch angle deviation | |
| Vertical position deviation in NED coordinates |
| Input | Meaning |
|---|---|
| Elevator deflection (deviation from trim) | |
| Throttle (thrust) deviation |
Note: The output matrix is set to
$\mathbf{C} = \mathbf{I}$ (identity), so all states are available as outputs.
Only the required signals ($\theta$ ,$z_E$ , etc.) are extracted using a Demux in Simulink.
In the NED (North-East-Down) frame,
To use altitude
In Simulink, this is implemented using a Gain = -1 block to convert
The altitude control system is designed as a cascade controller:
| Loop | Dynamics | Typical response time |
|---|---|---|
| Inner loop (pitch) | fast dynamics | ~1–2 s |
| Outer loop (altitude) | slow dynamics | ~20–60 s |
This separation allows each loop to be designed independently.
- Designing the full high-order MIMO system at once is complex.
- Cascade design enables each loop to be treated as a lower-order SISO problem.
- If the inner loop is stabilized first, the outer loop can be designed on top of a well-behaved inner closed-loop system.
- Problems can be localized to a specific loop.
- Each loop can be tested and tuned independently.
The inner loop makes the aircraft pitch angle (
The relationship “moment →
$q$ →$\theta$ ” is not separated into additional blocks; it is already embedded in the state-space matrices$\mathbf{A}, \mathbf{B}$ .
For inner loop design, extract the SISO transfer function:
MATLAB example: 4th output (
G_theta_deltae = minreal(tf(sys_long(4,1)));The actuator is modeled as a first-order lag:
Note: The numerator is
$-1$ to match the sign convention between elevator deflection and pitch response.
-
Overshoot: ≤ 10% (target damping ratio
$\zeta = 0.6$ ) - Settling time (2%): ≤ 2 s
Root locus is used to analyze closed-loop pole movement as PID gains change, and to select gains satisfying stability and response constraints.
Designed gains:
| Parameter | Value |
|---|---|
| 2.5 | |
| 0.5 | |
| 2.1 |
With the inner-loop controller, the pitch angle tracks
The outer loop makes the aircraft altitude (
Assuming the inner loop ensures
- Overshoot: ≤ 10%
- Settling time (2%): ≤ 60 s
- P-only control struggles to satisfy Ts/OS requirements.
- Steady-state error remains.
- Adding an integrator removes steady-state error.
- A grid search is used to find suitable
$(K_{p,out}, K_{i,out})$ combinations.
A physical limit is applied to
- Saturation block: limits pitch command
- Anti-windup: prevents integrator windup during saturation
Warning: In the current implementation,
$\delta_p = 0$ is fixed.
Using only the elevator to control altitude can cause:
- Energy deficit: speed decreases when climbing
- Phugoid mode: long-period oscillations may appear
- Slow response: settling within ~20 s is generally unrealistic
In real aircraft, altitude hold is typically paired with autothrottle to maintain speed/energy.
With both loops closed, altitude tracks
Below is the complete Simulink model integrating the inner and outer loops.
Components:
| Block | Role |
|---|---|
| Outer Loop Controller | altitude error → pitch command ( |
| Inner Loop Controller | pitch error → elevator command ( |
| Elevator Servo | 1st-order actuator model |
| B747 Longitudinal Plant | linearized longitudinal dynamics (state-space) |
| Gain (-1) |
|
| D2R / R2D | degree ↔ radian conversion |
b747-autopilot-control/
├── init_model.m # Define linear model matrices (A, B, C, D)
├── design_altitude_controller.m # Controller design scripts (Inner/Outer)
├── system_model.slx # Full Simulink model
├── Linear_Model.slx # Linear model Simulink file
├── Explanation.md # Detailed design guide
└── docs/
└── altitude control/ # Simulation result images
├── Full Simulink Model.png
├── inner loop response.png
└── outer loop response.png
- Launch MATLAB and move to the project directory
- Run
init_model.mto load the model matrices into the workspace - (Optional) Run
design_altitude_controller.mto compute controller gains - Open
system_model.slxand run the simulation
>> init_model
>> open_system('system_model')
>> sim('system_model')| Item | Description |
|---|---|
| Inner loop | fast attitude stabilization ( |
| Outer loop | slower altitude tracking (generates |
| Time-scale separation | key enabler for independent loop design |
| Coordinate conversion |
|
| Throttle |
|
-
Phase 1 autopilot design guide based on the linear state-space model: Explanation.md
-
Classical control design using PID and root locus
-
The main purpose of this personal project is to understand linearized system and structure of inner and outer loop control system.



