The pulse generator based on Hall element designed in this scheme requires low cost, simple structure and good performance. There is a relatively harsh electromagnetic environment in the electrical control system, so the product itself is required to have strong anti-interference ability. The system is mainly composed of AT89S52 single-chip processing system, motor, sensor detection unit, signal processing unit and display system.
1 Overall design
The measurement of rotation speed is actually the measurement of the frequency of the periodic pulse signal caused by the rotation of the rotor. The Hall element speed measurement method uses the Hall switch element to measure the rotation speed.
The Hall switch element contains a voltage regulator circuit, a Hall potential generator, an amplifier, a Schmitt trigger and an output circuit. The output level is compatible with the TTL level. A disk is installed on the motor shaft, and several pairs of small magnets are installed on the disk. The more small magnets, the higher the resolution. The Hall switch is fixed near the small magnets. When the motor rotates, every time a small magnet passes the Hall switch, the Hall switch outputs a pulse. The number of pulses per unit time can be calculated to determine the speed of the rotating body. The system block diagram is shown in Figure 1.
2 System Hardware Circuit Design
The system includes Hall sensor, isolation and shaping circuit, main CPU, display circuit, alarm circuit and power supply. The measurement process is that the Hall sensor for measuring the rotation speed is coaxially connected to the motor shaft. Each time the shaft rotates one circle, a certain number of pulses are generated, which are output by the Hall device circuit, isolated and shaped, and sent to the single-chip microcomputer for processing. After receiving the signal, the single-chip microcomputer processes the value data and displays it on the LCD display.
Once the speed exceeds the limit, the CPU will sound an alarm through the buzzer.
2.1 Sensor Selection
The first step to measure the motor speed is to express the motor speed as a pulse signal that can be recognized by the microcontroller, so as to count the pulses. The use of Hall devices to detect pulse signals has the advantages of strong structure, small size, light weight, long life, and easy installation. When the motor rotates, it drives the sensor to move and generate a pulse signal of the corresponding frequency. After signal processing, it is output to a counter or other pulse counting device to measure the speed.
2.2 Microprocessor Selection
In order to reduce the size and power consumption, the commonly used and economical AT89S52 microcontroller is used: AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller with 8K in-system programmable memory. Its minimum system includes the AT89S52 microcontroller interface circuit, crystal oscillator circuit, and reset circuit. See Figure 2.
2.3 Counters and Timers
The advantage of using the on-chip counter is that it reduces the cost of the single-chip microcomputer system. Each pulse will generate a T1 count. After the 100ms interrupt generated by T0 is completed, the number of T1 interrupt overflows is the number of pulses that need to be counted. The counting part of the system uses the on-chip counter. The timer part can be generated by the on-chip always signal.
2.4 Signal Processing Circuit
The Hall sensor is used to measure the rotation speed. The detected signal is a pulse, so there is no need for analog-to-digital conversion. After the signal passes through the sensor, the noise is filtered out and it can be directly connected to the microcontroller for counting processing. Since it is a digital pulse signal, two reverse operations are used during filtering to achieve the purpose of isolation and shaping. The hardware connection is shown in Figure 3. Among them, 74LS14 is a six-bit inverter.
2.5 System Design Block Diagram
During actual measurement, the Hall sensor should be fixed on the bottom plate of the DC tachometer motor. A magnetic steel block is fixed on the shaft of the motor opposite to the Hall probe. The Hall sensor sends a pulse signal every time the motor rotates one circle, as shown in Figure 4.
3. Detection system software design
There are 4 basic steps to measure the motor speed: 1 is the control method; 2 is to determine the counting method; 3 is the signal input method; 4 is to read the count value. The measurement process is that the Hall sensor for measuring the speed is coaxially connected to the motor shaft. Every time the shaft rotates one circle, a certain number of pulses are generated, which are output by the Hall device circuit. After passing through the isolation shaping circuit, it becomes the counting pulse of the revolution counter. By controlling the counting time, the count value of the counter can correspond to the speed value of the shaft. The main CPU processes the value data and displays it on the LCD display. 3.1 Main program flowchart
First, initialize and set the initial value of each timer, and then determine whether to start the system for measurement. After starting the system, when the Hall sensor detects the arrival of the pulse, start the external interrupt, interrupt once for each pulse, and record the number of pulses. At the same time, start the T0 timer, interrupt once every 1 second, read the recorded number of pulses, that is, the motor speed. Sampling three times in a row, take the average value and record it as a speed value. Then judge the value. If the value is higher than 5000r/s, alarm and return to the initialization stage, otherwise, normal speed LCD display will be performed. As shown in Figure 5.
3.2 Interrupt Service Routine
In the interrupt service program stage, firstly, the interrupt is disabled. Then, the value of the pulse count is read. Then, T0 is initialized and the interrupt is disabled. Finally, the interrupt is returned.
3.2.1 External counting interrupt
3.2.2 Timer interrupt flow chart
4 Conclusion
This paper introduces a design scheme of motor speed measurement system based on single chip microcomputer, which overcomes the shortcomings of traditional measurement methods and can realize accurate measurement of motor speed in different sections. The speed measurement system has the advantages of fast measurement speed and high measurement accuracy. After signal conditioning, the output signal of the Hall sensor is counted by the single chip microcomputer to realize speed measurement, which makes full use of the internal resources of the single chip microcomputer and has a high cost performance. Facts have proved that this system can be applied in general speed detection and control.
Previous article:Design and implementation of online update mechanism based on CAN bus
Next article:Design and implementation of a general purpose digital frequency divider based on FPGA
- Popular Resources
- Popular amplifiers
- MathWorks and NXP Collaborate to Launch Model-Based Design Toolbox for Battery Management Systems
- STMicroelectronics' advanced galvanically isolated gate driver STGAP3S provides flexible protection for IGBTs and SiC MOSFETs
- New diaphragm-free solid-state lithium battery technology is launched: the distance between the positive and negative electrodes is less than 0.000001 meters
- [“Source” Observe the Autumn Series] Application and testing of the next generation of semiconductor gallium oxide device photodetectors
- 采用自主设计封装,绝缘电阻显著提高!ROHM开发出更高电压xEV系统的SiC肖特基势垒二极管
- Will GaN replace SiC? PI's disruptive 1700V InnoMux2 is here to demonstrate
- From Isolation to the Third and a Half Generation: Understanding Naxinwei's Gate Driver IC in One Article
- The appeal of 48 V technology: importance, benefits and key factors in system-level applications
- Important breakthrough in recycling of used lithium-ion batteries
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Download from the Internet--ARM Getting Started Notes
- Learn ARM development(22)
- Learn ARM development(21)
- Learn ARM development(20)
- Learn ARM development(19)
- Learn ARM development(14)
- Learn ARM development(15)
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- 【Recruitment】Full-time and part-time RF engineers
- Explore Ultra-Wideband (UWB) Technology
- #It turns out I owe so many trees#Have you planted trees? Happy Arbor Day~
- Simple LM317 adjustable power supply
- AD09 cannot open AD files.
- AC servo motor based on STSPIN32F0
- Digital Circuit Design and VerilogHDL.pdf
- [GD32L233C-START Review] Review 2: Library function analysis, GPIO lighting
- Design of an ultra-low power micro-ECG stethoscope
- Modeling and simulation of power electronics and motor control systems