Why does my Speedgoat simulation experience CPU overloads and stop with an "Overload limit exceeded" error when using Simulink Real-Time (SLRT)?

51 ビュー (過去 30 日間)
I have a Simulink model I want to deploy on a Speedgoat target machine using Simlink Real-Time (SLRT). The model runs fine in Simulink, but when I select "Run on Target" the real-time simulation appears to fail, and a CPU overload error is shown in Simulink:
Executing the 'DisconnectConfirmed'command produced the following error: Application 'myModel' received an error running on target computer 'TargetPC1': Overload limit (0) exceeded in 0.001s (tid=0) rate with 1 overloads
On the Speedgoat target screen, I see the error "State: TARGET ERROR -> modelName (MODEL ERROR)", as shown in the screenshot below:
Why is this happening, and how can I avoid this?

採用された回答

MathWorks Support Team
MathWorks Support Team 2025 年 9 月 3 日 0:00
編集済み: MathWorks Support Team 2025 年 9 月 3 日 7:54
When the target computer is unable to finish all the required calculations for a time step before the next time step started, a CPU overload occurs. If you see the message "Overload limit (x) exceeded," this indicates that the number of missed deadlines has surpassed the maximum allowed by your model's configuration. If your model contains no SLRT Overload Options block, then no overloads are allowed. See the following documentation for details:
To resolve this issue, consider one of the following solutions:
1. Try to Compile with GCC -ffast-math
Turn on Compile with GCC -ffast-math. The code will run faster, but this could come at the cost of accuracy. The documentation page explains more about that. I’d recommend verifying your results if you use this option.
2. Allow overloads during initialization or for debugging
Add an 'SLRT Overload Options' block to your model to allow a small number of overloads to occur via the 'Max Overloads' parameter. This is good for uses where the given application needs a longer initialization time, and is tolerant and won't lose a significant amount of data. However, allowing overloads can cause incorrect results. See SLRT Overload Options.
3. Use Execution Profiling to identify bottlenecks
Temporarily increase the 'Max Overloads' value (e.g., to 10,000) and use Execution Profiling to find which parts of your model are causing delays. See Execution Profiling for Real-Time Applications.
4. Concurrent execution with Explicit Partitioning
Apply Explicit Partitioning to enable different parts of your model to run in parallel, reducing CPU load and improving real-time performance. See Concurrent Execution on Simulink Real-Time.
5. Remove incompatible blocks
Make sure your model does not contain incompatible blocks that aren't recommended for production code generation, such as To File blocks.
6. Overloads when loading parameter sets
If the overloads occur when loading a parameter set with loadParamSet(), see the following MATLAB answer: How can I avoid CPU overloads when using "loadParamSet"?
7. Increase model step size
Increase the model step size until the model is able to simulate on the target machine. Note that different Speedgoat machines have different CPUs, so a step size that works on one target machine might not always be able to run on another one. If you have multiple rates in your model, consider increasing the step size for each rate. Use the Timing Legend to visualize the rates in your model.
8. Turn off execution time measurement when not profiling
Finally, if you are no longer profiling the real-time execution of your model, configure 'Measure function execution times' to be 'Off' under Code Generation > Verification in the model configuration parameters. This reduces overhead and improves performance.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with Simulink Real-Time についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by