Main Content

Helicopter Modeling and Simulation

Since R2024b

This example shows how to model, simulate, control, and visualize a helicopter system in Simulink® using the Rotor (Aerospace Blockset) and 6DOF (Euler Angles) (Aerospace Blockset) blocks from Aerospace Blockset™.

Model Overview

Open the Simulink® model.

mdl = "HelicopterModelingSimulation";
open_system(mdl);

The top model consists of six subsystems:

Helicopter Model

This example models a helicopter by computing the forces and moments exerted by each part of helicopter and resolving them along the center of gravity of the helicopter. The resultant forces and moments are then fed to the 6DOF (Euler Angles) (Aerospace Blockset) block, which implements 6DOF equations of motion to simulate the helicopter model.

These components are included in the Force Moment Computation subsystem.

The UH-1H helicopter [1] parameters are used to compute forces and moments for the helicopter components. The helicopter weighs 2800 kg. For the purposes of this example, maintain constant speeds for the main rotor and tail rotor.

Main Rotor

A Rotor block models the main rotor of the helicopter by enabling the flap effects. The main rotor of the UH-1H helicopter is located at aft and above the CG position. Consequently, the moments from the Rotor block are resolved using the Cross Product block. The control input to the main rotor is the collective blade pitch angle, θ0, lateral cyclic pitch angle, θc, and longitudinal cyclic pitch angle, θs.

Tail Rotor

The tail rotor is modeled using the Rotor block without flap effects. Unlike the main rotor, the tail rotor is mounted vertically. Hence, the forces and moments from the Rotor block should be transformed about x-axis by 90 degrees, to properly represent its orientation. The Rotation Angles to Direction Cosine Matrix block carries out this transformation. As the tail rotor is located at aft and above the CG position of the helicopter system, the moments from the Rotor block are resolved using a Cross Product block. The control input to the tail rotor is the collective blade pitch angle, θ0, of the tail rotor.

Fuselage

This example uses simple fuselage aerodynamics of a UH-1H helicopter [1], implemented using a MATLAB Function block.

XF=uB(-D1|uB|+L1wB2|uB|)=-D1uB|uB|+L1wB2sign(uB)

YF=vB(-D2|vB|-Y1|uB|)

ZF=wB(-D3|wB|-L1|uB|)

LF=0

MF=M1wB|uB|

NF=-N1vBuB

Vertical Fin

The vertical fin aerodynamics corresponding to the UH-1H helicopter [1] are implemented using a MATLAB Function block.

uv=uB

vv=-vB+lVFrB

Yv=K1vvuv+F1vv|vv|

Nv=-YvlVF

Horizontal Stabilizer

The aerodynamics corresponding to the horizontal stabilizer of the UH-1H helicopter [1] are implemented using a MATLAB Function block.

uH=uB

wH=wB+lHSqB

ZH=-H1wHuH-H4wH|wH|

MH=ZHlHS

Gravity

The force due to gravity in the body axes frame is obtained by multiplying the direction cosine matrix, DCM and gravitational force in the north-east-down(NED) frame.

Sensor

The Sensor subsystem adds noise to the output of 6DOF (Euler Angles) block to resemble the measured signals from the helicopter system.

Input Panel

Use the Input Panel subsystem to set the reference height from the model.

Instrument Panel

The Instrument Panel subsystem uses aircraft-specific gauges from the Aerospace Blockset™ Flight Instrumentation library.

Environment

This example assumes a constant gravity of 9.81m/s2. The density of air is computed based on the altitude using the COESA Atmosphere Model (Aerospace Blockset) block.

Command and Control

The Command and Control subsystem manages and directs the behavior and responses of the helicopter. Since the helicopter is an underactuated system, where the number of control inputs is less than the number of states or modes to be controlled, this subsystem includes a cascaded proportional integral derivative (PID) control strategy.

This control mechanism is structured in a hierarchical manner, where multiple PID controllers are cascaded to refine the control action at each level. Each PID controller in the cascade is responsible for a specific aspect of the operation of the helicopter. For example, the inner loop controls the rate, and the outer loop controls the corresponding angle. This mechanism acts as an effective control strategy for an underactuated system.

Assuming constant rotor speeds, control inputs to the helicopter system include the collective blade pitch angle, and the lateral and longitudinal cyclic pitch angles. The collective blade pitch angle of the main rotor controls the altitude of the helicopter. The lateral cyclic pitch angle, the longitudinal cyclic pitch angle of the main rotor, and the collective blade pitch angle of the tail rotor control roll, pitch, and yaw motions, respectively.

The climb rate of the UH-1H helicopter is 488m/min, so the reference altitude increases at a rate of 8m/s until the helicopter reaches its desired altitude. The forward velocity is computed based on the specified velocity. You can assume that the lateral velocity is zero. The pitch and roll angle values are calculated by the PID controllers using the reference forward and lateral velocity values.

Visualization and Scope

The Visualization subsystem visualizes the helicopter in a simulation environment that uses the Unreal Engine® from Epic Games®. Visualization can be performed by co-simulation between Unreal Engine® and the Simulation 3D Scene Configuration (Aerospace Blockset), Helicopter (Aerospace Blockset), and Simulation 3D Rotorcraft (Aerospace Blockset) blocks. For more information on the Unreal Engine simulation environment, see How 3D Simulation for Aerospace Blockset Works (Aerospace Blockset).

To visualize the simulation results with Simulink 3D Animation, select the visual3D check box.

visual3D = false;

Run the live script to update the values, before executing the Simulink model.

Helicopter Simulation

Simulate the model to perform path-following, steady level-flight, or hover maneuvers. By default, the desired state is set to "path" to perform the path-following maneuver. To perform a level-flight or hover maneuver, choose the corresponding option from the dropdown.

state = "path";

Set the flying altitude of the helicopter. The maximum altitude of the UH-1H helicopter is 3500m.

hRef = 20;

For steady level-flight condition, set the desired velocity. The maximum velocity is 65m/s to represent the physical constraint of UH-1H helicopter.

if state == "level"||state == "path"
VRef = 30;
end

In this example, waypoints are used to guide the helicopter along a specific path. The choice of waypoints is used to define the trajectory and ensure that the helicopter follows the desired path during the simulation. Define the waypoints in the matrix WP, where each column represents a 3D coordinate in the format [x; y; z].

Ensure that each successive waypoint is defined at least 500 m apart, matching the 500 m lookahead distance. The guidance system calculates the yaw angle required to steer the aircraft on to the desired path. For information on guidance laws, see [2].

if state == "path"

WP(:,1) = [0; 0; -20];
WP(:,2) = [1500; 0; -20];
WP(:,3) = [1500; 1000; -20];
WP(:,4) = [0; 1000; -20];
WP(:,5) = [0; 0; -20];

Use the plot3 function to visualize the waypoints and the helicopter's path in a 3D space.

figure(1)

plot3(WP(2,:),WP(1,:),WP(3,:),'g*')
hold on
plot3(WP(2,:),WP(1,:),WP(3,:),'g')
axis equal
xlabel('y [m]');
ylabel('x [m]');
end
out = sim(mdl);
figure(1)
plot3(out.posout.Data(:,2),out.posout.Data(:,1),out.posout.Data(:,3),'r')

Figure contains an axes object. The axes object with xlabel y [m], ylabel x [m] contains 3 objects of type line. One or more of the lines displays its values using only markers

The desired altitude of the helicopter is controlled with a PID controller, by using the collective pitch angle of the main rotor as input. Calculate the desired roll angle and pitch angle using the PID controller, based on the desired vB and uB, respectively. You can calculate the desired yaw angle by applying the guidance laws in [2]. Control the roll, pitch, and yaw angles with cascaded PID controllers, utilizing corresponding rate controls p, q, and r in the inner loop. Use the lateral cyclic and longitudinal cyclic pitch angles of the main rotor for roll and pitch control and the collective pitch angle of the tail rotor for yaw control.

HelicopterModelingAndSimulationExample_06.gif

Reference

[1] Talbot, Peter D. and Lloyd D. Corliss. "A Mathematical Force and Moment Model of a UH-1H Helicopter for Flight Dynamics Simulations." NASA Ames Research Center, 1977. https://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/19770024231.pdf

[2] Fossen, Thor I., Thor J. Perez, and Asgeir J. Sørensen. "An Overview of the Marine Systems Simulator (MSS): A Simulink Toolbox for Marine Control Systems." Journal of Marine Engineering and Technology 12, no. 3 (2009): 45-60. https://doi.org/10.1080/20464177.2009.11020220.

See Also

(Aerospace Blockset)

See Also

Topics