# Simulink Drone Reference Application [![View Simulink Drone Reference Application on File Exchange](https://www.mathworks.com/matlabcentral/images/matlab-file-exchange.svg)](https://www.mathworks.com/matlabcentral/fileexchange/67625-simulink-drone-reference-application)
This Simulink® Project shows the implementation of a Remotely Piloted Radio-Control fixed-wing aircraft (i.e. Drone, UAV), an autopilot for flight stabilization, and an operator interface to control its trajectory.
## Components
The model consists of three main components:
### Plant model
A Six-Degree-Of-Freedom (6-DOF) dynamics model for a foam-built, 65-inch wingspan, Multiplex Mentor hobby radio controlled aircraft. It consists of models for the aircraft dynamics, the weather, the motor, the actuators and the sensors. The plant receives commands for the four actuator channels: (1) Throttle, (2) Ailerons, (3) Rudder, and (4) Elevator. In turn, it produces a set of readings as those that a sensor suite would produce on board this type of aircraft.
The plant model uses a flat-earth approximation and therefore it will only work for flights which have a range of approximately 20 Km..
### Autopilot model.
The autopilot controller is a classical lateral/longitudinal channel flight controller which includes Guidance, Navigation and Control (except attitude estimation as this is assumed to be obtained directly from the sensor suite). The autopilot, based on the ground control station commands and the sensor readings, produces control commands for the control surfaces and also reports telemetry back to the ground station. This block stabilizes the aircraft to keep it in-flight.
It allows the operator to command it to fly in four different modes:
- Waypoint guidance.
- Circular Guidance.
- Return to Base.
- Mid-level contro commands (Uc, phi_c, H_c)
### Aircraft operator interface.
This represents the console operating the RC Aircraft in flight. It issues commands sent from the ground to the aircraft (waypoints, airspeed, height, etc...).
The block receives telemetry reported by the aircraft such as attitude, sensor readings, and overall aircraft status. This will allow to set the desired behavior of the aircraft while in-flight.
This model has the option to interact with the well-know, publicly available Open Source Micro Air Vehicle ground station software [QGroundControl](http://qgroundcontrol.com/). To communicate with QGroundControl, the model uses the [MAVLink](https://mavlink.io/) communications protocol.
## Functionality
This Simulink Project exercises several common workflows in flight control development. Its purpose is to show a recommended approach to a Model-Based Design (MBD) process to develop a proof of concept Drone flight controller (autopilot). Particularly we show the following workflows:
1. **Flight Controller Design** Develop a fixed-wing drone autopilot and test its behavior in a reasonably realistic 6DOF aircraft simulation.
2. **Simulate the Flight Controller Under Different Conditions**: Rapidly asses the performance of an autopilot under many simulated flight conditions, using local parallel simulations.
3. **Flight Envelope Characterization** Rapidly characterize the Aircraft’s performance by doing a wide range of environmental and initial conditions sweep using MATLAB Distributed Computing Server.
4. **UAV SME Capabilities Assessment** Demonstrate to a Subject Matter Expert (SME), early in the design process, the Drone’s capabilities and gather feedback on usability and its functionality, via co-simulation between Simulink and QGroundControl Ground Station Software.
5. **Test Correctness of the Fight Controller’s Generated Code** Test the code behavior using Simulink's Software-In-the-Loop on the development computer for same results (within bounds) of the designed autopilot.
6. **Deploy and Test Correctness of the Flight Controller’s Generated Code** Test the code’s behavior on a development board (a Raspberry Pi) for same results (within bounds) using Simulink's Processor-In-the-Loop.
7. **System Integration Test (Hardware-In-the-Loop)** Test the flight controller deployed in the development board (Raspberry Pi) with a 6DOF aircraft simulation running in a [Speedgoat®](https://www.speedgoat.com/) Real-Time computer with [Simulink Real-Time™](https://www.mathworks.com/products/simulink-real-time.html).
8. **Run Regression Tests** Run Regression tests locally.
## Co-Simulation and Control Interface
This model can interact with the Open Source QGroundControl ground station software to control the aircraft while "in flight":
![QGC Co-Simulation](./documentation/images/cosim_overview.png)
## Getting Started
To run the model clone the repository into your own working directory and, from the MATLAB command line:
```matlab
>> openProject('pathToYourProject/MBDRI.prj');
>> configSim;
>> runShortFlight;
```
This should produce five plots, the first being an XY plot of a complete mission around 6 waypoints, as shown below:
![XY Mission Plot](./documentation/images/runShortFlight_xyPlot.png)
## Setup
To get the full functionality, you will need a computer running MATLAB®, Simulink® and a supported compiler plus the following products depending on the workflow:
### For Flight Control Design
- [Control Systems Toolbox™](https://www.mathworks.com/products/control.html)
### Simulate the Flight Controller Under Different Conditions
- [Parallel Computing Toolbox™](https://www.mathworks.com/products/parallel-computing.html)
### Flight Envelope Characterization
- [Parallel Computing Toolbox™](https://www.mathworks.com/products/parallel-computing.html)
- [MATLAB Parallel Server™](https://www.mathworks.com/products/matlab-parallel-server.html)
### SME Assesment and Connectivity to QGroundControl
- [QGroundControl](http://qgroundcontrol.com/) 3.1.3 or higher.
### For Testing and Deploying the Behavior of the Fight Controller’s Generated Code
- A Raspberry Pi 2 or 3 board.
- MATLAB Coder™
- Simulink Coder™
- [Embedded Coder™](https://www.mathworks.com/products/embedded-coder.html)
- [Simulink Support Package for Raspberry Pi](https://www.mathworks.com/help/supportpkg/raspberrypi/)
### For System Integration Test (Hardware-In-the-Loop)
- A host computer running Windows
- [Simulink Real-Time™](http://www.mathworks.com/products/simulink-real-time.html)
- A supported Speedgoat target computer with two ethernet ports
- A Raspberry Pi 2 or 3 board
- MATLAB Coder™
- Simulink Coder™
- [Simulink Support Package for Raspberry Pi](https://www.mathworks.com/help/supportpkg/raspberrypi/)
### For Automated Tests (Back-to-Back and Regression Tests)
- [Simulink Test™](https://www.mathworks.com/products/simulink-test.html)
## License
The license is available in the [License file](license.txt) within this repository.
# Contributing
If you are interested in contributing we are definitely interested in hearing from you. There are many open tickets and we are sure this list will only grow, so feel free to contribute by owning one of those tickets and send us a pull request.
If you would like to suggest an enhancement please create a new issue and apply the _enhancement_ label. This is no guarantee that we will get to it, but we will definitely take it into consideration.
If you have encountered a bug, please create a new issue and apply the _bug_ label.
# Community Support
[MATLAB Central](https://www.mathworks.com/matlabcentral)
Copyright 2021 The MathWorks, Inc.
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
基于C+matlab+Simulink开发遥控无线电控制无人机项目,用于飞行稳定的自动驾驶仪和用于控制其轨迹的操作员界面的实现,适合毕业设计、课程设计、项目开发。项目源码已经过严格测试,可以放心参考并在此基础上延申使用~ 项目简介: 该Simulink项目展示了遥控无线电控制固定翼飞机(即无人机、无人机)、用于飞行稳定的自动驾驶仪和用于控制其轨迹的操作员界面的实现。 该模型由三个主要组件组成: 1、工厂型号 一种六自由度(6-DOF)动力学模型,适用于泡沫制造的65英寸翼展、Multiplex Mentor业余无线电控制飞机。它由飞机动力学、天气、电机、执行器和传感器的模型组成 2、自动驾驶模型 自动驾驶控制器是一种经典的横向/纵向通道飞行控制器,包括制导、导航和控制(姿态估计除外,因为它被认为是直接从传感器套件中获得的) 3、飞机操作员界面 这表示遥控飞机在飞行中的控制台。它发出从地面发送到飞机的命令(航路点、空速、高度等)。 该块接收飞机报告的遥测数据,如姿态、传感器读数和飞机整体状态。这将允许设置飞机在飞行中的期望行为。
资源推荐
资源详情
资源评论
收起资源包目录
基于C+matlab+Simulink开发遥控无线电控制无人机项目,用于飞行稳定的自动驾驶仪和用于控制其轨迹的操作员界面的实现 (405个子文件)
.gitattributes 420B
.gitignore 4B
.gitmodules 150B
testsuite.h 491KB
common.h 93KB
mavlink_msg_rc_channels.h 39KB
mavlink_msg_high_latency.h 37KB
mavlink_helpers.h 36KB
mavlink_msg_set_position_target_global_int.h 34KB
mavlink_msg_set_position_target_local_ned.h 32KB
mavlink_msg_servo_output_raw.h 31KB
mavlink_msg_position_target_global_int.h 30KB
mavlink_msg_sys_status.h 29KB
mavlink_msg_sim_state.h 29KB
mavlink_msg_control_system_state.h 28KB
mavlink_msg_gps_input.h 28KB
mavlink_msg_hil_state_quaternion.h 28KB
mavlink_msg_position_target_local_ned.h 28KB
mavlink_msg_autopilot_version.h 27KB
mavlink_msg_hil_optical_flow.h 26KB
mavlink_msg_optical_flow_rad.h 26KB
mavlink_msg_set_home_position.h 26KB
mavlink_msg_hil_rc_inputs_raw.h 25KB
mavlink_msg_camera_settings.h 25KB
mavlink_msg_mission_item_int.h 25KB
mavlink_msg_rc_channels_scaled.h 25KB
mavlink_msg_hil_sensor.h 24KB
mavlink_msg_home_position.h 24KB
mavlink_msg_highres_imu.h 24KB
mavlink_msg_gps2_rtk.h 24KB
mavlink_msg_hil_state.h 24KB
mavlink_msg_gps_rtk.h 24KB
mavlink_msg_rc_channels_raw.h 24KB
mavlink_msg_camera_capture_status.h 23KB
mavlink_msg_adsb_vehicle.h 23KB
mavlink_msg_mission_item.h 23KB
mavlink_msg_rc_channels_override.h 23KB
mavlink_msg_hil_gps.h 23KB
mavlink_msg_command_int.h 22KB
mavlink_msg_param_map_rc.h 22KB
mavlink_msg_altitude.h 22KB
mavlink_msg_local_position_ned_cov.h 22KB
mavlink_msg_global_position_int_cov.h 21KB
mavlink_msg_follow_target.h 21KB
mavlink_msg_battery_status.h 21KB
mavlink_msg_camera_information.h 21KB
mavlink_msg_estimator_status.h 21KB
mavlink_msg_gps2_raw.h 21KB
mavlink_msg_set_attitude_target.h 21KB
mavlink_msg_command_long.h 21KB
mavlink_msg_camera_image_captured.h 20KB
mavlink_msg_gps_raw_int.h 20KB
mavlink_msg_global_position_int.h 19KB
mavlink_msg_hil_controls.h 19KB
mavlink_msg_safety_set_allowed_area.h 19KB
mavlink_msg_nav_controller_output.h 18KB
mavlink_msg_storage_information.h 18KB
mavlink_msg_manual_control.h 18KB
mavlink_msg_v2_extension.h 18KB
mavlink_msg_data_transmission_handshake.h 18KB
mavlink_msg_distance_sensor.h 18KB
mavlink_msg_scaled_imu3.h 18KB
mavlink_msg_scaled_imu2.h 18KB
mavlink_msg_attitude_target.h 17KB
mavlink_msg_optical_flow.h 17KB
mavlink_msg_scaled_imu.h 17KB
mavlink_msg_set_actuator_control_target.h 17KB
mavlink_msg_local_position_ned_system_global_offset.h 17KB
mavlink_msg_landing_target.h 17KB
mavlink_msg_wind_cov.h 17KB
mavlink_msg_gps_status.h 17KB
mavlink_msg_attitude_quaternion.h 17KB
mavlink_msg_raw_imu.h 17KB
mavlink_msg_global_vision_position_estimate.h 16KB
mavlink_msg_collision.h 16KB
mavlink_msg_attitude_quaternion_cov.h 16KB
mavlink_msg_manual_setpoint.h 16KB
mavlink_msg_logging_data_acked.h 16KB
mavlink_msg_terrain_report.h 16KB
mavlink_msg_resource_request.h 16KB
mavlink_msg_safety_allowed_area.h 15KB
mavlink_msg_vision_position_estimate.h 15KB
mavlink_msg_change_operator_control.h 15KB
mavlink_msg_vicon_position_estimate.h 15KB
mavlink_msg_file_transfer_protocol.h 15KB
mavlink_msg_vibration.h 15KB
mavlink_msg_logging_data.h 15KB
mavlink_msg_request_data_stream.h 15KB
mavlink_msg_radio_status.h 15KB
mavlink_msg_param_value.h 14KB
mavlink_msg_heartbeat.h 14KB
mavlink_msg_param_request_read.h 14KB
mavlink_msg_local_position_ned.h 14KB
mavlink_msg_actuator_control_target.h 14KB
mavlink_msg_param_set.h 14KB
mavlink_msg_attitude.h 14KB
mavlink_msg_serial_control.h 14KB
mavlink_msg_mission_request_partial_list.h 14KB
mavlink_msg_mission_write_partial_list.h 14KB
mavlink_msg_flight_information.h 14KB
共 405 条
- 1
- 2
- 3
- 4
- 5
资源评论
梦回阑珊
- 粉丝: 3539
- 资源: 1151
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功