1 Introduction
With the development of market demand and technology, people have put forward higher requirements for the reliability and stability of engineering, machinery, aviation, and navigation equipment, among which attitude measurement is an important indicator. Inclination sensor is a device that measures the inclination angle or attitude about a certain reference surface. At present, there are single-axis, dual-axis, and tri-axis inclination sensors on the market, but most of them are expensive or large in size. This paper proposes a design implemented with dual-axis sensor SCA100t and C8051F microcontroller, which can greatly reduce the system cost. It can not only constitute a separate digital output sensor, but also be used as a measurement module and embedded in the measurement control system. It is widely used in robot control, platform attitude (pitch and roll) measurement, dual-axis acceleration measurement and other systems.
2 Hardware Circuit Design
The whole system structure is shown in Figure 1. It can be divided into power supply circuit, angle measurement and data acquisition and output. The system adopts wide power supply. After power conversion, the power supply is divided into two paths. One path is the precision voltage regulator chip REF195, which outputs a high and stable 5V voltage, which is specially used to power the sensor to improve the output stability of the sensor; the other path is the 3.3V power supply output by LM2937, which provides working power for the microcontroller system.
Figure 1 System overall block diagram
The angle measurement uses the silicon-based accelerometer SCA100T produced by VTI, and its main performance indicators are: 1) Dual-axis inclination measurement: SCA100T measures XY directions; 2) Measurement range 1.7g; 3) Measurement sensitivity 1.2V/g; 4) +5V single power supply, two proportional voltage outputs (analog), built-in 11-bit AD converter; 5) SPI-compatible digital output; 6) The internal temperature sensor can be accessed through the SPI interface.
SCA100T is a 12-pin surface mount package. When designing, the chip should be installed horizontally, and the direction indicated by the arrow on the chip is the positive direction. The output uses the SPI interface with a cycle of 19 clocks. Although the C8051F microcontroller has on-chip SPI resources, it does not match the SPI timing of SCA100T, so software is used to simulate the SPI bus to read and write SCA100T data.
The sensor also has an analog output interface, and these two signals are brought out during design to meet user requirements.
The data acquisition and processing uses Silicon's high-performance C8051F005 microcontroller as the main processor. It uses the CHP-51TM microprocessor core, is fully compatible with 8051, and has expanded SPI, IIC AD and other peripherals on the chip. It uses a single instruction cycle and has a JTAG interface, which can be directly debugged and programmed. The output interface of small industrial sensors generally uses RS-232C or RS-485 interface. Both of these interface circuits are designed during the design, and users can choose one of the interfaces to output data.
3 System Software Design
The whole system is designed with C51, using modular structure and clear organization. The main functions include controlling SCA100T, reading biaxial measurement data and internal temperature value; completing voltage value-angle conversion; output data correction; data output software filtering; receiving serial port commands and outputting measurement data. The software flow is shown in Figure 2.
According to the device manual, the voltage value and angle output by SCA100t have the following relationship:
α=arcsin((Dout-1024)/Sens)
Figure 2 System software flow chart [page]
Dout is the digital output of the sensor;
Sens is the sensitivity of the sensor, which is 819 (4V/g) or 1638 (2V/g) depending on the measurement range. The microcontroller reads the A/D conversion results of the two sensors in the SCA100T through the SPI port, processes them in the microcontroller, and outputs them through the serial port. At the same time, the internal temperature sensor is read out using the SPI interface to perform temperature compensation on the measured value.
4 Measures to improve accuracy
SCA100T is very sensitive. Power fluctuations or device vibrations have a great impact on the accuracy of the output value. Temperature also has a certain impact on the output value. The welding surface may be uneven during welding, and there may be a certain angle with the reference surface when installed in the housing or embedded in other systems. These will cause zero point deviation of the measured value. After experiments and analysis, the following methods are mainly used to improve its stability and reliability:
4.1 Power supply circuit design
Unstable power supply voltage can directly cause proportional error of output, with the maximum value reaching 2%. If the power supply is overloaded, the sensor will be underpowered and cause output fluctuation. The system has added a power input protection circuit to prevent power input overload. The high-precision voltage source REF195 is used to power the sensor separately, effectively reducing the impact of power supply fluctuation on the output. When designing the circuit board, adding a 10nF filter capacitor between the power supply and ground of the sensor, and adding a 10uF filter capacitor to the analog output end can also reduce the ripple, thereby reducing the output error; when working in an embedded system, add an iron shell to this part of the circuit for electromagnetic shielding to reduce the impact of other working circuits or the surrounding environment on it.
4.2 Software Filtering
An array is set in the RAM on the microcontroller to store the angle values after the solution. The new measured values in the array are updated by using the principle of stack, and the data is weighted and averaged before output. This can reduce the output fluctuation, but the output has a certain lag. Through experiments, 5 data processing methods were finally selected to meet the design requirements of the system.
4.3 Temperature compensation
The output value of the sensor is also affected by temperature. It has an internal temperature sensor and does not require temperature compensation in most cases. When the sensor works near the limit temperature, the MCU can compensate according to its internal temperature. The actual value of the temperature is calculated by the following formula:
Treal=(Counts-197)/(-1.083)
Where Counts is the output value of the sensor.
4.4 Analog Output
Sca100t also has analog output, which is more accurate than the 11-bit AD conversion result of SPI output. You can use a 12-bit or 16-bit AD chip or a microcontroller with higher accuracy AD (such as C80051F060) to measure the voltage and then calculate it to get higher measurement accuracy.
4.5 Zero point calibration
When welding or installing the sensor, there will inevitably be some tilt angles, which will cause zero-point errors. After the sensor is installed and fixed, it is calibrated on a three-dimensional turntable to measure its zero-point error values in two directions and store them in the Flash chip as a constant value. The MCU subtracts the zero-point error from the measured value and then outputs it, which basically eliminates the measurement error caused by the zero-point error.
5 Summary
After many experiments and improvements, the digital inclination sensor works reliably and stably, has high measurement accuracy, and is easy to embed into other measurement systems. It has been applied in many projects such as drone attitude measurement.
Previous article:Design of electronic piano based on 51 single chip microcomputer
Next article:Research on the Sun Automatic Tracking System Based on 51 Single Chip Microcomputer
Recommended ReadingLatest update time:2024-11-16 17:47
- Popular Resources
- Popular amplifiers
- Principles and Applications of Single Chip Microcomputers 3rd Edition (Zhang Yigang)
- MCU Principles and Interface Technology C51 Programming (Edited by Zhang Yigang)
- Example interpretation of 51 single chip microcomputer complete learning and application
- Practice of Serial Communication between Single Chip Microcomputer and Computer (Zhang Xiuguan)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- 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
- 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
- The History of DSP and Why No One Mentions DSP Anymore
- RISC-V MCU IDE MRS (MounRiver Studio) development: Add standard math library reference
- A brief introduction to the timer A function of the 430 microcontroller
- [Social Recruitment] Capital Securities Recruitment [Semiconductor Researcher]
- [Lazy self-care fish tank control system] PRINTF output in RTT mode under Keil environment
- This week's highlights
- PIC118F
- [MM32 eMiniBoard Review] Part 3: UART Test and Analysis
- Resistance and capacitance thinking map
- Audi owes me a VR helmet for my childhood