You are currently viewing a new version of our website. To view the old version click .
Machines
  • Article
  • Open Access

28 October 2017

Modeling, Analysis, and Realization of Permanent Magnet Synchronous Motor Current Vector Control by MATLAB/Simulink and FPGA

,
and
Department of Electrical Engineering, National Chin-Yi University of Technology, Taichung 41170, Taiwan
*
Author to whom correspondence should be addressed.
This article belongs to the Special Issue High Speed Motors and Drives: Design, Challenges and Applications

Abstract

In this paper, we present the modeling, analysis, and realization of current vector control for a permanent magnet synchronous motor (PMSM) drive using MATLAB/Simulink and a field programmable gate array (FPGA). In AC motor drive systems, most of the current vector controls are realized by digital signal processors (DSPs) because of their complete and compact hardware functions. However, the performances of drive systems realized by low-cost DSP are limited by the hardware structure and computation capacity, which may lead to the difficulty of reaching a fast enough response, above all, for those motors with a small electrical time constant. Therefore, we use FPGA to speed up the calculation about the current vector control to attain a fast response. Simulations and practical experimental results are used to verify the correctness and performance of the designed full hardware system.

1. Introduction

The rapid development of high-performance and low-cost digital signal processors (DSP) has encouraged researchers to design motor drives with DSP. The functionality of a DSP is dependent on the demands for the particular requirements and processing speed. Since motor control using DSP has been widely developed by researchers and industry, IC manufacturers have, thus, designed and produced specific DSPs for motor control, such as the TI TMS320F28 series DSP, Microchip dsPIC, etc. Those motor control schemes with DSPs as the controllers have advantages, such as simple circuitry, software control, and flexibility in adaptation to various motor control requirements and applications. However, it is important to have an inner current control loop with a short time constant in order to obtain a rapid dynamic response on velocity or position control. To this requirement stated above, the calculation time to decide the desired switching pattern with the space vector pulse width modulation (SVPWM) strategy is requested as short as possible. Under this consideration, the inherent properties of DSP with sequential processing and software execution may make the system hardly reach the desired performance on the current loop control with high sampling frequency, e.g., 40 kHz or above, especially for a fixed-point DSP, or the developed algorithm without support by the build-in hardware of DSP. Therefore, a DSP with a floating point processor and high frequency clock is developed and used; however, this carries a high price.
Current feedback can be accomplished by Hall sensors or resistors, and sometimes the analog sinusoidal signal is processed by a low pass filter to remove the components, including those from modulation. However, phase lag and amplitude attenuation of the winding current from the Hall sensor and the low pass filter should be taken into consideration when the system is operated at high sampling frequency, which is closed to the bandwidth of Hall current sensor or low pass filter.
MATLAB/Simulink, produced by the MathWorks, Inc., is often used to the analysis and simulation for control purpose, and the controller design of modern power electronics and motor drive systems by field programmable gate arrays (FPGAs) has become more and more important. Thus, MATLAB/Simulink has been used as an alternative method to automatically generate a readable and portable IEEE standards compliant hardware description language (HDL) to realize the desired system which is generally and formerly built by DSP [1]. System design with MATLAB/Simulink makes complicated design easier. The designers can easily build and simulate their hardware control system by solving the conventional control problem with MATLAB/Simulink. Of course, some, or even many, modifications are needed to realize the developed hardware systems on a selective FPGA. However, for researchers, the hardware circuit design starting from MATLAB/Simulink is another choice to shorten the developing time.
An FPGA is fully customizable, allowing a completely flexible design which is custom-made for the particular type of control technology. Furthermore, an FPGA is field programmable, and further functionalities can be added anytime and anywhere when they are necessary [2]. FPGA-based digital controllers have, thus, been implemented successfully in motor drives, such as induction motors (IMs) [3], permanent magnet synchronous motors (PMSMs) [4,5,6,7], stepping motors [8], brushless DC motors [9], and switched reluctance motors [2]. Additionally, FPGAs are also used in the implementations of controllers, such as PID controllers [10], fuzzy controllers [4,11], tracking controllers [8], and for the realization of SVPWM modules [6].
In this study, the procedure of designing an FPGA-based current vector control for a PMSM drive system is demonstrated. The requirements of the design include the fast winding current responses, the realizable intellectual property (IP) for vector control, and the complete interfaces and peripherals. At first, the system is designed via MATLAB/Simulink on the system level, simulated by ModelSim, produced by Mentor Graphics Corporation, to evaluate the correctness, and converted into the Verilog HDL code as a vector control IP. Next, some modifications are made for the developed IP systems in order to be realizable by the specific selected FPGA. To finish the design of the hardware system, the interfaces for an analog to digital converter (ADC), digital to analog converter (DAC), serial/parallel converter, quadrature encoder pulse (QEP) counter, SVPWM module, and digital filter for speed moving average and for encoder signals are included in the design. Finally, the designed overall hardware circuits are applied to the PMSM drive system to practically evaluate the performances of the FPGA-based system by showing the sinusoidal steady-state response.
This paper is organized as follows. In Section 2, the mathematical descriptions regarding the electrical circuit of PMSM motor are given. The simulated and experimental systems designed and created by MATLAB/Simulink are shown in Section 3. In Section 4, the simulated results based on the system created in Section 3, and the experimental results based on the FPGA, power module, and PMSM motor are demonstrated. Finally, the conclusions are given in Section 5.

2. The Electrical Model of Permanent Magnet Synchronous Motor

The typical mathematical model of a PMSM is described in the dq-axis synchronous rotating reference frame as follows [4]:
d i d d t = R s L d i d + ω e L q L d i q + 1 L d v d
d i q d t = R s L q i q ω e L d L q i d + 1 L q v q ω e λ f L q
where v d and v q are the d- and q-axis voltages; i d and i q are the d- and q-axis currents; R s is the phase winding resistance; L d and L q are the d- and q-axis inductances, and L d = L q = L s ; ω e is the rotating speed of magnet flux; and λ f is the permanent magnet flux linkage.
Generally, the current control of PMSM is based on the vector control approach, and the generated torque, T e , can be represented as:
T e = 3 P 4 λ f i q = Δ K t i q
where P is the pole number, and K t = 3 P 4 λ f is the torque constant. (3) shows that the generated torque is proportional to the q-axis current under decoupling control.

4. Simulation, Experiment, and Discussion

Simulation and experiment are both done to show the performance of the designed hardware control system. The characteristics of the PMSM motor are shown in Table 1. The number of poles is 10; the stator resistance and inductance are, respectively, 3.5 Ω and 13 mH [12]. The electrical time constant is about 3.71 ms . A closed-loop control with PI controller as the kernel is used to compensate the system, and the expected closed-loop bandwidth is equal to, or greater than, 1 kHz. To reach the goals, the K p of the speed PI controller is first designed according to Equation (13), and chosen as K p = 100 for this system. The bandwidth of the equivalent current loop system is f 3 dB = 2500 Hz. The parameters of PI controller are K p = 100 and K i = 0.002 , the sampling frequency is set as f s = 20   kHz , which is eight times the desired system bandwidth, and this fits the criterion of digital signal processing. With the above-mentioned parameters, we have the equivalent system:
I q I q * 15385 s + 15654
Table 1. The parameters of PMSM motor (FRLS 4020506A).
The corresponding frequency response of Equation (14) is shown in Figure 8 with MATLAB, and the bandwidth is about 2.5 kHz, which is greater than the desired 1 kHz. As stated in the last section, Equation (12) is a band-pass system, and the frequency response is shown in Figure 9. It is noted that, in the region of low frequency, the response of Figure 8 is different from the one of Figure 9. Nevertheless, the system is operated at f s = 20   kHz , which is far away from the lower 3 dB frequency, which is about 5 × 10 5 rad/s, and the responses for both systems are very similar.
Figure 8. The frequency response of Equation (14).
Figure 9. The frequency response of Equation (12).
The waveform of the command is from a previously-built discrete-type sinusoidal signal, which is programmed and stored in the memory of the FPGA, and all the data are 32-bit numbers. The FPGA used to implement the system is made with an Altera Corp. model Cyclone III EP3C10E144C8. Since the main objects are focused on the inner current closed-loop control to yield a fast response with the dedicated system by SVPWM, the results regarding the current loop of the q-axis are the main components to be shown.

4.1. The Simulation Results

The simulation is first performed on the MATLAB/Simulink platform. Figure 10 and Figure 11 are the simulation results with the control block diagram as shown in Figure 1. To prevent saturation of the PI controller and the PMSM drive, the amplitude of current command is set to 1 A. In the following, the results for the commands at 100 Hz and 1 kHz sinusoidal input are demonstrated, respectively. Figure 10 shows the results at 100 Hz, where i q c m d and i d c m d are, respectively, the 100 Hz sinusoidal command inputs, and i q f b and i d f b are the current feedbacks. The responses and commands of the two figures are very close to each other. In Figure 10a, there is only a small DC offset between the two traces, and in Figure 10b, the d-axis current is very small, except for the transient duration at start. Furthermore, we set 1 kHz sinusoidal commands as the input, and the current amplitude is also approximately 1 A. Figure 11 is the simulated results. As the points marked on Figure 11a of the q-axis response, the time delay is 0.00115 – 0.001108 = 0.000042 s; it is equivalent to a phase lag 15.12 . Additionally, the difference of the amplitude between i q c m d and i q f b is very small. Since the phase delay is less than 45 , and nearly no amplitude drops off, the q-axis equivalent circuit under feedback control, thus, has a bandwidth greater than 1 kHz. Figure 11b shows that the d-axis current is still small, except for the transient duration shown in the results of Figure 10b.
Figure 10. The simulated result with 100 Hz sinusoidal command. (a) q-axis current command and response; and (b) d-axis current command and response.
Figure 11. The simulated result with 1 kHz sinusoidal command. (a) q-axis current command and feedback; and (b) d-axis current command and feedback.

4.2. The Experimental Setup and Results

The hardware setup for the implementation of the experiment is shown in Figure 12. It includes an Altera FPGA-based control board, a 12-bit serial ADC and serial DAC board, power module board, brake, and PMSM. Analog currents of phase A and B are sensed by resistors on the power module board without filtering, and are converted into digital values by serial ADCs, AD7866, with unipolar multi-channel voltage input. The ADCs are operated at a 250 kHz sampling frequency, it feeds back the digital values of the winding currents to the controllers in the FPGA by way of the serial to parallel interface. Additionally, the DACs are used to convert the discrete-type control variables (currents of i q * and i q ) into analog waveforms with the transfer gain of 0.5 V/A, and shown on the digital oscilloscope. Finally, we copy the waveforms on the oscilloscope and plot them in MATLAB. Furthermore, the PMSM motor is shaft-connected to a brake, and rotor is locked by the brake when operating with high-frequency command input.
Figure 12. The setup of the experimental system.
The current commands used in the simulation are also used for the experiment, and only the results of the q-axis currents are shown. Figure 13 shows the result with an amplitude of 1   A and a frequency of 100 Hz. It shows that the designed response nearly matches the command without phase delay and amplitude attenuation, i.e., it has good tracking when it is operated at 100 Hz. It is worth noticing that the trigger time of Figure 13 is set at the center of the screen due to the fact that the data in the figure is from the digital oscilloscope. Figure 14 is the result with command 1 kHz. Two points, (−0.00005–0.004) and (−0.00002–0.004), are chosen to evaluate the phase delay and the corresponding result is 10.8 . This shows that the response has only a slight drop-off in amplitude and a small phase delay compared to the command. Upon comparing the simulated and experimental results, it is also found that they are quite similar to each other. Finally, the experimental results show that the hardware system has attained the expected performance with a bandwidth greater than 1 kHz.
Figure 13. The experimental result with a 100 Hz sinusoidal input.
Figure 14. The experimental result with a 1 kHz sinusoidal input.

5. Conclusions

In this paper, we have shown the analysis and hardware current loop controller design with FPGA for a PMSM driver. The design considers the executing and computation delay of the hardware system. The developing procedure starts from the system design with MATLAB/Simulink, and the built model is verified by Modelsim. Moreover, the resulting Verilog HDL codes are modified to fit the selected FPGA. Finally, the developed system is realized on an Altera Cyclone III FPGA, and evaluated by the PMSM drive system. The simulated and practical experimental results show that the developed current loop vector control system with MATLAB/Simulink has been successfully realized, and also reveals a high dynamic response. The bandwidth is greater than 1 kHz. The setup system also successfully operates the current system reaching to 2 kHz as shown in Figure 15, where the response has a phase delay is approximately 57.6 .
Figure 15. The experimental result with a 2 kHz sinusoidal command.
The digital hardware circuits for the controller design are complicated when they are developed directly from the electronic design automation (EDA) system. On the other hand, when the design is started from platforms like MATLAB/Simulink, LabVIEW, or other similar tools, they make the design easy. Of course, it is necessary to optimize the created hardware circuit to make it an usable IP.

Author Contributions

Chiu-Keng Lai and Yao-Ting Tsao conceived and designed the experiments; Yao-Ting Tsao and Chia-Che Tsai performed the experiments; Chiu-Keng Lai, Yao-Ting Tsao, and Chia-Che Tsai analyzed the data; and Chiu-Keng Lai and Yao-Ting Tsao wrote the paper.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Siwakoti, Y.P.; Town, G.E. Design of FPGA-Controlled Power Electronics and Drives Using MATLAB Simulink. In Proceedings of the IEEE/ECCE, Melbourne, VIC, Australia, 3–6 June 2013; pp. 571–577. [Google Scholar] [CrossRef]
  2. Stumpf, A.; Elton, D.; Devlin, J.; Lovatt, H. Benefits of an FPGA based SRM controller. In Proceedings of the IEEE 9th Conference on Industrial Electronics and Applications (ICIEA), Hangzhou, China, 9–11 June 2014; pp. 12–17. [Google Scholar]
  3. Rohit, B.C.; Patil, M.D.; Shah, D.; Kadam, A. FPGA Implementation of SVPWM Control Technique for Three Phase Induction Motor Drive Using Fixed Point Realization. In Proceedings of the 2014 International Conference on Circuits, Systems, Communication and Information Technology Applications, Mumbai, Maharashtra, India, 4–5 April 2014; pp. 93–98. [Google Scholar]
  4. Kung, Y.-S.; Tsai, M.-H. FPGA-Based Speed Control IC for PMSM Drive with Adaptive Fuzzy Control. IEEE Trans. Power Electron. 2007, 22, 2476–2486. [Google Scholar] [CrossRef]
  5. Kung, Y.-S.; Huang, P.-G.; Chen, C.-W. Development of a SOPC for PMSM Drives. In Proceedings of the 47th IEEE International Midwest Symposium on Circuits and Systems, Hiroshima, Japan, 25–28 July 2004; pp. 329–332. [Google Scholar]
  6. Quynh, N.V.; Kung, Y.-S. FPGA-Realization of Fuzzy Speed Controller for PMSM Drives without Position Sensor. In Proceedings of the ICCAIS, Nha Trang, Vietnam, 25–28 November 2013; pp. 278–282. [Google Scholar] [CrossRef]
  7. Zhang, G.Z.; Zhao, F.; Wang, Y.X.; Wen, X.H.; Cong, W. Analysis and Optimization of Current Regulator Time Delay in Permanent Magnet Synchronous Motor Drive System. In Proceedings of the 2013 International Conference on Electrical Machines and Systems, Busan, Korea, 26–29 October 2013; pp. 2286–2290. [Google Scholar]
  8. Zhang, C.J.; Wu, X.J.; Zuo, X.Y. FPGA Soft-Core Based Step Motor Driving. In Proceedings of the 2010 International Conference on Electrical and Control Engineering, Wuhan, China, 25–27 June 2010; pp. 1035–1038. [Google Scholar]
  9. Horvat, R.; Jezernik, K.; Curkovic, M. An Event-Driven Approach to the Current Control of a BLDC Motor Using FPGA. IEEE Trans. Ind. Electron. 2014, 61, 3719–3726. [Google Scholar] [CrossRef]
  10. Kocur, M.; Kozak, S.; Dvorscak, B. Design and Implementation of FPGA-Digital Based PID Controller. In Proceedings of the 15th International Carpathian Control Conference, Velke Karlovice, Czech Republic, 28–30 May 2014; pp. 233–236. [Google Scholar]
  11. Quang, N.K.; Kung, Y.-S.; Ha, Q.P. FPGA-Based Control Architecture Integration for Multiple-Axis Tracking Motion Systems. In Proceedings of the IEEE/SICE, Kyoto, Japan, 20–22 December 2011; pp. 591–596. [Google Scholar] [CrossRef]
  12. Data sheet of FRLS4020506A. Available online: https://www.hiwin.de/en/Produktfinder_Detail_2/Motors_Drives_and_Accessories/Servo_motors/Without_motor_brakeand_feather_key/20373 (accessed on 23 October 2017).

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.