Two sensors with different step sizes - SIMULINK Arduino

조회 수: 6 (최근 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 CenterFile Exchange에서 Modeling에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by