M a t h F u n c t i o n s
Another powerful feature of the MDrive Motion Control is its ability to perform common math functions and to use these to manipulate data.
Addition | K2†=P+R2 |
Subtraction | |
Multiplication | A=A*2 |
Division | A=A/2 |
|
M o t i o n C o m m a n d s
M A
Move to an absolute position relative to a defined zero position.
For example, type the following commands followed by hitting enter:
P=0
MA 20000
H
PR P
The terminal screen will read 20000
MA 3000
H
PR P
The screen will echo back 3000.
M R
Move number of steps indicated relative to current position.
For example, type the following commands followed by hitting enter:
P=0
MR 20000
H
PR P
The terminal screen will read 20000
MR 3000
H
PR P
Notice the position echoed is 23000 and not 3000.
S L
Move at a constant velocity.
SLEW 200000
The motor will move at a constant velocity 200000 steps per second.
H
An H (hold) should typically follow any MA or MR commands in a program so that program execution is suspended until motion is complete.
(Note: There are circumstances where you may not want to hold up program execution.) Below is a usage example.
PG 100 | ‘enter | program | mode at address 100 | |
LB | M1 | ‘label | program | M1 |
MR | 20000 | ‘set motion mode to relative, move relative 20000 steps |
H‘hold until motion completes
H‘hold until motion completes
E‘end program
PG | ‘exit program mode |
31