Main Content

Multi-Instance Guidance Model

Reduced-order model for multiple UAVs

Since R2025a

  • Multi-instanceUAV Guidance Model block

Libraries:
UAV Toolbox / Algorithms

Description

The Multi-Instance Guidance Model block simulates multiple small UAVs by using reduced-order fixed-wing [1] or multirotor [2] kinematic models and autopilot controllers.

Examples

expand all

Open the reducedOrderMultiUAVModel.slx Simulink® model. The model uses the Multi-Instance Guidance Model block to simulate multiple UAVs with reduced order fixed-wing kinematic models, and a UAV Animation block to visualize the result.

open_system("reducedOrderMultiUAVModel")

reducedOrderMultiUAVModel model

Initial Condition of UAV

This model simulates the flight of four UAVs. Each UAV starts the simulation in the same position, air speed, heading angle, roll angle, and roll angle velocity. However, each UAV have different initial heights:

  • UAV 1 — 50 meters

  • UAV 2 — 60 meters

  • UAV 3 — 70 meters

  • UAV 4 — 80 meters

The initial condition is specified in the Initial State parameter of the Multi-Instance Guidance Model block.

Multi-Instance Guidance Model block mask with the initial height parameters highlighted.

Configuration of UAV

UAV 1, UAV 2, and UAV 3 are configured with default controller configuration. UAV 4 is confiigured with a proportional gain of the height controller of 1, and a proportional gain of the flight path angle controller of 1. This configuration is specified in the Configuration parameter of the Multi-Instance Guidance Model block.

Multi-Instance Guidance Model block mask with the P Height and P Flight Path Angle parameters highlighted.

Control Input

This model uses the Bus Creator block to create the control input bus. The bus name is specified in accordance with the Control Bus Name parameter of the Multi-Instance Guidance Model block.

Bus Creator and Multi-Instance Guidance Model block masks, with the Output data type and Control Bus Name parameters highlighted, respectively.

The bus contains these elements:

  • Height — Sets UAV 1, 2, 3, and 4 to have heights of 50, 60, 70, and 100 meters, respectively.

  • AirSpeed — Sets all UAV to have an air speed of 20 m/s.

  • RollAngle — Sets UAV 1, 2, 3, and 4 to have roll angles of -0.3, 0, 0.3, and 0 radians, respectively.

Control input bus, with Height, AirSpeed, and RollAngle inputs.

Environment Input

This model uses the Bus Creator block to create the environment input bus. The bus name is specified in accordance with the Environment Bus Name parameter of the Multi-Instance Guidance Model block.

Bus Creator and Multi-Instance Guidance Model block masks, with the Output data type and Environment Bus Name parameters highlighted, respectively.

The bus contains the following elements:

  • WindNorth — Sets all UAV to have north wind velocites of 0 m/s.

  • WindEast — Sets all UAV to have east wind velocites of 0 m/s.

  • WindDown — Sets all UAV to have down wind velocites of 0 m/s.

  • Gravity — Sets all UAV to have a gravitational accelerations of 9.8 m/s2.

Environment input bus, with WindNorth, WindEast, WindDown, and Gravity inputs.

Visualizing State Output

Before visualizing the state output, the model performs these operations on the elements of the bus output by the Multi-Instance Guidance Model block.

  • Multiplies the <Height> signal by a gain of –1 to match the z-axis direction of the UAV Animation block. The model then combine the height signal with <North> and <East> signals into a matrix. The model transposes the matrix so that each row contains the translation of each UAV, and connects the matrix to the Translation port of the UAV Animation block.

  • Combines the <HeadingAngle>, <FlightPathAngle>, and <RollAngle> signals into a matrix. The model transposes the matrix so that each row contains the rotation angle of each UAV, and connects the matrix to the Rotation port of the UAV Animation block.

  • The vector specified to the UAV Type input of the UAV Animation block indicates that all three UAVs are fixed-wing, while the UAV Mesh Configuration input sets the colors of UAVs 1, 2, 3, and 4 to red, green,blue, and black, respectively.

UAV Animation block connected to configured, transposed elements of the output bus of the Multi-Instance Guidance Model block, and UAV type and color configurations.

Run the Simulink model, and observe the simulation result from the UAV Animation window.

UAV Animation window output

Ports

Input

expand all

Control input for UAVs, specified as a bus. Specify each element of the bus as a 1-by-N vector, where N is the number of UAVs that you want to simulate.

If you set the Model Type property to MultirotorGuidance, you must specify a bus with these elements:

  • Roll — Roll angle of each UAV in radians.

  • Pitch — Pitch angle of each UAV in radians.

  • YawRate — Yaw rate of each UAV in radians per second.

  • Thrust — Vertical thrust of each UAV in Newtons.

If you set the Model Type property to FixedWingGuidance, you must specify a bus with these elements:

  • Height — Height of each UAV above the ground in meters.

  • Airspeed — Airspeed of each UAV in meters per second.

  • RollAngle — Roll angle of each UAV in radians.

Specify the name of the control input bus by using the Control Bus Name property.

Environment inputs, specified as a bus. Specify each element of the bus as a 1-by-N vector, where N is the number of UAVs that you want to simulate.

If you set the Model Type property to MultirotorGuidance, you must specify a bus with Gravity element which contains the gravitational acceleration for each 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 each UAV in meters per second.

  • WindEast — Wind velocity in the east direction for each UAV in meters per second.

  • WindDown — Wind velocity in the downward direction for each UAV in meters per second.

  • Gravity — Gravitational acceleration for each 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

expand all

Simulated UAV state, returned as a bus. Each element in the bus is a matrix or vector with N columns, where N is the number of UAV that you simulate.

If you set the Model Type property to MultirotorGuidance, the block returns the state output as an eight-element bus with these elements:

  • <WorldPosition> — 3-by-N matrix of UAV positions. Each column of the matrix contains the xyz-position of a UAV in meters.

  • <WorldVelocity> — 3-by-N matrix of UAV velocities. Each column of the matrix contains the xyz-velocity of a UAV in meters per second.

  • <EulerZYX> — 3-by-N matrix of UAV Euler angles. Each column of the matrix contains the Euler angles of a UAV in z-,y-,x-axis (yaw-pitch-roll) rotation sequence.

  • <BodyAngularRateRPY> — 3-by-N matrix of UAV angular rates. Each column of the matrix contains the angular rate of a UAV with respect to the x-,y-, and z- axes (roll rate, pitch rate, and yaw rate, respectively) in radians per second.

  • <Thrust> — 1-by-N vector of UAV thrusts. Each element of the vector contains the thrust of a UAV in newtons.

If you set the Model Type property to FixedWingGuidance, the block returns the state output as a bus with eight elements, where each element is a 1-by-N vector. The bus contains these elements:

  • <North> — Position in the north direction for each UAV in meters.

  • <East> — Position int he east direction for each UAV in meters.

  • <Height> — Height above the ground for each UAV in meters.

  • <AirSpeed> — Speed relative to the wind for each UAV in meters per second.

  • <HeadingAngle> — Angle between the ground velocity and north direction for each UAV in radians.

  • <FlightPathAngle> — Angle between the ground velocity and north-east plane for each UAV in radians.

  • <RollAngle> — Angle of rotation along the body x-axis for each UAV in radians per second.

  • <RollAngleRate> — Angular velocity of rotation along the body x-axis for each UAV in radians per second.

Specify the name of the state output bus by using the State Bus Name property.

Data Types: bus

Parameters

expand all

To edit block parameters interactively, use the Property Inspector. From the Simulink® Toolstrip, on the Simulation tab, in the Prepare gallery, select Property Inspector.

Guidance model type for all UAVs. Select MultirotorGuidance to simulate multirotor UAVs or FixedWingGuidance to simulate fixed wing UAVs.

Specify the number of UAVs to simulate as a positive integer.

Specify the input and output numeric data types as double or single.

  • 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 to Interpreted execution.

  • Interpreted execution — Simulate model using the MATLAB® interpreter. This option shortens startup time but has a slower simulation speed than Code generation. In this mode, you can debug the source code of the block.

Initial UAV state tab, specified as multiple table entries. In all initial state descriptions, N is the number of UAVs that you are simulating.

For multirotor UAVs, you must specify these initial states:

  • World Position — 3-by-N matrix. Specify each column of the matrix as the initial xyz-position of a UAV in meters. The default value for each UAV is [0;0;0].

  • World Velocity — 3-by-N. Specify each column of the matrix as the initial xyz-velocity of a UAV in meters per second. The default value for each UAV is [0;0;0].

  • Euler Angles (ZYX) — 3-by-N matrix. Specify each column of the matrix with the initial Euler angles of a UAV in z-,y-,x-axis (yaw-pitch-roll) rotation sequence. The default value for each UAV is [0;0;0].

  • Body Angular Rates — 3-by-N matrix. Specify each column of the matrix as the initial angular rate of a UAV with respect to the x-,y-, and z-axes (roll rate, pitch rate, and yaw rate, respectively) in radians per second. The default value for each UAV is [0;0;0].

  • Thrust — 1-by-N vector. Specify each element of the vector as the initial thrust of a UAV in newtons. The default value for each UAV is 0.

For fixed-wing UAVs, you must specify these initial states as 1-by-N vectors:

  • North Position — Initial position in the north direction for each UAV in meters. The default value for each UAV is 0.

  • East Position — Initial position in the east direction for each UAV in meters. The default value for each UAV is 0.

  • Height — Initial height above the ground each for each UAV in meters. The default value for each UAV is 0.

  • Air Speed — Initial speed relative to the wind for each UAV in meters per second. The default value for each UAV is 0.

  • Heading Angle — Initial angle between the ground velocity and north direction for each UAV in radians. The default value for each UAV is 0.

  • Flight Path Angle — Initial angle between the ground velocity and north-east plane for each UAV in radians. The default value for each UAV is 0.

  • Roll Angle — Initial angle of rotation along the body x-axis for each UAV in radians per second. The default value for each UAV is 0.

  • Roll Angle Rate — Initial angular velocity of rotation along the body x-axis for each UAV in radians per second. The default value for each UAV is 0.

Tunable: No

UAV controller configuration tab, specified as multiple table entries. In all controller configuration descriptions, N is the number of UAVs that you are simulating.

For multirotor UAVs, specify these parameters:

  • PD RollN-by-2 matrix. Specify each row of the matrix as the proportional and derivative gains of the roll angle controller for a UAV. The default value for each UAV is [3402.97 116.67].

  • PD PitchN-by-2 matrix. Specify each row of the matrix as the proportional and derivative gains of the pitch angle controller for a UAV. The default value for each UAV is [3402.97 116.67].

  • P YawRateN-by-1 vector. Specify each element of the vector as the proportional gain of the yaw rate controller for a UAV. The default value for each UAV is 1950.

  • P ThrustN-by-1 vector. Specify each row of the vector as the proportional gain of the thrust controller for a UAV. The default value for each UAV is 3900.

  • MassN-by-1 vector. Specify each element of the vector as the mass of a UAV in Kg. The default value for each UAV is 0.1.

For fixed-wing UAVs, specify these parameters:

  • P HeightN-by-1 vector. Specify each element of the vector as the proportional gain of the height controller for a UAV. The default value for each UAV is 3.9.

  • P Flight Path AngleN-by-1 vector. Specify each element of the vector as the proportional gain of the flight path angle controller for a UAV. The default value for each UAV is 39.

  • PD RollN-by-2 matrix. Specify each element of the matrix as the proportional and derivative gains of the pitch angle controller for a UAV. The default value for each UAV is [3402.97 116.67].

  • P Air SpeedN-by-1 vector. Specify each element of the vector as the proportional gain of the air speed controller for a UAV. The default value for each UAV is 1.

  • Min/Max Flight Path AngleN-by-2 matrix. Specify each element of the matrix as the minimum and maximum flight path angle for a UAV in radians. The default value for each UAV is [-pi/2 pi/2]

This tab contains the State Bus Name, Control Bus Name, and Environment Bus Name parameters, which specify the name of the output state bus, the input control bus, and the input environment bus, respectively. Each bus has a default name based on the UAV model and input type.

Model Type ParameterDefault State Bus NameDefault Control Bus NameDefault Environment Bus Name
FixedWingGuidanceFixedWingGuidanceStateBusFixedWingGuidanceControlBusFixedWingGuidanceEnvironmentBus
MultirotorGuidanceMultirotorGuidanceStateBusMultirotorGuidanceControlBusMultirotorGuidanceEnvironmentBus

To use multiple guidance models in the same Simulink model, specify bus names for each Multi-Instance Guidance Model block that do not intersect with one another.

More About

expand all

References

[1] Beard, Randal W., and Timothy W. McLain. “Design Models for Guidance.” In Small Unmanned Aircraft: Theory and Practice, 175–87. Princeton, NJ: Princeton University Press, 2012

[2] Mellinger, Daniel, Nathan Michael, and Vijay Kumar. “Trajectory Generation and Control for Precise Aggressive Maneuvers with Quadrotors.” The International Journal of Robotics Research 31, no. 5 (April 2012): 664–74. https://doi.org/10.1177/0278364911434236.

Extended Capabilities

expand all

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Version History

Introduced in R2025a