Real-time calculation method for effective value of alternating voltage suitable for DSP controller

文档序号:1071192 发布日期:2020-10-16 浏览:27次 中文

阅读说明:本技术 一种适用于dsp控制器的交流电压有效值实时计算方法 (Real-time calculation method for effective value of alternating voltage suitable for DSP controller ) 是由 高翔 赵喜洋 程焱 闫新军 陈琦 于 2020-07-10 设计创作,主要内容包括:本申请属于交流电压有效值计算技术领域,特别涉及一种适用于DSP控制器的交流电压有效值实时计算方法,所述方法包括:步骤S1、获取DSP控制器三相交流电压中某相的电压值;步骤S2、构建有效值计算模型,将所述DSP控制器三相交流电压中某相的电压值输入到所述有效值计算模型中,计算得到第一交流电压有效值;步骤S3、构建低通数字滤波模型,将所述第一交流电压有效值输入到所述低通数字滤波模型中,计算得到第二交流电压有效值。本申请根据均方根递推公式计算出交流电压有效值的粗略值,再对其进行二阶级联巴特沃斯数字低通滤波后输出交流电压有效值的准确值,该方法在极大程度减小DSP存储空间站用的情况下且保证了计算的高准确性以及快速性。(The application belongs to the technical field of calculation of effective values of alternating voltages, and particularly relates to a real-time calculation method of effective values of alternating voltages, which is suitable for a DSP (digital signal processor) controller, and comprises the following steps: step S1, acquiring a voltage value of a certain phase in the three-phase alternating-current voltage of the DSP controller; step S2, constructing an effective value calculation model, inputting a voltage value of a certain phase in three-phase alternating-current voltages of the DSP controller into the effective value calculation model, and calculating to obtain a first alternating-current voltage effective value; and step S3, constructing a low-pass digital filtering model, inputting the first alternating voltage effective value into the low-pass digital filtering model, and calculating to obtain a second alternating voltage effective value. According to the method, the rough value of the effective value of the alternating voltage is calculated according to a root mean square recursion formula, and the accurate value of the effective value of the alternating voltage is output after second-order cascading Butterworth digital low-pass filtering is carried out on the rough value of the effective value of the alternating voltage.)

1. A real-time calculation method for effective values of alternating voltages applicable to a DSP controller is characterized by comprising the following steps:

step S1, acquiring a voltage value of a certain phase in the three-phase alternating-current voltage of the DSP controller;

step S2, constructing an effective value calculation model, inputting a voltage value of a certain phase in three-phase alternating-current voltages of the DSP controller into the effective value calculation model, and calculating to obtain a first alternating-current voltage effective value;

and step S3, constructing a low-pass digital filtering model, inputting the first alternating voltage effective value into the low-pass digital filtering model, and calculating to obtain a second alternating voltage effective value.

2. The method according to claim 1, wherein in step S2, said constructing an effective value calculation model comprises:

the single-phase alternating-current voltage obtained by the first sampling is represented as x (1), the effective value of the alternating-current voltage obtained by the first calculation is represented as y (1), the single-phase alternating-current voltage obtained by the nth sampling is represented as x (n), and the effective value of the alternating-current voltage obtained by the nth calculation is represented as y (n);

from the definition of root mean square, one can obtain:

y(1)2=x(1)2

the method is obtained by recursion of the four formulas:

z transformation is performed simultaneously on both sides of the above equation of difference to obtain:

from the above equation, the effective value calculation model is:

Figure FDA0002579655230000016

z is a transformation operator.

3. The method according to claim 2, wherein in step S3, the low-pass digital filtering model is a second-order cascaded butterworth low-pass filtering model.

4. The method according to claim 3, wherein the step S3 of constructing the low-pass digital filtering model comprises:

the second-order cascade Butterworth low-pass digital filter is composed of two first-order Butterworth low-pass digital filters, and transfer functions of the two cascade first-order Butterworth low-pass digital filters are respectively expressed as follows:

Figure FDA0002579655230000022

the relationship between each coefficient and the cut-off frequency and the sampling frequency obtained from the Z transform can be expressed as:

Figure FDA0002579655230000026

wherein f issTo cut-off frequency, fcIs the sampling frequency.

Technical Field

The application belongs to the technical field of calculation of effective values of alternating voltages, and particularly relates to a real-time calculation method of the effective values of the alternating voltages, which is suitable for a DSP (digital signal processor) controller.

Background

The DSP controller is widely applied to the aviation power supply controller due to the characteristics of small volume, high precision, low cost, low power consumption, large data and program storage capacity and the like. In an aviation power supply controller software algorithm, an effective value of alternating voltage is often used as one of important parameter indexes to realize functions of control, conversion, protection and the like. For example, in the bus bar power controller, the effective value of the three-phase ac voltage of the bus bar is one of the important conditions for determining whether the contactor operates correctly, and directly affects the power supply mode switching of the on-board power supply. Therefore, how to realize real-time calculation of the alternating effective value is a technical difficulty and a key point in the research and development process of the aviation power supply controller.

At present, the calculation methods of the effective value of the alternating voltage are roughly divided into two types: hardware computation methods and software computation methods. The hardware calculation method mainly performs calculation through effective value calculation chips, such as AD637, AD8436 and the like, and is limited by the hardware resources which are already available. The software calculation method is mainly used for sampling the voltage value of the whole period of the alternating voltage and then obtaining the root mean square value of the voltage value, the method needs to ensure sampling times as many as possible in order to achieve calculation accuracy, the stored data volume is large, the storage space is occupied, the voltage response can be completely followed by one period of time, and the calculation real-time performance is poor.

Disclosure of Invention

In order to solve the technical problem, the application provides a real-time calculation method of an effective value of an alternating voltage, which is suitable for a DSP controller and solves the problem of poor real-time performance in the real-time calculation process of the effective value of the alternating voltage.

The application provides a real-time calculation method of an effective value of an alternating voltage suitable for a DSP controller, which comprises the following steps:

step S1, acquiring a voltage value of a certain phase in the three-phase alternating-current voltage of the DSP controller;

step S2, constructing an effective value calculation model, inputting a voltage value of a certain phase in three-phase alternating-current voltages of the DSP controller into the effective value calculation model, and calculating to obtain a first alternating-current voltage effective value;

and step S3, constructing a low-pass digital filtering model, inputting the first alternating voltage effective value into the low-pass digital filtering model, and calculating to obtain a second alternating voltage effective value.

Preferably, in step S2, the constructing the effective value calculation model includes:

the single-phase alternating-current voltage obtained by the first sampling is represented as x (1), the effective value of the alternating-current voltage obtained by the first calculation is represented as y (1), the single-phase alternating-current voltage obtained by the nth sampling is represented as x (n), and the effective value of the alternating-current voltage obtained by the nth calculation is represented as y (n);

from the definition of root mean square, one can obtain:

y(1)2=x(1)2

Figure BDA0002579655240000021

Figure BDA0002579655240000022

Figure BDA0002579655240000023

the method is obtained by recursion of the four formulas:

z transformation is performed simultaneously on both sides of the above equation of difference to obtain:

from the above equation, the effective value calculation model is:

z is a transformation operator.

Preferably, in step S3, the low-pass digital filtering model is a second-order cascaded butterworth low-pass filtering model.

Preferably, in step S3, the constructing the low-pass digital filtering model includes:

the second-order cascade Butterworth low-pass digital filter is composed of two first-order Butterworth low-pass digital filters, and transfer functions of the two cascade first-order Butterworth low-pass digital filters are respectively expressed as follows:

the relationship between each coefficient and the cut-off frequency and the sampling frequency obtained from the Z transform can be expressed as:

Figure BDA0002579655240000032

Figure BDA0002579655240000033

wherein f issTo cut-off frequency, fcIs the sampling frequency.

According to the method for calculating the effective value of the alternating voltage in real time applicable to the DSP controller, the rough value of the effective value of the alternating voltage is calculated according to a root-mean-square recursion formula, and then the accurate value of the effective value of the alternating voltage is output after second-order cascading Butterworth digital low-pass filtering is carried out on the rough value.

According to the method, the accurate value of the effective value of the alternating voltage can be calculated only through the current period sampling value of the alternating voltage, the last period sampling value and the effective values of the alternating voltage of the last two periods, the alternating voltage can be sampled and calculated in real time, the DSP calculation execution time is less than 5 microseconds, and the calculation error is within 0.5%.

Drawings

Fig. 1 is a schematic diagram of an effective value calculation model related to the method for calculating the effective value of the alternating voltage in real time, which is suitable for the DSP controller.

Fig. 2 is a schematic diagram of a low-pass digital filtering model related to the method for calculating the effective value of the alternating voltage in real time, which is suitable for the DSP controller.

Fig. 3 is a schematic diagram of a single-phase ac voltage supply.

Fig. 4 is a schematic diagram of output waveforms of different n values in the effective value calculation model.

Fig. 5 is a diagram illustrating the calculation result of the effective value.

Fig. 6 is a partial diagram illustrating the calculation result of the effective value of the quick response.

Fig. 7 is a partial diagram illustrating the calculation result of the effective value of the calculation accuracy.

Detailed Description

In order to make the implementation objects, technical solutions and advantages of the present application clearer, the technical solutions in the embodiments of the present application will be described in more detail below with reference to the accompanying drawings in the embodiments of the present application. In the drawings, the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The described embodiments are some, but not all embodiments of the present application. The embodiments described below with reference to the drawings are exemplary and intended to be used for explaining the present application, and should not be construed as limiting the present application. All other embodiments obtained by a person of ordinary skill in the art without any inventive work based on the embodiments in the present application are within the scope of protection of the present application. Embodiments of the present application will be described in detail below with reference to the drawings.

The application provides a real-time calculation method of an effective value of alternating voltage suitable for a DSP controller, and solves the problem of poor real-time performance in the real-time calculation process of the effective value of the alternating voltage.

The application provides an alternating voltage effective value real-time calculation method suitable for a DSP controller, which comprises the following steps:

step S1, acquiring a voltage value of a certain phase in the three-phase alternating-current voltage of the DSP controller;

s2, constructing an effective value calculation model, inputting a voltage value of a certain phase in three-phase alternating voltage of the DSP controller into the effective value calculation model, and calculating to obtain a first alternating voltage effective value;

and step S3, constructing a low-pass digital filtering model, inputting the first alternating voltage effective value into the low-pass digital filtering model, and calculating to obtain a second alternating voltage effective value.

Specifically, the DSP controller obtains a voltage value U of a certain phase in the three-phase ac voltage through an external or self-contained ADC module.

The single-phase alternating-current voltage obtained by the first sampling is represented as x (1), the effective value of the alternating-current voltage obtained by the first calculation is represented as y (1), the single-phase alternating-current voltage obtained by the nth sampling is represented as x (n), and the effective value of the alternating-current voltage obtained by the nth calculation is represented as y (n);

from the definition of root mean square, one can obtain:

y(1)2=x(1)2

Figure BDA0002579655240000041

Figure BDA0002579655240000042

the method is obtained by recursion of the four formulas:

it can be seen that the effective value can be calculated only by the voltage sampling value of the current period, the voltage sampling value of the previous period and the voltage effective values of the previous two periods, and a large amount of storage space is occupied without collecting multi-period voltage values.

Z transformation is performed simultaneously on both sides of the above equation of difference to obtain:

from the above equation, the effective value calculation model is:

z is a transform operator of the Z domain, which is a mathematical transformation performed on a discrete sequence, and can transform a time domain signal (discrete time sequence) into an expression in the complex frequency domain.

Coefficient of the above formula

Figure BDA0002579655240000054

I.e. K in FIG. 11Coefficient of

Figure BDA0002579655240000055

I.e. coefficient K in fig. 12Are all related to n and K1And K2There is a numerical relationship K2=1-2K1

The value of n affects both the calculation accuracy and the response speed, and in order to ensure the quick response of calculation in the application of the power control system, the rapidity of the calculation response is increased as much as possible by the effective value calculation model, and the accuracy of the effective value calculation module is compensated by adding the low-pass filtering model after the effective value calculation.

According to the method for calculating the effective value of the alternating voltage in real time applicable to the DSP controller, the Butterworth low-pass filter has stable amplitude-frequency characteristics inside and outside a pass frequency band, a frequency response curve is flat to the maximum extent and has no ripples, the frequency response curve gradually drops to zero in a stop frequency band, and a second-order cascade Butterworth low-pass filter is selected to filter the effective value calculation result to obtain the final voltage effective value.

The second-order cascade Butterworth low-pass digital filter is composed of two first-order Butterworth low-pass digital filters, and transfer functions of the two cascade first-order Butterworth low-pass digital filters are respectively expressed as follows:

Figure BDA0002579655240000056

coefficient K in the above formula3、K4、K5、K6Both related to the cut-off frequency and the sampling frequency of the filter. The design of a digital filter can generally be converted from an analog filter to a digital filter, i.e. from the S-domain to the Z-domain. The relationship between each coefficient and the cut-off frequency and the sampling frequency obtained from the Z transform can be expressed as:

Figure BDA0002579655240000062

Figure BDA0002579655240000063

wherein f issTo cut-off frequency, fcIs the sampling frequency.

The selection of the cut-off frequency influences the response speed and the calculation accuracy of the system, and the lower the cut-off frequency is, the slower the response speed is, the better the calculation accuracy is, and vice versa.

In one embodiment of the present application, the voltage of the single-phase ac power source is set to have an effective value of 115V, a frequency of 400Hz, an a/D sampling frequency of 10KHz, and a power supply time of 0.3s to 0.5s for 0.2s, i.e., 200ms, as shown in fig. 3.

To balance the rapidity and accuracy of the calculation, n is traversed from 0 to 1 every 0.01. Representative 4 sets of data were selected, and the values of n were 4.65, 9.01, 46.51, 89.93, respectively, as shown in fig. 4. As can be seen from the figure, when n is 4.65, the system has the best rapidity, but the accuracy is the worst; when n is 89.93, the calculation accuracy of the system is best, but the response to the voltage change is slowest, and the combination of rapidity and calculation accuracy selects n to be 9.09, namely K10.11. The transfer function of the effective value calculation model is:

and according to the effect of the first part effective value calculation, the comprehensive filtering precision and the response speed set the coefficients of the second part low-pass digital filtering part to be 80Hz and 100Hz respectively, then:

Figure BDA0002579655240000071

namely, the transfer functions of the low-pass digital filtering model are respectively:

the final effective value calculation result according to the transfer function is shown in fig. 5, and the partial amplification of the selected middle section of data is shown in fig. 6 and fig. 7, so that it can be seen that the effective value calculation result of the method is reduced to 20V and only needs 13.4ms, and the calculation precision is within 0.5%.

Compared with the existing method for calculating the effective value of the alternating voltage, the scheme of the invention firstly calculates the rough value of the effective value of the alternating voltage according to a root-mean-square recursion formula, and then outputs the accurate value of the effective value of the alternating voltage after the second-order cascading Butterworth digital low-pass filtering is carried out on the rough value. The calculation method can calculate the accurate value of the effective value of the alternating voltage only through the current period sampling value, the last period sampling value and the effective values of the alternating voltage of the last two periods, the alternating voltage can be sampled and calculated in real time, the DSP calculation execution time is less than 5 mu s, and the calculation error is within 0.5%. The method realizes the real-time calculation of the effective value of the alternating voltage, and ensures the high accuracy and the rapidity of the calculation under the condition of greatly reducing the use of DSP storage space stations.

12页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:家用电器电流监控装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!