Simulink Scope - time problems on external mode
显示 更早的评论
Hello,
i created a simulink model to control a RC Car using the support package for arduino and it worked great. Now i wanted to implement a PID control to the model. To do it i connected arduino to simulink as 'External' and tuned the P, I and D parts untill it was working perfectly. The problem is, that when i uploaded the model to arduino (Deploy to Hardware) and tried to drive it without having it connected to the PC via an USB cable, it wouldnt work anymore as it was supposed to do. I guess it might be something with the 'sample time', because when i tuned it in external mode, 1 second on the scopes would take 6 seconds in real time... It is like i tuned it to a much slower speed than the actual one when testing it without the cable. Can anyone help me with it? How could i fix it or how should i tune it instead? I cant tune it without the cable because i need to read the signals in order to choose the best parameters.
- I have all sample times set to 1/100 (on the s function, on simulink config and on all analog/derivate blocks), which would be a good frequency for the reading of all signals.
Thanks in advance!
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Arduino Hardware 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!