Simulating Quadcopter in MATLAB

Published on . Written by

Simulating Quadcopter in MATLAB

A Quadcopter is a multi-rotor vehicle as it consists of 4 rotors. It is widely used for various purposes because of its simplicity and agility. In this Matlab project, we will understand the dynamics of the quadcopter, PID tuning and perform a closed-loop simulation in Simulink. 

Read more..

SLNOTE

Skyfi Labs Projects
Working of a quadcopter

Quadcopter has 4 rotors that rotate in a precise way to actuate the quadcopter in all the 6 DoF. The propellers are aerodynamically designed to generate the lift. You can also increase the number of rotors and they can be called as hexacopter (6 rotors), Octacopter (8 rotors), etc. Unlike fixed-wing aircraft, quadcopters have good stability and hovering capability.

Almost all the quadcopters are equipped with IMU sensors which is basically a combination of 3-axis accelerometer and 3-axis gyroscope sensor. It is integrated with the flight control system of the aircraft and actuates the motor by detecting the orientation of the aircraft. Thus providing a stable flight. 

Miscellaneous sensors like barometer, ultrasonic sensor, magnetometer, etc. are used to detect the altitude, orientation in space. 

Most of the quadcopters are built on top of X-configuration where the opposing two motors spin in a clockwise direction and the other spins in the anticlockwise direction. This is done to cut the torque produced by the motors.


SLLATEST
Following are the 6 different motions of the quadcopter forward and backwards, up and down, right and left - motion in translational direction, roll, pitch and yaw - motion in the rotational direction. 

Simulink is a tool provided with MATLAB used to perform simulation and analysis. It provides a graphical programming environment to conduct the simulation. It makes simulation easier by using blocks.

Project implementation

The aim of this MATLAB project is to simulate a drone in Simulink by understanding the dynamics of a quadcopter.

Designing a control system architecture to hover a quadcopter - Build a controller that uses thrust to adjust the altitude by taking the feedback from sensors by considering the roll, pitch and yaw axis. 

Building the flight code - To perform the simulation model-based design is used to create a realistic environment and a quadcopter model. Two codes are written: model code to simulate the real world and the actual flight code to run quadcopter.

Building the model for simulation - The flight code for the model is written to operate in the virtual environment and the drone is operated and tested. 

PID tuning of the drone - PID controller (Proportional, Integral and Derivative) is an integral part of the flight control software that plays a major role to achieve a stable flight. It uses a control loop mechanism by taking input from the sensors and motors.

Different PID values are given and tested to achieve a stable flight. Thus a quadcopter is designed and simulated using model-based design in Simulink.


SLDYK
Kit required to develop Simulating Quadcopter in MATLAB:
Technologies you will learn by working on Simulating Quadcopter in MATLAB:


Any Questions?