Solve overrun issue due to buffer larg size in dSPACE real-time simulation.

18 views (last 30 days)
How can I increase the buffer capacity in my simulink model for real-time implementation on dSPACE, considering I am using an RNN deep learning block fed by 2000 samples? I have already tried using a buffer with a size of 2000, but I encountered an overrun error when I generated the C code, downloaded it on PCI, and ran it on dSPACE using Control Desk. Surprisingly, a smaller buffer size like 150 works fine. Are there any limitations or suggestions for increasing the buffer capacity? Should I consider using a different block, introducing a subsystem, or adding additional blocks to address this issue?

Answers (1)

Prateekshya
Prateekshya on 18 Aug 2023
As per my understanding, you are facing “overrun error”. Since you have mentioned about a few options, I would assume that you are going to try all of those, and I would suggest the other possible workarounds for this. You have mentioned about the following workarounds:
  • Checking the limitation of buffer capacity
  • Consider using a different block
  • Using a subsystem
  • Adding additional blocks
While trying to increase the buffer capacity in your Simulink model for real-time implementation on “dSPACE”, the following are the other possible workarounds:
  • Try increasing the buffer size gradually: Instead of directly increasing the buffer size to 2000, try incrementing it gradually and testing each increment. This approach can help identify the maximum buffer size that works without causing overrun errors. If a buffer size of 150 works fine, you can try increasing it incrementally from there.
  • Optimize your model: Review your model for any unnecessary computations or delays that might be causing the overrun errors. Simplify or optimize your model to reduce its computational load and improve real-time performance.
  • Check the parameters: The parameters could be changed and tested. For example, a very small “sample time” may lead to overrun errors. Hence try checking those.
Please note that the optimal buffer size and approach may vary depending on your specific model, hardware, and real-time implementation requirements.

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!