Borrar filtros
Borrar filtros

Two sensors with different step sizes - SIMULINK Arduino

1 visualización (últimos 30 días)
Dan
Dan el 27 de Nov. de 2020
Editada: pranav ranade el 20 de Oct. de 2021
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 comentarios
Nakul Khadilkar
Nakul Khadilkar el 3 de Dic. de 2020
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 el 3 de Dic. de 2020
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

Iniciar sesión para comentar.

Respuestas (1)

pranav ranade
pranav ranade el 20 de Oct. de 2021
Editada: pranav ranade el 20 de Oct. de 2021
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

Categorías

Más información sobre Modeling en Help Center y File Exchange.

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by