Design of detection device based on ARM tilt angle and acceleration

Publisher:温暖拥抱Latest update time:2019-11-29 Source: 51heiKeywords:ARM Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

[1] [2] [3] [4] [5]
Keywords:ARM Reference address:Design of detection device based on ARM tilt angle and acceleration

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

ARM learning classic 40 questions and answers must read
    Question 1:     Q: What mode is the processor in when the instruction movr0, LR is executed at the beginning of initializing the CPU stack?     A: The mode after reset is the management mode.     Question 2:     Q: Ask: What is the 8-bit image immediate value in MOV? How does 0xF0000001 come from?     A: It is ci
[Microcontroller]
ARM7 serial port programming essentials
I. Hardware Principles of Serial Port Programming 1. Serial Port Features: 1>16-byte receive FIFO and 16-byte transmit FIFO 2>The receive FIFO trigger point can be set to 1, 4, 8 or 14 bytes. 3>Built-in baud rate generator. 2. UART0 pins: 1>RxD0 pin is used for UART0 to receive data, and the receiving mode is ser
[Microcontroller]
ARM7 serial port programming essentials
Introduction to porting QTE and QPE on ARM board
The porting of QTE and QPE on ARM board is a headache for many technical friends. The author has sorted out his thoughts recently and published the article for your reference. Please correct me if there are any deficiencies.     Software toolkits required for migration: tmake-1.11.tar.gz(tmake-1.13) qt-embedde
[Microcontroller]
ARM Clock Management Unit--CMU
The principle of clock The clock management unit is the core unit used to manage various clock modules in the cortex-A9. The clock of 4412 generates clock signals of various frequencies required by the CPU bus peripherals through PLLS (phase-locked loop) The clock is the frequency that coordinates the entire system.
[Microcontroller]
ARM Clock Management Unit--CMU
【ARM】Timer
PWM Timer   PWN: Pulse Width Modulation   Each timer has a dedicated 16-bit down counter driven by the timer clock. When the count value of the down counter reaches 0, a timer interrupt request is generated to notify the CPU that the timer operation is completed. When the timer down counter reaches 0, the correspondin
[Microcontroller]
7 working modes of arm processor
      First, distinguish the working mode and working state of the arm processor. The working state only has arm state and thumb state. The main difference is the length of the executed instructions. The former is a word instruction and the latter is a half-word instruction.       There are 7 working modes of arm:
[Microcontroller]
Analysis of ARM multi-core and MIPS multi-threaded embedded processor technology
Implementing multi-core (including homogeneous or heterogeneous) and multi-threading technology in embedded devices can indeed bring many benefits, especially in improving system performance. Although RISC embedded technology faces more and more challenges, it can improve its future applicability and eff
[Microcontroller]
Analysis of ARM multi-core and MIPS multi-threaded embedded processor technology
uC/GUI transplantation example on ARM core S3C44B0X
uC/GUI is a graphical user interface (GUI) software package for embedded systems launched by Micrigm. Since uC/GUI is written entirely in ANSI-C, it is independent of the processor and can be easily ported to different operating systems and embedded microprocessors, and can support graphic LCDs of different sizes.
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号