Interruption time sequence adjustment method for arc discharge detection, arc discharge detection method and photovoltaic system

By adjusting the timing relationship between timer interrupt and ADC interrupt in the photovoltaic system, the problem of abnormal arc detection value is solved, and the stability and accuracy of the detection value are optimized.

CN119921671AActive Publication Date: 2025-05-02XIAMEN KEHUA DIGITAL ENERGY TECH CO LTD
View PDF 11 Cites 0 Cited by

Patent Information

Application Number
CN202411862697.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2025-05-02
Estimated Expiration
2044-12-17

AI Technical Summary

Technical Problem

In existing photovoltaic systems, the problem of abnormal arc detection value may be due to the long timer interrupt execution time, resulting in the ADC interrupt period being extended, which will cause detection point offset and false alarm failure.

Method used

By adjusting the timing relationship between timer interrupts and ADC interrupts, the tasks executed in the timer interrupts are arranged to be executed in the ADC interrupt after the timer interrupt is completed to avoid the ADC interrupt period being extended.

Benefits of technology

Optimize the situation of abnormal detection value during arc pull detection, ensuring that the ADC interrupt period remains stable and avoiding false alarm failures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119921671A_ABST
    Figure CN119921671A_ABST
Patent Text Reader

Abstract

The invention relates to an interruption time sequence adjustment method for arc discharge detection, an arc discharge detection method and a photovoltaic system. The interruption time sequence adjustment method for arc discharge detection comprises the steps that the time sequence of a first number of analog-to-digital converter (ADC) interruptions to be started at a first frequency is determined, and the ADC interruptions are used for obtaining sampling data obtained after ADC conversion is carried out on arc discharge parameters; determining a timing of interruption of a timer turned on at a second frequency, wherein the first frequency is at least twice the second frequency; and based on a relative relationship between the time sequence of the timer interruption and the time sequence of the ADC interruption, allocating at least one task executed in the timer interruption to at least one ADC interruption after the timer interruption is ended for execution, so as to avoid delayed triggering of the adjacent ADC interruption after the timer interruption is triggered. According to the time sequence adjustment method, the condition that the detection value is abnormal in the arc discharge detection process can be optimized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of arc detection, and in particular to an arc detection interruption timing adjustment method, an arc detection method and a photovoltaic system. Background Art

[0002] In the prior art, many fires in electrical systems are mainly caused by arcs. In order to improve the safety of electrical systems, existing electrical systems are usually equipped with arc detection devices to perform arc detection on electrical signals on the DC side of the electrical system.

[0003] The photovoltaic system includes structures such as solar photovoltaic panels, photovoltaic cables and photovoltaic inverters. The solar photovoltaic panels are exposed outdoors to collect solar energy and perform photoelectric conversion, thereby realizing photovoltaic power generation. When an arc is generated on the DC side of the photovoltaic system, it is very easy to cause a fire. In related technologies, arc fault detection technology mainly detects whether an arc fault has occurred by analyzing the differences in time-frequency domain characteristics of the parameters before and after the arc fault occurs. If the sampling period and sampling value used for arc fault analysis are deviated, it is easy to cause the arc fault analysis results to deviate and cause false alarms. Summary of the invention

[0004] In order to overcome the problems existing in the related art, the embodiments of the present application disclose an interrupt timing adjustment method for arc detection, an arc detection method and a photovoltaic system to optimize the problem of abnormal detection values ​​during arc detection.

[0005] According to a first aspect of an embodiment of the present application, a method for adjusting interrupt timing for arc detection is provided, the method comprising: determining the timing of a first number of digital-to-analog converter (ADC) interrupts to be turned on at a first frequency, wherein the ADC interrupt is used to obtain sampled data after ADC conversion of the arc parameter; determining the timing of a timer interrupt turned on at a second frequency, wherein the first frequency is at least twice the second frequency; based on the relative relationship between the timing of the timer interrupt and the timing of the ADC interrupt, dispatching at least one task executed in the timer interrupt to be executed in at least one ADC interrupt after the timer interrupt ends, so as to avoid delayed triggering of an ADC interrupt immediately after the timer interrupt is triggered.

[0006] According to a second aspect of an embodiment of the present application, an arc detection method is provided, the method comprising: executing the ADC interrupt and the timer interrupt according to the timing adjusted by any method in the present application; and performing arc algorithm processing on the sampling data obtained through the ADC interrupt.

[0007] According to a third aspect of an embodiment of the present application, a photovoltaic system is provided, comprising: a sampling device for collecting arcing parameters in the system; and a processor for executing the steps of any arcing detection method in the present application.

[0008] The technical solution provided by the embodiments of the present application may include the following beneficial effects: based on the relative relationship between the timing of the timer interrupt and the timing of the ADC interrupt, the present application allocates at least one task executed in the timer interrupt to be executed in at least one ADC interrupt after the timer interrupt ends, thereby avoiding the extension of the ADC interrupt cycle due to the long execution time of the timer interrupt, thereby optimizing the abnormal detection value during the arc detection process.

[0009] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0011] Figure 1 is a structural diagram of a photovoltaic system according to an exemplary embodiment of the present application.

[0012] Figure 2 The figure is a flow chart of a method for adjusting interrupt timing of arc detection according to an exemplary embodiment of the present application.

[0013] Figure 3 It is a timing relationship diagram showing how to deploy tasks executed in the Time0 interrupt to be executed in a subsequent ADC interrupt according to an exemplary embodiment of the present application.

[0014] Figure 4 The present invention is an arc detection method according to an exemplary embodiment of the present application.

[0015] Figure 5 4 is a diagram showing the relative relationship between the trigger position of the delayed Time0 interrupt and the trigger positions of two adjacent ADC interrupts according to an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0016] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0017] Figure 1 FIG. 1 is a photovoltaic system structure diagram according to an exemplary embodiment of the present application. Figure 1 As shown, the photovoltaic system 100 includes structures such as photovoltaic panel PV 101, current transformer CT 102, photovoltaic inverter 103 and power grid 104. The photovoltaic panel 101 converts the received solar energy into electrical energy through the photoelectric effect and outputs photovoltaic current. CT 102 monitors the current change in the photovoltaic system 100 in real time, controls the magnitude and direction of the current, and ensures the safe operation of the photovoltaic system 100. The photovoltaic inverter 103 converts the direct current output by the photovoltaic panel 101 into alternating current and outputs it to the power grid 104. The photovoltaic inverter 103 also uses an arcing board to sample and detect arcing parameters such as photovoltaic current monitored by CT 102 to determine whether an arc is generated in the photovoltaic system 100. Among them, the arcing board is a circuit board that can perform arcing detection. The arcing board can be set in products such as photovoltaic inverters as part of the equipment to realize the arcing detection function, or it can be independently realized outside the equipment.

[0018] In some embodiments, the arc detection process may include an arc parameter acquisition phase and an arc algorithm processing phase. In the arc parameter acquisition phase, the processor of the arc board obtains the sampled data of the arc parameters monitored by CT 102 after A / D conversion through a series of ADC interrupts. In the arc algorithm processing phase, the arc algorithm is used to process the collected arc parameters to obtain the arc detection results. More specifically, after completing the initialization procedure, the arc board performs the following processing to obtain the arc parameters and complete the arc detection:

[0019] 1) Enter the arc parameter sampling stage, turn on the ADC interrupt, and complete the sampling of the arc parameters at 1024 sampling points through 1024 ADC interrupts.

[0020] 2) Turn off the ADC interrupt, process the collected arc parameters with the arc algorithm, and determine whether an arc is generated.

[0021] 3) Repeat the above steps 1) and 2) to perform the next round of arc parameter detection.

[0022] In the related art, after the arc board is upgraded on the cloud platform with programs such as ARM (Advanced RISC Machine) / DCAC (DC-to-AC) / DCDC (DC-to-DC) / ARC (Advanced Renewable Computing), the problem of abnormal arc detection value occurs. Generally speaking, the normal value of arc is less than 200, and the arc threshold is set at 400. However, after the arc board program is upgraded, the arc detection value fluctuates greatly, even reaching 3900.

[0023] In response to the above problems, the inventor analyzed and tested the photovoltaic system from the aspects of hardware, software, structure, grounding, load, battery pack, etc. and found that the abnormal arc detection value after upgrading the arc board program may be caused by too many tasks executed in the timer interrupt, which prolongs the ADC interrupt cycle and causes the detection point to shift. In this regard, the inventor of this application proposed a solution to adjust some tasks in the timer interrupt in the arc board program to be executed in the subsequent ADC interrupt.

[0024] Figure 2 is a flowchart of a method for adjusting the interrupt timing of arc detection according to an exemplary embodiment of the present application. Figure 2 The steps shown are explained.

[0025] In step 11 , a timing of a first number of digital-to-analog converter ADC interrupts to be enabled at a first frequency is determined.

[0026] Here, the first frequency can be 250kHz, and the corresponding period is 4us, that is, the interval between the triggering times of two adjacent ADC interrupts is 4us. The first frequency can also be other values ​​that meet the arc detection requirements, such as 220kHz, 280kHz, etc. The first number is usually 1024 times, or it can be other numbers that meet the detection accuracy, such as 512 times, etc. In short, the first frequency and the first number can be reasonably set based on the detection requirements, and are not limited to the above values ​​​​cited in this application. The ADC interrupt is used to obtain sampled data after ADC conversion of the arc parameters. In some embodiments, the processor of the arc panel turns on the ADC interrupt at the first frequency to obtain the photovoltaic current output by the photovoltaic panel 101 as sampled data. The following is an example of the first frequency being 250kHz.

[0027] In step 12, the timing of the timer interrupt started at the second frequency is determined, wherein the first frequency is at least twice the second frequency, to ensure that after the timer interrupt, at least one ADC interrupt can accept the allocated task.

[0028] In some embodiments, there are timer interrupts such as Time0 interrupts in the arc drawing board system program. Time0 interrupts can generate a time base signal with a period of 2ms in the system program, that is, the interval between the triggering times of two adjacent Time0 interrupts is 2ms. It can be understood that in the process of the processor using the ADC interrupt to obtain sampled data, the Time0 interrupt also continues at a second frequency in the system program to perform tasks such as communication between chips. The second frequency is usually less than the first frequency, for example, it can be 500Hz, 450Hz, 400Hz, etc.

[0029] Since the cycle of each ADC interrupt is about 4us, a round of ADC interrupts, i.e. 1024 ADC interrupts, may take about 4.1ms to complete. Therefore, at least 2 Time0 interrupts will be inserted in the entire process from opening to closing a round of ADC interrupts. If the execution time of a certain Time0 interrupt inserted is too long, so that the trigger time of the ADC interrupt triggered immediately afterwards is delayed, the detection point offset and arc parameter detection abnormality may be caused due to the extension of the ADC interrupt cycle. For example, executing the communication receiving task of reading FIFO in the Time0 interrupt will cause the execution time of the timer interrupt to be longer, which may cause the trigger time of the next ADC interrupt to be delayed, and the interval between the trigger times of adjacent ADC interrupts to exceed 4us. The time data of the actual work of the test arc board shows that the execution time of the Time0 interrupt is too long, which may cause the interval between the trigger times of two adjacent ADC interrupts to reach 4.7us.

[0030] In step 13, based on the relative relationship between the timing of the timer interrupt and the timing of the ADC interrupt, at least one task executed in the timer interrupt is deployed to be executed in at least one ADC interrupt after the timer interrupt ends.

[0031] In an embodiment of the present application, at least one task executed in a timer interrupt is deployed to at least one ADC interrupt after the timer interrupt ends, including: based on the timing of the Time0 interrupt and the timing of the ADC interrupt, determining whether the execution of each Time0 interrupt causes the cycle of the Mth ADC interrupt to be extended, wherein the trigger time of the timer Time0 interrupt is located after the trigger time of the Mth ADC interrupt and before the trigger time of the M+1th ADC interrupt. The cycle of the Mth ADC interrupt is extended, specifically, the trigger time of the Time0 interrupt is located in the cycle of the Mth ADC interrupt, and the end time of the Time0 interrupt is located after the predetermined trigger time of the M+1th ADC interrupt, and M is a natural number greater than or equal to 1. In the case that the cycle of the Mth ADC interrupt is extended due to the Time0 interrupt, at least one task executed in the corresponding Time0 interrupt is deployed to at least one ADC interrupt after the Time0 interrupt ends for execution.

[0032] As mentioned above, during the process of each round of ADC interruption for arc detection, 2-3 Time0 interruptions may be inserted. If the trigger position of the Time0 interruption is close to the ADC interruption that is subsequently triggered, or there are too many tasks executed in the Time0 interruption and the execution time is too long, then the trigger time of the ADC interruption immediately after the Time0 interruption will be postponed. In this case, the cycle of the ADC interruption is lengthened. Therefore, it is necessary to determine whether the execution of each Time0 interruption will cause the cycle of a certain ADC interruption (for example, the Mth ADC interruption) in the round to be lengthened based on the relative relationship between the timing of the ADC interruption and the timing of the Time0 interruption. In the case that the cycle of the ADC interruption is lengthened, some tasks of the Time0 interruption are deployed to the subsequent ADC interruption for execution.

[0033] The specific process of task allocation during interruption is further described below based on steps S1301 - S1306 .

[0034] In step S1301, the triggering time of the Mth ADC interrupt is obtained, wherein the period of the Mth ADC interrupt is prolonged due to the insertion of the Time0 interrupt.

[0035] In some embodiments, the Mth ADC interrupt whose cycle is extended is determined by the trigger time and execution duration of the Time0 interrupt. The execution period of the Time0 interrupt in timing can be obtained based on the trigger time and execution duration of the Time0 interrupt. If the trigger time of an ADC interrupt in this round of ADC interrupts falls within the execution period of the Time0 interrupt, it means that the execution of the Time0 interrupt will cause the triggering of the ADC interrupt to be postponed, then the ADC interrupt immediately before the ADC interrupt is the Mth ADC interrupt. The trigger time of the Mth interrupt is used for subsequent task allocation.

[0036] In step S1302, based on the trigger time of the Mth ADC interrupt and the cycle of the ADC interrupt, the first end time of the Time0 interrupt after the task is allocated is determined, wherein the duration from the trigger time of the Mth ADC interrupt to the first end time of the Time0 interrupt after the task is allocated is not greater than the cycle of the ADC interrupt. Here, the cycle of the ADC interrupt is determined based on the first frequency.

[0037] It is understandable that if the Time0 interrupt ends before the scheduled M+1th ADC interrupt is triggered, the cycle of the Mth ADC interrupt will not be extended. Therefore, the first end time of the Time0 interrupt is first determined based on this condition, and the first end time makes the execution of the Time0 interrupt not exceed the cycle of the Mth ADC interrupt. Preferably, there is a certain time margin between the first end time and the triggering time of the M+1th ADC interrupt, such as 0.8us or 1us.

[0038] In step S1303, the second end time of the Time0 interruption before the task is allocated is obtained, and the minimum execution duration of the task to be allocated from the Time0 interruption is determined according to the first end time and the second end time.

[0039] Before the task is allocated, the second end time of the Time0 interrupt is located after the trigger time of the scheduled M+1th ADC interrupt in terms of timing. Therefore, it is necessary to allocate a part of the tasks from the Time0 interrupt so that the Time0 interrupt ends at the first end time before the trigger time of the M+1th ADC interrupt. That is, the execution time of the allocated task cannot be less than the time difference between the second end time and the first end time. This ensures that in the actual operation process, the Time0 interrupt after the task is allocated will not prolong the cycle of the ADC interrupt.

[0040] In step S1304, based on the minimum execution duration, the allocated first task is determined, wherein the execution duration of the first task is not less than the minimum execution duration.

[0041] After obtaining the minimum execution time, it is necessary to select the first task whose execution time is greater than or equal to the minimum execution time from the tasks executed in the Time0 interrupt based on the minimum execution time. If the execution time of the first task allocated is less than the minimum execution time, it is still possible that the Time0 interrupt after the task is allocated will extend the ADC interrupt cycle. Therefore, the allocated tasks cannot be selected arbitrarily, and it is necessary to confirm whether their execution time meets the requirements.

[0042] In step S1305, based on the execution duration of the allocated task, a second number of ADC interrupts required to complete the task is determined, and a second task required to be completed by each ADC interrupt in the second number of ADC interrupts is determined, wherein the first task includes the second task, and the execution duration of the second number of ADC interrupts allocated with the second task is not greater than the period of the ADC interrupt.

[0043] Since the deployed first task needs to be assigned to the ADC interrupt after the Time0 interrupt for execution, and the cycle of the ADC interrupt cannot be lengthened due to task allocation, the deployed first task may need to be assigned to multiple ADC interrupts in order to complete the task while ensuring the normal cycle of the ADC interrupt. In this way, based on the size of the deployed first task, the first task is assigned to the second number of ADC interrupts for execution, and the second number can at least ensure that the cycle of the ADC interrupt that has received the task allocation will not be lengthened. After determining the second number, the second task assigned to each ADC interrupt can be further determined. The ADC interrupt that has received task allocation needs to complete the second task allocated from the Time0 interrupt and the task of acquiring sampling data that it originally needs to complete. It is necessary to limit the execution time of the ADC interrupt that has received task allocation to no more than the cycle of the ADC interrupt, that is, no more than 4us, preferably, it can be 3.2us or 3.8us, etc.

[0044] In step S1306 , starting from the M+1th ADC interrupt immediately after the Time0 interrupt, the tasks allocated from the Time0 interrupt are executed in the second number of ADC interrupts.

[0045] After the adjustment of steps S1301-S1306, the execution time of the Time0 interrupt is shortened, and there is a timing gap between its end time and the triggering time of the subsequent ADC interrupt, which will not affect the subsequent ADC interrupt being triggered according to the predetermined period. Figure 3 FIG. 1 is a timing diagram showing how to deploy tasks executed in the Time0 interrupt to be executed in the subsequent ADC interrupt according to an exemplary embodiment of the present application. Figure 3As shown in the figure, after some tasks in the Time0 interrupt are deployed, the maximum execution time of the Time0 interrupt is shortened to 0.63us. Under normal circumstances, the maximum execution time of the ADC interrupt is 1.33us. Since the Nth ADC interrupt immediately before the Time0 interrupt is executed normally, the Time0 interrupt is started about 0.76us after the end of the Nth ADC interrupt. Therefore, after the execution of the Time0 interrupt ends, there is still a margin of (4us-1.33us-0.63us-0.76us=) 1.28us from the trigger time of the N+1th ADC interrupt. In other words, the triggering and ending time of the Time0 interrupt are both in the execution interval between the Nth ADC interrupt and the N+1th ADC interrupt, which will not interfere with the ADC interrupt and cause abnormal arc detection.

[0046] Accordingly, the ADC interrupt after the Time0 interrupt is extended because the task originally executed in the Time0 interrupt is allocated. Since the interval between the triggering times of two adjacent ADC interrupts cannot exceed 4us, the execution time of the ADC interrupt to which the task is allocated will also be limited. The task needs to be allocated to multiple ADC interrupts to shorten the execution time of the Time0 interrupt to an appropriate time. The N+1th ADC interrupt immediately after the Time0 interrupt ends and the subsequent ADC interrupts may be extended. For example, the first ADC interrupt after the Time0 interrupt, that is, the maximum execution time of the N+1th ADC interrupt will reach 3.2us, and the execution time of the subsequent ADC interrupts will also be extended one by one, even up to 3.85us, until the last ADC interrupt to which the task is allocated is executed and the ADC interrupt returns to its normal execution time.

[0047] As described above, according to the embodiment of the present application, when the execution time of the Time0 interrupt is too long and the cycle of the ADC interrupt is prolonged, some tasks in the Time0 interrupt are adjusted to the subsequent ADC interrupt for execution to shorten the execution time of the Time0 interrupt, so that the Time0 interrupt can be terminated before the next ADC interrupt is triggered, thus avoiding the abnormal arc detection caused by the prolonged cycle of the ADC interrupt. In addition, the tasks allocated from the Time0 interrupt are allocated to multiple ADC interrupts for execution to ensure that the execution time of the ADC interrupt that has been allocated does not exceed the cycle of the ADC interrupt.

[0048] It should be noted that since the period of Time0 interrupt is 2ms, there may be hundreds of ADC interrupts between two adjacent Time0 interrupts. Therefore, there is no need to worry that a new Time0 interrupt will appear and require task allocation before the last ADC with a scheduled task is completed. In other words, there will be enough ADC interrupts to accept task allocation after the Time0 interrupt, and there will be no situation where a new Time0 interrupt is adjacent to the previous ADC interrupt with a longer execution time.

[0049] In the arcing algorithm processing phase after the arcing parameter acquisition phase is completed, the Time0 interrupt will continue to be executed at the second frequency. Since there is no data acquisition task in this phase, in some embodiments, the ADC interrupt is turned off in the arcing algorithm processing phase.

[0050] In some other embodiments, during the arc drawing algorithm processing stage, the ADC interrupt is not completely disabled. For example, at least one ADC interrupt is started after the Time0 interrupt, and some tasks executed in the Time0 interrupt are deployed to the ADC interrupt started after the Time0 interrupt ends.

[0051] The number of ADC interrupts started is determined based on the size of the deployed task. In some embodiments, during the arc drawing algorithm processing, each time the Time0 interrupt is executed, the number of ADC interrupts required to complete the deployed task is determined based on the size of the task deployed from the Time0 interrupt, and the corresponding ADC interrupt is started based on the determined number of ADC interrupts. The execution frequency of the ADC interrupt can be the first frequency, or other suitable frequency required by the system task, without limitation.

[0052] The arc-pulling algorithm processing phase usually lasts about 5.2ms. According to the cycle of the Time0 interrupt, 2 to 3 Time0 interrupts may be executed during this period. After each Time0 interrupt is executed, a certain number of ADC interrupts are started to execute the tasks allocated from the Time0 interrupt.

[0053] Through the above task allocation processing, it is possible to avoid the execution time being too long due to too many or too large tasks of the Time0 interrupt. By shortening the execution time of the Time0 interrupt, the time interval between ADC interrupts is kept within 4us, thereby optimizing the resulting arc detection anomaly.

[0054] Figure 4 This is an arc detection method according to an exemplary embodiment of the present application. Figure 4 As shown, the detection method comprises the following steps:

[0055] In step 41, the ADC interrupt and the timer interrupt are executed according to the timing adjusted by the method described in the present application.

[0056] As mentioned above, based on the relative relationship between the timing of the Time0 interrupt and the timing of the ADC interrupt, at least one task executed in the Time0 interrupt is deployed to be executed in at least one ADC interrupt after the Time0 interrupt ends. After the deployment, the cycle of the ADC interrupt is restored to the normal duration before the program upgrade, and accordingly, the abnormal situation of the arc detection value is optimized. Therefore, after the timing adjustment, the ADC interrupt and the Time0 interrupt are executed, and the arc parameter collection stage is entered.

[0057] In step 42, the sampling data obtained through ADC interruption is processed by an arc-drawing algorithm.

[0058] After completing the arc parameter sampling in step 41, the arc algorithm processing stage is entered, and the arc algorithm processing is performed on the sampled data obtained through the ADC interrupt. In some embodiments, the arc algorithm processing may include: performing Fourier transform on the current parameter to obtain the spectrum corresponding to the current parameter; taking the modulus of the amplitude of each frequency point in the spectrum to obtain the characteristic value of the arc; and determining whether an arc is generated based on the characteristic value of the arc and the set arc threshold.

[0059] Since the tasks in the timer interrupt are deployed according to the timing adjustment method of the present application, based on the arc detection method described in the present application, even if the arc board program is upgraded, abnormal arc detection values ​​will not occur after the upgrade.

[0060] In addition, the inventors found in their research that when the "upgrade startup" program is being performed, a timer interrupt may be inserted in the process of executing the ADC interrupt to obtain the arc parameters, which makes the sampling of the arc parameters discontinuous, which may also cause abnormal arc detection values. Therefore, the inventors of this application proposed a solution to adjust the trigger position of the timer interrupt in the arc board program in the timing sequence to between two adjacent ADC interrupts.

[0061] According to an exemplary embodiment of the present application, before a certain round of ADC interruption is turned on, the timing of the ADC interruption and the timing of the Time0 interruption are first determined, and based on the relative timing relationship between the two, the trigger position of the Time0 interruption that may cause interference is adjusted to between two adjacent ADC interruptions in the timing to avoid the interference of the Time0 interruption on the ADC interruption. In this way, the current sampling discontinuity caused by the insertion of the timer interruption during the execution of the ADC interruption is prevented, thereby optimizing the abnormal detection value during the arc detection process.

[0062] Here, the Time0 interrupt that interferes with the ADC interrupt is the Time0 interrupt that overlaps with the ADC interrupt in terms of timing relationship. For example, the trigger position of the Time0 interrupt may be before, after, or both are triggered at the same time as the trigger position of a certain ADC interrupt, that is, any trigger position that causes the Time0 interrupt to have a synchronous execution duration with a certain ADC interrupt. For another example, if the priority of the ADC interrupt is defined as higher than the Time0 interrupt, the trigger position of the Time0 interrupt is before the ADC interrupt is triggered.

[0063] In some embodiments, based on the relative relationship between the timing of the timer interrupt and the timing of the ADC interrupt, the trigger position of the timer interrupt in the timing is adjusted to between two adjacent ADC interrupts, including: based on the timing of the Time0 interrupt and the timing of the ADC interrupt, determining whether each inserted Time0 interrupt in the process of the round of ADC interrupts interferes with a certain ADC interrupt in the timing, for example, interferes with the Nth ADC interrupt, where N is a natural number greater than or equal to 1. In the case of interference, the processor delays triggering the Time0 interrupt so that each Time0 interrupt runs between the Nth ADC interrupt and the N+1th ADC interrupt. Preferably, the trigger position of the Time0 interrupt is delayed to the interval period after the end of the Nth ADC interrupt and before the triggering of the N+1th ADC interrupt.

[0064] By determining the triggering positions of all Time0 interrupts that occur during a round of ADC interrupts and delaying the Time0 interrupt that may interfere with a certain ADC interrupt to be triggered during the interval between two adjacent ADC interrupts, the influence of Time0 interrupts on ADC interrupts can be better prevented.

[0065] Figure 5 FIG. 1 is a diagram showing the relative relationship between the trigger position of the delayed Time0 interrupt and the trigger positions of two adjacent ADC interrupts according to an exemplary embodiment of the present application. Figure 5, the cycle of ADC interrupt is 4us, and the execution time of each ADC interrupt is about 0.8us. Therefore, the interval period after the end of the Nth ADC interrupt and before the triggering of the N+1th ADC interrupt is about 3.2us. The expected position of the delayed triggering of the Time0 interrupt is taken as the control target. Preferably, the control target is set to 0.8us after the end of the Nth ADC interrupt. If the execution time of the Time0 interrupt is 1.6us, the N+1th ADC interrupt is triggered 0.8us after the end of the Time0 interrupt. At this time, the Time0 interrupt is triggered 0.8us after the end of the Nth ADC interrupt and ends 0.8us before the triggering of the N+1th ADC interrupt. Its execution time is exactly in the middle of the interval period between the Nth ADC interrupt and the N+1th ADC interrupt. In other words, controlling the Time0 interrupt to be triggered 1.6us later than the triggering position of the Nth ADC interrupt will present Figure 3 The timing relationship is shown.

[0066] Therefore, the time for delaying the triggering of the Time0 interrupt can be determined based on the expected position of the delayed triggering of the Time0 interrupt. In some embodiments, since the clock cycles of the Time0 interrupt and the ADC interrupt are consistent, both are 60 MHz, delaying the triggering of the corresponding Time0 interrupt so that the Time0 interrupt runs between the Nth ADC interrupt and the N+1th ADC interrupt may include:

[0067] Get the first clock cycle number temp1 from the current trigger position of the Time0 interrupt at this time; get the second clock cycle number temp2 from the trigger position of the Nth ADC interrupt at this time; then (temp2-temp1) is the number of clock cycles required to adjust the Time0 interrupt to be triggered simultaneously with the Nth ADC interrupt. The value of N is determined by dividing temp1 by the cycle of the ADC interrupt, thereby determining the trigger position of the Nth ADC interrupt.

[0068] Determine the third clock cycle number temp3 from the expected position of the delayed trigger of the Time0 interrupt to the trigger position of the Nth ADC interrupt, then (temp2-temp1+temp3) is the number of clock cycles required to delay the Time0 interrupt to the expected position. Preferably, temp3 is not less than the execution time of the Nth ADC interrupt, so that the delayed Time0 interrupt can be triggered after the Nth ADC interrupt ends, rather than during the execution.

[0069] Through the above calculation method, the number of clock cycles for delaying the Time0 interrupt can be determined to ensure that the triggering time of the Time0 interrupt can be located in the interval period between the two ADC interrupts.

[0070] like Figure 5 As shown in the figure, if the control target is that the Time0 interrupt is triggered 1.6us later than the Nth ADC interrupt, the Time0 interrupt needs to be delayed by (temp2-temp1+temp3) clock cycles, then the theoretical value of temp3 is 96 clock cycles, corresponding to 1.6us. However, in the process of obtaining temp1 and temp2, when assigning values ​​to TIM.all, the program runs synchronously, and EPwm1Regs.TBCTR and TIM.all are both decreasing or increasing. Therefore, the theoretical value of temp3 cannot be used directly, and needs to be measured through debugging waveforms.

[0071] In some embodiments, the debugging process may be: first, assign a value to temp3 with 110 clock cycles, and the test result is that the Time0 interrupt is started 1.4us after the ADC interrupt ends; then, assign a value to temp3 with 170 clock cycles, and the test result is that the Time0 interrupt is started 2.36us after the ADC interrupt ends. The test results are consistent with the theoretical relationship that 60 clock cycles correspond to 1us.

[0072] Then, based on the test results of temp3 being 110 clock cycles and Time0 interrupt being started 1.4us after the ADC interrupt ends, if the expected position of the delayed trigger of Time0 interrupt is 0.8us after the ADC interrupt ends, that is, 0.6us earlier than 1.4us, the test theoretical value of temp3 is 110-60*0.6us=74 clock cycles. It can be concluded that the test theoretical value of temp3 is 74 clock cycles. When temp4=44 or 74 is measured, Time0 interrupt is started 0.88us after the ADC interrupt ends, indicating that a certain interrupt jump time is required before Time0 interrupt starts.

[0073] Therefore, based on the test results, the test theoretical value of temp3 corresponding to the delay of the Time0 interrupt to the expected position trigger is determined, and the test theoretical value is determined as temp3, and the calculation result of (temp2-temp1+temp3) is determined as the number of clock cycles required to delay the Time0 interrupt to the expected position. Based on the number of clock cycles to delay the Time0 interrupt, the number of clock cycles of the Time0 interrupt delay can be adjusted based on the actual state of the program running in the system, so that under the actual state of the system program running, the Time0 interrupt can be adjusted to be triggered in the interval period between two adjacent ADC interrupts.

[0074] Therefore, based on the relative relationship between the timing of the Time0 interrupt and the timing of the ADC interrupt, the trigger position of the Time0 interrupt in the timing is adjusted to between two adjacent ADC interrupts, avoiding discontinuous current sampling caused by inserting the Time0 interrupt during the execution of the ADC interrupt, thereby optimizing the abnormal detection value during the arc detection process.

[0075] In addition to the above reasons, the reason for the abnormal arc detection may also be that after entering the arc parameter acquisition stage, the time interval between the first ADC interrupt and the second ADC interrupt is random, which may cause the first ADC sampling data to be abnormal.

[0076] As mentioned above, the arc detection process is cyclic. After a round of arc parameter sampling, the arc algorithm is processed for the sampled arc parameters and the result of whether an arc is generated is obtained. Then a new round of arc parameter sampling is started, and arc detection is continuously performed in the photovoltaic system. During the cyclic execution of arc detection, the triggering and ending of the ADC interrupt is controlled by setting the ADC interrupt register in the arc board circuit.

[0077] In some embodiments, the ADC interrupt register has an enable bit (Enable Bit) and a trigger bit (TreggerBit). Among them, setting the enable bit in the ADC interrupt register can allow or enable the interrupt line, so that the ADC interrupt can be triggered. Setting the trigger bit in the interrupt register can directly trigger the ADC interrupt, so that the processor responds to the interrupt request. Each round of ADC interrupt is enabled based on the setting of the enable bit, and is repeatedly set at a time interval of 4us through the trigger bit, so that the ADC interrupt is periodically triggered at a time interval of 4us after it is enabled, forming a process of sampling arc parameters at multiple sampling points at a frequency of 250kHz. After completing a predetermined number of ADC interrupts, such as 1024 times, the enable bit is cleared, and the round of ADC interrupts is closed.

[0078] In the system program, the enable bit of the interrupt register is set after the previous round of arcing algorithm processing phase ends and when entering a new round of arcing parameter sampling phase. Since the processing time of the previous round of arcing algorithm is determined by the completion status of the task in the system program (usually around 5.2ms), that is, the actual processing time of each round of arcing algorithm processing phase cannot be predicted, the start time of the ADC interrupt cannot be predetermined, and accordingly, the trigger time of the first ADC interrupt cannot be determined. However, the trigger bit of the interrupt register will be repeatedly set at a predetermined time interval and thereby trigger subsequent ADC interrupts, that is, the trigger time is determined from the second ADC interrupt to the 1024th ADC interrupt. Therefore, in each round of arcing parameter sampling phase, the interval between the trigger time of the first ADC interrupt and the second ADC interrupt is uncontrollable. This may also cause abnormal arcing detection.

[0079] Based on this, in an embodiment of the present application, after using a data sampling device such as a current sensor to start collecting the arc parameters at a preset time interval, the first arc parameter collected is discarded and not put into the sampling data group, and starting from the second arc parameter, the collection of 1024 arc parameters in this round is performed, that is, the sampling of the arc parameters is performed one more time in the future. This can further optimize the abnormal situation of arc detection. In some embodiments, after turning on the ADC interrupt, the ADC interrupt of this round is turned off after executing 1025 interrupts. The sampled data obtained from the 2nd to 1025th ADC interrupts in this round of ADC interrupts are used for data processing in the arc algorithm processing stage, and the arc result is judged.

[0080] After the arc detection process is adjusted in the above manner according to the embodiment of the present application, a simulation test is performed on the arc detection process, and the detection results of the simulation test are compared with the detection results before the above adjustment to verify the optimization effect after the adjustment. The data comparison before and after the adjustment is described in detail below.

[0081] After improvement according to the method described in the embodiment of the present application, the timing relationship between the ADC interrupt and the Time0 interrupt is detected, and Table 1 records the relevant time data of the ADC interrupt and the Time0 interrupt in the detection.

[0082] Table 1

[0083]

[0084] It can be seen from the data recorded in Table 1 that after the timing adjustment method of the embodiment of the present application is performed, the sampling period of the ADC interruption of the arc board after the program is upgraded is 4us, which is basically the same as the expected sampling period and meets the requirements for the ADC interruption sampling period. This proves that the timing adjustment method of the embodiment of the present application can indeed optimize the abnormal situation of the arc detection result.

[0085] The timing adjustment method and arc detection method in the arc parameter sampling process disclosed in the present application can be used in the arc detection of photovoltaic systems. In an embodiment of the present application, the photovoltaic system includes: a sampling device for collecting arc parameters in the system; a processor for executing the steps of any arc detection method disclosed in the present application.

[0086] It should be understood that "some embodiments", "one embodiment" or "an embodiment" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiments are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The above-mentioned sequence numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments.

[0087] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0088] The above is only an implementation method of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.

Claims

1. A method for adjusting the interruption timing of arc detection, characterized in that: The method comprises: Determine the timing of a first number of digital-to-analog converter (ADC) interrupts to be turned on at a first frequency, wherein the ADC interrupts are used to obtain sampled data after the arcing parameter is converted by ADC; determining a timing of a timer interrupt that is turned on at a second frequency, wherein the first frequency is at least twice the second frequency; Based on the relative relationship between the timing of the timer interrupt and the timing of the ADC interrupt, at least one task executed in the timer interrupt is deployed to be executed in at least one ADC interrupt after the timer interrupt ends, so as to avoid delayed triggering of the ADC interrupt immediately after the timer interrupt is triggered.

2. The method according to claim 1, characterized in that The method of allocating at least one task executed in the timer interrupt to be executed in at least one ADC interrupt after the timer interrupt ends based on the relative relationship between the timing of the timer interrupt and the timing of the ADC interrupt includes: Based on the timing of the timer interrupt and the timing of the ADC interrupt, determining whether the execution of the timer interrupt causes the cycle of the Mth ADC interrupt to be extended, wherein the triggering time of the timer interrupt is after the triggering time of the Mth ADC interrupt and before the triggering time of the M+1th ADC interrupt, where M is a natural number greater than or equal to 1; In the case that the cycle of the Mth ADC interrupt is prolonged due to the timer interrupt, at least one task executed in the corresponding timer interrupt is deployed to be executed in at least one ADC interrupt after the timer interrupt ends.

3. The method according to claim 2, characterized in that The step of allocating at least one task executed in the corresponding timer interrupt to be executed in at least one ADC interrupt after the timer interrupt ends includes: Obtain the trigger time of the Mth ADC interrupt; Based on the trigger time of the Mth ADC interrupt and the cycle of the ADC interrupt, a first end time of the timer interrupt after the task is allocated is determined, wherein the duration from the trigger time of the Mth ADC interrupt to the first end time of the timer interrupt after the task is allocated is not greater than the cycle of the ADC interrupt, and the cycle of the ADC interrupt is determined based on the first frequency.

4. The method according to claim 3, characterized in that: The step of allocating at least one task executed in the corresponding timer interrupt to be executed in at least one ADC interrupt after the timer interrupt ends also includes: Get the second end time of the timer interrupt before the task is dispatched; Determining a minimum execution duration of the task to be allocated from the timer interrupt according to the first end time and the second end time; Based on the minimum execution time, a first task is allocated and determined, wherein the execution time of the first task is not less than the minimum execution time.

5. The method according to claim 4, characterized in that The step of allocating at least one task executed in the corresponding timer interrupt to be executed in at least one ADC interrupt after the timer interrupt ends also includes: Determining a second number of ADC interrupts required to complete the task according to the allocated execution duration of the first task; Determine a second task to be completed by each ADC interrupt in the second number of ADC interrupts, wherein the first task includes the second task, and the execution time of the second number of ADC interrupts assigned with the second task is not greater than the period of the ADC interrupt; Starting from the M+1th ADC interrupt immediately after the timer interrupt, the second task allocated from the timer interrupt is executed in the second number of consecutive ADC interrupts.

6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: Based on the relative relationship between the timing of the timer interrupt and the timing of the ADC interrupt, the trigger position of the timer interrupt in the timing is adjusted to between two adjacent ADC interrupts.

7. An arc detection method, characterized in that: The method further comprises: Executing the ADC interrupt and the timer interrupt according to the timing adjusted by the method according to any one of claims 1 to 6; and The sampling data obtained through the ADC interruption is processed by an arc-drawing algorithm.

8. The method according to claim 7, characterized in that The method further includes: during the process of performing the arc drawing algorithm processing, disabling the ADC interrupt; or In the process of performing the arc drawing algorithm processing, at least one ADC interrupt is executed after the timer interrupt, and at least one task executed in the timer interrupt is deployed to be executed in the at least one ADC interrupt.

9. The method according to any one of claims 7 to 8, characterized in that: The method further comprises: Using a data collector to collect the arc drawing parameters at preset time intervals; discarding the first arc drawing parameter collected; and Starting from the second arc drawing parameter, the acquisition of the first number of arc drawing parameters is performed.

10. A photovoltaic system, characterized in that: include: A sampling device, used for collecting arc drawing parameters in the system; A processor for executing the steps of the arc detection method according to any one of claims 7 to 9.

Citation Information

Patent Citations

  • Integrated online digital signal wave-recording processing method

    CN105067915A

  • Fault detection method and device for photovoltaic string, and storage medium

    CN113792088A

  • Single-task embedded software scheduling method and equipment based on event driving

    CN114924847A

  • Pressure detection method in motor operation process

    CN118670588A

  • Pressure transmitter signal output method and system based on data delay

    CN118971883A