필터 지우기
필터 지우기

Using the block "Counter input" to measure the signal from a quadrature encoder

조회 수: 3 (최근 30일)
I am using the block "Counter input" from simulink desktop real-time to measure the signal from a quadrature encoder. From the encoder i get the signals A, B and Z. I want to use "Counter input" to count the signal. It works when i use the counter mode "bidirectional counter" but not when i use "quadrature encoder" which seems weird to me. Can someone explain how the block works and why the counter mode "bidirectional counter" works and not "quadrature encoder" which i thought was made exactly for this.

답변 (2개)

Jan Houska
Jan Houska 2023년 10월 17일
Hi Tobias,
instead of the Counter Input block, you should be using the Encoder Input block to read data from the counter in quadrature encoder mode.
Good Luck, Jan
  댓글 수: 1
Tobias Dehn Nielsen
Tobias Dehn Nielsen 2023년 10월 24일
Hi Jan,
Utilizing the Encoder Input block indeed resolves the issue in most cases. However, I've found that when I slowly rotate the encoder, the output from the Encoder Input block starts to shift. Even when I stop the rotation, the output from the Encoder Input block continues to increase. Can you help me understand why this is happening?
Best regards, Tobias

댓글을 달려면 로그인하십시오.


Jan Houska
Jan Houska 2023년 10월 25일
Hi Tobias,
this typically happens when there are spurious pulses present at the encoder input pins. The most common source of spurious pulses is incorrect ground connection, so as the first thing I'd check if everything is properly grounded. Please use the board vendor's documentation to learn how to correctly connect the encoder, including proper grounding.
Good Luck, Jan

카테고리

Help CenterFile Exchange에서 Get Started with Simulink Desktop Real-Time에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by