1. Composition of virtual instruments
In terms of components, the virtual instrument system is composed of computers , application software and instrument hardware. Computers and instrument hardware are also called VI's general instrument hardware platform. Virtual instruments based on PC platforms not only have powerful software development resources, but also have low costs and are suitable for ordinary users. This design is implemented using a PC DAQ system. The system structure of this design is shown in Figure 1. It mainly uses Advantech's PCL2818LS data acquisition card to build computer hardware peripheral circuits to achieve signal conditioning and high-speed data acquisition. The PCL2818LS data acquisition card has the following functions and features:
16 single-ended or 8 differential analog inputs; 40 kHz 12-bit A/D converter ; programmable gain for each input channel; automatic channel/gain scanning with DMA; 16 digital inputs and 16 digital outputs; one 12-bit analog output channel (D/A conversion); programmable timing trigger/counter; software support includes VisiDAQ 3.1, ActiveDAQ and Windows 3.1/95/NT high-speed DLL drivers. Since the measurement signal is not hardware filtered , the collected signal must be digitally filtered, otherwise it will cause great interference to the measurement result and affect the measurement accuracy.
2 Digital filter structure
Digital filter is used to filter the input signal.
The so-called digital filter refers to a device whose input and output are both digital signals, and which changes the frequency components contained in the input signal through a certain operation relationship. Compared with analog filters, the main advantages of digital filters are:
(1) High accuracy and stability;
(2) System functions are easy to change, so they are highly flexible;
(3) There is no impedance matching problem;
(4) Easy to integrate on a large scale;
(5) Multi-dimensional filtering can be achieved. A digital filter can be expressed as a system function:
There are two ways to implement digital filters: one is to use a general-purpose computer, and use the computer's memory, arithmetic unit and controller to compile the operations performed by the filter into a program and execute it through the computer, that is, to use computer software to implement it; the other method is to design dedicated digital hardware to implement it. There are two types of digital filters: IIR and FIR. From a structural point of view, IIR digital filters use a recursive structure, and FIR digital filters mainly use a non-recursive structure. Since the infinite impulse response filter IIR has the characteristics of infinite memory and a small number of operation items, this article will introduce the design method and implementation of the IIR filter to meet the technical indicators of the filter in the "terminal".
3 IIR filter design theory and method
The structure of the recursive filter and the form of its transfer function determine its design method. The transfer function of the recursive filter is generally in the form of formula (1). Designing a recursive filter is to determine the coefficients ak and bk of the filter so that it meets the technical specifications of the filter.
3.1 Recursive Filter Design
There are two main methods for designing IIR digital filters. One is to use the theory of analog filters for design; the other is computer-aided design, which is to use the optimal technology for design. His design steps are as follows:
(1) Determine the transfer function H(s) of the analog filter that meets the required technical specifications;
(2) Digitize the analog filter. To design a digital filter using an analog filter, the s plane is mapped to the z plane, so that the analog system function Ha(s) is transformed into the required digital filter system function H(z). This mapping relationship from complex variable s to complex variable z must meet two basic requirements:
① The frequency response of H(z) must be able to mimic the frequency response of Hz(s), that is, the imaginary axis jΩ of the s plane must be mapped to the unit circle ejΩ of the z plane, that is, the frequency axes must correspond;
② The causally stable Ha(s) should be able to be mapped into the causally stable H(z), that is, the left half plane of the s-plane Re(s)<0 must be mapped to the interior of the unit circle of the z-plane |z|<1.
The above two conditions maintain both the frequency characteristics and the stability of the analog filter, so the frequency characteristics and the stability of the digital filter obtained by the mapping relationship remain unchanged.
3.2 The solution of obtaining digital filter from analog filter
There are three main solutions for converting from analog filters to digital filters:
Design steps: Convert the given digital filter into an analog low-pass filter according to certain technical indicators; design the analog low-pass filter H(s) according to the converted technical indicators. Then convert H(s) into H(z): For the design of high-pass, band-pass or band-stop digital filters, first convert their technical indicators into the technical indicators of the corresponding low-pass analog filter as a "sample", then perform frequency conversion, and then design the low-pass H(s) according to the above steps, and then convert H(s) into the required H(z).
The main disadvantage of the impulse response invariance method to design IIR digital filters is that the amplitude response of the digital filter produces aliasing distortion. The bilinear transformation method can overcome this disadvantage, but it causes frequency distortion. The nonlinear distortion of the frequency scale of the bilinear transformation can be compensated by the pre-distortion method, that is:
The analog filter is designed according to these two pre-distorted frequencies ΩP and ΩT, so that the digital filter obtained by bilinear transformation has the desired cutoff frequency characteristics. Therefore, this article discusses the latter method. The bilinear transformation method first finds the transfer function H(s) of the analog filter, and then finds the corresponding transfer function H(z) of the digital filter:
T is the sampling period.
[page]
4 Design and implementation of virtual IIR digital filter
4.1 Software
In the concept of virtual instrumentation, "software is the instrument". In addition to the basic software such as the operating system required by the computer, the software used in the virtual instrumentation system also requires device driver software and user applications. Powerful, ready-made driver software is the heart of the data acquisition system. It provides users with a powerful application programming interface (API) using different programming environments and languages. The driver software hides the underlying, complex hardware programming details while maintaining high performance, providing users with an easy-to-understand interface. For device driver software, it is generally provided by the manufacturer of the hardware device or interface board. When programming, users only need to directly call these device drivers, which generally comply with the VISA (Virtual Instrument Software Architecture) standard.
For user application software, we selected the tool software VB, which has the characteristics of short development cycle, good product visibility, high reliability and strong maintainability. The software development steps are as follows:
(1) Create a form according to the design requirements, and then edit the code in the code editing window. The form should contain input control information and output display information. In the program code, perform digital filtering on the collected raw signal to prepare for the subsequent electrical parameter measurement.
(2) Use file input and output operations to store data or read data from files to facilitate storage and display of waveform data. It can also be used to print and analyze results.
(3) VB 6.0's debugging tools include breakpoints, break expressions, watch expressions, running statement by statement, running procedure by procedure, and displaying the values of variables and properties through a window. VB 6.0 also includes special debugging features, such as editing during execution, setting the next execution statement, and performing procedure testing when the application is in break mode.
4.2 Design and Implementation of IIR Digital Filters
This design uses a digital Butterworth filter. The amplitude response of the Butterworth filter has the flattest characteristics in the passband, and the amplitude characteristics are monotonically changing in the passband and stopband. The amplitude square function of the analog Butterworth filter is:
Where ω is the angular frequency, ωc is the cutoff frequency, and N is the order of the filter. From equation (9), it can be seen that as N increases, the amplitude response curve becomes steeper near the cutoff frequency, that is, more parts of the amplitude are close to 1 in the passband, and decrease to zero at a faster rate in the stopband. If s is used instead of jω, that is, after analytical extension, equation (9) can be written as:
This gives the extreme point
From the above formula, we can see that the pole distribution of Butterworth filter has the following characteristics: there are 2N poles in the s plane, which are equally spaced on a circle with a radius of ωc. These poles are symmetrical to the imaginary axis, and there are no poles on the imaginary axis. When N is an odd number, there are two poles on the real axis. When N is an even number, there are no poles on the real axis. The angular distance between each pole is π/N, and the Butterworth transfer function is as follows:
When N is an even number:
When N is an odd number:
According to the above method, we have compiled a design program for IIR digital filters. Using this program, you only need to select the analog low-pass filter prototype and the target filter type, input the sampling frequency ω and the target filter cutoff frequency ωc, and you can automatically complete the design of the IIR digital filter. For example, the design example of a 3rd-order low-pass digital filter is as follows:
A normalized 3rd-order Butterworth low-pass filter is selected as the design model, with a sampling frequency of 10 kHz and a cutoff frequency of 1 kHz. The transfer function of the low-pass digital filter obtained by running the design program is:
The amplitude-frequency diagram is shown in Figure 2.
A normalized 3rd-order Butterworth low-pass filter is selected as the design model, with a sampling frequency of 10 kHz, a cutoff frequency ωc1 of 1 kHz, and ωc2 of 2kHz. The transfer function of the bandpass digital filter obtained by running the design program is:
The amplitude-frequency diagram is shown in Figure 3.
5 Conclusion
Digital filters can be programmed to realize various systems to meet different needs, and the coefficients can be changed at any time, the filter parameters can be adjusted, and the best solution can be selected. The use of virtual instruments to gradually replace traditional instruments has become a development trend in the testing field. However, in practical applications, it is still necessary to optimize the program and combine software and hardware according to specific circumstances to enable virtual instruments to perform at higher performance. The innovation of the author of this article is to use the VB software platform to develop electrical parameter measuring instruments, etc. Virtual instruments achieve higher efficiency, save more hardware expenses, facilitate system maintenance and reduce the burden of instrument updates.
Previous article:Optimizing Automated Test Applications on Multicore Processors Using NI LabVIEW
Next article:Application of NI Compact RIO in Multi-physics Field Measurement of Marine Environment
Recommended ReadingLatest update time:2024-11-16 17:47
- Keysight Technologies Helps Samsung Electronics Successfully Validate FiRa® 2.0 Safe Distance Measurement Test Case
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Seizing the Opportunities in the Chinese Application Market: NI's Challenges and Answers
- Tektronix Launches Breakthrough Power Measurement Tools to Accelerate Innovation as Global Electrification Accelerates
- Not all oscilloscopes are created equal: Why ADCs and low noise floor matter
- Enable TekHSI high-speed interface function to accelerate the remote transmission of waveform data
- How to measure the quality of soft start thyristor
- How to use a multimeter to judge whether a soft starter is good or bad
- What are the advantages and disadvantages of non-contact temperature sensors?
- 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
- 5G Network Slicing
- Static Electricity Protection Measures in Circuits
- Portable energy storage power supply-Nanxin Semiconductor enters the market with strength
- Summary of the characteristics of 5 wireless transmission protocols for the Internet of Things
- Can dual 12V power supplies be used in parallel?
- MSP-FET430UIF driver cannot be installed in Windows 7
- Use GD32 to make a music spectrum to practice
- Zhou Ligong ZDS1104 and Macosin Oscilloscope STO1104C Operation Video (Transferred)
- Energy Harvesting with MSP430 FRAM Microcontrollers
- Live FAQ|Maxim IO-Link Solution