Course design background and design significance
The development of modern industrial production equipment is moving towards large-scale, high-speed, continuous and automated directions. Its complexity is increasing day by day, and the knowledge involved is extensive, including not only mechanical design and material science, but also computer technology, optics, circuit technology, etc. It is not only expensive, but also troublesome to maintain. Faced with such a large mechanical equipment, we must need some instruments to assist in inspection and testing. We hope that these instruments have a certain degree of intelligence, not only with real-time detection, automatic alarm, result display and storage, but also with small size, light weight, easy to carry and other advantages. However, although traditional electromechanical instruments have certain advantages, they are also a combination of machinery, electricity, light, and calculation. Their use and maintenance are also quite complicated, which is not conducive to the development of today's mechanical equipment.
With the development of modern network technology and the rapid expansion of enterprise scale, traditional instrument measurement with independent functions and short distance can no longer meet industrial needs. Long-distance and large-scale measurement instrument groups will be the trend of future development. Since traditional instruments use analog signals, they are not conducive to computer control and calculation, and will not be able to meet the needs of modern enterprise management and technological development.
From the above analysis, we realize that traditional measuring instruments have deficiencies in cost, manufacturing technology, and ease of operation, and cannot meet the needs of society. However, the virtual instrument technology developed in recent years has a good performance in cost, manufacturing technology, and ease of operation, and can well meet the needs of the development of modern science and technology. It is an important direction for the future development of instruments and meters.
The six-axis sensor MPU6050 has been widely used in various fields in recent years and is an indispensable component in future smart devices such as smartphones, tablet devices, handheld gaming products, game consoles, 3D remote controls, and portable navigation devices.
Design software and design planning
This course design is completed in the MDK environment, using C language for programming, and fully adopting object-oriented development ideas. It has a lot of room for personal development, and the same function can be solved from different aspects. MDK originated from the German KEIL company and is the abbreviation of RealView MDK. MDK is used by more than 100,000 embedded development engineers around the world. The latest version is: MDK5.14, which is the uVision5 IDE integrated development environment, which is currently the best development tool for ARM processors, especially Cortex M core processors.
Design planning:
For this course design, the following plan is designed, as shown in Figure 2.1.
Figure 2.1 Curriculum design planning
chapter summary
This chapter mainly introduces the background of course design, plans the design, and develops a reasonable workflow.
3 Hardware System Design
Overall design
The tilt acceleration detection system mainly completes the collection and display of temperature, acceleration, and tilt angle. Traditionally, the acceleration is collected using a three-axis acceleration sensor and the tilt angle is collected using a three-axis gyroscope. The cost is relatively high for this course design. In view of the above reasons, this system uses the MPU6050 six-axis gyroscope as the core sensor. The external data signal is converted into a digital signal by the MPU6050 input analog signal and transmitted to the single-chip microcomputer system (STM32RCT6) through the IO port. The single-chip microcomputer system decodes the received digital signal and displays the temperature and tilt angles in various directions through the TFTLCD, as shown in Figure 3.1.
Figure 3.1 Overall design architecture (see attachment)
Component selection and analysis
3.2.1 MCU selection and analysis
STM32F103RCT6 is a 32-bit microcontroller designed with CortexM3 as the core launched by ST. It is far superior to 8-bit 51 microcontrollers and can complete the design tasks excellently. The excellence of STM32 is reflected in the following aspects.
1. Ultra-low price. The biggest advantage of STM32 is that it can provide a 32-bit machine at the price of an 8-bit machine.
2. A large number of peripherals. STM32 has many peripherals and functions including: FSMC, TIMER, SPI, IIC, USB, CAN, IIS, SDIO, ADC, DAC, RTC, DMA, etc., with extremely high integration.
3. Rich models. STM32 has 8 series and hundreds of models of M3 core alone, including F100, F101, F102, F103, F105, F107, F207, F217, etc., with QFN, LQFP, BGA and other packages to choose from. At the same time, STM32 has also launched ultra-low power and wireless application-oriented M3 chips such as STM32L and STM32W.
4. Excellent real-time performance. 84 interrupts, 16 levels of programmable priority, and all pins can be used as interrupt inputs.
5. Excellent power consumption control. Each peripheral of STM32 has its own independent clock switch, which can reduce power consumption by turning off the clock of the corresponding peripheral.
6. Extremely low development cost. STM32 development does not require expensive emulators. Only one serial port is needed to download the code, and it supports two debugging ports, SWD and JTAG. SWD debugging can bring more convenience to your design. Only two IO ports are needed to realize simulation debugging.
The schematic diagram of STM32F103RCT6 is shown in Figure 3.2.
Figure 3.2 MCU schematic diagram
3.2.2 Sensor selection and analysis
The design requires the detection of tilt angle, acceleration and temperature. To complete the above requirements, a 3-axis gyroscope, a 3-axis acceleration sensor and a temperature sensor are required. Taking into account various factors such as cost, this course design uses a 6-axis sensor (MPU6050) with multiple functions to complete the data detection.
MPU6050 is the world's first integrated 6-axis motion processing component launched by InvenSense. Compared with multi-component solutions, it eliminates the problem of inter-axis difference when combining gyroscopes and accelerometers, and reduces installation space. MPU6050 integrates 3-axis gyroscopes and 3-axis acceleration sensors, and contains a second IIC interface that can be used to connect external magnetic sensors. It uses its own digital motion processor (DMP: Digital Motion Processor) hardware acceleration engine to output complete 9-axis fusion calculation data to the application end through the main IIC interface. With DMP, we can use the motion processing database provided by InvenSense to easily implement posture resolution, reduce the load of motion processing operations on the operating system, and greatly reduce the difficulty of development.
The features of MPU6050 include:
① Output 6-axis or 9-axis (external magnetic sensor required) rotation matrix, quaternion, and Euler angle format fusion calculation data in digital form (DMP support required).
② 3-axis angular rate sensor (gyroscope) with 131 LSBs/° /sec sensitivity and full-frame sensing range of ±250, ±500, ±1000 and ±2000° /sec.
③ Integrated programmable 3-axis accelerometer with a range of ±2g, ±4g, ±8g and ±16g.
④ Removed the sensitivity between the accelerometer and gyroscope axes to reduce the impact of settings and sensor drift.
⑤ The built-in digital motion processing (DMP) engine can reduce the load of the MCU's complex fusion calculation data, sensor synchronization, posture sensing, etc.
⑥ Operation time deviation and magnetic sensor calibration algorithm technology eliminates the need for additional calibration
⑦ Comes with a digital temperature sensor.
⑧ With digital input synchronization pin (Sync pin) to support video electronic image stabilization technology and GPS.
⑨ Programmable interrupts (interrupts) support gesture recognition, panning, screen zooming, scrolling, fast descent interrupts, high-G interrupts, motion sensing, touch sensing, and shake sensing functions.
⑩ VDD supply voltage is 2.5V±5%, 3.0V±5%, 3.3V±5%; VLOGIC can be as low as 1.8V
⑪ Gyroscope operating current: 5mA, gyroscope standby current: 5uA; accelerator operating current: 500uA, accelerator power saving mode current: 40uA@10Hz.
⑫ Built-in 1024-byte FIFO helps reduce system power consumption.
⑬ IIC communication interface up to 400Khz.
⑭ Ultra-small package size: 4x4x0.9mm (QFN).
The actual picture of the MPU6050 sensor is shown in Figure 3.3, and its detection axis is shown in Figure 3.4.
3.3 MPU6050 Physical Picture
Figure 3.4 MPU605 detection axis direction
The internal block diagram of MPU6050 is shown in Figure 3.5.
Figure 3.5 MPU internal block diagram
Among them, SCL and SDA are the IIC interfaces connected to the MCU. The MCU controls the MPU6050 through this IIC interface. There is also an IIC interface: AUX_CL and AUX_DA. This interface can be used to connect external slave devices, such as magnetic sensors, so that a 9-axis sensor can be formed. VLOGIC is the IO port voltage. The lowest voltage of this pin can be 1.8V. We usually connect it directly to VDD. AD0 is the address control pin from the IIC interface (connected to MCU). This pin controls the lowest bit of the IIC address. If connected to GND, the IIC address of MPU6050 is: 0X68, if connected to VDD, it is 0X69. The peripheral circuit of MPU6050 is shown in Figure 3.6.
Figure 3.6 MPU6050 peripheral circuit diagram
Working principle of MPU6050:
Gyroscope detection is not completely accurate and has certain errors.
Figure 3.7 Integration error
There will be an integral error, as shown in Figure 3.7. The smaller the integral time Dt, the smaller the error. This is very easy to understand. For example, when calculating the distance, assuming that the driving time is 1 hour, we randomly select the speed Vt at a certain moment in the driving process and multiply it by 1 hour. The distance error obtained is extremely large, because the speed at each moment in the driving process is not equal to the speed at that moment. If we detect the speed every 5 minutes, we can get the speed of 12 moments, Vt1, Vt2, Vt3-Vt12. Multiply the speed at each moment by the time interval (5 minutes), and sum these 12 results to get a relatively accurate driving distance. Continuously increasing the sampling frequency can make the integral time Dt smaller and reduce the error.
Previous article:ARM Cortex M0 LPC1114 Pinout and Overview
Next article:LPC2106 running water lamp program and simulation test based on Proteus are successful
Recommended ReadingLatest update time:2024-11-16 16:00
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
- 51 single chip digital tube serial communication
- Is it possible to use gallium nitride?
- Smoother than oil, make an electric ice pot with hard disk platters and breast pump
- [Third Batch of Shortlist] GigaDevice GD32L233 Review Activity
- [Practice Together in 2021] Looking Back at 2020 and Looking Forward to 2021
- Matter Development Guide (Part 2): Building a Matter Application
- Learning FPGA Embedded System Design-6.pdf
- A smart ring with emotional attributes that reminds you to exercise after a long period of sitting
- Problems with installing PingPingTouGe CDK under Win10 system
- Year-end feedback: EEWorld's 2018 Most Influential Netizens' Choice