Quadcopter Simulink Model
• Rotor #1 rotates positively with respect to the z-axis. It is located parallel to the xy-plane, -45 degrees from the x-axis. • Rotor #2 rotates negatively with respect to the body's z-axis. It is located parallel to the xy-plane, -135 degrees from the x-axis. • Rotor #3 has the same rotation direction as rotor #1. It is located parallel to the xy-plane, 135 degrees from the x-axis. • Rotor #4 has the rotation direction as rotor #2.
Modeling and Simulation of Quadcopter using PID Controller. MATLAB Simulink model using PID controller for. MATLAB Simulink model for quadcopter using PID. A hobby-grade quadcopter was chosen as the primary test. The Simulink model. Included within the APM Multicopter Development Kit for Simulink is a stereo.
It is located parallel to the xy-plane, 45 degrees from the x-axis. This example uses the approach defined by Prouty[1] and adapted to a heavy-lift quadcopter by Ponds et al[2].
Control For control, the quadcopter uses a complementary filter to estimate attitude, and Kalman filters to estimate position and velocity. The example implements. • A PID controller for pitch/roll control • A PD controller for yaw • A PD controller for position control in Noth-East-Down coordinates The controllerVars file contains variables pertinent to the controller. The estimatorVars file contains variables pertinent to the estimator.
The example implements the controller and estimator as model subsystems, enabling several combinations of estimator and controllers to be evaluated for design. To provide inputs to the quadcopter (in pitch, roll, yaw, North (X), East (Y), Down (Z) coordinates ), use one of the following and change the VSS_COMMAND variable in the workspace. • An Inertial Measurement Unit (IMU) to measure the angular rates and translational accelerations. • A camera for optical flow estimation. • A sonar for altitude measurement. The example stores the characteristics for the sensors in the file sensorVars.
To include sensor dynamics with these measurements, you can change the VSS_SENSORS variable in the workspace. Environment The models implement several Aerospace Blockset™ environment blocks, including those for atmosphere and gravity models. To include these models, you can change the VSS_ENVIRONMENT variable in the workspace to toggle between variable and fixed environment models. Linearization The model uses the trimLinearizeOpPoint to linearize the nonlinear model of the quadcopter using Simulink Control Design (R). Testing To make sure that the trajectory generation tool works properly, the example implements a test in the trajectoryTest file.
For more information on how to do this, see the Simulink Control Design ) Visualization You can visualize the variables for the quadcopter in one of the following ways. • Using Simulation Data Inspector.
• Using the flight instrument blocks. • Toggling between the different visualization variant subsystems. You can toggle between the different variant subsystems by changing the VSS_VISUALIZATION variable. Note that one of these variants is a FlightGear animation. To use this animation, you must add a FlightGear compatible model of the quadcopter to the project.
The software does not include this model. Trajectory Generation A trajectory generation tool, using the Dubin method, creates a set of navigational waypoints.
To create a trajectory with a set of waypoints this method uses a set of poses defined by position, heading, turn curvature, and turn direction. To start the tool, open the project and run: The following interface displays.
• North and East (position in meters) • Heading (degrees from North) • Curvature (turning curvature in meters^-1) • Turn (direction clockwise or counter-clockwise) A list of poses appears in the waypoint list to the right of the text boxes. Raphael Icons Font. To add a waypoint, enter pose values in the edit boxes and click Add. The new waypoint appears in the waypoint list in the same panel. To edit the characteristics of a waypoint, select the waypoint in the list and click Edit. The characteristics of the waypoints display in the edit boxes.
Edit the characteristics as desired, then click OK. To cancel the changes click Cancel. To delete a waypoint, in the waypoint list, select the waypoint and click Delete. No-Fly Zone The panel defines the location and characteristics of the no-fly zones.
To define the no-fly zone, the panel uses text boxes. • North and East (position in meters) • Radius (distance in meters) • Margin (safety margin in meters) Use the Add, Delete, Edit, OK, and Cancel buttons in the same way as for the Waypoints panel. Mapped Trajectory This panel plots the trajectory over the Apple Hill campus aerial schematic based on the waypoints and no-fly zone characteristics.