Specifications
BASIC commands
PROGRAMMING MANUAL 45
Revision 5.0
3.2.45 CAMBOX
/i
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 controller 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 param-
eter 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.
Type Axis command
Syntax CAMBOX(start_point, end_point, table_multiplier, link_distance,
link_axis [ , link_option [ , link_position ]])
Description The CAMBOX command is used to generate movement of an axis following a
position profile in the TABLE variable array. The motion is linked to the meas-
ured motion of another axis to form a continuously variable software gearbox.
The TABLE values are absolute position relative to the starting point and are
specified in encoder edges.
The TABLE array is specified with the TABLE command. The movement can
be defined with any number of points from 3 to the maximum table size avail-
able (64000). Being able to specify the start point allows the TABLE array to
be used to hold more than one profile and/or other information. The TJ1-
MC__ moves continuously between the values in the TABLE to allow a
number of points to define a smooth profile. Two or more CAMBOX com-
mands can be executed simultaneously using the same or overlapping values
in the TABLE array.
The CAMBOX command requires the start element of the TABLE to have
value zero. Note also that CAMBOX command allows traversing the TABLE
backwards as well as forwards depending on the Master axis direction.
The link_option argument can be used to specify different options to start the
command and to specify a continuous CAM. For example, if the link_option
is set to 4 then the CAMBOX operates like a "physical" CAM.
CAMBOX works on the default basis axis (set with BASE) unless AXIS is
used to specify a temporary base axis.
Note: While CAMBOX is being executed, the ENDMOVE parameter will be
set to the end of the previous move. The REMAIN axis parameter will hold the
remainder of the distance on the link axis.