Control strategy model modeling specification (other)



In principle, modeling behaviors other than those specified in this specification should follow the rules recommended by the latest version of MAAB.

7.1. The selection principle of Simulink and Stateflow

Choosing to use simulink or stateflow to build a control algorithm model should be determined according to the attributes that the model needs to express, avoid using stateflow to describe mathematical expressions, and adopt the form of simulink. If the processing process mainly involves complex logical operations, or the model’s current operation is related to the result of the previous operation, Stateflow modeling should be used; if the main function of the model is mathematical operations, or the processing strategy mainly involves fixed flow formulas For digital processing, Simulink modeling should be used.
If the main program is logical operation, but a small part is mathematical operation, you can use the language in stateflow to write in stateflow.
If the main program is a mathematical operation, but some simple logic is needed to support the algorithm, you can use the basic logic operation module.
If you encounter more complex mathematical operations during the logical operation, you should use stateflow to perform the main logical operations, and then use the fuction-call module to call the simulink to complete the mathematical operations.

7.2. Model architecture

Frequency division scheduling of modules should be implemented according to module characteristics and requirements

7.3. Script file

The M file should contain complete comments, such as author, modification time, and version;
 
unused script code is not allowed;
variable declaration sequence:
Name = mpt.Signal Name should be prefixed with Sig to indicate that it is signal
Name = mpt.Parameter Name The prefix Param should be added to indicate that the parameter
Name = Simulink.Numeric Type Name should be prefixed with Numeric to indicate that it is a parameter

MATLAB 2013 and later versions should use the following method to declare variables:
Name = simulink.Signal
Name = simulink.Parameter
Name = Simulink.NumericType

Guess you like

Origin blog.csdn.net/lm393485/article/details/88895365