A Reference-Pulse Generator for Motion Control System

This paper introduces a reference-pulse interpolator motion control system, which can be applied for computer numerical control (CNC) machine tools. The interpolation is calculated in DSP and the independent pulse generator modules are performed in FPGA, which can generate precise reference velocity profile and eliminate the path error of reference pulse interpolation. The proposed methodology has many advantages over existing reference-pulse interpolator controller, such as: real-time, extensibility, high flexibility and high precision motion profile planning.


Introduction
In the last few decades, motion control has developed steadily with the contribution of recent advanced control theories and technologies [1].Along with the intensive applications of motion control, many researches have been conducted to enhance the performance of the motion control system [2]- [4].The development of Field-Programmable Gate Array (FPGA) makes it easy to implement motion control applications due to programmable hard-wired feature, parallel processing architecture, short design cycle, low power consumption and high density [5].Therefore FPGA is conventionally used to develop compact, low-price, high volume, and high performance motion control system [6].However, FPGA-based controller with only hard-wired logic is not flexible and expandable for designing complicated algorithms and structures of motion control system, such as user's defined motion profile, motion blending, advanced closed-loop control algorithms.Therefore, a new motion control hardware architecture was proposed by X. Shao, D. Shun, and J. K. Mills [7] to improve motion performance of high speed robotic manipulators.In this research, a DSP is used for dynamic compensation, trajectory planning, and the control loop is implemented in the FPGA.In [8], a System-on-a Programmable-Chip (SoPC) with an embedded processor is implemented in FPGA to carry out motion profile generation and position control algorithm, while current vector control is performed in FPGA.This technology enables software and hardware co-design to be parallel processing, hence increases the system performance and flexibility [8]- [10].However, all of above combinations are just developed in closed-loop control types.
Open-loop motion controller type generates reference signals, which is generally used for CNC systems such as water-jet cutting, machine tools, laser-beam cutters and welders.The reference signals from the controller can be transmitted as a sequence of reference pulse or as binary word in a sampled-data system [11].The interpolator and signal generators are normally implemented in PC-based system with assembly language in order to save memory data and improve computing speed [11] [12].In this system, the digital differential analyzer (DDA) method [11] [13] or stairs approximation method [12] [14] is used in hardware interpolators.Although the program design of geometric path planning is simple in PC-based control, the restriction of interpolation execution time of PC-based system makes it difficult to expand multi-axis motion system.Moreover, the design of interpolator and pulse generation based on one interrupt clock employed in these methods causes path error and cannot generate constant instantaneous velocity [12].In [12], a simple motion control approach is proposed by using two separate interrupt interval times at each interpolation step to generate constant velocity along geometric path.Although the precision is improved, this method still has error of half basic length unit.
In this paper we propose a new structure to overcome those drawbacks.Firstly, DSP is used to employ complicated calculation of the geometric path planning and motion profile generation.The order of velocity profile can be expanded to reduce jerk and vibration residue.Secondly, the binary velocity data of individual axis obtained from DSP are sent simultaneously to FPGA through Universal Host Port Interface (UHPI) at each sampling clock.A Master-Slave Wisbone interface (MSWI) module is designed in FPGA to communicate with DSP and pulse generator module through a First-In-First-Out (FIFO) memory buffer controller.Pulse generator modules with high speed clock designed in FPGA receive the velocity data from DSP and generate output pulse independently for each axis.The combination of interpolation calculation in DSP and independent pulse generator module in FPGA, along with the synchronous communication hardware structure, makes it possible to design a synchronous motion control system and eliminate the path error of reference pulse interpolation.

Architecture of Synchronous Motion Control System
The reference pulse motion controller generates a sequence of pulses representing position and velocity to be controlled, which is usually based on an iterative technique controlled by an interrupt clock.
In order to overcome the drawbacks of this kind of motion control, we proposed a new synchronous interpolation hardware and software structure, where the motion of each axis is independent with the system clock rate as shown in Figure 1.Consequently, the constant instantaneous velocity along the geometric path is generated and the error of pulse generator is eliminated.The proposed controller is developed based on a high performance DSP and an FPGA.The geometric path planning and motion profile generation are calculated by DSP.At each interrupt clock, the interpolated velocity data of each coordinate are transferred to the pulse generator module through the MSWI.The MSWI module, designed in FPGA includes a Wishbone bus arbitration, a Wishbone master interface, a Wisbone slave interface for internal SRAM memory control, and Wishbone slave interfaces for connecting with the pulse generator module s through a FIFO buffer memory controller.
The FIFO buffer memory controller includes a timer and a shift register control.The signal i_clk and r_clk_full represent the input clock and output for timer, respectively.The frequency of r_clk_full signal is equivalent to the clock interrupt of DSP.This timer ensures the velocity data to be transferred between DSP and pulse generator module of FPGA synchronously.Memory buffer contains velocity data r_data to gradually transfer to the pulse generator module at every sampling clock.Then these velocity data are accumulated in the pulse generator module to generate reference pulse.A shift register in the stack occurs when there exists velocity input data i_wr_data from the host controller and i_time_trigger signal is active.The i_time_trigger signal indicates that the buffer memory is not empty and timer signal i_clk is active.
The bus arbitration in MSWI is used to inter-connect the bus control signals between master and slave module.This structure enables the interpolator velocity data to be transferred from DSP to pulse generator module s simultaneously, and the corresponding pulse outputs generated for all coordinates are synchronous at each interval clock.
Pulse generator module is connected with the Wishbone slave interface through a FIFO buffer memory controller as shown in Figure 2.This design protects the binary velocity data from the host controller to be overflowed.Consequently, the proposed controller is capable of generating synchronous and precise reference pulse signal for motion control system.

Pulse Generator Module
Pulse generator module generates a sequence of signals o_pulse and o_dir representing reference position and moving direction of motion system, respectively.At each sampling time, the binary velocity data i_speed_data are stored in memory buffer for pulse generation process.
Since the pulse signal is equivalent to one basic length unit (BLU), the pulse frequency is proportional to velocity, and the number of pulse is equivalent to the integration of velocity over time unit as in Equation (1): where P denotes the number of reference pulse output, BVU represents the basic velocity unit which is proportional to the frequency f clk of timer signal i_clk, and V is the reference velocity (pulse/sec), f RANGE is the frequency unit defines the input factor for Comparator block.Equation ( 1) can be rewritten in discrete type as: where n is the output of Counter block.
The Counter and Adder block in pulse generator module acts as the velocity integrator.The integrator value

Geometric Path Planning and Motion Profile Generation
Motion planning, including geometric path planning G(p) and motion profile generation p(t), plays an important role in machine control.With the rapid development of microprocessor technology, motion planning becomes flexible to employ [10].In this section, we will discuss about the effective method to design a DSP-based motion planning module that can be applied for reference pulse generator.

Motion Profile Generation
Motion profile is expressed as a parametric function of time p(t), which provides the corresponding desired position and velocity at each instant.S-curve trajectory or seven-segment trajectory is used in motion control system to provide a smooth motion profile by adopting a continuous, linear piece-wise acceleration profile.In this manner, the resulting velocity is composed by linear segment connected by parabolic blends.Since the jerk is characterized by a step profile, the stress load by this motion profile is reduced.The seven main parts of S-curve profile can be determined from the input coordinate motion data, as follows: 1 st , 3 rd , 5 th , and 7 th segments: ( ) where ( ) p t denotes the instant position, 0 p is initial position, max p  is maximum velocity, and max p  is maximum acceleration of geometric path, respectively.

Geometric Path Planning
Generally, geometric path planning including linear interpolation is common applied in industrial manufacture.Geometric path planning generates the reference position ( ) G p and velocity command ( ) for individual coordinate which is used for reference pulse generator.The geometric path can be considered as a parametric vector function which represents the trajectory when the motion profile ( ) p t moves over some interval of coordination as following: Linear interpolant is a straight line between two given points ( ) and ( ) G G , the value Y G along the straight line is calculated from the following equation: The design of linear interpolation function in microprocessor is straightforward.The displacement of linear trajectory can be calculated as following: The interpolated position ( ) and velocity ( ) of reference path can be presented as following: It can be seen from the above calculations, the instantaneous position and velocity data of individual axis can be implemented comprehensively in DSP by some calculations of motion profile generation and geometric path planning process.

Experimental Results
The overall motion control system shown in Figure 3 consists of an embedded motion control board, a host PC to communicate with the board, 4 servo drivers to drive 4 AC motors of gantry mechanical system.In this experiment, only a vertical axis and a horizontal axis are used for linear move.The developed embedded motion control board, showed in Figure 4, includes a high performance DSP TMS320F2812 operating at 150 MHz and an FPGA XC3S1000 that has 1M system gates, 17,280 logic cells, and 391 I/O pins.The summary of the device utilization characteristic for the circuit of the FPGA is given in Table 1.The line driver 75ALS174A is used to convert the reference single-end pulse/dir signal from the FPGA to differential-end signal.The servo driver is set to operate in position mode.A quadrature encoder module (QEM) is designed in FPGA to observe the actual position of mechanical system.The line receiver is used to convert differential-end signal from rotary encoder of motor to single-end signal for QEM.The velocity profile data is send periodically from DSP to FPGA at the sampling clock frequency of 2 KHz.The pulse generator module in FPGA is able to generate pulse at maximum speed of 4 Mpps.The motion control board implemented in this paper can control system with up to 4 axes.
Figure 5 shows the reference pulses of proposed motion control board, which represents the linear interpolation from (0.00 mm, 0.00 mm) to (500.00 mm, 800.00 mm) for the required vector velocity of 400.00 mm/s.The   Meanwhile, due to the combination of interpolation calculation from DSP and independent pulse generator module from FPGA, the instantaneous vector velocity of linear path generated by proposed method can keep a constant value, and the reference path error is 0. The experimental results in Figure 5 shows that the pulses     The experimental results prove the synchronous performance of developed controller applied in an industrial motion system.The flexibility and the open design of the motion board make it easy to develop and configure advanced motion control algorithm.

Conclusion
In this paper, we introduced a new synchronous reference pulse interpolator methodology for motion control system.The combination of proposed interpolation calculation in DSP and independent pulse generator module in FPGA can generate precise reference velocity profile and eliminate the path error of reference pulse interpolation.Therefore the proposed motion controller is applicable in high precision motion control system like CNC machine, planning machine, robot control.
f RANGE factor in the Comparator block.An output pulse o_pulse is toggle when

Figure 3 .
Figure 3. Multiple axis motion control system.

Figure 5 .
Figure 5. Reference pulse of X and Y axis along linear path using proposed controller.

Figure 6 .
Figure 6.Single axis velocity of linear interpolation.

Figure 7 .
Figure 7. Single axis position of linear interpolation.

Figure 8 .
Figure 8. Position of linear interpolation.generated from two axes are uniform and synchronous.The velocity profiles in Figure 6 and the position tracking in Figure 7 validate the calculation of motion profile generation in the DSP.The experimental results prove the synchronous performance of developed controller applied in an industrial motion system.The flexibility and the open design of the motion board make it easy to develop and configure advanced motion control algorithm.

Table 1 .
Device utilization summary.present the velocity profile, position profile and geometric path planning generated by linear interpolation.The actual position and velocity of each axis are gathered by QEM module from servo drivers to compare with the result of proposed reference pulse generators.