Simulator

@Taim Al-Dabbagh @Mostafa Hussein

The simulator is a MATLAB/Simulink model that simulates an aircraft.

Currently, the simulator will work for a generic fixed-wing aircraft.

Critical Aspects

We would like to have a simulator that validates our competition drone, so the Simulink model must take proper inputs, proccess and calculate accurate information, and visualize the output from what the model proccesses. In order to have a functional and valid simulator, we must accomplish the following aspects that are critical to validating the aircraft for competition:

  1. Realistic enviroment simulation

  2. Automatically calculate parameters from imported CAD model

  3. Interfacing with ZP3

  4. Accurate sensor model mocks

Flowchart

Prior to starting on modelling the simulator in Simulink, the process of how the simulator operates was abstracted and made into a flowchart to show the different parts of the simulator and how they work.

Abstracted flowchart of simulator

Firstly, input commands are given to the simulator. This includes throttle and control surfaces that describe the aircraft. This information gets sent to the controller, which controls the throttle and control surfaces in order to move the aircraft to a certain position/waypoint.

The output from the controller (actuator output) will be used to simulate the effect of the actuator outputs (how the lift and other variables is affected after the control surfaces are controlled). This would include calculating the forces and moments generated by the control surfaces and throttle, which gets used to find more information by calculating other variables (orientation, altitude, etc) through the physics model.

After the physic model calculations, it gets outputted into the simulated IMU sensor which feeds back into the controller block, which closes the loop of the processes taken by the simulator to simulate the aircraft.

After a rough working draft of the simulator has been finished and cleaned up, the controller will be replaced with ZeroPilot, so the simulator will interface with ZP.

 

UPDATES:


Required Simulink Version and Toolboxes

In order to run the simulator, there are required toolboxes that must be installed within MATLAB/Simulink. The following toolboxes are required:

The latest MATLAB/Simulink version to run the simulator has to be R2022b.

Resources

Starting with no knowledge on how aircrafts work along with using Simulink, a list of (some) resources that were used to learn and create the simulator were collected which can be accessed below.