Power distribution terminal vector angle change calculation method, device, equipment and medium
By using fixed frequency sampling and tracking frequency sampling calculation methods on the power consumption side, real-time monitoring and calculation of vector angle changes is achieved, and the problem that the power consumption side in the prior art is not able to effectively monitor vector angle changes, and the safety and reliability of the equipment are improved.
Patent Information
- Application Number
- CN202510020632.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-07
- Publication Date
- 2025-05-06
AI Technical Summary
The prior art cannot effectively monitor the change of vector angle on the power consumption side, resulting in the electric equipment that may be irreversible damage when the vector angle changes greatly.
A method of vector angle change calculation of power distribution terminals is adopted. Through two methods, fixed frequency sampling and tracking frequency sampling, the vector angle changes between every two cycles are calculated to realize real-time monitoring and calculation.
This method can accurately calculate vector angle changes without relying on the stator and rotor position sensors, protect the electrical equipment from damage, and improve the safety and reliability of the electrical equipment.
Smart Images

Figure CN119945235A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of vector angle calculation, and in particular to a method, device, equipment and medium for calculating vector angle changes of a power distribution terminal. Background Art
[0002] Currently, in the power system, vector angle change is a key parameter that directly affects the output power and efficiency of the motor. During the operation of the synchronous motor, due to load changes and other reasons, the angle between the motor rotor magnetic field and the stator magnetic field will change, which will cause the motor output power and efficiency to change. This change is called vector angle change. The traditional vector angle change monitoring method relies on external sensors to monitor the position of the stator and rotor, and achieves stable output of external electricity through space vector decomposition and PID control. However, this method has obvious limitations on the power load side, because it cannot monitor the displacement of the vector through the position sensor. When the vector angle changes significantly, it will cause irreversible damage to the electrical equipment over time.
[0003] Existing technical solutions mainly focus on the output control of the motor on the power generation side, while there is a lack of effective solutions for monitoring the vector angle changes on the power load side. In a general power consumption environment, changes in the vector angle may have a destructive effect on the back-end power consumption equipment; in simple terms, for the power user, the displacement of the vector cannot be monitored by the position sensor. When the vector angle changes significantly, it will cause irreversible damage to the power consumption equipment over time.
[0004] In summary, the current problem of the distance between the power load and the power generation side is that there is no effective means to monitor the position of the stator and rotor, and the conventional method cannot be used to calculate the vector angle change. Therefore, it is necessary to develop a new calculation method or device that can monitor and calculate the change of the vector angle in real time on the power consumption side to protect the power consumption equipment on the load side.
[0005] In view of this, this application is filed. Summary of the invention
[0006] The present invention provides a method, device, equipment and medium for calculating the change in vector angle of a power distribution terminal, which can at least partially improve the above-mentioned problem.
[0007] To achieve the above object, the present invention adopts the following technical solutions:
[0008] A method for calculating a distribution terminal vector angle change, comprising:
[0009] Obtain preset parameter information, perform preprocessing according to the parameter information, perform AD conversion processing on the acquired sampling points, and store them in the ADbufer[x] array;
[0010] Define three pointer variables, point to multiple sampling points in the ADbufer[x] array according to the pointer variables, and calculate three positive zero-crossing points according to the pointed sampling points;
[0011] According to the three positive zero-crossing points, the deviation of the vector angle is calculated to generate a vector angle change result.
[0012] The present invention also provides a device for calculating the change in vector angle of a power distribution terminal, which comprises:
[0013] The AD conversion unit is used to obtain preset parameter information, perform preprocessing according to the parameter information, perform AD conversion processing on the obtained sampling points, and store them in the ADbufer[x] array;
[0014] The zero-crossing point calculation unit is used to define three pointer variables, point to multiple sampling points in the ADbufer[x] array according to the pointer variables, and calculate three positive zero-crossing points according to the pointed sampling points;
[0015] The result generating unit is used to calculate the deviation of the vector angle according to the three positive zero-crossing points and generate a vector angle change result.
[0016] The present invention also provides a distribution terminal vector angle change calculation device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the distribution terminal vector angle change calculation method as described in any one of the above.
[0017] The present invention also provides a readable storage medium storing a computer program, which can be executed by a processor of a device where the storage medium is located to implement the method for calculating the vector angle change of a distribution terminal as described in any one of the above items.
[0018] In summary, the distribution terminal vector angle change calculation method can accurately and real-time calculate the vector angle change between every two cycles without relying on the stator and rotor position sensors. The method includes two methods: fixed-frequency sampling and tracking frequency sampling. In fixed-frequency sampling, by establishing a timer and a sampling buffer, the number of sampling points and the frequency change of each cycle are calculated to deduce the change of the vector angle. In tracking frequency sampling, by setting a minimum timer and recording the time count value of each sampling point, the time interval and frequency change between the zero crossing points are calculated, and then the change of the vector angle is obtained. It aims to solve the problem that the existing technology cannot effectively monitor the change of the vector angle on the power consumption side. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 It is a flow chart of a method for calculating a change in vector angle of a power distribution terminal provided by an embodiment of the present invention;
[0020] Figure 2 It is a schematic diagram of the overall process of the method for calculating the vector angle change of the power distribution terminal provided by an embodiment of the present invention;
[0021] Figure 3 1 is a schematic diagram of a calculation waveform of a vector angle change in a fixed-frequency sampling environment provided by an embodiment of the present invention;
[0022] Figure 4 is a schematic diagram of a calculation waveform of a vector angle change under a tracking frequency provided by an embodiment of the present invention;
[0023] Figure 5 It is a module diagram of a device for calculating a vector angle change of a power distribution terminal provided in the third embodiment of the present invention. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0025] refer to Figure 1 , Figure 2 As shown, the first embodiment of the present invention discloses a method for calculating the change of the vector angle of a distribution terminal, which can be executed by a distribution terminal vector angle change calculation device (hereinafter referred to as a calculation device), and in particular, executed by one or more processors in the calculation device to implement the following method:
[0026] S1, obtain preset parameter information, perform preprocessing according to the parameter information, perform AD conversion processing on the obtained sampling points, and store them in the ADbufer[x] array;
[0027] S2, define three pointer variables, point to multiple sampling points in the ADbufer[x] array according to the pointer variables, and calculate three positive zero-crossing points according to the pointed sampling points;
[0028] S3, calculating the deviation of the vector angle according to the three positive zero-crossing points, and generating a vector angle change result.
[0029] Specifically, in this embodiment, the distribution terminal vector angle change calculation method is a vector angle change calculation method that does not rely on stator and rotor position sensors, and can accurately and real-time calculate the vector angle change between every two cycles. The method includes two embodiments: fixed frequency sampling and tracking frequency sampling.
[0030] See also Figure 3Preferably, the preset parameter information is obtained, preprocessing is performed according to the parameter information, AD conversion is performed on the obtained sampling points, and the obtained sampling points are stored in the ADbufer[x] array, specifically:
[0031] Set the sampling period to T, collect 256 sampling points in each period T, where the sampling period of each sampling point is t1, and the period T is fixed;
[0032] Create a timer timer1, perform an AD conversion on the current sampling point every t1 time, and store the converted sampling points in the ADbufer[x] array in a loop according to the pointer displacement variable ptr, where x=16*256+1;
[0033] Among them, the pointer displacement variable ptr is incremented once every AD conversion. When it is determined that the pointer displacement variable ptr is greater than 16*256, the pointer displacement variable ptr is set to 0.
[0034] Preferably, three pointer variables are defined, and the pointer variables point to multiple sampling points in the ADbufer[x] array, and three positive zero-crossing points are calculated according to the pointed sampling points, specifically:
[0035] Define three pointer variables short *pua, *pbottom, *pua_last, where the pointer variable *pua points to the current sampling point, the pointer variable *pbottom points to the starting address of the ADbufer[x] array, and the pointer variable *pua_last points to the previous sampling point.
[0036] Compare the 768 sampling points collected in the three cycles T pointed to by the three pointer variables one by one, and select the sampling points that meet the preset conditions and set them as i, where the preset conditions are *pua_last>0 and *pua<=0;
[0037] Determine a first positive zero-crossing point f1, a second positive zero-crossing point f2, and a third positive zero-crossing point f3 according to the sampling point i;
[0038] Among them, the mathematical expression of the positive zero crossing point is: fa=pua_last, fb=pua, fa=fa / (fa-fb), fa=fa+i.
[0039] Preferably, according to the three positive zero-crossing points, the deviation of the vector angle is calculated to generate a vector angle change result, specifically:
[0040] Get the number of sampling points in the first cycle data1, and the number of sampling points in the second cycle data2;
[0041] According to the number of sampling points data1 and data2, the period t11=data1*7t1, t12=data2*t1 is calculated, and according to the period t11 and t12, the frequency F1=1 / t11 between the first positive zero crossing point f1 and the second positive zero crossing point f2, and the frequency F2=1 / t12 between the second positive zero crossing point f2 and the third positive zero crossing point f3 are determined;
[0042] Calculate the number of points f4 between the first positive zero-crossing point f1 and the second positive zero-crossing point f2, f4=f2-f1, calculate the number of points f5 between the second positive zero-crossing point f2 and the third positive zero-crossing point f3, f5=f3-f2, and determine the time between every two positive zero-crossing points according to the number of points f4 and the number of points f5 as the current cycle T;
[0043] Calculate the angular frequency according to the formula W = 2∏f = 2∏ / T and determine the relationship between the frequency of change of the vector angle and the periodic frequency;
[0044] According to the characteristics of the sine circle, each cycle is fixed to 360 degrees, the relationship between the change in angle per cycle and the percentage change in frequency per cycle is determined, and the deviation of the vector angle is calculated according to the frequencies F1 and F2, Θ = 360° (F2-F1) / F1;
[0045] Based on the above relationship, a vector angle change result is generated.
[0046] In this embodiment, a fixed-frequency sampling method is provided. By establishing a timer and a sampling buffer, the voltage signal is sampled at a high frequency, and the number of sampling points and frequency changes in each cycle are calculated, thereby deriving the change in the vector angle. This method can accurately capture the subtle changes in the voltage signal, and even when the voltage fluctuation is small, the change in the vector angle can be accurately calculated, providing timely protection basis for electrical equipment.
[0047] The sinusoidal signal is sampled at 256 points according to the industrial frequency voltage (50HZ), with each cycle of 20ms. Each cycle is 360 degrees, and the angle represented by each point is 1.40625. The sampling period t1 of each point is 78.125us. It is necessary to establish a timer of 78.125us (timer1), perform an AD sampling conversion once every t1 time, and put the conversion result into ADbufer[16*256+1].
[0048] Taking the phase-A voltage as an example, using the same method for the phase-B and phase-C voltages and currents. Further, in a cyclic storage manner, the sampling points are stored in ADbufer[ptr], where ptr is a pointer displacement variable. Each time a sampling conversion is performed, ptr++. When ptr > 16 * 256, set ptr = 0. Then, find 768 points backward from the latest ptr, which is three cycles. Define three pointer variables short* pua, *pbottom, *pua_last. At the same time, set pbottom = &ADbufer[0], pointing the pointer to the starting address of ADbufer, set the previous point pua_last = (short*)&ADbufer[ptr], and the current sampling point pua = (short*)&ADbufer[ptr]. The two pointers point to the current position where the collected values are stored.
[0049] Immediately afterwards, perform a comparison of each of the 768 points before and after. Move the pua pointer one position forward, pua = pua - 1, and move the pua_last one more position based on the forward movement of pua, pua_last = pua - 1. When the point satisfying the conditions *pua_last > 0 and *pua <= 0 is found as i, during the process of finding and shifting the points, note that when the pointer pua or pua_last < pbottom, it means approaching the starting position 0 of the array. At this time, perform the processing pua += (16 * 256 + 1) or pua_last += (16 * 256 + 1) to ensure that the pointer does not cross the boundary. According to the formula fa = pua_last; fb = pua; fa = fa / (fa - fb); fa = fa + i, calculate the true zero-crossing point with a decimal. fa is the first positive zero-crossing point f1, and find the second positive zero-crossing point f2 and the third positive zero-crossing point f3 in sequence according to the above steps.
[0050] According to the angular frequency W = 2∏f = 2∏ / T, it can be known that the change in the vector angle ultimately reflects the change in the frequency of each cycle. The change in frequency during the fixed-frequency sampling process reflects the change in the number of sampling points.
[0051] When the frequency is 50HZ, the cycle is 20ms, and one point is sampled every 78.125us. Theoretically, the sampling point data1 of one cycle is 20000 / 78.125=256. Similarly, when the frequency is 51hz, the sampling point data2 is 250.98039215686274509803921568627. According to the number of sampling points, the cycle t11=data1*78.125; t12=data2*78.125; according to the cycle, the frequency F1=1 / t11=50HZ, F2=1 / t12=51HZ is obtained. And the number of points f4=f2-f1 between the first zero crossing point and the second zero crossing point, and the number of points f5=f3-f2 between the second zero crossing point and the third zero crossing point are calculated; to determine the time between each two positive zero crossing points, that is, the current cycle, and calculate the frequency according to the cycle. Finally, the deviation of the vector angle is calculated as Θ=360°(F2-F1) / F1=360(51-50) / 50=7.2 degrees.
[0052] See also Figure 4 The second embodiment of the present invention provides a method for calculating the change of the vector angle of a distribution terminal in a tracking frequency sampling mode. This method can adapt to scenarios with fast frequency changes by setting a minimum timer and recording the time count value of each sampling point. When the frequency changes, the sampling interval will be adjusted accordingly, but the number of sampling points remains unchanged. By calculating the time interval and frequency change between the zero crossing points, the change in the vector angle is obtained. This method can quickly respond to frequency fluctuations, and even in the case of frequent frequency changes, it can maintain the accuracy and stability of the calculation results, ensuring the safe operation of electrical equipment under different frequency conditions.
[0053] Preferably, the preset parameter information is obtained, preprocessing is performed according to the parameter information, AD conversion is performed on the obtained sampling points, and the obtained sampling points are stored in the ADbufer[x] array, specifically:
[0054] Establish counting timer timer3 and sampling timer timer2;
[0055] The sampling period of sampling timer timer2 is set to T2. Based on counting timer timer3, 256 sampling points are collected in each sampling period T2, where the sampling period T2 is not fixed.
[0056] Perform an AD conversion on all current sampling points within each sampling period T2, and store the converted sampling points in the ADbufer[x] array according to the pointer displacement variable ptr. At the same time, start the counting timer timer3 to record the number of sampling points in the period, x=16*256+1;
[0057] Store the count value of the counter timer3 into the ADbufer[x] array. Each AD conversion value has a corresponding count value.
[0058] Among them, the pointer displacement variable ptr is incremented once every AD conversion. When it is determined that the pointer displacement variable ptr is greater than 16*256, the pointer displacement variable ptr is set to 0.
[0059] Preferably, three pointer variables are defined, and the pointer variables point to multiple sampling points in the ADbufer[x] array, and three positive zero-crossing points are calculated according to the pointed sampling points, specifically:
[0060] Define six pointer variables short *pua, *pbottom, *pua_last, u32 *pua_tick, *pbottom_tick, *pua_last_tick, where the pointer variable *pua points to the current sampling point, the pointer variable *pbottom points to the starting position of the sampling point in the ADbufer[x] array, the pointer variable *pua_last points to the previous sampling point, the pointer variable *pua_tick points to the current count value, the pointer variable *pbottom_tick points to the starting position of the count value in the ADbufer[x] array, and the pointer variable *pua_last_tick points to the previous count value.
[0061] Compare the 768 sampling points collected in the three cycles T pointed to by the six pointer variables one by one, and select the sampling points that meet the preset conditions and set them as i, where the preset conditions are *pua_last>0 and *pua<=0;
[0062] Determine a first positive zero-crossing point f1, a second positive zero-crossing point f2, and a third positive zero-crossing point f3 according to the sampling point i;
[0063] Among them, the mathematical expression of the positive zero crossing point is: fa=pua_last, fb=pua, fa=fa / (fa-fb), fa=fa+i.
[0064] Preferably, according to the three positive zero-crossing points, the deviation of the vector angle is calculated to generate a vector angle change result, specifically:
[0065] When it is determined that pua_last_tick > pua_tick, the fractional part of the first positive zero-crossing f1 is obtained according to the function modf(f1, X), and the interval tick1add between the first positive zero-crossing f1 and the next sampling point is calculated as tick1add = (pua_last_tick - pua_tick) * (1 - modf(f1, X)), where X is the integer part of the first positive zero-crossing f1;
[0066] When it is determined that pua_last_tick < pua_tick, the interval tick1add between the first positive zero-crossing f1 and the previous sampling point is calculated as tick1add = (0xffffffff - pua_tick + 1 + pua_last_tick) * (1 - modf(f1, X));
[0067] And the interval tick2add between the second positive zero-crossing f2 and the previous sampling point, and the interval tick3add between the third positive zero-crossing f3 and the previous sampling point are calculated in sequence according to the above steps;
[0068] The count value ticka_11 of the point before the first positive zero-crossing f1 is calculated as ticka_11 = ticka_1 + tick1add, the count value tick2 of the point before the second positive zero-crossing f2 is calculated as tick2 = ticka_2 + tick2add, and the count value tick3 of the point before the third positive zero-crossing f3 is calculated as tick3 = ticka_3 + tick3add;
[0069] When it is determined that ticka_1 > ticka_2, the time interval t11 between the first positive zero-crossing f1 and the second positive zero-crossing f2 is calculated as t11 = ticka_1 + tick1add - ticka_2 - tick1add;
[0070] When it is determined that ticka_1 < ticka_2, the time interval t11 between the first positive zero-crossing f1 and the second positive zero-crossing f2 is calculated as t11 = 0xffffffff - ticka2 - tick2add + ticka_1 + tick1add;
[0071] When it is determined that ticka_2 > ticka_3, the time interval t12 between the second positive zero-crossing f2 and the third positive zero-crossing f3 is calculated as t12 = ticka_2 + tick2add - ticka_3 - tick3add;
[0072] When it is determined that ticka_2 < ticka_3, calculate the time interval t12 between the second positive zero-crossing f2 and the third positive zero-crossing f3 as t12 = 0xffffffff - ticka3 - tick3add + ticka_2 + tick2add;
[0073] Calculate the frequency F1 between the first positive zero-crossing f1 and the second positive zero-crossing f2 as F1 = 1 / t11, and the frequency F2 between the second positive zero-crossing f2 and the third positive zero-crossing f3 as F2 = 1 / t12 according to the time intervals t11 and t12;
[0074] Calculate the deviation Θ of the vector angle as Θ = 360°(F2 - F1) / F1 according to the frequencies F1 and F2, and generate the result of the vector angle change according to the deviation of the vector angle.
[0075] Specifically, in this embodiment, a 32-bit counting timer timer3 with a time interval of 0.05 us is defined, and the count value u32time_cnt is defined. Each increment represents 0.05 us, with a maximum value of 0xFFFFFFFF. After reaching the maximum value, it starts counting from 0 again. Then, a sampling timer timer2 (T2) is defined, with an initial sampling period of 78.125 us. For a 50HZ waveform, the sampling interval per period is 78.125 us, and the number of sampling points per period is 256. When a frequency change is detected, the sampling interval of the sampling timer timer2 will be changed to follow the sampling frequency, and the number of sampling points per period remains unchanged. According to the timer timer2 (T2), regardless of how the sampling period T2 changes, an AD sampling conversion is performed once within the T2 time, and the conversion result is placed in ADbufer[16*256 + 1]. At the same time, the count value of timer3 at this time is recorded in the array ADbufer_tick[16*256 + 1], that is, each AD sampling value corresponds to a count value of timer3.
[0076] It should be noted that the variable-frequency sampling method cannot calculate the frequency per period based on the number of sampling points because the frequency modulation for tracking the frequency occurs after a frequency change is detected, and the interval between sampling points will continuously change during tracking. According to the characteristics of sampling, when the frequency is indeed changing, the number of sampling points in two consecutive periods may be the same, which means that sampling and frequency modulation cannot be synchronized. However, the amplitude change of the voltage collected each time follows the law of the sine curve. Thus, timer3 is started to assist in timing.
[0077] Taking phase A voltage as an example, the same method is used for phase B voltage and current: the sampling point is stored in ADbufer[ptr] in a loop, and the corresponding timer3 count value is placed in ADbufer_tick[ptr]. Ptr is a pointer displacement variable, which is converted once for each sampling, ptr++. And find 768 points back from the latest ptr, define three pointer variables short*pua, *pbottom, *pua_last; three pointer variables u32*pua_tick, *pbottom_tick, *pua_last_tick; among them, pbottom=&ADbufer[0], pbottom_tick=&ADbufer_tick[0] use pointers to point to the starting address of sampling data and count value, current point pua_last=&ADbufer[ptr], pua_last_tick=&ADbufer_tick[ptr] latest sampling point pua=&ADbufer[ptr-1], pua_tick=&ADbufer_tick[ptr-1]. Furthermore, the 768 points are compared one by one, and the point i that satisfies the conditions of pua_last>0, pua<=0 is found; according to the formula fa=pua_last; fb=pua; fa=fa / (fa-fb); fa=fa+i, the true zero-crossing point with decimals is found, fa is the first positive zero-crossing point f1, and the second positive zero-crossing point f2 and the third positive zero-crossing point f3 are found in turn according to methods 8)-11).
[0078] According to theoretical knowledge, since the first positive zero-crossing point f1 is calculated as a floating-point number, for example, if f1 = 31.25, then the fractional part is obtained by the function modf(f1, X). The true sampling point before the zero-crossing point is 31, and the true sampling point after the zero-crossing point is 32. When the sampling point is 31, the counting tick value at this time is pua_tick, and the next counting tick value is pua_last_tick. Therefore, the interval tick1add between the zero-crossing point of f1 and the 32nd point is calculated as tick1add = (pua_last_tick - pua_tick) * (1 - modf(f1, X)), where X is the integer part obtained, and modf() obtains the fractional part. This situation applies when pua_last_tick > pua_tick. If pua_last_tick < pua_tick, the reason for this situation is that when the timer increments to the maximum value of 0xffffffff, it needs to be reset to start counting again. At this time, the interval tick1add between f1 and the 32nd point is tick1add = (0xffffffff - pua_tick + 1 + pua_last_tick) * (1 - modf(f1, X)). Similarly, the interval tick2add between the second positive zero-crossing point f2 and the previous point, and the interval tick3add between the third positive zero-crossing point f3 and the previous point can be calculated.
[0079] 紧接着,定义第一个过零点的前一个点的计数值为ticka_1(每个点都对应一个timer3计数值),计算tick1=ticka_1+tick1add;定义第二个过零点的前一个点的计数值为ticka_2(每个点都对应一个timer3计数值),计算tick2=ticka_2+tick2add;定义第三个过零点的前一个点的计数值为ticka_3(每个点都对应一个timer3计数值),计算tick3=ticka_3+tick3add。 Immediately afterwards, define the count value of the point before the first zero-crossing point as ticka_1 (each point corresponds to a timer3 count value), and calculate tick1 = ticka_1 + tick1add; define the count value of the point before the second zero-crossing point as ticka_2 (each point corresponds to a timer3 count value), and calculate tick2 = ticka_2 + tick2add; define the count value of the point before the third zero-crossing point as ticka_3 (each point corresponds to a timer3 count value), and calculate tick3 = ticka_3 + tick3add.
[0080] Calculate the time intervals between three zero-crossing points, calculate the time interval between f1 and f2. When ticka_1 > ticka_2, calculate the time interval T1 = ticka_1 + tick1add - ticka_2 - tick1add; when ticka_1 < ticka_2, it means the count value has crossed the maximum count value, and at this time T1 = 0xffffffff - ticka2 - tick2add + ticka_1 + tick1add. Calculate the time interval between f2 - f3. When ticka_2 > ticka_3, calculate the time interval T2 = ticka_2 + tick2add - ticka_3 - tick3add; when ticka_2 < ticka_3, calculate T2 = 0xffffffff - ticka3 - tick3add + ticka_2 + tick2add.
[0081] Based on the above calculations, the time intervals t11 and t12 between two adjacent cycles can be obtained. Further, calculate the frequencies between the two by F2 = 1 / t12 and F1 = 1 / t11. Finally, calculate the vector angle deviation Θ = 360°(F2 - F1) / F1 to obtain the vector angle deviation between two adjacent cycles.
[0082] To sum up, as Figure 2 shown, relying on Figure 3 and Figure 4 the relevant calculations, for the three-phase voltages A, B, and C, when the phase voltage > 0.05Un and is considered to be energized, start the real-time calculation of the vector angle change of the corresponding phase in the 10ms timer for tripping or alarming of the entire protection. And, according to the calculation result verification, when the A-phase voltage signal changes from 50HZ with a period of 20ms to 55.833HZ with a period of 17.9ms and continuously changes 55 times, theoretically the change value of the vector angle Θ = 360° * 5.833 / 50 = 41.9976°. Figure 4 The result is the change value delta_angle_a of the A-phase vector angle output by the algorithm verification every 5ms. The reason for some of the same values is that the waveform is calculated once every 10ms, and the error is within 2 degrees, meeting the accuracy requirements of the power grid fluctuation frequency. This calculation method has high accuracy and strong real-time performance, and can monitor the change of the vector angle in real time.
[0083] Among them, Figure 3 shows the calculation of the vector angle change in a fixed-frequency sampling environment. According to the positive zero-crossing points, calculate the actual number of points in each cycle, calculate the time based on the fixed sampling interval between sampling points, infer the frequency from the time, and then infer the vector angle change based on the angular frequency characteristic of W = 2∏f to reflect the change of the angle. Figure 4It shows that the number of sampling points in each cycle under the tracking frequency is different, and the time between points is not fixed. According to the fixed timer, the time count value of each point is recorded. According to the search of the zero-crossing point, the time count value between the zero-crossing points is calculated, and the frequency between each complete cycle is deduced, thereby deducing the vector angle change between every two cycles.
[0084] In summary, the method has high accuracy and strong real-time performance, and can operate effectively in fixed-frequency and variable-frequency sampling systems. By real-time monitoring of changes in vector angles and having control tripping and alarm functions, the present invention can quickly cut off loads or issue alarms, thereby protecting electrical equipment from damage. When it is detected that the vector angle changes exceed the preset safety range, the system will immediately activate the protection mechanism, cut off the power supply or issue an alarm signal to remind relevant personnel to take timely measures to avoid damage to the equipment due to abnormal voltage. This timely protection measure greatly improves the safety and reliability of electrical equipment, extends the service life of the equipment, reduces equipment failure rate and maintenance costs, and brings significant economic benefits to enterprises and users.
[0085] In simple terms, the distribution terminal vector angle change calculation method adopts the calculation method of the vector angle change in fixed frequency sampling and the calculation method of the vector angle change under tracking frequency sampling; the sampling point data pointer increment and the positive zero-crossing point cycle search method every 3 cycles; in variable frequency sampling, the creation of the minimum timer 0.05us timer, the minimum timer reference method, the increment method and the method of synchronously recording the timer count value of each sampling point data, the data processing method near the maximum value of the timer, the size processing method of the time count value between two adjacent zero-crossing points, and the correspondence between the vector angle change and the frequency change in each cycle; the vector angle calculation is based on the 10ms time interval and the condition of starting the calculation greater than the threshold voltage. On the power consumption side, the vector angle change between every two cycles can be accurately calculated in real time without relying on the stator and rotor position sensors; it can be used in a fixed frequency high-speed sampling system to process data, and it can also be used in a variable frequency high-frequency sampling system to process data; the calculation method and monitoring concept proposed by this method can well protect the load on the power consumption side according to the change of the vector angle.
[0086] See also Figure 5 The third embodiment of the present invention provides a device for calculating a vector angle change of a power distribution terminal, which comprises:
[0087] The AD conversion unit 201 is used to obtain preset parameter information, perform preprocessing according to the parameter information, perform AD conversion processing on the obtained sampling points, and store them in the ADbufer[x] array;
[0088] The zero-crossing point calculation unit 202 is used to define three pointer variables, point to multiple sampling points in the ADbufer[x] array according to the pointer variables, and calculate three positive zero-crossing points according to the pointed sampling points;
[0089] The result generating unit 203 is used to calculate the deviation of the vector angle according to the three positive zero-crossing points, and generate a vector angle change result.
[0090] The fourth embodiment of the present invention provides a distribution terminal vector angle change calculation device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the distribution terminal vector angle change calculation method as described in any one of the above.
[0091] The fifth embodiment of the present invention provides a readable storage medium storing a computer program, which can be executed by a processor of a device where the storage medium is located to implement a method for calculating a vector angle change of a distribution terminal as described in any one of the above items.
[0092] Exemplarily, the above-mentioned devices and process steps can be implemented by a computer program. The computer program can be divided into one or more units. The one or more units are stored in the memory and executed by the processor to complete the present invention.
[0093] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0094] The memory can be used to store the computer program and / or module, and the processor realizes various functions of the present invention by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0095] Wherein, if the electronic device or printer integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0096] It should be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the accompanying drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines. A person of ordinary skill in the art may understand and implement it without paying any creative effort.
[0097] The above is a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A method for calculating the change in vector angle of a power distribution terminal, characterized in that: include: Obtain preset parameter information, perform preprocessing according to the parameter information, perform AD conversion processing on the acquired sampling points, and store them in the ADbufer[x] array; Define three pointer variables, point to multiple sampling points in the ADbufer[x] array according to the pointer variables, and calculate three positive zero-crossing points according to the pointed sampling points; According to the three positive zero-crossing points, the deviation of the vector angle is calculated to generate a vector angle change result.
2. The method for calculating the change in the distribution terminal vector angle according to claim 1, characterized in that: Obtain preset parameter information, perform preprocessing according to the parameter information, perform AD conversion processing on the acquired sampling points, and store them in the ADbufer[X] array, specifically: Set the sampling period to T, collect 256 sampling points in each period T, where the sampling period of each sampling point is t1, and the period T is fixed; Create a timer timer1, perform an AD conversion on the current sampling point every t1 time, and store the converted sampling points in the ADbufer[x] array in a loop according to the pointer displacement variable ptr, where x=16*256+1; Among them, the pointer displacement variable ptr is incremented once every AD conversion. When it is determined that the pointer displacement variable ptr is greater than 16*256, the pointer displacement variable ptr is set to 0.
3. The method for calculating the change in the distribution terminal vector angle according to claim 2, characterized in that: Define three pointer variables, point to multiple sampling points in the ADbufer[x] array according to the pointer variables, and calculate three positive zero-crossing points according to the pointed sampling points, specifically: Define three pointer variables short *pua, *pbottom, *pua_last, where the pointer variable *pua points to the current sampling point, the pointer variable *pbottom points to the starting address of the ADbufer[x] array, and the pointer variable *pua_last points to the previous sampling point. Compare the 768 sampling points collected in the three cycles T pointed to by the three pointer variables one by one, and select the sampling points that meet the preset conditions and set them as i, where the preset conditions are *pua_last>0 and *pua<=0; Determine a first positive zero-crossing point f1, a second positive zero-crossing point f2, and a third positive zero-crossing point f3 according to the sampling point i; Among them, the mathematical expression of the positive zero crossing point is: fa=pua_last, fb=pua, fa=fa / (fa-fb), fa=fa+i.
4. The method for calculating the change in the distribution terminal vector angle according to claim 3, characterized in that: According to the three positive zero-crossing points, the deviation of the vector angle is calculated to generate the vector angle change result, which is specifically: Get the number of sampling points in the first cycle data1, and the number of sampling points in the second cycle data2; According to the number of sampling points data1 and data2, the period t11=data1*7t1, t12=data2*t1 is calculated, and according to the period t11 and t12, the frequency F1=1 / t11 between the first positive zero crossing point f1 and the second positive zero crossing point f2, and the frequency F2=1 / t12 between the second positive zero crossing point f2 and the third positive zero crossing point f3 are determined; Calculate the number of points f4 between the first positive zero-crossing point f1 and the second positive zero-crossing point f2, f4=f2-f1, calculate the number of points f5 between the second positive zero-crossing point f2 and the third positive zero-crossing point f3, f5=f3-f2, and determine the time between every two positive zero-crossing points according to the number of points f4 and the number of points f5 as the current cycle T; Calculate the angular frequency according to the formula W = 2∏f = 2∏ / T and determine the relationship between the frequency of change of the vector angle and the periodic frequency; According to the characteristics of the sine circle, each cycle is fixed to 360 degrees, the relationship between the change in angle per cycle and the percentage change in frequency per cycle is determined, and the deviation of the vector angle is calculated according to the frequencies F1 and F2, Θ = 360° (F2-F1) / F1; Based on the above relationship, a vector angle change result is generated.
5. The method for calculating the change in the distribution terminal vector angle according to claim 1, characterized in that: Obtain preset parameter information, perform preprocessing according to the parameter information, perform AD conversion processing on the acquired sampling points, and store them in the ADbufer[X] array, specifically: Establish counting timer timer3 and sampling timer timer2; The sampling period of sampling timer timer2 is set to T2. Based on counting timer timer3, 256 sampling points are collected in each sampling period T2, where the sampling period T2 is not fixed. Perform an AD conversion on all current sampling points within each sampling period T2, and store the converted sampling points in the ADbufer[x] array according to the pointer displacement variable ptr. At the same time, start the counting timer timer3 to record the number of sampling points in the period, x=16*256+1; Store the count value of the counter timer3 into the ADbufer[x] array. Each AD conversion value has a corresponding count value. Among them, the pointer displacement variable ptr is incremented once every AD conversion. When it is determined that the pointer displacement variable ptr is greater than 16*256, the pointer displacement variable ptr is set to 0.
6. The method for calculating the change in the distribution terminal vector angle according to claim 5, characterized in that: Define three pointer variables, point to multiple sampling points in the ADbufer[x] array according to the pointer variables, and calculate three positive zero-crossing points according to the pointed sampling points, specifically: Define six pointer variables short *pua, *pbottom, *pua_last, u32 *pua_tick, *pbottom_tick, *pua_last_tick, where the pointer variable *pua points to the current sampling point, the pointer variable *pbottom points to the starting position of the sampling point in the ADbufer[x] array, the pointer variable *pua_last points to the previous sampling point, the pointer variable *pua_tick points to the current count value, the pointer variable *pbottom_tick points to the starting position of the count value in the ADbufer[x] array, and the pointer variable *pua_last_tick points to the previous count value. Compare each of the 768 sampling points collected within three periods T pointed to by six pointer variables one by one, and filter out the sampling points that meet the preset conditions, and set them as i. Among them, the preset conditions are *pua_last>0 and *pua<=0; Determine the first positive zero crossing f1, the second positive zero crossing f2, and the third positive zero crossing f3 according to the sampling point i; Among them, the mathematical expression of the positive zero crossing is: fa = pua_last, fb = pua, fa = fa / (fa - fb), fa = fa + i.
7. The method for calculating the change in the distribution terminal vector angle according to claim 6, characterized in that: According to the three positive zero crossings, calculate the deviation of the vector angle and generate the vector angle change result. Specifically: When it is judged that pua_last_tick>pua_tick, obtain the fractional part of the first positive zero crossing f1 according to the function modf(f1, X), and calculate the interval tick1add between the first positive zero crossing f1 and the next sampling point tick1add=(pua_last_tick - pua_tick)*(1 - modf(f1, X)), where X is the integer part of the first positive zero crossing f1; When it is judged that pua_last_tick<pua_tick, calculate the interval tick1add between the first positive zero crossing f1 and the previous sampling point tick1add=(0xffffffff - pua_tick + 1 + pua_last_tick)*(1 - modf(f1, X)); And calculate the interval tick2add between the second positive zero crossing f2 and the previous sampling point, and the interval tick3add between the third positive zero crossing f3 and the previous sampling point in sequence according to the above steps; Calculate the count value ticka_11 of the point before the first positive zero crossing f1 ticka_11 = ticka_1 + tick1add, the count value tick2 of the point before the second positive zero crossing f2 tick2 = ticka_2 + tick2add, and the count value tick3 of the point before the third positive zero crossing f3 tick3 = ticka_3 + tick3add; When it is judged that ticka_1>ticka_2, calculate the time interval t11 between the first positive zero crossing f1 and the second positive zero crossing f2 t11 = ticka_1 + tick1add - ticka_2 - tick1add; When it is judged that ticka_1<ticka_2, calculate the time interval t11 between the first positive zero crossing f1 and the second positive zero crossing f2 t11 = 0xffffffff - ticka2 - tick2add + ticka_1 + tick1add; When it is judged that ticka_2>ticka_3, calculate the time interval t12 between the second positive zero crossing f2 and the third positive zero crossing f3 t12 = ticka_2 + tick2add - ticka_3 - tick3add; When it is determined that ticka_2 < ticka_3, calculate the time interval t12 between the second positive zero-crossing f2 and the third positive zero-crossing f3 as t12 = 0xffffffff - ticka3 - tick3add + ticka_2 + tick2add; Calculate the frequency F1 between the first positive zero-crossing f1 and the second positive zero-crossing f2 as F1 = 1 / t11, and the frequency F2 between the second positive zero-crossing f2 and the third positive zero-crossing f3 as F2 = 1 / t12 according to the time intervals t11 and t12; Calculate the deviation Θ of the vector angle as Θ = 360°(F2 - F1) / F1 according to the frequencies F1 and F2, and generate a vector angle change result according to the deviation of the vector angle.
8. A device for calculating the change in vector angle of a power distribution terminal, characterized in that: Include: An AD conversion unit, configured to obtain preset parameter information, perform preprocessing according to the parameter information, perform AD conversion processing on the acquired sampling points, and store them in the ADbufer[x] array; A zero-crossing calculation unit, configured to define three pointer variables, point to multiple sampling points in the ADbufer[x] array according to the pointer variables, and calculate three positive zero-crossings according to the pointed sampling points; A result generation unit, configured to calculate the deviation of the vector angle according to the three positive zero-crossings and generate a vector angle change result.
9. A distribution terminal vector angle change calculation device, characterized in that: Include a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, the method for calculating the vector angle change of the distribution terminal according to any one of claims 1 to 7 is implemented.
10. A readable storage medium, characterized in that: Store a computer program, and the computer program can be executed by the processor of the device where the storage medium is located to implement the method for calculating the vector angle change of the distribution terminal according to any one of claims 1 to 7.