Copyright©IFAC Control Problems and Devices Budapest, Hungary. 1980
DEVELOPMENT OF AN ACC FOR A CNC: SOFTWARE INTERACTIONS AND CONFLICTS R. Bedini*, F. Mancuso** and P. C. Pinotti*** ·University of Florence, Florence, Italy •• Olivetti OeN S.p.A., Ivrea, Italy ···University of Pisa, Pisa, Italy
Abstract. In the paper the main problems faced while implementing an Adaptive Constrained Control, developed to optimize rough turning operations, on a lathe provided with a Computerized Numerical Control, are presented and discussed. The interactions between standard Numerical Control functions and Adaptive commands are analized and the conflicts that in particular conditions may arise are underlined. The general features of the realized firmware are also reported. Keywords. Adaptive control; Computer software; Control engineering; Computer applications; Direct digital control; Machine tools; ManUfacturing processes; Microprocessors; Special purpose computers.
NOTATION a I M N Vf Vt W
feed (mm/rev) armature current of spindle motor (A) spindle torque (Nm) motor speed (rev/min) feedrate (mm/min) cutting speed (m/min) spindle motor power (Kw) INTRODUCTION
The development of Adaptive Constrained Control (ACC) systems for the online optimization of the metal cutting process requires the solution of problems mainly related to:
With the advent of CNC units, designed around fast and powerful microprocessors and provided with the memory resources made available by the Large Scale Integration (LSI) technQ logies, approaches toward integrated NC-ACC systems have been envisaged (Maltby and Marten, 1978; Weck and Schafer, 1977). In this way the ACC function become one of the tasks pe£ formed by the microcomputer which shares its resources between the conventional and the adaptive activities.
- the set up of proper sensors; - the design of an efficient control strategy; - its implementation on the machinetool. Since the ACC system are practically developed only for Numerically Controlled (NC) machine-tools, the ACC, either software or hardware realized, must always fit into the NC env~ron ment.
This paper refers on the co-operative work carried out by the authors in order to apply, to a CNC marketed by a major Italian firm, the already presented and discussed ACC strategy developed for turning operations.
In the past years the technical literature reported on several ACC prototypes developed, mainly for lathes and milling machines, with various optimization algorithms and operating structures. Since the Computerized Nu
CPDMT _ L
merical Control (CNC) systems were not yet available, the ACC activity was often performed by hardware controllers, either analog or digital, properly interfaced to the standard NC units. In others ACC experiments minicomputers provided with digital and analog input-output facilities we re dedicated to the ACC functions. I; a few cases digital computers operating on a time-sharing basis among se veral machinetools, and realizing th; Direct Numerical Control (DNC) of the machining, were also employed for ACC experiments.
The realized ACC fit into the
167
R. Bedini, F. Mancuso and P. C. Pinotti
168
class of the closed loop sampled data systems; the digital controller has, as objective function, the maximization of an Index of Performance of the machining. The non linearities of the cutting process, of its mechanical and technological constraints, and of the spindle and feedrate drives make the control problem a non trivial one. The ACC loop is operating close to that of the NC; the whole CNC-ACC structure is a complex, mUltiple feedback loop (Fig. 1).
I
N C da1a
I I
I I I
, C C da1a
I
r---i__ -, I CONV[NTIONAl NU~v:RICAt
I
CONTROL
I I
ADAPlIV£
I
CONSTRAINED
,
I
LATHE
I
L
n~~~~~u
Ne 1001 path
Spl"" I. speed feedral.
I
~ _ ~~:'R~L___:..
~
r------,
I Spi'llJl. motor L
"-,--
I J
I Armature current tnnsducrr
Adaptiv. loop
Fig. 1. The CNC-ACC System. In this system the adaptive function is based on the periodic measurement by means of an A/D converter of the ar mature current of the DC spindle mo-tor. This motor is driven on the arma ture voltage up to a speed of 1000 rev/min and on the field circuit from 1000 to 3000 rev/min. In this case, as it is well known, the armature cur rent I is proportional to the torquein the lower speed range and to the PQ wer In the higher speed range. The CNC controls on line, as a conven tional NC job, the cutter position a~d the spindle speed. The additional kno~ ledge of the actual value of I is sufficient to it for computing the values of the mechanical stresses on the machine-tool, i.e. the spindle motor po wer and torque and the main cutting force. These machining parameters may be easily compared with the maximum allowed values, which are the mechani cal constraints of the workpiece-toollathe system, in order to obtain the degree of machine-tool utilization and to maintain the maChining in safe conditions. Shop practice, handbooks or tool manufacturers data allow to determine the technological constraints for the machining. These are the upper and lower cutting speed and feed values for which the machining is still correctly per for med for the given workpiece-tool mat- -
chining and which define the technological admissible region. Acting on both the feedrate and the cutting speed, which are the cutting process controlling variables, the ACC algorithm may therefore: - keep the cutting point (V t , Vf) into the technological admissible region; - bring it to safe cutting conditions whenever a mechanical constraint is violated; - bring and maintain the machining to the maximum feedrate compatible with all the above-mentioned constraints. To this point, hereafter the Opti mum Point (OP), the minimum machi- ning cost very often corresponds when rough turning operations on low or medium powered NC lathes are per formed (Bedini and Pinotti, 1979a,1979b; Spiewak and Szafarczyk, 1978). Such a type of machine-tool is more and more diffusing worldwide. The software developed ACC strategy allows the OP to be reached and attai ned through a hill climbing procedure performed by imposing step variations to the controlling variables. The ini tial cutting speed and feedrate (Vto~ Vfo ) are those set by the part progra~ mer for conventional NC operations. For each sampling of the I value the ACC routine updates these values. Being the optimization algorithm based on a static model of the turning prQ cess, the frequency of the sampling is limited to a few hertz by the electromechanical transients of the machine tool actuators and by the settling time of the I transducer. This fact does not affect the economical aspects involved with the ACC system, since the improvements experimentally obtained on the prototype are very sa tisfactory (Bedini and Pinotti, 1979b). While machining a workpiece the cutting process is often interrupted and the tool moves in the air. Highest va lues of the feedrate during "air cut-=ting" can considerably improve the m~ tal removal rate, provided that an et ficient control algorithm protects the system against overloads when the tool encounters the workpiece. The de veloped ACC system is provided with this feature also. THE CNC STRUCTURE The used CNC is the CONTOR 32 produced by the Olivetti CN S.p.A. firm and widely marketed for application on lathes. The unit realizes a twoaxes continuous path control and it is provided with both linear and circular interpolation capabilities.
Development of an ACC for a CNC 'he machine-tool is therefore operated 'y the microcomputer on which the con,rol unit is based. The part programs :an be loaded either through a tape 'eader or an alphanumeric keyboard. 7he general scheme of the system is ,hown in Fig. 2. PART PROGRAM PUNCHfO TAP(
OP(RATOR'S REOUESTS
n
CRT 01 SPlM
AlPHANUIN:R IC I([YBOARO
CONSOU
UNIT
POSITION & VElOC ITY
POWER COM....... NOS
Ne
LATHE
Fig. 2. CNC Structure, ~he CONTOR 32 is provided with two ;PUs; CPUI manages the data handling: Lt supervises the computational flow lnd the I/O activities performed thro Igh the peripherals to which it is :onnected; CPU2 performs arithmetic, ;rigonometric and exponential comput~ ;ions in a fast and highly precise lay. ~he
operating systems is stored on the machine-tool parameters and ;he part programs are permanently main ;ained on RAM-CMOS memories provided lith independent power supply; the lcratch data are stored on RAM dynamic nemories. ~PROM:
rhe timing of the activities is driven by a 5ms clock. Tool position and spinile speed are sampled at the 200Hz fre~uency, and values for the following step are computed and set. Checks on the machine and actuators status are also performed; if failures are detected an emergency procedure is activated and the machine stopped. rhe control software is hierarchically Jrganized and consists of a supervisory module and of controlled modules. rhese latter are: - a peripherals processor module, which manages the I/O activity of the peri pherals which assure the man-machin; communication; - a module which supervises the on-li ne information flow between the prQ cessing unit and the user; - a processor module for the translation into the machine language of the geometric and technological input data to the NC; - a machine interface module which ma
169
nages the information flow between the CNC and the signal and power i~ terfaces of the machine-tool; - an actuator module which drives and checks the axis motion. INTEGRATION OF THE ACC INTO THE CNC General considerations From the above reported basic consid~ rations it appears yet that ACC and NC functions are, in some manner, antithe tic and interactions and conflicts bet ween them may arise. In fact the conventional NC tries to maintain at the constant set values the cutting parameters, in any maChining condition, until new F and S specifications in successive program blocks are encountered. The ACC function, on the contrary, is developed in order to seek, reach and maintain the OP despite all the disturbances that may modify its position. This happens mainly because of the variable material hardness, tool dullness or depth of cut. In order to attain the OP, the cutting parameters have to be continuously modified, if necessary. To obtain the best integration of the NC and ACC functions, it might be perhaps more advisable to develop a whole firmware for the two activities, optimizing the various functions and resources of the microcomputer managing the machine-tool as far as the operating system architecture, routi nes linking, memory assignements, priorities and timings are concerned. The way of implementing the ACC functions into the already available CNC structure has been chosen, mainly with the aim of verifying the practical ef fectiveness of such an on-line optimI zation of the machining process. Once this prototype will prove to lead to significant savings in machining industrial workpieces, the acquired experiences could aid the integrated design of a new generation of CNC units. On this way the most significant problems to be solved while adding the ACC function to a CNC can be so summa rized: - input-output problems: the data required by the ACC software in order to correctly perform the on-line optimization should not constitute a severe impact for a conventional part programmer. The behaviour of the machine-tool should also be ea-
170
R. Bedini, F. Mancuso and P. C. Pinotti
sily understandable by the operator during machining, allowing the check of all the operations performed by the ACC algorithm; - time sharing problems: the ACC routi nes must, in all situations, fit within the timing of the NC main functions, driven by the processor clocks; - interference problems: in several c~ ses, as for instance when facing op~ rations are performed, and the ISO G95 and G96 functions have been acti vated, the NC computes and executes step commands on spindle speed and feedrate in order to maintain the programmed values of cutting speed and feed. Since the AC algorithm independently computes the optimization steps, depending upon the actual values of the stresses, the problem of "tuning" these activities arises. The write-up in the machine language of the ACC routines is a less difficult job since powerful assemblers and cross assemblers are today available for microprocessor programming. Considerable effort has to be made to develope an integrated ACC-NC firmware as compatible as possible with the sta~ dard machine, in order to assure maximum retrofitting capabilities at minimum cost.
of NC users. A simple solution, which proved its effectiveness (Bedini and Pinotti, 1979b) was therefore preferred, based on the following requirements and assumptions: - the introduction of an ACC system in the workshop should be as simple as possible, avoiding uneasy procedures, at least until all potential benefits of AC will be fully confirmed. - it should be possible to convert si~ ply and quickly for ACC usage the part programs already developed and functioning on conventional NC insta1 lations. In this way an easy retrofitting of the ACC on installed systems would be assured. The realized solution meets these sta tements since the CNC itself, whene= ver in the part program F and S sp~ cifications are encountered, derives for the related operations (Fig. 3): - the limits on the cutting speed: V t
!!"
V t
ml.n =
~l.
I.
K V 1 to
K> 1 1
K V 2 to
K< 1 2
( 1)
-
the limits on the feed: a
max
K 3
'1
0
K> 1 3
(2 )
Input-output problems The mechanical and technological constraints, defining the correct utilization of the machine-workpiece-tool system need to be introduced, in some way, into the CNC. Here the problem arises of how to do this. The job of defining the proper ranges of cutting values would bring the ACC usage too far away from the usual workshop practice. For each tool used in the working cycle, it would be necessary to specify, with a proper procedure, at least the values of Vt max, Vt min' a max and amin in addition to the standard spindle speed (or cutting speed) and feedrate (or feed) specifications. This would be a time consuming and pr£ ne to errors step in programming. An advanced solution to this problem it might consist into the creation of a machinability data bank, concerning the materials and tools used in the shop, to be stored into the CNC, or, in more sophisticated realizations, i~ to the mass memory of the supervisory computer realizing a Direct Numerical Control. The first solu~ion is behind the immediate objectives of this research since it requires memory and computing resources today not yet avai lable for industrial CNC systems. The last solution is not useful and economically justifiable for the majority
a ml.n
Vf
Fig.
.....
4 a0
K
K< 1
4
" .....
3. Mechanical and technological constraints in the Vf-V t plane,
The chosen values for the constan~ Kl , K , K and K depend on the workpl.ece 4 2 3 mater'al and on the tool. They are st£ red into the CNC memory together with the values of Vf max and Vf min when necessary, through preliminary off-li ne procedures. This solution has been chosen since, as it is well known from industrial
Development of an ACC for a CNC practice, the cutting parameters defined on a part program are very often kept to conservative values. This is due to the uncertainty on the amount of material to be removed, to the variability of material hardness and tool dullness and to the lack of well established machining data. Flexibility is assured to this basic behaviour by the fact that, as in con ventional operations, also under ACC the valu~s of Vfo and Vto may be chaQ ged on-llne actlng on the feed and spindle overrides. In this way the op~ rator alters the field bounded by the technological constraints into which the cutting point is searching and ma intaining the OP of the machining. This feature requires that the CNC could dynamically update, at each opti mization step, the values of the constraints given by the (1) and (2) relationships. Unacceptable and unforeseen cutting conditions that might arise are in this way avoided; on the other side the skilled operator may actively intervene during cutting, following the suggestions given by the machine-tool behaviour, to improve the AC effectiveness. As a matter of fact, while in conventio nal machining unacceptable cutting conditions are perceived only in extr~ me cases, a proper output during ACC operations may indicate on-line the process status. For this purpose the standard CRT display, available on the CNC, has been used to output information to the operator. Beside the alarms for a bad usage of the ACC functions, the main messages shown on-line in the display are: - the actual values of the feedrate and cutting speed; - the amount of armature current I uti lized by the spindle motor as the percent valu~ of the I max . Fo: the DC motor havlng the above mentloned characteristics, the current value refers to the motor torque or power depending on the speed value. Since the frequency of the ACC steps is about 3Hz, the on-line visualization of more parameters is of difficult perception. Instead of numerical values, histograms on the CRT display are now planned, for an easier monit£ ring of the whole functioning. Other main parameters which are data inputs of the ACC software and whose numerical values may require sometimes a calibration, are: - the number No, multiple of the basic cycle time of the CNC, which defines the sampling period of the ACC. This
III
value is imposed by the time requested by the system in order a new steady state of the cuttin8 process can be measured after commands on N and Vf are sent to the lathe. Since this time mainly depends on the act~ ators and current transducer dynamics, No may be considered as a con stant value, hardware depending; - the value of the spindle motor speed Nc to which the control switches from the armature to the field circuit; this value also is imposed by the machine-tool har~ware; - the maximum value I max of the armature current corresponding to the rated load of the spindle motor. This value also can be stored into the CNC memory only once and is assumed as reference value unless otherwise specified in the part pr£ gram. Indeed, a further facility provided by the ACC, suggested by the user's experience, consists into the easiness of specifying, into the proper blocks, a desired percentage of the I max . This feature realizes a better control, through the mech~ nical constraints also, of critical cuts; - the steps amplitude, AV t and 6Vf' which have to be chosen so as to reach a compromise between the need of rapidly following the OP and that of avoiding high and time lasting cutting transients. The 6V t and 6Vf are the more critical software constants, since very often they depend on the machining parameters as fo~ instance the machined diameter ar.d the material-tool matching. On the way of avoiding to many adjustments on the shop floor of these numerical values, the solution of defining steps on the feed, instead that on the feedrate, has been recently plag ned. In this manner the dependence of the steps amplitude on the machined diameter is avoided and a closer relationship established between the process and the tool tip characteristics. Being the parameters of the ACC strategy so predefined, the ACC function may be activated and cancelled by si~ ply introducing into the part-program proper instructions (free ISO G functions, for instance) at the beginning and at the end of each set of blocks to be executed under ACC. Return to conventional NC operations must be automatically assured for operations to which the ACC strategy does not apply. The console editing facility of the CNC may therefore be used to quickly update conventional nc tapes for ACC machining. Time sharing problems The timing of the control activity
172
R. Bedini, F. Mancuso and P. C. Pinotti
performed by the CONTOR on the machine is based on a frequency of 200Hz. Every 5 ms a machine control program at the highest priority is executed. Such a program, which controls the motion of the slideways and the spindle speed, lasts from two to four ms depending on the kind of operation performed by the machine. The longest time is requested when the circular interpolation is uti lized. The ACC program, as it has been already discussed,requires a slower timing. This is due to the fact that a static model has been adopted and the transients last some tenth of a second. The optimization algorithm can be therefore activated at a low frequency. For the Pontiggia NC lathe used in the research a frequency of about 3Hz was necessary. The evaluation of the ACC routine running time, which is variable, has shown that 5 ms may not be enough for both the machine control and ACC programs to be completed. The adopted solution is therefore based on the following points: - the whole ACC routines set has been subdivided into some modules; each of these modules can surely be execu ted together with the machine con- trol program within the allowed 5 ms; in this way each ACC run requires, to be completed, some basic cycles; - since the variables concerning the status of machine parameters utilized by the ACC routines may be modi fied at each 200Hz run of the machIne control program, their initial va lue must be "saved" as long as the ACC routines are running. This has been done utilizing a storage space in which the variables are updated at a frequency of about 3Hz. The available storage space in the stan dard CONTOR configuration has allowed to store both the ACC program and the necessary data. It has been noted that in this application the amount of memo ry required is a parameter not so striil gent as the running time. Throughout the work an effort has therefore been made to speed up the NC and ACC system even sacrifying some memory space. As far as the timing of the whole ACC routines set is concerned, difficulties have been encountered to utilize the basic 200Hz clock. For this purpose a second clock, available on the CON]OR, at a lower priority level, has been used (Fig. 4). This clock allows the system to read the values set by the operator on the console by means of switches. Such a clock, having a period of (20-30) ms, has also been utilized for starting the ACC routines as soon as a counter, incremented by the 200Hz clock has reached the No value set in
TO THE 20rns ROVIINE
TO THE 5rns ROUTINE
Fig.
4. The NC-ACC interaction
flo~
the program. As a matter of fact the ACC routines start within 30 ms after the counter has reached the No value. In the Fig. 5 the flow of the ACC stra tegy is shown. The information concer~ ning the armature current is obtained using a spare AID converter available in the standard CONTOR configuration. This solution has made necessary to modify the operating system of CNC. This is because the values received from the console are organized, into the memory, on a buffer in cycle upd~ ted by the auxiliary clock. The storage in such a buffer of the I value could take place some tenth of a second after the armature current has reached the steady value. Such a delay, added to the time neces sary to the transients to settle and to the computing time would increase too much the ACC period. The modified operating system allows the I value to be stored as soon as an ACC step is started. As a matter of fact when the ACC step begins,the updating in the buffer of the parameters other than the armature current is stopped, the I value is stored and then the uE dating is restarted. When the air cut routine is activated, the process st~ tus is monitored with the console clock frequency since the tool-workpi~ ce collision must be detected as soon
Development of an ACC for a CNC as possible. START
TRANSFERS TO THE AC MEMORY REG lOll THE PARA/KTERS STORED IN ~ MA IN MEMORY I VI, <1>, N.... J
READ THE VAlL{ CIF THE ARMATURE CURRENT THROUGH THE CONSOU AID CONVERTER
173
cy of 200Hz. In this case the armature current continuously varies and a rele vant amount of it is necessary to face the inertial torque. For this reason the cutting status is hidden and oscil lations around the cutting point may occur. To eliminate the effects, that can cou ple and magnifie the one another, of these step variations on the spindle speed, some limitations to the ACC algorithm, when facing operations are performed, have been envisaged. The ACC is now disactivated when predefined low values of the workpiece diameter are machined. At the author's judgement, this "tuning" problem requires further study and experiments. NC-ACC FIRMWARE ARCHITECTURE Figure 6 shows the whole CNC architectu re after the hardware and software ACC implementation has been completed.
SET Oil THE MACHINE TOOL THE UPDATED N, VI VAlL{S
Fig.
5. Flow of the ACC strategy.
Interference problems Facing operations constitute an intere sting situation of conflict between standard NC and ACC commands. Indeed, some trouble occurs, as summarized in the following. When the part programmer specifies the cutting speed and the feed, the standard CNC algorithm modifies both the spindle speed and the feedrate in order to maintain Vt and a at the correct predefined values. These mofifications occur at each basic machine cycle. Every 5 ms therefore the numerical control unit computes and sets a new value of spindle speed, according to the variation of the machined diameter; at the same time in order to maintain the desired value of a, the corresponding value of Vf is also co~ puted. On the other hand, at each step of the ACC a value also for ~Vt is computed and set on the machine, together with a ~Vf value. When the machined workpiece diameter approaches to very small values, the spindle speed is undergoing very high variations and the related commands are imposed by the NC with a frequen-
... u ..u~(
CIJI'fNl' f,MISOUC('
Fig.
6. The CNC-ACC architecture
The processor, which includes CPU1, CPU2 and its ROM1, may interchange d~ ta with the user peripherals by means of an high speed bus (BUS1). Through a bidirectional interface the processor is also connected to the second bus (BUS2) to which the machine peripherals are linked. BUS2 is highly protected against noise in order to avoid disturbances generated by the machine-tool electrical devices. A D/A converter drives the servomotors
174
R. Bedini, F. Mancuso and P. C. Pinotti
of the axes and the DC spindle motor which is fed by a SCR six-phases bridge. The hardware utilized by the ACC incl~ des: - a transducer of the armature current I. Such a transducer includes a shunt on the armature circuit, a rectifier and a low pass filter; an AID converter which sends, at the software controlled frequency the instantaneous value of the armature current to the BUSl and then to the processor; an air cut monitoring circuit based on the tachometer information; the idle armature current required at the measured spindle speed is comp~ red with the actual I value and then the air cut status detected. In such a way a signal may be sent to BUS2 in order to set the feed programmed for the air gaps. When the cutter encounters the workpiece a "safe" cutting condition is imposed through the spindle and feedrate actuators. The RAM memory of Fig. 6 provides the data swapping between the two CPUs and between each of these and the related peripherals. The operating system of the CNC and the ACC software modules are permanently stored in ROM2; the air cut routine is stored in ROM1. CONCLUSIONS The whole integration of an efficient ACC strategy in a conventional CNC still requires some effort. Some problems, as,for instance, the optimal co-ordination of the NC and AC commands in facing operations at low workpiece diameter, seems to be yet open to further studies. Nevertheless the today available CNC s~ stems allow to develope ACC algorithms that may give significant results and savings in several machining situations. Experimental results, obtained while peL forming rough turning operations under the developed ACC system, have shown that an average saving of machining time of about 30 - 40 %, can be easily reached compared to conventional NC.
ACKNOWLEDGEMENTS Authors wish to express their appreciation to the Olivetti OCN S.p.A. for the support under which the present work was carried out and to the PONTIG GIA S.p.A. for the useful technical advices. Appreciations are also expre~ sed to Mrss. M. Balestri, S. Bazzocchi, and F. Vivaldi for their help in the experimental work. REFERENCES Bedini, R. and P.C. Pinotti (1979). Development of an adaptive constr~ ined control for a computerized numerical control: an approach for turning operations. Atti del Centro per l'Automatica dell'Universita di Pisa. Paper 79-01. Bedini, R. and P.C. Pinotti (1979). Development of an adaptive constr~ ined control for a computerized numerical control: experiences in machining. Atti del Centro per l'Automatica dell'Universita di Pisa. Paper 79-02. Maltby, D., and H.R. Marten (1979). Software for a computer numerical control system designed for adaptive control research. Proc. 19th Int. MTDR Conf., 19-26. Spiewak, S., and M. Szafarczyk (1978). Algorithms of operation and structures of ACC controllers for rough turning. CIRP Ann., £1, 413-418. Week, M., and K. Schafer (1977). Direct digital control for turning operations. Proc. 17th Int. MTDR Conf., 61, 66.