Aircraft pitch motion control
This example demonstrates the simulation of an aircraft's longitudinal motion control system. The models of aircraft dynamics and actuators are described by first-order linear approximations and connected to an analog control system. Subsystem Controller (Regulator):
-
Uses the pitch signal from the aircraft control stick as a setpoint for the pitch angle of the aircraft.
-
Uses the pitch angle of the aircraft and the rate of change of this angle to form control actions.
To perturb the system, a simplified subsystem Dryden Wind Gust Models (Dryden Gust Models) is implemented in the model.
Model diagram:
Defining the function to load and run the model:
In [ ]:
function start_model_engee()
try
engee.close("pitch_control", force=true) # закрытие модели
catch err # в случае, если нет модели, которую нужно закрыть и engee.close() не выполняется, то будет выполнена её загрузка после catch
m = engee.load("$(@__DIR__)/pitch_control.engee") # загрузка модели
end;
try
engee.run(m) # запуск модели
catch err # в случае, если модель не загружена и engee.run() не выполняется, то будут выполнены две нижние строки после catch
m = engee.load("$(@__DIR__)/pitch_control.engee") # загрузка модели
engee.run(m) # запуск модели
end
end
Out[0]:
Running the simulation
In [ ]:
start_model_engee();
Extraction of pitch angle and setpoint signals from the simout variable:
In [ ]:
result = simout;
res = collect(result)
Out[0]:
Writing signals to variables:
In [ ]:
alpha = collect(res[1])
stick = collect(res[2]);
Visualization of simulation results
Aircraft pitch angle graph and setpoint signal:
In [ ]:
using Plots
gr()
plot(alpha[:,1], alpha[:,2], label="Угол тангажа самолёта, град.", linewidth=3)
plot!(stick[:,1], stick[:,2], label="Уставка, град.", linewidth=3)
Out[0]:
