RoboteQ AX2550/2850 ユーザーズマニュアル

ページ / 180
Installing, Connecting and Using the Encoder Mod-
140
AX2500/2850 Motor Controller User’s Manual
 Version 1.7. February 1, 2005
Using the Encoder to Track Position
The encoder module can be used to report the distance between the actual motor position 
and a desired destination. The resulting measured “distance” can then be used by the con-
troller in the position mode to move the motor in the right direction until the destination is 
reached. This movement is controlled by the PID position algorithm inside the controller 
and is therefore best suited at tracking position.
Since the controller uses a signed 8-bit value (-127 to +127) for the distance measurement 
in the Position Mode, a special algorithm is used to convert the real distance which can be 
much higher than -127 to +127 as both the counter and destination registers are 32-bit 
wide. 
The actual formula is as follows:
            Distance = (Destination - Counter value) / Divider
Where: divider is a configurable parameter of value 1, 2, 4, 8, 16, 32, 64 or 127
If computed distance is less than -127, then reported distance is -127
If computed distance is larger than +127, then reported distance is +127
Important Notice
Destination= 50,050
distance at 
divider
   50   
   1
   25   
   2
   12   
   4
   6 
 
   8
   3 
 
   16
   1 
 
   32
   0 
 
   64
   0 
 
   128
Counter= 50,000
FIGURE 87. Small distance computation example
Destination= 50,000
distance at 
divider
   127   
   1
   127   
   2
   127   
   4
   127   
   8
   127   
   16
   127   
   32
   78   
   64
   39   
   128
Counter= 45,000
FIGURE 88. Large distance computation example