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

조회 수: 6 (최근 30일)
Jorge Polo
Jorge Polo 2020년 9월 9일
답변: MULI 2024년 9월 23일
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:

답변 (1개)

MULI
MULI 2024년 9월 23일
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.

카테고리

Help CenterFile Exchange에서 Raspberry Pi Hardware에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by