ROBOT . HEAD to TOE
Product User’s Manual –
SD02C
g. To get 16 bits encoder value, Exclusive-OR the two 16 bits variables and store it to a
16 bits variable.
Encoder value = 1101011000000000
2
XOR
0000000001110110
2
= 1101011001110110
2
= 54902 (16 bits encoder value)
Track encoder value
a. Host needs to send command 3 bytes of commands to SD02C to track encoder value.
When the steps counted are equal to the value sent by host, SD02C will brake the
stepper motor.
I. 1
st
byte: Send command ‘T’ to track encoder and brake motor
ii. 2
nd
byte: Send higher 8 bits encoder value
iii.3
rd
byte: Send lower 8 bits encoder value
b. 2
nd
byte and 3
rd
byte sent to SD02C are 16 bits encoder value for encoder tracking
(number of steps to go before SD02C brakes the stepper motor). For example, if user
wants stepper motor to brake when encoder value equals to 54902. Host needs to send
this value (1101011001110110
2
) to SD02C. Higher 8 bits is to be sent before the
lower 8 bits encoder value.
1 1
0 1 0 1 1 0 0 1 1 1 0 1 1 0
Created by Cytron Technologies Sdn. Bhd. – All Rights Reserved