The traditional wire-type displacement sensor uses a potentiometer displacement sensor, which converts mechanical displacement into a resistance or voltage output that is linear or an arbitrary function relationship with it through a potentiometer element. Ordinary linear potentiometers and circular potentiometers can be used as linear displacement and angular displacement sensors respectively. However, the potentiometer designed for the purpose of measuring displacement requires a definite relationship between displacement change and resistance change. The movable brush of the potentiometer displacement sensor is connected to the object to be measured, and the displacement of the object causes the resistance change at the moving end of the potentiometer. The change in resistance reflects the magnitude of the displacement, and the increase or decrease in resistance indicates the direction of the displacement. Usually, a power supply voltage is passed through the potentiometer to convert the resistance change into a voltage output. The traditional wire-type displacement sensor has a step-shaped output characteristic because its resistance changes in steps as the turn resistance when the brush moves. If this displacement sensor is used as a displacement feedback element in a servo system, an excessive step voltage will cause system oscillation. Therefore, the resistance value per turn should be minimized in the production of the potentiometer. At the same time, another major disadvantage of the potentiometer sensor is that it is easy to wear, has poor resolution, has low resistance, and has poor high-frequency characteristics, which leads to a decrease in measurement accuracy. Its advantages are: simple structure, large output signal, easy to use, and low price.
The wire-type displacement sensor based on magnetic angle technology uses the magnetic field as the transmission carrier to convert the displacement transformation into magnetic field angle displacement. At the same time, the displacement signal is returned to the application system through the communication interface.
1 Overall design plan
The function of the wire-type displacement sensor based on magnetic angle technology is to convert the mechanical displacement of the wire into an electrical signal that can be measured, recorded or transmitted. It is mainly composed of automatic return springs, wheels, magnets, and data processing units. The structure is shown in Figure 1. As
can be seen from Figure 1, the wire-type displacement sensor based on magnetic angle technology is mainly composed of 6 parts. It changes the shortcomings of traditional wire-type displacement sensors such as contact, easy wear, and poor high-frequency characteristics. The wire-type displacement sensor based on magnetic angle technology uses the magnetic field as the medium to convert mechanical displacement changes into magnetic field angle changes. On the one hand, it solves the contact method of traditional wire-type displacement sensors, and on the other hand, it reduces wear and improves the high-frequency characteristics of the system, thereby ensuring the displacement detection accuracy. The data processing operator is used to calculate the received magnetic angle signal into the displacement signal of the pull line through the mathematical model. The communication interface communicates with the equipment of the application system through the communication interface, receives commands from the application system equipment and feeds back the collected displacement signal to the application system. This improves the accuracy, stability and reliability of data acquisition and lowers the application threshold of the displacement sensor.
The functions of each component are described as follows:
(1) The steel rope of the pull line is wound on the hub, which is connected to a magnet. When the pull line is displaced, it drives the hub to rotate. The rotation of the hub causes the magnet connected to the hub shaft to rotate, so that the magnetic field of the magnet produces a changing angle. When the pull line moves, the automatic return spring ensures that the pull line has a certain tension and ensures the proportional relationship between the displacement of the pull line and the magnetic angle.
(2) The magnetic angle sensor is installed on the same central axis as the magnet to sense the change of the magnet angle. A microprocessor is selected to read the magnetic angle information and calculate the magnetic angle into the displacement of the pull line by establishing a mathematical model.
(3) Communication interface. The microprocessor receives commands from the application system through the communication interface and returns the displacement information to the application system through the communication interface.
2 Hardware interface circuit design
The data processing unit consists of a magnetic angle sensor, a microprocessor unit, a communication interface and an output module. The specific functional block diagram is shown in Figure 2.
By analyzing Figure 2, the magnetic angle sensor uses MLX90316, which converts the angle of rotation of the magnetic field caused by the displacement of the pull wire into a magnetic angle. The microprocessor unit uses a 32-bit embedded ARM to process the received magnetic angle data and complete the reception of the magnetic angle data. Since the received angle is the angle of magnetic field conversion, the magnetic angle is converted into the displacement of the pull wire by establishing a mathematical model and combining factors such as the diameter of the wheel hub. Therefore, in order to quickly realize the reception of data and the establishment of the model, LPC2136 is selected as the data processing unit. The input and output control module is responsible for the processing of various external interfaces, such as receiving commands from the application system through the communication interface and returning the collected displacement results to the application system, so that the microprocessor unit can execute the commands of the application system and send the collected results to the application device through the interface safely and reliably, mainly including 1 RS 485 and 4-20 mA current output.
2.1 Magnetic angle receiving interface
MLX90316 is a linear Hall chip, a monolithic integrated sensor chip using planar Hall sensing technology. The chip can be used to measure the magnetic flux density coplanar with the chip surface, and can obtain the rotation position value from 0 to 360°. It can output highly accurate linear absolute position signals through multiple modes, and it is low-cost and easy to install.
The front end of the MLX90316 chip is a sensor using Triaxis Hall technology. After the two orthogonal analog signals obtained by the Hall sensor are amplified, they enter the chip microprocessor (DSP) through a 14-bit differential A/D converter, and then the digital signals processed by the 16-bit DSP are divided into three outputs. The MLX90316 output has 12-bit angle resolution and 10-bit angle accuracy, and can avoid the influence of peripheral temperature changes on output accuracy to a certain extent. MLX90316 has three outputs: analog output converted from 12-bit D/A; PWM output with a frequency of 100 to 1 000 Hz; and serial communication protocol output (SPI) in digital mode. [page]
Since the output signal of serial communication comes directly from the internal DSP output of MLX90316, the SPI output mode is more stable, has smaller errors, and has higher anti-interference ability. In this design, the SPI interface is selected, and the specific hardware interface connection circuit is shown in Figure 3. In Figure 3, the three SPI lines of MLX90316 are connected to the SP10 port of ARM LPC2136. The SPI (Serial Protocol InterIace) bus interface is a synchronous serial peripheral interface. This is a serial interface protocol with 4 signal lines, including master and slave modes. The 4 signal lines are: clock line (SCK), data input line (MISO), data output line (MOSI) and slave enable line (SS).
2.2 RS 485 communication interface circuit design
RS 485 bus has been widely used in industrial control systems due to its simple structure, high communication rate, long transmission distance and many other advantages. It uses balanced transmission and differential reception to achieve communication. The transmitter converts the TTL level signal of the serial port into two differential signal outputs A and B. After cable transmission, the differential signal is restored to a TTL level signal at the receiver. Since the transmission line usually uses twisted pair and differential transmission, it has a strong ability to resist common mode interference, and the bus transceiver is very sensitive.
In the wire-type displacement sensor based on magnetic angle technology, we designed an RS 485 signal output. The RS 485 interface chip uses MAX3485, which is used to exchange displacement data with the application system. In order to ensure the reliability of data communication, the communication interface uses the optoelectronic isolation chip 6N137.
2.3 Controllable current output interface
The data processing unit has a controllable 4~20 mA current output for driving the field indicator instrument. The specific connection circuit is shown in Figure 4. PWM2 is connected to the PWM2 pin of ARM. The PWM signal is used to control the conduction and cutoff of the optocoupler. The inverter is mainly used to adjust the waveform. According to the relationship between the magnetic sensitivity angle and the displacement, a mathematical model is established to calculate the duty cycle of PWM, so as to achieve the purpose of current regulation.
3 Software Design
The μC/OS-Ⅱ operating system is embedded in LPC2136.
μC/OS-Ⅱ is a priority-based preemptive multi-tasking real-time operating system that includes real-time kernel, task management, time management, inter-task communication synchronization (semaphore, mailbox, message queue) and memory management functions. It can make each task work independently without interfering with each other, and it is easy to achieve timely and error-free execution, making the design and expansion of real-time applications easy and greatly simplifying the application design process.
Software programming mainly includes three modules: PWM control current output module, RS 485 communication module, and MLX90316 SPI communication module. The programming process is shown in Figure 5. The PWM control current output module mainly adjusts the current by changing the PWM duty cycle. The RS 485 communication module is mainly used to receive instructions from the upper system and transmit data back according to the instructions. The SPI communication module of MLX90316 is mainly used to read the magnetic angle. The SPI communication process is: the master end first outputs 1 0xAA and 1 0xFF as the communication start signal, and then outputs 8 0xFF, while the slave end will simultaneously output 2 0xFF, 4 bytes of angle signal and 4 0xFF, thus completing a data communication.
4 Conclusion
Using MLX90316 to build a position sensor requires the use of magnets, and the installation of active mechanical parts at the sensing position (usually connected to the end of the shaft). Any magnet with uniform horizontal magnetic flux can be used. The size and material of the magnet are not important; within the mechanical, magnetic field and thermal tolerances, the horizontal magnetic flux must be within the range of 20 to 70 mT (for example, (45±25) mT).
In terms of air gap, if the actual air gap from the IC surface is greater than 7.5 mm, a ring magnet is better than a disc magnet. The magnet can be placed at the end of the shaft, and when using a ring magnet, it can be wrapped around the shaft. Special magnet designs can also be used to obtain normal transmission characteristics of the rotary position sensor.
In the "Intelligent Detection System of Dam Displacement Based on FPGA Technology", a wire-type displacement sensor based on magnetic angle technology is used in the dam root stone displacement acquisition device. There are a total of 7 dams to be monitored, and each dam has 5 key monitoring points. Therefore, the RS 485 bus is used to form a star network with these 35 monitoring points. From the test results, it can be seen that the sensor overcomes the shortcomings of traditional wire-type displacement sensors such as easy wear, poor resolution, low resistance, and poor high-frequency characteristics, and improves the measurement accuracy.
Reference address:Design and application of wire-drawn displacement sensor based on magnetic sensitive angle technology
The wire-type displacement sensor based on magnetic angle technology uses the magnetic field as the transmission carrier to convert the displacement transformation into magnetic field angle displacement. At the same time, the displacement signal is returned to the application system through the communication interface.
1 Overall design plan
The function of the wire-type displacement sensor based on magnetic angle technology is to convert the mechanical displacement of the wire into an electrical signal that can be measured, recorded or transmitted. It is mainly composed of automatic return springs, wheels, magnets, and data processing units. The structure is shown in Figure 1. As
can be seen from Figure 1, the wire-type displacement sensor based on magnetic angle technology is mainly composed of 6 parts. It changes the shortcomings of traditional wire-type displacement sensors such as contact, easy wear, and poor high-frequency characteristics. The wire-type displacement sensor based on magnetic angle technology uses the magnetic field as the medium to convert mechanical displacement changes into magnetic field angle changes. On the one hand, it solves the contact method of traditional wire-type displacement sensors, and on the other hand, it reduces wear and improves the high-frequency characteristics of the system, thereby ensuring the displacement detection accuracy. The data processing operator is used to calculate the received magnetic angle signal into the displacement signal of the pull line through the mathematical model. The communication interface communicates with the equipment of the application system through the communication interface, receives commands from the application system equipment and feeds back the collected displacement signal to the application system. This improves the accuracy, stability and reliability of data acquisition and lowers the application threshold of the displacement sensor.
The functions of each component are described as follows:
(1) The steel rope of the pull line is wound on the hub, which is connected to a magnet. When the pull line is displaced, it drives the hub to rotate. The rotation of the hub causes the magnet connected to the hub shaft to rotate, so that the magnetic field of the magnet produces a changing angle. When the pull line moves, the automatic return spring ensures that the pull line has a certain tension and ensures the proportional relationship between the displacement of the pull line and the magnetic angle.
(2) The magnetic angle sensor is installed on the same central axis as the magnet to sense the change of the magnet angle. A microprocessor is selected to read the magnetic angle information and calculate the magnetic angle into the displacement of the pull line by establishing a mathematical model.
(3) Communication interface. The microprocessor receives commands from the application system through the communication interface and returns the displacement information to the application system through the communication interface.
2 Hardware interface circuit design
The data processing unit consists of a magnetic angle sensor, a microprocessor unit, a communication interface and an output module. The specific functional block diagram is shown in Figure 2.
By analyzing Figure 2, the magnetic angle sensor uses MLX90316, which converts the angle of rotation of the magnetic field caused by the displacement of the pull wire into a magnetic angle. The microprocessor unit uses a 32-bit embedded ARM to process the received magnetic angle data and complete the reception of the magnetic angle data. Since the received angle is the angle of magnetic field conversion, the magnetic angle is converted into the displacement of the pull wire by establishing a mathematical model and combining factors such as the diameter of the wheel hub. Therefore, in order to quickly realize the reception of data and the establishment of the model, LPC2136 is selected as the data processing unit. The input and output control module is responsible for the processing of various external interfaces, such as receiving commands from the application system through the communication interface and returning the collected displacement results to the application system, so that the microprocessor unit can execute the commands of the application system and send the collected results to the application device through the interface safely and reliably, mainly including 1 RS 485 and 4-20 mA current output.
2.1 Magnetic angle receiving interface
MLX90316 is a linear Hall chip, a monolithic integrated sensor chip using planar Hall sensing technology. The chip can be used to measure the magnetic flux density coplanar with the chip surface, and can obtain the rotation position value from 0 to 360°. It can output highly accurate linear absolute position signals through multiple modes, and it is low-cost and easy to install.
The front end of the MLX90316 chip is a sensor using Triaxis Hall technology. After the two orthogonal analog signals obtained by the Hall sensor are amplified, they enter the chip microprocessor (DSP) through a 14-bit differential A/D converter, and then the digital signals processed by the 16-bit DSP are divided into three outputs. The MLX90316 output has 12-bit angle resolution and 10-bit angle accuracy, and can avoid the influence of peripheral temperature changes on output accuracy to a certain extent. MLX90316 has three outputs: analog output converted from 12-bit D/A; PWM output with a frequency of 100 to 1 000 Hz; and serial communication protocol output (SPI) in digital mode. [page]
Since the output signal of serial communication comes directly from the internal DSP output of MLX90316, the SPI output mode is more stable, has smaller errors, and has higher anti-interference ability. In this design, the SPI interface is selected, and the specific hardware interface connection circuit is shown in Figure 3. In Figure 3, the three SPI lines of MLX90316 are connected to the SP10 port of ARM LPC2136. The SPI (Serial Protocol InterIace) bus interface is a synchronous serial peripheral interface. This is a serial interface protocol with 4 signal lines, including master and slave modes. The 4 signal lines are: clock line (SCK), data input line (MISO), data output line (MOSI) and slave enable line (SS).
2.2 RS 485 communication interface circuit design
RS 485 bus has been widely used in industrial control systems due to its simple structure, high communication rate, long transmission distance and many other advantages. It uses balanced transmission and differential reception to achieve communication. The transmitter converts the TTL level signal of the serial port into two differential signal outputs A and B. After cable transmission, the differential signal is restored to a TTL level signal at the receiver. Since the transmission line usually uses twisted pair and differential transmission, it has a strong ability to resist common mode interference, and the bus transceiver is very sensitive.
In the wire-type displacement sensor based on magnetic angle technology, we designed an RS 485 signal output. The RS 485 interface chip uses MAX3485, which is used to exchange displacement data with the application system. In order to ensure the reliability of data communication, the communication interface uses the optoelectronic isolation chip 6N137.
2.3 Controllable current output interface
The data processing unit has a controllable 4~20 mA current output for driving the field indicator instrument. The specific connection circuit is shown in Figure 4. PWM2 is connected to the PWM2 pin of ARM. The PWM signal is used to control the conduction and cutoff of the optocoupler. The inverter is mainly used to adjust the waveform. According to the relationship between the magnetic sensitivity angle and the displacement, a mathematical model is established to calculate the duty cycle of PWM, so as to achieve the purpose of current regulation.
3 Software Design
The μC/OS-Ⅱ operating system is embedded in LPC2136.
μC/OS-Ⅱ is a priority-based preemptive multi-tasking real-time operating system that includes real-time kernel, task management, time management, inter-task communication synchronization (semaphore, mailbox, message queue) and memory management functions. It can make each task work independently without interfering with each other, and it is easy to achieve timely and error-free execution, making the design and expansion of real-time applications easy and greatly simplifying the application design process.
Software programming mainly includes three modules: PWM control current output module, RS 485 communication module, and MLX90316 SPI communication module. The programming process is shown in Figure 5. The PWM control current output module mainly adjusts the current by changing the PWM duty cycle. The RS 485 communication module is mainly used to receive instructions from the upper system and transmit data back according to the instructions. The SPI communication module of MLX90316 is mainly used to read the magnetic angle. The SPI communication process is: the master end first outputs 1 0xAA and 1 0xFF as the communication start signal, and then outputs 8 0xFF, while the slave end will simultaneously output 2 0xFF, 4 bytes of angle signal and 4 0xFF, thus completing a data communication.
4 Conclusion
Using MLX90316 to build a position sensor requires the use of magnets, and the installation of active mechanical parts at the sensing position (usually connected to the end of the shaft). Any magnet with uniform horizontal magnetic flux can be used. The size and material of the magnet are not important; within the mechanical, magnetic field and thermal tolerances, the horizontal magnetic flux must be within the range of 20 to 70 mT (for example, (45±25) mT).
In terms of air gap, if the actual air gap from the IC surface is greater than 7.5 mm, a ring magnet is better than a disc magnet. The magnet can be placed at the end of the shaft, and when using a ring magnet, it can be wrapped around the shaft. Special magnet designs can also be used to obtain normal transmission characteristics of the rotary position sensor.
In the "Intelligent Detection System of Dam Displacement Based on FPGA Technology", a wire-type displacement sensor based on magnetic angle technology is used in the dam root stone displacement acquisition device. There are a total of 7 dams to be monitored, and each dam has 5 key monitoring points. Therefore, the RS 485 bus is used to form a star network with these 35 monitoring points. From the test results, it can be seen that the sensor overcomes the shortcomings of traditional wire-type displacement sensors such as easy wear, poor resolution, low resistance, and poor high-frequency characteristics, and improves the measurement accuracy.
Previous article:TQ2440 startup code analysis (Part 2)
Next article:Integrated power supply monitoring device based on ARM and FPGA
Recommended Content
Latest Microcontroller Articles
He Limin Column
Microcontroller and Embedded Systems Bible
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
MoreSelected Circuit Diagrams
MorePopular Articles
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
MoreDaily News
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
Guess you like
- With these experiences, novices can easily choose MOSFET
- Seeking sensors that can monitor objects in the soil
- Agitek Engineers - How to Measure Cable Impedance and Loss Using a Vector Network Analyzer
- How to Layout a Circuit Board for an Op Amp
- 【RVB2601 debugging record 2】+ uGUI porting
- Visitor registration is in progress丨2021 Munich South China Electronics Show (Shenzhen International Convention and Exhibition Center) invites you to participate!
- Motion Detector Using MSP430 Launchpad and PIR Sensor
- 2022 Digi-Key Innovation Design Competition Unboxing
- 【Smart network desk lamp】9. Maix bit driver serial port
- [N32L43X Review] 3. Debugging tools JlinkRTT&Shell