HWML 4-Axis Stepper Motor Controller Code Demo

; --------- Initial Setup ---------

; Hardware Setup

~ 3,5,7,0 ; Step Pins
^ 2,4,6,0 ; Direction Pins
[ 0,0,0,0 ; Negative Limit Pins
] 0,0,0,0 ; Positive Limit Pins
{ 15,0,0,0 ; Input Pins
} 17,0,0,0 ; Output Pins

; I/O Setup

> 0,0,0,0 ; Outputs Off
c 1,0,0,0 ; First Input is Emergency Stop

; Movement Setup

_ 1000,1000,1000,0 ; Revolution Distance (micron) X, Y, Z, W
` 40,40,40,0 ; Count of Steps per Revolution X, Y, Z, W
& 100,100,100,100 ; Axis Rate Scaling Factor (%) X, Y, Z, W
p 0,0,0,0 ; Position X, Y, Z, W
v 400,100,600,1000 ; Rate: Feedrate, Start/Stop Speed, Max Speed, Acceleration
w 1,0,0,1 ; Mode: Linear Motion, XY Arc Plane, Exact Path Travel, Relative Distance
r 0 ; Queue (Contour) Empty

; --------- End of Initial Setup ---------


v 500 ; Set Feedrate to 500 steps/sec
w 1,,0,0 ; Set Mode: Linear Motion, , Exact Path Travel, Absolute Distance
q 0,500 ; Add S1 Segment to Queue
q 150,500 ; Add S2 Segment to Queue
w 2,0 ; Set Mode: CW Arc Motion, XY Arc Plane
q 150,300 ; Add S3 Segment to Queue
u 0,-100 ; Set Arc Center Offsets for S3 Segment
q 150,0 ; Add S4 Segment to Queue
u 0,-150 ; Set Arc Center Offsets for S4 Segment
w 1 ; Set Mode: Linear Motion
q 0,0 ; Add S5 Segment to Queue
e 1 ; Execute the Queue


(C) Aryeh Eiderman  < leib @ hwml . com >