• No results found

CHAPTER 5: OPPORTUNITIES CREATED BY PERVASIVE MICROPROCESSING

5.5 Interpolator

The interpolator is the main algorithm in the control program. It coordinates the motion of the axes to drive the machine tool along the required trajectories [42]. Figure 50 (b) shows the finite state machine of the interpolator program. A basic interpolation algorithm uses the vector of desired states of the machine (generated by the interpreter from the part-data program) to obtain the tool path as a combination of linear and circular segments. The output of the interpolator can be transmitted to the servo controllers in a sequence either of pulses or as a binary word in a sample data technique [3, 6]. A sample data method for interpolation is typical in modern CNC because it supports higher feeds. However, a reference-pulse interpolation technique was chosen as a first approach of implementation, because of its simplicity and precision.

In reference pulse interpolation, the interpolator generates a sequence of output pulses. The total number of pulses represents the position of the axes, and the frequency of the pulses represents their velocity [55]. This information is transmitted to the servo control of each axis with

113

a direction pin (DIR in Fig. 3) to specify clockwise and counter-clockwise motion and a pulsed signal. Each pulse is equivalent to one basic length-unit (BLU) of the machine. The interpolator in this paper is based on a software digital differential analyzer (DDA) technique. This method uses registers and an external clock to solve the differential equation of motion in real-time and create the interpolating points through successive additions, subtractions and comparisons of integers.

The simplicity of this interpolation algorithm makes it ideal for implementation in C and assembly programming language. A flowchart of the software DDA method with a detailed discussion on the calculation of the size of the registers, their initialization, and the number of iteration required to complete a quarter of a circle is presented in reference [55].

Because in the software DDA interpolation algorithm, the number of iterations is equal to the length of the arc in BLU’s, the frequency of pulses along the path is expected to be constant and equal to the specified federate. This was a determining factor in selecting an interpolation technique for our control architecture.

Figure 51. An interpolation example of a 2D trajectory using linear and circular reference pulse interpolation.

A vector trajectory (a) and its G code approximation (b) are generated in Inkscape [121]. The trajectory is interpolated with reference pulses of 8 kHz and sampled in real time through a serial communication interrupt (c). A

zoom view of interpolated path is shown in (d).

114

In a reference-pulse interpolator, a timer interrupt in the microprocessor controls the execution of the interpolation ISR. A single iteration of the ISR can yield an output pulse (a BLU) or keep track of a fraction of a pulse depending on the frequency of interpolation. At maximum velocity, every iteration of the ISR yields and output pulse and therefore the allowable frequency of interpolation depends on the execution time of the ISR. A common value for the execution time is approximately 100 μs corresponding to a maximum interpolating frequency of 10 KHz. This frequency in a machine with BLU of 10 μm corresponds to a maximum feed rate of 6000 mm/min.

The software DDA interpolation routine, for linear and circular motions, was programmed on the boards Arduino Mega 2560 and Texas Instruments Launchpad C2000. The interpolator interrupt service routine (ISR) has a maximin execution time of 72 μs in the Arduino Mega and 4 μs in the TI Launchpad C2000, this corresponds to maximum interpolating frequencies of 13 kHz and 230 kHz respectively. This speed can be improved by programming the ISR in assembly language.

The DDA interpolation algorithm works inherently for single-quadrant arc segments specified in incremental motion. This is because the values of the velocity registers are proportional to the incremental distance from the tool to the center of rotation, and their rate of change is dependent on the quadrant of motion. To keep the interpolator a real-time processing component, the interpreter (in the executive program) carries the conversion form absolute to relative coordinates and breaks the multiple-quadrant blocks into single quadrant intermediate states before feeding them to the interpolator. To ensure the smoothness of the motion along the specified trajectory, the interpolator program includes a first in first out (FIFO) buffer. Initially, the FIFO buffer is partially filled with a number of desired states. During the execution of the numerical control (NC) program, the head pointer of the buffer is incremented every time a new state arrives from the executive program. In the same way, the tail pointer is incremented upon completion of a machine state by the interpolator. The interpolator requests new states from the executive program whenever the difference between the head and the tail points is below a set value. This guarantees that subsequent machine states are always available to the interpolator without relying on the communications with the executive program.

Figure 51 shows the interpolation of a 2D trajectory with a combined linear and circular DDA algorithm on the Arduino Mega 2560. The graphics software Inkscape [121]was used to trace the vector trajectory from a bit-map image (Fig. 51 (a)) and to generate the G-code approximation

115

(Fig. 51 (b)). The interpreter in the executive program parses the part-data program and feeds the generated machine states to the interpolator. Figure 51 (c) shows the NC trajectory sampled in real time by a serial communication interrupt while interpolating at a frequency of 8 KHz. The ability of accessing and visualizing real-time data of the machine tool trajectories is desirable for the creation of products and manufacturing processes in digital manufacturing environments. Data mining at this level of the controller can be exploited to optimize, configure, embed and operate supply structures.

Related documents