Troubleshoot Unsatisfactory Real-Time Performance
I want some recommended methods to improve unsatisfactory real-time application performance.
What This Issue Means
Run-time performance and reduce the task execution time (TET) of a model depend on model design, target computer capacity, and target computer utilization.
Try This Workaround
You can improve run-time performance and reduce the task execution time (TET) of a model with these methods.
Enable Compile with GCC -ffast-math Option
The Compile with
GCC -ffast-math option enables the GCC compiler
-ffast-math option when compiling real-time application code.
This option is disabled by default for Simulink®
By enabling the Compile with GCC -ffast-math option, you provide the compiler with more flexibility to optimize floating-point math at the expense of deviating from the IEEE-754 floating-point standard.
Run Performance Tools
Use these performance tools:
For more information, see Execution Profiling for Real-Time Applications.
Use a Multicore Target Computer
You can improve run-time performance by configuring your model to take advantage of your multicore target computer:
Partition the model into subsystems according to the physical requirements of the system that you are modeling. Set the block sample rates within each subsystem to the slowest rate that meets the physical requirements of the system.
In the Configuration Parameters dialog box, on the Solver pane, select the check box for Treat each discrete rate as a separate task.
Click Configure Tasks, and then select the Enable explicit model partitioning for concurrent behavior check box.
Run the real-time application.
Do not use MATLAB System blocks in the top level of Simulink Real-Time models in which task execution is explicitly partitioned. These blocks generate a TLC error when building the real-time application, for example:
"Unable to find TLCBlockSID within the Block scope"
Minimize the Model
You can improve run-time performance by minimizing your model to make more memory and CPU cycles available for the real-time application:
On the Solver pane, increase Fixed-step size (fundamental sample time). Executing with a short sample time can overload the CPU.
Use polling mode. See Execution Modes.
Reduce the number of I/O channels in the model.
Contact Technical Support
For additional guidance, refer to these sources:
MathWorks® Tech Support: MathWorks Help Center website
MATLAB® Answers: www.mathworks.com/matlabcentral/answers/?term=Simulink+Real-Time
MATLAB Central: www.mathworks.com/matlabcentral
For Speedgoat hardware issues, contact Speedgoat Tech Support: www.speedgoat.com/knowledge-center.
- Execution Profiling for Real-Time Applications
- Partition Your Model Using Explicit Partitioning
- Execution Modes
- Find Simulink Real-Time Support
- Multicore Programming with Simulink