An embedded portable data acquisition and analysis instrument

Publisher:渤海湾Latest update time:2012-04-05 Source: 电测与仪表 Keywords:ARM Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

introduction

In the practice of multi-point vibration testing of rotating machinery, a variety of instruments are needed, such as oscilloscopes, dynamic balancers, vibration analyzers, etc. With the advancement of testing technology, the emergence of virtual instruments has combined them into one, greatly simplifying the complex testing work. The concept of virtual instruments is to use computers to collect data on the measured signals and analyze and display the collected data sequences. Instruments built according to the concept of virtual instruments require three parts: computers, data acquisition hardware, and analysis software. Data acquisition hardware is generally implemented by A/D boards. However, the advancement of computers and changes in buses have made the once feasible measurement structures and analysis programs unable to work properly on new buses and operating systems. A/D boards from various manufacturers generally only have simple sampling triggering methods; the confidentiality of hardware and windows underlying source code has stifled the possibility of users developing new sampling triggering methods on their own. PCs are too large to be mobile; although laptops are portable, there is almost no space to insert boards inside, and the interface performance is also delicate. These deficiencies have brought new inconveniences to testing work.

In recent years, embedded technology has developed rapidly, and data acquisition systems controlled by single-chip microcomputers are in the ascendant. However, due to the limitations of single-chip microcomputer performance, the sampling rate is limited, and the storage space is small, which cannot meet the needs of high-speed and large-capacity sampling, and it is even more impossible to make the instrument run analysis software and work independently without a computer.

ARM series microprocessors have low power consumption and much higher performance than single-chip microcomputers, making it possible to implement virtual instruments on embedded systems. This paper designs an embedded data acquisition and analysis instrument based on ARM7TDMI to achieve the above purpose.

Hardware structure and working principle

The hardware structure and working principle of the instrument are shown in Figure 1. The processor uses Samsung's s3c44b0x to replace the 51 single-chip microcomputer, which achieves a higher operating frequency and more powerful data processing capabilities while maintaining low power consumption. Its ARM7TDMI core uses improved RISC design ideas to obtain a better power performance ratio, with a low power consumption of 0.06mW/MHz, ensuring that the instrument can work for a long time under battery power conditions. The three-level instruction pipeline of ARM7 provides an instruction efficiency of 0.97MIPS/MHz, which is close to executing one instruction per cycle.


Figure 1 Hardware structure and working principle diagram

S3c44b0x is connected to an external 10MHz crystal oscillator, and runs at a main frequency of 64MHz through internal PLL multiplication. This main frequency is 5 to 10 times higher than that of ordinary microcontrollers, ensuring that the processor can provide additional computing time for data analysis while controlling high-speed A/D for data acquisition. In addition to the ARM7TDMI core, s3c44b0x also provides peripherals such as PWM counter, UART, DMA, 8-channel 10-bit precision A/D converter, etc.

In terms of memory, the system is equipped with 8Mbyte SDRAM and 16Mbyte FLASH. The large capacity SDRAM provides sufficient space for program operation and data acquisition cache. Part of the FLASH is used as the system startup memory; part of it stores the acquired data, which will not be lost even if the power is off. The memory is connected to the processor through 16-bit data lines, address lines and chip select lines. S3c44b0x provides eight memory chip select spaces (banks).

A/D converter is a key component of data acquisition. The instrument has two A/D converters. One is the A/D converter inside s3c4bb0x, which has 10-bit accuracy and a maximum speed of 100kSps for 8 channels and single channel. The other is AD7859 chip from AD company, which has 12-bit accuracy, a maximum speed of 200kSps for 8 channels and single channel, and comes with a sample-and-hold device. AD7859 is connected to the processor through 16-bit data line, address line and chip select line, occupying a memory bank. The processor accesses AD7859 in the way of accessing memory, and can also use the processor's DMA to control data transmission. The trigger end of AD7859 is connected to the external clock input end of the instrument and the counter output end of the processor through a multi-way switch to realize multiple triggering modes. In addition, the processor can also trigger AD7859 to sample by sending commands through the data line.

The USB controller is the main component of data transmission. This instrument uses the PDIUSBD12 chip from Philips, which complies with the USB1.1 standard and has a data transmission speed of 12Mbps. As a slave, PDIUSBD12 is connected to s3c44b0x through 8-bit data lines, address lines, and chip select lines, occupying a memory bank. The INT_N pin of PDIUSBD12 is connected to the EINT2 pin of s3c44b0x, and notifies the processor to handle the call of the USB host computer through an interrupt. The hardware connection circuit schematic diagram of PDIUSBD12 is shown in Figure 2.


Figure 2 PDIUSBD12 hardware connection schematic diagram

The human-machine interface of the instrument consists of a 320×240 high-resolution monochrome LCD and a 4×4 keyboard. The LCD module is connected to the s3c44b0x with 8-bit data lines, address and chip select, occupying one memory bank. [page]

Software System

The software system mainly includes five parts: initialization program, operating system, sampling trigger program, USB firmware and application software.

Initialization program
The initialization program is written in assembly language for s3c44b0x. Before handing control to the operating system, it initializes the most basic hardware devices. The main work is to configure SDRAM and copy the operating system code from FLASH to SDRAM. The main code of this part is as follows:

ResetHandler:
ldrr0,=WTCON;//watchdogdisable
ldrr1,=0x0
strr1,[r0]
mrsr0,cpsr;//disableinterrupt
orrr0,r0,#0xc0
msrcpsr,r0
/*Setclockcontrolregisters*/
ldrr0,=LOCKTIME
ldrr1,=2000;    //count=t_lock*Fin
strr1,[r0]
ldrr0,=PLLCON
ldrr1,=0xf8033;    //MCLK=64MHz
strr1,[r0]
ldrr0,=CLKCON
ldrr1,=0x7ff8;    //AllunitblockCLKenable
strr1,[r0]
;/*Setmemorycontrollerregisters,initializeSDRAM*/
ldrr1,=0x11110002;//BWSCON
ldrr2,=0X600; //GCS0FLASHROM
ldrr3,=0X7FFC; //GCS1LCDCONTROLLER
ldrr4,=0X7FFC; //GCS2
ldrr5,=0X7FFC; //GCS3
ldrr6,=0X7FFC; //GCS4
ldrr7,=0X7FFC; //GCS5
ldrr8,=0X18000; //GCS6SDRAM
ldrr9,=0X18000; //GCS7SDRAM
ldrr10,=0x820419; //REFRESH
ldrr11,=0x16; //BankSize
ldrr12,=0x20; //MRSR6
ldrr13,=0x20; //MRSR7
ldrr0,=0x01c80000; //BWSCONAddress
stmiar0,{r1-r13}
;/*Copyentireprogramsto0x0c008000atSDRAM*/
ldrr0,=0x0;//startaddressoftheflashrom
ldrr1,=0xc008000;  //targetaddressintheSDRAM
ldrr2,=0x128e0;  //thenumberofbytesneedtocopy
COPY:
ldr    r3,[r0],#4
str    r3,[r1],#4
subs    r2,r2,#4
bne    COPY
ldrr4,=0xc007ffc;//jumptoSDRAM
addpc,pc,r4
............
b__main;//jumptoOS

Operating system
The instrument uses μC/OS-II embedded operating system. μC/OS-II is an open source preemptive real-time embedded kernel, which guarantees the real-time performance of the system. In this system, a high-priority task that is ready can deprive the running low-priority task of the CPU usage right. As long as the priority of the data acquisition task is high enough, the data acquisition process can be guaranteed not to be interrupted, thus ensuring the continuity and integrity of the data.

μC/OS-II is easy to port. You only need to modify three files for s3c44b0x to complete the porting work. These three files are OS_CPU.H, OS_CPU_A.ASM, OS_CPU_C.C. The main modification is the SWI soft interrupt exception response, interrupt routine and task switching routine. Other files are processor-independent and generally do not need to be modified. The function menu selection task is the lowest priority task. This task is run when no other high-level tasks are running. When in use, select the required function through the LCD display and keyboard to perform sampling and measurement work.

Sampling trigger mode
In addition to the internal trigger, external trigger, and timing trigger modes that other instruments have, this instrument also designs a frequency multiplication trigger mode and a single A/D multi-channel parallel delay-free trigger mode according to the needs of industrial test sites.

(1) Internal trigger mode, that is, sampling is triggered by a square wave, and the operator specifies its frequency fs, time length (measurement point length) T and start time, also known as digital trigger. This is a function that general A/D boards have. If the sampled data is cached and each value is compared with the specified voltage value, level triggering can be achieved. That is, the sampled data is stored only when the sampling level reaches and exceeds a certain threshold. The instrument also has a dedicated IO line, and the sampling is triggered by the level change event of the IO line, which can achieve pre-triggering and post-triggering. Pre-triggering means that sampling is performed only after the IO line event occurs, with the pre-selected sampling frequency fs and truncation length; post-triggering means sampling at the pre-selected sampling frequency fs before the IO line event occurs, and sampling ends when the IO event occurs. [page]

(2) Frequency doubling triggering method. During the speed increase or decrease process of large rotating equipment, it is necessary to understand the performance of the critical speed process at each bearing or a certain cross-section measuring point on the shaft. Conventional time-sharing inspection is not allowed, and a special triggering method is required. In this case, frequency doubling triggering is often used for sampling. That is, the rotor speed signal is used for external synchronization, and N points are sampled per revolution. When the speed changes, the instrument automatically corrects the sampling frequency to ensure that the sampling of the corresponding points of each channel is at the same time, and at the same time, accurate rotor speed information is obtained.

To achieve this triggering method, the speed signal needs to be connected to the external clock input of the instrument. The speed signal is generally a square wave with one cycle per revolution. A sampling cycle generally includes four speed signal cycles: In the first cycle, when the processor detects the rising edge of the external clock signal through querying, an internal counter starts counting at a specified frequency. This counter is called a cycle counter. When the rising edge is detected again, the counting stops. At this time, the value of the counter contains the cycle information of the speed signal. In the second cycle, this value is divided by N (the number of sampling points per cycle) and passed to another counter. The second counter is called a trigger counter. The counting frequency is the same as that of the cycle counter, and the output frequency is the sampling frequency. At this time, the sampling frequency is equivalent to N times the speed signal, realizing frequency multiplication. When the processor detects the rising edge again (the third cycle), the trigger counter starts counting, and the output signal triggers the A/D sampling to collect data for two cycles. This cycle repeats. The flowchart of the entire sampling program is shown in Figure 3.


Figure 3 Flowchart of externally triggered full-cycle frequency multiplication sampling

After frequency doubling, N points can be accurately collected per cycle and evenly distributed; using the rising edge of the speed signal as the sign of the start of sampling ensures that the sampling starts at the beginning of each cycle and ends at the end of each cycle. The speed signal cycle measurement is performed before each sampling to ensure that the sampling frequency can follow the speed signal changes. Due to the inertia and acceleration limitations of large rotating machinery, the adjacent rotor speed changes are not large, and can be predicted and corrected during the test process. These measures strictly guarantee the full periodicity of the sampling. Although the data obtained is intermittent, since its start and end phases are the same, it will not affect the subsequent data analysis after being connected together.

(3) Multi-channel parallel triggering mode without time delay. Multi-channel inspection tests are usually completed one by one in time division, which sometimes introduces errors. When performing modal measurements at industrial sites, whether it is one-point excitation, multi-point measurement, or multi-point excitation, two-point (excitation point and response point) measurement, the data measured at each measuring point is required to be at the same time (without time delay). For example, when testing the performance of each measuring point over critical speed during the acceleration and deceleration of a large rotor, there is such a requirement of no time delay.

In order to ensure that each measurement point has no delay, before each sampling, the state of each channel is held by the sample holder, and then the A/D is allowed to scan and sample each channel at the fastest speed, and then the hold is released to prepare for the next scan measurement. After the collected data is sorted, the actual sampling sequence of each channel can be obtained. This triggering method sacrifices the highest sampling rate of the A/D, and uses one A/D to achieve multi-channel parallel delay-free sampling. Compared with the method of multiple A/Ds working in parallel, the cost is much lower.

USB firmware
The USB driver on the instrument is also called USB firmware. After the instrument is connected to the host computer, PDIUSBD12 responds to the host computer's signal and sends an interrupt request to ARM7. ARM7 responds to the interrupt and calls the program in the firmware to process the host computer's request and send data. Data is transferred from SDRAM or FLASH to PDIUSBD12, which sends it to the host computer. Data transmission uses bulk mode to ensure accuracy. Actual transmission experiments show that the transmission speed reaches 1Mbytes. [page]

Application software
Data analysis software is the main part of the application software of this instrument. The data analysis software currently developed is the oscilloscope function software. This instrument can trace the waveform on a large-screen LCD display while collecting data. The realization of this function fully reflects the advantage of ARM7's faster computing speed than the single-chip microcomputer. The maximum sampling rate of A/D is 200ksps, that is, each sampling cycle is 5ηs. ARM7 runs at a main frequency of 64MHz, and each cycle is 15.625ns. In this way, each sampling cycle includes 320 main frequency cycles. ARM7 has an instruction efficiency of 0.97MIPSMHz, and 320 main frequency cycles can run about 310 instructions. When the counter triggers A/D sampling, the processor's job is to read data from A/D once per sampling cycle and save it to RAM. The code is as follows:

LDRr0, [r1]; /*Register r1 stores the address of the A/D data register; requires 3 cycles*/
STRr0, [r2, #4]!; /*Register r2 stores the starting address of the data storage space in RAM; requires 2 cycles*/

This operation requires 5 main frequency cycles. Using the remaining A/D conversion time, ARM7 can display the data collected last time on the large-screen LCD to achieve waveform tracing, making it convenient for users to observe signals on site and saving the trouble of carrying an oscilloscope. This is not available in other data acquisition instruments.

Taking full advantage of the high performance of ARM7, other data analysis and processing can also be performed. Other data processing functions are currently under development. Most of the μC/OS-II operating system is written in C language, which is easy to develop. In addition to the software modules that come with the instrument, users can develop new modules themselves to continuously expand functions.

Experimental data

The embedded data acquisition analyzer designed according to the above ideas has been preliminarily realized. The experiment was carried out using the built-in A/D converter of s3c44b0x. The internal trigger mode and the frequency multiplication trigger mode were selected to collect 714Hz triangle waves respectively. The internal trigger mode selected the highest sampling frequency fs=100kHz and the sampling length was 512 points; the frequency multiplication trigger mode selected 32 times (N=32) and collected 4 cycles (M=4); two groups were sampled each time. The collected data was transferred to the computer via USB, and the data was processed using Matlab software, and the waveforms were drawn respectively; after FFT, the amplitude-frequency diagram was drawn. The results are shown in Figure 4.

It can be seen from the figures in Figure 4 that the waveform drawn by the data collected by this instrument is smooth and free of noise, indicating that the instrument has achieved its performance indicators.


Figure 4 Sampling comparison and analysis of triangle wave

Comparing the figures in Figure 4, we can see several differences between the two triggering methods:

(1) There is a phase difference between the two waveforms in Figure 4a and Figure 4c, while the phases of Figure 4e and Figure 4g are the same. This shows that the start and end time of the internal trigger sampling is random, while the start (starting at the external trigger) and end (ending at the end of the entire cycle) of the double frequency trigger sampling are relatively fixed.

(2) The waveforms in FIG. 4a and FIG. 4c are not full cycles; the waveforms in FIG. 4e and FIG. 4g are full 4 cycles.

(3) Reflected in the respective FFT amplitude-frequency diagrams: Figure 4b and Figure 4d both have obvious leakage effect and fence effect, and the maximum sidelobe amplitude is 5.75% of the one-fold frequency amplitude; Figure 4f and Figure 4h are both clean spectrum lines of the nth harmonic component of the triangle wave, and the maximum sidelobe amplitude is only 1.09% of the one-fold frequency amplitude. The above phenomenon shows that the frequency-doubling trigger mode can ensure the whole cycle truncation of the sampling data sequence and ensure that the sampling frequency is an integer multiple of the fundamental frequency of the signal to be measured, which is conducive to improving the accuracy of FFT signal analysis; internal trigger sampling does not have this feature due to the artificiality of its sampling frequency and truncation length, as well as the randomness of the start and end. To obtain good FFT results, either modify the sampling frequency and truncation length, or add a special window function, which brings a lot of trouble to the test process.

Each measured signal has different characteristics. Choosing the right trigger mode can filter out useless signals and obtain more useful signals. For example, when performing vibration testing on rotating machinery, the frequency doubling trigger mode provided by this instrument can obtain a full-cycle signal suitable for FFT, which is conducive to subsequent analysis; other trigger modes are not suitable. When collecting excitation vibration signals, it is necessary to use a level trigger mode to accurately obtain the signal starting from the excitation. As an instrument designer, you should conduct more test practices, understand the actual needs of various tests, and continuously enrich the sampling trigger mode of the instrument to meet the needs of different test environments.

in conclusion

In summary, the data acquisition analyzer developed based on ARM7 has a single-channel data acquisition capability of up to 200ksps, and its major feature is the virtual instrument function of displaying waveforms on site and performing data analysis. The rich sampling triggering methods enable the instrument to calmly cope with the special requirements of more test environments. The USB interface is convenient for connecting to a computer to transmit data, and the speed can reach 1Mbytes.

Since the concept of virtual instruments was proposed in the 1990s, virtual instruments have greatly improved the flexibility and applicability of instrument design and application. With the rapid development of embedded systems and the continuous improvement of microprocessor performance, it is a trend in instrument development to make virtual instruments portable and free instruments from the constraints of computers while maintaining their functional flexibility. Although the embedded portable data acquisition and analysis instrument based on ARM7 has only preliminarily realized the functions of portable virtual instruments, it has proved the feasibility of this theory in practice. With the continuous development and upgrading of application software, it is also an inevitable result to realize all the current virtual instrument functions.

Keywords:ARM Reference address:An embedded portable data acquisition and analysis instrument

Previous article:Research and design of embedded file system based on ARM and SD card
Next article:Design of navigation and positioning function of logistics information terminal based on Qt/Embedded

Recommended ReadingLatest update time:2024-11-16 20:59

EU suspends investigation into Nvidia's acquisition of ARM
Nvidia wants to acquire British chip design company ARM. According to information provided by the European Commission, the EU antitrust authorities have temporarily suspended their investigation into the acquisition as they wait for more information.    The deadline set by the European Commission was November 25, and
[Semiconductor design/manufacturing]
ARM Cortex-A9 (tiny 4412)
Require Transplant Linux to add system calls and burn them to the development board detailed steps 1. Build Linux compilation environment 1. Installation of GCC compiler: tar xzvf arm-linux-gcc-4.5.1-v6-vfp-20120301.tgz  -C/ arm-linux-gcc -v //View GCC version 2、gedit ~/.bashrc export PATH=$PATH:/opt/FriendlyAR
[Microcontroller]
ARM Cortex-A9 (tiny 4412)
Nvidia and ARM's deal has sounded the alarm for the industry
The deal to sell ARM to Nvidia for $40 billion has caused a lot of discussion in the industry, but some of ARM's partners have remained silent.   "This is shocking news and spells trouble for many manufacturers," said Mark Lippett, chief executive of XMOS processor design in Bristol, England. "Contrary to traditional
[Embedded]
Nvidia and ARM's deal has sounded the alarm for the industry
ARM7 LPC2138 digital frequency meter design source code and report
1.1 Design Principle Frequency is the number of times a periodic signal changes within a unit time (1s). If the number of repeated changes of this periodic signal measured within a certain time interval T is N, then its frequency can be expressed as f=N/T. Among them, f is the frequency of the measured signal, N is t
[Microcontroller]
ARM7 LPC2138 digital frequency meter design source code and report
Design of SWI abnormal interrupt processing program for ARM
This section mainly introduces several issues that need to be paid attention to when writing SWI handlers, including determining the SWI interrupt number, writing SWI exception handling functions in assembly language, writing SWI exception handling functions in C language, using SWI exception interrupt processing in pr
[Microcontroller]
Design of SWI abnormal interrupt processing program for ARM
ARM's 9 addressing modes
ARM's 9 addressing modes 1) Immediate addressing The operand is an immediate value, prefixed with "#", and "0x" is used to represent a hexadecimal value. example: MOV R0,#0xFF00 ;0xFF00 - R0 SUBS R0,R0,#1 ;R0 – 1 - R0   2) Register addressing The value of the operand is in the register, and the register value is direc
[Microcontroller]
Huang Renxun: Nvidia doesn’t have to acquire Arm
According to foreign media reports, Nvidia's $40 billion acquisition of Arm has attracted much attention since it was announced on September 13 last year. Foreign media have previously reported that many Silicon Valley technology giants opposed Nvidia's acquisition of Arm, and Arm's co-founder Hermann Hauser also oppo
[Semiconductor design/manufacturing]
Huang Renxun: Nvidia doesn’t have to acquire Arm
ExecuTorch Beta Released to Accelerate Generative AI Development on the Edge on Arm Platforms
The combination of the Arm computing platform and the ExecuTorch framework enables smaller and more optimized models to run on the edge, accelerating the implementation of generative AI on the edge New Llama quantization model for Arm-based AI applications on both the edge and on the edge reduces m
[Embedded]
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号