DAQ in Matlab with incremental encoder
조회 수: 3 (최근 30일)
이전 댓글 표시
HALLO;
How can one calculate the speed of an incremental encoder in Simulink?
댓글 수: 0
답변 (1개)
Simon
2025년 8월 11일
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!
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Sources에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!