Horizontal well technology is increasingly being applied to the development of oilfield productivity. Today, the horizontal well tractor is a transport tool for logging tools in horizontal well logging technology, which solves the problem that the instrument can’t get to the target layer by gravity. The brushless DC motor (BLDCM) used for horizontal well tractor has large torque ripple in the actual condition, the motor running not smooth, vibration and noise is too large, can not meet the demand. In view of the above reasons, this paper proposes a permanent magnet synchronous motor (PMSM) of horizontal well tractor sine wave drive technology through the research of control algorithm, to improve the dynamic performance of the system   .
Based on the analysis of the mathematical model of PMSM and its vector control principle and the Space Vector Pulse Width Modulation (SVPWM) algorithm   , a PMSM control system based on SVPWM control algorithm is established by using PSIM (Power Simulation), which realizes the speed and current double closed loop space vector control system of PMSM. The simulation results and analysis are given   . The results show that the system has good robustness and the torque ripple of the motor is small, and meets the demand of horizontal well tractors.
2. Mathematical Model of PMSM and Its vector control Principle
The mathematical model of PMSM in the synchronous rotating coordinate system as follows  :
Motor flux linkage equation:
Stator voltage equation:
Equation of motion:
In type: is the flux linkage of axis; is inductance of axis; is current of axis; is flux linkage of permanent; is resistance of stator; is the electrical angular speed and mechanical angular speed of the rotor; is electromagnetic torque; is the number of pole pairs of a motor; is Load torquer; J is moment of inertia; B is friction factor.
According to equations (1)-(3), if can be obtained:
From the above, it can be found that the electromagnetic torque of the motor is determined only by the current of q-axis, which realizes the decoupling of electromagnetic torque of the motor. thus, It can be seen that after adopting the control mode, the permanent magnet synchronous motor is equivalent to a self excitation DC motor, which only needs to control the torque current , and can control the electromagnetic torque, so as to achieve speed control. Figure 1 is the schematic diagram of PMSM Vector Control:
3. Principle of SVPWM algorithm
SVPWM refers to the different combinations of the switching tubes of the bridge arm of the three-phase inverter bridge and outputs different pulse sequences for controlling the inverter to output three-phase sinusoidal voltage or three-phase sinusoidal current. Figure 2 is a schematic diagram of three phase inverter:
Figure 1. Schematic diagram of PMSM vector control.
Figure 2. Schematic diagram of three phase inverter.
It can be seen from the schematic diagram of the three-phase inverter that six switching devices are controlled by six control signals. Each of the upper and lower bridge switching devices can only be turned on and the other one is turned off. Therefore, the inverter has 8 operating states. Corresponding to 8 voltage vectors. Set on the bridge conduction, the lower bridge off as 1, the lower bridge conduction, the bridge off recorded as zero. The formula for the phase voltage can be derived:
indicates the three-phase stator voltage in coordinate system, the in the coordinate system can be got by using the clark transformation:
Distributions of 8 voltage vector such as Figure 3:
From Figure 3, it can be seen that 2 of the 8 basic space voltage vectors are zero vectors, the other 6 non zero vector amplitudes are equal, and the phase difference is 60 degrees, dividing vector space into 6 sectors. According to the parallelogram rule, the 8 basic space vectors can be used to synthesize any voltage vector. SVPWM that does not exceed the maximum amplitude. SVPWM technology is to use these 8 basic spatial vectors to approximate the given reference voltage vectors . In order to meet the requirement of the actual working condition of the horizontal well tractor, the actual flux linkage vector is made to approximate the ideal circle track of the flux linkage and reduce the torque ripple of the motor.
Figure 3. Basic space vector distribution map.
4. Implementation of SVPWM algorithm
4.1. Determine thesector of the Uref
Set up 3 reference quantities:
It can be seen from Figure 3, If , , , 3 lines can be got that reclosing with 6 non zero vectors, thus, According to the relation between 3 reference quantities and the size of 0, the sector of can be determined. Setting up 4 auxiliary variables , if , , otherwise ; if , , otherwise, ; if , , otherwise, :
relation between N and sector following Table 1.
4.2. Determine the time of Action ofadjacent vectors T1, T2
It can be known that is synthesized by two vectors in its sector through principle of SVPWM algorithm. As shown in Figure 3. in the 1 sector, formula is as follows:
In type: T is period of PWM; is time of action of and .
Equation can be obtained by converting reference voltage vector to coordinate system:
Because of , Equation can be obtained:
can be seen from the form (12). For different sectors, relation between and following Table 2.
Table 1. Table of relation between N and sector.
Table 2. Table of relation between and .
4.3. Determine the SVPWM waveform
The SVPWM waveform used in this paper uses a more widely used seven stage synthesis method. Take 1 sectors as an example, in order to divide the action time of each vector into two parts, and divide the time of zero vector action to two zero vectors, we can minimize the number of switches per bridge and effectively reduce the output harmonic content of the inverter. The synthesized vector sequence is like Table 3, and the generated SVPWM waveform is following Figure 4.
The corresponding comparison values can be obtained from Figure 4:
The relationship between the comparison value and in different sectors is following Table 4. It can be known from Figure 4 that the corresponding SVPWM waveform can be obtained after comparing the obtained comparison value with the triangular wave.
4.4. Implementation of SVPWM algorithm in PSIM
PSIM is a computer simulation software dedicated to the design and analysis of power electronic circuits and motor control systems. PSIM has a simplified C block, and users can implement a control algorithm by writing a C language program. The following details are introduced by using PSIM software to implement the SVPWM algorithm through the simplified C Block.
As in Figure 5, the above module uses a total of 4 block. Block 1 calculate based on , block 2 calculate N based on
, block 3 calculate based on , N and the bus voltage obtained through a voltage sensor, block 4 get the corresponding comparison value signal based on and N. Then through the comparison
Figure 4. SVPWM waveform.
Figure 5. SVPWM algorithm module.
Table 3. Vector sequence table.
Table 4. Table of relations between comparison values and ta, tb, tc.
with the triangular wave to form SVPWM signal to control the inverter, in order to achieve SVPWM algorithm.
5. Establishment of PMSM control system
The PMSM control system following Figure 6 is constructed by using the SVPWM algorithm module and the PSIM model library constructed as described above. There are various simulation models of motor and power
Figure 6. PMSM control system.
Table 5. PMSM simulation parameters.
electronic devices in the model reservoir of PSIM, which can facilitate the user to establish the control system.
Shown in figure 6, the three-phase inverter switching devices using IGBT, PMSM simulation parameters in Table 5, the control system uses speed, current double closed-loop PI control, which obtains the output of the electrical angle and speed by absolute encoder and speed sensor.
6. Simulation results and analysis
The control system in this paper: The given DC bus voltage is 300 V. Period of PWM is 50 μs. The motor load torque is 20 N∙m. The simulation time is 0.4 s. The initial given speed of motor is 1700 rpm. At 0.2 s, the given speed changes from 1700 to 2200 rpm. The simulation results are shown in Figures 7-12. It can be seen that the stator three-phase current is very close to the standard sine wave, the speed and torque dynamic response fast, the system quickly into the steady state, closed-loop PI control plays a good role, the motor torque ripple is small, in line with the horizontal well tractor The actual conditions of demand.
Figure 7. Speed waveform diagram.
Figure 8. Torque waveform.
Figure 9. Sector change diagram of Uref.
Figure 10. Stator three-phase current waveform.
Figure 11. Line voltage waveform.
Figure 12. DC bus current.
The subject of the research association of the work of Hubei college laboratory in 2016, project number HBSY2016-25; the research project of colleges and universities’ provincial teaching in Hubei in 2016, project number 2016-258.
 Scarcella, G., Scelba, G., Pulvirenti, M., et al. (2017) Fault-Tolerant Capability of Deadbeat-Direct Torque and Flux Control for Three-Phase PMSM Drives. IEEE Transactions on Industry Applications, 53, 5496-5508.
 Formentini, A., Trentin, A., Marchesoni, M., et al. (2015) Speed Finite Control Set Model Predictive Control of a PMSM Fed by Matrix Converter. IEEE Transactions on Industrial Electronics, 62, 6786-6796.
 Kontarcek, A., Bajec, P., Nemec, M., et al. (2015) Cost-Effective Three-Phase PMSM Drive Tolerant to Open-Phase Fault. IEEE Transactions on Industrial Electronics, 62, 6708-6718.
 Preindl, M. and Bolognani, S. (2013) Model Predictive Direct Torque Control with Finite Control Set for PMSM Drive Systems, Part 1: Maximum Torque per Ampere Operation. IEEE Transactions on Industrial Informatics, 9, 1912-1921.
 Inoue, Y., Morimoto, S. and Sanada, M. (2012) Comparative Study of PMSM Drive Systems Based on Current Control and Direct Torque Control in Flux-Weakening Control Region. IEEE Transactions on Industry Applications, 48, 2382-2389.
 Hu, J.H., Zou, J.B., Xu, F., Li, Y., et al. (2012) An Improved PMSM Rotor Position Sensor Based on Linear Hall Sensors. IEEE Transactions on Magnetics, 48, 3591-3594.
 Zou, J.B., Zhao, B., Xu, Y.X., et al. (2012) A New End Windings Transposition to Reduce Windings Eddy Loss for 2 MW Direct Drive Multi-Unit PMSM. IEEE Transactions on Magnetics, 48, 3323-3326.