FMT ICF5 real-time simulation, not limited to flight control

Real-time simulation based on ICF5

As FMT's first self-developed domestic open-source flight control hardware platform, ICF5 not only has powerful functions, but also has high appearance and high cost performance, which has won unanimous praise from users.

FMT ICF5 flight controller

ICF5 purchase link item.taobao.com/item.htm?id=705459383848&ali_refid=a3_430620_1006:1123834906:N:O3mcoUggvOmuxWcZ5TrtiQ%3D%3D:69fa2cb78214f2a9eeb73ab7c59bb9ba& ali_trackid=162_69fa2cb78214f2a9eeb73ab7c59bb9ba&spm=a21n57.1.0.0#detail

However, the function of ICF5 is not limited to a flight control platform. ICF5 can also be used as a real-time simulation target machine to provide a real-time simulation interface, which can run the physical model of the drone or other controlled objects and carry out hardware-in-loop (hardware-in-loop). , HIL) or pure hardware (Simulator-in-hardware, SIH) real-time simulation. Compared with real-time simulators that cost tens of thousands or hundreds of thousands, ICF5 can be described as "really fragrant".

ICF5 supports Model-based design (MBD), and Simulink can be used to build a model of the controlled system. At present, ICF5 has built-in controlled object models of various drones, and other controlled object models can be easily built based on FMT.

Multi-rotor controlled object model MC-Plant​github.com/Firmament-Autopilot/FMT-Model/tree/master/model/Plant/MC-Plant

Fixed-wing controlled object model FW-Plant​github.com/Firmament-Autopilot/FMT-Model/tree/master/model/Plant/FW-Plant

MC-Plan

The model can directly generate C/C++ code and burn it into ICF5 to run in real time.

code generation

The running data can be recorded by ICF5 and imported into Matlab for viewing.

data analysis

hardware-in-the-loop simulation

Hardware-in-the-loop simulation, also known as hardware-in-the-loop simulation, is a real-time simulation technology that combines real hardware with computer simulation technology to test and verify the performance of embedded systems. In HIL simulation, an embedded system is connected to an emulator or simulator and interacts with a real physical device to simulate the operation and feedback in the actual environment. Through HIL simulation, the performance and reliability of embedded systems, as well as their interaction with the surrounding environment, can be evaluated more comprehensively and accurately.

ICF5 can be used as a simulator to run the controlled system model, and also provides a wealth of hardware interfaces, such as serial port, SPI, IIC, USB, network port, CAN, etc., for data exchange with external controllers and simulation computers.

HIL simulation

pure hardware emulation

Pure hardware simulation is similar to hardware-in-the-loop simulation, which is a hardware-based simulation technology. The main difference between them is that the model of the controlled system and the controller are combined into one during pure hardware simulation, that is, the Plant and the Controller are run simultaneously on one piece of hardware. Its advantage is that it can simplify the hardware structure and cost, and also eliminate the signal delay and bandwidth problems caused by intermediate communication.

SIH simulation

Simulation steps

Taking pure hardware simulation as an example, the following introduces the basic steps of using ICF5 for real-time simulation:

1. Obtain the latest code of FMT-Firmware. It can be pulled from the following Github address.

FMT-Firmware​github.com/Firmament-Autopilot/FMT-Firmware

2. The macro opened in fmtconfig.hFMT_USING_SIH is to enable the SIH simulation function.

3. Enter to scons -j4compile the multi-rotor firmware (default). Use if you want to compile firmware for fixed wings scons -j4 --vehicle=Fixwing.

4. Download the firmware to the ICF5 flight controller. After the flight control is running, you can see that the Plant model has been loaded in the console output.

5. Connect the remote control to the flight controller (you can also choose not to use the remote control), and connect to the ground station at the same time. Simulation testing can then be performed as if operating a real aircraft. For example, use the remote control to control the flight, or use the ground station to draw waypoints, etc.

Simulation demonstration case

Some actual simulation cases are shown below.

Simulation of multi-rotor 8 SIH based on ICF5

Simulation of fixed-wing SIH based on ICF5

ICF5 User Stories

Guess you like

Origin blog.csdn.net/msq19895070/article/details/130772499