フィルターのクリア

Two sensors with different step sizes - SIMULINK Arduino

1 回表示 (過去 30 日間)
Dan
Dan 2020 年 11 月 27 日
編集済み: pranav ranade 2021 年 10 月 20 日
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).
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
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.
Dan
Dan 2020 年 12 月 3 日
Thanks for your answer.
But the whole simulation works with a fundamental sample time of 0.0001s (so it's <1ms). The LIDAR subsystem is just a normal subsystem and should work with this fixed step size. If I change the fundamental step size to 1ms, the LIDAR doesn't work like it should... So the 0.0001s are needed

サインインしてコメントする。

回答 (1 件)

pranav ranade
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

カテゴリ

Help Center および File ExchangeModeling についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by