Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 150 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
150
Dung lượng
758,75 KB
Nội dung
4-1 Application Examples Several MSP430 application examples are given in the following sections. Common to nearly all of them is the storage of calibration data, tables, constants, etc. in the external EEPROMs. External EEPROMs are used for safety reasons. If the microcomputer fails completely, it is still relatively easy to read out the accumulated consumption values. This is usually impossible if these values reside in internal EEPROMs. These EEPROMs can also store tables that describe the principal errors of a given measurement principle that is dependent on the input value (current, flow, heat etc.). The MSP430, with its excellent table processing capabilities, can determine the right starting value out of these tables and calculate the lin- ear, quadratic or cubic approximation value. The following figure shows the principal error of a meter. The complete range starting at 1% up to 200% is di- vided into sub ranges of different length. A stored table would contain the start- ing point, the different distances and the inherent error at the beginning of each range. With this information, the MSP430 can calculate the error at any point of the measurement range. Chapter 4 4-2 4.1 Electricity Meters 4.1.1 Overview The MSP430 can be used in two completely different kinds of electronic elec- tricity meters. The difference between the two methods is mainly where the electrical energy W + ŕ U I dt is measured: - The electrical energy is measured in a front-end separated from the MSP430. Several methods exist for doing that: Hall effect sensors, Ferra- ris wheel pick-ups, analog multipliers, etc. The interface to the MSP430 is normally a train of pulses, where every pulse represents a defined amount of energy (Ws, kWs, Wh). All family members can be used for this purpose. - The electrical energy is calculated by the MSP430 itself, using its 14-bit analog-to-digital converter (ADC) for the measurement of current and volt- age. Only the MSP430C32x can be used for this purpose. The two different methods are shown in Figure 4–1 32 kHz32 kHz Error ms kWh COM SEL P0.x P0.y SV CC Pulses MSP430C31x V SS V CC Frontend Peripherals COM SEL P0.x SV CC MSP430C32x V SS V CC Peripherals A1 A0 Voltage Current Voltage Current LCD Figure 4–1. Two Measurement Methods for Electronic Electricity Meters The second method is mainly used with the electricity meters described in this chapter. The unnecessary front end gives a cost advantage when compared 4-3 Application Examples to the two-chip solution. An example for the 1st method that uses a front end is shown at the end of this chapter. 4.1.2 The Measurement Principle The principle used (Reduced Scan Principle) measures current and voltage in regular time intervals and multiplies the current and voltage samples. The multiplication results are summed up, with the sum representing the con- sumed energy (Ws, kWh). While the method normally used measures voltage and current at exactly the same time, the Reduced Scan Principle (a protected TI method) alternately measures voltage and current samples. Every sample is used twice; once it is multiplied with the value measured before and once with the value measured afterwards. To further reduce the required multiplica- tions, these two multiplications are reduced to one by using the sum of the two voltage samples. This measurement principle is shown in Figure 4–3. The following shows the measurement sequence for a single-phase measure- ment. Current and voltage are measured alternately. The time, α, represents the angle between related voltage and current samples. Voltage Current Voltage Current Time 1/ARR Repetition Time α Figure 4–2. Timing for the Reduced Scan Principle (Single Phase) Where: α Inherent Phase Shift of the Measurement Method [rad] Repetition Time Length of a complete measurement cycle [s] 1/ARR Time Distance between two ADC Conversions [s] Note: The Reduced Scan Principle is intellectual property of Texas Instruments. This measurement principle may be used only with the microcomputers pro- duced by Texas Instruments. 4-4 Voltage Current Power ++ Time Sampling Point ∆t φ –– Figure 4–3. Reduced Scan Measurement Principle The measured energy W (for a single phase) is: W + ȍ t+R t+0 i n ǒ u n*1 ) u n)1 Ǔ ∆t Where: W Accumulated energy [Ws] i n Current sample at time t n [A] u n–1 Voltage sample at time t n–1 [V] u n+1 Voltage sample at time t n+1 [V] ∆t Sampling interval between appertaining voltage and current measurements [s] 4-5 Application Examples 4.1.2.1 The Inherent Error of the Reduced Scan Principle The Reduced Scan Principle has a small inherent error caused by the phase shift ∆t, once inductive and once capacitive, due to the time interval between voltage and current measurements. Any calculated energy sample shows this error, it is independent of the phase angle ϕ between voltage and current. The value, e, of this error is: e + ( cos ( ∆t f 2p ) * 1 ) 100 where: e Error [%] ∆t Sampling interval between voltage and current measurements [s] f AC frequency [Hz] For example, with the values (f = 60 Hz, ∆t = 300 µs) the inherent error is –0.639%. This error can be eliminated during runtime by a multiplication of the accumulated energy with the correction factor c: c + 1 cos ( ∆t f 2p ) The correction factor, c, is normally included in the calibration constants (slope and offset) and not used explicitly. For a multiple-phase electricity meter, the Reduced Scan Principle is used for all phases one after the other. This is described in the following chapters. Derivation of the inherent error The flawless equation (except the quantization error) for the electric energy W is: W + ȍ t+R t+0 i n u n ∆t The equation used for the Reduced Scan Principle is: W + ȍ t+R t+0 i n ǒ u n*1 ) u n)1 Ǔ ∆t 4-6 Where: u n = U × sinωt Voltage sample at time t i n = I × sin(ωt+ϕ) Current sample at time t u n–1 = U × sin(ωt–α) Voltage sample at time t – ∆t u n+1 = U × sin(ωt+α) Voltage sample at time t + ∆t α Angle in radians between current and voltage samples (α = ω∆t = 2π×f×∆t) ∆t Time between appertaining current and voltage samples ϕ Phase angle in radians between voltage and current The error e of an energy sample due to the Reduced Scan Principle is: e + erroneous correct * 1 e + 0.5 I sin ( ωt ) f ) ( U sin ( ωt * α ) ) U sin ( ωt ) α )) U sin ωt I sin ( ωt ) f ) * 1 e + 0.5 ( sin ( ωt * a ) sin ( ωt ) α )) sin ωt * 1 e + 0.5 ( sin ωt cos α * sin α cos ωt ) sin ωt cos α ) sin α cos ωt ) sin ωt * 1 e + 0.5 ( 2 sin ωt cos α ) sin ωt * 1 + cos α * 1 e + ( cos α * 1 ) 100 + ( cos ( 2p f ∆t ) * 1 ) 100 or in percent This result means that the error of each energy sample calculated with the Re- duced Scan Principle shows a constant value e. This inherent error depends only on the angle α between the current and the voltage samples; it is indepen- dent of the phase angle ϕ and of the sample point of the measurement inside the sine wave. So for all samples, the same correction can be used. 4.1.2.2 The Advantages of the Reduced Scan Principle 1) Only 50% of the measurements are necessary because every measured current or voltage sample is used twice 2) Only 50% of the multiplications are necessary because two voltage sam- ples are added before the multiplication 3) Only one ADC is needed compared to up to six with the usual method. 4-7 Application Examples 4) The computing power gained by reducing the number of multiplications can be used by the microcomputer for other system tasks. The MSP430 is able to do the task of the front-end and of the host computer. 5) The Reduced Scan Principle is nearly independent of frequency devi- ations of the ac. See Section 4.1.2.4 for results. 6) The Reduced Scan Principle is also nearly independent of the interrupt la- tency time of the microcomputer. See Section 4.1.2.5 for results. The Reduced Scan Measurement Principle is implemented in an evaluation board for a 3-phase meter, which shows a typical error of 0.2%. 4.1.2.3 Measurement Errors for Some Sampling Frequencies Table 4–1 gives an overview for the measurement errors dependent on the sampling frequency. The inherent error shows the error for the ac frequency (50 Hz or 60 Hz). The 3rd harmonics error shows the corrected measurement error for the 3rd harmonic of the ac frequency (150 Hz or 180 Hz). The 5th har- monics error shows the corrected measurement error for the 5th harmonic of the ac frequency (250 Hz or 300 Hz). For any number of measurements (cur- rent and voltage samples together) for a full period, a rough error estimation can be made with this table. 4-8 Table 4–1. Errors Dependent on the Sampling Frequency Meas rements Sample Frequencies Errors Measurements per Full Period Single Phase (50Hz) Two Phase (60Hz) Three Phase (50Hz) Inherent Error 3rd Harmonic † 5th Harmonic † 20 1000 2400 3000 –4.89% –36.4% –95.2% 30 1500 3600 4500 –2.19% –16.9% –47.8% 40 2000 4800 6000 –1.23% –9.7% –28.0% 50 2500 6000 7500 –0.78% –6.2% –18.3% 60 3000 7200 9000 –0.55% –4.3% –13.4% 70 3500 8400 ‡ –0.40% –3.2% –9.5% 80 4000 9600 –0.30% –2.4% –7.3% 90 4500 ‡ –0.24% –1.9% –6.0% 100 5000 –0.20% –1.6% –4.7% 110 5500 –0.16% –1.3% –3.9% 120 6000 –0.13% –1.1% –3.2% 130 6500 –0.11% –0.9% –2.7% 140 7000 –0.10% –0.8% –2.4% 160 8000 –0.08% –0.6% –1.9% 180 9000 –0.06% –0.5% –1.5% 200 10000 –0.05% –0.4% –1.2% † The errors of the harmonics are corrected by the value of the inherent error ‡ Sampling frequencies above 10000Hz are not possible due to the speed of the ADC (132 ADCLKs/conversion @ ADCLK = 1.5MHz) 4.1.2.4 Measurement Error for Deviations of the AC Frequency If the ac frequency deviates from the nominal value used during the calibration, then a small error is generated. Table 4–2 shows this error dependent on the sample frequency and the ac frequency deviation. The introduced error, Fmd, is: F md + ǒ cos ( ∆t ( f ) ∆f ) 2p ) cos ( ∆t f 2p ) * 1 Ǔ 100 4-9 Application Examples Where: F md Error due to the ac frequency deviation from the nominal frequency [%] ∆t Time between related current and voltage samples [s] f Nominal ac frequency (used during calibration) [Hz] ∆f Frequency deviation of the ac frequency during runtime [Hz] Table 4–2. Errors dependent on the AC Frequency Deviation Sample Frequencies Errors Measurement per full Period Single Phase (50Hz) Two Phase (60Hz) Three Phase (50Hz) ∆f/f = +0.5% ∆f/f = +1.0% ∆f/f = +5.0% 20 1000 2400 3000 –0.051% –0.103% –0.523% 40 2000 4800 6000 –0.012% –0.025% –0.127% 80 4000 –0.003% –0.006% –0.030% 130 6500 –0.001% –0.002% –0.010% The errors for negative frequency deviations are the same as shown in Table 4–2 but with positive signs. The ADC is assumed to be error-free, this way only the influence of the frequency deviation is shown. The additional error due to the deviation of the ac frequency can be reduced to nearly zero by the measurement of the actual ac frequency and an appropri- ate correction of the calculated energy. 4.1.2.5 Measurement Error Dependent on the Interrupt Latency Time The calibration of an electricity meter is made normally in an environment with- out interrupt activity. This can be completely different to the real time environ- ment where the meter has to measure the electric energy later. Therefore the interrupt latency time (here the time the interrupt request of the sampling time base is delayed by other interrupts) can have an influence on the accuracy of the measurement. Table 4–3 shows the errors introduced by different interrupt latency times. The calibration is made with a maximum interrupt latency time of 5 µs (due to missing interrupt activities): this is the maximum delay caused by the completion of the current instruction (indexed,indexed mode) with MCLK = 1MHz. The conditions used for the simulations of Table 4–3 are: - The simulation conditions are the same ones as described in section 4.1.3 except where noted otherwise. - The given interrupt latency times are the maximum values; each voltage and current sample is delayed by a random time interval ranging between zero and this maximum value. - The ADC is assumed to be error-free (except the range transition error), this way only the influence of the interrupt latency time is shown. 4-10 - For other values of MCLK than 1MHz , the shown latency times are not given in microseconds but CPU cycles. - The used current is 100% except for the last line (1%) - The measurement time is 20 seconds Table 4–3. Errors dependent on the Interrupt Latency Time Meas rement Sin g le Maximum Interrupt Latency Time Measurement per Full Period Single Phase (50 Hz) 5 µs (Calibr.) 20 µs 40 µs 80 µs 160 µs 20 1000 –0.0013% –0.0010% +0.0023% +0.0052% +0.0103% 40 2000 –0.0010% +0.0010% –0.0005% –0.0053% –0.0113% 80 4000 +0.0007% +0.0002% –0.0035% –0.0053% –0.0292% 130 6500 –0.0011% +0.0002% –0.0006% –0.0025% – † cos ϕ=0.5 6500 –0.0011% 0% +0.0001% –0.0055% – † 1% I n 6500 –0.0098% –0.0175% +0.0170% –0.0786% – † † Interrupt latency time is greater than sampling interval Table 4–3 shows the extreme low influence of the interrupt latency time: even non-realistic high latency times like 160 µs result in negligible influence. This means that the Reduced Scan Principle is not sensitive to the interrupt latency time of the system. Note: The errors shown in Table 4–3 are won by the use of random values for the interrupt latency time. Despite the relatively long simulation time (20 sec- onds) every simulation made under exactly the same conditions returned therefore a slightly different error. 4.1.2.6 Measurement Error Due to Overvoltage and Overcurrent With the simulation conditions described in Section 4.1.3, The Analog-to-Digi- tal Converter of the MSP430C32x , the ADC measures up to 111% of the maxi- mum current or voltage without additional error. It is important to know how the electricity meter behaves if the input values are above these limits: there must be a smooth transition and no oscillations or sudden changes. Due to the satu- ration the ADC shows for overflow and underflow, the errors shown in Table 4–4 result. The ADC is assumed to be error-free (with the exception of the range transition error), so only the effect of the overflow is shown.