A method and system for automatically optimizing and adjusting PID parameters

CN122600657BActive Publication Date: 2026-09-18SHENZHEN ENERGY EFFICIENCY ELECTRIC TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611072203.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-07-20
Publication Date
2026-09-18
Estimated Expiration
2046-07-20

AI Technical Summary

Technical Problem

例如,在电源开关状态切换的瞬间,本意是等待最初的剧烈震荡平息后再去测量真实的电压纹波大小,但由于寄生LC网络的谐振周期固定,次级能量回弹的波峰时刻在切换事件后以确定的时间偏移出现;当采样延迟被拉长至覆盖主振铃衰减全程后,该延迟时长与次级回弹波峰的到达时刻高度吻合,测量动作正好发生在寄生元件能量二次释放的波峰上,导致系统捕获到的电压瞬态值是次级回弹峰值,而非真正需要的主纹波幅值

Benefits of technology

本发明公开了一种PID参数自动优化调节方法,针对功率开关管节点电压振铃过程中寄生LC谐振能量释放导致的次级回弹干扰问题,通过滑动时间窗检测连续电压采样序列的局部极值获得电压包络序列,识别包络幅值由单调衰减转为非单调抬升的次级回弹区间及其起始时间节点,在该区间内提取局部抬升顶点的回弹峰值及触发时刻,同时对振铃衰减段进行逐点一阶差分运算获得电压衰减梯度分布序列,定位由负转正的过零点作为主纹波时间节点并提取对应的主纹波值,根据回弹峰值与主纹波值的幅值差异以及两者的时间差异划分主纹波采样区与次级回弹区的边界时间节点,以此向前推导安全采样窗口的起始边界并输出至PID调节器,使采样动作持续锁定在主纹波值表征的电压稳定区域内,有效规避次级回弹干扰对控制精度的影响,实现PID参数的自适应优化调节。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122600657B_ABST
    Figure CN122600657B_ABST
Patent Text Reader

Abstract

The application provides a PID parameter automatic optimization and adjustment method and system, comprising: acquiring a continuous voltage sampling sequence of a power switch tube node, performing local maximum value and minimum value detection on the continuous voltage sampling sequence by using a sliding time window to obtain a voltage envelope sequence; according to the voltage envelope sequence, performing segmented identification on a non-monotonic rebound section in a ring-down process to determine a secondary rebound interval of the voltage envelope sequence; performing point-by-point first-order difference operation on a subsequence corresponding to a ring-down section between a starting time node of the voltage envelope sequence and a starting time node of the secondary rebound interval to obtain a voltage decay gradient distribution sequence; and according to amplitude differences of a rebound peak value and a main ripple value and time differences between a triggering time of the rebound peak value and a main ripple time node, dividing boundary time nodes of a main ripple sampling area and a secondary rebound area.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of information technology, and in particular to a method and system for automatic optimization and adjustment of PID parameters. Background Technology

[0002] In the field of power electronics control, PID automatic optimization regulation technology is the core hub for ensuring the stable operation of power supply systems. To obtain accurate voltage ripple feedback signals, it is typically necessary to sample the voltage at the power switch nodes. Existing conventional sampling strategies often rely on a fixed time window avoidance mechanism, that is, by directly increasing the sampling trigger delay time, attempting to bypass the initial violent fluctuation phase to extract a reliable ripple amplitude. However, in actual circuits, due to the presence of parasitic inductance and capacitance, after the initial main ringing, the residual energy in the secondary circuit is released back to the main node due to its own resonant period delay, thus forming a secondary energy rebound interval, manifested as a new voltage fluctuation peak. When the system blindly increases the sampling delay, the sampling window originally intended to avoid main interference will precisely slip into this secondary energy rebound interval. For example, at the instant of power switch state switching, the intention is to wait for the initial violent oscillation to subside before measuring the actual voltage ripple. However, due to the fixed resonant period of the parasitic LC network, the peak of the secondary energy rebound occurs at a predetermined time offset after the switching event. When the sampling delay is extended to cover the entire ringing decay of the main oscillation, this delay duration closely matches the arrival time of the secondary rebound peak. The measurement action occurs precisely at the peak of the secondary energy release of the parasitic element, causing the system to capture the voltage transient value as the secondary rebound peak, rather than the actual main ripple amplitude. Once an incorrect peak is extracted, because the secondary rebound peak is significantly higher than the actual main ripple amplitude, the PID control loop will determine that the output voltage is too high. When using this artificially high voltage reading as a feedback reference to calculate the adjustment deviation, the resulting deviation points in the direction of reducing the output voltage. However, the actual main ripple amplitude has not reached the height reflected by this reading, and the adjustment direction that should be applied is exactly opposite. The duty cycle output correction applied by the PID adjustment algorithm accordingly continuously deviates from the actual main ripple reference. Summary of the Invention

[0003] This invention provides a method for automatic optimization and adjustment of PID parameters, mainly including: A continuous voltage sampling sequence of the power switch node is acquired. A sliding time window is used to detect local maxima and minima in the continuous voltage sampling sequence to obtain a voltage envelope sequence. Based on the voltage envelope sequence, the non-monotonic rise segment during the ringing attenuation process is segmented and identified to determine the secondary rebound interval. Within the secondary rebound interval, local rise vertices are identified based on the voltage rise edge pattern, and the voltage amplitude of these local rise vertices is extracted as the rebound peak value and the trigger time is recorded. A point-by-point first-order difference operation is performed on the ringing attenuation segment subsequence between the start of the voltage envelope sequence and the start time node of the secondary rebound interval to obtain a voltage attenuation gradient distribution sequence. In the voltage attenuation gradient distribution sequence... The zero-crossing point where the negative value turns into a positive value is located. The time value of the zero-crossing point is taken as the time of the switch event triggering the zero point as the main ripple time node. The envelope amplitude corresponding to the main ripple time node is extracted as the main ripple value. Based on the amplitude difference between the rebound peak and the main ripple value, and the time difference between the triggering time of the rebound peak and the main ripple time node, the boundary time nodes of the main ripple sampling area and the secondary rebound area are divided. Based on the boundary time nodes and combined with the main ripple time nodes, the starting boundary of the safety sampling window is derived forward and output to the PID controller. The PID controller adjusts the sampling delay to lock the sampling action within the voltage stability area represented by the main ripple value.

[0004] Furthermore, a sliding time window is used to detect local maxima and minima of the continuous voltage sampling sequence to obtain a voltage envelope sequence. This includes: setting a high-impedance detection access point at the drain pin of the power switch tube; continuously recording the transient voltage of the node using a sampling rate higher than a preset multiple of the switching frequency to obtain a node voltage sampling sequence with timestamps; configuring a sliding window with a window length shorter than half a period of parasitic ringing for the node voltage sampling sequence; extracting the maximum and minimum values ​​within the window point by point to obtain a set of maxima and a set of minima; merging the set of maxima and the set of minima in ascending order of timestamps and using linear interpolation to form an upper envelope segment and a lower envelope segment; and calculating the amplitude difference point by point to obtain the voltage envelope sequence.

[0005] Furthermore, based on the voltage envelope sequence, the non-monotonic rise segment during the ringing attenuation process is segmented and identified to determine the secondary rebound interval. This includes: obtaining the attenuation slope sequence by calculating the forward difference of the voltage envelope sequence according to the sampling time sequence; sliding along the attenuation slope sequence point by point from the trigger time of the switching event, marking the position where the slope sign of consecutive backward points flips from negative to positive as candidate trend reversal points; verifying the time offset of the candidate trend reversal points according to the resonance period of the parasitic loop, if the time interval between the candidate point and the trigger time of the switching event is less than one half-resonance period, it is determined to be a local jitter and is eliminated, and if it is within a preset range of multiples of the resonance period, it is retained as the starting point of the rise; segmenting the voltage envelope sequence at the starting point of the rise, and extending the continuous rising segment after the starting point of the rise until the envelope amplitude falls back to a preset proportion of the starting amplitude of the rise segment, thus obtaining the secondary rebound interval.

[0006] Furthermore, within the secondary rebound interval, local rise peaks are identified based on the voltage rising edge pattern. The voltage amplitude of the local rise peak is extracted as the rebound peak value and the trigger time is recorded. This includes: calculating the amplitude difference between adjacent voltage envelope segments within the secondary rebound interval; if the sign of the adjacent amplitude difference flips from positive to negative, the flip position is marked as a local inflection point; the inflection point with the largest envelope amplitude among the local inflection points is taken as the local rise peak, and the timestamp corresponding to the local rise peak value is recorded as the trigger time of the rebound peak value.

[0007] Furthermore, a point-by-point first-order difference operation is performed on the ringing attenuation segment sequence between the start of the voltage envelope sequence and the start time node of the secondary rebound interval to obtain the voltage attenuation gradient distribution sequence. This includes: calculating the first-order difference value of the amplitude at the next point minus the amplitude at the previous point along the time axis of the ringing attenuation segment sequence, and arranging all the first-order difference values ​​in order along the time axis to obtain the voltage attenuation gradient distribution sequence.

[0008] Furthermore, extracting the envelope amplitude corresponding to the main ripple time node as the main ripple value includes: retrieving sampling points in the voltage envelope sequence that match the timestamp of the main ripple time node and performing linear interpolation to obtain the main ripple value.

[0009] Furthermore, based on the amplitude difference between the rebound peak and the main ripple value, and the time difference between the triggering time of the rebound peak and the main ripple time node, the boundary time nodes for dividing the main ripple sampling area and the secondary rebound area are defined, including: the amplitude difference being the difference obtained by subtracting the main ripple value from the rebound peak; the time difference being the difference obtained by subtracting the main ripple time node from the triggering time of the rebound peak; a transition interval being defined between the main ripple time node and the triggering time of the rebound peak; and a boundary time node being selected within the transition interval based on the amplitude difference and the time difference.

[0010] Furthermore, the starting boundary of the safe sampling window is derived forward from the boundary time node and the main ripple time node, including: deriving the starting boundary of the safe sampling window by offsetting backward from the boundary time node to the main ripple time node along the time axis. The offset is a preset ratio of the time length between the boundary time node and the main ripple time node. The time position obtained by subtracting the offset from the boundary time node is used as the starting boundary of the safe sampling window.

[0011] Furthermore, the PID controller adjusts the sampling delay to lock the sampling action within the voltage stability region represented by the main ripple value. This includes: the starting boundary of the safe sampling window and the main ripple time node are output to the input of the PID controller; the PID controller uses the main ripple time node as the target reference and the actual sampling trigger time corresponding to the current sampling delay as the feedback quantity; the proportional, integral, and derivative components of the PID controller respectively process the instantaneous deviation, cumulative deviation, and deviation change rate to obtain the sampling delay correction quantity; the current sampling delay is superimposed and updated to obtain the target sampling delay for the next cycle; if the actual sampling trigger time deviates from the safe sampling window range, the correction is continued until it converges to the voltage stability region.

[0012] This invention provides an automatic optimization and adjustment system for PID parameters, mainly comprising: The voltage sampling and envelope extraction module is used to obtain the continuous voltage sampling sequence of the power switch node and to obtain the voltage envelope sequence by detecting local maxima and minima using a sliding time window. The secondary rebound interval identification module is used to segment and identify the non-monotonic rise segment in the voltage envelope sequence to determine the secondary rebound interval; The rebound peak extraction module is used to identify the local rise peak when parasitic LC resonance releases energy based on the voltage rise edge shape and extract the voltage amplitude as the rebound peak. The voltage decay gradient calculation module is used to perform a first-order difference on the ringing decay segment subsequence between the start of the voltage envelope sequence and the start time node of the secondary rebound interval to obtain the voltage decay gradient distribution sequence. The main ripple localization and extraction module is used to locate the zero-crossing point in the voltage decay gradient distribution sequence, take the time value as the main ripple time node, and extract the corresponding envelope amplitude as the main ripple value. The boundary time node division module is used to divide the boundary time nodes based on the amplitude difference between the rebound peak value and the main ripple value and the time difference between the trigger time of the rebound peak value and the main ripple time node. The safe sampling window output module is used to derive the starting boundary of the safe sampling window by combining the boundary time node with the main ripple time node, and output it to the PID regulator to adjust the sampling delay so that the sampling is locked in the voltage stable region.

[0013] The technical solutions provided by the embodiments of the present invention may include the following beneficial effects: This invention discloses an automatic optimization and adjustment method for PID parameters. Addressing the secondary rebound interference caused by parasitic LC resonant energy release during the ringing process of power switch node voltage, the method obtains a voltage envelope sequence by detecting local extrema of a continuous voltage sampling sequence through a sliding time window. It identifies the secondary rebound interval where the envelope amplitude changes from monotonically decaying to non-monotonicly rising, and its starting time node. Within this interval, the rebound peak value and trigger time of the local rise apex are extracted. Simultaneously, a point-by-point first-order differential operation is performed on the ringing decay segment to obtain the voltage decay gradient distribution sequence. The zero-crossing point where the value changes from negative to positive is located as the main ripple time node, and the corresponding main ripple value is extracted. Based on the amplitude difference between the rebound peak value and the main ripple value, as well as their time difference, the boundary time nodes of the main ripple sampling area and the secondary rebound area are divided. This allows for the forward derivation of the starting boundary of the safe sampling window, which is then output to the PID controller. This ensures that the sampling action is continuously locked within the voltage stability region represented by the main ripple value, effectively avoiding the impact of secondary rebound interference on control accuracy and achieving adaptive optimization and adjustment of PID parameters. Attached Figure Description

[0014] Figure 1 This is a flowchart of an automatic PID parameter optimization and adjustment method according to the present invention.

[0015] Figure 2 This is a schematic diagram of an automatic optimization and adjustment method for PID parameters according to the present invention.

[0016] Figure 3 This is another schematic diagram of an automatic optimization and adjustment method for PID parameters according to the present invention.

[0017] Figure 4 This is a schematic diagram of the structure of an automatic PID parameter optimization and adjustment system according to the present invention. Detailed Implementation

[0018] The technical solution of the present invention will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0019] like Figures 1-4 This embodiment of a method and system for automatic optimization and adjustment of PID parameters may specifically include: S101. Obtain the continuous voltage sampling sequence of the power switch node, and use a sliding time window to detect local maxima and minima of the continuous voltage sampling sequence to obtain the voltage envelope sequence.

[0020] A high-impedance detection access point is set at the drain pin of the power switch as a node positioning reference. A high-speed analog-to-digital conversion path is connected to the node positioning reference, and the transient voltage of the node is continuously recorded at uniform intervals using a sampling rate higher than a preset multiple of the switching frequency. The continuous recording is written into a cyclic signal buffer. The signal buffer uses the trigger time of the switching event as the anchor reference point, retaining the leading segment forward and the ringing attenuation segment backward, resulting in a node voltage sampling sequence with timestamps. For the node voltage sampling sequence, a sliding window with a window length shorter than half a cycle of parasitic ringing is configured. The sliding window moves backward point by point at unit sampling intervals, and the maximum and minimum values ​​of the voltage values ​​within the window are extracted simultaneously. If the voltage value at the center point of the window is greater than the voltage values ​​of the adjacent sample points on both sides, the center point is determined to be a local maximum; if the voltage value at the center point of the window is less than the voltage values ​​of the adjacent sample points on both sides, the center point is determined to be a local minimum, resulting in a set of maximum and minimum points with timestamps. Based on the set of maximum and minimum points, the extreme points are merged in ascending order according to the timestamps corresponding to each extreme point. Linear interpolation is used to form an upper envelope segment between adjacent maxima and a lower envelope segment between adjacent minima. The upper and lower envelope segments are aligned along the same time axis, and the amplitude difference is calculated point by point as the instantaneous swing of the ringing envelope. The instantaneous swing is arranged over time to obtain a voltage envelope sequence that reflects the shape of the voltage ringing envelope.

[0021] During the switching transient of a power switch, the ringing phenomenon of the node voltage is caused by a resonant circuit formed by parasitic inductance and capacitance, and the ringing amplitude gradually decays over time. To extract the true main ripple information, it is necessary to first obtain an envelope curve reflecting the overall ringing pattern. The acquisition of the envelope curve depends on high-resolution sampling and extreme value detection of the node transient voltage. In one embodiment, a high-impedance probe access point is set at the drain pin of the power switch as a node positioning reference. The high-impedance probe access point is connected to the sampling path through a series resistor voltage divider structure, which consists of a front-stage resistor R1 and a rear-stage resistor R2. The value of R1 ranges from 0.8 megohms to 2 megohms, and the value of R2 ranges from 8 kilohms to 20 kilohms. The voltage division ratio K = R2 / (R1 + R2) is set between 0.01 and 0.02, so that the overall input impedance is kept between 1 megohms and 2 megohms, avoiding a load effect on the transient waveform of the node under test. After the node positioning reference is connected to the high-speed analog-to-digital conversion path, the sampling rate is configured to be 50 to 200 times the switching frequency of the power switch tube, ensuring that more than 15 discrete sample points can be covered in a single ringing cycle for accurate extraction of the envelope curve.

[0022] For example, if the switching frequency is in the hundreds of kilohertz range, the sampling rate is configured to be in the tens of megahertz range. The analog-to-digital conversion path continuously records the transient voltage of the node at uniform intervals, and then writes this continuous record into a cyclic signal buffer. The cyclic signal buffer has a first-in, first-out (FIFO) structure, and the buffer depth is configured according to the complete ringing decay time of a single switching event. This decay time is determined by the parasitic parameters of the measurement circuit and is calculated as T = 5 × L / R, where L is the parasitic inductance, R is the equivalent damping resistance, and the coefficient 5 corresponds to the ringing amplitude decaying to 1% of its initial value. A typical configuration range is 500 nanoseconds to 2 microseconds. The cyclic signal buffer uses the gate drive pulse transition edge of the power switch as the trigger time of the switching event. This trigger time is set as the anchor reference point. A preamble is retained to record the steady-state voltage baseline before switching, and a ringing attenuation segment is retained to record transient fluctuations after switching. The duration of the preamble is set to 20% to 30% of the ringing attenuation duration, and the duration of the ringing attenuation segment is set to 70% to 80% of the ringing attenuation duration. For example, when the ringing attenuation duration is 1 microsecond, the preamble is configured to be 200 nanoseconds, and the ringing attenuation segment is configured to be 800 nanoseconds, resulting in a node voltage sampling sequence with timestamps.

[0023] It should be noted that the ringing waveform in the node voltage sampling sequence consists of several alternating extreme points, and the time interval between adjacent extreme points in the same direction is approximately equal to the resonant period of the parasitic loop. Based on this characteristic, a sliding window is configured for the node voltage sampling sequence, and the window length is set shorter than half a cycle of the parasitic ringing. The selection of the window length follows a principle: if the window length is too long, multiple samples within a half-cycle of ringing will be included in the comparison range simultaneously, causing the true extreme value to be masked by adjacent samples; if the window length is too short, false extreme values ​​will be introduced due to the jitter of discrete sampling.

[0024] Preferably, the window length is configured to be one-quarter to one-third of the parasitic loop resonant period. The sliding window moves backward point by point at unit sampling intervals, and at each moving position, the maximum and minimum values ​​of the sample voltages within the window are extracted simultaneously. The specific determination rule is that if the voltage value of the current window center point is simultaneously greater than the voltage values ​​of the adjacent sample points on both sides, then the center point is determined to be a local maximum; if the voltage value of the current window center point is simultaneously less than the voltage values ​​of the adjacent sample points on both sides, then the center point is determined to be a local minimum. All determined extreme points, along with their timestamps, are summarized to form a set of maximum points and a set of minimum points, respectively. Further, the sets of maximum points and minimum points are merged in ascending order according to the timestamps corresponding to each extreme point. In the merged extreme value sequence, a linear interpolation algorithm is used for the time interval between two adjacent maximum points to interpolate the upper envelope amplitude of each sample point within that time interval, forming the upper envelope segment; the same linear interpolation is used for the time interval between two adjacent minimum points to obtain the lower envelope segment.

[0025] In one embodiment, after aligning the upper and lower envelope segments along the same time axis, for each sampling moment, the upper amplitude is taken from the upper envelope segment and the lower amplitude is taken from the lower envelope segment, and the difference between the two is used to obtain the instantaneous swing at that moment. The instantaneous swing is arranged point by point over time to obtain a voltage envelope sequence that reflects the voltage ringing envelope pattern.

[0026] It is understandable that the voltage envelope sequence abstracts the ringing waveform, which originally contained high-frequency details, into a smooth amplitude variation curve. The envelope amplitude shows an overall decreasing trend during the ringing decay process, and the local anomalies in the amplitude variation provide morphological basis for subsequent identification of the secondary rebound interval.

[0027] S102. Based on the voltage envelope sequence, segment the non-monotonic recovery segment during the ringing attenuation process to determine the secondary rebound interval of the voltage envelope sequence.

[0028] For the voltage envelope sequence, forward difference is calculated for adjacent amplitude points according to the sampling time sequence to obtain an attenuation slope sequence reflecting the direction of envelope amplitude change. In the attenuation slope sequence, negative values ​​correspond to the decreasing segment of envelope amplitude, and positive values ​​correspond to the increasing segment of envelope amplitude. The attenuation slope sequence is slid point by point from the moment the switching event is triggered, and the consistency of the slope sign between the current point and a preset number of consecutive backward points is verified. If all consecutive backward points maintain negative values, the current position is determined to be in the monotonically decreasing segment of the ringing body. If the slope sign of consecutive backward points in the negative value sequence flips from negative to positive, the flipped position is marked as a candidate trend reversal point, and a set of candidate trend reversal point positions is obtained. For the set of candidate trend reversal points, the time offset of each candidate point is verified based on the resonance period of the parasitic loop. If the time interval between the candidate trend reversal point and the trigger time of the switching event is less than one half-resonance period, the candidate point is determined to be a local jitter within the ringing body and is eliminated. If the time interval is within a preset multiple of the resonance period, the candidate point is retained as the starting point of the rise, thus obtaining the starting point of the non-monotonic recovery segment in the voltage envelope sequence. Based on the starting point, the voltage envelope sequence is segmented at the starting point position. The continuous rising segment after the starting point is recorded as the non-monotonic recovery segment. The non-monotonic recovery segment is extended backward along the time axis until the envelope amplitude falls back to a preset proportion lower than the initial amplitude of the recovery segment, thus obtaining the complete coverage of the non-monotonic recovery segment as the secondary rebound interval of the voltage envelope sequence. The timestamp corresponding to the starting point is recorded as the starting time node of the secondary rebound interval.

[0029] The ringing waveform formed during the switching transient of a power switch exhibits an overall decreasing trend in envelope amplitude during the main decay phase. However, after the parasitic circuit completes its first round of energy dissipation, residual magnetic and electrical energy that has not yet been fully released in the circuit will couple back to the main node, causing a local rise in envelope amplitude. This local rise constitutes the non-monotonic recovery segment in the voltage envelope sequence, corresponding to the physical form of the secondary rebound interval.

[0030] It should be noted that, ideally, the voltage envelope sequence should exhibit a strictly monotonically decreasing trend. However, in actual operating conditions, due to the secondary energy exchange of parasitic loops, the envelope amplitude will experience at least one reverse rise during the decay process. Identification of the secondary rebound interval depends on the accurate segmentation and location of this non-monotonic rebound segment. In one embodiment, the voltage envelope sequence is subjected to forward differential operation according to the sampling sequence.

[0031] Specifically, for adjacent amplitude points E(t) and E(t+1) at times t and t+1 in the voltage envelope sequence, the difference D(t) = E(t+1) - E(t) is calculated. This difference D(t) is the attenuation slope value corresponding to time t. This difference operation is repeated point-by-point for each pair of adjacent amplitude points in the voltage envelope sequence to obtain an attenuation slope sequence aligned with the time axis of the voltage envelope sequence. The sign of each element in the attenuation slope sequence carries morphological information: when D(t) is negative, the envelope amplitude at the corresponding position is in a decreasing phase; when D(t) is positive, the envelope amplitude at the corresponding position is in a rising phase; and when D(t) is close to zero, the corresponding position is near a waveform inflection point.

[0032] Preferably, the attenuation slope sequence is subjected to small-amplitude threshold filtering, and the difference between absolute values ​​below a preset noise threshold is set to zero to avoid false sign flips introduced by discrete sampling jitter. The preset noise threshold θ is set to 5% to 10% of the signal amplitude A, i.e., θ = 0.05A to 0.1A. When the signal amplitude fluctuation range is large, the upper limit is taken to improve anti-interference capability. Further, the attenuation slope sequence is slid backward point by point from the moment the switch event is triggered, and the sign consistency between the current point D(t) and the subsequent N consecutive backward points D(t+1), D(t+2), up to D(t+N) is verified, where N is a preset number.

[0033] In one embodiment, the value of N is determined by combining the sampling rate and the ringing period, ensuring that the time span covered by N consecutive backward points is shorter than one complete ringing period. Optionally, N can be 5 to 8. This range ensures that at least two complete signal sampling periods are covered to capture the true attenuation trend. When the sampling frequency is low, the upper limit is used to enhance the reliability of the judgment, while when the sampling frequency is high and the signal attenuation rate is fast, the lower limit can be used to improve the response speed.

[0034] Specifically, if the current point D(t) and the following N consecutive backward points all maintain negative values, then time t is determined to be in the monotonically decreasing segment of the ringing body, with the amplitude showing an overall decaying trend. If a local pattern appears in the decay slope sequence, where from a certain time t, the preceding consecutive points maintain negative values, while the signs of the following N consecutive backward points flip from negative to positive, then this flipping position t is marked as a candidate trend reversal point. The candidate trend reversal points do not necessarily all correspond to the actual secondary rebound starting point. High-frequency ripple superposition, sampling jitter, or measurement noise within the ringing body can also trigger sign flipping. Therefore, all candidate trend reversal points are aggregated into a position set for subsequent verification and screening. If the M consecutive points from tM to t are all negative, with M ranging from 3 to 5, and more than 80% of the N points from t+1 to t+N flip from negative to positive, then t is marked as a candidate trend reversal point. For example, if a slope sequence is -0.3, -0.2, -0.1, +0.05, +0.08, +0.12, then a sign flip occurs at the 3rd sampling point. Since high-frequency ripple superposition, sampling jitter, or measurement noise can also cause local sign flips, all candidate points need to be aggregated into a location set.

[0035] It is understandable that the resonant period of a parasitic circuit is determined by the equivalent parasitic inductance L and equivalent parasitic capacitance C of the circuit, and its characteristic time T satisfies... In the formula, L is the parasitic inductance, C is the parasitic capacitance, and π is pi. The characteristic time T serves as the time window criterion for dividing the main ringing stage and the secondary rebound stage, and is used to screen the reasonable occurrence interval of candidate trend reversal points. The switching event trigger time refers to the moment when the drive signal of the main power switching device changes from conduction to turn-off or from turn-off to conduction, which can be determined by collecting the timestamps corresponding to the rising or falling edges of the drive signal, and this moment is used as the zero-point reference for the time offset Δt. In one embodiment, for each candidate point in the set of candidate trend reversal point positions, the time offset Δt from the candidate point to the switching event trigger time is calculated. If Δt is less than 0.5*T, meaning the time offset is still within the first half-cycle of resonance, the candidate point is determined to be in the violent oscillation stage of the main ringing body. Its sign reversal originates from the periodic fluctuation of the main ringing itself and is not a substantial manifestation of secondary energy rebound. The candidate point is then eliminated. If Δt falls within the range of 0.5*T to 5*T, i.e., with a single half-cycle of resonance as the lower bound and five complete resonance cycles as the upper bound, covering a reasonable time window for the release of secondary energy in the parasitic circuit, the candidate point is retained as the starting point for the rise. If Δt exceeds 5*T, the candidate point is considered to have deviated from the effective attenuation window of the secondary rebound and is also eliminated. After the above time offset verification, false candidate points in the set of candidate trend reversal points are filtered out, and the remaining candidate points constitute the starting point for the rise of the non-monotonic rise segment in the first voltage envelope sequence.

[0036] For example, the voltage envelope sequence is segmented at the time position corresponding to the rise start point. Segmentation divides the voltage envelope sequence into two segments, with the continuous rising segment after the rise start point being independently marked and named the non-monotonic recovery segment. Further, the non-monotonic recovery segment is extended point by point along the time axis to track the subsequent changes in the envelope amplitude until the envelope amplitude falls back to a preset proportion below the initial amplitude of the non-monotonic recovery segment.

[0037] Preferably, the preset ratio is a fraction lower than the initial amplitude to ensure that the extension endpoint is located in the low-amplitude region after the secondary energy has been dissipated. The complete coverage range of the non-monotonic recovery segment from the starting point to the extension endpoint serves as the secondary rebound interval of the voltage envelope sequence.

[0038] It is understood that the timestamp corresponding to the lifting start point is the starting time node of the secondary rebound interval. This starting time node reflects the beginning moment of the secondary energy release of the parasitic LC resonance, providing a time anchoring basis for subsequently distinguishing the main ripple sampling area from the secondary rebound area.

[0039] S103. Within the secondary rebound range, identify the local rise peak generated when the parasitic LC resonance releases energy based on the voltage rise edge pattern, extract the voltage amplitude of the local rise peak as the rebound peak value, and record the trigger time of the rebound peak value.

[0040] For the voltage envelope sequence segment within the secondary rebound interval, the amplitude difference between adjacent amplitude points is calculated along the time axis. The sign of the adjacent amplitude difference represents the rising edge pattern. If the sign of the adjacent amplitude difference flips from positive to negative, the flip position is marked as a local inflection point, resulting in a set of local inflection points within the secondary rebound interval. For each inflection point in the set of local inflection points, the envelope amplitude corresponding to each inflection point is compared. The inflection point with the largest envelope amplitude in the set of local inflection points is taken as the local rise peak. The envelope amplitude corresponding to the local rise peak is taken as the rebound peak value, and the timestamp corresponding to the local rise peak value is recorded as the trigger time of the rebound peak value.

[0041] After the main ringing decays, the secondary energy exchange between residual magnetic and electrical energy in a parasitic LC resonant circuit causes the node voltage to exhibit a local wave packet shape that first rises and then falls within the secondary rebound region. The apex of this local wave packet is the instantaneous highest voltage position during the secondary energy release process of the parasitic LC resonant circuit. The voltage amplitude at this apex and the triggering time are the key criteria for distinguishing between the main ripple sampling region and the secondary rebound region.

[0042] Specifically, for the voltage envelope sequence segment intercepted within the secondary rebound interval, the amplitude difference between the previous and subsequent amplitude points is calculated along the time axis for every two adjacent amplitude points. When the adjacent amplitude difference is positive, the envelope is on a rising edge at that moment; when the adjacent amplitude difference is negative, the envelope is on a falling edge at that moment. In one embodiment, the sign change of the adjacent amplitude difference is scanned point by point along the time axis. If the adjacent amplitude difference before a certain position remains positive and the adjacent amplitude difference after that position flips to a negative value, then that position is marked as a local inflection point. All positions that satisfy the above sign flipping condition are collected to form a set of local inflection points, and each inflection point in the set of local inflection points corresponds to a transition position from rising to falling.

[0043] It should be noted that the presence of multiple candidate inflection points in the local inflection point set stems from the high-frequency, small-amplitude fluctuations that may be superimposed during the secondary energy rebound process.

[0044] Preferably, the envelope amplitude of each inflection point in the set of local inflection points is compared, and the inflection point with the largest envelope amplitude in the set of local inflection points is taken as the local rise peak. The envelope amplitude corresponding to the local rise peak is taken as the rebound peak value, and the timestamp corresponding to the local rise peak value is recorded as the trigger time of the rebound peak value.

[0045] It is understandable that the rebound peak reflects the highest voltage released by the parasitic LC resonant secondary energy, and the triggering time of the rebound peak reflects the delay of the highest voltage relative to the triggering time of the switching event. Together, they constitute the amplitude and time characteristics of the secondary rebound phenomenon.

[0046] S104. Perform point-by-point first-order difference operation on the subsequence corresponding to the ringing attenuation segment between the start of the voltage envelope sequence and the start time node of the secondary rebound interval to obtain the voltage attenuation gradient distribution sequence.

[0047] Based on the starting time node of the secondary rebound interval, a continuous amplitude segment from the starting point of the voltage envelope sequence to the starting time node is extracted from the voltage envelope sequence. This continuous amplitude segment corresponds to the attenuation process of the ringing body, resulting in a ringing attenuation segment subsequence. For the ringing attenuation segment subsequence, the first-order difference between the amplitude of the next point and the amplitude of the previous point is calculated along the time axis. This first-order difference reflects the change in envelope amplitude within adjacent sampling intervals. All first-order difference values ​​are arranged sequentially along the time axis to obtain the voltage attenuation gradient distribution sequence.

[0048] The ringing attenuation segment reflects the energy dissipation process after the power switch transients, and its envelope amplitude generally shows a downward trend. Finding the deepest trough point within this attenuation segment is a crucial prerequisite for locating the main ripple. To make the location of the trough point independent of the absolute amplitude, it is more reliable to convert the morphological characteristics of the attenuation segment into gradient information that reflects the rate of amplitude change.

[0049] Specifically, in one implementation, the boundaries of the interception range are strictly defined. The starting point of the interception is selected from the starting point of the voltage envelope sequence, corresponding to the initial highest position of the envelope amplitude after the switching event is triggered; the ending point of the interception is selected from the starting time node of the secondary rebound interval, corresponding to the critical position where the envelope amplitude changes from monotonically decreasing to non-monotonicly increasing. All envelope amplitude sampling points between the above two time positions are intercepted from the voltage envelope sequence along the time axis. The extracted continuous amplitude segment does not include any sampling points within the secondary rebound interval, resulting in a ringing attenuation segment subsequence.

[0050] It should be noted that while the ringing decay segment sequence decreases overall, there are still small local fluctuations, and it is difficult to accurately locate the deepest decay based solely on the amplitude.

[0051] Preferably, for the ringing attenuation segment subsequence, adjacent amplitude points are processed pairwise in chronological order. For each pair of adjacent amplitude points, the difference between the amplitude of the next point and the amplitude of the previous point is calculated, and the resulting difference is denoted as the first-order difference value. The sign of the first-order difference value reflects the rising and falling direction of the envelope within the sampling interval, and the absolute value of the first-order difference value reflects the rate of change of the envelope amplitude within the sampling interval. All first-order difference values ​​are arranged in chronological order according to their corresponding timestamps to obtain the voltage attenuation gradient distribution sequence.

[0052] It is understood that the voltage attenuation gradient distribution sequence converts the overall downward trend of the ringing attenuation segment into point-by-point gradient data. The trajectory of the gradient transitioning from negative to zero and then to positive contains the location information of the lowest attenuation valley. The voltage attenuation gradient distribution sequence provides a morphological basis for locating the main ripple time node at the zero crossover point.

[0053] S105. Locate the zero-crossing point in the voltage decay gradient distribution sequence where the value changes from negative to positive. Map the zero-crossing point to the time value in the coordinate system with the time of the switch event trigger as the time zero point, and extract the envelope voltage amplitude corresponding to the time of the main ripple as the main ripple value.

[0054] For the voltage decay gradient distribution sequence, the sign of each gradient value is scanned point by point along the time axis. The sign of the gradient value at the current point is compared with the sign of the gradient value at the immediately preceding point. If the gradient value at the current point is negative and the gradient value at the immediately preceding point is positive, the intermediate time position between these adjacent positions is marked as a zero-crossing point. The zero-crossing point corresponds to the lowest point in the ringing body decay process, thus obtaining the zero-crossing point position in the voltage decay gradient distribution sequence. Based on the zero-crossing point position, a relative time coordinate system is constructed with the switching event triggering time of the power switch as the origin. The time offset corresponding to the zero-crossing point position in the relative time coordinate system is taken as the main ripple time node. The main ripple time node reflects the time delay between the lowest point of the ringing body and the switching event triggering time. Based on the main ripple time node, an envelope amplitude sampling point matching the timestamp of the main ripple time node is retrieved in the voltage envelope sequence. If the timestamp falls between two adjacent sampling points, the envelope amplitudes of the two adjacent sampling points are linearly interpolated to obtain the target envelope amplitude. The target envelope amplitude is taken as the main ripple value, which reflects the true envelope voltage amplitude corresponding to the lowest valley point during the ringing body attenuation process.

[0055] The voltage decay gradient distribution sequence carries information about the point-by-point rate of change of the envelope amplitude during the ringing main decay process. During the main decay phase, the envelope amplitude transitions from high to low, and the corresponding gradient value remains negative in the early part of the sequence. When the envelope amplitude drops to its lowest point, the amplitude begins to rise slightly, and the gradient value flips to a positive value. The critical position of this negative-to-positive reversal is the morphological inflection point of the deepest decay.

[0056] Understandably, gradient data near the zero-crossing point is the core basis for determining the true moment of the main ripple. Relying solely on the instantaneous value of the envelope amplitude is easily affected by high-frequency ripple jitter, while the gradient sign reflects the direction of change and has a strong tolerance to small-amplitude noise.

[0057] Specifically, for the voltage decay gradient distribution sequence, the sequence is scanned point by point along the time axis from the starting point. During the scan, the gradient value G(i) at the current point and the gradient value G(i+1) at the immediately preceding point are taken as a comparison sample, and their signs are checked. If G(i) is less than 0 and G(i+1) is greater than or equal to 0, it is determined that a gradient sign flip from negative to positive has occurred between G(i) and G(i+1); the time position corresponding to this flip is taken as the midpoint between the current point and the immediately preceding point, and marked as a zero-crossing point. In one embodiment, all positions in the voltage decay gradient distribution sequence that satisfy the above sign flipping condition are registered, and multiple candidate zero-crossing points may exist.

[0058] Preferably, the negative-to-positive reversal zero-crossing point closest to the trigger time of the switching event is taken as the target zero-crossing point to eliminate secondary reversal interference caused by weak jitter at the end of the attenuation, and to obtain the zero-crossing point position in the voltage attenuation gradient distribution sequence.

[0059] It should be noted that the zero-crossing point corresponds to the instantaneous position in the ringing attenuation segment sequence where the gradient changes from negative to positive, i.e., the lowest point in the ringing body attenuation process. The physical meaning of this lowest point is the deepest point of energy dissipation in the ringing body, corresponding to the instantaneous position where the true main ripple appears. Further, based on the zero-crossing point, a relative time coordinate system is constructed with the gate drive pulse transition of the power switch along the corresponding switching event trigger time as the origin. In this relative time coordinate system, the switching event trigger time is set to zero, and subsequent sampling times are converted into positive time offsets according to their time difference relative to the trigger time.

[0060] In one embodiment, the time offset corresponding to the zero-crossing point position in the relative time coordinate system is taken as the main ripple time node. The main ripple time node reflects the time delay between the lowest point of the ringing body and the triggering time of the switch event.

[0061] For example, based on the main ripple time node, an envelope amplitude sampling point matching the timestamp of the main ripple time node is retrieved in the voltage envelope sequence. In actual operating conditions, the timestamp corresponding to the main ripple time node usually falls between two adjacent sampling points of the discrete sampling grid.

[0062] In one possible implementation, linear interpolation is performed on the envelope amplitudes of two adjacent sampling points that enclose the main ripple time node: Let the timestamps of the two adjacent sampling points be t1 and t2, and the corresponding envelope amplitudes be E1 and E2, respectively. Then, the target envelope amplitude E corresponding to the main ripple time node satisfies... In the formula, t is the timestamp of the main ripple time node. The target envelope amplitude is taken as the main ripple value.

[0063] It is understood that the main ripple value reflects the true envelope voltage amplitude corresponding to the lowest point during the ringing body attenuation process. This amplitude differs significantly from the secondary rebound peak value, providing an amplitude benchmark for subsequently dividing the boundary between the main ripple sampling area and the secondary rebound area. Another way to determine the main ripple value is to scan the sign of each gradient value point by point along the time axis for the voltage attenuation gradient distribution sequence. The gradient value G(i) at the current point is compared with the gradient value G(i+1) at the immediately following point. If G(i) is less than 0 and G(i+1) is greater than or equal to 0, then the precise time position Tzero of the zero-crossing point between these adjacent positions is calculated by linear interpolation. That is, Tzero is equal to T(i) plus the absolute value of G(i) divided by the absolute value of the difference between G(i) and G(i+1) multiplied by the sampling time interval, where T(i) is the timestamp of the i-th sampling point. The zero-crossing point corresponds to the lowest point during the ringing body attenuation process. A relative time coordinate system is constructed using the turn-on or turn-off moment of the power switch as the time origin T0. The time offset corresponding to the zero-crossing point in this coordinate system is the main ripple time node Tripple, which reflects the time delay between the lowest point of the ringing main body and the switch action. The voltage envelope sequence is obtained by extracting the instantaneous amplitude through Hilbert transform of the ringing voltage waveform. This sequence records the voltage envelope amplitude at each sampling moment. Based on the main ripple time node Tripple, the envelope amplitude corresponding to the timestamp is retrieved in the voltage envelope sequence. If Tripple falls between adjacent sampling points T(j) and T(j+1), then linear interpolation is performed on the envelope amplitudes Venv(j) and Venv(j+1) of the two points. The calculation formula is Vtarget equal to Venv(j) plus the difference between Tripple and T(j), divided by the difference between T(j+1) and T(j), and then multiplied by the difference between Venv(j+1) and Venv(j). The resulting Vtarget is the main ripple value, which quantitatively characterizes the voltage amplitude at the lowest point during the ringing body attenuation process.

[0064] S106. Based on the amplitude difference between the rebound peak and the main ripple value, and the time difference between the triggering time of the rebound peak and the time node of the main ripple, divide the boundary time nodes of the main ripple sampling area and the secondary rebound area.

[0065] The amplitude difference between the rebound peak value and the main ripple value is obtained, and the amplitude difference is the difference obtained by subtracting the main ripple value from the rebound peak value; the time difference between the trigger time of the rebound peak value and the time node of the main ripple value is obtained, and the time difference is the difference obtained by subtracting the time node of the main ripple value from the trigger time of the rebound peak value, so as to obtain the amplitude difference and time difference reflecting the relative relationship between the main ripple and the secondary rebound. Based on the time difference, a transition interval is defined between the main ripple time node and the triggering time of the rebound peak. The amplitude difference is normalized by dividing the amplitude difference by the sum of the absolute values ​​of the rebound peak and the main ripple value to obtain the normalized amplitude ratio r. r is a dimensionless quantity, and its value is limited to between 0 and 1. If the calculation result exceeds this range, it is truncated according to the boundary value. For example, when the main ripple value is -0.2 and the rebound peak value is 0.6, r equals 0.8 divided by 0.8, which is 1.0, indicating that the secondary rebound is dominant relative to the main ripple. Based on the transition interval and the normalized amplitude ratio, the boundary time node position Tb is taken along the time axis within the transition interval. Tb satisfies In the formula, Tm is the primary ripple time node in milliseconds, Δt is the time difference in milliseconds, and r is the normalized amplitude ratio, which serves as a dimensionless offset scaling factor to characterize the pulling effect of the secondary rebound intensity on the boundary position. When r approaches 0, the secondary rebound is relatively weak, Tb is close to the rebound peak trigger time, and the primary ripple sampling area expands. When r approaches 1, the secondary rebound is relatively strong, Tb is close to Tm, and the primary ripple sampling area contracts. The time period before the boundary time node is marked as the primary ripple sampling area, and the time period after the boundary time node is marked as the secondary rebound area, thus obtaining the boundary time node between the primary ripple sampling area and the secondary rebound area.

[0066] During the transient process of a power switch, there is a definite time interval between the main ripple time node corresponding to the lowest point of the ringing main body and the trigger moment of the rebound peak generated by the secondary energy release of the parasitic LC resonance. Within this interval, the voltage pattern transitions from decay to recovery. Defining the boundary time node between the main ripple sampling region and the secondary rebound region essentially involves finding a dividing point between the main ripple time node and the rebound peak trigger moment. The time period before the dividing point allows sampling to lock the true main ripple, while the time period after the dividing point enters the secondary rebound rise process, and sampling should be avoided.

[0067] Specifically, in one embodiment, the amplitude difference between the rebound peak value and the main ripple value is obtained. The amplitude difference is the difference obtained by subtracting the main ripple value from the rebound peak value; its dimension is the same as voltage, and its value reflects the additional boost in energy released by the parasitic LC resonant secondary wave on top of the main ripple. Under light load conditions, the amplitude difference is small, and the transition of the envelope from the main ripple to the rebound peak value is relatively gentle; under heavy load or high switching frequency conditions, the amplitude difference is large, and the transition of the envelope from the main ripple to the rebound peak value is relatively steep.

[0068] It should be noted that a single amplitude difference is insufficient to determine the boundary; a time-dimensional reference is still necessary. The time difference between the trigger time of the rebound peak and the main ripple time node is obtained. This time difference is the difference obtained by subtracting the main ripple time node from the trigger time of the rebound peak. Its dimension is the same as time, and its value reflects the time offset of the secondary energy rebound peak relative to the location of the main ripple. Further, based on the time difference, a transition interval is defined between the main ripple time node and the trigger time of the rebound peak. The left endpoint of the transition interval is the main ripple time node, and the right endpoint is the trigger time of the rebound peak. The total length of the interval is equal to the time difference. The physical meaning of the transition interval is the entire time range during which the envelope amplitude transitions from its lowest point to the secondary rebound peak.

[0069] Specifically, the amplitude difference is normalized. The amplitude difference is divided by the rebound peak value to obtain the normalized amplitude ratio r. The normalized amplitude ratio r is a dimensionless quantity, ranging from 0 to 1. The closer r is to 1, the higher the rebound peak value is to the main ripple value, and the more prominent the secondary rebound rise intensity is; the closer r is to 0, the smaller the difference between the rebound peak value and the main ripple value, and the relatively weak the influence of the secondary rebound.

[0070] In one embodiment, for power loops with large parasitic parameters, the normalized amplitude ratio r can typically exceed a preset threshold. In this case, the secondary rebound has a strong potential interference to the sampling, and the boundary time node should be closer to the main ripple time node to shorten the exposure width of the main ripple sampling area.

[0071] In one possible implementation, the boundary time node position Tb is determined along the time axis within the transition interval based on the ratio of the transition interval to the normalized amplitude, satisfying Tb = Tm + Δt × (1-r), where Tm is the main ripple time node, Δt is the time difference, and r is the normalized amplitude ratio. This formula indicates that the boundary time node position extends backward from the main ripple time node for a period of time, which is the time difference Δt multiplied by the compensation coefficient (1-r). When r is large and the secondary rebound rise intensity is prominent, (1-r) is small, and the boundary time node is closer to the main ripple time node; when r is small and the secondary rebound rise intensity is weak, (1-r) is large, and the boundary time node is closer to the triggering time of the rebound peak.

[0072] It is understood that the time period before the boundary time node is marked as the main ripple sampling region, and the time period after the boundary time node is marked as the secondary rebound region. The main ripple sampling region is a safe area where the envelope amplitude fluctuates stably around the main ripple value, while the secondary rebound region is a dangerous area where the envelope amplitude is raised due to the secondary release energy of parasitic LC resonance.

[0073] For example, in power switch applications with different power supply topologies or different parasitic parameters, the value of the normalized amplitude ratio r will adapt to the operating conditions, and the position of the boundary time node will be dynamically adjusted along the transition interval so that the division between the main ripple sampling area and the secondary rebound area always matches the actual shape of the current circuit.

[0074] S107. Using the boundary time node as a reference, the starting boundary of the safe sampling window is derived forward by combining the main ripple time node, and output to the PID controller. The PID controller uses the main ripple time as the target reference and adjusts the sampling delay so that the sampling action is locked in the voltage stability region represented by the main ripple value.

[0075] Based on the boundary time node, a reverse offset is derived along the time axis in the direction of the main ripple time node. The reverse offset is a preset proportion of the time length between the boundary time node and the main ripple time node. The time position obtained by subtracting the reverse offset from the boundary time node is taken as the starting boundary of the safe sampling window. The ending boundary of the safe sampling window is aligned with the boundary time node. The safe sampling window covers a continuous time range from the starting boundary to the ending boundary, thus obtaining the starting boundary of the safe sampling window. Based on the starting boundary of the safe sampling window, the starting boundary of the safe sampling window and the main ripple time node are output to the input of the PID controller. The PID controller uses the main ripple time node as the target reference and the actual sampling trigger time corresponding to the current sampling delay as the feedback quantity. The proportional, integral, and derivative components of the PID controller respectively process the instantaneous deviation, cumulative deviation, and deviation change rate between the actual sampling trigger time and the target reference to obtain the sampling delay correction quantity output by the PID controller. Based on the sampling delay correction amount, the current sampling delay is updated in real time to obtain the target sampling delay for the next cycle. The target sampling delay control sampling trigger module delays the target sampling delay for the duration after each switching event is triggered before starting the sampling action. If the actual sampling trigger time is between the start and end boundaries of the safe sampling window, the target sampling delay value remains unchanged. If the actual sampling trigger time deviates from the range of the safe sampling window, the PID controller continues to calculate and add the sampling delay correction amount until the actual sampling trigger time converges to the voltage stability region corresponding to the main ripple time node.

[0076] The boundary time nodes between the main ripple sampling area and the secondary rebound area have been marked as the critical positions where sampling is not possible. However, in order for the actual sampling action to be locked within the voltage stability area corresponding to the main ripple time node, it is necessary to further construct a window range with time tolerance within the boundary time node and let the PID controller continuously correct the actual sampling trigger time so that the sampling action falls within this window range in each switching cycle.

[0077] Specifically, in one implementation, a reverse offset is derived along the time axis in the direction of the main ripple time node based on the boundary time node. The determination of the reverse offset follows a principle: if the reverse offset is too large, the starting boundary of the safety sampling window will be too close to the main ripple time node, narrowing the window width, and the PID controller will go out of bounds if a small overshoot occurs; if the reverse offset is too small, the starting boundary of the window will be too close to the boundary time node, failing to reserve a buffer distance for the secondary rebound and climb process.

[0078] Preferably, the reverse offset is a preset ratio of the time length between the boundary time node and the main ripple time node, and the preset ratio is between 0.2 and 0.5. Further, the time position obtained by subtracting the reverse offset from the boundary time node is taken as the starting boundary of the safe sampling window. The ending boundary of the safe sampling window is aligned with the boundary time node.

[0079] In one embodiment, the secure sampling window is defined by a start boundary and an end boundary, covering a continuous time range from the start boundary to the end boundary.

[0080] It should be noted that the safety sampling window provides a certain time margin for the sampling action, and the envelope voltage at any time within the window belongs to the voltage stability region characterized by the main ripple value.

[0081] Specifically, based on the starting boundary of the safety sampling window, the starting boundary of the safety sampling window and the main ripple time node are jointly output to the input of the PID controller. The PID controller is a closed-loop feedback controller, which uses the main ripple time node as the target reference and the actual sampling trigger time corresponding to the current sampling delay as the feedback quantity. The instantaneous deviation e(k) is obtained by subtracting the target reference from the feedback quantity, where k is the discrete control cycle number and e(k) is the deviation value between the feedback quantity and the target reference in the k-th control cycle.

[0082] In one possible implementation, the proportional element of the PID controller directly multiplies the instantaneous deviation e(k) by the proportional gain. The output of the proportional element reflects the immediate correction force of the current deviation; the larger the deviation amplitude, the larger the output of the proportional element. The integral element of the PID controller accumulates and sums the deviations over historical control cycles. The accumulated deviation reflects the systematic deviation of the feedback quantity relative to the target reference in the long-term direction. The output of the integral element is multiplied by the integral gain to eliminate steady-state error. The derivative element of the PID controller calculates the deviation change rate between adjacent control cycles. The deviation change rate reflects the trend rate of the feedback quantity approaching or moving away from the target reference. The output of the derivative element is multiplied by the derivative gain to suppress overshoot. The outputs of the proportional element, the integral element, and the derivative element are weighted and summed to obtain the sampling delay correction amount output by the PID controller.

[0083] It is understood that the sampling delay correction amount is a time increment with positive and negative signs; a positive value indicates that the actual sampling trigger time should be postponed, and a negative value indicates that the actual sampling trigger time should be brought forward. Furthermore, based on the sampling delay correction amount, the current sampling delay is updated in real time, and the current sampling delay plus the sampling delay correction amount yields the target sampling delay for the next cycle. The target sampling delay control sampling trigger module delays the sampling action by the duration of the target sampling delay after each switch event is triggered.

[0084] In one embodiment, the closed-loop determination is performed according to the following rules: if the actual sampling trigger time is located between the start and end boundaries of the safe sampling window, then the current sampling action is already in the stable region within the main ripple sampling area, the target sampling delay value remains unchanged, and the feedback quantity enters a tracking steady state. If the actual sampling trigger time deviates from the range of the safe sampling window, the PID controller continues to calculate and superimpose the sampling delay correction amount, the target sampling delay is updated cycle by cycle, and the actual sampling trigger time approaches the main ripple time node along the time axis until the actual sampling trigger time converges to the voltage stable region corresponding to the main ripple time node.

[0085] For example, in situations where ringing patterns change due to switching frequency variations, load switching, or parasitic parameter drift, the boundary time node and the main ripple time node are recalibrated according to the current operating condition. The start and end boundaries of the safety sampling window are refreshed accordingly. The PID controller continuously adjusts the sampling delay based on the updated target reference, ensuring that the sampling action always follows the position change of the main ripple moment under different operating conditions. Another implementation method involves using the boundary time node as a reference and combining it with the main ripple time node to derive the start boundary of the safety sampling window and output it to the PID controller. The PID controller adjusts the sampling delay based on the main ripple moment as the target reference, locking the sampling action within the voltage stability region represented by the main ripple value. This includes: based on the boundary time node, performing a reverse offset along the time axis in the direction of the main ripple time node. The reverse offset is a preset ratio of the time length between the boundary time node and the main ripple time node. The time point obtained by subtracting the reverse offset from the boundary time node is taken as the start boundary of the safety sampling window, and the end boundary of the safety sampling window is aligned with the boundary time node. The main ripple time node is output as the target reference time Tref to the input of the PID controller. The actual sampling trigger time Tact of the current cycle is input as feedback to the PID controller. The actual sampling trigger time Tact is obtained by adding the current sampling delay Dcur to the switching event trigger time. The PID controller calculates the time deviation ΔT = Tref - Tact between the target reference time Tref and the actual sampling trigger time Tact, where the proportional element multiplies ΔT by the proportional coefficient Kp, the integral element multiplies the cumulative value of ΔT by the integral coefficient Ki, and the derivative element multiplies the rate of change of ΔT by the derivative coefficient Kd. The sum of these three values ​​gives the sampling delay correction ΔD. The current sampling delay Dcur is updated to obtain the target sampling delay Dnext = Dcur + ΔD for the next cycle. The target sampling delay Dnext is limited to the range of 0.5 microseconds to 20 microseconds. The sampling control circuit delays the target sampling delay Dnext before starting ADC sampling after each switching event trigger. If the absolute value of the deviation between the actual sampling trigger time Tact and the main ripple time node Tref is less than 10% of the safe sampling window width, the sampling delay correction amount ΔD of the current cycle is limited to 50% of the correction amount of the previous cycle to reduce adjustment fluctuations. If the absolute value of the deviation is greater than the safe sampling window width, the normal correction amount is maintained until the actual sampling trigger time Tact converges to the safe sampling window range.

[0086] This invention provides an automatic optimization and adjustment system for PID parameters, mainly comprising: The voltage sampling and envelope extraction module is used to acquire the continuous voltage sampling sequence of the power switch node, and to perform local maxima and minima detection on the continuous voltage sampling sequence using a sliding time window to obtain the voltage envelope sequence. The secondary rebound interval identification module is used to segment and identify the non-monotonic rise segment during the ringing attenuation process according to the voltage envelope sequence, and determine the secondary rebound interval of the voltage envelope sequence. The rebound peak extraction module is used to identify the local rise peak generated when parasitic LC resonance releases energy within the secondary rebound range based on the voltage rise edge pattern, extract the voltage amplitude of the local rise peak as the rebound peak, and record the trigger time of the rebound peak. The voltage decay gradient calculation module is used to perform point-by-point first-order difference operations on the subsequence corresponding to the ringing decay segment between the start of the voltage envelope sequence and the start time node of the secondary rebound interval to obtain the voltage decay gradient distribution sequence. The main ripple localization and extraction module is used to locate the zero-crossing point that changes from negative to positive in the voltage decay gradient distribution sequence, map the zero-crossing point to the time value in the coordinate system with the time of the switch event triggering as the time zero point, and extract the envelope voltage amplitude corresponding to the time of the main ripple time node as the main ripple value. The boundary time node division module is used to divide the boundary time nodes between the main ripple sampling area and the secondary rebound area based on the amplitude difference between the rebound peak and the main ripple value, as well as the time difference between the trigger time of the rebound peak and the main ripple time node. The safe sampling window output module is used to derive the starting boundary of the safe sampling window based on the boundary time node and the main ripple time node, and output it to the PID controller. The PID controller uses the main ripple time as the target reference and adjusts the sampling delay to lock the sampling action within the voltage stability region represented by the main ripple value.

[0087] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A method for automatic optimization and adjustment of PID parameters, characterized in that, The method includes: A continuous voltage sampling sequence of the power switch node is obtained, and a sliding time window is used to detect local maxima and minima of the continuous voltage sampling sequence to obtain a voltage envelope sequence. Based on the voltage envelope sequence, the non-monotonic recovery segment during the ringing attenuation process is segmented and identified to determine the secondary rebound interval; Within the secondary rebound interval, the local rise peak is identified based on the voltage rise edge pattern, the voltage amplitude of the local rise peak is extracted as the rebound peak value, and the trigger time is recorded. A point-by-point first-order difference operation is performed on the ringing attenuation segment subsequence between the start of the voltage envelope sequence and the start time node of the secondary rebound interval to obtain the voltage attenuation gradient distribution sequence. In the voltage decay gradient distribution sequence, locate the zero-crossing point where the negative value turns into a positive value. Take the time value of the zero-crossing point as the zero point with the trigger time of the switching event as the zero point, and extract the envelope amplitude corresponding to the main ripple time node as the main ripple value. Based on the amplitude difference between the rebound peak and the main ripple value, and the time difference between the trigger time of the rebound peak and the time node of the main ripple, the boundary time nodes of the main ripple sampling area and the secondary rebound area are defined. Based on the boundary time node and combined with the main ripple time node, the starting boundary of the safe sampling window is derived forward and output to the PID controller. The PID controller adjusts the sampling delay to lock the sampling action within the voltage stability region represented by the main ripple value.

2. The method for automatic optimization and adjustment of PID parameters according to claim 1, characterized in that, The step of using a sliding time window to detect local maxima and minima of the continuous voltage sampling sequence to obtain a voltage envelope sequence includes: setting a high-impedance detection access point at the drain pin of the power switch transistor; continuously recording the transient voltage of the node at a sampling rate higher than a preset multiple of the switching frequency to obtain a timestamped node voltage sampling sequence; configuring a sliding window with a window length shorter than half a period of parasitic ringing for the node voltage sampling sequence; extracting the maximum and minimum values ​​within the window point by point to obtain a set of maxima and a set of minima; merging the set of maxima and the set of minima in ascending order of timestamps and using linear interpolation to form an upper envelope segment and a lower envelope segment; and calculating the amplitude difference point by point to obtain the voltage envelope sequence.

3. The method for automatic optimization and adjustment of PID parameters according to claim 1, characterized in that, The step of segmenting and identifying the non-monotonic rise segment during the ringing attenuation process based on the voltage envelope sequence to determine the secondary rebound interval includes: obtaining a decay slope sequence by calculating the forward difference of the voltage envelope sequence according to the sampling time sequence; sliding point by point along the decay slope sequence from the moment the switching event is triggered, marking the position where the slope sign of consecutive backward points flips from negative to positive as candidate trend reversal points; verifying the time offset of the candidate trend reversal points based on the resonance period of the parasitic loop, if the time interval between the candidate point and the moment the switching event is less than one half-resonance period, it is determined to be a local jitter and is eliminated, and if it is within a preset range of multiples of the resonance period, it is retained as the starting point of the rise; segmenting the voltage envelope sequence at the starting point of the rise, and extending the continuous rising segment after the starting point of the rise until the envelope amplitude falls back to a preset proportion of the starting amplitude of the rise segment, thus obtaining the secondary rebound interval.

4. The method for automatic optimization and adjustment of PID parameters according to claim 1, characterized in that, The step of identifying local rise peaks based on voltage rise edge morphology within the secondary rebound interval, extracting the voltage amplitude of the local rise peak as the rebound peak value, and recording the trigger time includes: calculating the amplitude difference between adjacent voltage envelope segments within the secondary rebound interval; marking the flip position as a local inflection point when the sign of the adjacent amplitude difference flips from positive to negative; taking the inflection point with the largest envelope amplitude among the local inflection points as the local rise peak, and recording the timestamp corresponding to the local rise peak as the trigger time of the rebound peak value.

5. The method for automatic optimization and adjustment of PID parameters according to claim 1, characterized in that, The step of performing a point-by-point first-order difference operation on the ringing attenuation segment sequence between the start of the voltage envelope sequence and the start time node of the secondary rebound interval to obtain the voltage attenuation gradient distribution sequence includes: calculating the first-order difference value of the amplitude of the next point minus the amplitude of the previous point along the time axis of the ringing attenuation segment sequence, and arranging all the first-order difference values ​​in order along the time axis to obtain the voltage attenuation gradient distribution sequence.

6. The method for automatic optimization and adjustment of PID parameters according to claim 1, characterized in that, The step of extracting the envelope amplitude corresponding to the main ripple time node as the main ripple value includes: retrieving sampling points in the voltage envelope sequence that match the timestamp of the main ripple time node and performing linear interpolation to obtain the main ripple value.

7. The method for automatic optimization and adjustment of PID parameters according to claim 1, characterized in that, The step of dividing the boundary time nodes between the main ripple sampling area and the secondary rebound area based on the amplitude difference between the rebound peak value and the main ripple value, and the time difference between the trigger time of the rebound peak value and the main ripple time node, includes: the amplitude difference being the difference obtained by subtracting the main ripple value from the rebound peak value; the time difference being the difference obtained by subtracting the main ripple time node from the trigger time of the rebound peak value; defining a transition interval between the main ripple time node and the trigger time of the rebound peak value; and selecting a boundary time node within the transition interval based on the amplitude difference and the time difference.

8. The method for automatic optimization and adjustment of PID parameters according to claim 1, characterized in that, The step of deriving the starting boundary of the safe sampling window by taking the boundary time node as a reference and combining it with the main ripple time node includes: deriving the starting boundary of the safe sampling window by offsetting backward along the time axis from the boundary time node to the main ripple time node. The offset is taken as a preset ratio of the time length between the boundary time node and the main ripple time node. The time position obtained by subtracting the offset from the boundary time node is used as the starting boundary of the safe sampling window.

9. The method for automatic optimization and adjustment of PID parameters according to claim 1, characterized in that, The PID controller adjusts the sampling delay to lock the sampling action within the voltage stability region represented by the main ripple value. This includes: the starting boundary of the safe sampling window and the main ripple time node are output to the input of the PID controller; the PID controller uses the main ripple time node as the target reference and the actual sampling trigger time corresponding to the current sampling delay as the feedback quantity; the proportional, integral, and derivative components of the PID controller respectively process the instantaneous deviation, cumulative deviation, and deviation change rate to obtain the sampling delay correction quantity; the current sampling delay is superimposed and updated to obtain the target sampling delay for the next cycle; if the actual sampling trigger time deviates from the safe sampling window range, the correction is continued until it converges to the voltage stability region.

10. A PID parameter automatic optimization and adjustment system, characterized in that, The system includes: The voltage sampling and envelope extraction module is used to obtain the continuous voltage sampling sequence of the power switch node and to obtain the voltage envelope sequence by detecting local maxima and minima using a sliding time window. The secondary rebound interval identification module is used to segment and identify the non-monotonic rise segment in the voltage envelope sequence to determine the secondary rebound interval; The rebound peak extraction module is used to identify the local rise peak when parasitic LC resonance releases energy based on the voltage rise edge shape and extract the voltage amplitude as the rebound peak. The voltage decay gradient calculation module is used to perform a first-order difference on the ringing decay segment subsequence between the start of the voltage envelope sequence and the start time node of the secondary rebound interval to obtain the voltage decay gradient distribution sequence. The main ripple localization and extraction module is used to locate the zero-crossing point in the voltage decay gradient distribution sequence, take the time value as the main ripple time node, and extract the corresponding envelope amplitude as the main ripple value. The boundary time node division module is used to divide the boundary time nodes based on the amplitude difference between the rebound peak value and the main ripple value and the time difference between the trigger time of the rebound peak value and the main ripple time node. The safe sampling window output module is used to derive the starting boundary of the safe sampling window by combining the boundary time node with the main ripple time node, and output it to the PID regulator to adjust the sampling delay so that the sampling is locked in the voltage stable region.

Citation Information

Patent Citations

  • PID parameter adaptive adjustment method and system, electronic equipment and readable medium

    CN121878571A

  • Voltage transient suppression in a switched mode power supply

    US20220302838A1