As shown in Figure 1, the hardware of the system includes not only the ARM9-S3C2410A core board with expanded memory, but also peripheral signal conditioning, keyboard and display circuits. The A/D and signal conditioning circuit composed of MAX1324 is an important part of the data acquisition. This article mainly introduces the hardware and related software design of this part.
1 Hardware design of data acquisition
The development board ST2410 has rich hardware resources and provides a 40-pin external expansion interface, through which peripheral circuits such as signal acquisition can be easily expanded. The specific structure of the signal conditioning circuit is shown in Figure 2.
1.1 Signal conditioning circuit
The analog signal input front-end circuit uses voltage transformer (PT) and current transformer (CT) to isolate and level-convert the sampled voltage and current. The primary transformer first converts the high voltage and high current of the power grid into the standard AC 100 V and 5 A, and the secondary transformer converts it into the -10 to +10 V level required by the A/D chip MAX1324 input, thereby obtaining all the original data of the common connection point of the power system. [page]
1.2 A/D conversion
Because the voltage and current of the neutral line are used when measuring the three-phase unbalanced parameters of the power grid, although theoretically, the voltage and current values of the neutral line can be calculated through the phase voltage and phase current, the measured value should be closer to physical reality. Therefore, it is best to measure the three-phase voltage, three-phase current and the voltage and current of the neutral line at the user's common connection point in the power grid at the same time, totaling 8 analog input signals. The synchronous sampling of multiple signals can effectively overcome the phase difference problem caused by channel conversion, so the A/D should use an 8-channel synchronous sampling chip. Maxim's MAX1320 and MAX1324 are both dedicated chips suitable for the above design requirements. The analog input voltage range of MAX1324 is ±10 V, which is wider than the input voltage range of the MAX1320 chip. Under the same interference and noise conditions, the relative accuracy of A/D conversion will be higher, so MAX1324 is used. It integrates 8 independent sample-and-hold devices and 8-channel multi-way switches, which can easily realize the instantaneous acquisition of 8 analog quantities, and its conversion results are output in sequence in the form of complement code.
For an ADC with a given number of conversion bits, it is certain about the level value of the discrete data bit of the signal. The 14-bit MAX125 provides 214 discrete levels of 2×10 V/214≈1.22 mV, and the relative resolution can reach ±0.025%. In the national harmonic measurement standard, the current measurement accuracy requirements for the specified distortion rate are relatively high. Considering various situations, practice has also proved that the use of a 14-bit ADC can fully meet the design requirements of harmonic measurement.
The ARM processor chip S3C2410A of the power quality monitor also has an 8-channel 10-bit A/Dc. According to the above analysis, it is difficult for a 10-bit A/D to meet the data acquisition requirements of the harmonic monitor, and the A/D does not have a synchronous sampling function. However, when measuring the frequency of the fundamental wave of the power grid, the national standard requires that the measurement accuracy of the power frequency is 50±0.01 Hz, which means that in one cycle, more than 50÷0.01=5,000 points must be collected, so the A/D conversion time is less than 20 ms/5,000=4μs. Frequency measurement does not require high amplitude accuracy, as long as the positive and negative values can be judged normally. The conversion speed of the 10-bit A/D in the ARM chip can reach up to 500 ksps (2μs), so it is just right for measuring the fundamental frequency of the power grid. In this way, the A/DC in the MAX1324 and ARM can be used for harmonic and frequency measurement respectively.
1.3 Hardware interface between MAX1324 and processor S3C2410
The interface between MAX11324 and processor S3C2410 is shown in Figure 4. The analog supply voltage of MAX1324 is 5 V, while the digital supply voltage range allowed by MAX1324 is 2.7 to 5.25 V, which is 3.3 V in the figure. In this way, it can be directly connected to the digital I/O interface of S3C2410 without level conversion.
When performing data acquisition, the operation process is divided into the following three steps: (1) First, set the working mode of MAX1324 to instantaneous sampling of 8 channels, connect the pin ALLON to a high level, pull it low, and write all "1" to the data lines D0~D7, so that all 8 channels can be selected to realize synchronous ADC; (2) Pull down the GPA12 terminal of ARM to make the CONVST pin a low level. After the input signal reaches a stable level in the sample and hold, the A/D is started by the rising edge of CONVST. The multi-channel conversion here is performed in the order of channel numbers from low to high. When the conversion of the last channel is completed, the conversion end signals of all channels jump to a low level, and the conversion results are first stored. Stored in the corresponding 14-bit × 8 SRAM on the chip; (3) Read the analog-to-digital conversion result data. There are two ways: one is the query method. The pin of MAX1324 is connected to an I/0 pin of S3C2410. After S3C2410 starts A/D conversion, it continuously queries whether this I/0 pin is at a low level to determine whether the conversion is completed, and then reads the converted digital signal in turn; the other is the interrupt method. The pin of MAX1324 is directly connected to an external interrupt pin of S3C2410. Once the conversion is completed, an interrupt is requested to S3C2410. S3C2410 will enter the interrupt service program and read the converted data of MAX1324 in turn. In order to improve the efficiency of CPU use, the interrupt method is adopted. In Figure 4, the pin of MAX1324 is connected to the external interrupt EINT3 pin of S3C2410. When the A/D data conversion is completed, a low level will be sent to the EINT3 of S3C2410. When the EINT3 pin is at a low level, 8 read pulses will be sent to the pins of MAX1324 in succession, controlling the strobe pin to read the ADC data of the 8 channels converted by MAX1324 in a time-sharing manner. [page]
2 Interface
Drivers The tasks of the device driver include automatic configuration and initialization subroutines, which are responsible for detecting whether the hardware device to be driven can work properly. If the device is normal, the software state required by the device and its related device driver is initialized.
The device driver under Linux is organized as a set of functions with completely different tasks. Writing an A/D driver mainly completes the operations of open0, close0, read0, write0, etc. on the control registers and data registers of the A/D device, and registers them in file_operations.
static struct file_operations adcmax1324_fops = {
open: ademaxl324_open,
ioctl: adcmaxl324_ioctl,
read: adcmaxl324_read,
write: ademaxl324_write,
release: adcmaxl324_release,
}
Here are some important functions:
(1) adcmaxl324_write function: Call this function to write data OxOOFF to MAX1324 through the bidirectional data lines DATAO~DATA7, and set MAX1324 to the 8-channel simultaneous conversion mode; (2) ademax1324_ioctl function: Ioctl function tracks the signal and starts A/D conversion; (3) adcmax1324_read function: read function sends the data read in the interrupt processing function to the user program.
Finally, the initialization work is completed in init(). Including registering the device driver and applying for system resources. When writing a driver, it is usually written in the form of a module. The initialization function module_init() is called when the module is loaded, and the unloading module function module_exit() is called when it is unloaded.
3 Conclusion
This paper implements the design of data acquisition for power quality monitor based on ARM9. The hardware circuit and its related software are introduced. After experimental testing, the above data acquisition circuit based on MAX1324ECM can achieve an actual measurement accuracy of ±0.5%. The experimental results are shown in Table 1. Therefore, MAX1324ECM is fully suitable for data acquisition in power quality monitoring.
Previous article:Design of electromagnetic nondestructive detection circuit for steel material crack based on ARM
Next article:Development of Remote Intelligent House Control Device Based on ARM7
Recommended ReadingLatest update time:2024-11-17 00:41
- Popular Resources
- Popular amplifiers
- Practical Deep Neural Networks on Mobile Platforms: Principles, Architecture, and Optimization
- ARM Embedded System Principles and Applications (Wang Xiaofeng)
- ARM Cortex-M4+Wi-Fi MCU Application Guide (Embedded Technology and Application Series) (Guo Shujun)
- osk5912 evaluation board example source code
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
- [TI recommended course] #TI? Application of interface chips in automotive products#
- 【GD32E231_DIY】-01: Schematic diagram & PCB
- Live broadcast at 10 am today [ST three-phase motor control solution for home appliances]
- Apply for free evaluation! ——ESP32-S2-Kaluga-1 new multimedia development board, flexible disassembly and assembly to meet various needs
- What is the difference between a multivibrator and a bistable trigger? Their circuits are similar. What are the categories of triggers?
- Dengge's open source FOC motor driver data based on esp32 (less than 100 yuan, you can DIY it yourself)
- Key points of RF circuit design
- EEWORLD University Hall----TI.com Online Purchasing Special: Smart Buildings
- About the loop compensation part in DCDC current control mode
- Two-phase four-wire stepper motor