Online setting method and device for water turbine governor and medium
Patent Information
- Application Number
- CN202611145924.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-30
- Publication Date
- 2026-10-13
AI Technical Summary
在确定映射模型训练标签时,各频段阻尼状态需要共同参与候选PID参数评价,多个频段的阻尼评价合并为综合指标后,不同频段的阻尼贡献可能相互补偿,由于使综合评价满足条件时,个别频段可能仍处于阻尼不足状态,此类参数进入训练标签,会使映射模型难以体现最不利频段的稳定边界,从而导致其在工况变化时,输出的PID参数存在各频段稳定裕度不一致的问题
相对于仅依据综合阻尼评价选择训练标签的方式,本申请以各频段阻尼裕度中的最小值表征候选PID参数的分频阻尼裕度,然后删除分频阻尼裕度小于零的候选PID参数,并以剩余候选PID参数形成多频段稳定域交集,再从该交集中确定目标PID参数作为训练标签。由于任一频段的阻尼不足均会反映在最小裕度中,可避免任一频段的阻尼不足被其他频段的充裕裕度所掩盖,从而减少局部频段不满足阻尼要求的候选参数进入训练数据,有利于保持训练标签在各关键振荡频段上的稳定边界一致性。
Smart Images

Figure CN122899635A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of governor adjustment technology, specifically to a method, device, and medium for online adjustment of a turbine governor. Background Technology
[0002] The turbine governor adjusts the guide vane opening based on the unit's speed or frequency deviation to maintain the turbine-generator unit's operating status under varying load and head conditions. The turbine regulation system includes dynamic components such as the water intake system, turbine, generator, and load. Water hammer oscillation and electromechanical oscillation are distributed across different frequency ranges. To adapt to multi-condition operation, a mapping relationship between operating parameters and PID parameters can be established based on simulation or historical responses. When determining the training labels for the mapping model, the damping state of each frequency band needs to participate in the evaluation of candidate PID parameters. After the damping evaluations of multiple frequency bands are combined into a comprehensive index, the damping contributions of different frequency bands may compensate for each other. Since some frequency bands may still be in an insufficient damping state when the comprehensive evaluation meets the conditions, such parameters entering the training labels will make it difficult for the mapping model to reflect the stability boundary of the most unfavorable frequency band, resulting in inconsistent stability margins of the output PID parameters in different frequency bands when the operating conditions change. Summary of the Invention
[0003] The purpose of this invention is to provide a method, apparatus and medium for online adjustment of a water turbine governor.
[0004] To achieve the above objectives, the present invention provides the following technical solution: a method, apparatus, and medium for online adjustment of a turbine governor, the method comprising: The operating parameters of the turbine regulating system, the candidate PID parameters of each group, and the damping margin of each frequency band are obtained. The damping margin of each frequency band is the difference between the equivalent damping ratio of the candidate PID parameter in each frequency band and the preset damping lower limit of the corresponding frequency band. The minimum value among the damping margins of each frequency band is determined as the frequency division damping margin of each group of candidate PID parameters. Candidate PID parameters with a frequency division damping margin less than zero are deleted. The remaining candidate PID parameters form the intersection of the multi-frequency band stability domains. The target PID parameters are determined from the intersection of the multi-frequency band stability domains based on the frequency division damping margins and used as training labels for the corresponding operating conditions. The mapping model is trained using the operating condition parameters and training labels. The mapping model outputs the PID parameters corresponding to the current operating condition.
[0005] As one possible design, damping margins for each frequency band are obtained, including: The turbine regulation response corresponding to each set of candidate PID parameters is decomposed into frequency bands to obtain the first frequency band response and the second frequency band response. The first frequency band responds to the oscillations caused by the water hammer effect of the water diversion system, and the second frequency band responds to the oscillations caused by the load coupling between the turbine and the generator. Continuous attenuation peaks are extracted from the first frequency band response and the second frequency band response respectively. The equivalent damping ratio of the corresponding frequency band is determined according to the amplitude relationship of adjacent attenuation peaks. The degree of deviation of the equivalent damping ratio from the lower limit of damping of the frequency band is determined as the damping margin of the frequency band.
[0006] As one possible design, the target PID parameters are determined, including: The remaining candidate PID parameters are sorted from largest to smallest according to the frequency division damping margin, and the maximum frequency division damping margin is determined. Candidate PID parameters whose difference from the maximum frequency division damping margin does not exceed a preset range are used to form a safe candidate set. Determine the time-domain regulation index of each candidate PID parameter in the safety candidate set, and select the candidate PID parameter with the smaller time-domain regulation index from the safety candidate set as the target PID parameter.
[0007] As one possible design, when the intersection of the multi-band stability domains is empty, the constraint frequency band is determined based on the frequency band with the minimum damping margin and a damping margin less than zero among the candidate PID parameters in each group. Based on the direction of the damping margin of the constraint frequency band changing with the proportional, integral, and derivative parameters, supplementary candidate PID parameters are generated in the neighborhood of the deleted candidate PID parameters. The damping margin of each frequency band of the supplementary candidate PID parameters is re-determined, and training labels for the corresponding operating conditions are generated after a non-empty intersection of the multi-band stability domains is formed.
[0008] As one possible design, generating supplementary candidate PID parameters includes: performing tiered sampling within preset value ranges for proportional, integral, and derivative parameters; establishing a numerical stability domain for the candidate PID parameters based on the sampling results; using the direction of increasing damping margin corresponding to the constraint frequency band as the parameter adjustment direction, reducing the sampling interval within the boundary neighborhood of the numerical stability domain until supplementary candidate PID parameters with a frequency division damping margin not less than zero are obtained or a preset number of supplementary iterations is reached. The preset number of supplementary iterations is determined based on the PID parameter value range, the initial sampling step size, and the number of boundary samples; one possible preset number of supplementary iterations is 20 rounds.
[0009] As one possible design, the operating parameters include the flow inertia time constant, load disturbance amplitude, operating head, and initial values of guide vane opening.
[0010] As one possible design, the acquisition of each group of candidate PID parameters includes: performing Latin hypercube sampling within the preset range of PID parameters, obtaining the response state corresponding to each sampled PID parameter through a simulation model, deleting sampled PID parameters that cause response divergence or exceed the preset operating boundary, forming a numerical stability region, and iteratively generating candidate PID parameters within the numerical stability region using the mayfly optimization algorithm.
[0011] As one possible design, a mapping model is trained using operating parameters and training labels, including: The operating parameters are normalized, with the initial values of the flow inertia time constant, load disturbance amplitude, working head, and guide vane opening as inputs; The proportional, integral, and derivative parameters from the target PID parameters are used as outputs to train a fully connected neural network with at least two hidden layers, and the network parameters are adjusted based on the error between the training labels and the network output.
[0012] As one possible design, after the mapping model outputs the PID parameters corresponding to the current operating condition, the actual response of the turbine regulating system is collected and the actual damping margin of each frequency band is determined. When the deviation between the actual damping margin of each frequency band and the damping margin of each frequency band corresponding to the training label exceeds the limit, incremental samples are formed using the current operating condition and the actual response to update the candidate mapping model. The current operating condition and its neighboring operating conditions are input into the candidate mapping model, and multi-frequency stability domain intersection verification is performed on the PID parameters output by the candidate mapping model. If the verification passes, the candidate mapping model replaces the original mapping model; if the verification fails, the original mapping model is retained.
[0013] As one possible design, after generating candidate PID parameters, the process also includes: guiding the updating of candidate PID parameters for mayfly individuals with small frequency division damping margins, based on the mayfly individuals with large frequency division damping margins.
[0014] The technical effects and advantages provided by the present invention in the above technical solution are as follows: Compared to selecting training labels solely based on comprehensive damping evaluation, this application characterizes the frequency-specific damping margin of candidate PID parameters by using the minimum value among the damping margins of each frequency band. Then, candidate PID parameters with a frequency-specific damping margin less than zero are removed, and the remaining candidate PID parameters form the intersection of multi-frequency band stability domains. The target PID parameter is then determined from this intersection as the training label. Since any damping deficiency in any frequency band is reflected in the minimum margin, it avoids the damping deficiency in any frequency band being masked by the ample margins of other frequency bands. This reduces the number of candidate parameters that do not meet the damping requirements in local frequency bands entering the training data, which helps maintain the consistency of the stability boundaries of the training labels across key oscillation frequency bands. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.
[0016] Figure 1 This is a flowchart of the online tuning method of the present invention.
[0017] Figure 2 This is a schematic diagram of the simulation model of the turbine regulating system of the present invention.
[0018] Figure 3 This is a flowchart of the multi-band damping hard constraint screening process of the present invention.
[0019] Figure 4 This is a schematic diagram illustrating the determination of the target PID parameters in this invention.
[0020] Figure 5 This is a schematic diagram of the deep neural network mapping model structure of the present invention.
[0021] Figure 6 This is a schematic diagram illustrating the comparison of training labels in this invention.
[0022] Figure 7 This is a flowchart of the adaptive update process for the mapping model of this invention. Detailed Implementation
[0023] To clarify the technical solution, implementation conditions, and relationships between the various processing steps in this application, the online tuning method, apparatus, and medium for a turbine governor are described below with reference to three embodiments. The parameter ranges and equipment configurations described below are used to illustrate feasible technical paths and are not intended to limit the scope of protection of this application.
[0024] This application provides an online tuning device for a turbine governor that integrates multi-band damping ratio hard constraints, including a memory, a processor, and a program stored in the memory. When the processor executes the program, it implements the tuning method.
[0025] This application provides a storage medium on which a program is stored, and when the program is executed, it implements a tuning method.
[0026] The turbine regulating system in this application includes a water intake system, a turbine, a generator and load, a governor, and a guide vane actuator. The PID parameters include proportional, integral, and derivative parameters, denoted as K. p K i and K d The operating parameters should include at least the water flow inertia time constant T. wThe parameters include the load disturbance amplitude ΔP, the operating head H, and the initial guide vane opening Y0. The dimensions, sampling period, and baseline values of each parameter remain consistent throughout the offline modeling, training label generation, and online inference phases.
[0027] The preset thresholds, ranges, weights, or frequency mentioned in this application are all determined before the calculation of candidate parameters, model training, or online verification for the corresponding batch begins, and are saved together with the unit identifier, model version, and data time. The determination order is as follows: values already specified in the unit design documents, speed control system test procedures, or grid-connected operation requirements are preferred; when no fixed values are given, they are determined based on the same unit's disturbance-free data, historical valid disturbance data, or simulation data verified by engineering, and remain unchanged within the same batch. When preset parameters need to be adjusted between different units, the disturbance-free noise level of that unit and at least one set of known stable PID parameters are used first to complete the benchmark verification, avoiding the direct use of thresholds from other units.
[0028] Example 1 This embodiment illustrates the process of determining multi-band damping margin, screening candidate PID parameters, selecting target PID parameters, training the mapping model, and online output. This process is executed collaboratively by a training server and an online tuning device. The training server is used for closed-loop simulation, candidate parameter generation, and mapping model training; the online tuning device is used to read the current operating conditions, call the mapping model, and write the validated PID parameters into the turbine governor. These two types of devices can be configured independently or processed by the same computing device at different stages of operation.
[0029] like Figure 1 As shown, the online tuning method of the present invention includes an offline training stage and an online tuning and update stage: the offline training stage completes closed-loop simulation, candidate PID parameter screening, target PID training label generation, and mapping model training; the online stage outputs and verifies the PID parameters according to the current operating conditions, and performs incremental updates or model rollback based on the actual damping margin deviation.
[0030] The training server first establishes a closed-loop simulation model of the turbine regulating system. The water intake system model receives the flow deviation and outputs the head deviation; the turbine model determines the flow rate and mechanical power based on the head and guide vane opening; the generator and load model determines the speed deviation based on the mechanical power, electromagnetic power, and load disturbance; the governor generates guide vane control input based on the speed deviation; and the guide vane actuator changes the guide vane opening based on the guide vane control input. When using per-unit values for modeling, the turbine flow rate and mechanical power can be calculated using the following formula: q=y√h, P m =h·q In the formula, q is the per-unit flow rate, y is the per-unit guide vane opening, h is the per-unit working head, and P... mThis represents the per-unit value of mechanical power. The rotor motion relationship between the generator and the load can be expressed as: T a ·dΔω / dt=P m -P e In the formula, T a Let P be the inertial time constant of the generator and load, Δω be the speed deviation, and P be the inertial time constant of the generator and load. e P represents electromagnetic power. e The load disturbance ΔP and the unit damping term D·Δω are taken into account. The water diversion system model must include at least the water flow inertia time constant T. w The steady-state operating point of the turbine model is determined by the operating head H and the initial value of the guide vane opening Y0. The above model relationship makes K... p K i and K d Changes in these parameters can be reflected in the oscillation amplitude, decay rate, overshoot, and settling time of the speed or frequency response.
[0031] like Figure 2 As shown, the closed-loop simulation model of the turbine regulation system includes a PID controller, a guide vane actuator, a water intake system, a turbine, a generator, and a load. The frequency deviation of the generator and load output is fed back to the input of the PID controller, and the load disturbance ΔP acts on the generator and load components.
[0032] As a model configuration, the rated head is 197m, the rated guide vane opening is 1.0 per unit, and T a The time constant is 8s, and the guide vane servo system uses a first-order system with a time constant of 0.1s. w It can be determined by the design parameters of the water diversion system, or it can be identified using flow rate, guide vane opening, and head response. ΔP is the per-unit value of the difference between the target active power after the disturbance and the steady-state active power before the disturbance, relative to the rated active power; H is determined by the upstream water level, downstream water level, and hydraulic loss; Y0 is the steady-state opening of the guide vane servo before the disturbance occurs.
[0033] When converting the working head H to the per-unit head value h in the turbine model, the formula is h = H / H. N Conversion, H N The rated head; the load disturbance amplitude ΔP is determined by the following formula: ΔP=(P tar -P0) / P N In the formula, P tar P0 is the target active power after the disturbance, and P0 is the steady-state active power before the disturbance. N This is the rated active power. When the disturbance amplitude is determined using dispatch instructions, P tarTake the target value of the dispatch after the disturbance; when the disturbance amplitude is determined by the measured active power, P tar The steady-state active power within the effective observation window after perturbation is taken. The same P is used in the offline training, closed-loop verification, and online monitoring phases. N And the agreement on positive and negative directions.
[0034] To create training scenarios that cover different operating conditions, in T w Combined sampling is performed within the range of values for ΔP, H, and Y0. For example, T w Eight values were taken within 0.6s to 2.0s, eight values were taken for ΔP within 0.03 per unit to 0.20 per unit, five values were taken for H within 160m to 225m, and five values were taken for Y0 within 10% to 90%, resulting in a total of 1600 operating points. These operating points can be combined at equal intervals, or the number of samples near commonly used operating points can be increased based on the density of historical operating data.
[0035] For each operating point, at K p K i and K d Latin hypercube sampling is performed within a preset value range. One possible value range is: K p K ranges from 0.1 to 10. i K ranges from 0.01 to 2. d The range is 0 to 2. Latin hypercube sampling divides each parameter range into an equal number of non-overlapping intervals and extracts parameter values from each interval, resulting in a relatively uniform distribution of the initial candidate parameters in the 3D parameter space. Each set of sampling results is written into the closed-loop simulation model to obtain the corresponding turbine regulation response.
[0036] When establishing the numerical stability region, first delete obviously unusable sampled PID parameters. Judgment criteria include: the envelope of speed or frequency deviation continuously increases within the set observation window; the guide vane opening exceeds the governor's allowable range; the speed deviation exceeds the unit's operating limits; simulation calculations produce non-numerical results; and the parameter cannot enter the preset steady-state error band at the end of the observation window. The length of the observation window should not be shorter than two oscillation cycles corresponding to the lowest frequency to be analyzed. For example, when the lowest analysis frequency is 0.01Hz, the observation window can be longer than 200s to obtain sufficient attenuation peaks. After deleting the above parameters, the remaining sampled PID parameters constitute the numerical stability region.
[0037] In this embodiment, the numerical stability region D is represented by discrete feasible nodes and their local feasible neighborhoods. First, K... p K i and K dNormalized to 0 to 1 within their respective allowable ranges, sampling points that pass the running boundary check are considered feasible nodes; for each feasible node, the local radius r is half the normalized Euclidean distance from that node to the nearest sample that did not pass the running boundary check. D , and r D r is not greater than the distance from the node to the nearest neighboring feasible node; when there are no neighboring samples that failed the running boundary check, r D Take half the distance from the node to its nearest neighbor feasible node. The union of the local neighborhoods of each feasible node constitutes the searchable numerically stable region.
[0038] If the parameter to be updated is within the above union, its position is preserved; if it is outside the union, Proj D Project the data to the boundary point of the nearest local neighborhood using the normalized Euclidean distance. When multiple projection points are equidistant, select the projection point corresponding to the feasible node with the larger frequency division damping margin. The projection results still need to be re-executed for complete closed-loop boundary verification; if they fail, restore the data to the position of the individual's most recent successful verification, and do not directly replace stability verification with geometric projection results.
[0039] Within the numerical stability region, the mayfly optimization algorithm can be used to further generate candidate PID parameters. The position vector of each mayfly individual is determined by K. p K i and K d Composition. In each iteration, the PID parameters corresponding to each individual are written into the closed-loop simulation model to obtain the speed deviation sequence or frequency deviation sequence, and the operating condition identifier, PID parameters, response sequence, operating boundary verification results and time-domain adjustment index are saved for subsequent frequency band damping calculation and training label selection.
[0040] like Figure 3 As shown, in the process of numerical stability domain estimation and multi-band damping hard constraint screening, the running boundary verification is first performed on the Latin hypercube sampling results, and then candidate PID parameters are generated in the numerical stability domain. Only candidate parameters with damping margins of all frequency bands not less than 0 are retained in the intersection of the multi-band stability domain.
[0041] When determining the damping margin for each frequency band, the turbine regulation response corresponding to each set of candidate PID parameters is first decomposed into frequency bands. This embodiment sets up a first frequency band and a second frequency band. The first frequency band characterizes the oscillations caused by the water hammer effect in the water intake system, and the second frequency band characterizes the electromechanical oscillations caused by the coupling of the turbine, generator, and load. The first frequency band can be set to 0.01Hz to 0.1Hz, and the second frequency band can be set to 0.1Hz to 2Hz. The frequency band boundaries can be adjusted based on the unit modal identification results, but the damping ratio and damping margin are calculated separately for each frequency band.
[0042] To ensure that frequency band division under different unit conditions can be repeatedly performed, the frequency band boundaries can be determined as follows: Calculate the power spectral density of the speed deviation sequence or frequency deviation sequence under the same operating condition, and extract spectral peaks exceeding the sum of the mean of the undisturbed noise spectrum and a preset multiple as candidate mode frequencies; then, use the matrix beam method or Prony method to verify the candidate mode frequencies, retaining the mode center frequencies whose fitting residuals do not exceed a preset fitting threshold. Sort the retained mode center frequencies in ascending order, and take the geometric mean of the frequency band boundary frequencies between two adjacent mode center frequencies; sampling frequencies located at the boundary frequencies are uniformly assigned to the higher frequency band, and a filter transition band no larger than 10% of the interval between adjacent mode frequencies is set on both sides of the boundary frequency. When only one mode center frequency is identified, the upper and lower limits of the corresponding frequency band are determined based on the half-power bandwidth of that mode; when the identification result does not meet the fitting threshold, the fixed frequency band boundary confirmed by unit testing is used, and this boundary remains consistent during offline training, online verification, and incremental update stages.
[0043] When determining the frequency band boundaries of the same batch of training data, first select a set of benchmark PID parameters that have been engineering-verified and whose closed-loop response does not diverge, and then cover T... w The same type of standard perturbation was applied under representative operating conditions with values of ΔP, H, and Y0, and the baseline response was obtained. The modal center frequencies identified for each representative operating condition were clustered, and the median of the modal center frequencies within the same cluster was taken as the representative modal frequency of that batch. The frequency band boundary frequency was then determined according to the aforementioned geometric mean rule.
[0044] Once the frequency band boundary is determined, it remains fixed when evaluating all candidate PID parameters in that batch, performing online closed-loop verification, and generating incremental samples, and does not change due to variations in the response frequency corresponding to a single set of candidate PID parameters. If a representative operating condition does not identify an effective mode that meets the fitting threshold, the frequency band boundary is not updated using that operating condition, and the most recently confirmed frequency band version from unit testing is used instead.
[0045] As an executable method for determining the spectral peak threshold, a speed or frequency sequence of at least 60 seconds is obtained during a period when the unit is in steady state and no disturbance is applied. The undisturbed power spectrum is then calculated using the same sampling frequency as the response to be analyzed. The mean of the undisturbed power spectrum within the frequency range to be analyzed is assumed to be μ. N The standard deviation is σ N The candidate spectral peak threshold can then be set to μ. N +λσ N λ is taken as 3 to 6; λ is fixed when the relative change in the field noise level does not exceed 10% over three consecutive reference windows. The fitting residual of the matrix bundle method or Prony method is represented by the ratio of the reconstruction mean square error to the mean square value of the original frequency band signal, and the preset fitting threshold can be taken as 5% to 10%. After determining the frequency band boundary using the same batch of training data, μ is... N σN The parameters λ, fitting threshold, and final frequency band boundary are stored together, and online verification and incremental updates directly call the same version of parameters.
[0046] Frequency band decomposition can employ zero-phase bandpass filtering. First, the response sequence is acquired at a sampling frequency no less than 10 times the highest analysis frequency. Then, it is processed using bandpass filters corresponding to the first and second frequency bands, respectively. Zero-phase processing reduces the impact of filter phase delay on peak times. For responses with significant non-stationary components, empirical mode decomposition can be performed first, and then the responses can be assigned to their corresponding frequency bands based on the center frequencies of each intrinsic mode component. Regardless of the decomposition method used, frequency band boundaries, filter parameters, and sampling periods are preserved so that the actual response can be processed according to the same rules during the online phase.
[0047] As a specific filter configuration, each frequency band employs a 4th to 8th order Butterworth bandpass filter. The upper and lower limits of the passband are taken from the boundaries of that frequency band, and the stopband boundary is set outside the filter transition band. When the sampling frequency is 20Hz and the highest analysis frequency is 2Hz, a 6th order Butterworth filter can be used, and zero-phase processing is achieved by performing filtering once in both the forward and reverse directions. Before filtering, the mean and linear trend of the window before disturbance are removed. After filtering, the transition data at both ends with a length not less than three times the filter order are discarded. If the effective observation window is less than two cycles of the lowest frequency band due to discarding transition data, the original sampling window is extended and reprocessed, instead of using the insufficient frequency band response to calculate the damping ratio.
[0048] For each frequency band response, consecutive attenuated peak values in the same direction are extracted after the disturbance initiation time. A minimum inter-peak time interval and a minimum significant amplitude are set during peak extraction; the minimum inter-peak time interval is determined based on the highest frequency of the band, and the minimum significant amplitude is determined based on the noise amplitude of the undisturbed data. If the amplitudes of adjacent peaks do not show an attenuating trend, the corresponding peak pair is marked as a non-attenuated peak pair. For the r-th peak pair in the b-th frequency band, the local damping ratio is calculated using a logarithmic attenuation relationship: Peak extraction parameters can be automatically determined based on the sampling frequency and band noise. Let the sampling frequency be f. s The highest frequency of the b-th frequency band is f. b,max Then the minimum sample interval between peaks in the same direction is not less than f. s / f b,max Let σ be the standard deviation of the undisturbed filter response in this frequency band. b The maximum absolute amplitude of the frequency band response after the disturbance is A. b,max Then the minimum significant amplitude of the peak value is taken as max(3σ). b 0.01A b,maxWhen fewer than three peak pairs are extracted, the observation window is extended sequentially by one cycle corresponding to the lowest frequency. If the window is still insufficient after being extended to the preset maximum window, modal parameter fitting is then performed. The maximum order of modal parameter fitting can be 6 to 12, but must not exceed one-tenth of the number of effective sampling points.
[0049] δ b,r =ln(|A b,r | / |A b,r+1 |) ξ b,r =δ b,r / √(4π 2 +δ b,r 2 ) In the formula, A b,r and A b,r+1 δ represents the amplitude of two adjacent peak values in the same direction within the b-th frequency band. b,r ξ represents the logarithmic decay rate corresponding to the peak pair. b,r Let π be the local damping ratio for the corresponding peak pair, and π be the mathematical constant pi. For non-attenuated peak pairs, δ b,r If not greater than 0, the obtained ξ b,r When there are more than 3 effective peak pairs in a frequency band, the median of the local damping ratios is taken as the equivalent damping ratio ξ of that frequency band. b When the number of peak pairs is insufficient, the candidate PID parameter is not directly used as the training label. Instead, the observation window is extended or the fitting result of the modal parameter of the frequency band is used for verification.
[0050] When performing a verification using modal parameter fitting, the discrete response x for the b-th frequency band is... b [n] Establish x within the effective observation window after the disturbance begins. b [n]=Σ l=1 L c l ·z l n The exponential decay model, where L is the fitting order and c l Z represents the modal amplitude coefficient. l For discrete poles, L increases progressively from 1 to a preset maximum order, with the order corresponding to the minimum Bayesian information criterion and a reconstruction mean square error not exceeding 5% of the mean square value of the signal in that frequency band being taken as the effective order. For pole z... l Press s l =ln(z l ) / T s Convert to continuous poles s l =σ l +jω l T s The sampling period is ξ; l =-σl / √(σ l ²+ω l ²) Determine the corresponding modal damping ratio. Select the effective mode with the largest reconstructed amplitude whose center frequency is located in the b-th frequency band, and use its damping ratio as the kernel damping ratio for that frequency band. When there are no stable poles, the reconstruction error exceeds the threshold, or the difference in damping ratios obtained from different fitting orders exceeds 0.05, mark the candidate PID parameter as having uncertain damping state and do not use it to generate training labels.
[0051] Each frequency band is configured with a preset damping lower limit. The preset damping lower limit can be determined by unit design requirements, speed control system test results, or operating procedures, and should remain fixed within the same batch of training data. The damping margin of the b-th frequency band is determined by the following formula: M b =ξ b -ξ b,min In the formula, M b Let ξ be the damping margin for the b-th frequency band. b Let ξ be the equivalent damping ratio of the b-th frequency band. b,min This is the preset lower limit of damping for this frequency band. M b A value not less than 0 indicates that the candidate PID parameters meet the damping hard constraint of the b-th frequency band; M b A value less than 0 indicates that the oscillation attenuation of the candidate PID parameter in the b-th frequency band is insufficient. Different ξ values can be used for different frequency bands. b,min As an example, ξ in band 1 and band 2 b,min All values are 0.30.
[0052] For a set of candidate PID parameters, the minimum value among the damping margins across all frequency bands is determined as the frequency-division damping margin of that set of parameters: M = min{M1, M2, ..., M} B} In the formula, M represents the frequency division damping margin, and B represents the total number of frequency bands. The frequency division damping margin reflects the most unfavorable margin of the candidate PID parameters in the hard constraints across all frequency bands. The training server establishes a frequency band stability domain D for each frequency band. b D b By satisfying M b Candidate PID parameters not less than 0 are used to construct the multi-band stability domain intersection D. ∩ For each D b The intersection of the frequency bands. Candidate PID parameters with a frequency band damping margin less than 0 that do not meet the lower damping limit in at least one frequency band are deleted; candidate PID parameters with a frequency band damping margin not less than 0 that are located in the stability domain of all frequency bands are retained.
[0053] For example, the preset lower damping limit for both frequency band 1 and frequency band 2 is 0.30. The equivalent damping ratios of candidate parameter A for the two frequency bands are 0.34 and 0.27, respectively, with damping margins of 0.04 and -0.03 for the two bands, and a frequency division damping margin of -0.03. Therefore, candidate parameter A is deleted. The equivalent damping ratios of candidate parameter B for the two frequency bands are 0.33 and 0.32, respectively, with a frequency division damping margin of 0.02. Therefore, candidate parameter B enters the intersection of the multi-band stability domain. This process does not allow the positive margin of frequency band 1 to compensate for the negative margin of frequency band 2.
[0054] When determining the target PID parameters in the intersection of multi-band stability domains, the remaining candidate PID parameters are first arranged in descending order of frequency division damping margin, and the maximum frequency division damping margin M is determined. max The frequency division damping margin is compared with M. max The difference does not exceed the preset margin range ε M The candidate PID parameters constitute a safety candidate set. ε M A fixed value can be used, or it can be set to M. max A certain proportion is set. As an example, ε M Take 0.02; when M max When the value is 0.06, candidate PID parameters with a frequency division damping margin of not less than 0.04 are included in the safe candidate set.
[0055] Then, the time-domain regulation index of each candidate PID parameter in the safety candidate set is calculated. The integral of time multiplied by the absolute error can be calculated using the following formula: J ITAE =∫0 T t·|e(t)|dt In the formula, J ITAE The time-domain regulation index is calculated as the integral of the absolute error multiplied by time, where e(t) represents the speed deviation or frequency deviation, t is the time after the disturbance, and T is the end time of the evaluation window. Overshoot, settling time, steady-state error, and guide vane movement variation can also be calculated. When using multiple indices, they are first normalized according to their value range in the current operating condition candidate set, and then a comprehensive time-domain regulation index is obtained based on preset weights. The weights remain consistent across the same batch of training data. The candidate PID parameter with the smallest comprehensive time-domain regulation index in the safe candidate set is determined as the target PID parameter.
[0056] The comprehensive time-domain adjustment index can be expressed as J=w1J ITAE,n +w2M p,n +w3T s,n +w4ΔY ,n J ITAE,n M p,n T s,n and ΔY ,nThese represent the normalized time multiplied by the integral of the absolute error, overshoot, settling time, and total change in guide vane movement, respectively. All values w1 through w4 are not less than 0 and their sum is 1. As one configuration, w1, w2, w3, and w4 are set to 0.40, 0.20, 0.25, and 0.15, respectively. The normalization upper and lower limits for each indicator are determined by the safe candidate set for the current operating condition. When an indicator has the same value across all safe candidate parameters, its normalization result is uniformly set to 0 and it is not included in the evaluation of differences between candidate parameters. The weights and normalization upper and lower limits are saved along with the training labels to verify the selection process of the target PID parameters.
[0057] The above two-layer selection process first uses the frequency division damping margin to limit the stability margin of the most unfavorable frequency band, and then uses the time-domain adjustment index to distinguish candidate PID parameters with similar safety margins. If the comprehensive time-domain adjustment index of the two groups of candidate PID parameters is the same, the parameter with the larger frequency division damping margin is selected first; if the frequency division damping margin is also the same, the parameter with a smaller distance from the target PID parameter of the adjacent operating condition is selected to reduce unnecessary jumps in the training label as the operating condition changes.
[0058] like Figure 4 As shown, the intersection D∩ of the stable domains of each frequency band is composed of candidate PID parameters that simultaneously satisfy the damping lower limit of all frequency bands; within the intersection, a safe candidate set is first formed based on the frequency division damping margin, and then the target PID parameters are determined based on the comprehensive time-domain adjustment index and used as training labels.
[0059] For each operating condition, the target PID parameters, along with their first-band damping margin, second-band damping margin, frequency-specific damping margin, and time-domain regulation index, are saved. The target PID parameters are then used as training labels for the corresponding operating condition. Before training the mapping model using the operating condition parameters and training labels, minimum-maximum normalization is performed on each operating condition parameter. z j =(u j -u j,min ) / (u j,max -u j,min ) In the formula, u j Let u be the j-th operating condition parameter. j,min and u j,max These are the minimum and maximum values of the parameter in the training data, respectively. j This is the normalized result. The normalized parameters are stored together with the mapping model, and the same parameters are used to process the current working condition during online inference. The training inputs are T... w , ΔP, H and Y0, the training output is K in sequence p K i and K d .
[0060] The mapping model employs a fully connected neural network. One network structure includes four input nodes, three hidden layers with 64, 64, and 32 nodes respectively, and three output nodes. The hidden layers use a linear rectified activation function, and the output layers use a linear output. The network weights and biases are updated using the mean squared error between the training labels and the network outputs. The training data is divided into a training set, a validation set, and a test set in a 7:1.5:1.5 ratio. The validation set is used to determine when to stop training, and the test set is used to check the parameter mapping error on conditions not involved in training.
[0061] like Figure 5 As shown, the mapping model takes Tw, ΔP, H and Y0 as inputs, and outputs Kp, Ki and Kd after being processed by three fully connected hidden layers.
[0062] As an executable training configuration, the network weights are initialized using He, the optimizer is Adam, and the initial learning rate is 1×10⁻⁶. -3 The learning rate is halved if the validation set loss does not decrease for 10 consecutive training epochs, with a minimum learning rate of 1×10. -5 Batch size is set to 32 or 64, and the maximum number of training epochs is 300. Training stops when the validation set loss does not decrease for 20 consecutive training epochs, and the network parameters that minimize the validation set loss are restored. The output layer obtains K... p K i and K d First, map back to the engineering range of the corresponding parameters respectively; if any output exceeds the allowable range of the speed controller, truncate it to the nearest allowable boundary and mark the operating condition as the boundary operating condition for the multi-band stability domain intersection verification to be performed, and do not directly assume that it meets the damping hard constraint because the parameter truncation is completed.
[0063] After model training is complete, a closed-loop verification is performed on the test conditions. The K output by the mapping model is then used for this verification. p K i and K d Write the closed-loop simulation model for the corresponding operating condition and recalculate the damping margin for each frequency band. The model version is marked as deployable only when the frequency-division damping margin of the output parameters of the test condition is not less than 0 and the PID parameters are within the allowable range of the speed controller. If a test condition fails, add training samples near that condition or adjust the network training parameters and retrain, instead of directly deploying the model that failed the review.
[0064] like Figure 6 As shown, the Kp, Ki, and Kd predicted by the mapping model are distributed along the ideal fitting line with the corresponding training labels, which is used to check the mapping error of the mapping model for parameters not involved in the training.
[0065] During online operation, the online tuning equipment reads the current operating head, initial guide vane opening value, and load change information, and obtains the current T based on the water diversion system design parameters or online identification results. w The current ΔP can be determined by the change in load command or by the difference in active power before and after the disturbance. The online tuning equipment uses the normalized parameters saved during the training phase to process the current operating condition and inputs the normalized results into the mapping model to obtain K corresponding to the current operating condition. p K i and K d .
[0066] The current T is obtained by online identification. w During the time period when the unit experiences changes in guide vane opening and the load change amplitude reaches a preset excitation threshold, a discrete first-order equivalent water diversion model is established using the guide vane opening increment Δy and the working head increment Δh as inputs, and the flow rate increment Δq as the output: Δq(k+1) = a·Δq(k) + b y ·Δy(k)+b h ·Δh(k). The recursive least squares method with a forgetting factor is used to estimate a and b. y and b h The forgetting factor is set to 0.95 to 0.995, and the recognition window is set to 30 to 120 seconds; (The text abruptly ends here, likely due to an incomplete sentence or a formatting error.) w =-T s / ln(a) is used to convert the equivalent water flow inertia time constant, where 0 <a<1,T s The sampling period is defined as follows. It is only used when the input excitation variance is not less than the preset excitation threshold, the model prediction mean square error does not exceed 10% of the mean square value of the flow increment, and the T values obtained from three consecutive windows are within the specified range. w Update the current T when the relative deviation does not exceed 10%. w If the update conditions are not met, the most recently validated T will be used. w Or the design value of the water diversion system.
[0067] Before writing parameters, first check if the current operating condition is within the training data coverage range and if the output PID parameters are within the speed controller's allowed range. If the current operating condition is within the training range and the output parameters pass the range check, write the new parameters within the speed controller's allowed parameter update window. To avoid sudden changes in control quantity caused by instantaneous parameter switching, linear interpolation can be performed on the original PID parameters and the new PID parameters within a transition time of 1 to 5 seconds. If the current operating condition significantly exceeds the training range or the output parameters exceed the limits, maintain the original PID parameters or call the backup parameters verified by the engineering team, and record the out-of-range operating condition.
[0068] In this embodiment, the aforementioned output parameter verification means that, in addition to verification through the PID parameter range, it also passes the multi-band stability domain intersection verification under the current operating conditions. Specifically, the K output by the mapping model...p K i and K d As initial PID parameters, along with the current T w ΔP, H, and Y0 are written into the closed-loop verification model corresponding to the online object. A standard perturbation consistent with the training phase is applied, and the damping margin of each frequency band of the initial PID parameters is determined according to the same frequency band boundary, peak extraction rules, and damping margin calculation rules. When the damping margin of all frequency bands is not less than 0, the initial PID parameters are determined as the PID parameters to be written; when the damping margin of any frequency band is less than 0, the initial PID parameters are used as the center, and within K... p K i and K d Local correction parameters are generated within a ±5% neighborhood of each allowable range. The central difference method is used to calculate the local change direction of the minimum damping margin relative to each PID parameter, and the sampling step size is progressively reduced along the direction of increasing minimum damping margin. For each set of local correction parameters, the damping margin for all frequency bands is recalculated. Only local correction parameters that simultaneously meet the lower damping limits for all frequency bands are included in the intersection of the multi-frequency stable domains of the current operating condition. From this intersection, the parameter whose frequency-specific damping margin differs from the maximum value by no more than the preset margin range and has the smallest comprehensive time-domain adjustment index is selected as the PID parameter to be written. If a non-empty intersection is not formed after completing the preset correction rounds, the output parameters of the mapping model are not written; the original PID parameters are retained, or backup parameters verified by engineering are called, and the current operating condition, initial PID parameters, and frequency bands that do not meet the lower damping limit are recorded.
[0069] The closed-loop verification model can be deployed on a training server or a monitoring server. Its calculation results are used for safety checks before parameter writing and do not directly guide the actuator to output control inputs. Before each verification, the current T... w H and Y0 update the operating points of the water diversion system and turbine, update the generator and load models with the current load status, and add K to be verified. p K i and K d Write the data into the governor model. Standard disturbances are preferentially represented by active load steps, with the step amplitude taken as the current load disturbance amplitude ΔP, and the direction consistent with the direction of the current dispatch command change. If no identifiable load change exists, a preset verification step of 0.05 per unit can be used. The simulation observation window is no shorter than two cycles corresponding to the lowest analysis frequency; 200s is used as a configuration, and the sampling frequency is 20Hz. The closed-loop verification model uses the same frequency band boundaries, filtering parameters, peak thresholds, and damping lower limits as the training phase. Therefore, whether the online output parameters meet the hard constraints is determined by the recalculated damping margins of each frequency band, rather than directly assuming that the output meets the hard constraints simply because the training labels of the mapping model meet them.
[0070] When the initial PID parameters fail the multi-band stability domain intersection check, local correction is made using K. p K i and K d Each parameter's allowable span is 5% as the maximum offset for the first round. Sampling points are set in both the positive and negative directions, and the step size is halved in subsequent rounds. At least three sets of parameters with the largest frequency division damping margin are retained as the sampling centers for the next round in each round, and each set of parameters undergoes re-performing boundary checks and full-band damping margin calculations. Local corrections terminate when any of the following conditions are met: a non-empty multi-band stable domain intersection is formed; the maximum frequency division damping margin increment is less than 0.001 for three consecutive rounds; the sampling step size is less than the governor parameter writing resolution; or 20 rounds are reached. Selected parameters are written only when a non-empty intersection is formed; in other termination cases, the original PID parameters are retained or backup PID parameters are called.
[0071] This embodiment calculates the damping margin for each frequency band separately and uses the minimum value as the frequency-specific damping margin, ensuring that any damping deficiency in any frequency band is directly reflected as a negative value. The intersection of the multi-band stability domains retains only candidate PID parameters that satisfy the lower damping limit for all frequency bands. Furthermore, a safe candidate set and time-domain adjustment index are used to select training labels, establishing the output relationship of the mapping model based on candidate parameters that already satisfy the multi-band hard constraints, while retaining the evaluation of response error and settling time.
[0072] The following is a complete example of the process from inputting the training condition to writing it online. Let the current training condition be T. w =1.2s, ΔP=0.10 per unit, H=197m, Y0=0.60 per unit, K p K i and K d The ranges are 0.1 to 10, 0.01 to 2, and 0 to 2, respectively. For this operating condition, 600 initial parameters were generated using Latin hypercube. After verification for response divergence, guide vane overshoot, speed overshoot, and steady-state error band, 382 parameters were retained. The first frequency band was set to 0.01Hz to 0.1Hz, and the second frequency band was set to 0.1Hz to 2Hz. The preset lower limit of damping for both frequency bands was set to 0.30. After calculation according to the aforementioned filtering and peak rules, a total of 64 parameters simultaneously satisfied the lower limits of damping for both frequency bands.
[0073] Among the 64 sets of parameters, the maximum frequency division damping margin M max The value is 0.09, and the preset margin range ε is [missing value]. M Taking a value of 0.02, the 17 sets of parameters with a frequency division damping margin of not less than 0.07 constitute a safety candidate set. After calculating the comprehensive time-domain regulation index according to w1=0.40, w2=0.20, w3=0.25, and w4=0.15, K is selected. p =2.38, K i =0.41, Kd =0.24 is used as the target PID parameter; the equivalent damping ratios of this parameter in the first and second frequency bands are 0.38 and 0.37, respectively, corresponding to damping margins of 0.08 and 0.07, and the frequency division damping margin is 0.07. This set of parameters, together with the operating condition parameters, forms the training sample.
[0074] After the mapping model is trained, inputting the same working condition into the mapping model yields K. p =2.35, K i =0.40, K d =0.23. This output parameter is written into the closed-loop verification model, and a load step of 0.10 per unit is applied. The equivalent damping ratios for the first and second frequency bands are obtained as 0.37 and 0.34, respectively, corresponding to a frequency division damping margin of 0.04. Since the guide vane opening, speed deviation, and time-domain adjustment indicators do not exceed the operating boundaries, this parameter is determined as the PID parameter to be written, and the original parameter is linearly transitioned to this parameter within 3 seconds. If the damping margin of any of the above frequency bands is negative, a search is performed according to the local correction rule; if no non-empty intersection is formed, the output parameter is not written. This example illustrates that training label selection, model output, and parameter writing pre-verification are performed separately, and the hard constraint state of the model output is based on the closed-loop verification result.
[0075] Example 2 This embodiment illustrates the constraint frequency band identification, supplementary candidate PID parameter generation, and mayfly individual update guidance process when the intersection of the multi-frequency band stable domains is empty under a certain operating condition. Embodiment 2 adopts the closed-loop simulation model, frequency band decomposition rules, damping margin calculation rules, and training label selection rules from Embodiment 1. The content that is the same as in Embodiment 1 will not be repeated.
[0076] An empty intersection of the multi-band stability domains means that among all candidate PID parameters obtained from the initial sampling and the current round of optimization, there are no parameters that simultaneously satisfy the preset damping lower limits for all frequency bands. This state may be caused by the operating condition being at the edge of the training range, insufficient initial sampling density, or the different frequency band stability domains not yet forming a identifiable intersection at the current sampling accuracy. When the intersection is empty, the preset damping lower limit is not relaxed, nor are parameters with a frequency division damping margin less than 0 used as training labels. Instead, a supplementary search targeting the constrained frequency bands is initiated.
[0077] When determining the constraint frequency bands, the frequency band with the minimum damping margin is recorded for each group of deleted candidate PID parameters. The training server counts the number of times each frequency band becomes the minimum damping margin frequency band and calculates the average absolute value of the negative margin for that frequency band. The frequency band with the most occurrences is preferentially determined as the constraint frequency band; if the occurrences are the same, the frequency band with the larger average absolute value of the negative margin is determined as the constraint frequency band. If the statistical results of two frequency bands are close, two search directions are retained respectively, and all frequency bands are re-validated after each generation of supplementary parameters.
[0078] To determine the damping margin of the constrained frequency band as a function of K p K i and K d The direction of change is determined by selecting parameters from the deleted candidate PID parameters whose frequency division damping margin is between -ε0 and 0 as boundary samples. ε0 is used to define the range close to the intersection boundary of the multi-band stability domain, and one possible value is 0.03. For the boundary sample x, respectively in K... p K i and K d Small positive and negative perturbations are applied in the direction, and the margin rate of change in the direction of the j-th parameter is estimated using central difference: g j =[M b (x+Δ j e j )-M b (x-Δ j e j )] / (2Δ j ) In the formula, g j To constrain the local rate of change of the frequency band damping margin relative to the j-th PID parameter, M b To constrain the damping margin of the frequency band, Δ j Let e be the perturbation step size of the j-th parameter. j Let Δ be the unit vector in the direction of the j-th parameter. j The value can be 1% to 5% of the corresponding parameter range. j When the value is greater than 0, the direction of increase of this parameter is recorded as the direction of margin increase; g j When the value is less than 0, the direction of decreasing this parameter is recorded as the direction of increasing margin; g j When the value is close to 0, supplementary parameters are not generated along the direction of that parameter.
[0079] To avoid K p K i and K d The different dimensions and ranges of values make the rates of change incomparable. Before calculating the local rate of change, the three parameters can be mapped to normalized coordinates from 0 to 1 according to their allowable ranges, and a central difference perturbation can be applied to the normalized coordinates. The absolute value of the normalized rate of change is less than 1 × 10⁻⁶. -3 When, the g in the corresponding direction can be determined. j A majority consensus is defined as when the sign of the boundary samples is consistent in at least two-thirds of the samples in the same direction, close to 0. This threshold, the number of boundary samples, and the consensus ratio remain unchanged during a supplementary search.
[0080] To reduce the risk of individual boundary samples being affected by local nonlinearity, g is calculated for at least three boundary samples. jA direction with the same parameter is considered a valid adjustment direction only when it has a consistent sign across most boundary samples; if the signs are inconsistent, the Δ value is reduced. j Then recalculate. If the inconsistency persists after reducing the perturbation step size, the parameter is treated as a non-monotonic parameter in the current local region and is not extrapolated based solely on its direction, but rather sampled in combination with other parameters.
[0081] When generating supplementary candidate PID parameters, first in K p K i and K d Layered sampling is performed within a preset range, and a numerical stability domain is established according to the running boundary determination rules in Example 1. The first round of supplementary parameters is generated along the effective adjustment direction, centered on the boundary sample. The step size for the first round can be 5% of the corresponding parameter range; after each round of supplementary simulation, the step size is halved, and the parameter with the largest frequency division damping margin in this round is used as the local sampling center for the next round. All supplementary parameters are projected onto the preset range of PID parameters and the numerical stability domain.
[0082] The aforementioned projection is performed according to the projection rules for discrete feasible nodes, local feasible neighborhoods, and nearest points specified in Example 1 for the numerical stability region D; after projection, the closed-loop verification must be run again, and supplementary parameters that fail will not enter the next round of search.
[0083] For each set of supplementary candidate PID parameters, the training server reruns the complete closed-loop simulation, extracts the responses of each frequency band according to the same frequency band boundaries, and recalculates the damping margins and frequency-specific damping margins for all frequency bands. The supplementary search does not only calculate the constraint frequency band. If an adjustment direction can improve the damping margin of the constraint frequency band, but causes the damping margins of other frequency bands to become negative, the supplementary parameter is still deleted. Only supplementary parameters with a frequency-specific damping margin not less than 0 are included in the intersection of the multi-band stability domains.
[0084] For example, under a certain operating condition, the second frequency band achieves the minimum damping margin among most of the deleted candidate PID parameters. The difference results from the boundary samples indicate that appropriately reducing K... p And increase K d At that time, the damping margin of the second frequency band increases. The training server along K... p Decrease and K d The increased combination direction generates supplementary parameters, and the damping margins for the first and second frequency bands are recalculated for each set of supplementary parameters. If the damping margin of a certain supplementary parameter in the second frequency band increases from -0.02 to 0.01, while the damping margin in the first frequency band remains at 0.03, then the supplementary parameter enters the intersection of the multi-band stability domain.
[0085] The termination conditions for supplementary sampling include: obtaining at least one supplementary candidate PID parameter with a frequency division damping margin of not less than 0; the maximum frequency division damping margin increment of three consecutive sampling rounds being less than a preset increment; reaching a preset number of supplementary rounds; or the sampling step size being less than the parameter writing resolution. One preset number of supplementary rounds is 20 rounds. After forming a non-empty intersection, the supplementary parameters are merged with the original retained parameters, and the target PID parameter is determined according to the safety candidate set and time-domain adjustment index in Example 1. If a non-empty intersection is not formed even after reaching the termination conditions, the operating condition is marked as a condition to be reviewed, and the backup parameters verified by engineering are used. No network training label is generated for this operating condition.
[0086] During the mayfly optimization phase, the position x of each mayfly individual i is... i Represents 1 group K p K i and K d speed v i This represents the update amount of the three parameters. In addition to the original individual-optimal and population-optimal update components of the mayfly algorithm, a margin-guided component generated by individuals with a large frequency division damping margin is added. One velocity update method is as follows: v i k+1 =ω k v i k +c1r1(p i k -x i k )+c2r2(g k -x i k )+ν k (x M k -x i k ) x i k+1 =Proj D [x i k +v i k+1 ] In the formula, k is the iteration number, ω k c1 and c2 are inertia weights, c1 and c2 are learning coefficients, r1 and r2 are random numbers between 0 and 1, and p i k For the historical best position of individual i, g k For the optimal position of the population integration objective, x M k The central position of the individual with the largest frequency division damping margin in the current population, ν k Proj is the margin guiding factor.D This indicates that the update results will be limited to the PID parameter range and the numerical stability region D. k The number of iterations can be gradually reduced, allowing the search to approach the high margin region more quickly in the early stages and reducing parameter oscillations in the later stages of the search.
[0087] Individual historical optimal position p i k and the optimal position g of the overall population objective k The evaluation rule is determined according to lexicographical order. For any two individuals a and c, first determine their frequency division damping margin M. a and M c Whether it is not less than 0: If only one is not less than 0, the individual with a frequency division damping margin not less than 0 is preferred; if both are less than 0, the individual with the larger frequency division damping margin is preferred; if both are not less than 0, the individual with the smaller comprehensive time-domain adjustment index J is preferred; if J is the same, the individual with the larger frequency division damping margin is preferred.
[0088] p of individual i i k For the optimal position determined according to the above rules from all historical positions from iteration 0 to iteration k, g k This represents the optimal position among the historical optimal positions of all individuals in the current population. Therefore, before individuals satisfying the lower limit of damping across all frequency bands are formed, optimization prioritizes increasing the margin of the most unfavorable frequency band; after feasible individuals are formed, optimization prioritizes decreasing the comprehensive time-domain adjustment index while maintaining the frequency-specific damping margin at no less than 0.
[0089] In specific calculations, the margin guiding coefficient in the formula can be denoted as ν according to the individual state. i k When M i k When <0, ν i k =ν k When M i k When ≥0, ν i k =ρν k Where ρ ranges from 0.1 to 0.5. If, after a feasible individual update, the damping margin in any frequency band is less than 0, then the next round of recovery will use the complete ν. k .
[0090] As a specific parameter configuration for the mayfly optimization algorithm, the inertia weight ω k The learning coefficient decreases linearly from 0.90 to 0.40 with the number of iterations, with both learning coefficients c1 and c2 set to 1.50, and the margin guiding coefficient ν... kThe value is reduced from 0.80 to 0.10; the population size is set to 40 to 100, and the maximum number of iterations is set to 100 to 300. After each iteration, if an individual's position exceeds the allowable range of the PID parameters, it is projected to the nearest allowable boundary; if the projected parameters fail the numerical stability domain verification, the individual is restored to its most recently verified position, and a new random velocity component is generated. The parameter configuration is saved with the optimization task, and the same random seed is used or the initial population is saved when reproducing the same training label.
[0091] Determine x M k At this time, the current population can be sorted by frequency-partial damping margin, and the top 10% to 20% of individuals can be selected to form a guide set, and their position average can be taken. For individuals with a frequency-partial damping margin less than 0, the full margin guide component is used; for individuals with a frequency-partial damping margin not less than 0, ν is reduced. k This allows the search to continue primarily based on time-domain adjustment indices. Each updated individual still requires numerical stability domain verification and full-band damping margin calculation.
[0092] Constraint-band supplementary sampling and mayfly individual update guidance can be executed sequentially. First, mayfly optimization is used to generate candidate PID parameters within a large parameter space. If the intersection of the multi-band stability domains is empty, local supplementary sampling is performed using constraint-band and boundary samples. Alternatively, the intersection status can be checked at fixed iteration intervals during mayfly optimization, and local supplementary sampling can be initiated early when the intersection is empty for several consecutive generations. Both methods use the damping margin of each frequency band and the frequency-specific damping margin as the criterion.
[0093] In this embodiment, when the intersection of the multi-band stability domains is empty, the search focus is determined by the frequency band where the negative margin is located, and a limited supplementary search process is formed by local rate of change, step size reduction, and verification across all frequency bands. This process provides adjustment direction, parameter boundaries, stopping conditions, and failure handling, enabling those skilled in the art to supplement candidate PID parameters not covered by the original sampling without reducing the damping hard constraints.
[0094] Example 3 This embodiment illustrates the process of monitoring the actual damping margin, forming incremental samples, updating candidate mapping models, and replacing models after the mapping model is put into operation. Embodiment 3 adopts the frequency band boundaries, peak extraction rules, equivalent damping ratio calculation method, preset damping lower limit, and frequency-division damping margin definitions determined in Embodiment 1, so that offline training and online monitoring have the same data meaning.
[0095] like Figure 7As shown, the online monitoring and adaptive update process decomposes the actual response into frequency bands and calculates the damping margin of each frequency band. When any frequency band hard constraint is not met or the deviation from the reference margin exceeds the limit continuously, incremental samples are generated to train the candidate mapping model, and the original mapping model is replaced only after the current working condition, the adjacent working condition and the intermediate working condition have all passed the multi-frequency band stability domain intersection verification.
[0096] The mapping model outputs K corresponding to the current operating condition. p K i and K d After the parameters are written, the online tuning equipment collects the actual response when the unit experiences a valid disturbance. Valid disturbances include load command steps, islanded grid load changes, or approved speed control system test disturbances. The collected data includes at least a speed deviation sequence or frequency deviation sequence, and can simultaneously record guide vane opening, active power, operating head, and load command. The sampling frequency, sampling clock, and data units are consistent with the response processing rules of the offline model.
[0097] The online tuning equipment first removes the pre-disturbance steady-state bias and obvious abnormal sampling points, and then performs zero-phase frequency band decomposition on the actual rotational speed or frequency response according to the frequency band boundaries of Example 1. Continuous attenuation peak values are extracted from the response of each frequency band, and the actual equivalent damping ratio is calculated according to the logarithmic attenuation relationship. The actual equivalent damping ratio is subtracted from the preset lower limit of the corresponding frequency band to obtain the actual frequency band damping margin; the minimum value among all actual frequency band damping margins is determined as the actual frequency-division damping margin.
[0098] The reference damping margin corresponding to the training label is stored in association with the target PID parameters when training data is generated offline. When the current operating condition is the same as the training operating condition, the damping margin of each frequency band of the training operating condition is directly read. When the current operating condition is among multiple training operating conditions, the operating condition parameters are first processed using the normalization rules of the training phase, then the five training operating conditions with the closest normalization distance are selected, and the damping margin of each frequency band is weighted according to the reciprocal of the distance to obtain the reference frequency band damping margin of the current operating condition.
[0099] The deviation between the actual frequency band damping margin and the reference frequency band damping margin is judged separately for each frequency band. If the damping margin of any actual frequency band is less than 0, the damping hard constraint is directly determined to be unmet; if the actual frequency band damping margin is not less than 0, but the absolute difference from the reference value exceeds the preset deviation range for that frequency band, a deviation is determined to exist between the model and the field object. One preset deviation range is 0.10. To reduce false triggering caused by measurement noise, incremental updates can be initiated only after the preset deviation range is exceeded in three consecutive valid disturbances for the same frequency band.
[0100] After triggering the incremental update, with the current T wΔP, H, and Y0 are used as incremental sample inputs. The incremental sample output does not directly use the PID parameters that are currently running but have deviated; instead, it generates correction parameters within the neighborhood of those PID parameters. The range of the correction parameters can be K. p K i and K d Each parameter is allowed to be 5% to 10% of its respective range. The corrected parameters are written into the closed-loop model after actual response correction, the damping margin of all frequency bands is calculated according to the method in Example 1, and new target PID parameters are determined from the intersection of non-empty multi-frequency band stability domains as incremental sample outputs.
[0101] When generating the correction parameters, first take the parameters of the currently running PID as the center and proceed along K... p K i and K d At least two levels of disturbance step sizes are set in both the positive and negative directions. The first step size is 5% of the corresponding allowable range, and the second step size is half of the first step size. For each correction parameter, parameter range verification, closed-loop operation boundary verification, and damping margin calculation for all frequency bands are performed. If multiple sets of correction parameters enter the intersection of the multi-frequency band stability domain, parameters with a frequency division damping margin not lower than the maximum frequency division damping margin of the intersection minus 0.02 are retained first, and then the parameter with the smallest comprehensive time-domain regulation index is selected as the incremental sample output. If a non-empty intersection is not obtained or the corrected closed-loop model does not meet the correction acceptance conditions described later, only the current operating condition and actual response are saved as data to be verified, and supervised training samples with target PID parameter outputs are not generated.
[0102] The closed-loop model after actual response correction is adjusted by T w The unit damping coefficient, guide vane servo time constant, or load model parameters are used to ensure that the model's speed or frequency response under the current disturbance matches the dominant frequency, peak amplitude, and attenuation trend of the actual response. Calibration uses only parameters identifiable from the actual acquired data and retains both the pre- and post-calibration parameter versions. If a set of PID parameters, verified by engineering and with damping margins not less than 0 across all frequency bands, has been obtained from field testing, this set of parameters can be directly used as the output of the current incremental sample.
[0103] During closed-loop model calibration, the identifiable parameters are combined to form a calibration vector θ, where θ includes at least T. w Unit damping coefficient D, guide vane servo time constant T g One of the equivalent damping parameters for the load; model parameters not selected for θ retain their engineering verification values. The initial values for each correction parameter are taken from the model values before correction, with the boundary values preferably using unit design data or experimental allowable ranges; if no clear allowable range is available, T... w D and T g Each is limited to between 70% and 130% of the initial value, and T gKeep the values positive. For the same effective disturbance, extract the dominant frequency f, the first effective peak amplitude A, the logarithmic decay rate δ, and the normalized time series response u(t) from the actual response and the simulated response, respectively, and construct the correction objective function J. cal =w1·|f sim -f act | / f act +w2·|A sim -A act | / max(|A act |,ε)+w3·|δ sim -δ act | / max(|δ act |,ε)+w4·RMSE(u sim ,u act ), where w1 to w4 are all not less than 0 and their sum is 1, and ε is a preset small quantity to prevent the denominator from being 0. The bounded Levenberg-Marquardt algorithm or the bounded simplex search algorithm is used to minimize J. cal Each iteration projects θ onto the corresponding value boundary. When J reaches its maximum value after 5 consecutive iterations... cal The relative decreases were all less than 1×10 -3 J cal Terminates when the value is no greater than 0.10 or when 100 iterations are reached. Only when J... cal Only when the error is no greater than 0.10, the relative error of the dominant frequency is no more than 5%, the relative error of the peak amplitude is no more than 10%, and the absolute error of the equivalent damping ratio is no more than 0.05, will the corrected closed-loop model be marked as usable for incremental sample label generation; otherwise, the model before correction and the reason for failure will be retained, and the target PID parameters will not be generated using the correction result.
[0104] To avoid mutual compensation among multiple parameters to be corrected under a single perturbation, local sensitivity screening is performed on each parameter in θ before correction. The m-th parameter is increased and decreased by 1% to 3% in the normalized coordinates, and the central difference of the dominant frequency, peak amplitude, logarithmic decay rate, and normalized time-series response characteristics is calculated. The sensitivity matrix S is constructed from these characteristic differences. If the absolute value of the correlation coefficient between any two columns of the normalized sensitivity vectors is greater than 0.95, or the condition number of S is greater than 100, only the parameter with the larger normalized sensitivity norm is retained for this correction, while the remaining parameters retain their engineering check values. Alternatively, joint correction can be performed after obtaining another type of effective perturbation.
[0105] When θ contains more than two parameters, to limit the correction parameters from deviating unjustifiably from their initial engineering values, the actual minimized correction objective function can be expressed as: J cal ′=J cal +λ θ Σ m=1nθ [(θ m -θ m,0 ) / (θ m,max -θ m,min )] 2 In the formula, θ m,0 Let θ be the initial value of the m-th parameter before correction. m,max and θ m,min These are the upper and lower limits of the parameter's value, λ. θ The value is set to 0.01 to 0.10. The solution is repeated using no fewer than three different initial correction vectors. If each group meets the correction acceptance condition, but the relative difference of any parameter result exceeds 10%, the corresponding parameter under this perturbation is determined to be unidentifiable, and incremental samples are not generated using the corrected closed-loop model.
[0106] When the actual response fails to identify an effective mode that meets the fitting threshold, there are fewer than 3 consecutive effective peak pairs and the mode fitting still fails, or there are no identifiable parameters after the sensitivity matrix is screened, the current closed-loop model correction is stopped, and only the current operating condition and the actual response are saved as data to be reviewed.
[0107] The incremental samples include operating parameters, target PID parameters, actual response characteristics, actual damping margins for each frequency band, data time, and unit identification. The training server combines the incremental samples with representative samples from the original training data to form a mini-batch training set, and performs incremental training on the original mapping model to obtain candidate mapping models. Incremental training uses an update step size smaller than that in the initial training phase, and retains original samples from different operating condition regions in each training batch to prevent the candidate mapping model from only adapting to the current operating condition and destroying the mapping relationship of other operating conditions.
[0108] As an executable configuration for incremental training, the candidate mapping model is trained starting from the weights of the original mapping model, with a learning rate of 1×10⁻⁶. -4 Up to 5×10 -4 The batch size is set to 32, the maximum training epochs to 50, and the same normalization parameters as the initial training are used. In each training batch, incremental samples or their neighborhood correction samples account for 25% to 50%, and the remaining samples are stratified and extracted from different operating condition regions of the original training data. When the number of incremental samples is insufficient to fill the specified proportion, incremental samples are allowed to be extracted repeatedly, but the number of original representative samples is not reduced. The candidate mapping model will only proceed to the subsequent multi-band stable domain intersection verification if the mean squared error on the retained validation set does not increase by more than 5% compared to the original model.
[0109] The candidate mapping model does not immediately replace the original mapping model after training. Validation conditions include the current working condition and its neighboring conditions. Neighboring conditions can be selected from the original training data, or they can be selected separately for T. wThe parameters ΔP, H, or Y0 are formed by applying changes not exceeding 5% of the training parameter span. Each validation includes at least the current condition and 5 neighboring conditions to cover the local parameter region surrounding the current condition.
[0110] Adjacent operating conditions can be determined in the normalized operating condition space according to Euclidean distance, prioritizing those closest to the current operating condition and each covering T. w The operating conditions are defined by increasing and decreasing ΔP, H, and Y0. When the original training operating condition does not exist in a certain direction, the corresponding parameters are changed by 2% to 5% of the training span to form a supplementary verification operating condition, provided that the training range is not exceeded. The current operating condition, adjacent operating conditions, and intermediate operating conditions are verified one by one using the same closed-loop verification model version, and the input operating conditions, output PID parameters, damping margins of each frequency band, and operating boundary results are saved respectively to determine the specific operating conditions and constraint frequency bands that fail the verification.
[0111] For each validation scenario, the K output by the candidate mapping model will be... p K i and K d The damping margins for each frequency band and the frequency-specific damping margins are recalculated in the closed-loop simulation model. The multi-band stability domain intersection verification here refers to the fact that the PID parameters output by the candidate mapping model for each verification condition belong to the intersection of the stability domains of all frequency bands for that verification condition, meaning that the damping margin for each frequency band is not less than 0. Verification also includes the PID parameter range, guide vane action range, whether the response diverges, and whether the time-domain regulation index exceeds the allowable value.
[0112] For a candidate mapping model to pass validation, it must simultaneously meet the following conditions: the frequency division damping margin of the output parameters under the current operating condition is not less than 0; the frequency division damping margin of the output parameters under a preset number of adjacent operating conditions is not less than 0; all output PID parameters are within the allowable range of the speed controller; the closed-loop response does not exceed the operating boundary; and the mapping error of the candidate mapping model on the retained validation set does not exceed the allowable increment of the original model. If any condition is not met, the candidate mapping model will not replace the original mapping model.
[0113] To avoid damping hard constraint failure between adjacent operating conditions due to passing only discrete verification points, the adjacent operating condition verification, in addition to using the operating condition points from the original training data, also inserts at least two intermediate operating conditions at equal intervals with normalized distances between the current operating condition and each adjacent operating condition. The candidate mapping model calculates the damping margin for all frequency bands for each set of PID parameters output by the current operating condition, adjacent operating conditions, and the intermediate operating conditions according to the complete closed-loop verification process of Example 1. If the damping margin of any frequency band in any verification operating condition is less than 0, the candidate mapping model is determined to have failed the multi-band stability domain intersection verification. After successful verification, the multi-band stability domain intersection verification is still performed on a per-operating-condition basis before parameter writing when applying the candidate mapping model online. Model version verification does not replace the hard constraint verification of a single online output.
[0114] After successful verification, the version number, training time, incremental sample identifier, verification conditions, and verification results of the candidate mapping model are written to the model management record. When the unit is in steady state and the governor allows parameter switching, the candidate mapping model replaces the original mapping model. The original mapping model is retained as a fallback version. The actual frequency division damping margin is calculated for the first few effective disturbances after the switch; if the actual frequency division damping margin is less than 0, the output parameters exceed the limit, or the input data is abnormal, the original mapping model is restored or safe backup parameters are output.
[0115] When verification fails, the online tuning device maintains the original mapping model and current safety PID parameters, and does not perform model switching. The current incremental samples, failed verification conditions, and reasons for failure are retained for subsequent sample additions or centralized retraining. Therefore, an independent multi-band hard constraint verification step is established between incremental updates and online model switching, preventing a single field sample from directly altering the currently running parameter mapping relationship.
[0116] In one deployment configuration, the data acquisition module reads H, Y0, load, speed, and guide vane opening from the unit monitoring system; the operating condition processing module determines T. w The system performs normalization with ΔP; the model inference module runs the mapping model; the parameter verification module checks the PID parameter range and current operating condition coverage; the parameter writing module updates the speed controller within the allowed window; the online monitoring module calculates the actual damping margin for each frequency band; and the model management module completes incremental sample storage, candidate mapping model verification, version switching, and rollback. These modules can be executed by the same processor or distributed across the training server, monitoring server, and speed controller. The functional division of the above modules is merely illustrative; in actual implementation, the functions of multiple modules can be executed by the same processor or distributed across different computing devices, and this invention does not limit this.
[0117] This embodiment utilizes the damping margin of each actual frequency band to evaluate the difference between the offline model and the field object, ensuring that the incremental update triggering condition uses the same frequency band hard constraints as the training label generation stage. Before replacement, the candidate mapping model needs to undergo multi-band stability domain intersection verification for the current operating condition and adjacent operating conditions, thereby verifying the local output after incremental training. The original mapping model and safety backup parameters are retained, ensuring a clear processing path in case of verification failure, input anomalies, or abnormal response after switching.
[0118] The number of frequency bands in the above three embodiments is not limited to two. When the turbine regulating system has other oscillation modes that require separate constraints, corresponding frequency bands can be added, and a preset damping lower limit can be configured for each frequency band. In this case, the frequency division damping margin is still taken as the minimum value among the damping margins of all frequency bands, and the intersection of the multi-frequency band stability domains is still composed of candidate PID parameters that simultaneously satisfy the damping lower limits of all frequency bands. The target PID parameters, supplementary candidate PID parameters, and candidate mapping models are all determined and verified according to the same rules.
[0119] The execution order of the steps described in the above embodiments can be adjusted according to offline training and online deployment methods. However, the candidate PID parameters should meet the damping hard constraints of each frequency band before entering the training label. The PID parameters output by the mapping model should be verified for range. Before the candidate mapping model replaces the original mapping model, the multi-frequency stable domain intersection verification of the current operating condition and the adjacent operating conditions should be completed.
[0120] The above description is merely a specific embodiment of this application and is not intended to limit the scope of protection of this application. Equivalent substitutions or conventional adjustments made by those skilled in the art to the parameter range, number of frequency bands, model structure, and computing device without departing from the technical concept of this application shall fall within the scope of protection of this application.
Claims
1. A method, device, and medium for online adjustment of a turbine governor, characterized in that, The method includes: The operating parameters of the turbine regulating system, the candidate PID parameters of each group, and the damping margin of each frequency band are obtained. The damping margin of each frequency band is the difference between the equivalent damping ratio of the candidate PID parameter in each frequency band and the preset damping lower limit of the corresponding frequency band. The minimum value among the damping margins of each frequency band is determined as the frequency division damping margin of each group of candidate PID parameters. Candidate PID parameters with a frequency division damping margin less than zero are deleted. The remaining candidate PID parameters form a multi-frequency band stability domain intersection. The target PID parameter is determined from the multi-frequency band stability domain intersection based on the frequency division damping margin and used as the training label for the corresponding operating condition. The mapping model is trained using the operating condition parameters and the training label. The mapping model outputs the PID parameters corresponding to the current operating condition.
2. The method as described in claim 1, characterized in that, Obtaining the damping margin for each frequency band includes: The turbine regulation response corresponding to each set of candidate PID parameters is decomposed into frequency bands to obtain the first frequency band response and the second frequency band response. The first frequency band responds to the oscillations caused by the water hammer effect of the water diversion system, and the second frequency band responds to the oscillations caused by the load coupling between the turbine and the generator. Continuous attenuation peaks are extracted from the first frequency band response and the second frequency band response respectively. The equivalent damping ratio of the corresponding frequency band is determined according to the amplitude relationship of adjacent attenuation peaks. The degree of deviation of the equivalent damping ratio from the lower limit of damping of the frequency band is determined as the damping margin of the frequency band.
3. The method as described in claim 2, characterized in that, The determination of the target PID parameters includes: The remaining candidate PID parameters are sorted from largest to smallest according to the frequency division damping margin, and the maximum frequency division damping margin is determined. Candidate PID parameters whose difference from the maximum frequency division damping margin does not exceed a preset range are used to form a safe candidate set. Determine the time-domain regulation index of each candidate PID parameter in the safety candidate set, and select the candidate PID parameter with the smaller time-domain regulation index from the safety candidate set as the target PID parameter.
4. The method as described in claim 3, characterized in that, When the intersection of the multi-band stability domains is empty, the constraint frequency band is determined according to the frequency band with the minimum damping margin and a damping margin less than zero among the candidate PID parameters in each group. Based on the direction of the damping margin of the constraint frequency band changing with the proportional, integral, and derivative parameters, supplementary candidate PID parameters are generated in the neighborhood of the deleted candidate PID parameters. The damping margin of each frequency band of the supplementary candidate PID parameters is re-determined. After forming a non-empty intersection of the multi-band stability domains, training labels for the corresponding operating conditions are generated.
5. The method as described in claim 4, characterized in that, The process of generating supplementary candidate PID parameters includes: performing hierarchical sampling within a preset range of values for the proportional, integral, and derivative parameters; establishing a numerical stability domain for the candidate PID parameters based on the sampling results; and reducing the sampling interval within the boundary neighborhood of the numerical stability domain, using the direction of increasing damping margin corresponding to the constrained frequency band as the parameter adjustment direction, until supplementary candidate PID parameters with a frequency division damping margin not less than zero are obtained or a preset number of supplementary parameters is reached.
6. The method as described in claim 1, characterized in that, The operating parameters include the flow inertia time constant, load disturbance amplitude, working head, and initial values of guide vane opening.
7. The method as described in claim 6, characterized in that, The acquisition of each group of candidate PID parameters includes: performing Latin hypercube sampling within the preset value range of the PID parameters, obtaining the response state corresponding to each sampled PID parameter through a simulation model, deleting sampled PID parameters that cause response divergence or exceed the preset operating boundary, forming a numerical stability region, and iteratively generating candidate PID parameters within the numerical stability region using the mayfly optimization algorithm.
8. The method as described in claim 1, characterized in that, The process of training a mapping model using operating condition parameters and training labels includes: The operating parameters are normalized, with the initial values of water flow inertia time constant, load disturbance amplitude, working head, and guide vane opening as inputs; The proportional, integral, and derivative parameters from the target PID parameters are used as outputs to train a fully connected neural network with at least two hidden layers. The hidden layers use the ReLU activation function, and the output layer uses the linear activation function. The network parameters are adjusted based on the error between the training labels and the network output.
9. An online tuning device for a turbine governor integrating multi-band damping ratio hard constraints, comprising a memory, a processor, and a program stored in the memory, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1-8.
10. A storage medium having a program stored thereon, characterized in that, When the program is executed, it implements the method as described in any one of claims 1-8.