Design and implementation of a new type of Hall sensor signal detection and analysis instrument

Publisher:快乐舞动Latest update time:2011-03-09 Source: 维库 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Abstract: Aiming at the defects of the installation process of the Hall sensor in the brushless DC motor, a logic signal detection analyzer based on the virtual instrument architecture is designed and implemented to detect the Hall sensor signal of the motor. The AT89S52 microcontroller is used as the signal collector, and the microcontroller communicates with the PC through the RS232 serial port. The graphical interface designed by VB is used to analyze the collected data.

In brushless DC motor (BLDC) applications, Hall sensors are often used to detect the actual position of the motor rotor to provide a basis for electronic commutation. However, due to manufacturing process limitations, the installation of the Hall sensor may cause physical position deviations, which will cause deviations in the timing of electronic commutation and affect the speed and smoothness of the motor. In order to detect this manufacturing process defect, dedicated motor detection equipment is used in the industry, but these devices are complex in structure, bulky in size, and expensive. Based on the design concept of the virtual instrument architecture, this paper designs a low-cost logic signal detection analyzer to detect the motor Hall sensor signal.

1. System solution

This design uses a cheap 51 single-chip microcomputer as a signal collector. The 51 single-chip microcomputer sends the collected data to the PC through the RS232 serial port, and the PC then records and analyzes the data and draws the waveform. The structure of the hardware part is shown in Figure 1.

By using the P1 port of the 51 single-chip microcomputer as the signal sampling port, 8 logic signals can be collected synchronously, and then the 8 logic levels collected at the same time can be transmitted to the PC as 8 bits of a byte through the RS232 serial port.

Hardware structure diagram

Figure 1 Hardware structure diagram.

2. Software

2.1 MCU part

The AT89S52 microcontroller is a low-power, high-performance CMOS 8-bit microcontroller, which has 8KB online programmable ISP flash memory that can be erased and written 1000 times, 3-level program memory encryption, 256B internal ARM, 32 programmable I/O lines, 3 16-bit timer # counters, 8 interrupt sources, UART serial channel and other features. On the AT89S52 microcontroller, P1 port is used as the sampling port, Timer() is the waiting time timer, and Timer2 is used as the timer for the serial port baud rate. The serial port data communication protocol is: the data transmission rate is 57600b/s, 8 data bits, 1 stop bit, and no parity bit. The serial port communication initialization program is:

When the 51 MCU is powered on, it starts sampling and sending data continuously, which is similar to the "DMA" method on a computer. The main program flow chart of the MCU is shown in Figure 2. The main program code is:




MCU main program flow chart

Figure 2 MCU main program flow chart

Section 2.2

VB is used on the PC to write a program for receiving, storing and analyzing data on the serial port. The design concept of the "virtual instrument architecture" is borrowed, and efforts are made to complete the required test functions by operating the PC-side software, just like operating an electronic instrument defined and designed by oneself.

First, the serial port must be initialized, and the communication characteristics of the MSComm control must be set to be consistent with the 51 microcontroller in order to communicate normally.

After the serial port is initialized, the MSComm control can be used to receive data from the serial port in real time. ONComm is the communication event processing function of the MSComm control. The serial port communication program is:


The above is the serial port data receiving program. After receiving the data, the PC needs to process and display the data. In this system, the collected signal information is intuitively displayed by drawing the data sampling results.

In addition to the above functions, the PC software also has the functions of saving the collected data and reading historical samples.

3. Application Examples

The Hall sensor plays a very important role in the brushless DC motor control system. It is used to detect the position of the rotor pole and provide the correct commutation information for the switching circuit. If the phase of the Hall sensor is deviated, the electronic commutation time will be deviated, affecting the speed and stability of the motor. If the phase of the Hall sensor is missing, the motor phase current will increase and the electromagnetic torque pulsation will increase, and even burn the motor. Therefore, the detection of the Hall phase is very important. In this paper, the designed logic signal detection analyzer is applied to the detection of the motor Hall sensor signal. Its hardware circuit is shown in Figure 3.

Hall sensor signal detection hardware circuit
Figure 3 Hall sensor signal detection hardware circuit

Brushless DC motors (BLDC) generally have three Hall sensors, and the three signals generated by them are sampled by the 51 single-chip microcomputer. The signals are sent to the PC through the RS232 serial port line. The receiving and analysis software running on the PC can analyze and display the collected signals. After connecting the detection circuit, turn the motor rotor by hand, start sampling on the software, and stop after a period of time, and you can get the waveform shown in Figure 4. It can be seen from Figure 4 that when the BLDC rotor rotates, the Hall signal will present a square wave waveform, and the position changes of the three Hall signals can be effectively analyzed through the analysis software function.

Hall signal analysis interface collected on the PC

Figure 4 Hall signal analysis interface collected on the PC

The logic signal detection analyzer designed in this paper based on the virtual instrument architecture gives full play to the role of the single-chip microcomputer and the PC. It can synchronously sample 8-way signals, store and record a large amount of test data, and can effectively analyze and display the test data in graphics. This paper successfully applies it to the detection of motor Hall sensor signals and achieves good results. Due to its simple structure, low cost, wide applicability, and strong expansibility, it can be used in various multi-way signal detection schemes.

Reference address:Design and implementation of a new type of Hall sensor signal detection and analysis instrument

Previous article:Stress concentration principle in the design process of force sensors
Next article:Current output capacitive angle sensor based on AM402

Latest Industrial Control Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号