ME 440 - 09 CNC System (Rev. 3)
-
Upload
manuj-arora -
Category
Documents
-
view
12 -
download
0
Transcript of ME 440 - 09 CNC System (Rev. 3)
O tli CNC S tOutline – CNC System• CNC System
– Direct ControlDirect Control– Indirect Control
• Architecture of CNC• Architecture of CNC System – Control AlgorithmControl Algorithm
• InterpolatorLinear– Linear
– Circular
Chapter 9 ME 440 2
Computer Numerical ControlComputer Numerical Control• CNC is a multi-processor control system designed
to perform the tasks commonly encountoured into perform the tasks commonly encountoured in metal working machinery and other machine tools:
– Motion control / Servo control• Multi-axis motion control• Spindle motion control
– Peripheral unit control / PLC• Tool changer / turret• Coolant / lubricant control• Tool alignment / other auxillary functions
Command generation– Command generation• Interpolation / command shaping• Machine tool cycles• Tool ofset compensation• Passive error compensation
– Diagnostics and calibration– User Interfacing
• Program editing / storage / simulation• File management• Tool management• Tool management• Manual data input (MDI) • Machine / human interfacing
Courtesy of Heidenhain Corp.
Chapter 10 ME 440 3
CNC Systemsy
CNC SystemNC
Indirect Control System
Torq
ueco
mm
and
CNC System
i Ser oPosi
tion
com
man
d
M t
NCProgram
feedstoollocation
P i i
PartTable
Interpolator
cMotionController
Servomotor
Angular position feedback
c MotorDrive
Positionsensor
Ball Screw Shaft Nut
CNC S tNC
Direct Control System
Torq
ueom
man
d
CNC System
SPosi
tion
omm
and
M
NCProgram
feedstoollocation
Positionsensor
PartTable
Interpolator
cMotionController
Servomotor
Direct position feedback
P c MotorDrive Ball Screw Shaft Nut
Chapter 10 ME 440 4
Generic CNC SystemGeneric CNC SystemDrive +ut ac
e
CuttingForces
Controle(k) m(k) x(t)x*(k) + m(t) τm(t)Interpolator
Torquecommand(voltage)Po
sitio
nco
mm
and
Drive +Motor Feed Drive
Out
puIn
terf
aControlAlgorithm
e(k) ( )( )
_
( )
Clock
m
T
Motortorque
NCProgram
Sens
ornt
erfa
ce PositionSensor
x(k)
Clock
Carriage's position
SynchronizationSignal
CNC System
S In
• 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 comp tes the desired position ( *) of the• The interpolator computes the desired position (x*) of the carriage at a particular instant in time using the NC program.
Chapter 10 ME 440 5
p g
Generic Control System (Cont’d)Generic Control System (Cont d)• The control algorithm first determines the deviationThe 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 th d i d tthe desired torque.
• Hence, the generated torque (τm) compensates the di t b th f d d i t d t thdisturbance on the feed-drive system and puts the carriage back to its desired course.
Chapter 10 ME 440 6
Computer Controlp
• Each physical quantity (such as position• Each physical quantity (such as position measurement, error, etc.) in CNC system (a.k.a. control computer) is represented by acontrol computer) is represented by a corresponding binary number with a finite length:
Byte / word– Byte / word– Integer, long integer
Floating point number etc– Floating point number etc.• All computations and I/O operations are
h i d b t l ksynchronized by a master clock.
Chapter 10 ME 440 7
Computer Control (Cont’d)p ( )
Inside the comp ter each q antit is alid• Inside the computer, each quantity is valid at only discrete-time intervals: – t = {0, T, 2T, 3T, ..., kT, ...}– T is called sampling period of the computer.T is called sampling period of the computer.
• In discrete-time domain, the time dependence among various quantities ofdependence among various quantities of interest are represented by a time index:
(t kT) (kT) (k) h k 0 1 2– x(t=kT) = x(kT) = x(k) where k = 0, 1, 2, ...– Integer k is called time index.
Chapter 10 ME 440 8
Control AlgorithmControl 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:that of the output:
∑ ∑ −+−−=I J
ji jkebikmakm )()()( ∑ ∑= =i j
ji j1 0
)()()(
ai, bj are the constant coefficients of the equation;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 (Cont’d)Control Algorithm (Cont d)
1 Read *(k) from the interpolator1. Read x (k) from the interpolator.2. Read the position measurement x(k).p ( )3. Calculate the error: e(k) = x*(k) - x(k).4 C t th ti i l4. Compute the correction signal:
m(k)= -a1m(k-1) – a2m(k-2) - ... + b0e(k) + b1e(k-1) +...
5. Send m(k) to the output interface.6 Wait till the end of the period T6. Wait till the end of the period T.7. Go to Step 1.Chapter 10 ME 440 10
Control Algorithm (Cont’d)Control Algorithm (Cont d)
nt al n d nt
asur
emen
te th
en
sign
a
orre
ctio
al the
end
od, T
asur
emen
d th
e m
ea
alcu
lat
rect
ion
put t
he c
sign
a
ait t
ill t
of p
erio
d th
e m
ea
Rea
d Cco
r r
Out
p
Wa o
Rea
d
TimeTime
Chapter 10 ME 440 11
Interpolatorp
• Interpolator is an advanced command generationInterpolator is an advanced command generation algorithm executed by the CNC system.
• By interpreting the codes in the default NC program, the i t l t t th f ll i dinterpolator generates the following commands:– The desired position and velocity of each axis– The desired velocity of spindle (and angular position whereverThe desired velocity of spindle (and angular position wherever
necessary) – The appropriate peripheral unit commands:
• Coolant on / off• Coolant on / off• Spindle on / off• Tool change
Th d i t d ith th ( d) hi l– The commands associated with the (canned) machine cycles.
Chapter 10 ME 440 12
Interpolator (Cont’d)p ( )
• Since the commands are to be fed to the• Since the commands are to be fed to the axis-position control (a.k.a. servo) cycle at
h li i d T t i tieach sampling period T, certain time restrictions are imposed on the interpolation algorithm.
• Furthermore the interpolator has to carry• Furthermore, the interpolator has to carry out complicated trigonometric calculations i l d i th t l di tiinvolved in the tool radius compensation.
Chapter 10 ME 440 13
Interpolation Types
• Three types of interpolations areThree types of interpolations are commonly utilized in CNC technology:– Rectilinear / Linear– Rectilinear / Linear– Circular
Helical– Helical• More advanced interpolation types are
l d i d CNC hi t lalso used in modern CNC machine tools:– Parabolic– NURBS
Chapter 10 ME 440 14
Linear Interpolationp
y
Y G90 G1 Xxf Yyf Zzf Ff • Let us first calculate travel time between these points:yf
f
p
)60/()()()( 222
fzzyyxx
T sfsfsft
−+−+−=
ys
X
)( f
• Hence, number of commands to be generated
xs xfX
zZ
gthrough out this motion becomes
⎫⎧T
zs
zf
f ⎭⎬⎫
⎩⎨⎧=TTN tint
Here int {•} rounds its argument
xs xfX
Here, int { } rounds its argumentto the nearest integer while Tdenotes the sampling time.
Chapter 10 ME 440 15
p g
Linear Interpolation (Cont’d)p ( )• The interpolation equations take the following form:
ykykyxkxkx
Δ+−=
Δ+−=
)1()()1()(
**
**
zkzkz Δ+−= )1()( **
• In these equations, q ,• k = 1, 2, ..., N;• x*(0) = xs; y*(0) = ys; z*(0) = zs
• The constants can be expressed as
zzyyxxNzz
zNyy
yNxx
x sfsfsf −=Δ
−=Δ
−=Δ ;;
Chapter 10 ME 440 16
Circular Interpolationp
The positions at t kT can be(x' y' )Y'
G90 G17 G3 Xxf Yyf Rr FfY
The positions at t = kT can beexpressed as
(x f ,y f)
(x'(k+1),y'(k+1))(x'(k),y'(k))
Y
)sin()(')cos()('
θθ
Δ=Δ=krkykrkxr
f
(x's ,y's)k
The positions at t = (k+1)Tbecome
f sX'O’(xc ,yc)
))1cos(()1(' θΔ+=+ krkxX
222
222 )()( ryyxx cscs =−+−
))1sin(()1(' θΔ+=+ krky222 )()( ryyxx cfcf =−+−
Solving these equations givesthe coordinates of the center (x y )
Chapter 10 ME 440 17
the coordinates of the center (xc,yc).
Circular Interpolation (Cont’d)
)(
Expanding these terms yields
)i ()()()i ()1(')sin()sin()cos()cos()1('
)'()'(
θθθθθθθθ
ΔΔΔΔΔΔ−ΔΔ=+
4847648476 kykx
kkkkrkrkx
)sin()cos()cos()sin()1(')'()'(
θθθθ ΔΔ+ΔΔ=+ 4342143421kxky
krkrky
When these equations are shifted backward in time(k←k-1), we get
)1(')sin()1(')cos()(')1(')sin()1(')cos()('
−Δ+−Δ=−Δ−−Δ=
kxkykykykxkx
θθθθ
with x’(0) = xs – xc and y′(0) = ys – yc.
Chapter 10 ME 440 18
Circular Interpolation (Cont’d)p ( )Note that
Nsf θθ
θ−
=Δ⎭⎬⎫
⎩⎨⎧ −
= ⋅
)(int Tfsfr
Nθθ
N ⎭⎩ 60
⎟⎞
⎜⎛ −⎟
⎞⎜⎛ − −− xxxx cscf 11 θθ ⎟
⎠⎞
⎜⎝⎛=⎟⎟
⎠⎜⎜⎝
= −−
rrcs
scf
f11 coscos θθ
Thus, we have
**cc ykykyxkxkx +=+= )(')(;)(')( **
Chapter 10 ME 440 19
ExamplepY [mm] G90 (ABSOLUTE COORDINATES)
G01 X0 Y0 Z0 F600 (PT 0)50
Samples to be generated
CD
G01 X0 Y0 Z0 F600 (PT 0)X20 Y10 (PT A)X60 (PT B)
v = 600[mm/min]
Y50 (PT C)X20 (PT D)Y10 (PT A)
10A B
X0 Y0 Z0 (GO TO PT 0)M30
X[mm]0 20 60
G90: Absolute Coordinates SpecifiedG01: Linear Interpolation Mode
X, Y, Z: Destination CoordinatesF: Feedrate (velocity in mm/min)
Chapter 10 ME 440 20