UAV development model Matlab / Simulink-based (a serial)

"All objects can be controlled, needs to be mathematically quantified"

This is the author many years engaged in research and development come to the truth, regardless of vehicle control, robot control, aircraft control, or UAV control, and all associated mechanical motion control, if not well mathematical quantification, it will not be It is well controlled.

Because of work requirements, I have visited a lot of UAV research and development companies, universities and research institutes. UAV research and development company found that most research and development means, compared to other countries, is rudimentary. Basically embedded development mostly focused on driving the changes, flight logical changes. I think this is not really a strict UAV development. Because most companies do not give controlled object (UAVs), establish a complete mathematical model. Just use open-source framework, adjust the control parameters, there is no complete test procedures and test indicators. Such consistency is poor developed aircraft, each aircraft flight conditions are not uniform, can not meet the industrial application scenarios. 2018/2019 collapse of the UAV company, most of the existence of such circumstances.

Many of them had engaged in some Internet software development company, career change UAV development. In the field of motion control, and various Internet software development. Sometimes the Internet software development, no mathematical model of controlled object. Adhering to design patterns, software architecture design, collaborative programming, large-scale centralized test software, on-line. In unmanned systems development, software architecture design is essential, but in the test session, if there is no mathematical model, test out of the question, because most of the real test, the cost, efficiency and test the intensity of the far less than required. Because a BUG will cause the crash, but any new system, there is often a lot of BUG.

In mature industries, such as automotive, aircraft manufacturing, power electronics, aerospace and other fields we use a lot of model-based development tools based on Matlab Simulink.

We offer the following courses Amu laboratory system and packaging tools:

The course will comprehensively, and carefully explain how the method model (Simulink) design powerful set of flight control system. The course was designed by a number of front-line senior flight control engineer with many years of experience in the development of flight control based on the model, to provide the most advanced and cutting-edge flight control development experience.

Outline

Model-based development will save tedious coding steps, just drag a few modules like building blocks in general, easily build your own flight control algorithms. Flight Control developers can focus more on the algorithm itself, without too much attention to the details of the code implemented, this will greatly accelerate the development efficiency, reduce errors generated in the coding process. Meanwhile, the model-based development with a good code reusability. In other words, the function module has been designed, simply copy and paste, can be easily applied to any other place, eliminating the tedious process of porting the code.

Model-based development that is another strong advantage lies in "the first test, simulation many times," the purpose. Simulink powerful combination of open-loop and closed-loop simulation system, only a single acquisition data, you can now re-simulation of the actual real world performance. By modifying the model or algorithm parameters, online data emulation and debugging, greatly simplifies the difficulty of debugging.

System interface and bus design

Before we design control systems, enter the first thing to do is to define the system's I / O interfaces. In Simulink, the interface bus is generally defined manner. Bus structure may be understood as the C language, when the Simulink model automatically generates C code, the bus can see the final structure is to be achieved.

For the inner loop controller gesture, the input bus designed as follows:

Command_Bus

Element Type Unit Meaning
reset uint8 [0,1] 1 is reset controller
mode uint8 [0,1] 0: angle control, 1: angular velocity control
base_th int16 0~1000 Attitude basis throttle ring

Reference_Bus

Element Type Unit Meaning
phi_ref_rad single work Target roll
theta_ref_rad single work Target pitch
psi_ref_rad single work Target yaw
p_ref_radDs single rad/s Target roll angular velocity
q_ref_radDs single rad/s Target pitch angular velocity
r_ref_radDs single rad/s Target yaw angular velocity

States_Bus

Element Type Unit Meaning
phi_rad single work The current value of the roll
theta_rad single work The current value of the pitch
psi_rad single work yaw current value
p_radDs single rad/s The current value of the roll angular velocity
q_radDs single rad/s The current value of the pitch angular velocity
r_radDs single rad/s The current value of the yaw angular velocity

There are three bus input interface, namely Command_Bus , Reference_Bus and States_Bus . Command_Bus wherein the control bus is used to control the system settings such as mode settings, reset. Reference_Bus and States_Bus target signal bus, and status signal bus, can be understood as the controller and current value. Purpose of the controller is such that the current value to converge to a target value by controlling the extent possible.

The input interface design finished, followed by an output interface. Compared to a lot of input output interface is simple, nothing more than multiple pwm command output. Here we set aside six pwm output interface, which can support up to six axes of control, face to face, but also can be modified according to their needs.

Control_Out_Bus

Element Type Unit Meaning
pwm1 uin16 1000~2000 Motor 1 pwm signal
pwm2 uin16 1000~2000 Motor 2 pwm signal
pwm3 uin16 1000~2000 Motor 3 pwm signal
pwm4 uin16 1000~2000 Motor 4 pwm signal
pwm5 uin16 1000~2000 Motor 5 pwm signal
pwm6 uin16 1000~2000 Motor 6 pwm signal

Well, now interfaces are defined, then the next question is how to implement these interfaces are defined in Simulink inside.

In fact, to achieve these interfaces are defined in Simulink is very simple. Simulink Bus Editor provides a tool that requires only a simple configuration can define any interface or bus you need.

The following step by step method to explain the definition of the bus:

  • First, open the control model, click on Edit-> Bus Editor bus_editor_1

  • I've been here before-configured, so I can see already defined bus. But if it is their first time to design, then there should be empty. You can click on the add bus as shown in the red circle to add Bus signals, here we need to add a total of 4 Bus. A three input bus and output bus. After Bus add well in the rightmost Property, change the name of Bus. After adding a good Bus, we need to add the following to the Bus Element inside that element bus. First, select a Bus, click the blue circle circles add element out of options, you can add elements.bus_editor_2

  • 
    
  • Element then need to be configured. As shown, we generally only need to Name, Data Type and Dimension three options can be configured. Dimension to dimension the variable, if we need to configure the element as a vector or matrix, you need to configure Dimension.bus_editor_3

  • After configuration, you need to click on File-> Export to File to save the Bus is configured to be alive .mat .m file. Because the definition of Bus are stored in the workspace. When you next open matlab when the work space is cleared of all, we need to save our Bus defined as a file, so that when the next time you open the matlab, you can just load at our .mat / .m file, we will be able to Bus defined before you can load into the workspace.

No micro-channel public concern "Amu laboratory" for more information UAV development evaluation, concerned about "Amu community" for more information on learning courses.
Community Forum Address: bbs.amovauto.com participate in the discussion.

Guess you like

Origin www.cnblogs.com/amovlab/p/11692723.html