The Design and Implementation of a Spindle Motor Drive

Abstract High speed spindle machines have been widely applied to versatile areas of manufacturing, automotive industry, food industry aviation, commercial and medical technology, such as machine tools, fuel cell, turbo generator, mixers, spin testers, and food processor. For precise control and energy saving of spindle motor, the design and implementation of an efficient electric spindle motor drive becomes an important issue. This paper presents two different switching techniques for inverter design. One is 120° conduction which each transistor turns on for a period of 120° in six switching transistors inverter, and the other is 180° conduction which turns on 180° for a complete cycle. A comparison between two different switching techniques shows the advantages of 180° conduction switching for an inverter design because the utilization voltage of 180° conduction is 115% higher than that of the 120° conduction mode. The complete system design of electric motor drive based on an embedded system for a spindle motor including hardware design and software programming is described and realized in this paper. Finally, a prototype of spindle motor drive using ARM microcontroller is implemented and demonstrated. The performances of both switching techniques are also discussed.


Introduction
The machine tools which process any kind of metal components by cutting, milling, drilling, and grinding, are the basic and necessary production devices for the machinery and mechanical industry. Since the key assembly component of the machine tools is the spindle motor drive [1,2]. The performance of the spindle motor drive will then directly or indirectly affect the quality and precision of the processing metal components. Because most of spindle motor drives are operating in the wide range of load variation. This situation causes the system parameters to change extremely. Therefore, how to reduce the effects of the system parameter fluctuations becomes an important issue for the design and development of a spindle motor drive. Since one of system fluctuations is caused by switching transistors of an inverter [3,4]. In order to reduce parameter variations due to this switching fluctuation and increase the overall performance of a motor drive, the different PWM techniques and timing sequence will be controlled by a proper delay time. Most of switching techniques applied to the motor drives are 120° conduction which conducts only two transistors during any conduction interval and 180° conduction which always has three transistors turn-on for all conduction interval. This paper presents two different switching technologies for inverter design. One is 120° conduction for six switching transistors inverter and the other is 180° conduction for any conducting interval. A comparison between two different switching conduction modes shows the advantages of 180° conduction switching for an inverter design because the utilization voltage of 180° conduction is higher than that of the 120° conduction mode. The complete system design of electric motor drive for a spindle motor including hardware design and software programming are described and realized in this paper. Finally, a prototype of spindle motor drive is implemented and demonstrated.
The system hardware of spindle motor drive based on an embedded ARM (Advanced RISC (Reduced Instruction Set Computer) Machine) microcontroller with other peripheral devices is discussed in Section 2. It includes an AC/DC rectifier, a six switching MOSFETs inverter, voltage and speed sensors, power supplies, machine tool, and ADC converter. The system software in Section 3 is developed under Cortex M4 development environment and written in C language. The firmware of motor drive is programmed based on the Keil integrated development environment tool by Keil company. The experimental results are shown in Section 4. Finally, the advantages and performances for employing both switching techniques are discussed in Section 5.

The System Hardware Structure
The system hardware of a spindle motor drive based on an ARM microcontroller is shown in Figure 1. It consists of an ARM microcontroller LM4F232 series microcontroller, protection circuit, optical coupling isolation, inverter, current sensor, encoder, and communication interface.
The microcontroller LM4F232 manufactured by Texas Instrumentation incorporate is the core controller of the designed motor drive. It has a 32-bit CPU with the capability of digital signal processing. Moreover, it supports many powerful modules such as built-in PWM module, addressable encoder interface module, and input capture module. These specific functions make the design friendly and thus shorten the development schedule.
The three-phase bridge inverter comprises six power MOSFETs for switching as shown in Figure 2. The photocoupler TLP250 manufactured by Toshiba semiconductor company is used for electrical isolation between the microcontroller system and bus voltage. The motor currents are sensed through the current detection circuit. The position of rotor is detected by the speed sensors so that the speed and rotor position can be calculated and precisely controlled, subsequently. The 120° conduction or 180° conduction of pulse width modulation technique for MOSFETs switching is applied to drive the three-phase inverter for performance testing.
The equivalent circuit of an induction motor is shown in Figure 3. The stator phase voltage equations (V as , V bs , V cs ) related to the stator phase currents (i as , i bs , i cs ) and flux linkage (λ as , λ bs , λ cs ) for an induction motor with stator resistance, r s , can be expressed by (1) [4,5].
The rotor phase voltages (V ar , V br , V cr ) related to the rotor phase currents (i ar , i br , i cr ) and rotor resistance, r r , are The flux linkage equations are where The stator-to-stator inductance and rotor-to-rotor inductance are expressed by The mutual inductance between stator windings and rotor windings can be expressed by   L ls : stator leakage inductance for each phase, L ss : stator self inductance, L sm : stator mutual inductance, L rr : rotor self inductance, L rm : stator mutual inductance, L sr : stator to stator mutual inductance.
where P g is permeance of gap and L ss = N 2 s P g , L sr = N s N r P g , L sm = N 2 s P g cos(2 ∕3), L rm = N 2 r P g cos(2 ∕3), L rr = N 2 r P g The electromagnetic torque can be represented as where K t is the torque constant, l dr and l qr represent the rotor flux linkage for d and q axis, respectively. The rotor current in the d and q axis denote as i dr and i qr , respectively. Rearrange (7) for the rotor magnetic field aligned in the d-axis, i.e., l qr = 0, then the electromagnetic torque can be expressed by The electromagnetic torque expressed in (8) indicates that it can be controlled by the stator current with the torque constant, K t . This is very similar to the control of the separate dc motor drive [6]. The load model with mechanical angular speed, ω m , can be expressed in terms of a moment of inertia, J, in kg-m 2 /s 2 with a viscous friction B, in N-m/rad/s. The electromagnetic torque, T e , in N-m then drives the load torque, T L , in N-m, with mechanical angular speed, ω m , as represented in (9) [7,8].
Applying 120° conduction mode of six MOSFETs switching to the inverter in Figure 2, one of the phase voltages can be expressed as [9] (7) T = K t ( dr i qr − qr i dr )  where V dc is the dc link voltage, ω s is the angular speed of phase voltage. The fundamental peak phase voltage is √ 3 V dc . The fundamental rms phase voltage is then equal to One of the phase voltage for 180° conduction is expressed in Fourier series as [9] The fundamental rms phase voltage can be obtained by From (11) and (13), it can be concluded that the utilization voltage of 180° conduction mode is 115% higher than that of 120° switching conduction.

The System Software Design
The system software program is developed under Keil integrated development environment software platform and written in C language. Most of the functions of the spindle motor drive are programmed in the microcontroller firmware which include the circuit protection mechanism, PWM generation, motor currents calculation, rotor position and speed calculation, and rotor pole position [10,11]. The flowchart of main program for microcontroller firmware is shown in Figure 4. The initializations for I/O configuration, Timer 1, Timer 2, Timer 3, ADC and PWM settings are firstly processed at the beginning of the main program. Figure 5 shows the PWM interrupt routine. The sensing current is firstly calculated and fed to the current controller. Since the PWM frequency is 20 kHz, the current controller is updated for every 50 us. After the calculation of current controller, the speed calculation is then performed by speed controller with PID algorithm [12,13]. The speed is constrained by the limiter for the operating speed range.
Most functions of the spindle motor drive are programmed in the microcontroller firmware which includes the circuit protection mechanism, the analog to digital converter, PWM generation, motor currents calculation, rotor position, rotor pole position, as well as transmit and receive of communication interface as shown in Figure 4. The motor speed is obtained from the difference between current counter value and the last counter value which both are acquired from the Timer 2 in capture interrupt service routine. In order to properly control the motor speed, PID control algorithm is employed to respond to the speed command. The current controller uses the same control algorithm. The fundamentals of PID can be referred to [13,14]. The communication between the motor drive and user interface is established by UART interface which is accomplished with the RS232 serial communication standard [10]. The EIA-232 drives/receives of MAX 232, which includes a capacitive voltage generator to supply EIA-232 voltage from a 5-V supply, is used for proper voltage level conversion so that the communication of microcontroller can meet the RS232 standard. The system software for user interface including serial communication program is developed under PC environment and written in C language.

The Experimental Results
The prototype of a spindle motor drive based on the ARM microcontroller with PID control is tested under 120° conduction and 180° conduction switching conditions with different speed ranges. Figure 6 shows the printed circuit board of spindle motor drive designed  in this paper. The complete developing system is shown in Figure 7. In order to facilitate the development of a spindle motor drive, an user interface display panel is designed and realized as shown in Figure 8. The speed and current commands can be given by keying the proper desired values. The real time speed and current then respond and display beneath the bottom bold line on the user interface panel as shown in Figure 8. The spindle motor under test has rated voltage 370 V, rated current 3.75 A, rated power 1.4 kW, rated torque 0.8 Nm, and rated speed 18000 rpm. Figures 9 and 10 show the switching signal of six MOSFETs  switches for 120° conduction with speed at 5200 rpm and 180° conduction at 5255 rpm, respectively. In the condition of 120° conduction, it can be found that each phase conducts only 120° in Figure 9 and is shifted by 120°. The same result for 180° conduction mode except that each phase conducts only 180° is shown in Figure 10. The rated speeds for both 120° and 180° conduction are tested with dc bus voltage of 120 V, as shown in Figures 11 and 12   the solid line, too. Observing both figures, it can be found that under the same duty cycle, 0.998, 180° conduction mode has better speed response than the 120° does.
In order to distinguish the performance of speed response for different switching of MOSFETs, Figures 13 and 14 demonstrate the step speed response profile for both cases, respectively. At the beginning, motor runs at 1000 rpm, after 15 s, steps up to 3000 rpm for 10 s ,and then runs up to 5000 rpm. The motor continuously operates at 5000 rpm for 8 s and after that steps down to 3000 rpm and finally down to 1000 rpm, for 120° and 180° conduction modes, as shown in Figures 13 and 14, respectively. At the beginning of motor start, the system does not employ the PID control algorithm during the first 10 s and this  results in the spike-like speed response shown in both figures. Under the same conditions of speed at 3000 rpm and DC bus voltage of 24 V, the current waveforms for 120° and 180° conduction modes are shown in Figures 15 and 16, respectively. It can be found that the current is 1.109 A for 120° conduction and 0.94 A for that of 180° conduction, as shown in the bottom icon box of user interface panel. In other words, the switching MOSFETs consume less power for 180° conduction mode than that for 120° conduction mode. This result meets with the conclusion of utilization voltages for different switching PWM modes discussed in Section 2.

Conclusions
A spindle motor drive based on an ARM microcontroller is implemented and tested. Speed control can be easily obtained by adjusting the duty ratio of the PWM pulses to control the supply voltage of the motor. Two modes of operation, 180° conduction and 120° conduction switching for inverter design are compared and discussed. From the experimental results, it concludes that the 180° conduction has better utilization of switching transistors. Hence, it provides a higher output voltage than the 120° conduction mode does. Therefore, to design and implement a spindle motor drive, the 180° conduction mode for switching transistors of an inverter is much better choice. This is why it is a commonly used method. This paper also develops a friendly user interface for a spindle motor drive with PC system to reduce the occurrence of improper design of spindle motor drive by real time monitoring. Consequently, it can speed up the development of entire system design. The experimental results demonstrated using the user interface display, have verified the system integrity for system hardware and software design.

Disclosure statement
No potential conflict of interest was reported by the authors.

Funding
The part of this work was supported by the Ministry of Science and Technology of the ROC [grant number MOST 105-2221-E-035-072].