Examples and tips
PROGRAMMING MANUAL
327
R
e
vi
si
o
n
1
.0
FE_LIMIT=1073741824/P_GAIN/UNITS
'SPEED is set to 1/3 of "max_speed
SPEED=(max_speed73)*enc_resolution/60/UNITS
'ACCEL in 200ms from 0 to "max_speed"
ACCEL=SPEED/0.2
'DECEL in 200ms from "max_speed" to 0
DECEL=SPEED/0.2
5.2.3
Single axis program
fig. 48
This program is a simple program to run one axis only.
Example
'GOSUB homing
BASE(0)
DEFPOS(0)
WA(100)
loop:
MOVE(1440)
WAIT IDLE
WA(100)
GOTO loop
The units are degrees in this example, therefore:
•
13-bit encoder
•
Pn202=32
•
Pn203=45
•
UNITS=32
The graph in the figure is typical for this point-to-point movement with linear
acceleration). Note the following:
•
During linear acceleration, the graph of the position is parabolic
(because the speed is a derivative of the position).
•
During constant speed, the graph of the position is straight.
•
During linear deceleration, the graph of the position is counter-parabolic.
•
During stop, the graph of the position is constant.
•
When an overflow occurs (
MPOS>=REP_DIST
), the position jumps to 0
if
REP_OPTION=1
or to
-REP_DIST
if
REP_OPTION=0
.