Borrar filtros
Borrar filtros

How to get accurate RPM using a Raspberry pi board with Simulink?

11 visualizaciones (últimos 30 días)
Jorge Polo
Jorge Polo el 9 de Sept. de 2020
Respondida: MULI el 23 de Sept. de 2024 a las 4:50
I'm using a Raspberry pi 2 model B with three photo interrupter sensors (https://www.waveshare.com/photo-interrupter-sensor.htm) to get the RPM of three different BLDC motors. I want to use Simulink as control interface. To get the RPM of each motor, I made a basic matlab function, that computes the motor speed when a sensor detects an obstacle (the obstacle is in fact a disk encoder with 20 holes). However, when I run the model and take some measures, the reading is not accurate at all. It does'nt measure the motor's real speed and the simulation is limited on speed (500RPM max). I guess is a problem with timing, but I don't have much experience dealing with timing in Simulink. Any tips or advice would be really appreciate. Thanks!
Below is the block diagram in Simulink:

Respuestas (1)

MULI
MULI el 23 de Sept. de 2024 a las 4:50
Hi Jorge,
I understand you are facing an issue with timing for the RPM measurement in Simulink. To improve accuracy and handle timing problems, consider the following suggestions:
Reduce Sample Time:
  • Simulink uses discrete time steps, so if the sample time is too large, it may miss fast sensor changes.
  • Reduce the step size in your Simulink model to capture state changes more accurately.
Debouncing:
Accumulate State Changes:
  • Instead of calculating RPM after every single state change, try accumulating several state changes and then average the time. This will make the RPM readings more stable.
Implementing these changes can improve the accuracy and reliability of your RPM measurements in Simulink.

Categorías

Más información sobre Raspberry Pi Hardware en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by