{'fraction_non_alphanumeric': 0.02761818365084165, 'fraction_numerical': 0.006954944058058663, 'mean_word_length': 4.539921831379118, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Design of Brushless DC Motor Controller with the Hall Position Sensor

In the paper, the controller uses a MCU (dsPIC30F) to detect the position of the BLDCM by Hall Position Sensor, which can get the corresponding coding value. Each combination of values represents the current position of the BLDCM rotor. When the rotor position changes, the sensor level will change and the MCU will be interrupted. According to the position code, the corresponding power tube is opened or closed to drive the BLDCM. Changing the duty cycle of PWM can control the conduction time of power tube to adjust the BLDCM speed. If the voltage temperature and speed sampling signals exceed the allowed range, the PWM signal will be blocked to protect the controller and the BLDCM.


Introduction
With the development of power electronic technology, BLDCM is a new Mechatronics motor. It not only has the mechanical and regulating characteristics of DC motor, but also has the advantages of convenient maintenance and reliable operation of AC motor. It has been widely used in electronic equipment, industrial drive, control, military and aerospace fields.
BLDCM is basically an inverted DC motor. In general DC motor, the stator is a permanent magnet. There is winding on the rotor, which is electrified. A rotating or moving electric field is generated by reversing the current in the rotor with the commutator and the brush. In contrast, in BLDC motors, the windings are on the stator and the rotor is a permanent magnet. The term "inside and outside inverted DC motor" is thus named. [1] MICROCHIP's digital signal controller is a single-chip embedded controller, which integrates the control function of single-chip microcomputer and the calculation ability of DSP. It has rich peripherals and powerful digital signal processing performance. In addition, the flexible reprogramming ability of C language and low pin package make the digital signal controller an ideal choice in the control field. In this paper, the BLDCM with Hall position sensor is designed as the control object, and the MCU dsPIC30F of MICROCHIP company is used as the control core to realize the control scheme, hardware implementation and software programming of BLDCM. [2]

BLDCM control principle
As shown in Figure 1, the internal winding of BLDCM is a three-phase star. By using six switches-IGBT or MOSFET, the three-phase winding can be driven to high level, low level or no power at all. For example, when one end of the winding is connected to a highend driver, a PWM signal with a variable duty cycle can be applied to the low-end driver. This is the same as adding PWM signal to the high-end drive and connecting the low-end drive to VSS or GND. [3] In order for the rotor to rotate, there must be a rotating electric field. Generally speaking, three-phase BLDC motor has three-phase stator, two of which are connected at the same time to generate rotating electric field. This method is quite easy to realize. However, on the premise of knowing the exact position of the rotor magnet, the stator must be orderly energized in a specific way to prevent the permanent magnet rotor from being locked by the stator.

Determination of BLDCM rotor position
Unlike DC brush motor, BLDCM steering is electronically controlled, and stator windings must be energized in a certain sequence. In order to determine which winding will be energized, it is important to know the position of the rotor. The rotor position is detected by the Hall positon sensors .Three Hall position sensors are embedded in the stator on the nondrive end of most BLDCM. Whenever the rotor poles pass near the sensor, they will send a high or low level signal, which indicates that the north or south poles are passing through the sensor. According to the combination of these three Hall position sensors, the precise position of the commutation can be determined.

Drive control of BLDCM
For a typical three-phase BLDC motor with the sensors, there are six different working sections. Specific two-phase winding is energized in each section. By detecting the Hall position sensors, a 3-bit code can be obtained, and the range of the code value is from 1 to 6. Each code value represents the current range of the rotor. This provides information about which windings need to be energized. Therefore, the program can use a simple lookup table operation to determine which two specific pairs of windings are to be energized to make the rotor rotate. Note that states "0" and "7" are invalid for Hall position sensors.
Using the above techniques flexibly, the Hall position sensor can be connected to the input pin of the MCU dsPIC30F to detect the change. When the input level of these pins changes, the MCU will generate an interrupt to identify the position of the rotor, open the corresponding switch tube to drive the motor. As shown in Figure 2, When the values of Hall position sensor A, sensor B and sensor C are "1", "0" and "1" respectively, the MCU will enable three-phase winding A, B and C to be energized "+V" "-V" and "0" respectively to turn on the switch tube 1H and 2L, and so on, the motor will rotate.

Speed regulation of BLDCM
According to the basic principle of BLDCM, changing the voltage on both ends of motor winding can change the speed of motor, that is to say, changing the duty cycle of PWM signal on the winding of BLDCM can realize the speed regulation of motor. DsPIC30F2010 has six PWM outputs. MCPWM has a special 16 bit TPER (Time Base Period Register), and the PWM frequency can be changed by changing the value of this register. In addition, Changing the duty cycle is achieved by changing the values of the three PDC duty cycle registers.

Hardware design
The controller is designed for the BLDCM with the Hall position sensor. The BLDCM internal winding is connected with three-phase star type. The mode, such as three-phase star full bridge drive circuit, two phase winding energized at the same time, 3-phase 6-state, etc. is widely used in the operation of the BLDCM [5] . Six MCPWM outputs are connected to three pairs of MOSFET Drivers (IR2101S) and finally extended to six MOSFETs (IRFR2407). These MOSFETs are connected to the BLDCM windings in a three-phase bridge. The MOSFET Driver also needs a high voltage (+15V) to operate, so it needs to provide such a high level. The working voltage of the BLDCM is 24V, so the bus voltage of the DC + to DC-is 24V. In addition, it needs to provide + 5V voltage to drive MCU dsPIC30F. The output signals of the 3 Hall position sensors are connected to the input pins of the change notification circuit, which enables the system to generate interrupts while exchanging data. If any of these three pins have a level change, an interrupt will occur. In order to provide speed setting, button switches are provided on RC14 and rc13 to increase and decrease motor speed. When the MCU detects that the current, voltage, temperature, speed and other sampling signals of the power switch are beyond the allowable range, the MCU blocks all PWM signals and plays a protective role in the control system and the BLDCM. [

Software design
The software design of the control system is completed in MPLAB IDE, an integrated development environment of Microchip company. MPLAB IDE has all the advanced editing/ compiling/ debugging functions that 32-bit debugging environment should have. It not only integrates software development functions, but also integrates many hardware development tools, such as software simulator MPLAB SIM, online debugging/ development programmer MPLAB ICD3 [8] .
In this paper, the open-loop control of BLDCM is adopted, the control program is written in C language. The initialization of MCPWM module and A/D conversion module and the configuration of functional pins are completed at the beginning of the program [9] [10] . The program will wait for an activation signal (for example, pressing a button) to indicate the start ( Figure 5). When the button is pressed, the program will read the hall position sensor value. Based on the value, it will take the corresponding value from the table and write it to OVDCON. Then the motor starts to rotate. The initial duty cycle remains at the default value of 50%. However, in the first cycle of the main program, according to the change of the deceleration port value, the value (i.e. the correct given value) is inserted as the duty cycle. This value determines the speed of the motor. The higher the duty cycle is, the faster the motor will turn. The rotor position sensor of the motor, namely Hall position sensor, is connected to the change notification pin of the MCU, which allows CN (change notification) to be interrupted. When the rotor rotates, the position of the rotor magnet changes, and the corresponding pin input level changes (as shown in Figure1), and the interruption will be generated. In the CN interrupt service routine (ISR), the system will read the value of the Hall effect sensor, find the value in a table according to the value, and write it to the OVDCON register ( Figure 5). This operation will ensure that the correct winding is energized in the correct section, allowing the motor to continue to rotate.

Conclusion
In this experiment, a set of controller based on dsPIC30F is designed to drive the BLDCM. The hardware structure is simple, and its cost is lower than that of MCU with the same function. The control program is written in C language. Compared with the special integrated control chip, the complex control strategy and algorithm are easier to be realized by software programming, It is more convenient to control the start and stop, rotation speed, steering and braking operation of the motor, and it has complete protection functions. Therefore, it is an ideal AC speed regulation scheme in the small power speed regulation system. We believe that its application field will be more extensive.