introduction
TI's C2000 series DSP is widely used in industrial automation, motor control, and industrial production with its excellent performance and rich on-chip peripherals. TMS320F2812 is one of the outstanding performance in the C2000 series. F2812 integrates a 12-bit 16-channel digital/analog converter on the chip, and the theoretical accuracy can reach more than 0.1%. However, due to the existence of gain error (<5%) and offset error (<2%), the accuracy can only be around 5%, so the ADC must be calibrated.
The traditional method for ADC calibration is to input known standard voltages into two channels, determine the AD conversion curve based on the principle of two points determining a straight line, and use this to calibrate the conversion value. However, due to the influence of accidental factors in the calibration process, the accuracy of this calibration method can only reach about 3%. In response to this, a calibration method using the least squares method and linear regression is proposed. By analyzing and calculating multiple measurement points, the best fitting curve is found to minimize the overall mean square error.
The least square method is a data processing method proposed by Gauss in 1809 and widely used in multidisciplinary fields. The use of the least square method to estimate unknown parameters can effectively eliminate the influence of gross errors and systematic errors in measurement. Regression analysis was first proposed by British statistician Galton in 18*. Univariate linear regression is one of the statistical analysis methods that uses regression analysis in mathematical statistics to determine the quantitative relationship between two or more variables that are interdependent. It is widely used. Generally speaking, the equation of linear regression can be obtained by the least square method, and the straight line for y=bx+a can be calculated.
1. Correction principle and implementation scheme
The input and output of the ADC module of DSP are linear. Ideally, the input-output equation should be y=x. But in fact, the ADC module has gain error and offset error. The gain error is the deviation between the actual curve slope and the ideal curve slope, and the offset error is the deviation between the actual output value and the ideal output value (0 V) when the input is 0 V. The analog input voltage of F2812 ADC is 0~3 V, and the output is 0~4095. The corresponding relationship between analog input and digital output is: digital output value = 4095×(analog input value-reference voltage value)/3.0. The input/output characteristic curve of ADC module is shown in Figure 1.
Figure 1 ADC module input/output characteristic curve
The ADC of F2812 has 16 input channels. Since the error between channels is within ±0.2%, 6 channels can be selected as the calibration input terminals, and 6 unequal standard DC reference voltages can be input respectively. By defining the structure variables in the program to read the converted values, 6 sets of coordinate points on the input/output plane are obtained. Then, the data is processed using the least squares and univariate linear regression ideas to obtain the best fitting curve, which minimizes the sum of squares of the distances from each coordinate point to the best curve (the sum of squares of the residuals).
2 Least Squares Method and Univariate Linear Regression
2.1 Least Squares Principle
For a linear model, if there are t unmeasurable unknown quantities, theoretically, the functional relationship can be obtained by measuring the directly measured quantity that has a functional relationship with the t unknown quantities t times. However, since the measured data inevitably contains measurement errors, the results obtained must also contain certain errors. In order to improve the accuracy of the results obtained, the number of measurements can be increased to n (n>t) to use compensation to reduce the impact of random errors.
Gauss believed that when obtaining unknown parameters based on observed data, the most appropriate value of the unknown parameter should be such a value, that is, to select the parameter estimate that makes the model output as close to the observed data as possible, and the degree of closeness is measured by the sum of the squares of the difference between the model output and the data. This is the basic idea of least squares. The principle of least squares method points out that the most accurate value should be obtained under the condition of minimizing the sum of squares of residual errors.
2.2 Principle of univariate linear regression
Univariate linear regression deals with the relationship between two variables, that is, if there is a linear relationship between two variables x and y, then through experiments and analysis of the obtained data, the function curve between the two is found. This is also the linear fitting problem often encountered in engineering.
3 Experimental plan and result analysis
3.1 Experimental plan
The experiment was completed using the F2812 development board and DSP debugging software CCS2.0. A stable signal source was used to generate 6 standard voltages, which were 0.2 V, 0.5 V, 1.0 V, 1.5 V, 2.0 V, and 2.5 V, and the input channels were selected as A0, A1, A2, B0, B1, and B2. The ADCL0 pin was connected to the analog ground of the circuit board, and the signal line connected to the analog input pin should avoid the digital signal line to reduce the interference of the digital signal on the analog signal. The input circuit is shown in Figure 2.
Figure 2 Input circuit [page]
3.2 Correction Algorithm
Assume that the input/output curve of the ADC module is y=a+bx, the input voltage value is xi, and the corresponding conversion output value is yi. The equation can be obtained by the least squares estimation algorithm:
Solving this system of equations gives us estimated values of a and b:
In the formula,
This gives the best fitting curve (regression equation): This equation can then be used to perform transformation value correction.
3.3 Experimental data processing
The six sets of data obtained from the experiment were processed using the least squares method and linear regression method, and the least squares estimates of a, 6 were obtained, respectively, so the regression equation is: y = 0.003 612 + 1.039 091x. Using the regression equation as the standard, the corrected transformation value can be calculated by x = (y-0.003 612) / 1.039 091 and compared with the untransformed value. The results are shown in Table 1.
In Excel, the uncorrected input/output distribution points and the regression curve are plotted as shown in Figure 3.
Figure 3 Schematic diagram of regression curve
3.4 Results Analysis
It can be seen from Table 1 and Figure 3 that if no correction measures are taken, the ADC module of F2812 will have a relative error of about 5%; and the proposed correction method can reduce the error to less than 1%. This greatly improves the accuracy of A/D conversion. For occasions with high control accuracy requirements, sacrificing the 6 channels of the ADC module to obtain relatively high conversion accuracy is still very necessary and worthwhile.
4 Conclusion
This paper proposes a method of using the least squares method and linear regression to correct the ADC module of DSP. Experiments have shown that this method can greatly improve the conversion accuracy and effectively make up for the defect of low AD conversion accuracy in DSP. This method has simple hardware circuits and low cost, and has high promotion and utilization value.
Previous article:Secondary boot loading scheme for microprocessor
Next article:Design of center positioning algorithm based on TMS320C6711B DSP
Recommended ReadingLatest update time:2024-11-16 21:34
- Popular Resources
- Popular amplifiers
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
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
- [National Technology Low Power Series N32L43x Review] 05. SPI drive TFT screen & TF card to achieve Chinese and English mixed display
- How to prevent LCD screen from moisture and humidity
- Ask for help 50 E coins
- ②. Build development environment and running lights
- Comparison between altera's USB BLASTER II and USB BLASTER
- circuitpython starts testing WebBluetooth functionality
- What are the remedies for a pulse with a shallow rising edge?
- Novice talks about the application and difference of CAN (FD), RS485/RS422, RS232, Ethernet, and EtherCat
- Initial performance test of R329 development board
- Arteli-AT32F4xx timer input capture mode