Installing, Connecting and Using the Encoder Mod-

 

 

 

 

 

 

 

 

5V Out

 

 

4.7kOhm

 

 

 

 

 

4.7kOhm

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1kOhm

 

 

 

 

Ch A In

 

 

 

 

 

 

 

 

 

5V

Ch A

 

Encoder

GND

Ch B

Ch B In

1kOhm

SW1

SW2

GND

Encoder Module

FIGURE 86. Signals seen by encoder using multi-levels and limit switches

Using this circuit, when the switch is open, a 0V (low-level) output from the encoder goes through a 1k and 4.7k voltage divider, thus creating a voltage that will never be below 0.8V at the encoder module’s input.

When the switch is activated, the module’s input is pulled to 0V.

It is recommended to use a voltmeter and/or oscilloscope to verify that the right voltage levels are created as the encoder rotates and the switches activated.

You may also use the Encoder setup/test function in the Roborun utility (see “Encoder Testing and Setting Using the PC Utility” on page 150). If the wiring is correct, the counters should increment/decrement as the motor rotate. The switch indicators should be always off unless the switches are actually activated.

Using the Encoder Module to Measure Distance

As the encoders rotate, their quadrature outputs is automatically processed and incre- ments/decrements two 32-bit counter inside the Encoder Module. There is one 32-bit counter for each of the encoders.

The counter values is stored as a signed binary number, ranging from -2,147,836,648 to +2,147,836,647 (Hexadecimal format of value 80000000 to 7FFFFFFF respectively. When the maximum or minimum counter value is reached, the counter automatically rolls back to zero.

The counters can be read and set using the commands described in “RS232 Encoder

Command Set” on page 142.

138

AX2500/2850 Motor Controller User’s Manual

Version 1.7. February 1, 2005

Page 138
Image 138
RoboteQ AX2550/2850 user manual Using the Encoder Module to Measure Distance