Hardware design of PMSM control system based on DSP

Compared with traditional motor, permanent magnet synchronous motor has the characteristics of strong anti-interference ability, high starting torque and power density, and good speed regulation performance.Permanent magnet synchronous motor servo system has become a research hotspot in the field of servo drive.In this paper, with DSP28335 as the main control chip to give a permanent magnet synchronous motor AC servo control hardware system design scheme, the paper introduces in detail the system core control circuit, main power circuit, detection circuit design and the choice of main components.The hardware system designed has been applied to engineering practice, and has achieved good control effect.


Introduction
Because of its advantages, permanent magnet synchronous motor has been widely used in military, aviation, aerospace and daily life [1].In order to give full play to its superior performance, the hardware design of AC servo control system is very important.With the rapid development of power electronics technology and microprocessor, it is possible to design the hardware system with simple structure, reliable performance and strong anti-jamming ability.In this paper, a set of AC servo control system with DSP28335 as the main control chip is designed for small power permanent magnet synchronous motor.

Overall hardware structure of the system
The overall hardware structure of permanent magnet synchronous motor AC servo control system is shown in Figure 1. The hardware of the system is mainly composed of the core control circuit, the main power circuit and the detection circuit [2]. Considering that the strong electric signal of the main power supply circuit will interfere with the weak electric signal of the core control circuit during the system operation, an optocoupler isolation circuit is designed between the control circuit and the main power supply circuit.

System core control circuit design
3.1. The overall structure of the system core control circuit The core control circuit of the system is mainly composed of main control chip DSP288335, power supply, crystal oscillator circuit, reset, simulation interface, serial communication circuits [3].The power supply circuit provides a stable working power supply to the whole system. The crystal oscillator circuit provides a clock source for the work of the master control chip. The serial communication circuit enables data exchange between the master chip and the host computer. The overall structure of the system core control circuit is shown in Figure 2.

Power supply circuit
Power supply circuit is very important, it directly affects the stability of the whole main control board. Since the core of the main control chip needs 1.8V power supply and the I/O needs 3.3V power supply, therefore, TPS767D318 chip is selected as the core chip of the power supply circuit. When TPS767D318 is running, +5V DC voltage is input to its input end, and 3.3V and 1.8V DC voltage will be output at its output end. To avoid EMI, the analog and digital (ground, power supply) need to be separated and add inductance between them. In order to reflect the working state of the output power supply in real time, a light-emitting diode is connected in series between all the output power supply and the ground as the indicator light of the power supply. The power circuit is shown in Figure 3.

Reset and crystal oscillator circuit
Common reset circuit has three kinds: the system automatically reset after power on, manual reset according to the system operation, automatic reset according to system operation. According to the overall requirements of this design, manual reset is adopted.
The crystal oscillator circuit adopts 30MHz external active crystal oscillator. When the system is working, the phase-locked loop control register of DSP takes its maximum value of 10, at this time, the frequency provided by the external active crystal oscillator will increase from 30MHz to 150MHz, and the main control chip will work at the maximum clock frequency. The reset circuit is shown in Figure  4, and the crystal oscillator circuit is shown in Figure 5.

Simulation interface circuit and Serial communication circuit
Engineers can debug and save the program through the simulation interface circuit. The design of the simulation interface circuit (JTAG) adopts the standard interface of 14 pins and in order to avoid the damage of the interface due to the reverse insertion of the simulator, the 6th pin of the simulation interface circuit is vacant. The emulator interface circuit (JTAG) is shown in Figure 6.In the AC servo control system, starting and stopping the whole system and setting the motor running speed are all carried out on the upper computer, so the communication between the lower computer and the upper computer should be completed by using the serial communication circuit [4].The model of the chip used in the serial communication circuit is MAX3232.Serial communication circuit is shown in Figure 7.

Overall structure of main power circuit
The main power circuit includes rectifier filter circuit, inverter circuit and optocoupler isolation circuit. The rectifying filter circuit is responsible for the conversion between alternating current and direct current to ensure that some modules of the system can use direct current.When the main power circuit is working, the main control chip can produce 6 PWM wave, PWM can Control the switching on or off of power components in the inverter circuit, thus controlling the three-phase stator current of the motor. The overall structure of the main power circuit is shown in Figure 8.

Inverter circuit and rectifier filter circuit
In order to reduce the size of the system, optimize the heat dissipation of the system, reduce power consumption, improve the reliability and anti-interference ability of the system, the intelligent power module IPM is used in the inverter circuit. Intelligent power module IPM integrates controllable power device and its driving circuit, and has protection function, when there is a problem in the process of system operation, the protection function is activated.
The rectifier filter circuit can convert 220V AC voltage into stable DC voltage, so as to ensure the normal operation of the IPM intelligent power module and the core control circuit of the system. The filter circuit consists of four electrolytic capacitors in parallel(450V /330μf).The rectifier filter circuit is shown in Figure9.It should be noted that when the entire servo control system is energized, the electrolytic capacitor will be charged quickly. Due to the large capacity of electrolytic capacitor selected in the system, the rectifier and filter circuit will have very large current passing through, which is likely to damage the rectifier device and electrolytic capacitor. In order to suppress the excessive current in the rectifier filter circuit, two resistors in series (R2, R3) are used in parallel with the thyristor Q1 to ensure the safety of the system operation.

Optocoupling isolation circuit
In the actual operation of the system, the strong electrical signals of the main power circuit often interfere with the weak electrical signals of the control circuit, so the PWM pulse processed by buffering cannot be directly input to IPM. Therefore, this system designed an optocoupler isolation circuit, which effectively avoids interference and can prevent PWM pulse interlocking. The optocoupler isolation circuit is shown in Figure 10.

Current detection circuit
The closed-loop Hall sensor detection method is used in the current detection part of the system. This method has a wide detection range, short response time, small measurement error, and occupies little system space, and the installation method is simple. Hall sensor specific model is CSNE151-100. The current detection circuit is shown in Figure 11.
In order to simplify the design of the system, the current detection circuit only detects the A and B phase stator current of the motor, and the C phase current is calculated by Kirchhoff's law. The detected current signal is an analog signal, and the analog-to-digital conversion must be completed before the signal is sent to the main control chip for processing. It is important to note that there is still some work to be done before the analog-to-digital conversion can begin. Firstly, the current signal detected by the sensor is converted to between -1.5V and +1.5V through the sampling resistor R1, and then the offset voltage of 1.5V is superimposed to obtain the voltage (0V-3V) meeting the A/D input voltage range.  (4) According to the above calculation results, it can be seen that the stator current of the motor can be detected by selecting the appropriate sampling resistor R1 and the connection form of the current sensor.

Position and speed detection circuit
The system uses Kollmorgen's permanent magnet synchronous motor (M-205-B), which is equipped with an incremental photoelectric coding plate to measure rotor speed and position. Photoelectric coding disk output A, B, Z, U, V, W signals. When the motor shaft rotates once, the Z signal outputs a pulse, which represents the initial position of the motor. Signal A and B output 1024 orthogonal pulses with phase difference of 120  , which are used to measure the incremental position of the motor. U, V and W signals output square wave signals when the motor rotates at a uniform speed. The square wave signals differ in phase by 120  from each other, and their period is equal to the time it takes the motor shaft to rotate one circle. When the motor rotates, the initial position of the motor cannot be determined before the emergence of Z signal, so the initial position of the motor is roughly set by U, V and W signals, the error is 30   .Assuming that DSP timer T2 is used to achieve orthogonal coding, then the Angle increment of motor rotation, the motor speed, the mechanical Angle of rotation of the rotor is 2 2 [ ( 1)

Conclusion
In this paper, a hardware system of permanent magnet synchronous motor AC servo control is designed. This paper introduces in detail the design of the core control circuit, the main power circuit and the detection circuit of the main control system, the selection of components and the working principle of some circuits. The hardware circuit gives full play to the superior performance of DSP28335 in the design process. The circuit structure is simple and the degree of anti-jamming is high. The hardware system designed in this paper has been applied to engineering practice, and has achieved good control effect under the cooperation of vector control and fuzzy PI controller, which lays a foundation for the development of higher performance AC servo system of permanent magnet synchronous motor in the future [5].