Design of digital inclination sensor based on C8051F single chip microcomputer

Publisher:MysticGlowLatest update time:2011-11-19 Keywords:SCA100t  C8051F Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

System overall block diagram www.elecfans.com


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)

System software flow chart www.elecfans.com

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.

Keywords:SCA100t  C8051F Reference address:Design of digital inclination sensor based on C8051F single chip microcomputer

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

Use C8051F MCU program downloader to write code into MCU
  After generating the usbadl.hex code file, you need to use the C8051F MCU program downloader to write the code into the C8051F MCU. The specific operations are as follows:   ① Select and enter the downloader software: Click the flashutil.exe icon with the left button of the mouse to enter the main interface of the f
[Microcontroller]
C8051F020 Single Chip Microcomputer and Its Application in Total Phosphorus Online Automatic Analyzer
1 Overview The C8051F0XX series of MCUs are a new type of mixed signal system-level MCU launched by Cygnal. This series of MCUs contains the CPU core of CIP-51, and its instruction system is fully compatible with MCS-51. The C8051F020 MCU contains 64kB on-chip Flash program memory, 4352B RAM, 8 I/O ports with a
[Microcontroller]
C8051F020 Single Chip Microcomputer and Its Application in Total Phosphorus Online Automatic Analyzer
Design of CAN bus and RS-232 communication based on C8051F040
  In order to realize the bidirectional communication requirements of CAN bus and RS-232 serial port, a data communication scheme based on C8051F040 single-chip microcomputer is proposed, and the system design is completed. The communication characteristics of CAN bus and RS-232 serial port are analyzed, the single-chi
[Microcontroller]
Design of CAN bus and RS-232 communication based on C8051F040
Design of flow rate and head efficiency monitoring instrument based on C8051F005
0 Introduction  The purpose of monitoring the hydraulic parameters of hydropower units in a hydropower station is first to ensure the safe and economical operation of the hydropower station, and secondly to identify and examine the performance of the hydropower units. Therefore, as one of the main characteristics of
[Microcontroller]
Design of flow rate and head efficiency monitoring instrument based on C8051F005
Transplantation of μC/OS-II on C8051F
In embedded applications, the main reason for using RTOS is to improve system reliability, followed by improving development efficiency and shortening development cycles. μC/OS-II is a priority-based preemptive real-time kernel that supports 56 user tasks. 90% of the code is w
[Microcontroller]
Design of USB interface for data acquisition system based on C8051F series single chip microcomputer
1 Introduction As modern industrial production and scientific research place increasing demands on data acquisition systems, transmission speed, error correction capability, and ease of operation and installation have always been issues that people have been concerned about when collecting data. This has made data com
[Microcontroller]
Design of USB interface for data acquisition system based on C8051F series single chip microcomputer
Two-phase stepper motor drive system based on A3992 and C8051F300
1 Introduction The stepper motor has accurate positioning and is easy to interface with the digital circuit. It can achieve accurate angular displacement without feedback and has been widely used in many fields such as CNC machine tools. However, the traditional stepper motor positioning system is a cont
[Microcontroller]
Two-phase stepper motor drive system based on A3992 and C8051F300
Design of digital multi-motor control platform based on C8051F020 single chip microcomputer
    This article introduces a multi-motor control platform based on the single-chip microcomputer C8051F020. The hardware circuit is simple and reliable, and the power circuit is built by field effect transistors. It has strong versatility and can be directly used in the drive control systems of other small-power moto
[Microcontroller]
Design of digital multi-motor control platform based on C8051F020 single chip microcomputer
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号