A microcomputer-controlled X-Y translator for CNC laser applications

A microcomputer-controlled X-Y translator for CNC laser applications

A microcomputer-controlled translator for CNC laser applications X-Y K.C.A. CRANE, T.J.C. HOSEA, C.H. LAM and A. BENDELI An inexpensive X-Y translat...

762KB Sizes 0 Downloads 24 Views

A microcomputer-controlled translator for CNC laser applications

X-Y

K.C.A. CRANE, T.J.C. HOSEA, C.H. LAM and A. BENDELI An inexpensive X-Y translator is described that is designed for industrial and laboratory laser applications such as cutting and heat treatment requiring computer numerical control. The system includes standard stepper motors, lead screws and carriages, but is unusual in that although versatile it requires only an inexpensive Apple II microcomputer for control and for creation of data files. The selected translation speed is maintained constant regardless of direction. Speeds up to about 3000 steps s-1 are obtained. A single file of pattern information contains up to 400 segments, which may be straight lines or circular arcs. KEYWORDS: lasers, translators,

computer

numerical

Introduction An X-Y translator is perhaps the most common type of computer numerical control (CNC) equipment that accompanies a high power laser in industrial or laboratory environments. This type of translator has two carriages which move simultaneously in two orthogonal dimensions, thereby enabling the laser beam to describe complicated two-dimensional patterns on sheet materials. Either the workpiece or optical elements may be translated. Common applications include laser cutting of metals or plastics and laser heat treatment of metals and semiconductors’. Specialized control characteristics for the translator are usually necessary when it is used with a laser. For example, CNC laser cutting requires faster and more accurate control than CNC oxy-torch cutting. Laser cutting produces much narrower heat-affected zones and is more appropriate for fast accurate cutting of complex shapes in thin materials. Typically, accumulated spatial errors of less than 0.3 mm in path lengths of 1 m are required in laser cutting. In addition, to achieve fast (and therefore economical) cuts of uniform width, the selected speed of the beam relative to the workpiece must be fairly constant regardless of changes in direction. Laser heat-treatment applications often require similar control characteristics’. Consequently, except for some units of very limited versatility, CNC translators for laser systems are expensive’. Little technical data exist that enable prospective users to construct their own systems or to understand many of the physical considerations involved in their design. This paper attempts to alleviate these problems. Fundamental design details are presented for a CNC X-Y translating system of considerable sophistication The authors are at the CSIRO Division of Applied Physics, Lindfield. Sydney 2070. Australia. Received 7 September 1983

003D-3992/84/020087-06/$03.00 OPTICS AND LASER TECHNOLOGY.

APRIL 1984.

control

developed by the authors for industrial and laboratory laser applications. This system consists essentially of carriages which move on two lead screws rotated by stepper motors that are controlled by an Apple II microcomputer. The processing speed and storage capacity of this microcomputer are less than those in the more expensive minicomputers usually associated with CNC translators, and some design details in the present system are strongly influenced by these limitations. Novel aspects of the system relate to control concepts in the software and to some details of the interface between the computer and the drive units for the motors. Besides high spatial accuracy, high translation speed, and the ability to maintain a constant speed, other system features given high priority are low cost, versatility, reliability and ready availability of parts. Many software features of convenience to the user exist in the system, but these are not described in detail because they are not fundamental to the system design.

Hardware

arrangement

Figure 1 shows the system hardware arrangement. Its general features are quite conventional. Data for desired patterns may be entered via either the Apple keyboard or an Apple graphics tablet (a type of digitizer). Files are created for each pattern and stored on mini-floppy discs prior to their execution by the Apple. An interface/timing card (see next section) outputs trigger pulses at appropriate times to the drivers for the two stepper motors. Two trigger channels per driver are required for bidirectional control. A fifth channel controls the laser shutter which is either open or closed. Many suitable drivers are available commercially. The type chosen has circuitry enabling manual operation. A console (not shown) houses switches for manual control of the translator and some laser operations. Various stepper motors, lead screws and carriage types may be used3, as 0 1984

Butterworth Et Co (Publishers) Ltd 87

I

Apple II computer

this clock requires minimal time. This feature is significant in helping to achieve high translation speeds.

I

4

To laser shutter

The clock increments with a period s, of 2 /.LSand counts for 33.6 s (224 X 2 ps) before it rolls over to zero and recommences. The present choices of clock period z, and number of registers are compromise values. Accuracy of the translator decreases with increases in z, because z, is the minimum period resolvable by the system. On the other hand, roll-over time increases with r,, thereby increasing the maximum interval between restarts of timing parameters. The roll-over time may also be increased by adding registers to the clock but then the time required to read the clock increases, thus reducing the maximum translator speed.

Control

concepts

Segments:

Fig. 1 Schematic diagram of translator system (moving-workpiece configuration shown)

determined by the application. The choices of motor step increment and pitch on the lead screws are compromises between spatial accuracy and maximum translation speed. Typically, the motor step increment is rr/lOO rad (1.8”) and the pitch is 4 mm, thereby providing a step distance on each axis of 0.02 mm. Although Fig. 1 shows a moving-workpiece configuration, one or both carriages may instead move optical elements to control the laser beam, in which case the rest of the system is unchanged. An alternative to using stepper motors is to use linear or synchronous motors with encoders. Although stepper motors have more complex electrical drivers and must be prevented from skipping steps or jamming at high speeds or high accelerations, they require simpler software and interfacing than alternative motors, and they do not require gears, clutches or brakes.

I Address

bus (16 bit)

Resettable clock counters

card

Figure 2 is a block diagram of the interface/timing card. An addressable latch-driver provides the output pulses. The remaining circuitry is a resettable clock that enables the software to control the pulse timing. The clock is driven from the Apple main clock and is connected to the data bus via three eight-bit registers. A decoder commands these registers to be latched without stopping the clock and allows their contents to be read by enabling them individually. Thus, reading

88

general description

Software files containing trigger pulse information for a desired pattern, hereinafter called ‘pulse files’, are first created by special programs and then used by a real-time program that causes output pulses to be produced. A pattern is entered as a series of segments, which may be of +arious lengths. The real-time program resets the system clock at the beginning of each segment. Segments may be either straight lines or arcs of circles. Non-circular curves are approximated by series of segments of these two types. Two segments with the laser shutter closed are automatically inserted at the beginning of all pulse files if the desired translation speed for either axis exceeds a set base speed (typically 200 steps s-l) above which motor jamming may occur at start-up. One of these is a ramp-up segment, and it is always immediately preceded by the other, a preramping segment. The ramp-up segment starts at base speed and ends at the specified pattern starting point (the origin) with a velocity vector matching that required at the origin. The preramping segment is at base speed and compensates for ramp-up movement, thereby preserving the specified position of the origin on the workpiece.

Using the scheme shown in Fig. 1, many different approaches to the software and interfacing are possible. The approach taken here attempts to maximize the system’s versatility, yet requires only simple interface hardware. Thus, for example, auxiliary central processing units in the form of commercially available stepper-motor controllers are not used. In addition, any internal oscillator and ramping/deramping logic in the motor drivers are only used for manual operation.

Interface/timing

and system performance

xa

xa Data bus (6 bit

Fig. 2

xa )

Schematic diagram of the interface/timing

card

OPTICS AND LASER TECHNOLOGY.

APRIL 1984.

Similar segments for ramping down at the ends of files to prevent overshoot have been found to be unnecessary. Some simple methods for calculating pulse timing are inappropriate in the present system. For example, perhaps the easiest way for straight lines is to determine the required ratio for each line ofx-pulses to y pulses, and then arrange that one pulse on the slower axis is issued after the ratio number of pulses (necessarily rounded to the nearest integer) has been issued on the faster axis. Using this method, circles and other curves may be approximated by a series of very short straight lines. However, for laser applications. spatial errors for both straight lines and curves are then unacceptably large. In addition. computer memory requirements are then severe for curves. A superior control method is used in the present system. and it is explained in the next two sub-sections. Straight-line

segments

A user defines each straight-line segment from the keyboard by entering the segment type (straight, not circular), the coordinates of the two end points, and the shutter status. Alternatively, the graphics tablet is used to enter the end-point coordinates. After all segments have been defined, the user specifies the desired translation speed V for the pattern. For present purposes, V is conveniently expressed in Hz, where 1 Hz = 1 step distance s-l, and where the step distance 6 is that resulting from a single pulse on one axis. Then V is independent of the choices of screw pitch and motor step size. Note that V is equivalent to pulses s-’ only when motion is exclusively along either axis. Following entry of these data, creation of the pulse file for the pattern is automatic, but involves considerable computation. Many parameters are conveniently expressed non-dimensionally using either the step distance S or the clock period r, for normalization. Consider a straight line requiring non-dimensional translations Ax and Ay along the x and y axes respectively, where Ax and Ay are real numbers. The total numbers of x and y steps are obviously integers given by IVY =

int (Ax)

(la)

NV =

int (Ay)

(lb)

where ‘int’ refers to rounding to the nearest integer, not to truncation. The angle of the segment with respect to thex axis is 8 =

tan-’ (Ay/&)

(lc)

Since N, and A$ are fundamental parameters for each segment, they must be stored in the pulse file. Each ZVY or F,, is stored using two bytes (plus one bit for its sign) rather than as a real variable which requires five bytes in the Apple. This approach not only economizes on memory space but also increases the speed of the realtime program and hence increases the maximum translation speed. However. the following restrictions then exist: t&t,

l&l

465535

(Id)

where 65535 is the largest number allowed when using

OPTICS AND LASER TECHNOLOGY.

APRIL 1984.

two eight-bit bytes. Time periods can only be evaluated as integral numbers of clock pulses. The periods rX between xpulses and yVbetween y-pulses are expressed nondimensionally as ?r =

int((Vr, Icost9()‘I) for cos 8 f 0

(2a)

rr =

int (( Vt, )sinl9])-‘) for sin 8 Z 0

(2b)

?,, T,, < 65535

(2c)

Inequality 2(c) arises because two bytes are also used for storing 7, or s,.. This therefore imposes restrictions on 8:

lcos el.

I sin

8

I > (65535VrJ’

(3)

When either restriction is violated for 0 close to 0. r/2. ITor 3n/2 rad. the program effectively resets B to one of these angles. whichever is appropriate. It does this by resetting the number of pulses for the slower axis to zero and resetting the pulse period for the faster axis to int ((I+,.)-‘). Thus a small spatial error is produced (for example. a maximum of 7.6 X IO-) rad (0.44”) when V= 1 kHz and Z, ‘2,~s). For a given V, these restrictions on 8 worsen as s, decreases. For straight lines. two restrictions have so far been mentioned. These are expressed in (Id). and (3). The third and final restriction is that the time required to execute a segment must not exceed the clock roll-over time of 33.6 s (see previous section). In addition to the errors that may arise from circumventing the restriction inherent in (3). other errors may exist at any fl due to the rounding procedure in (I) and (2). The errors due to rounding may occur regardless of the number of bytes used to store N,, N,, ?Yor T,.. In (la) and (1 b), these errors increase with 6, but errors directly from this source do not exceed S/2. More importantly, rounding errors in equations (2a) and (2b) may lead to motor jamming. even at moderate speeds. because one axis may complete a segment significantly earlier than the other. If no correction is made for this effect, the first axis must pause to allow the other to complete the segment because the axes must commence the next segment together when the clock is reset. This pause may be sufficiently long to cause jamming on the first axis at the start of the next segment. The pause is shortest if either r, or T,.,whichever is less. is set by (2) and the other (say z,.) is then determined by 7,. =

int (N,. t,./J$)

Then the non-dimensional

(4) pause duration TV is

and T,, has a maximum value of 1N/21. If (say) the .V axis finishes first. jamming may o&r for T,, > r,./4 for V> 1 kHz. However. T,, (which tends to increase with the segment length) is often much greater than r,. To help prevent jamming from this effect, the software automatically inserts a number yV, of supplementary pulses:

89

Nxs =

int part (T+J

(6)

where ‘int part’ refers to the integral part (truncation). Further, the software considers the part of Tp that then still remains, which may be nearly as large as r, If this remainder exceeds 2 ms it is ignored, since then ?Y> 2 ms, in which case jamming will not occur anyway. If, however, the remainder is less than 2 ms it is briefly stored and at the start of the next segment it is subtracted from the time delay that would normally precede the first x-pulse on the second segment. Thus the effect of Tp is eliminated at the junction of these two segments. It is necessary that this procedure be applied by the real-time program at all segment junctions because precalculation of Tp for all junctions is very difficult. The supplementary pulses required to prevent jamming are usually the dominant contribution to the spatial error. The maximum possible proportional error E,,, in the length of a segment due to supplementary pulses is given by E max =

(74

(N,,)max~N

where N = NY/sin 8 is the non-dimensional length of the segment. Equations (2a). (5) and (6) show that E mm =

(Nv cos @,a, V?J(M?

= VrJ4

In addition to spatial errors, the actual speed averaged over a segment may be slightly different from the constant value requested. Poorer accuracy is tolerable for the speed than for the spatial dimensions. Equations (2) and (4) show that the proportional errors in rY and rY for straight lines are less than + 0.5% for speeds up to 3.5 kHz, which is the upper limit to V as determined by the real-time program and the Apple processing speed. This limit is roughly equal to that imposed by frictional effects in typical translators. Circular segments

The ability to represent circular arcs accurately by single segments rather than by a series of short straight lines is more than just a feature of convenience. It also affords considerable savings in memory space, even though a circular segment requires more memory than

90

Diigam

for dotermination of equation (8)

For a circular segment. rY and rr vary within the segment. As indicated for the quarter circle in Fig 3, r, at a point having a tangent at an angle @Jto the x axis is r,(n) = int (( Vq cos @)-I) = int [ (VQ-’

(1-n’/R*)+]

for 0 < n 4 (R-l)

(8)

where the integer n is the number ofx pulses in the segment prior to that point if the segment started with r&= 0, and R is the non-dimensional radius. The special value for q(n=R) at @ = tr/2 is calculated using the time required to execute the quarter circle at the desired speed:

(7b)

and occurs for 8 = rr/4, 3n/4. W4 or 7-R/4.For example, E,,, is 0.05% at 1 kHz if r, = 2 us. For a pattern, the accumulated error is not easily predictable but the proportional error in relation to the total length of all segments is likely to be much less than E,,,. Equation (7) shows that the choice of the clock period r, is important in terms of the spatial accuracy obtained.

Fig. 3

a straight line. The user defines a circular segment from the keyboard by entering the segment type. the coordinates of the end points. the radius of curvature. and whether the centre of curvature is to the right or left of the travel vector. Alternatively, if using the graphics tablet, the user specifies the segment type from the keyboard and then enters from the tablet the coordinates of the end points plus any other point on the arc. The Apple then automatically determines N, and h!Yfor the segment.

R-- 1 rx

(n=R)= nR/(2V7,) -

r&r)

(9a)

& tI= It can be shown that except for very small R. T,(n=R)

4 R”/( f’s,)

(W

Equation (8) shows that groups of pulses exist which have the same rY For a given V, the number q of pulses per group varies with 7,. This variation I is the complement of that for groups based on r,. in Fig. ‘3, or for groups based on rr in quarter circles starting with @I= sr/2 or 3rr/2. Thus, given R and V. a single ‘circular table’ can be constructed from (8) and (9) which provides the necessary r, and r,. for any #. Ideally. the table lists r~ for a series of r, (or r,.) differing successively by one clock period. However. to save memory space the program arranges that the difference between successive r, values in the table is 10 for R > 100 (typically) and is 1 for R < 100. Several restrictions exist on the parameters for circular segments. As with straight lines, an arc must take less than 33.6 s to be executed. Other restrictions are those on the radius R. Its maximum allowed value R,,, varies with V and is limited in three ways. Firstly, since two bytes are used for storing r, and 7,. (9b) for the longest pulse interval t,(n=R) shows that R = R,,, when q(rr=R) = 65535. This restriction is unacceptably severe (for example. R,,, is only 1.72 X 10’ for V = 1 kHz and r, = 2 ps). However, it is easily relaxed by the software with negligible sacrifice in accuracy. In fact, it may be shown that R,,, is increased by a factor of about 100 by arranging that rY (or r,.) is averaged over the very few pulse intervals for which (8) predicts that r, would exceed 6553512.3. The second restriction on R,,, is that the number of pulses tl per group must not exceed 65535. In this case R max may be found from (8) by setting n = 65535 and rY = (VrJr + 5 (the limiting rY value for pulses to be

OPTICS AND LASER TECHNOLOGY. APRIL 1984.

-5

corner. The ramping characteristic inherent in the circular table enables even acute comers to be executed without grossly complicating the software. A tile may accommodate hundreds of corner-turning arcs because only one circular table is required for all of them. Several alternatives to the use of corner-turning arcs are possible. but .a11of them considerably lengthen the total time required to execute a pattern. add more than one segment per corner. and increase enormously the memory requirements.

Sofhwm3 arrangement -1

0

0.5

1.0

1.5

2.0

2.5

V (klir) Fig. 4 The maximum radius of curvature R,,,, and the minimum radius of CuNature R,,, as functions of translation speed V. In region a the dominant restriction on R,,,,, relates to rx (or rJ,limits, in b it relates to memory limitations, and in c it relates to the limit on r~

admitted to the largest group). The third restriction on R mi,x is that the circular table must tit into the available storage space. Fig. 4 shows R,,, as a function

of V and indicates the dominant restriction on R,,, at any V. Finally, as also shown in Fig. 4, a restriction exists on the minimum value f?mtn for R. An axis that is initially stationary may jam if it attempts to describe an arc for which R is very small. The axis will experience a rampup in speed. but this may be too fast. To prevent this possibility. the program ensures that the speed required for that axis at the start of the arc is less than the base speed B (typically 200 Hz). This is simply done by setting r&r----R-I) = (Br,)-’ in (8) and solving for R. Thus

Rmin= l/[l - (1 -

B 2/V2)H]

Figure 5 shows a block diagram of the software system. The Basic language is used for all six programs in the package except the real-time program Driver which is in assembly language. Only Mover and Driver can exist simultaneously in the memory. The small program Menu simply facilitates loading of the desired program from disc. In the usual sequence of events. a user first creates a ‘shape file’ containing all necessary data on the desired pattern geometry and shutter status by entering data either via the graphics tablet and keyboard using Digitize. or via the keyboard only using Space. The shape tile may be checked by displaying the pattern on a video monitor and/or an X-Y plotter. and it is then saved on disc. Next. Time and the required shape file are loaded from disc. The user then specifies the speed V. Time automatically creates preramping ramping and corner-turning segments, and it converts the geometrical data into a pulse tile which. simply expressed assigns to each of the five interface channels the number of pulses and their temporal spacing for each segment. Pulse tiles contain data records for each segment and contain the circular tables. These pulse tiles are then also saved on disc. This two-step arrangement for creating a suitable data tile for a pattern is necessitated by the limited size (about 35 kbyte) of the

(10)

As with straight lines. supplementary pulses are automatically inserted at the end of circular segments if required. Spatial errors and errors in speed averaged over a segment are similar in magnitude for circular segments to those for straight lines. A speed of 2.8 kHz is the maximum attainable by the real-time program for arcs. Turning at segment junctions

(optional)

Typical patterns require abrupt changes in the direction of translation at segment junctions (corners). To prevent jamming at high speeds automatically without compromising the constant-speed feature, the user may as an option direct the program to substitute ‘corner-turning arcs’ of radius Rmin (see (IO)) at the corners. The ends of such an arc are tangent points for the two segments originally forming the corner. To accommodate the corner-turning arcs, the original segments are first truncated by appropriate lengths. Appropriate geometric calculations modify the original pattern so that these arcs are inserted at every junction except those for which the change in direction is so small that the original segments require truncating by less than two steps for both axes. The magnitudes of the spatial modifications increase with V and may be calculated from Rmin (Fig. 4) and the geometry at each

OPTICS AND LASER TECHNOLOGY.

APRIL 1984.

‘Space’ +-

Pattern geometry ( keybcard

)

‘Menu’ (1 kbyte)

creates

pulse

-SpeedV

FL'MOWS-'

(5 kbyte) loads files, calls Driver

’ Driver’ (1 kbyte) (real-time control program)

Pattern file sequence

Trigger pulses

Fig. 5 Schematic diagram of the software system. Approximate sizes of programs are indicated

91

maximum addressable and data in the Apple executed by Driver.

memory available for programs II. The pattern may then be

Mover automates the loading of pulse files and Driver from disc. and it calls Driver at appropriate times so that tiles are executed sequentially. In Mover, the user may specify a list of pulse tiles so that a very extensive pattern (represented by several files) and/or a series of simpler patterns may be executed. Only one pulse file at a time is loaded. During loading the translator is stationary and the shutter is closed. As an option. the number of disc accesses may be greatly reduced by using a commercially-available RAM expansion card that emulates the disc drive operation. Driver is a complex, compact program which outputs trigger pulses by processing the pulse tile created by Time. It is the only program that requires the interface/ timing card. The abilities of Driver to output pulses quickly and to prevent sudden changes in pulse intervals are given high priority. Fig 6 is a simplified flowchart for Driver. Each segment is executed independently of the others, and the logic path for straight lines is almost separate from that for arcs. Many details are omitted from the figure.

(

Start

‘Driver

‘)

Table 1. user * * * * * * * * * * *

Software features of convenience

to the

Fully interactive use with monitor prompts Simple methods for data entry and editing of patterns All errors or problems indicated during use Display of patterns on monitor and/or x-y plotter Graphics display blow-up facility Choice of absolute or incremental coordinates Patterns may be rotated, translated or inverted Independent x and y scaling (if no circular segments) Optional use of one or two disc drives Optional use of 128 k RAM card emulating disc operation Segments with shutter closed are automatically faster

The Apple memory is sufficient for files to have up to 400 segments if only straight lines are involved. or up to 200 segments if the only arcs in it are corner-turning arcs. If several arcs with various R are required. the number of segments that can be accommodated varies from one to several hundred depending on the length and number of the circular tables required. Time informs the user if storage problems exist. Since Time typically requires 8 min to process 100 segments. the possible existence of such problems is determined early during pulse tile creation so that it may be aborted at an early stage. Many software features typical of sophisticated translator systems are included in the present system for the convenience of the user. These are listed in Table 1. They are not fundamental to the system design. Nevertheless, it is significant that all these features are provided in such an inexpensive system with the program sizes indicated in Fig. 5. Conclusions An inexpensive yet versatile X-Y translator with some sophisticated features for laser applications has been successfully designed around a general-purpose eightbit microcomputer and a stepper-motor drive system. Within each data file the translation speed is a selected constant, regardless of direction. The design involves careful use of computer memory and a careful choice of the system clock frequency. Compromises inevitably exist in the design when attempts are made to maximize simultaneously the size of tiles. the translation speed, the system accuracy and the length of segments. The present system is marketed under the name of ‘Sirostep translators’.

No

Send Y pulse. Decrement Y pulse

References

count. Adjust parameters using circular table. Set next T(Y)

L Fig. 6 Simplified flowchart for Driver. T(x) and T(Yj are the times at which the x and Y pulses, respectively, are sent

92

I

Ready, J.F. ‘Industrial applications of lasers’. Academic Press. New York (1978) Lue, J.T. ‘An automatic X-Y scanning controller for laser anealing of ion-implanted semiconductors’. J. Phys E: .Sci. Instrum. 15 (1982) 705-707 ‘Laser Focus Buyers’ Guide’, Advanced Technology Publications Inc. Littleton. Massachusetts. Annual

OPTICS AND LASER TECHNOLOGY.

APRIL 1984.