Omron trajexia CJ1W-MCH72 Operation Manual page 120

Sysmac cj-series programmable controller
Hide thumbs Also See for trajexia CJ1W-MCH72:
Table of Contents

Advertisement

All BASIC commands
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.
Section 4-2
109

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents