![background image](http://html1.mh-extra.com/html/omron/r88a-mcw151-drt-e/r88a-mcw151-drt-e_operation-manual_742243266.webp)
251
Programming Examples
Appendix C
Example 5: Synchronising Cutter Movement
A flying shear cutter is required to synchronise with a continuously moving web and to cut a roll of paper every
5 m:
• The cutter (axis 0) can move a total of 600 mm. We use a maximum 500 mm of this travel.
• The blade is operated by a solenoid which is switched by digital output 8.
• The blade must be operated mid-way through the cutter motion.
• The cutter must synchronise to cut, and return to its start position all within not more than 80% of the
repeat cycle.
To ensure that speeds and positions of the cutter and paper match during the cut process, the arguments of
the MOVELINK command must be correct. It is normally easiest to consider the acceleration, constant speed
and deceleration phases separately and then combine them as required.
start:
UNITS AXIS(0) = 5000 ’Meters
UNITS AXIS(1) = 5000
loop:
BASE(0)
MOVELINK(0, 4, 0, 0, 1)
’Wait distance
MOVELINK(0.1, 0.2, 0.2, 0, 1)
’Accelerate
MOVELINK(0.3, 0.3, 0, 0, 1)
’Match speed
MOVELINK(0.1, 0.2, 0, 0.2, 1)
’Decelerate
MOVELINK(-0.5, 5, 3, 3, 1)
’Move back
GOTO loop
The middle MOVELINK commands can be done in one move using the following line.
MOVELINK(0.5, 0.7, 0.2, 0.2, 1)
Example 6: Generating Smooth High-speed Profiles
It is often desirable to generate a smooth profiled move for the maximum operational speed in high-speed
machines. An optimal profile for this is a sine squared:
y= mx - n(sin(x))
In this example we work in radians. The axis no. 1 is the master axis.
start:
GOSUB filltable
BASE(0)
loop:
CAMBOX(0,36,1,100,1)
WAIT IDLE
WA(1000)
GOTO loop
filltable:
num_p = 37
scale = 2000
FOR p=0 TO num_p
TABLE(p,((-SIN(PI*2*p/num_p)/(PI*2))+p/num_p)*scale)
NEXT p
RETURN
Example 7: Coordinating Two Moving Objects
Two conveyors run in parallel, conveyor A (axis 0) carries a product that must be transferred into boxes evenly
spaced on conveyor B (external encoder on axis 1). The transfer operation requires the products to be aligned
at the end of the conveyor.