Improved DDA Algorithm and FPGA Implementation Yi-Xuan WANG a, Quan-Gang WEN b, He YIN c, Zhi-Gang HAO, Xin-Zheng DONG

Similar documents
Study on Gear Chamfering Method based on Vision Measurement

Section 1.1 The Distance and Midpoint Formulas; Graphing Utilities; Introduction to Graphing Equations

5/27/12. Objectives. Plane Curves and Parametric Equations. Sketch the graph of a curve given by a set of parametric equations.

minutes/question 26 minutes

Direction Fields; Euler s Method

The diagram above shows a sketch of the curve C with parametric equations

Proceedings of the Third International DERIVE/TI-92 Conference

GRAPHICS OUTPUT PRIMITIVES

WW Prob Lib1 Math course-section, semester year

P1 REVISION EXERCISE: 1

An Improved Rotary Interpolation Based on FPGA

1) Find. a) b) c) d) e) 2) The function g is defined by the formula. Find the slope of the tangent line at x = 1. a) b) c) e) 3) Find.

Chapter 10 Homework: Parametric Equations and Polar Coordinates

Chapter 6 Some Applications of the Integral

Polar (BC Only) They are necessary to find the derivative of a polar curve in x- and y-coordinates. The derivative

MA 114 Worksheet #17: Average value of a function

10.1 Curves Defined by Parametric Equations

Design of Liquid Level Control System Based on Simulink and PLC

OpenGL Graphics System. 2D Graphics Primitives. Drawing 2D Graphics Primitives. 2D Graphics Primitives. Mathematical 2D Primitives.

Chapter 3. Sukhwinder Singh

Points and lines. x x 1 + y 1. y = mx + b

Linear algebra deals with matrixes: two-dimensional arrays of values. Here s a matrix: [ x + 5y + 7z 9x + 3y + 11z

Output Primitives Lecture: 4. Lecture 4

Area and Volume. where x right and x left are written in terms of y.

RESEARCH ON INTELLIGENT DESIGN AND ACCURATE MODELLING OF SPIRAL BEVEL GEARS BASED ON FUNCTION-TO-FORM MAPPING

Accurate Trajectory Control for Five-Axis Tool-Path Planning

Chapter 2 A Second-Order Algorithm for Curve Parallel Projection on Parametric Surfaces

Properties of a Circle Diagram Source:

Chapter - 2: Geometry and Line Generations

Chapter 8: Applications of Definite Integrals

Qiqihar University, China *Corresponding author. Keywords: Highway tunnel, Variant monitoring, Circle fit, Digital speckle.

ROSE-HULMAN INSTITUTE OF TECHNOLOGY

MATHEMATICS 105 Plane Trigonometry

Calculators ARE NOT Permitted On This Portion Of The Exam 28 Questions - 55 Minutes

f sin the slope of the tangent line is given by f sin f cos cos sin , but it s also given by 2. So solve the DE with initial condition: sin cos

To graph the point (r, θ), simply go out r units along the initial ray, then rotate through the angle θ. The point (1, 5π 6. ) is graphed below:

Research on Measuring and Optimization Method of Dynamic Accuracy of CNC Machine Tools

MATH 31A HOMEWORK 9 (DUE 12/6) PARTS (A) AND (B) SECTION 5.4. f(x) = x + 1 x 2 + 9, F (7) = 0

Implementation Of Harris Corner Matching Based On FPGA

The Acceleration/Deceleration Control Algorithm Based on Trapezoid-Curve Jerk in CNC Machining

You will need to use a calculator for this worksheet A (1, 1)

Quadratic Functions CHAPTER. 1.1 Lots and Projectiles Introduction to Quadratic Functions p. 31

Interpolator. Chapter Introduction

To graph the point (r, θ), simply go out r units along the initial ray, then rotate through the angle θ. The point (1, 5π 6

(Refer Slide Time: 00:03:51)

Goals: Course Unit: Describing Moving Objects Different Ways of Representing Functions Vector-valued Functions, or Parametric Curves

C3 Numerical methods

27. Tangent Planes & Approximations

Computer Graphics D Graphics Algorithms

Each point P in the xy-plane corresponds to an ordered pair (x, y) of real numbers called the coordinates of P.

Conics, Parametric Equations, and Polar Coordinates. Copyright Cengage Learning. All rights reserved.

AP Calculus AB Unit 2 Assessment

? Answer:

PARAMETRIC EQUATIONS AND POLAR COORDINATES

practice: quadratic functions [102 marks]

48. Logistic Growth (BC) Classwork

Chapter 8: Implementation- Clipping and Rasterization

High School Geometry. Correlation of the ALEKS course High School Geometry to the ACT College Readiness Standards for Mathematics

Design of Fault Diagnosis System of FPSO Production Process Based on MSPCA

Conics, Parametric Equations, and Polar Coordinates. Copyright Cengage Learning. All rights reserved.

The scale factor between the blue diamond and the green diamond is, so the ratio of their areas is.

OMNI Interpolator for High-performance Motion Control System Part I: Algorithm of Interpolator

Tópicos de Computação Gráfica Topics in Computer Graphics 10509: Doutoramento em Engenharia Informática. Chap. 2 Rasterization.

Curves, Tangent Planes, and Differentials ( ) Feb. 26, 2012 (Sun) Lecture 9. Partial Derivatives: Signs on Level Curves, Tangent

Volumes of Solids of Revolution Lecture #6 a

The Acceleration/Deceleration Control Algorithm Based on Trapezoid-Curve Jerk in CNC Machining

A small review, Second Midterm, Calculus 3, Prof. Montero 3450: , Fall 2008

GEOMETRY. STATE FINALS MATHEMATICS CONTEST May 1, Consider 3 squares A, B, and C where the perimeter of square A is 2 the

Graphics and Interaction Transformation geometry and homogeneous coordinates

COMP30019 Graphics and Interaction Transformation geometry and homogeneous coordinates

Semester 2 Review Problems will be sectioned by chapters. The chapters will be in the order by which we covered them.

Rasterization: Geometric Primitives

Unit 12 Topics in Analytic Geometry - Classwork

Contour Error Decoupling Compensation for Non-circular Grinding Qi-guang LI 1,a, Qiu-shi HAN 1, Wei-hua LI 2 and Bao-ying PENG 1

MOTION TRAJECTORY PLANNING AND SIMULATION OF 6- DOF MANIPULATOR ARM ROBOT

Design and Implementation of CNC Operator Panel Control Functions Based on CPLD. Huaqun Zhan, Bin Xu

Differentiation. The Derivative and the Tangent Line Problem 10/9/2014. Copyright Cengage Learning. All rights reserved.

Math 5BI: Problem Set 2 The Chain Rule

Math Exam 2a. 1) Take the derivatives of the following. DO NOT SIMPLIFY! 2 c) y = tan(sec2 x) ) b) y= , for x 2.

ASSIGNMENT BETA COVER SHEET

New modeling method of spiral bevel gears with spherical involute based on CATIA

MATH DICTIONARY. Number Sense. Number Families. Operations. Counting (Natural) Numbers The numbers we say when we count. Example: {0, 1, 2, 3, 4 }

sin30 = sin60 = cos30 = cos60 = tan30 = tan60 =

= f (a, b) + (hf x + kf y ) (a,b) +

Indoor Location Algorithm Based on Kalman Filter

Semester 2 Review Problems will be sectioned by chapters. The chapters will be in the order by which we covered them.

MA 243 Calculus III Fall Assignment 1. Reading assignments are found in James Stewart s Calculus (Early Transcendentals)

+ b. From this we can derive the following equations:

x + 1 = 2 Write x as a fraction in the form a, where a and b are positive integers with no common factor other than 1. Pass on the value of b a.

Multivariable Calculus

The Parameters Optimization of Fusion Winglet Based on Orthogonal Experiment Yue LUO 1, *, Qi WANG 1, Qi DU 1 and Hou-An DING 1

Vector Addition. Qty Item Part Number 1 Force Table ME-9447B 1 Mass and Hanger Set ME Carpenter s level 1 String

Year Term Week Chapter Ref Lesson 18.1 Cubic and reciprocal functions. 18 Graphs 2. (Algebra) 18.4 Gradients and areas under graphs

Line Drawing. Foundations of Computer Graphics Torsten Möller

An Improved Algorithm for Image Fractal Dimension

Efficient Plotting Algorithm

volume & surface area of a right circular cone cut by a plane parallel to symmetrical axis (Hyperbolic section)

Parametric and Polar Curves

Chapter 3 Path Optimization

Parametric and Polar Curves

Transcription:

2016 International Conference on Mechanics Design, Manufacturing and Automation (MDM 2016) ISBN: 978-1-60595-354-0 Improved DDA Algorithm and FPGA Implementation Yi-Xuan WANG a, Quan-Gang WEN b, He YIN c, Zhi-Gang HAO, Xin-Zheng DONG Lab building 430, Computer Department, Zhuhai College of Jilin University, Zhuhai, Guangdong, China a yixuan_jessica@hotmail.com, b wen_sir_125@163.com, c 34089689@qq.com Keyword: Interpolation, DDA algorithm, FPGA, Errors analysis. Abstract. In this paper, the basic principle of DDA interpolation algorithm is discussed and an improved algorithm is designed based on errors analysis of DDA algorithm. These two algorithms are simulated on Matlab, testing result shows chord error δ of improved DDA algorithm was reduced by 20% - 50% on interpolation accuracy. Finally the algorithm is implemented on FPGA to test its real-time performance and interpolation speed. Introduction Interpolation was widely accepted in traditional machinery manufacturing decades ago. In engineering and science, one often has a number of data points, obtained by sampling or experimentation, which represent the values of a function for a limited number of values of the independent variable. It is often required to interpolate (i.e. estimate) the value of that function for an intermediate value of the independent variable. This may be achieved by curve fitting or regression analysis [1]. With the popularity of industrial automation and intelligent control, motion control system has become the core technology of universal Industry 4.0, and interpolation algorithm is essential to modern motion control system. Many traditional interpolation algorithms have been proposed by universal researchers, such as point by point comparison method, digital differential analyzer (DDA algorithm), and vector discriminant method. DDA algorithm is an interpolation generation method in computer graphics based on linear differential equation. Not as widely used as point by point comparison method, DDA algorithm has floating calculation and rounding operation which are not easily implemented on hardware. The rest of this paper is organized as follows; basic principle of DDA algorithm is analyzed in the second section; next section proposes some improvements based on error analysis of DDA algorithm; the forth section describes simulation of the algorithm on Matlab and implementation on FPGA. The fifth section is the conclusion. Figure 1. Integral Operation of Function y = f (x).

The Basic Principle of DDA Algorithm Set a function y = f (x), as shown in Fig.1, from the geometry expression, integral operation is the size of the area surrounded by the function curve S, as shown in equation (Eq.1). S ydt S ydt S y y t The size of the area S can be approximate to the sum of many small rectangular areas; the width of rectangles is an independent variable, and the height is the corresponding f (x) on Y-axis(shown as Eq.2). This is so called the rectangular integral method, and the formula is called the rectangle formula. In practical, if we set 1, one pulse quantity, The formula Eq2 can be simplified to Eq3. It shows that integral operation can be transformed into summation operation, if variable is small enough, so as the pulse is small enough, the error of using add operation instead of integral can be restricted within the range of allowable. So we can use a function register, an accumulator register and an adder Q to complete integral operation. Once a pulse signal came, we accumulate the value of (y at current) into accumulator register. If we take the capacity of register as an area unit, every overflow pulse of register in the process of accumulating indicate an area unit obtainment. So the total amount of overflow is as integral area of S. DDA Linear Interpolation Now we extend the former principle to linear interpolation. Set the processing line is OZ, coordinates of start point O is (0, 0) and coordinates of end point Z is (x,y ), shown as Fig. 2. Set length of OZ is L, rate of feeding is v and we obtain x and y coordinates at current time t is: (1) (2) (3) Figure 2. DDA Linear Interpolation. x x t, y y t (4) Differential equation is: x or dx x dt y or dy y dt (5_1) (5_2)

Take v/l as federate K, dx, dy and dt in incremental form x y and t: x K x t y K y t (6) Thus, we can use two function register J J to preserve the value of x and y and two accumulator registers J, J to do the linear interpolation. Take two-dimensional linear interpolation as an example, straight line start at point (0, 0) end at point (7, 5). According to the coordinate difference, take 3 bit register as the accumulator, we got the operation form (Table 1) and plot graph (Fig.3). Assuming that forward toward the end point v (distance) for each pulse t, in other words, uniform motion to the finish point at the speed of v, thus we obtain the following formula: K (7) K is so-called scaling factor. Set the number of step from start to finish is m, we have Eq.8. m*k1,so as K (8) When choosing m and K,m must an integer, we must consider that each increment of x and y must be no more than 1. Maximum value of x and y are limited by register capacity, Assume that n-digit register, the maximum value of x and y is 2-1. To meet the conditions of x and y must be no more than 1, the following formula Eq6 can be deduced. xkx K2 11 yky K2 11 K In general set K. (9_1) (9_2) Calculate counter Table 1. Linear Interpolation Operation. x y (, ) 0(Init) 0 0 1 7 5 0 0 (0,0) 2 14=8+6 10=8+2 1 1 (1,1) 3 13=8+5 7 1 0 (2,1) 4 12=8+4 12=8+4 1 1 (3,2) 5 11=8+3 9=8+1 1 1 (4,3) 6 10=8+2 6 1 0 (5,3) 7 9=8+1 11=8+3 1 1 (6,4) 8 8 8 1 1 (7,5)

Figure 3. Linear Interpolation Plot Graph. Figure 4. DDA Circular Interpolation. DDA Circular Interpolation To generate arc with DDA algorithm works as follows, assuming that arc AB is located in the first quadrant, counterclockwise direction, start at point A(, ), end at point B(, ) and radius is R. Feeding speed along the arc tangent is constant v, which can be resolve into horizontal velocity and vertical velocity at any point N(, ) on arc. The following formula can be derived: v v v sinθ v y v cosθ v x Transform into the following Eq.11. dx y dt or x y t dy x dt or y x t (10_1) (10_2) (11_1) (11_1) Take v/r as federate K, dx dy and dt in incremental form x y and t: x K y t y K x t (12) Similar as linear interpolation, we can use two function register (for value of ) (for value of ) to preserve the value of and and two accumulator registers, to do the linear interpolation. Errors Analysis and Improvements of DDA Interpolation The basic cause of the error of DDA interpolation is step-by-step processing; each inaccurate calculation is producing errors on every step. There are several methods to help us to reduce these errors. Reduce the Pulse Equivalent As the pulse equivalent reduced, the error s geometry size decrease and the number of steps increase synchronously. For instance, line OZ, Fig. 5 display us the difference between

step-size is 1(Left) and step-size is 0.2(Right). Decreasing of pulse equivalent has to increase calculation speed, which is limited by hardware implementation, to obtain the same motion speed. As previously discussed, this method is practical limited by hardware minimum pulse equivalent and calculation speed. a) step-size=1 b) step-size=0.2 Figure 5. Reduce the Pulse Equivalent. Preset Accumulator to 0.5 Capacity The accumulator will overflow only to 2 in the original DDA algorithm. We can obtain error reduction if we preset accumulator to half of its capacity instead of 0 before the accumulation step. The basic idea of preset is just like rounded integer is practically more accurate than floored integer. Take linear interpolation as an example, line OZ ( =8, =2). Interpolation trajectory of original DDA algorithm and preset accumulator shows in figure 6, and latter error significantly reduced. Similar error reduction has been achieved in circular interpolation. a) Original DDA algorithm b) preset accumulator DDA algorithm Figure 6. Preset Accumulator to 0.5 Capacity. Use Secant Instead of Tangent on Circular Interpolation In circular interpolation, using secant instead of tangent could achieve more accurate approximation accordingly improve the interpolation precision. Fig. 7 shows the principle of improved algorithm; Fig. 8 shows first quadrant circular interpolation using tangent approximation and secant approximation.

Figure 7. Principle of Improved DDA Algorithm. Figure 8. Tangent and Secant Approximation. In processing the first quadrant circular arc, radius is R. Current point is, next point in original DDA is. Clearly we can see, deviation of point from circular trajectory is far, the radial error is very large. We could apply the following step to correct direction of feed. (1) Calculate from original DDA algorithm. (2) Calculate coordinates of midpoint B of line. (3) Calculate length L1 form center O to point B. (4) Take O as center, L1 as radius, calculate the unit direction vector at point B on circular arc, which is the BC direction. (5) Calculation unit direction vector of point B in X and Y axes direction (, ) (6) Next point can be calculate by adding, from (, ). Interpolation precision can be improved by 30-40 percent by applying the above improvement in Matlab simulation. But the computational complexity of this method increase 2 times, which might slow down the interpolation speed. Simulation and FPGA Implementation of Improved DDA Interpolation The original DDA algorithm and its improved strategy are simulated in Matlab environment. The simulation results shown in Figure 5,Figure 6 and Figure 8 give us basic concept of accuracy improvements of these strategy. We introduce the chord error δ to measure the accuracy of interpolation algorithms in our test. Chord error δ was reduced by 20% - 50% according to different test cases and related parameters, but we achieve very little increase of interpolation speed. Accuracy is the most important value of interpolation algorithm, and interpolation algorithm is the core value of motion control. Yet its stability and real-time performance practical is crucial after all. To test its real-time performance, our team has implemented on FPGA. Its characteristics of small size, high integration, short development cycle makes it suitable test environment for high speed motion control. The simulation results are shown in Fig. 9, upper one is linear interpolation test case, bottom one is cicular interpolation test case, and program is realized in verilog language.

Figure 9. Algorithm Simulation in Modelsim. Conclusion Based on errors analysis of original DDA algorithm, the improved algorithm proposed in this paper has improved in local accuracy and global accuracy obviously. The improved algorithm is simulated in Matlab and realized in FPGA chip, its real-time performance and stability has been validated in practice. References [1] https://en.wikipedia.org/wiki/interpolation. [2] Zhang Bingxing. Error analysis of DDA circular interpolation and solution [J]. Value Engineering, 2013-02. [3] Li En Lin. Principle of Interpolation [M], Peking: China Machine Press, 1984: 35-39. [4] Zhao Wei. Research on Interpolation Algorithm and Acceleration-Deceleration Controller in CNC System [D]. Tian Jin: Tian Jin University, 2004. [5] Li Fen, Wang Hai-tao. Design of arc interpolation program based on extended DDA[J], Manufacturing Automation, 2012, 34(144-146). [6] Tang, Huifeng. Research and Simulation of Improving Point by Point Comparison Method Circular Arcs Interpolation [J], Microcomputer Information, 2006, 22(5-3).