Simple Step Command Set and Communications Protocol
Simple Step Command Set and Communications Protocol
Communications Protocol
Command Syntax:
Commands to the Simple Step driver and controller are single alpha
characters normally followed by a numeric value. The case sensitive alpha
character represents “what to do” and the numeric value represents “how much
to do it”.
Values for desired velocities, accelerations, positions, stepping
resolutions, and currents can all be set. You can also query the program what
position it is currently at and what velocity it currently possesses. Creating loops
within the strings are easily possible, and storing these strings for later execution
can also be done. These strings are stored on the EEPROM, enabling the
Simple Step to power up into a mode of your choice. This is how it can act with
no computer attached.
The commands are simply typed into a Terminal Program such as
“HyperTerminal”, no special software is required. The Simple Step can even be
commanded from a serial enabled PDA. Please refer to the Simple Step user
guide for setting up Hyperterminal on your PC.
Command Set:
1
Simple Step Command Set and
Communications Protocol
Command Operand Description
(Case
Sensitive)
P 0-max* Move Motor relative number of steps in positive
direction. A value of zero will cause an endless
forwards move at speed V. By doing so, it enters
into Velocity Mode. Any other finite number will set
the mode to be in Position Mode.
D 0-max* Move Motor relative number of steps in negative
direction (Note: Motor will not run in the negative
direction if the position is at 0. You can use the ‘z’
command to set the 0 position to be further away in
the negative direction. Then use this command.) A
value of zero will cause an endless backwards move
at speed V. This will enter Velocity Mode. Any other
finite number will set the mode to be in Position
Mode.
F 0, 1 Reverses the positive direction to be negative. The
P command will move the motor in the negative
direction, and the D command will move the motor in
the positive direction. Default is 0.
v 50-900 In Position Mode, this sets the Start Speed of the
Motor in half steps per second.
V 5-5800 In Position Mode, this sets the Top Speed of the
Motor in half steps per second.
V 5-2500 In Velocity Mode, you can change the Top Speed
“on the fly”. This is allowed when Top Speed < Start
Speed (pps).
c 50-900 In Position Mode, this sets the stop speed of the
motor in half steps per second.
L 1-20 In Position Mode, this sets the Acceleration factor (
acceleration = L*7500 steps/sec2)
N 0-1 Sets the micro step mode to on or off. Turning Micro
step mode on allows the motor to be positioned in
micro steps.
2
Simple Step Command Set and
Communications Protocol
Command Operand Description
(Case
Sensitive)
R Run the command string that is currently in the
execution buffer
X Repeat the current command string
g Beginning of a repeat loop
G 0-30000 End of a repeat loop. Loops can be nested up to 4
levels. A value of 0 causes the loop to be infinite.
T Terminate current command
M 0-30000 Delay for “M” milliseconds
H Halt current command string and wait until condition
specified.
Blank Wait for switch 2 closure
3
Simple Step Command Set and
Communications Protocol
s 0-15 Stores a program. Program 0 is executed on power
up (Total of 25 commands max per string)
e 0-15 Executes the Stored Programs 0-15
j 2, 4, 8, 16, Adjusts the resolution in micro-steps per step.
32, 64 Resolution depends on model.
o 0-250 Allows user to correct any unevenness in microstep
size
S 01 Skip next instruction if low on input 1 (Switch no. 1)
11 Skip next instruction if hi on input 1 (Switch no. 1)
02 Skip next instruction if low on input 2 (Switch no. 2)
12 Skip next instruction if hi on input 2 (Switch no. 2)
03 Skip next instruction if low on input 3 (Switch no. 3)
13 Skip next instruction if hi on input 3 (Switch no. 3)
04 Skip next instruction if low on input 4 (Switch no. 4)
14 Skip next instruction if hi on input 4 (Switch no. 4)
? 0 Simple Step returns the current motor position
? 1 Returns the current Start Velocity
? 2 Returns the current Slew Speed for Position mode
? 3 Returns the current Stop Speed
? 4 Returns the status of all four inputs, 0-15
representing a 4 bit binary pattern:
Bit 0 = Input 0
Bit 1 = Input 1
Bit 2 = Opto 0
Bit 3 = Opto 1
? 5 Returns the current Velocity mode speed
? 6 Returns the current step size
? 7 Returns the current ‘o’ value
& Returns the current Firmware revision and date
Q Query current status of the Simple Step:
0 = No Error
1 = Initialization error
2 = Bad Command
3 = Operand out of range
*109 (32 Bit)
4
Simple Step Command Set and
Communications Protocol
Communications Protocol:
The protocol is based on the Cavro serial communications protocol. The
Simple Step defaults to communicate in the DT protocol mode.
DT Protocol syntax:
The DT Protocol allows the unit to be commanded over a simple serial
port. HyperTerminal works well for this. The syntax for the DT protocol is as
follows:
Start Character Address Commands End of a string
/ 1-9* Command strings <CR>
5
Simple Step Command Set and
Communications Protocol
Example #1 (A Move to Absolute Position, delay, then a move to home)
/1A10000M500A0R
/ Start character
1 Device address
A10000 Motor turns to Absolute Position 10000
M500 Wait for 500 Milliseconds
A0 Motor will turn to Absolute Position 0
R Run the command that it has received
(Press Enter)
/1gA10000M500A0M500G10R
/ Start character
1 Device address
g The start of a repeat loop
A10000 Motor turns to Absolute Position 10000
M500 Wait for 500 Milliseconds
A0 Motor will turn to Absolute Position 0
M500 Wait for 500 Milliseconds
G10 End of the repeat loop, which will repeat for 10 times
R Run the command that it has received
(Press Enter)
6
Simple Step Command Set and
Communications Protocol
Example #3 (Program Storage and Results)
/1s2A10000M500A0M500G10R
/1e2R<CR>
This will execute the previously stored program #2. (Note: Program 0 is always
executed on power up. If we used 0 instead of 2 in this example, then this
program would execute automatically on power up.)
Example #4 (Set Current, Wait for Switch Push Button, Home to Opto)
/1s0J0m75h10H11ZJ3A5000A0R
7
Simple Step Command Set and
Communications Protocol
Example #5 (Skip / Branch Instruction)
/1s0gA0A100S13e1G0R
/1s1gA0A10S03e0G0R
Two “Subroutines” are stored in string0 and string1 and the code switches from
one subroutine to the other depending on the state of input3. In the example
given, the code will cycle the motor between position A0 and A100 if input3 is
High and between A0 and A10 if input3 is Low.
Stored string0:
/1s0 Store the following string as program 0 for driver #1
g Begin loop
A0 Move motor to the absolute position 0
A100 Move motor to the absolute position 100
S13 Skip next instruction if 1 (hi) on input 3
e1 Jump to string1
G0 Run this loop infinitely
R Run command
(Press Enter)
Stored string1:
8
Simple Step Command Set and
Communications Protocol
Example #6: (Open and Close a Valve with One Push Button)
/1s0j2gH12P100H12D100G0R
9
Simple Step Command Set and
Communications Protocol
Example #7: (Push Button to Run Motor, Opto Sensor stops the Motor)
/1s0gH11P10000H11Z10000G0R
10