Koyo Incremental Rotary Encoder
Posted 15 December 2012 - 04:11 PM
Posted 16 December 2012 - 08:13 PM
Sounds like you have the "RZ" output option (TTL output)?
Looks like you can just power it with 5 volts, so I would connect as follows with no resistors:
A => FIO4
B => FIO5
Common => GND
Vcc => VS
Then go into the test panel in LJControlPanel. Put in the settings you listed, except that you don't need a Counter so can leave them disabled. Now on the test panel you should see counts on Timer0/1 as you turn the encoder.
Posted 18 December 2012 - 05:41 PM
Posted 20 December 2012 - 08:36 AM
Posted 24 December 2012 - 11:24 AM
Are you seeing the rollover at 65535 (2^16) in the test panel in LJControlPanel, or just in LJStreamUD? Confirm that in LJControlPanel it can count to much higher numbers. In stream mode, note that channel 200 just reads the lower 16 bits of the timer Value, and channel 224 reads the upper 16 bits of timer Value. To get the full 32 bits you need to take Ch200 + 2^16*Ch224.
A timer has a Value associated with it. When you configure the timer you write the Value and that generally has meaning about the configuration. Later if it is an input timer mode you read the Value whenever you want to know the timer reading.
Section 188.8.131.52 says that to enable Z-phase you need to set bit 15 of the configuration timer Value and set bits 0-4 to signify the DIO number. A decimal 6 is 110 in binary, so that means Value = b1000000000000110 which is 32774 in decimal.
The test panel in LJControlPanel does not let you write the Value when you configure the quadrature mode timers, so you can't try it there. The config defaults section of LJControlPanel also does not let you specify Value for quadrature, and that is what you need to use LJStreamUD. I will ask someone else about changing LJControlPanel to allow specifying Value for any applicable timer modes.
I'm only seeing the rollover in LJStreamUD and the counter works as expected. It is not so much the rollove at the top end that is troublesome, it is that the counter goes up to 65535 when the encoder is rotated CW to the point that you would expect the counter to turn negative, as it does in LJControPanel. However, I think I can overcome this obstacle by manipulating data in a spreadsheet.
For Z-Phase, I was also able to manipulate data in a spreadsheet to get the desired result, but it would be nice if I could get LJStreamUD to handle it for me. I under stand what you are saying above, except for the "b". However, I don't know how to set the timer configuration value. Can you explain how to do this?
Posted 26 December 2012 - 12:47 PM
Are you doing a read of channel 200 followed by 224 and then calculating Ch200 + 2^16*Ch224? If you are just looking at the value of channel 200 you are just getting the lower 16-bits of the signed 32-bit timer.
It is not so much the rollove at the top end that is troublesome, it is that the counter goes up to 65535 when the encoder is rotated CW to the point that you would expect the counter to turn negative ...
It is just a nomenclature used to specify that a number is binary. For example:
I under stand what you are saying above, except for the "b".
b1111111 = d255 = hFF
What I was trying to say is that neither LJControlPanel nor LJStreamUD let you specify the configuration Value for a quadrature Timer, so we are looking at whether we can change LJCP for you to have that ability in "config defaults" and "test".
However, I don't know how to set the timer configuration value. Can you explain how to do this?
Posted 27 December 2012 - 05:18 PM
Let us know if you find any problems with the update.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users