Two sensors with different step sizes - SIMULINK Arduino
2 ビュー (過去 30 日間)
古いコメントを表示
Hello,
I want to use two different sensors with my arduino due. One of them is a LIDAR that just works good with a step size of 0.0001. The other one is a gyro-sensor that needs something about 0.03.
That's why I created an atomic subsystem for the gyro with a sample time of 0.03 and a global step size of 0.0001 for the whole simulation.
But now I remarked that the gyro doesn't work while the LIDAR is "active". As soon as I "turn on" the LIDAR, the gyro gives unrealistic values (see screenshot).![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/431078/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/431078/image.png)
The gyro sensor works with I2C and is connected to SDL and SCL, the LIDAR uses the RX1 and TX1 serial pins of my arduino.
Do you guys have any idea how to fix my problem?
I already thinked about creating an enabled subsystem for the LIDAR sensor that is disabled every time, when the gyro sensor sends some data. But I don't know if it would work and how to realize it...
Thanks.
2 件のコメント
Nakul Khadilkar
2020 年 12 月 3 日
Hello Dan,
Try to change the sample time of the LIDAR subsystem to <1ms. There might be task overruns happening on the hardware.
回答 (1 件)
pranav ranade
2021 年 10 月 20 日
編集済み: pranav ranade
2021 年 10 月 20 日
Hello, Have you checked with Model reference block instead of atomic subsystem ?.. you can use individual model reference block which will contain models for LIDAR and GYRO sensor so that you can define individual solver and other configuration setting for both the sensors
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!