Quadcopter Control and Sensors
You must create a control system and set sensors for the quadcopter.
Control System
To create a control system for a Parrot quadcopter minidrone , you must design algorithms and controllers that manage the stability, altitude, orientation, and trajectory of the drone.
When designing the control system for a minidrone, consider the specific dynamics and constraints of the drone, as well as the requirements of the intended mission or application. Safety, stability, and responsiveness are critical aspects of the control system design.
For control, the quadcopter uses a complementary filter to estimate attitude, and Kalman filters to estimate position and velocity.
The model implements the controller and estimators as subsystems, which allows you to evaluate several combinations of estimators and controllers for design.
Quadcopter Flight Control System
Inputs. The inputs of the flight control system (FCS) are:
Aircraft command — From
Command
subsystemSensors — From the
Sensor
subsystemImage data — From
Sensors
subsystem
Components. The main components of the FCS are:
Image Processing system — The system uses the image data from the sensors and computes the landing flag, which forms the input to the landing logic control system. The subsystem detects whether dominance of red is detected in the image from the camera.
Landing Logic — The landing logic system initiates the controller to land the quadcopter based on the landing flag, which is set based on the camera data, and the landing Override flag, which is set if the vehicle closes in on the safe limit of 0.6 m (height from the ground).
Estimators — The subsystem uses the sensor subsystem outputs to estimate the states of the vehicle using a complementary filter (for attitude) and Kalman filters (for position and velocity).
Controller — The implemented controller logic uses
A PID controller for pitch/roll control.
A PD controller for yaw
A PD controller for position control in North-East-Down coordinates
Crash predictor flag — The flag is set based on the vehicle state values. The simulation is stopped based on the optical flow velocity (u or v is >0 .01) or the estimated position (x or y >10).
The controllerVars
file contains variables pertinent to the
controller. The estimatorVars
file contains variables
pertinent to the estimator. The values are based on these files https://github.com/Parrot-Developers/RollingSpiderEdu/tree/master/MIT_MatlabToolbox/trunk/matlab/libs/RoboticsToolbox.
Sensors
You can use either of these types of sensors in the model:
Dynamic sensors
Feedthrough sensors
Dynamic sensors and feedthrough sensors serve different purposes and provide distinct types of data for the flight control system. Dynamic sensors are designed to measure changes in the motion and orientation of the drone. They provide real-time data related to the movement, acceleration, and rotational dynamics of the drone. Common dynamic sensors in a drone include accelerometers, gyroscopes, magnetometers, and inertial measurement units (IMUs).
Feedthrough sensors directly pass on the states and environment values as sensor outputs, while in Dynamic sensors the IMU block adds noise to the state values.
Use the VSS_SENSORS
variable in the workspace to choose your
sensors.
This workflow uses a set of sensors to determine the states of the quadcopter. These states describe the orientation and position of the quadcopter:
VNED — Velocity in earth reference frame
XNED — Position in earth reference frame
Euler — Euler rotation angles φ, θ, and ψ
DCMbe — Coordinate transformation from Earth axes to body-fixed axes
Vb — Velocity in the body-fixed frame
ɷb — Angular rates in body-fixed axes
dɷb/dt — Angular accelerations
Abe — Accelerations with respect to inertial frame
These sensors determine the states:
An IMU to measure the angular rates and translational accelerations.
An algorithm for optical flow estimation.
Sonar for altitude measurement.
The system stores the characteristics for the sensors in sensorVars
. To
include sensor dynamics with these measurements, you can change the
VSS_SENSORS
variable in the workspace.