Changing sample time, Ts of the examples under Simulink support package for parrot minidrones
1 次查看(过去 30 天)
显示 更早的评论
Hello everyone,
I am trying to get the sensor values at a particular time for the Parrot Mambo Fly minidrone. Simulink model: Code generation template.
I want to change the sample time Ts = 0.005 sec to Ts = 5.00 sec. I tried providing sample time as 5 sec in the solver but then error occurs ![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/390478/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/390478/image.png)
According to what i understood from the flight log after the simulation is that counter(returns the sensor values like pressure, altitude, acc.) occurs every second with a frequency of 200Hz as Ts is set to 5ms.
But I want the counter to occur every 5 secs.
Would be great if someone could help me here.
thanks :)
0 个评论
回答(1 个)
Nitin Kapgate
2020-10-29
编辑:Nitin Kapgate
2020-10-29
You have changed the fixed-step solver’s step-size (system sample time) to be equal to 5 seconds, but the sample times for the blocks in the model are still 0.005 seconds, which is causing an error.
This error is caused because the sample times of different blocks must be integer multiples of fixed-step solver’s step-size. Otherwise, the simulator might miss key transitions in the state of the system.
You can resolve this error by changing the sample times (which currently are set to 0.005 seconds) for all the blocks in the model to 5 seconds or an integer multiple of 5 seconds.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Parrot Minidrones 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!