{'fraction_non_alphanumeric': 0.02303894679100384, 'fraction_numerical': 0.02550740537575425, 'mean_word_length': 4.9926047658175845, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, '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 Inclinometer Based On STM32

This paper introduces an angle sensor based on STM32 microprocessor. Firstly, it introduces the power circuit module. Then it analyzes the angle acquisition principle and signal output type of MPU9250, then analyzes the CAN transceiver module, and finally introduces the software architecture. The sensor has a CAN output interface that can be directly applied to the CAN network architecture. The experimental results show that the sensor measurement accuracy reaches ±0.1°, which can meet the needs of industrial angular position measurement.


Introduction
The Angle measurement sensors are widely used in mechanical contact encoder, photoelectric encoder, grating sensor, magnetic sensor, and so on, first of all, the service life of the traditional mechanical structure of the Angle sensor is generally is not high, poor ability to resist shock, vibration, if meet the bad working environment such as damp, high temperature, sensor measurement precision and accuracy will be badly affected. Secondly, the interface of traditional Angle sensor is mostly SPI and BISS, which cannot be directly used in CAN network system. Third, the traditional Angle meter is expensive. Based on the STM32 microcontroller, this paper designs the hardware circuit module and intelligent software of the Angle sensor, and verifies the independent linear precision and measurement accuracy of the sensor through the performance test experiment system.

Overall design of sensor system
MPU9250 was used as the Angle sensor to acquire the chip, and STM32 was used as the system MCU to design the Angle signal acquisition circuit, power circuit, CAN interface circuit and software design. STM32F103 is an enhanced chip, the use of high-performance ARM Cortex M3 32-bit RISC core, working frequency 72 MHZ, built-in told memory (up to 128 k byte flash and 20 k byte SRAM), have 3 serial SPI interface, 2 road 12 bit D/A converter and no.5 USART interfaces, operating temperature range for -40 ~ 105 ℃, working voltage from 2.0 V to 3.6 V, fully meet the requirements of low power applications.
Angle signal is collected by MPU9250, which is a qfn-encapsulated composite chip (MCM), which is composed of two parts. One is a 3-axis acceleration and a 3-axis gyroscope, and the other is AKM's AK8963 3-axis magnetometer. So the MPU9250 is a 9-axis motion tracking device that combines 3axis acceleration, 3-axis gyroscope and digital motion processor (DMP) in a small 3X3X1 package and is compatible with MPU6515. Its perfect I2C scheme can directly output all data of 9 axis. Integrated design, kinematic integration, and clock calibration allow developers to avoid tedious chip CAN isolation chip adopts ISO1050. ISO1050 is an electroplating reasonable isolation CAN transceiver, which conforms to ISO11891 standard technical specification. This device has a logical input and output buffer separated by a silicon diode insulated gate and used with the isolator power supply to prevent the data bus or other noise current from entering the local grounding and interfering and damaging sensitive circuits. As a CAN transceiver, this device provides differential transmission and differential reception capabilities for CAN controllers with bus and signaling speeds up to 1 MBPS. Designed to operate in particularly harsh environments, the device is characterized by cabling, overvoltage, earthing loss protection and overheat shutoff at -27v to 40V, and a common model range of -12v to 12V.
The micro control chip STM32F03 reads the digital quantity Angle of the sensor chip MPU9250 through the I2C interface and conducts a series of internal processing. Finally, CAN communication is conducted through the transceiver ISO1050 and the Angle value is fed back to the upper computer system. The overall system block diagram is shown in figure 1.

Power circuit design
In order to meet the overall system design requirements of low power consumption of the system, the sensor system USES DC5V power supply and adopts the power stabilized chip LM1117 to meet the requirements of 3.3v power supply of the micro-controller. LM1117 has the characteristics of low power consumption, simple peripheral circuit, over temperature and over current protection. The design diagram of power supply circuit is shown in figure 2.

MPU9250 signal acquisition circuit
The MPU9250 and the control chip STM32 communicate via I2C. I2C is a dual-line communication scheme, which has two lines of SDA and SCL to transmit data and clock signals respectively. Usually this interface is a two-way open drain interface. You can do host or slave when connecting devices. Address can be matched during slave communication. When using MPU as a slave, SDA and SCL usually require pull-up resistance to VDD, and the communication speed reaches 400KHz. MPU9250 acquisition circuit is shown in figure 3.

CAN communication circuit
The transceiver chip adopts ISO050.ISO1050 is an isolated CAN transponder with electroplating isolation, which conforms to or is superior to the technical specification of ISO11898. As a CAN repeater, this device provides transmission and differential reception capabilities for both bus and CAN controllers with signaling speeds of up to 1 megabit per second. Designed to operate in particularly harsh environments, the device has a series of wires, overvoltage and overheat shutdowns. The specific circuit is shown in fi gure4.

System software design
The system software flow chart is shown in figure 5. Firstly, the system is electrified, the system is initialized, the I2C port is configured, the CAN interface is configured, and MPU9250 register data is read, then the software is filtered, finally the data read is transmitted to the supreme computer through the CAN network, and the data is read once, then the data is read next time.

Conclusion
In this paper, based on STM32 processor and MPU9250 Angle sensor, an Angle sensor which CAN be directly applied to CAN network architecture is developed. This sensor has the features of high measurement accuracy, adjustable measurement range and harsh working conditions. graduate student, major in biomedical engineering, worked in Shanghai institute of metrology and testing technology in July 2012, the main research direction detection method for medical imaging equipment, hardware circuit design, automatic control, etc. His email address: wang_zeguan@126.com, His mobile phone number: 15901852283 In the process of completing this paper, I would like to thank Mr. Lu xun for giving me many useful Suggestions and ideas on hardware circuit design, and for his help in the drawing of circuit diagram.At the same time, I would also like to thank Dr. Sun rongrong for his great efforts in the software design of the system, which finally enabled the whole system to meet the precision requirements we expected.The serious scientific attitude of Mr. Lu xun and Dr. Sun rongrong, the rigorous spirit of studying and the work style of striving for perfection deeply infect and inspire me to make continuous progress.In addition, I would like to express my gratitude to my colleagues for designing practical experimental schemes when conducting circuit design experiments, so as to ensure the timely completion of the thesis.