User`s manual
ROBOT . HEAD to TOE
Product User’s Manual – SD02B
Created by Cytron Technologies Sdn. Bhd. – All Rights Reserved
32
On/Off, Run/Brake, CW/CCW and Reset Encoder Value
Host sends 1 byte command to SD02B to On/Off, Run/Brake, CW/CCW and reset encoder
value.
Set Stepper Motor Speed
a. Host sends ‘S’ to SD02B to set stepper motor’s speed.
b. After sent the first command, host need to send 8 bit speed value to SD02B. The
speed value is from 1 to 255. If SD02B receives ‘0’, the speed is assumed as 1.
However, the speed for each stepper motor is different. It is depend on the resolution
(°/step) of stepper motor.
Accelerate stepper motor
a. Host needs to send a packet of data. Each packet consists of 4 bytes. The data need to
be sent 1 byte by 1 byte.
i. 1
st
byte: Send command ‘A’
ii. 2
nd
byte: Send initial speed
iii. 3
rd
byte: Send final speed
iv. 4
th
byte: Send acceleration rate
b. After sent ‘A’, host needs to send 1 byte of initial speed, followed by 1 byte of final
speed and 1 byte of acceleration rate.
c. All initial speed, final speed and acceleration rate range from 1 to 255. If SD02B
receive ‘0’, the speed is assumed as 1.
d. Initial speed and final speed received by SD02B will be compared to determine which
value is greater than the other one. If initial speed < final speed, SD02B will perform
acceleration and if initial speed > final speed, SD02B will perform deacceleration.
e. For acceleration rate, 1 is the slowest rate and 255 is the fastest rate. This means when
SD02B received 1 as acceleration rate, stepper motor will accelerate/deaccelerate very
slow and if 255 is received as the acceleration rate, stepper motor will
accelerate/deaccelerate very fast.