Abstract
In order to achieve the requirements of high anti-disturbance and robustness performance for servo system, the acceleration control with disturbance observer is adopted in this paper, where the disturbance observer is used to estimate and compensate the load disturbance. To accomplish the accurate disturbance estimation, higher cut-off frequency of disturbance observer and exact acceleration information are required, where accurate speed estimation is crucial. Thus, a novel velocity acquisition method for servo control system with optical encoder is proposed. At the same time, dynamic error is put forward as a new performance metrics to scientifically explain the dynamic performance of this algorithm. The proposed velocity acquisition method is implemented based on a field programmable gate array. Experimental results show that this novel velocity acquisition method can improve dynamic response performance on the premise of guaranteeing the invariable velocity precision, and at the same time can effectively improve the anti-disturbance and robustness performance of the servo system.
Keywords
Introduction
With the wide usage of servo system in robots, new energy vehicles, CNC machine tools, and other industrial fields, the performance requirements of the servo system are getting higher and higher, where the requirement of fast and robustness of dynamic response is continuously improved. As one of the effective methods of robustness control, acceleration control has been applied in many fields.1–3 In robust acceleration control, disturbance observer (DOB) is usually used to estimate and compensate the external load disturbance.4,5 The accuracy of the disturbance estimation depends on the cutoff frequency of DOB and the accuracy of the obtained acceleration information. In order to set a higher cutoff frequency, shortening the sampling period is an effective method. However, the shorter sampling period usually reduces the resolution of the velocity/acceleration information, which will result in greater errors in the estimation of disturbances.
As the important input information of DOB, accurate and fast velocity acquisition is very important for the performance improvement of DOB and servo system.6–8 Velocity prediction methods with Kalman filter can estimate the velocity precisely.9,10 However, these methods require plant models and the algorithm structure is complicated. Generally, the velocity is often derived from the position obtained by an optical encoder. Due to the limitation of manufacturing process, the number of optical grating is restricted. Therefore, obtaining high-precision velocity information from the location with a limited accuracy has been a hot research spot of the servo drive systems.11,12 There are many results on velocity measurement or estimation by an optical encoder. Among them, two commonly used methods exist: M method and T method. In M method, velocity is estimated by counting the pulses between sampling instances and then performing numerical differentiation on the position signal obtained from an optical encoder. However, in this operation, large deviations may occur at especially low velocities due to quantization effect. In fact, there are some methods implementing low-pass filters after numerical differentiation to eliminate the deviations but they are not sufficient most of the time. As an alternative method commonly referred to as the T method, the number of high-frequency reference clock pulses can be counted between encoder pulses and then taking the inverse of the elapsed time offers very accurate velocity estimation at low-frequency ranges. In Ohmae et al., 13 M/T method is proposed by combining the advantages of M method and T method. The M/T method can obtain high-precision velocity information in the full speed range, and has been widely used in practice. However, the classical M/T method also has some shortcomings, such as the uncertainty of sampling time and the appearance of false pulses and so on. Thus, a variety of improved M/T methods has been proposed to further improve the velocity measurement accuracy both under steady state and dynamic state in the past years.14–16 For example, the N method based on the traditional M algorithm is proposed. 17 This method calculates the speed by sliding the sampling period of the M method in a small amount of time and capturing the position pulse quickly. Therefore, the N method is faster and has a large amount of computation. However, under low-speed range, the measurement accuracy of this method is nonideal. In addition, the S method based on the T method is also proposed,6–8 which is a new speed detection method of speed update and pulse mode synchronization. A concept of “pulse alteration” is defined in this method, and the velocity calculation is synchronized with the “pulse alteration”. S method expands velocity measurement range; but unfortunately this method enlarges velocity update time and decreases the dynamic accuracy.
In order to improve the dynamic response performance of the servo system, a novel velocity measurement method is proposed in this study, which is based on the M/T velocity measurement algorithm and combines the advantages both of N method and S method. The new algorithm is applied to the acceleration control system of permanent magnet synchronous motor (PMSM) with DOB to verify the effect of the algorithm on the robustness of the system. The simulation and experimental results show that the new algorithm can improve the velocity update rate and decrease the dynamic measurement error while keeping unchanged the measurement steady-state accuracy of M/T, where the robustness performance of the servo system is improved obviously.
Acceleration control
Acceleration control based on DOB
DOB, proposed by Ohishi, is an effective way to realize the acceleration control.4 DOB can estimate the variation of the load disturbance torque and parameters. In order to improve the robustness of the system, the error is equivalent to the control input and the corresponding compensation is introduced to achieve the complete suppression of the disturbance. In this section, DOB is used as the acceleration controller to reduce the effect of the disturbance torque as quickly as possible.
The motion equation of the permanent magnet servo system is given as
The block diagram of the reconfigurable acceleration control system with DOB based on equation (3) is shown in Figure 1. DOB is used to convert the estimated load torque to the current compensation, which is introduced to the input of the system. The estimation of the disturbance torque is based on the acceleration signal obtained by two derivative of the position of the encoder, so the DOB essentially realizes the acceleration feedback control.

The block diagram of DOB.
Effect of quantization error on acceleration control
In this section, we mainly describe the influence of the quantization error of the photoelectric encoder to illustrate the importance of accurate velocity measurement in the acceleration control. Equation (4) gives the estimation formula of load torque in practical applications
Theory of the proposed new velocity estimation algorithm
A new performance measurement index
Two basic performance indices of the traditional velocity measurement evaluation system are the absolute velocity resolution Qv and the velocity measuring error rate

The diagram of dynamic measurement error.
For M/T velocity acquisition algorithm, the velocity update cycle is approximately equal to sampling time T0. It estimates the difference between the present position and the position in a previous sampling time, and this value is then divided by the sampling time. Assuming that no errors occur, the value of
From equation (5) it can be seen that Qd is proportional to T0. On one hand, when the sampling time T0 reduces, the dynamic measurement error would decrease, but the steady-state accuracy of the M/T algorithm also reduces. On the other hand, when the sampling time T0 increases, the dynamic measurement error would increase while there is improvement in the steady-state accuracy of the M/T algorithm.
Proposed method
The proposed method is based on the M/T method, and the positions used to estimate the distance are almost the same. The difference between the methods is the measurement time, with the M/T method using T0 and the proposed method using a shorter time interval Tp, which can be seen in Figure 3. This means that the speed of calculation of the proposed method is faster than that of the M/T method. By using a faster calculation, it is possible to obtain many velocity values in the single sampling time used in the M/T method.

Scheme of the proposed method.
The procedure of velocity measurement is shown as follows:
Take a positive integer N (N > 1) dividing the sampling time T0 into N parts. Every part is a short sampling time named as Tp. The relationship between T0 and Tp is described as following
In every short sampling time, the optical encoder pulses Np and clock pulses Mp are counted respectively according to the principle of the M/T method. Take N adjacent short sampling time Tp(j),Tp(j – 1),…,Tp(j – N + 1)(j ≥ N) as a sliding window that is signed as Window(j). The variable j will add one when the sliding window slides once. In each sliding window, the velocity is calculated and updated once.
The measured velocity np(j) is calculated by the following equation. The equations below show the velocity resolution Qv and the dynamic measurement error Qd
The velocity update time of the proposed method reduced by N times compared to that of the M/T measurement method and the dynamic measurement error decreased three times approximately while keeping the steady-state accuracy of M/T algorithm unchanged.
Simulation analyses
Simulation analysis of the performance of the proposed method
The proposed new speed measurement algorithm is realized in FPGA, and the simulation model is built in MATLAB/Simulink. Figure 4 shows the speed response curves of two kinds of algorithm using trapezoidal wave with period of 1 Hz as the speed reference signal, where the value of N is 10. As can be seen from Figure 4, compared with the conventional M/T method, the proposed method in this paper has a better performance, i.e. a smaller speed fluctuation and the shortening of time delay by about 0.5 ms.

Matlab algorithm simulation with trapezoid instruction.
Figures 5 and 6 show the dynamic error performance comparison of two kinds of speed algorithm in different accelerations. On comparison of the two diagrams, it can be seen that the greater the acceleration of the system, the smaller the dynamic error of the new algorithm is, and the higher the response speed. For example, when a= 180 r/min/s2 as seen in Figure 6, the theoretical minimum value of the maximum error of the traditional M/T method is Qd=0.27 r/min/s by means of equation (5). According to equation (9), the theoretical minimum value of the maximum dynamic error of the new algorithm is Qd=0.108 r/min/s. The simulation results are close to the calculated results, which verify the correctness of the simulation algorithm.

Dynamic error when a = 180 rad/s.

Dynamic error when a = 300 rad/s.
Figure 7 shows the speed refresh time curves of the two algorithms at different speeds. The speed refresh time represents the response speed of the algorithm. As can be seen from Figure 8, with the increase of speed, the speed refreshment time of the traditional M/T method appears as a maximum value every 6 r/min, showing a cyclical change and finally approaching 1 ms. While with the increase of speed, the speed refresh time of the proposed new algorithm approaches Ts/N. When the value of N is large, it will approach the theoretical minimum value.

Simulation of the speed refreshment time.

Speed response of the system with DOB.
Simulation analysis of the system performance based on DOB
DOB is an effective way to estimate and compensate the load disturbance. When there exists disturbance in load, the new speed measurement algorithm and the traditional M/T method are respectively used to measure the speed of the system, which then is used as the input information of DOB. And DOB estimates the value of the disturbance torque as a feedforward compensation of torque current, to compensate the load disturbance caused by the fluctuation of speed. Figure 8 shows the speed response curve of the system after the DOB based on the two velocity measurement algorithm added to the control system
In the simulation, the cutoff frequency of DOB is set as 300 rad/s and the speed reference is 200 r/min. In order to verify the disturbance suppression performance of the control system, a sudden load of 2 N·m is added at 0.05 s, and removed at 0.1 s. As can be seen from Figure 8, introduction of the DOB can make the servo system suppress the load disturbance commendably, and the dynamic speed response performance of the servo system based on the proposed new algorithm is better.
Experiment platforms
Implementation of the proposed method using FPGA
In traditional micro control unit (MCU)/digital signal processing (DSP) control systems, the operation of the central processing unit (CPU) is based on the instruction cycle. In the industrial products, the instruction cycle of the speed loop is generally 0.001 s. Velocity acquisition and PI loop control are done within this period. The actual velocity update time in the M/T algorithm is a variable value. For example, if the actual velocity update cycle is slightly larger than the instruction cycle, the controller will step to the next control cycle while the velocity has not been updated. Hence, the controller cannot get the calculated velocity in the current control cycle. So in the traditional industrial products based on MCU/DSP controllers, the M method is commonly used instead of the M/T method to make the controllers stable.
FPGA is different from the traditional controllers with the advantage of parallel processing, which can let this function modules work in assembly line, as shown in Figure 9. Velocity calculation module and the other control modules can work independently. The velocity calculation is not restricted by the controller working cycle.

The comparison of FPGA controller and the traditional controllers.
The proposed velocity measurement algorithm in this thesis is implemented in a Xinlinx-Spartan6-XC6SLX16 FPGA. The velocity calculation module, communication module, and driver module are realized by Verilog programming language. The experiment setup is shown in Figure 10. The AC servo drive works under speed mode, and the velocity instruction is generated by the signal generator. The optical encoder is connected with the servo motor coaxially and the velocity is figured out in FPGA with the information collected from the optical encoder. Then calculation results are transmitted to the upper computer through the serial port.

The experiment setup.
Figure 11 shows the implementation process of the velocity measurement module based on FPGA. By sending these two channels of differential signals A and B to the FPGA through the TI-AM26C32 chip, the moving direction of the optical encoder can be detected according to the phase of signals A and B. Combining the current values and the previous values of the above differential signals to a structure of four-bit binary: {Aq, Bq, An, Bn}, during the process of motor rotation, eight states will be produced: {1011} {1101} {0100} {0010} {1110} {1000} {0001} {0111}. As a result, an encoder of 2500 lines can be identified as a 10,000 lines encoder.

Algorithm implementation process in FPGA.
The high-frequency clock timer is triggered by the edges of the encoder pulses. The encoder pulse counter and the high-frequency clock timer are all in the work state when the time is less than the short sampling time Tp. And they will be reset until a certain trigger that meets the timer’s value over the short sampling time Tp, where the next round of counting begins. At the same time, the data both in the high-frequency clock timer and the encoder pulse counter will be deposited in the FIFO of length N respectively. Meanwhile, the velocity is calculated once using the data both in the two FIFO registers.
Experiment results
In order to verify the robust performance of the control system based on DOB, a test platform is constructed as shown in Figure 12. This platform consists of two main modules: motor speed regulation and FPGA open-loop speed measurement. Where, the motor speed regulation module uses Infineon XMC4500 control chip as the core, the control motor uses the Hitachi 1Kw motor configuring with the, 2500 line of photoelectric encoder, and the load uses the magnetic powder brake for loading experiment.

Test platform of the servo system.
Experimental verification of the proposed algorithm
The signal generator is used for the given analog signal of the servo controller. Figure 13 shows the contrast curve of the traditional M/T method and the new velocity measurement algorithm. As can be seen from Figure 13, the steady-state performance of the new algorithm is more similar to that of the traditional M/T method when the system is running steadily, and the steady-state values are more accurate. When the motor speed changes, the new speed measurement algorithm has obvious advantages like more quickly approaching the real speed of the system, while the traditional M/T method has a delay in the output velocity relative to the real speed of the system.

The contrast curve of the traditional M/T method and the proposed method: (a) sine wave (the cycle of 5Hz); (b) trapezoidal wave (ramp acceleration of 100 r/min/s2).
Experimental verification of system disturbance rejection performance
In order to verify the effectiveness of the control system based on DOB to suppress the external load disturbance, and compare the effects of different velocity measurement algorithms of the system, three groups of experiments were carried out on the experimental platform: (1) the traditional PI control system experiment (M method), as shown in Figure 14; (2) the DOB control system experiment based on the traditional M/T method, the response is shown in Figure 15; (3) the DOB control system experiment based on the new speed measurement algorithm, the response is shown in Figure 16. In the experiment, the bandwidth of the DOB is 500 rad/s and the given speed is 200 r/min. To verify the performance of the system when there is occurrence of disturbance, a sudden load of 2 N·m is added to the system after the speed reaches the steady-state value and removed after a period of time.

(a) Speed and (b) current response curves with the traditional PI control system.

(a) Speed and (b) current response curves of the DOB control system based on M/T method.

(a) Speed and (b) current response curves of the DOB control system based on the proposed method.
In order to compare the effects of the two algorithms on the servo system more clearly, Table 1 shows the comparison of the experimental data from Figures 14 to 16.
Comparison of the experimental data.
From the data of Table 1 can be seen that when the load changes, the speed fluctuation of the traditional PI servo system is very large, especially in the sudden load removing is more obvious, and the speed and current return to stable value for a long time. At this time, the system has a poor anti-disturbance performance. After DOB is added, the speed fluctuation caused by the load disturbance is significantly reduced compared with method 2, method 3, and method 1, and speed and current response time is significantly shortened, showing good disturbance rejection ability. On comparison of method 2 and method 3, it can be seen that the robustness of the control system by using the proposed method is improved obviously, especially in the sudden reduction of load. Speed overshoot reduced from 7.5% to 5.5% and the performance increased by 26.7%. Time to restore the stability of the speed shortened from 1.5 s to 1.1 s, and the performance increased by 26.7%. Time to restore the stability of the current shortened from 0.4 s to 0.3 s, and the performance increased by 25%.
Conclusion
This paper proposed a novel method of velocity acquisition based on the traditional M/T method for servo drive systems with optical encoders. In this proposed velocity measurement method, the positions used to estimate the distance are almost the same while the sampling time of the novel method is reduced N times than that of the M/T measurement method. Hence, this proposed method can not only keep the steady-state accuracy of the M/T method, but also can improve the velocity update speed. In addition, the dynamic measurement error is proposed to evaluate the dynamic accuracy. The dynamic measurement error of the novel method is reduced approximately three times than that of the M/T measurement method. The velocity information obtained by the new algorithm is input to the acceleration control system based on DOB for PMSM, which makes the robustness performance of the system improve obvious. In the experiments carried out in this paper, the performance of the control system based on the new speed measurement algorithm is improved by about 25% than that based on the traditional M/T algorithm.
Footnotes
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This research was financially supported by the national high technology research and development program of China (863 Program) under Grant 2011AA04A105 and Shandong Province Natural Science Foundation under Grant ZR2014EL032.
