Guidance Model
Reduced-order model for UAV
Libraries:
UAV Toolbox /
Algorithms
Description
The Guidance Model block represents a small unmanned aerial vehicle (UAV) fixed-wing[1] and multirotor[2] guidance model that estimates the UAV state based on control and environmental inputs. The model approximates the behavior of a closed-loop system consisting of an autopilot controller and a fixed-wing or multirotor kinematic model for 3-D motion. Use this block as a reduced-order guidance model to simulate your fixed-wing or multirotor UAV. Specify the ModelType to select your UAV type. Use the Initial State tab to specify the initial state of the UAV depending on the model type. The Configuration tab defines the control parameters and physical parameters of the UAV.
Ports
Input
Control commands sent to the UAV model, specified as a bus.
For multirotor UAVs, the model is approximated as separate PD controllers for each command. The elements of the bus are control command:
Roll
- Roll angle in radians.Pitch
- Pitch angle in radians.YawRate
- Yaw rate in radians per second. (D = 0. P only controller)Thrust
- Vertical thrust of the UAV in Newtons. (D = 0. P only controller)
For fixed-wing UAVs, the model assumes the UAV is flying under the coordinated-turn condition. The guidance model equations assume zero side-slip. The elements of the bus are:
Height
- Altitude above the ground in meters.Airspeed
- UAV speed relative to wind in meters per second.RollAngle
- Roll angle along body forward axis in radians. Because of the coordinated-turn condition, the heading angular rate is based on the roll angle.
Specify the name of the control input bus by using the Control Bus Name property.
Environmental inputs, specified as a bus. The model compensates for these environmental inputs when trying to achieve the commanded controls.
If you set the Model Type property to
MultirotorGuidance
, you must specify a bus with
Gravity
element which contains the gravitational acceleration for
the UAV in the z-axis direction of the inertial frame in meters per second
squared.
If you set the Model Type property to
FixedWingGuidance
, you must specify a bus with these elements:
WindNorth
— Wind velocity in the north direction for the UAV in meters per second.WindEast
— Wind velocity in the east direction for the UAV in meters per second.WindDown
— Wind velocity in the downward direction for the UAV in meters per second.Gravity
— Gravitational acceleration for the UAV in the z-axis direction of the inertial frame in meters per second squared.
Specify the name of the environment input bus by using the Environment Bus Name property.
Data Types: bus
Output
Simulated UAV state, returned as a bus. The block uses the
Control
and Environment
inputs with the
guidance model equations to simulate the UAV state.
For multirotor UAVs, the state is a five-element bus:
WorldPosition -
[x y z]
in meters.WorldVelocity -
[vx vy vz]
in meters per second.EulerZYX -
[psi theta phi]
Euler angles in radians.BodyAngularRateRPY -
[r p q]
in radians per second along thexyz
-axes of the UAV.Thrust -
F
in Newtons.
For fixed-wing UAVs, the state is an eight-element bus:
North - Position in north direction in meters.
East - Position in east direction in meters.
Height - Height above ground in meters.
AirSpeed - Speed relative to wind in meters per second.
HeadingAngle - Angle between ground velocity and north direction in radians.
FlightPathAngle - Angle between ground velocity and north-east plane in radians.
RollAngle - Angle of rotation along body x-axis in radians per second.
RollAngleRate - Angular velocity of rotation along body x-axis in radians per second.
Data Types: bus
Parameters
UAV guidance model type, specified as MultirotorGuidance
or
FixedWingGuidance
. The model type determines the elements of the
UAV State
and the required Control
and
Environment
inputs.
Tunable: No
Input and output numeric data types, specified as either double
or single
. Choose the data type based on possible software or
hardware limitations.
Tunable: No
Code generation
— Simulate model using generated C code. The first time you run a simulation, Simulink® generates C code for the block. The C code is reused for subsequent simulations, as long as the model does not change. This option requires additional startup time, but the speed of the subsequent simulations is comparable toInterpreted execution
.Interpreted execution
— Simulate model using the MATLAB® interpreter. This option shortens startup time but has a slower simulation speed thanCode generation
. In this mode, you can debug the source code of the block.
Tunable: No
Initial UAV state tab, specified as multiple table entries. All entries on this tab are nontunable.
For multirotor UAVs, the initial state is:
World Position -
[x y z]
in meters.World Velocity -
[vx vy vz]
in meters per second.Euler Angles (ZYX) -
[psi theta phi]
in radians.Body Angular Rates -
[p q r]
in radians per second.Thrust -
F
in Newtons.
For fixed-wing UAVs, the initial state is:
North - Position in north direction in meters.
East - Position in east direction in meters.
Height - Height above ground in meters.
Air Speed - Speed relative to wind in meters per second.
Heading Angle - Angle between ground velocity and north direction in radians.
Flight Path Angle - Angle between ground velocity and north-east plane in radians.
Roll Angle - Angle of rotation along body x-axis in radians per second.
Roll Angle Rate - Angular velocity of rotation along body x-axis in radians per second.
Tunable: No
UAV controller configuration tab, specified as multiple table entries. This tab allows you to configure the parameters of the internal control behaviour of the UAV. Specify the proportional (P) and derivative (D) gains for the dynamic model and the UAV mass in kilograms (for multirotor).
For multirotor UAVs, the parameters are:
PD Roll
PD Pitch
P YawRate
P Thrust
Mass(kg)
For fixed-wing UAVs, the parameters are:
P Height
P Flight Path Angle
PD Roll
P Air Speed
Min/Max Flight Path Angle (
[min max]
angle in radians)
Tunable: No
Simulink bus signal names tab, specified as multiple entries of character vectors. These buses have a default name based on the UAV model and input type. To use multiple guidance models in the same Simulink model, specify different bus names that do not intersect. All entries on this tab are nontunable.
More About
The guidance model uses the North-East-Down (NED) coordinate system convention.
The earth frame is assumed to be an inertial frame with an origin that is fixed relative to the earth surface. The frame coordinates are xe (positive in the direction of north), ye (positive in the direction of east), and ze (positive towards the center of the earth). The xeye plane is assumed to be flat.
The UAV body frame is centered on the UAV center of mass. The frame coordinates are xb (positive towards node of UAV) , yb (perpendicular to xb, positive towards right of UAV), and zb (perpendicular to xbyb plane, positive downward).
The orientation of the UAV body frame with respect to the earth frame is specified in ZYX Euler angles. First rotate about the ze-axis by the yaw angle, ψ. Then, rotate about the intermediate y-axis by the pitch angle, ϴ. Then, rotate about the intermediate x-axis by the roll angle, ϕ.
The angular velocity of the UAV is represented by [p,q,r] with respect to the body axes, [xb,yb,zb].
For fixed-wing UAVs, these equations define the guidance model of the UAV:
These equations result in these state variables:
where:
xe, ye, and h are the north position, east position, and height of the UAV in the inertial frame, respectively
χ, γ, and ϕ are the course angle, flight path angle, and roll angle of the UAV, respectively.
Va and Vg are the air and ground speeds of the UAV.
Vwn, Vwe, and Vwdare the wind speeds of the UAV in the north, east, and down directions, respectively.
kP* and kD*are controller proportional and derivative gains of the UAV, respectively.
C is the control input.
The model assumes that the UAV is flying under a coordinated-turn condition, with zero side-slip. The autopilot controls airspeed, altitude, and roll angle.
These equations define the guidance model for multirotor UAVs.
The model governs the acceleration of the UAV center of mass in inertial coordinates as:
where:
xe, ye, andhare the north position, east position, and height of the UAV in the inertial frame, respectively
m and g are the mass and gravitational acceleration of the UAV, respectively
Fthrust is the total force created by the propellers applied to the multirotor along the –zb axis.
Reb is the rotation matrix that rotates the inertial frame to the body frame:
where ψ, ϴ, and ϕare the yaw, pitch, and roll angles, respectively. c and s are abbreviations for cos and sin, respectively.
The model uses two independent proportional-derivative (PD) controllers to control the roll and pitch angles, and two independent proportional (P) controllers to control the yaw rate and thrust.
These equations determine the angular velocity, angular acceleration, and thrust:
where:
ψ, ϴ, and ϕ are the yaw, pitch, and roll angles, respectively
p,q, and r are the angular rotation with respect to xb,yb, and zb, respectively.
kP* and kD*are the proportional and derivative gains of the controller, respectively.
c is the control input
Fthrust is the thrust of the UAV
These equations result in these state variables:
References
[1] Randal W. Beard and Timothy W. McLain. "Chapter 9." Small Unmanned Aircraft Theory and Practice, NJ: Princeton University Press, 2012.
[2] Mellinger, Daniel, and Nathan Michael. "Trajectory Generation and Control for Precise Aggressive Maneuvers with Quadrotors." The International Journal of Robotics Research. 2012, pp. 664-74.
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
Version History
Introduced in R2018b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)