DAQ in Matlab with incremental encoder

HALLO;
How can one calculate the speed of an incremental encoder in Simulink?

답변 (1개)

Simon
Simon 2025년 8월 11일

0 개 추천

Hi Mahmoud,
You can calculate incremental encoder speed in Simulink using the pulse counting method as follows:
1. Encoder Pulse Input – Read channel A (or B) via Digital Input, this is your DAQ input.
2. Detect Rise Positive – Output a single pulse for each rising edge.
3. Counter – Count pulses between resets using a Discrete-Time Integrator or counter logic. 
4. Triggered Subsystem – Trigger every second to read and reset the counter. Read the current count and subtract it using a unit delay.
5. First Gain block – Convert to rad/s (Converts encoder counts difference to counts per second)
Value can be 1/(PRR*Interval), create the variables and values accordingly
PRR - Pulses per Revolution
Interval: This is the time between your measurements.
This gain converts the change in encoder counts per sample into a real-world rotational speed (rad/s)
6. To get RPM – multiply second gain block value as 60
7. Display/Scope – Show or log speed.
This method is simple and works well for medium–high speeds. For very low speeds, consider period measurement.
There’s some information available to refer:
Hope it helps!

카테고리

태그

질문:

2025년 8월 7일

답변:

2025년 8월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by