- Configure the solver settings in Simulink to use a fixed-step solver with a step size of 1/350 seconds (approximately 2.86 ms). This ensures that the simulation runs at a consistent rate.
- Use the “Rate Transition” block in Simulink to control the rate at which signals are passed between different parts of your model. Set the sample time of the Rate Transition block to match the desired update frequency of 350Hz: https://www.mathworks.com/help/simulink/slref/ratetransition.html
match hardware update frequency in simulation
2 次查看(过去 30 天)
显示 更早的评论
Hello,
I am trying to tune my Simulink controller for a system I built. My communication speed is about 350Hz using Serial communication to my off board controller. What I want to do is design a simulation that replicated my hardware, I have design all the dynmic models but I am having trouble replicating my communication speed. How can I make sure that my controller updates at 350Hz? I cannot find a good Simulink block that does this. I can add delays but that seems incorrect.
0 个评论
回答(1 个)
Chetan
2023-9-27
I understand that you are trying to tune a controller and trying to replicate the communication speed.
To ensure that your Simulink controller updates at a specific frequency, such as 350Hz, you can follow these steps:
By combining these techniques, you can control the timing and synchronization of your Simulink controller to match the desired update frequency of 350Hz.
I hope these suggestions help you resolve the issue you are facing.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Modeling 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!