Seminar

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 29

Hardware and

Software
Interpolators
V Mohan Raje Urs (CIM - 22MEM3R18)
Venkata Praneet. S(MFG -22MEM2R18)
What exactly is the role of interpolator ?

 Assume a CNC machine is contouring a circular


path. The only input in the code was X and Y co-
ordinates with R (radius) .
 Is it as easy as it seems ?
 CNC tool isn’t a circle drawing compass ?
 A CNC machine generally has more than two controlled
axes to machine complex shapes.
 Two kinds of control can be carried out: The point-to-
point control method is used to move the axis to the
desired position; and the contour control method is used
Introduction to move the axis along an arbitrary curve.
 In order to execute these control methods successfully,
tool movement should be divided into components
corresponding to each axis; the locus of the tool is created
through combining the individual displacements for each
axis.
For example

 For example, if a tool should move from point P1 to P2 at


feed-rate Vf in the XY plane, as shown in, the interpolator
divides the overall movement into individual displacements
along the X- and Y-axes based on the pre-defined feed-rate.
Finally, the velocity command blocks for the two axes are
generated as shown in Fig
Interpolator characteristics ?

The interpolator requires the following characteristics so that it can


generate the displacement and speed successfully for multiple axes
from the part shape and the pre-defined feed-rate.
 The data from the interpolator should be close to the actual part
shape.
 The interpolator should consider the limitation of speed due to
the machine structure and the servo specifications while
calculating velocity.
 The accumulation of interpolation error should be avoided in
order that the final position should coincide as closely as
possible to the position commanded.
Types of interpolators

Hardware Interpolators Software Interpolators


• The hardware interpolator carries out the computation of • With the reduction of the price and size of PCs, a software
interpolation and generates interpolation method has appeared in which interpolation is
pulses by using an electric circuit. carried out using a computer program instead of a logic
• In the hardware interpolator, high-speed execution is possible, arithmetic hardware device.
but it is difficult to adapt new algorithms or modify • Within CNC a micro computer is provided as part of the
algorithms. controller to perform basic NC operations.
• In NC, the computation of interpolation and feed-rate depends • Various algorithms have been introduced for software
on hardware. However, the dependency on hardware has been interpolation such as Software DDA Interpolator, Tustin
gradually decreased because of the introduction of computer Interpolator, Improved Tustin Interpolator.
numerical control (CNC) systems.
DDA Integrator

 The hardware interpolator uses a DDA (digital differential analyzer) based on the
principle of a numerical integration. A DDA is a digital circuit operated as a digital
integrator that is like integration by an OP amplifier in an analog circuit.
 Understanding of the concept of integration should be preceded by knowledge of the
principle of interpolation. Given the velocity function V(t), the displacement S(t) can be
approximated by summing the areas of the thin rectangles beneath the velocity curve as
shown in Fig.
DDA Integrator contd.

 The DDA integrator consists of two n-bit registers. The Q


register is an n-bit binary adder, and the V register is an n-bit
up/down counter.
 The value of the Q register and the value of the V register are
summed up by binary addition. If the value of the Q register is
greater than (2n−1), which is the maximum value of an n-bit
register, overflow occurs and this overflow becomes ΔS, which
is the output of the DDA integrator.
DDA Line Drawing Algorithm

 We know the general equation of line Y = mX + C


 And slope m =
 Now there are three cases of slope variation

m<1 m>1 m=1

• x changes with unit • y changes with unit • x and y both


intervals intervals changes with unit
intervals
Steps In Algorithm

Find the slope and choose the case which its following. (here case1)
We choose the start and the end point. [(x1,y1), (x2,y2)].
Assign - Variable X = x1 and variable Y_true = y1.
Loop till the end point (while(x<=x2)).
Assign y = integer(y_true) or in some algorithms ceiling(y_true).
Generate the new (x,y).
Increment x by 1.
Increment y_true = y_true + 1.
End the loop.
(5,8)

Example
(2,2)
Iteration X Y_true Y Output Pulse X Y
1. 2 2 2 (2,2) 1 ✓ ✓
2. 3 2.5 2 (3,2) 2 ✓ --
3.
4.
4
5
3
3.5
3
3
(4,3)
(5,3)
3
4



--
Iteration
5. 6 4 4 (6,4) 5 ✓ ✓ Table
6. 7 4.5 4 (7,4) 6 ✓ --
7. 8 5 5 (8,5) 7 ✓ ✓
DDA Circle
Drawing
Algorithm
DDA Circle Drawing Algorithm contd.

 The behavior of the circuit for clockwise circular interpolation is shown in Fig.
 Assume that the radius (R) of the circle is 15, the initial value of the vector (i, j) from the start position of the circle
to the center is (R,0), and the length (n) of the register is 4.
 In this case, the value and the output of the registers can be summarized for the iteration period. Because the length
of the registers is set to be n=4, the registers of the DDA for the X- and Y-axes can store 15, maximum.
 Furthermore, because the start position of a circle is (R, 0), the initial value of the V registers of the DDA for the X-
and Y-axes are 15 and 0, respectively.
 In the first iteration, the initial value of the V register of the DDA for the X-axis is added to the Q register. Because
overflow does not occur in the Q register, the DDA for the Y-axis is not changed.
 In the second iteration, the value of the V register of the DDA for the X-axis is added to the Q register. Now,
overflow occurs in the Q register and the value of the Q register becomes 14 (30−16 = 14).
Iteration step DDA for x axis DDA for y
axis
 In the second iteration, the value of the V register of the V Q Δs V Q Δs
DDA for the X-axis is added to the Q register. Now, overflow
occurs in the Q register and the value of the Q register 0. 15 0 -- 0 0 --
becomes 14 (30−16 = 14). 1. 15 15 -- 0 0 --
 Because of the overflow from the X-axis DDA, the V register 2. 15 14 1 1 1 --
of the Y-axis DDA comes to have value 1. By adding the 3. 15 13 1 2 3 --
value of the V register and the value of the Q register, the Q
register comes to have the value 1. 4. 15 12 1 3 6 --
5. 15 11 1 4 10 --
 As this process is repeated, due to the overflow from the
DDA for the X-axis, the V register for the Y-axis is 6. 15 10 1 5 15 --
incremented. On the other hand, due to the overflows from 7. 15 9 1 6 5 1
the DDA for the Y-axis, the V-register of the DDA for the X-
axis is decremented, resulting in circular interpolation. 8. 14 7 1 7 12 --
9. 14 5 1 8 4 1
10. 13 2 1 9 13 --
11. 13 15 -- 9 6 1
Iteration step DDA for x axis DDA for y
axis
Iteration step DDA for x axis DDA for y
axis V Q Δs V Q Δs
V Q Δs V Q Δs
12. 12 11 1 10 0 1
0. 15 0 -- 0 0 -- 13. 11 6 1 11 11 --
1. 15 15 -- 0 0 -- 14. 11 1 1 12 7 1
2. 15 14 1 1 1 -- 15. 10 11 -- 12 3 1
3. 15 13 1 2 3 -- 16. 9 4 1 13 0 1
4. 15 12 1 3 6 -- 17. 8 12 -- 13 13 --
5. 15 11 1 4 10 -- 18. 8 4 1 14 11 1
6. 15 10 1 5 15 -- 19. 7 11 -- 14 9 1
7. 15 9 1 6 5 1 20. 6 1 1 15 18 1
8. 14 7 1 7 12 -- 21. 5 6 -- 15 7 1
9. 14 5 1 8 4 1 22. 4 10 -- 15 6 1
10. 13 2 1 9 13 -- 23. 3 13 -- 15 5 1
11. 13 15 -- 9 6 1 24. 2 15 -- 15 4 1
25. 1 0 -- 15 3 1
Interpolated circle
with the original
circle
SOFTWARE INTERPOLATORS

 Interpolation carried out using a computer


program instead of a logic arithmetic
hardware.
 CNC Classification according to
Interpolation

- Reference pulse

- Reference word / sampled data systems.


 Both will generate reference signal (pulse or
binary word)
Reference pulse System

 The hardware produces a sequence of reference pulses for axis of motion.


 Each pulse generating a motion of one BLU.
 The accumulated number of pulses represents position, and the pulse frequency is
proportional to the axis velocity.
 These pulses can either actuate a stepping motor in an open loop system or be fed as a
reference to a closed-loop system.
 Reference-pulse interpolators execute cyclically with a clock.
Reference pulse
 Software DDA interpolation algorithms originate from the
hardware DDA, and their execution procedure is same as
the behavior of hardware DDA 
 The variable L is a linear displacement and the variables A
and B denote the displacement of the X- and y-axes, and
the initial value of variables Q1 and Q2 is zero.
The initial values of variables are the same as those for
Software DDA linear interpolation, the variable R is the radius of the circle,
Interpolator  Variables P1 and P2 give the center position when the start
point of the circle is the origin of the coordinate system.
 The following is an example of a software DDA
interpolation algorithm, and an example part program is
below. The length unit of the example part program is BLU,
and a speed unit is BLU per second.
 G01 X0.Y10.F10 G02 G90 X10. Y0. I0. J-10. F10
Stairs Approximation Interpolator

 The Stairs Approximation algorithm, termed an incremental


interpolator, determines the direction of the step every BLU interval
and sends the pulse to the related axis

 1. Dk < 0: This case means that the position (Xk,Yk) is located on the
inside of a circle and, in this case, the step moves in the positive
direction of X-axis
 1. Dk < 0: This case means that the position (Xk,Yk) is located on the
inside of a circle and, in this case, the step moves in the positive
direction of X-axis
 Dk = 0: One of the above rules can be arbitrarily selected and applied
Stairs Approximation Interpolator
Reference word / sampled data systems.

 In reference word interpolation systems, the maximum velocity is not limited by the execution speed of the
processor.
 The interpolator routine is more complex.
1st Stage:-
 Input contour is segmented into straight line segment within an allowable tolerance. (rough interpolation)

2nd Stage:-
 Approximating line segments
 The data which is interpolated, and interpolation result send to axis.(fine interpolation)
Sampled data systems- Flowchart
Sampled data
systems for
linear
interpolation
Sampled data
systems for
linear
interpolation
Comparison between the both types

You might also like