Simulink Encoder Block outputting pulses only?

조회 수: 17 (최근 30일)
John
John 2014년 8월 15일
댓글: Jan Houska 2014년 8월 22일
The Simulink "Encoder Input" block (Real-Time Windows Target toolbox) seems to output pulses only when the encoder is turned. It should be keeping track of full position and outputting accumulated ticks. How can the block be configured to output accumulated quadrature ticks?
I'm using an NI PXI-6221 DAQ card, with the appropriate wiring. I'm using counter0, which is encoder input 1.

채택된 답변

Jan Houska
Jan Houska 2014년 8월 20일
Your expectations about the output signal of the Encoder Input block are correct. It is indeed supposed to output accumulated quadrature ticks. There is no configuration necessary, this is the only mode the block works in.
If you experience a different behavior, I would recommend to double-check the wiring. Namely, please make sure that the reset (index) pin of the data acquisition board is either properly connected to the encoder, or to a fixed logical signal that will disable its functionality (high or low). If this pin is left unconnected, it may be sensitive to crosstalk or noise and may reset the encoder at random times.

추가 답변 (1개)

John
John 2014년 8월 20일
편집: John 2014년 8월 20일
Thanks for the reply and thoughts. In "Board Setup" there are two counters to configure: Counter 0 Mode and Counter 1 Mode. I have them both set to "Quadrature". But, in the Encoder Block itself, the Input Channel is set to 1: I have everything wired to Counter 1. The only options there are 1 and 2.
This DAQ has only two counters. Why does the test board show up as 0 and 1, and the Input Channel options only 1 and 2? Or are they referring to different things?
EDIT: the wiring is correct, and I've tied Index to GND.
  댓글 수: 1
Jan Houska
Jan Houska 2014년 8월 22일
Input channels (and vector elements) in Simulink are always numbered starting from one. On the other hand, vendors often number the hardware channels starting from zero. Channel 1 is the first one, even if named Counter 0 by the manuacturer.

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

카테고리

Help CenterFile Exchange에서 Target Computer Setup에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by