All BASIC commands
Section 4-2
109
profile_gen:
num_p=201
scale=1.0
FOR p=0 TO num_p-1
TABLE(p,((-SIN(PI*2*p/num_p)/(PI*2))+p/num_p)*scale)
NEXT p
RETURN
Example
A suction pick and place system must vary its speed depending on the
load carried. The mechanism has a load cell which inputs to the control-
ler on the analogue channel (
AIN
).
The move profile is fixed, but the time taken to complete this move must
be varied depending on the
AIN
. The
AIN
value varies from 100 to 800,
which must result in a move time of 1 to 8 seconds. If the speed is set to
10000 units per second and the required time is 1 to 8 seconds, then the
distance parameter must range from 10000 to 80000. (distance = speed
x time).
The return trip can be completed in 0.5 seconds and so the distance
value of 5000 is fixed for the return movement. The Multiplier is set to -1
to reverse the motion.
GOSUB profile_gen 'loads the cam profile into the table
SPEED=10000:ACCEL=SPEED*1000:DECEL=SPEED*1000
WHILE IN(2)=ON
OP(15,ON) 'turn on suction
load=AIN(0) 'capture load value
distance = 100*load 'calculate the distance parameter
CAM(0,200,50,distance) 'move 50mm forward in time calculated
WAIT IDLE
OP(15,OFF) 'turn off suction
WA(100)
CAM(0,200,-50,5000) 'move back to pick up position
WEND
profile_gen:
num_p=201
scale=400 'set scale so that multiplier is in mm
FOR p=0 TO num_p-1
TABLE(p,((-SIN(PI*2*p/num_p)/(PI*2))+p/num_p)*scale)
NEXT p
RETURN
See also
ACCEL
,
AXIS
,
CAMBOX
,
SPEED
,
TABLE
.
Содержание SYSMAC CJ Series
Страница 2: ......
Страница 70: ...Specifications Section 2 4 58...
Страница 84: ...FINS commands Section 3 4 72...
Страница 148: ...All BASIC commands Section 4 2 136 AXIS 1 AXIS 0...
Страница 277: ...Section 265 SECTION 5 Examples This chapter gives 2 categories of examples and tips How to s Practical examples...
Страница 370: ...Section 358...