Вы находитесь на странице: 1из 5

Outline O tli CNC S t System

CNC System
Direct Control Indirect Control

Computer Numerical Control


CNC is a multi-processor control system designed to perform the tasks commonly encountoured in metal working machinery and other machine tools:
Motion control / Servo control
Multi-axis motion control Spindle motion control Tool changer / turret Coolant / lubricant control Tool alignment / other auxillary functions Interpolation / command shaping Machine tool cycles Tool ofset compensation Passive error compensation

Peripheral unit control / PLC

Architecture of CNC System


Control Algorithm

Command generation

Interpolator
Linear Circular
Courtesy of Heidenhain Corp.

Diagnostics and calibration User Interfacing


Program editing / storage / simulation File management Tool management Manual data input (MDI) Machine / human interfacing

Chapter 9

ME 440

Chapter 10

ME 440

CNC Systems y
Indirect Control System
NC Program
tool location feeds

Generic CNC System


Cutting Forces Interpolator x*(k) + ( )
Position command

CNC System
Position c command Torque c command

e(k)
_

( ) Control m(k) Algorithm T

Outpu ut Interfa ace

m(t) ()
Torque command (voltage)

Drive + Motor

m(t)
Motor torque

x(t)

Feed Drive

Table Motor M t Drive


Position P ii sensor

Part
NC Program

Interpolator

Motion i Controller

Servo Ser o motor

Clock
Synchronization Signal

Ball Screw Shaft

Angular position feedback

x(k)

S Sensor In nterface

Nut

CNC System

Position Sensor

Carriage's position

Direct Control System


NC Program
tool location feeds

CNC System S t
Torque command P Position command

Table Motor M Drive Servo S motor


Direct position feedback

Part

Position sensor

Interpolator

Motion Controller

Ball Screw Shaft

Nut

In this direct control system, the position of the carriage y , p g (x) is measured and sampled by this simplified CNC system. The interpolator computes the desired position ( *) of the comp tes (x*) carriage at a particular instant in time using the NC p g program.
Chapter 10 ME 440 5

Chapter 10

ME 440

Generic Control System (Contd) (Cont d)


The control algorithm first determines the deviation (e = x*-x) of the feed-drive system from the desired path and then calculates the corrective action (m). The correction signal (called manipulation) is sent to the output interface generating a corresponding voltage m(t). This voltage serves as a torque command for the motor drive which in turns controls the servo-motor to produce the d i d torque. th desired t Hence, the generated torque (m) compensates the disturbance on the f d d i system and puts th di t b th feed-drive t d t the carriage back to its desired course.
Chapter 10 ME 440 6

Computer Control p
Each physical quantity (such as position measurement, error, etc.) in CNC system (a.k.a. control computer) is represented by a corresponding binary number with a finite length:
Byte / word Integer, long integer Floating point number etc etc.

All computations and I/O operations are synchronized b a master clock. h i d by t l k

Chapter 10

ME 440

Computer Control ( p (Contd) )


Inside the comp ter each q antit is valid computer, quantity alid at only discrete-time intervals:
t = {0, T, 2T, 3T, ..., kT, ...} T is called sampling period of the computer.

Control Algorithm
Control algorithm can be expressed in terms of a finite g p difference equation. That is, it is an algebraic expression which depends on not only the history of the input but also that of the output:

m( k ) = aim( k i ) + bj e( k j )
i =1 j =0

In discrete-time domain, the time dependence among various quantities of interest are represented by a time index:
x(t=kT) = x(kT) = x(k) where k = 0, 1, 2, ... (t kT) (kT) (k) h 0 1 2 Integer k is called time index.
Chapter 10 ME 440 8

ai, bj are the constant coefficients of the equation; m(k) current value of the output (manipulation) @ t = kT; m(k-1) is old value of m @ t = (k-1)T, ... ; e(k) current value of the input (error) @ t = kT; e(k-1) is old value of e @ t = (k-1)T, ... ;
Chapter 10 ME 440 9

Control Algorithm (Contd) (Cont d)


1. 1 2. 3. 4. 4 Read x*(k) from the interpolator interpolator. Read the position measurement x(k). p ( ) Calculate the error: e(k) = x*(k) - x(k). Compute the correction signal: C t th ti i l
m(k)= -a1m(k-1) a2m(k-2) - ... + b0e(k) + b1e(k-1) +...

Control Algorithm (Contd) (Cont d)


Read the mea d asuremen nt Read the mea d asuremen nt

Calculat the te corr rection signa n al

Outp the correction put signa al

5. Send m(k) to the output interface. 6. 6 Wait till the end of the period T T. 7. Go to Step 1.
Chapter 10 ME 440 10 Chapter 10

Wa till the end ait t d o of perio T od,

Time

ME 440

11

Interpolator p
Interpolator is an advanced command generation algorithm executed by the CNC system. By interpreting the codes in the default NC program, the interpolator generates the following commands: i t l t t th f ll i d
The desired position and velocity of each axis The desired velocity of spindle (and angular position wherever necessary) The appropriate peripheral unit commands:
Coolant on / off Spindle on / off Tool change

Interpolator ( p (Contd) )
Since the commands are to be fed to the axis-position control (a.k.a. servo) cycle at each sampling period T certain ti h li i d T, t i time restrictions are imposed on the interpolation algorithm. Furthermore the interpolator has to carry Furthermore, out complicated trigonometric calculations involved i th t l radius compensation. i l d in the tool di ti
Chapter 10 ME 440 13

Th commands associated with th ( The d i t d ith the (canned) machine cycles. d) hi l

Chapter 10

ME 440

12

Interpolation Types
Y

Linear Interpolation p
G90 G1 Xxf Yyf Zzf Ff

Three types of interpolations are commonly utilized in CNC technology:


Rectilinear / Linear Circular Helical

yf
f

Let us first calculate travel time between these points: p


Tt = ( x f x s )2 + ( y f ys )2 + ( z f z s )2 ( f / 60)

ys xs xf
X

More advanced interpolation types are also used i modern CNC machine t l l d in d hi tools:
Parabolic NURBS
Chapter 10 ME 440 14

zf zs xs
Chapter 10

Hence, number of commands to be generated g through out this motion becomes


T N = int t T

xf

Here, Here int {} rounds its argument {} to the nearest integer while T denotes the sampling time. p g
ME 440 15

Linear Interpolation ( p (Contd) )


Y

Circular Interpolation p
G90 G17 G3 Xxf Yyf Rr Ff Y Y'
(x y' (x'f ,y f)
(x'(k+1),y'(k+1)) (x'(k),y'(k))

The interpolation equations take the following form:


x * ( k ) = x * ( k 1) + x y * ( k ) = y * ( k 1) + y z * ( k ) = z * ( k 1) + z

The positions at t = kT can be expressed as


x ' ( k ) = r cos( k ) y' ( k ) = r sin( k )
X' X

r f k
(x's ,y's)

In these equations, q ,
k = 1, 2, ..., N; x*(0) = xs; y*(0) = ys; z*(0) = zs
O(xc ,yc)
f s

The positions at t = (k+1)T become


x ' ( k + 1) = r cos(( k + 1) ) y' ( k + 1) = r sin(( k + 1) )

The constants can be expressed as

x =
Chapter 10

x f xs N

y =

y f ys N

z =

z f zs N
16

( x s x c ) + ( ys yc ) = r ( x f x c ) + ( y f yc ) = r
2 2

2 2

Solving these equations gives the coordinates of the center (xc,yc) y ).


Chapter 10 ME 440 17

ME 440

Circular Interpolation (Contd)


Expanding these terms yields
64 4 7 8 64 4 7 8 x ' ( k + 1) = r cos( k ) cos( ) r sin( k ) sin( ) y' ( k + 1) = r sin( k4 ) cos( ) + r cos( k4 ) sin( ) i2 ( 14( 3 14( 3 i ( 2
y '( k ) x '( k ) x '( k ) y '( k ) (

Circular Interpolation ( p (Contd) )


Note that

f s
N

r ( ) N = int ff T s 60
s = cos1

When these equations are shifted backward in time (kk-1), we get


x ' ( k ) = cos( ) x ' ( k 1) sin( ) y' ( k 1) y' ( k ) = cos( ) y' ( k 1) + sin( ) x ' ( k 1)

f = cos1

xf xc r

xs xc r

Thus, we have

with x(0) = xs xc and y(0) = ys yc.


Chapter 10 ME 440 18 Chapter 10

x * (k) = x ' (k) + x c ;

y * ( k ) = y' ( k ) + yc

ME 440

19

Example p
Y [mm]
Samples to be generated

50

D
v = 600 [mm/min]

10 0

B 60

G90 (ABSOLUTE COORDINATES) G01 X0 Y0 Z0 F600 (PT 0) X20 Y10 (PT A) X60 (PT B) Y50 (PT C) X20 (PT D) Y10 (PT A) X0 Y0 Z0 (GO TO PT 0) M30

20

X [mm]
G90: Absolute Coordinates Specified G01: Linear Interpolation Mode
ME 440 20

X, Y, Z: Destination Coordinates F: Feedrate (velocity in mm/min)


Chapter 10

Вам также может понравиться