PID (Proportion Integration Differentiation) control parameter setting method, device, equipment, medium and product
By extracting features from the operating data of the controlled object and intelligently selecting optimization algorithms, the PID parameters are dynamically tuned, solving the problem of relying on experience in traditional methods and achieving efficient control under complex operating conditions.
Patent Information
- Application Number
- CN202511609130.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-05
- Publication Date
- 2026-02-17
AI Technical Summary
Traditional PID control parameter tuning methods rely on engineers' experience, making it difficult to obtain the optimal solution under complex operating conditions, and failing to provide ideal control performance when dealing with complex objects such as nonlinear, time-varying, or large time delay.
By collecting the operating data of the controlled object and extracting features, and using target optimization algorithms such as particle swarm optimization, sparrow search algorithm and gray wolf optimization, the most suitable PID parameter tuning algorithm for the current working condition is dynamically selected to achieve intelligent tuning.
It significantly improves the response speed, stability and robustness of the control system, enhances control performance and tuning efficiency under complex operating conditions, and avoids poor tuning results caused by algorithm-system mismatch.
Smart Images

Figure CN121541441A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial process automatic control technology, specifically to a PID control parameter tuning method, device, equipment, medium, and product. Background Technology
[0002] PID controllers are widely used in industrial process control due to their simple structure and robustness. Their control performance largely depends on the tuning quality of the proportional, integral, and derivative parameters. Traditional tuning methods, such as the Ziegler-Nichols method, heavily rely on the engineer's experience and struggle to achieve ideal control results when dealing with complex objects such as nonlinear, time-varying, or large time delays. Summary of the Invention
[0003] This invention provides a method, apparatus, equipment, medium, and product for tuning PID control parameters, in order to solve the problems of traditional tuning methods relying on prior knowledge, having low tuning efficiency, and being unable to obtain the optimal solution under complex working conditions.
[0004] In a first aspect, the present invention provides a method for tuning PID control parameters, the method comprising: setting initial PID parameters for a control system and controlling the operation of a controlled object through the control system; collecting operating data of the controlled object and extracting features from the operating data to obtain feature data; determining a PID parameter tuning algorithm from several objective optimization algorithms based on the feature data; and tuning the initial PID parameters using the PID parameter tuning algorithm.
[0005] In one optional implementation, determining the PID parameter tuning algorithm from several objective optimization algorithms based on the feature data includes: determining the problem type based on the feature data, wherein the problem type represents the problem of the control system; and selecting PID parameter tuning algorithms based on the problem type, wherein the PID parameter tuning algorithm includes at least one of particle swarm optimization, sparrow search algorithm, and gray wolf optimization.
[0006] In one optional implementation, the step of tuning the initial PID parameters using the PID parameter tuning algorithm includes: when the PID parameter tuning algorithm includes one target optimization algorithm, tuning the initial PID parameters using the PID parameter tuning algorithm; when the PID parameter tuning algorithm includes multiple target optimization algorithms, comparing and testing the multiple target optimization algorithms using a simulation model, and selecting a first algorithm based on the test results; tuning the initial PID parameters using the first algorithm, and confirming the first PID parameters.
[0007] In an optional implementation, after tuning the initial PID parameter using the PID parameter tuning algorithm, the method further includes: using the first PID parameter as a new initial PID parameter, returning to the step of collecting the operating data of the controlled object and extracting features from the operating data; when the new feature data meets a preset stability condition, stopping the tuning of the initial PID parameter using the PID parameter tuning algorithm and maintaining the first PID parameter; when the new feature data does not meet the preset stability condition, returning to the step of determining the PID parameter tuning algorithm from several target optimization algorithms based on the feature data.
[0008] In one optional implementation, the tuning of the initial PID parameters further includes: tuning using an incremental parameter update strategy.
[0009] In an optional implementation, when the new feature data meets the preset stability condition, stopping the tuning of the initial PID parameter through the PID parameter tuning algorithm and maintaining the first PID parameter, the method further includes: checking the performance of the control system at a preset period, wherein the performance of the control system includes at least one of operating condition changes and system characteristic drift; when the performance of the control system changes, returning to the step of collecting the operating data of the controlled object.
[0010] Secondly, the present invention provides a PID control parameter tuning device, the device comprising: The data acquisition module is used to set the initial PID parameters for the control system and to acquire the output data of the control system. The feature extraction module is used to extract features based on the output data to obtain feature data; An algorithm determination module is used to determine a PID parameter tuning algorithm from several target optimization algorithms based on the feature data; The PID parameter tuning module is used to tune the initial PID parameters using the PID parameter tuning algorithm.
[0011] Thirdly, the present invention provides an electronic device, comprising: a memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to perform a PID control parameter tuning method of the first aspect or any corresponding embodiment described above.
[0012] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to execute a PID control parameter tuning method according to the first aspect or any corresponding embodiment described above.
[0013] Fifthly, the present invention provides a computer program product, including computer instructions, which are used to cause a computer to execute a PID control parameter tuning method according to the first aspect or any corresponding embodiment described above.
[0014] This invention, through dynamic analysis of the operating characteristics of the controlled object, intelligently selects the most suitable PID parameter tuning algorithm from multiple optimization algorithms for the current operating conditions, overcoming the limitations of traditional methods that rely on a single fixed algorithm. By employing an intelligent selection mechanism based on operating characteristics, it significantly enhances adaptability to systems with different dynamic characteristics. While improving the response speed, stability, and robustness of the control system, it effectively avoids poor tuning results caused by algorithm-system mismatch, achieving superior overall control performance. Attached Figure Description
[0015] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0016] Figure 1 This is a schematic diagram of the first step in a PID control parameter tuning method according to an embodiment of the present invention; Figure 2 This is a schematic diagram of a second process for a PID control parameter tuning method according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the third process of a PID control parameter tuning method according to an embodiment of the present invention; Figure 4 This is an overall flowchart of a PID control parameter tuning method according to an embodiment of the present invention; Figure 5 This is a structural block diagram of a PID control parameter tuning method apparatus according to an embodiment of the present invention; Figure 6 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0017] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0018] It is understood that before using the technical solutions disclosed in the various embodiments of the present invention, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in the present invention and their authorization should be obtained in accordance with relevant laws and regulations through appropriate means.
[0019] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0020] Tuning methods in related technologies face significant limitations. For example, the classic Ziegler-Nichols method and its many improved variants, while effective in specific scenarios, often rely heavily on engineers' field experience and prior knowledge, leading to poor consistency and low reproducibility. A more prominent problem is that these methods are typically based on the assumption of linear time-invariant systems. When faced with complex controlled objects that are prevalent in actual industrial applications, such as nonlinear, time-varying parameters, or large time delays, their generalization ability and tuning effectiveness drop sharply, making it difficult to consistently provide optimal control performance under dynamically changing conditions. Furthermore, some automatic tuning techniques based on single optimization algorithms, while reducing reliance on human intervention, are highly dependent on the degree of matching between the algorithm and the specific controlled object, lacking the ability to adapt to different dynamic characteristics, thus limiting their universal application.
[0021] According to an embodiment of the present invention, a method for tuning PID control parameters is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0022] This embodiment provides a PID control parameter tuning method, which can be used in the aforementioned computer equipment. Figure 1 This is a flowchart of a PID control parameter tuning method according to an embodiment of the present invention, such as... Figure 1As shown, the process includes the following steps: Step S101: Set the initial PID parameters for the control system and control the operation of the controlled object through the control system.
[0023] Specifically, PID (Proportional-Integral-Derivative) is a controller algorithm. Setting the initial PID parameters, i.e., setting the parameters of the PID controller, allows PID control to be based on the current error signal. ( A setpoint-measured-value linear controller generates its output signal by linearly combining the proportional (P), integral (I), and derivative (D) components of the error. Its standard mathematical model is: Where u(t) is the output signal of the controller; This is the current error signal; The proportional gain is used to amplify the current error and determine the system's response speed. Too small a value results in slow response and large static error. Excessive size can cause system oscillations or even instability; The integral gain is used to eliminate steady-state error by integrating the error. If the value is too small, the static error will be difficult to eliminate; Excessive size can cause integral saturation, leading to increased system overshoot and slower response speed. The differential gain is obtained by differentiating the error, reflecting the rate of change of the error, and providing a damping effect. It can predict future trends in errors, effectively reduce overshoot, suppress oscillations, and improve system stability. Setting the initial PID parameters is equivalent to setting... The process can use the Ziegler-Nichols (ZN) method or empirical values to configure intelligent algorithm parameters (population size, number of iterations, learning factor, etc.), set performance index thresholds (overshoot, settling time, steady-state error, etc.), and input commands according to preset control targets, such as target temperature and target pressure, to make the controlled object enter the running state.
[0024] In one example, during the parameter configuration phase, the Ziegler-Nichols method or empirical values can be used as the initial input to the intelligent algorithm. When using the Ziegler-Nichols method, the critical characteristic parameters of the system must first be obtained through preliminary testing. Specifically, the controller is first switched to pure proportional control mode, the integral and derivative actions are turned off, and the proportional gain is gradually adjusted until the system produces critical constant-amplitude oscillations under a step input signal. The critical proportional gain P0 and the oscillation period T0 at this point are recorded. For a conventional PID controller, the initial PID parameters can be calculated according to the classic formula of the Ziegler-Nichols method. If the user has abundant historical debugging data, empirical values can be directly used as the initial input to the intelligent algorithm. For example, for a temperature control system, depending on the inertia of the controlled object, the empirical proportional gain is usually between 10 and 100, the integral time is between 30 and 300 seconds, and the derivative time is between 0 and 30 seconds; for a pressure control system, the empirical proportional gain is generally between 1 and 50, the integral time is between 0.1 and 10 seconds, and the derivative time is between 0 and 5 seconds. When selecting empirical values, fine-tuning is necessary based on the actual operating conditions of the controlled object (such as load variation range, disturbance intensity, etc.) to ensure that the initial input parameters do not cause instability phenomena such as severe oscillations or serious overshoot in the system. Inputting these operating condition-adapted empirical values into the intelligent algorithm enables the algorithm to focus on a better parameter range in the early stages of optimization, shortening the time cost of iterative optimization.
[0025] Step S102: Collect the operating data of the controlled object and extract features from the operating data to obtain feature data.
[0026] Specifically, after the controlled object enters the operating state, the data acquisition system is activated. The acquisition cycle is set according to the response speed of the controlled object to ensure that dynamic response details can be captured. Baseline performance testing begins, and the control system operates using an initial parameter set (set by empirical values or the ZN method). During the test, dynamic response data of the controlled variable (such as the real-time output value when the target value changes stepwise), controller output signals, and parameter change curves during algorithm iteration are continuously acquired. This serves as a basic reference for evaluating the initial controller performance and provides a foundation for subsequent parameter optimization of intelligent algorithms and system performance improvement. After the system stabilizes, data acquisition is stopped, and the baseline performance indicators are quantitatively analyzed. The extracted system response characteristics (rise time, peak time, overshoot, steady-state error, response curve smoothness, etc.) are standardized and quantified to eliminate dimensional differences. For example, the overshoot extracted from the acquired data is obtained by calculating the percentage of the difference between the peak value of the controlled variable and the target value relative to the target value; the settling time is the time from a step input to stabilization within the allowable deviation range; and the steady-state error is the deviation between the controlled variable and the target value after the system stabilizes. In this embodiment, the analysis results are used as the benchmark for subsequent optimization.
[0027] Step S103: Determine the PID parameter tuning algorithm from several objective optimization algorithms based on the feature data.
[0028] Specifically, by classifying feature data according to different indicators, system performance can be determined, such as stability, dynamic response speed, damping degree, steady-state accuracy, and anti-interference ability. This identifies the current performance shortcomings and core optimization needs of the system. Then, optimization algorithms are selected based on system performance. When selecting optimization algorithms, the core characteristics of each algorithm must be clearly defined. For example, particle swarm optimization (PSO) has fast convergence speed and is easy to implement, making it suitable for scenarios that require quickly finding a better solution; genetic algorithms have strong global search capabilities and are suitable for complex nonlinear systems; simulated annealing can effectively avoid local optima and is suitable for multi-extremum problems; and ant colony optimization (ACO) has good robustness and is suitable for systems with high stability requirements. Simultaneously, the data requirements (such as whether a large amount of historical response data is needed) and computational complexity of each algorithm are recorded. A matching score is given based on the system's core needs and algorithm characteristics. The evaluation should also incorporate quantitative indicators from the feature data (such as the overshoot magnitude and the percentage increase in settling time).
[0029] Step S104: The initial PID parameters are tuned using a PID parameter tuning algorithm.
[0030] Specifically, the PID tuning process unfolds step by step through an iterative approach.
[0031] In one example, the PID parameter tuning algorithm is a particle swarm optimization (PSO) algorithm. It first constructs a "particle swarm" near the initial parameters, with each particle representing a set of potential PID parameters. In each iteration, the algorithm directly applies these parameters to the actual control system for a short run, collecting the system's step response or disturbance rejection response data. Then, based on the step response or disturbance rejection response data, it calculates the performance index value, i.e., the fitness, for each particle. Subsequently, the algorithm compares the fitness of all current particles with their historical best values, driving the particle swarm to move towards a more optimal parameter region according to a preset update formula. This process is repeated, with the particle swarm continuously narrowing its search range in the parameter space, like an invisible intelligent agent constantly "trial and error" and accumulating experience, gradually approaching the global optimum. Throughout the iteration process, the algorithm needs to balance exploration and development, searching unknown regions to avoid getting trapped in local optima while also conducting a fine-grained search around already discovered superior regions. Finally, when convergence or the maximum number of iterations is reached, the algorithm terminates and outputs the currently found optimal PID parameter combination. Thus, the system completed the autonomous tuning from coarse initial parameters to refined and optimized parameters, thereby achieving comprehensive control performance with fast dynamic response, small overshoot, and high steady-state accuracy.
[0032] This embodiment provides a PID control parameter tuning method that, by linking a technical chain of "preliminary operation - feature perception - intelligent decision-making - precise optimization," achieves a transformation from traditional, experience-based tuning to data-driven intelligent tuning. Its core advantage lies in its adaptability to systems with different dynamic characteristics. It can intelligently diagnose major problems in the system response (such as oscillation and sluggishness) and automatically select the most suitable optimization tool, effectively overcoming the inherent limitation of poor universality of single algorithms. Ultimately, this method can quickly and automatically obtain high-quality PID parameters superior to fixed strategies without requiring extensive prior knowledge, significantly improving control performance, tuning efficiency, and engineering applicability under complex, time-varying conditions.
[0033] This embodiment provides a PID control parameter tuning method, which can be used in the aforementioned computer equipment. Figure 2 This is a flowchart of a PID control parameter tuning method according to an embodiment of the present invention, such as... Figure 2 As shown, the process includes the following steps: Step S201 involves setting initial PID parameters for the control system and then controlling the controlled object to operate through the control system. For details, please refer to [link to relevant documentation]. Figure 1 Step S101 of the illustrated embodiment will not be described again here.
[0034] Step S202: Collect the operating data of the controlled object and extract features from the operating data to obtain feature data. For details, please refer to [link to relevant documentation]. Figure 1 Step S102 of the illustrated embodiment will not be described again here.
[0035] Step S203: Determine the PID parameter tuning algorithm from several objective optimization algorithms based on the feature data.
[0036] Specifically, step S303 includes: Step S2031: Determine the problem type based on the feature data. The problem type is used to represent the problem of the control system.
[0037] In one example, rise time and peak time can be scored on a scale of 1 to 5 (1 point indicates extremely slow response, and 5 points indicates extremely fast response), overshoot can be scored inversely on a scale of 1 to 5 (1 point indicates extremely large overshoot, and 5 points indicates no overshoot), steady-state error can be mapped to a precision level of 1 to 5 based on its absolute value, and the smoothness of the response curve can be calculated using the standard deviation of the error sequence and corresponding to a fluctuation level of 1 to 5. The quantified feature data is then divided into three core dimensions: dynamic response efficiency (including rise time and peak time scores), control accuracy (including overshoot and steady-state error scores), and response stability (including response curve scores). Each dimension is assigned a corresponding weight (set according to actual control requirements; for example, in a precision control scenario, the control accuracy weight is 0.4, and the dynamic response efficiency and stability weights are each 0.3). Based on the above quantitative scoring system, the problem type of the control system can be determined by analyzing the score combination of the three core dimensions: if the dynamic response efficiency score is low while other dimensions perform well, the core problem of the system is slow response; if the overshoot and steady-state error scores in the control accuracy dimension are both low, it is judged as control misalignment, manifested as severe oscillations or significant steady-state error; if the response stability score is low, it points to a problem of deteriorated stability, characterized by severe jitter in the response curve; and when the scores of all three dimensions are generally poor, it is diagnosed as comprehensive misalignment.
[0038] Step S2032: Based on the problem type, select PID parameter tuning algorithms. The PID parameter tuning algorithms should include at least one of particle swarm optimization, sparrow search algorithm, and gray wolf optimization.
[0039] Based on the identified problem type and combined with quantitative indicators in the feature data (such as dynamic response efficiency dimension, rise / peak time, etc.), PID parameter tuning algorithms are selected. PID parameter tuning algorithms can include one or more of the following algorithms: particle swarm optimization, sparrow search algorithm, and gray wolf optimization.
[0040] In one example, when the dynamic response efficiency score is significantly low, or when the coupling is strong, the system preferentially selects the Gray Wolf optimization algorithm, which has fast convergence characteristics. This algorithm simulates the social hierarchy of a wolf pack. Wolves guide the search direction of the swarm, and their unique encirclement-hunting mechanism can quickly lock onto the optimal parameter region. In a specific implementation, when the algorithm presets the search range of the Kp parameter to 1.5-2 times the normal value and sets a high convergence accuracy threshold, it can significantly improve the system response speed by enhancing the proportional effect. For cases with significant overshoot or steady-state error, the system adopts the sparrow search algorithm. In the global search implementation of the sparrow search algorithm, the discoverer-follower mechanism in the sparrow search algorithm will deeply explore the potential optimal solution region discovered by the particle swarm, especially fine-tuning the Ki parameter to eliminate steady-state error, while effectively suppressing overshoot through the cooperative optimization of the Kd parameter. Faced with complex situations with multiple dimensions of anomalies simultaneously, the system can select multiple algorithms. For example, with the problems of "slow response + high computational cost constraints", the gray wolf optimization can be given priority, because its social hierarchical guidance mechanism can usually improve the response speed faster than the particle swarm algorithm with fewer iterations. Sparrow search algorithm can be considered as a candidate, although it has stronger exploration capabilities. However, its complex "discoverer-follower-watcher" mechanism may incur additional overhead when computational resources are limited. In this case, the system will simultaneously select the gray wolf optimization algorithm and the sparrow search algorithm. The selected algorithm is the PID parameter tuning algorithm.
[0041] Step S204: The initial PID parameters are tuned using a PID parameter tuning algorithm. For details, please refer to [link to relevant documentation]. Figure 1 Step S104 of the illustrated embodiment will not be described again here.
[0042] This embodiment provides a PID control parameter tuning method that, through in-depth analysis of characteristic data and precise determination of the problem type of the control system, achieves qualitative diagnosis of system performance bottlenecks, transforming traditional blind parameter optimization into targeted problem solving. Based on this, it intelligently selects the most suitable tuning algorithm from various advanced algorithms (such as particle swarm optimization, sparrow search algorithm, and gray wolf optimization) according to the problem type, achieving adaptive matching between optimization tools and problem characteristics. This greatly avoids the blindness of the optimization process and solves the problems of slow convergence, low accuracy, or easy getting trapped in local optima when a single algorithm faces different dynamic characteristics. It significantly improves tuning efficiency and quality. Through targeted algorithm selection, it ensures that fast-response problems are handled by algorithms with rapid convergence, while complex instability problems are handled by algorithms with stronger global search capabilities, thereby obtaining high-quality PID parameters with excellent stability, speed, and accuracy in a shorter iteration cycle. Ultimately, this method elevates PID tuning from an "experience-based skill" to a highly efficient, reliable, and self-decision-making systematic solution.
[0043] This embodiment provides a PID control parameter tuning method, which can be used in the aforementioned computer equipment. Figure 3This is a flowchart of a PID control parameter tuning method according to an embodiment of the present invention, such as... Figure 3 As shown, the process includes the following steps: Step S301: Set the initial PID parameters for the control system and control the operation of the controlled object through the control system.
[0044] Step S302: Collect the operating data of the controlled object and extract features from the operating data to obtain feature data. For details, please refer to [link to relevant documentation]. Figure 2 Step S202 of the illustrated embodiment will not be described again here.
[0045] Step S303: Determine the PID parameter tuning algorithm from several objective optimization algorithms based on the feature data. For details, please refer to [link to relevant documentation]. Figure 2 Step S203 of the illustrated embodiment will not be described again here.
[0046] Step S304: The initial PID parameters are tuned using a PID parameter tuning algorithm.
[0047] Specifically, step S304 includes: Step S3041: When the PID parameter tuning algorithm includes a target optimization algorithm, the initial PID parameters are tuned using the PID parameter tuning algorithm.
[0048] Specifically, when the PID parameter tuning algorithm includes only one target optimization algorithm, the system will initiate a directional single-algorithm optimization process. This process uses the initial PID parameters as the starting point and systematically searches for optimization within the parameter space using a preset optimization algorithm (such as particle swarm optimization). The algorithm continuously evaluates the control effect of the new parameter set through an iterative mechanism: each iteration directly applies the newly generated Kp, Ki, and Kd parameter set to the actual controlled object and collects the corresponding system response data. Based on the above data, a fitness value (such as the comprehensive ITAE index) is calculated. The algorithm automatically adjusts the parameter search direction and step size according to its inherent search strategy (such as the position update rule of particle swarm optimization), allowing the parameter combination to continuously evolve along the performance improvement trajectory. The entire process continues until the convergence condition is met (such as the fitness improvement rate being lower than a threshold or reaching the maximum number of iterations), and finally outputs the optimal PID parameters obtained by the algorithm, achieving a precise transformation from initial parameters to optimized parameters.
[0049] Step S3042: When the PID parameter tuning algorithm includes multiple target optimization algorithms, the multiple target optimization algorithms are compared and tested through a simulation model, and the first algorithm is selected based on the test results.
[0050] Specifically, the process first constructs a high-fidelity simulation model (e.g., rapidly building a simulation model in an environment like MATLAB / Simulink for performance comparison testing) to accurately reproduce the dynamic characteristics of the controlled object, establishing a unified testing environment for all algorithms involved in the comparison. By designing a lightweight parallel testing framework, multiple algorithms are run simultaneously within a limited number of iterations, quickly evaluating the initial performance and potential of each algorithm while significantly reducing computational overhead. During testing, the system monitors key performance indicators in real time, including convergence speed, solution quality, and search stability, among other multi-dimensional data. Finally, based on the core contradictions of the current problem, a comprehensive decision is made. For example, given the constraints of slow response and high computational overhead, the system will focus on verifying the efficiency improvement of the Grey Wolf optimization algorithm under resource-constrained environments. Simultaneously, using the optimization potential of the Sparrow Search algorithm as a performance benchmark, comparative analysis is used to select the algorithm that achieves the best balance between efficiency and performance as the primary execution entity for subsequent tuning.
[0051] In one example, the control system was diagnosed as having slow response and limited computational resources, prompting a multi-algorithm comparative testing process. The system first built an accurate simulation model, then ran the Gray Wolf Optimization Algorithm and the Sparrow Search Algorithm in parallel within a lightweight testing framework. The Gray Wolf Optimization Algorithm, with its social hierarchical search mechanism, rapidly improved the system's response speed within a limited number of iterations, shortening the heating time. The Sparrow Search Algorithm, through its discoverer-follower mechanism, demonstrated superior depth exploration capabilities; although computational overhead increased, it achieved a more stable temperature curve. After comprehensive evaluation, the system ultimately selected the Gray Wolf Optimization Algorithm, which prioritized efficiency, as the primary algorithm, as it met real-time requirements while achieving core performance indicators.
[0052] Step S3043: The initial PID parameters are tuned using the first algorithm to confirm the first PID parameters.
[0053] Specifically, the initial parameters in this invention are used as the starting point of the first algorithm. Based on the inherent characteristics of the algorithm, such as setting the population size for the gray wolf optimization algorithm or configuring the proportion of early warning systems for the sparrow search algorithm, sufficient parameter configuration is performed. This configuration employs stricter settings than the lightweight testing phase (e.g., significantly increasing the number of iterations and the convergence accuracy threshold) to ensure the algorithm achieves full convergence in a real environment. Subsequently, the first algorithm initiates its complete optimization process on a real control system. Leveraging its proven effectiveness for the current problem in previous verifications, the algorithm focuses on discovering optimal control performance. By performing a more thorough and refined search across the entire parameter space, it continuously generates and verifies new parameter combinations, gradually approaching the global optimum. When a strict convergence condition is met (e.g., the continuous iterative improvement of the fitness function is less than a set threshold), the algorithm automatically terminates, and its output optimal PID parameter combination is formally confirmed as the first PID parameters.
[0054] In some optional implementations, after step S3043, the method further includes: Step a1: Using the first PID parameter as the new initial PID parameter, return the steps of collecting the running data of the controlled object and extracting features from the running data.
[0055] Step a2: When the new feature data meets the preset stability conditions, stop tuning the initial PID parameters through the PID parameter tuning algorithm and maintain the first PID parameter.
[0056] Step a3: When the new feature data does not meet the preset stability conditions, return to the step of determining the PID parameter tuning algorithm from several objective optimization algorithms based on the feature data.
[0057] Specifically, the overall process of this invention is as follows: Figure 4 As shown, firstly, the optimal PID parameters obtained from the previous optimization are used to drive the controlled object into a new round of operation. During this stage, the data acquisition system starts, continuously recording the dynamic response data of the controlled object, the controller output signal, and the parameter change curves during the algorithm iteration process. The feature extraction module processes the fresh operating data in real time, generating an updated feature dataset containing dimensions such as response speed, overshoot characteristics, and steady-state accuracy.
[0058] Then, when the updated feature data meets the preset stability conditions, including but not limited to the overshoot being consistently below the threshold, the adjustment time reaching the standard range, and the steady-state error remaining within the specified tolerance band, and the above indicators remaining stable over multiple consecutive sampling cycles, the system determines that the current PID parameter has reached the expected control target, and then terminates the parameter tuning cycle, locking the first PID parameter as the final working parameter.
[0059] If the updated feature data fails to meet the preset stability conditions, manifested as key indicators falling outside the standard range, periodic oscillations occurring, or the core problem of the control system remaining unresolved, the system will continue to activate the algorithm decision-making process. At this point, the system will again execute the problem type diagnosis and algorithm matching logic based on the latest feature data, dynamically selecting a new optimization algorithm for subsequent tuning based on the current system performance.
[0060] These three steps together constitute an adaptive parameter tuning mechanism. Through a cyclical structure of parameter deployment, performance evaluation, and decision feedback, the system can not only verify the actual effect of the tuned parameters, but also initiate a re-optimization process when control performance fails to meet standards. It can combine the advantages of different algorithms to form a continuously improving parameter optimization system.
[0061] In some alternative implementations, after step a3 above, the method further includes: Step b1: Check the performance of the control system at a preset cycle. The performance of the control system includes at least one of the following: changes in operating conditions and drift in system characteristics.
[0062] Step b2: When the performance of the control system changes, continue to return to the step of collecting the operating dataset of the controlled object and the output data of the control system.
[0063] Specifically, this invention establishes a periodic performance monitoring mechanism that automatically performs a comprehensive health status assessment of the control system at fixed time intervals (e.g., every 24 hours or after each production batch). This assessment covers two key dimensions: first, monitoring of operating condition changes, including setpoint adjustment frequency analysis, load fluctuation statistics, and recording of environmental parameter (temperature, humidity, etc.) change trends; second, detecting system characteristic drift by analyzing historical data of characteristic parameters of the step response (e.g., rise time, overshoot, settling time) to establish a baseline for the system's dynamic characteristics. During monitoring, the system uses a sliding window algorithm to perform correlation analysis between real-time operating data and historical baseline data. When a characteristic parameter deviates from the normal range beyond a preset threshold, a performance change flag is triggered.
[0064] When the performance monitoring system issues a change alarm, the system immediately initiates the adaptive tuning process for the PID parameters. First, the data acquisition module synchronously records the output response of the controlled object and the output signal of the controller at a higher sampling frequency to ensure complete capture of the dynamic process. Simultaneously, the system automatically adjusts its acquisition strategy based on the type of performance change. For changes in operating conditions, it focuses on acquiring the dynamic response of the setpoint tracking process; for system characteristic drift, it emphasizes recording the recovery characteristics of the disturbance suppression process. After preprocessing and feature extraction, the newly acquired dataset updates the system's performance benchmark. The system uses this freshly acquired real-time data to perform online calibration and updates of the internal parameters of the digital twin model. This process is implemented through a system identification algorithm, aiming to minimize the error between the digital twin model output and the real system response, thereby ensuring that the virtual model can faithfully reproduce the current dynamic behavior of the physical entity and solve model mismatch problems caused by equipment aging, environmental changes, or component wear. After the digital twin model completes its synchronous update, the system then retunes the PID parameters based on this new model. The tuning system will invoke previously validated optimization algorithms (or re-select algorithms), but this time the search will no longer start from historical parameters, but from new initial values calculated based on the characteristics of the new model. The optimization algorithm will perform a rapid and safe simulation search within the updated digital twin model, which accurately represents the system's "current health status," to find the optimal combination of PID parameters suitable for the current operating conditions. The entire process employs a gradual switching strategy to ensure a smooth transition of the control system during retuning.
[0065] Periodic performance monitoring enables early detection of system characteristic degradation, preventing gradual deterioration of control performance and achieving predictive maintenance. Targeted data acquisition strategies ensure the efficiency of the retuning process, requiring only the necessary data under critical operating conditions, significantly reducing system interference time and the frequency of manual intervention. This intelligent tuning system is particularly suitable for long-term, complex industrial processes, effectively solving the problem of control performance degradation caused by equipment aging and load changes, ensuring continuous stability of production quality. This design achieves closed-loop autonomous control system performance maintenance, bringing significant technical advantages.
[0066] In some optional implementations, step S3023 above further includes: Step c1: Tuning is performed using a progressive parameter update strategy.
[0067] When using an incremental parameter update strategy for PID parameter tuning, the core is to break down the parameter optimization process into multiple progressive stages. Each stage focuses on improving a specific performance indicator, achieving a steady improvement in system performance through small parameter adjustments. Specifically, firstly, based on initial parameters and baseline test results, the first optimization objective (e.g., prioritizing the reduction of overshoot) is determined. A selected tuning algorithm is then used to search within a small parameter space (e.g., ±10% of the initial P value) to obtain a set of intermediate parameters that significantly improve overshoot. These parameters are then substituted into the system and their stability is verified. Once the overshoot problem is controlled, the second stage begins, aiming to shorten the settling time. The search range is expanded (e.g., ±20%) based on the parameters from the first stage, and the algorithm continues to optimize and verify the results. Subsequent stages progressively widen the parameter adjustment range, targeting indicators such as steady-state error and anti-interference capability, until all performance indicators meet expectations. Parameter updates at each stage are based on the current stable state of the system, avoiding drastic system fluctuations caused by sudden parameter changes, and ensuring the safety and controllability of the tuning process.
[0068] The core advantage of this strategy lies in balancing optimization efficiency and system stability. By focusing on specific indicators in stages, it avoids mutual interference from parameter adjustments in multi-objective optimization, making the optimization objectives of each stage clearer, the algorithm more targeted, and significantly improving the accuracy of parameter tuning. Small-amplitude, progressive parameter updates effectively prevent the system from oscillating or becoming unstable due to sudden parameter changes, making it particularly suitable for industrial control scenarios with high safety requirements (such as high-temperature furnaces and pressure vessels), reducing the risks during the tuning process. Simultaneously, the verification results at each stage provide real-time feedback for subsequent optimization, facilitating timely correction of the search direction, reducing ineffective iterations, and ultimately achieving global optimization of PID parameters in a more robust manner, balancing the system's dynamic response speed and steady-state control accuracy.
[0069] This embodiment provides a PID control parameter tuning method. When the system has already clearly matched a single optimal algorithm, this step bypasses unnecessary algorithm comparison steps and directly calls that algorithm to centrally optimize the initial parameters. This not only significantly saves computational resources and tuning time but also avoids the decision-making complexity that may arise from parallel processing of multiple algorithms. When the system selects multiple algorithms, a competition mechanism ensures the scientific nature and robustness of the algorithm selection. When facing complex or multi-objective conflicting control problems, this step introduces a simulation model as a "test platform" to conduct fair performance comparison tests on multiple candidate algorithms. This process elevates algorithm selection from "empirical judgment" to "data-driven decision-making," using objective test results (such as convergence curves and stability indicators) to select the "first algorithm" with the best overall performance, thus providing the optimal tool for subsequent tuning and fundamentally guaranteeing the upper limit of the final parameter quality.
[0070] This embodiment also provides a PID control parameter tuning device, which is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0071] This embodiment provides a PID control parameter tuning device, such as... Figure 5 As shown, it includes: The data acquisition module 501 is used to set the initial PID parameters for the control system and to acquire the output data of the control system. Feature extraction module 502 is used to extract features based on output data to obtain feature data; The algorithm determination module 503 is used to tune the initial PID parameters using a PID parameter tuning algorithm; The PID parameter tuning module 504 is used to tune the initial PID parameters using a PID parameter tuning algorithm.
[0072] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.
[0073] The PID control parameter tuning device provided in this embodiment of the invention can execute a PID control parameter tuning method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method. Further functional descriptions of the above modules and units are the same as in the corresponding embodiments described above, and will not be repeated here.
[0074] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention.
[0075] The following is a detailed reference. Figure 6 This diagram illustrates a suitable structural design for implementing an electronic device according to embodiments of the present invention. The electronic device may include a processor (e.g., a central processing unit, graphics processor, etc.) 601, which can perform various appropriate actions and processes based on a program stored in read-only memory (ROM) 602 or a program loaded from memory 608 into random access memory (RAM) 603. RAM 603 also stores various programs and data required for the operation of the electronic device. The processor 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0076] Typically, the following devices can be connected to I / O interface 605: input devices 606 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 607 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; memory devices 608 including, for example, magnetic tapes, hard disks, etc.; and communication devices 609. Communication device 609 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 6 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown, and more or fewer devices may be implemented or have instead.
[0077] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 609, or installed from a memory 608, or installed from a ROM 602. When the computer program is executed by the processor 601, it performs the functions defined in a PID control parameter tuning method according to embodiments of the present invention.
[0078] Figure 6 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.
[0079] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, a PID control parameter tuning method shown in the above embodiments is implemented.
[0080] A portion of this invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the invention through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.
[0081] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A PID control parameter tuning method, characterized in that, The method comprises: setting initial PID parameters for a control system and controlling a controlled object to run through the control system; collecting running data of the controlled object and performing feature extraction on the running data to obtain feature data; determining a PID parameter tuning algorithm from a plurality of target optimization algorithms according to the feature data; tuning the initial PID parameters through the PID parameter tuning algorithm.
2. The method of claim 1, wherein, The determination of the PID parameter tuning algorithm from the plurality of target optimization algorithms according to the feature data comprises: judging a problem type according to the feature data, the problem type being used to represent a problem of the control system; selecting a PID parameter tuning algorithm according to the problem type, the PID parameter tuning algorithm at least including one of particle swarm optimization, sparrow search algorithm and grey wolf optimization.
3. The method according to claim 1 or 2, characterized in that, The tuning of the initial PID parameters through the PID parameter tuning algorithm comprises: when the PID parameter tuning algorithm includes one target optimization algorithm, tuning the initial PID parameters through the PID parameter tuning algorithm; when the PID parameter tuning algorithm includes a plurality of target optimization algorithms, comparing and testing the plurality of target optimization algorithms through a simulation model, and selecting a first algorithm according to a test result; tuning the initial PID parameters through the first algorithm to obtain first PID parameters.
4. The method of claim 3, wherein, After the tuning of the initial PID parameters through the PID parameter tuning algorithm, the method further comprises: using the first PID parameters as new initial PID parameters, and returning to perform the steps of collecting the running data of the controlled object and performing feature extraction on the running data; when new feature data meets a preset stable condition, stopping the tuning of the initial PID parameters through the PID parameter tuning algorithm, and keeping the first PID parameters; when the new feature data does not meet the preset stable condition, returning to perform the step of determining the PID parameter tuning algorithm from the plurality of target optimization algorithms according to the feature data.
5. The method of claim 3, wherein, The tuning of the initial PID parameters further comprises: adopting a progressive parameter updating strategy for tuning.
6. The method of claim 4, wherein, After the stopping of the tuning of the initial PID parameters through the PID parameter tuning algorithm and the keeping of the first PID parameters when the new feature data meets the preset stable condition, the method further comprises: checking a performance of the control system at a preset period, the performance of the control system at least including one of working condition change and system characteristic drift; when the performance of the control system changes, returning to perform the step of collecting the running data of the controlled object.
7. A PID control parameter tuning device, characterized by, The device comprises: a data collection module configured to set initial PID parameters for a control system and collect output data of the control system; a feature extraction module configured to perform feature extraction based on the output data to obtain feature data; an algorithm determination module configured to determine a PID parameter tuning algorithm from a plurality of target optimization algorithms according to the feature data; and a parameter tuning module configured to tune the initial PID parameters through the PID parameter tuning algorithm. The PID parameter setting module is configured to set the initial PID parameters by using the PID parameter setting algorithm.
8. An electronic device, comprising: The method comprises the following steps: The memory and the processor are connected in communication with each other, and the memory stores computer instructions.
9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer instructions for causing a computer to execute the PID control parameter setting method according to any one of claims 1 to 6.
10. A computer program product, characterised in that, The computer readable storage medium stores computer instructions for causing a computer to execute the PID control parameter setting method according to any one of claims 1 to 6. The computer readable storage medium stores computer instructions for causing a computer to execute the PID control parameter setting method according to any one of claims 1 to 6.
Citation Information
Cited By
Standard man-hour dynamic self-tuning method based on PID (Proportion Integration Differentiation) algorithm
CN122085647A