Since the 1990s, electronic technology has been applied in underground drilling. However, the vibration of downhole drilling tools will have adverse effects on many sensors.
In particular, it has a huge impact on the inertial navigation sensor that measures the attitude of the downhole drill bit. In the vibration environment while drilling, if the signal is not processed, the correct well inclination and azimuth angle cannot be measured at all, and the well trajectory while drilling cannot be realized. control requirements. This article introduces the implementation method of high-speed vibration acquisition and storage function using DMA technology in SoC chip, and gives the test results in the drilling environment.
1 Proposal of method
The traditional data collection method adopts the method of direct control of the CPU for data collection. Data transmission needs to be transferred by the CPU before it can be stored in the memory. The transmission speed is slow and the collection rate is limited by the CPU, which greatly affects the sampling frequency of the system and cannot meet the requirements of the system. Requirements for high-speed acquisition of vibration signals. In the DMA transfer mode, data transfer does not go through the CPU, and the DMA controller realizes direct and rapid transfer of data between the memory and peripherals. In the measurement and control system of XTCS, the SoC chip used in the CPU is integrated with DMA. By working together with other devices, it can achieve simultaneous acquisition and storage, achieve the purpose of high-speed signal acquisition, and obtain high-fidelity underground vibration signals.
2 System introduction
The acquisition system uses C8051F060 SoC as the core, and C8051F060 integrates ADC and DMA internally. In addition, large-capacity memory chip K9F2808 is used as data memory. The system structure is shown in Figure 1.
Figure 1 Signal acquisition system structure diagram
This system is used as a detection device for underground related signals. Since the pressure and vibration signals collected by the pressure and vibration sensors are relatively weak, an amplifier circuit is required to condition and amplify the signals. The output of the sensor is an analog signal, which will be interfered by noise when collecting data. In order to eliminate the noise and improve the common mode rejection ratio and input impedance of the circuit, the acquisition amplifier circuit uses a pre-input buffer three-op-amp structure. Since ADC0 in the SoC can only collect positive signals, a bias circuit is provided after the conditioning amplifier circuit to convert the voltage of -5V ~ +5V into 0V ~ +2.5V to facilitate signal collection.
The CPU controls the multi-channel selection switch to collect the signal, and then converts it through the ADC. In the DMA transmission mode, the collected data is directly written into the memory K9F2808. While the DMA stores the data, the ADC is also collecting. After software testing, the time required to record and collect a page of 512 bytes using the timer 2 integrated in the SoC is 1.277ms, while writing a page of data to the off-chip memory K9F2808 requires 0.722ms.
The time it takes for the ADC to collect a page of data is less than the time it takes for the DMA to write a page of data off-chip. Therefore, data collection and storage can be performed at the same time without data overwriting and loss, achieving fast and accurate data collection.
3 Hardware part
The C8051F060 microcontroller is core-compatible with the 51 series microcontroller. It integrates two 16-bit SAR (successive comparison) ADCs and a DMA function module. There are 4352 bytes of data memory, 64KB flash memory and 64KB data memory interface on the chip, which can be used for system programming. The two SAR ADCs have 16-bit accuracy and are available as two single-ended or one differential converters. If DMA is used to store data directly into RAM, no additional software overhead is required.
K9F2808UOC memory is an ultra-large-capacity data storage device with NAND structure and is widely used in MP3, USB flash drives, digital cameras and PDAs. Its power supply voltage is 1.7V~3.6V, small size, low power consumption, read and write by page, erase by block, time-sharing multiplexing through the I/O port as command/address/data, the port supports real-time bidirectional input and output . Connect each control port of the flash memory to the P3 port of the SoC, and connect the general I/O port to the P7 port of the SoC. By controlling the output of the SoC port line, the FLASH memory can be read, written, and erased. Figure 2 is the interface circuit diagram of the chip.
Figure 2 Chip interface circuit diagram
4 A/D conversion and data storage
The ADC subsystem of C8051F060 integrates a track-and-hold circuit, a programmable window detector and a DMA interface. The two ADCs can be configured as two independent single-ended ADCs or form a differential pair. Data conversion mode, window detector and DMA interface can all be controlled by software special function registers. ADCn is enabled when the ADnEN bit in the ADC control register ADCnCN is set to logic 1. The ADC0 selected in this system has 4 conversion start modes, which are determined by the status of the ADC0 start conversion mode bits (AD0CM1, AD0CM0) in ADC0CN. The measurement and control system software uses timer 3 overflow to perform timed continuous conversion acquisition. After initializing the ADC, the ADC will automatically collect once when timer 3 overflows. After collecting one page of data, the collected data is directly stored in the off-chip flash memory K9F2808 under the DMA transfer mode, and the chip is read, written and erased.
In this measurement and control system, VB language is used to write the upper computer program, and C51 language is used to write the lower computer program. The upper computer controls the lower computer to perform corresponding tasks. Since the system's SoC integrates UART, communication can be achieved through the RS232 serial port of the PC. Each time the slave computer receives a task command, the program of the slave computer jumps into the corresponding serial interrupt program to execute the task. The main program of the lower computer includes continuously starting the DMA program, calling the writing program of the external memory K9F2808UOC, and sending the 512 bytes collected by DMA to the K9F2808 to achieve synchronization of collection and storage. The main program flow chart is shown in Figure 3. The subroutines mainly include: crystal oscillator initialization, port initialization, serial port initialization, ADC initialization, DMA initialization, timer 3 initialization, erasure program of the off-chip memory K9F2808UOC, delay program, etc.
Figure 3 Lower computer main program flow chart
Here, crystal oscillator initialization mainly completes the configuration of the external oscillator; port initialization completes the initial configuration of ports p0~p7; serial port initialization completes the configuration of timing counters T0 and T1 and the setting of the baud rate; ADC0 initialization completes ADC0 Configuration; DMA0 initialization mainly completes the configuration of DMA0, setting the external data memory start value, ADC0 start mode, etc.; Timer 3 initialization mainly completes the setting of the reload value and stimulates ADC0 to collect; the erasure of the off-chip memory K9F2808 The program completes erasing the data in K9F2808.
5 Performance testing and indoor experiments
After the hardware and software debugging, we sent the test circuit and sensor to the standard vibration table of the Petroleum Instrument Quality Inspection Center, and tested it on (10g, 1000Hz), (25g, 100Hz), (25g, 200Hz), (25g, 1000Hz) The test system was calibrated under the conditions and proved that the measurement accuracy of vibration amplitude is 1% and the measurement accuracy of vibration frequency is 5‰. This accuracy can meet the vibration measurement requirements of the steerable drilling system.
Previous article:Design of seismic survey sensor network based on C8051f020 microcontroller and UDP/IP protocol
Next article:Design of digital circuit for acoustic detection system based on CPLD chip and C8051F020
Recommended ReadingLatest update time:2024-11-23 05:05
- Popular Resources
- Popular amplifiers
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- May I ask if Mr. Yi Zhongtian mentioned in a certain program that he talked about "have you learned it?", "have you learned it thoroughly?", "have you learned it thoroughly?", in which program did he say this?
- Interpretation of how dust and water resistance testing of lamps is applied in international standards
- Is it as shown in the picture?
- PCB file conversion
- 5G indoor base stations will be released soon, and it is expected that each household will have a small base station, which will subvert the existing home Internet access methods.
- How to consider the impact of audio analog signals after being transmitted through a 100m long cable?
- Angle sensor
- Some misunderstandings and precautions of C51
- Airborne electronically scanned phased array radar
- Transistor Selection