- Disable or increase the Watchdog timeout in the HIL Initialize block.
- Increase the simulation step size to reduce CPU load (for example, try using a step size of 0.002 or 0.005).
- Remove any Stop Simulation blocks or logic that may be halting the simulation.
- Increase the target communication timeout in the QUARC Target Console.
Simulink + QUARC: Simulation Stops at T = 0.210s Despite Stop Time Being Set to inf
3 次查看(过去 30 天)
显示 更早的评论
Hi all,
I'm working with Simulink R2017 and QUARC 2.6.2082.0 to control a Quanser Coupled Tank System using the Q2-USB DAQ. The model runs in External Mode and includes the required HIL Initialize and HIL Write Analog blocks.
Setup:
- Target: Q2-USB via QUARC
- Stop Time: inf
- Solver: ode3, Fixed-step, step size 0.001
- Scope shows: T = 0.210s, then simulation ends
- Model Build: Successful
- HIL block settings: Analog Output in range [-10V, 10V]
- Diagnostic Viewer shows: "Simulation elapsed: 2 sec", but simulation stops at T = 0.210 on the scope
- No errors are shown in MATLAB or Diagnostic Viewer
What I've Tried:
- Set Stop Time to 1000 instead of inf
- Changed solver and step size
Problem:
Simulation starts correctly, the motor runs briefly, but it always stops at T = 0.210s, even though Stop Time is much larger. The model becomes disconnected from the target, and the Run button becomes grayed out.
Any help or suggestions would be really appreciated!
Thanks in advance!
0 个评论
回答(1 个)
Adit
2025-8-6
Hi Atharva,
Here are some possible workarounds you can try to resolve the issue of your simulation stopping prematurely:
These steps should help resolve the issue. For further information, refer to below links:
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Programmatic Model Editing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!