Method and device for realizing PI-IP regulator switching, processor and computer readable storage medium thereof
By calculating the error, proportional and integral terms, the PI and IP regulators are switched smoothly, solving the vibration problem caused by regulator switching in the servo drive and achieving stable control.
Patent Information
- Application Number
- CN202511911096.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-17
- Publication Date
- 2026-03-10
AI Technical Summary
In servo drive control, directly switching between PI and IP regulators can easily cause system vibration and affect the control effect.
By calculating the error term, proportional term, and integral term, the PI controller and IP controller are smoothly switched. This includes calculating the error, the proportional and integral term outputs of the PI and IP controllers, and correcting the integral term to achieve smooth switching.
Smooth switching of the PI-IP controller is achieved, avoiding system vibration and shock, and ensuring the stability of the control process.
Smart Images

Figure CN121634794A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of industrial control technology, in particular to the field of PI regulator, and more particularly to a method, device, processor and computer readable storage medium for implementing PI-IP regulator switching. BACKGROUND
[0002] PI regulator, namely proportional integral regulator, is a control device that forms control deviation according to given value and actual output value, and forms control amount through linear combination of proportion and integral of the deviation to control the controlled object. PI regulation does not require accurate mathematical model of the controlled object, and is easy to implement, so it is widely used in industrial control, such as current regulator and speed regulator in servo driver. PI regulator is suitable for scenarios that require fast response and need to eliminate steady-state error, but it is prone to overshoot for step input.
[0003] IP regulator, namely integral proportional regulator, enhances the anti-interference ability of the system while tracking the instruction quickly by introducing integral and proportional control strategy. Compared with the traditional PI controller, the IP regulator eliminates the overshoot phenomenon of step response, and has stronger inhibition effect on load disturbance.
[0004] In the control of servo driver, two kinds of regulators need to be switched in real time according to process requirements. If the switching is directly performed, system vibration is easily caused in the switching process, which affects the control effect. SUMMARY
[0005] The present application aims to overcome the shortcomings of the prior art, and provides a method, device, processor and computer readable storage medium for implementing PI-IP regulator switching, which is simple to operate, smooth to switch and widely applicable.
[0006] In order to achieve the above-mentioned purpose, the method, device, processor and computer readable storage medium for implementing PI-IP regulator switching of the present application are as follows: the method for implementing PI-IP regulator switching mainly comprises the following steps: (1) calculating error term; (2) calculating proportional term; (3) calculating output of integral term; (4) processing regulator integral term; (5) calculating output of regulator .
[0007] Preferably, the step (1) is specifically: The error is calculated by the difference between the instruction value Ref and the feedback value Fdb . The error is calculated according to the following formula : ; in, For instruction value, is the feedback value, and k is the discrete sampling time.
[0008] Preferably, step (2) specifically includes the following steps: (2.1) Calculate the proportional term of the PI controller; (2.2) Calculate the proportional term of the IP regulator.
[0009] Preferably, the calculation of the proportional term of the PI regulator in step (2.1) is specifically as follows: Calculate the proportional term of the PI controller using the following formula: ; in, The proportional coefficient of the regulator. This is the error.
[0010] Preferably, the calculation of the proportional term of the IP regulator in step (2.2) is specifically as follows: Calculate the proportional term of the IP regulator using the following formula: ; in, The proportional coefficient of the regulator. This is the feedback value.
[0011] Preferably, the calculation of the integral term in step (3) is specifically as follows: Calculate the output of the integral term using the following formula: The sampling time is Ts. This is the value for this sampling period. The value is from the previous sampling period, and the time interval between k and k-1 is Ts. , is the integration time constant.
[0012] Preferably, step (4) specifically includes the following steps: If switching from a PI controller to an IP controller, the integral term is corrected; If switching from an IP regulator to a PI regulator, the integral term is corrected; If there is no regulator switching, then the integral term It remains unchanged.
[0013] Preferably, step (5) specifically includes the following steps: If the current controller is a PI controller, then specifically: Calculate the regulator output using the following formula. : in, For the proportional term of the PI controller, This is the output of the integral term; If the current modem is an IP modem, then the specific steps are as follows: Calculate the regulator output using the following formula. : in, For the proportional term of the IP regulator, This is the output of the integral term.
[0014] The main feature of this device for switching PI-IP regulators is that the device comprises: A processor is configured to execute computer-executable instructions; The memory stores one or more computer-executable instructions that, when executed by the processor, implement the steps of the method for switching the PI-IP regulator as described above.
[0015] The processor that implements PI-IP regulator switching is characterized in that the processor is configured to execute computer-executable instructions, which, when executed by the processor, implement the various steps of the above-described method for implementing PI-IP regulator switching.
[0016] The main feature of this computer-readable storage medium is that it stores a computer program thereon, which can be executed by a processor to implement the various steps of the above-described method for switching the PI-IP regulator.
[0017] The present invention employs the method, apparatus, processor, and computer-readable storage medium for switching PI-IP controllers, enabling real-time switching of PI-IP controllers. The switching process is smooth, without shock or vibration, and can solve the problem of smooth switching between two algorithms, preventing system vibration. Attached Figure Description
[0018] Figure 1 This is a flowchart illustrating the PI-IP regulator switching method of the present invention.
[0019] Figure 2 This is a control block diagram of the PI controller for the method of switching PI-IP controller according to the present invention.
[0020] Figure 3 This is a control block diagram of the IP regulator in the method for implementing PI-IP regulator switching according to the present invention. Detailed Implementation
[0021] To more clearly describe the technical content of the present invention, the following description is provided in conjunction with specific embodiments.
[0022] The method for switching a PI-IP regulator according to the present invention includes the following steps: (1) Calculate the error term; (2) Calculate the ratio; (3) Calculate the output of the integral term; (4) Process the integral term of the regulator; (5) Calculate the output of the regulator .
[0023] In a preferred embodiment of the present invention, step (1) specifically comprises: The error is calculated by the difference between the instruction value Ref and the feedback value Fdb. ; The error is calculated using the following formula. : ; in, For instruction value, The feedback value is k, which refers to the discrete sampling time.
[0024] In a preferred embodiment of the present invention, step (2) specifically includes the following steps: (2.1) Calculate the proportional term of the PI controller; (2.2) Calculate the proportional term of the IP regulator.
[0025] In a preferred embodiment of the present invention, the calculation of the proportional term of the PI regulator in step (2.1) specifically involves: Calculate the proportional term of the PI controller using the following formula: ; in, The proportional coefficient of the regulator. This is the error.
[0026] In a preferred embodiment of the present invention, the calculation of the proportional term of the IP regulator in step (2.2) specifically involves: Calculate the proportional term of the IP regulator using the following formula: ; in, The proportional coefficient of the regulator. This is the feedback value.
[0027] In a preferred embodiment of the present invention, the calculation of the integral term in step (3) specifically includes: Calculate the output of the integral term using the following formula: The sampling time is Ts. This represents the value for the current sampling period. It is the value of the previous sampling period, and the time interval between k and k-1 is Ts. , is the integration time constant.
[0028] In a preferred embodiment of the present invention, step (4) specifically includes the following steps: If switching from a PI controller to an IP controller, the integral term is corrected; If switching from an IP regulator to a PI regulator, the integral term is corrected; If there is no regulator switching, then the integral term It remains unchanged.
[0029] In a preferred embodiment of the present invention, step (5) specifically includes the following steps: If the current controller is a PI controller, then specifically: Calculate the regulator output using the following formula. : in, For the proportional term of the PI controller, This is the output of the integral term; if the current controller is an IP controller, then specifically: the controller output is calculated according to the following formula. : in, For the proportional term of the IP regulator, This is the output of the integral term.
[0030] The apparatus for implementing PI-IP regulator switching according to the present invention, wherein the apparatus includes: A processor is configured to execute computer-executable instructions; The memory stores one or more computer-executable instructions that, when executed by the processor, implement the steps of the method for switching the PI-IP regulator as described above.
[0031] The processor of the present invention for implementing PI-IP regulator switching is configured to execute computer-executable instructions, which, when executed by the processor, implement the various steps of the above-described method for implementing PI-IP regulator switching.
[0032] The computer-readable storage medium of the present invention stores a computer program thereon, which can be executed by a processor to implement the various steps of the above-described method for implementing PI-IP regulator switching.
[0033] Figure 1 The flowchart shows the switching process for the PI-IP controller. Figure 2 This is the control block diagram of a PI controller. Figure 3 This is a control block diagram for the IP regulator. In the speed loop control of a servo drive, it is usually necessary to switch the speed regulator to a PI or IP regulator in real time according to the process requirements to meet the machining effect requirements.
[0034] In a specific embodiment of the present invention, the following measures are taken to achieve the following: Step 1: Calculate the error term; Step 2: Calculate the ratio; Step 3: Calculate the integral term; Step 4: Regulator integral term processing; Step 5: Calculate the regulator's output.
[0035] The specific method for step 1 is as follows: The error is obtained by the difference between the instruction value Ref and the feedback value Fdb. .
[0036] .
[0037] Where k refers to the discrete sampling time.
[0038] The specific method for step 2 is as follows: Calculate the proportional term of the PI controller: .
[0039] in This is the proportional coefficient of the regulator.
[0040] Calculate the proportional term of the IP regulator: .
[0041] The specific method for step 3 is as follows: Calculate the output of the integral term: The sampling time is Ts. This represents the value for the current sampling period. It is the value of the previous sampling period, and the time interval between k and k-1 is Ts. , is the integration time constant.
[0042] The specific method for step 4 is as follows: At any given moment, if switching from a PI controller to an IP controller, the integral term is corrected as follows: At any given moment, if switching from an IP controller to a PI controller, the integral term is corrected as follows: At any given time, if no regulator switch occurs, the integral term... It remains unchanged.
[0043] The specific method for step 5 is as follows: Calculate the output of the regulator : If the current controller is a PI controller: If the current modem is an IP regulator: Before and after the regulator switch, the regulator output This remains unchanged, thus ensuring smooth switching of the PI-IP regulator.
[0044] Before and after PI-IP regulator switching, the regulator output The PI-IP regulator remains unchanged, ensuring smooth switching. In actual servo drive motion control, the output torque remains stable before and after the PI-IP regulator switches, without any abnormal fluctuations.
[0045] In this invention, both the PI and IP regulators act on the speed loop of the servo driver. In speed control mode, the PI regulator has high dynamic effect but large overshoot, while the IP regulator has slow dynamic response but small overshoot.
[0046] In position mode, the PI controller responds quickly to speed commands but has a long positioning time. Conversely, the IP controller has a short positioning time and is more suitable for high-speed positioning. During machine tool processing, the two control modes are switched according to the requirements of the machining process.
[0047] Kp and Ki can be manually adjusted based on experience, or obtained using the self-tuning function of the servo controller. This invention only switches the PI and IP controllers, which share a single set of Kp and Ki parameters, which are not switched.
[0048] The value of Kp ranges from 0.1 to 3276.7 Hz, and Ki = Kp / Ti, with the value of Ti ranging from 0.1 ms to 1000 ms.
[0049] This invention maintains either position or speed control mode, switches between speed regulator algorithms, and the switching methods are different. Moreover, the switching can be completed within one control cycle without waiting.
[0050] For the specific implementation scheme of this embodiment, please refer to the relevant descriptions in the above embodiments, which will not be repeated here.
[0051] It is understood that the same or similar parts in the above embodiments can be referred to each other, and the contents not described in detail in some embodiments can be referred to the same or similar contents in other embodiments.
[0052] It should be noted that in the description of this invention, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. Furthermore, in the description of this invention, unless otherwise stated, "a plurality of" means at least two.
[0053] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of the preferred embodiments of the invention includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as will be understood by those skilled in the art to which embodiments of the invention pertain.
[0054] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution device. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0055] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The corresponding program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiments.
[0056] Furthermore, the functional units in the various embodiments of the present invention can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.
[0057] The storage media mentioned above can be read-only memory, disk, or optical disk, etc.
[0058] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0059] The present invention employs the method, apparatus, processor, and computer-readable storage medium for switching PI-IP controllers, enabling real-time switching of PI-IP controllers. The switching process is smooth, without shock or vibration, and can solve the problem of smooth switching between two algorithms, preventing system vibration.
[0060] In this specification, the invention has been described with reference to specific embodiments thereof. However, it will be apparent that various modifications and variations can be made without departing from the spirit and scope of the invention. Therefore, the specification and drawings should be considered illustrative rather than restrictive.
Claims
1. A method of implementing PI-IP regulator switching, the method comprising: The method comprises the following steps: (1) calculating an error term; (2) calculating a proportional term; (3) calculating an output of an integral term; (4) processing a regulator integral term; (5) calculating the output of the regulator .
2. The method of claim 1, wherein, The step (1) is specifically: The error is calculated by the difference between the command value Ref and the feedback value Fdb ; The error is calculated according to the following formula : ; wherein is the instruction value, is the feedback value, k is the discrete sampling instant.
3. The method of enabling PI-IP regulator switching of claim 1, wherein, The step (2) specifically comprises the following steps: (2.1) calculating a proportional term of a PI regulator; (2.2) calculating a proportional term of an IP regulator.
4. The method of claim 3, wherein, The step (2.1) of calculating the proportional term of the PI regulator is specifically: The proportional term of the PI regulator is calculated according to the following formula: ; wherein, is the proportional coefficient of the regulator, is the error.
5. The method of enabling PI-IP regulator switching according to claim 3, wherein, The step (2.2) of calculating the proportional term of the IP regulator is specifically: The proportional term of the IP regulator is calculated according to the following formula: ; wherein, is the proportional coefficient of the regulator, is the feedback value.
6. The method of enabling PI-IP regulator switching of claim 1, wherein, The step (3) of calculating the output of the integral term is specifically: The output of the integral term is calculated according to the following formula: where Ts is the sampling time, is the value for the current sampling period, is the value for the previous sampling period, the interval between k and k-1 is Ts, , is the integration time constant.
7. The method of enabling PI-IP regulator switching of claim 1, wherein, The step (4) specifically comprises the following steps: If switching from the PI regulator to the IP regulator, correcting the integral term; If switching from the IP regulator to the PI regulator, correcting the integral term; If there is no regulator switch, the integral term remains unchanged.
8. The method of enabling PI-IP regulator switching of claim 1, wherein, The step (5) specifically comprises the following steps: If the current is the PI regulator, it is specifically: The output of the regulator is calculated according to the following equation : wherein, is a proportional term of the PI regulator, is an output of the integral term. If the current is the IP regulator, it is specifically: The output of the regulator is calculated according to the following equation : wherein, is the proportional term of the IP regulator, is the output of the integral term.
9. An apparatus for implementing PI-IP regulator switching, the apparatus comprising: The device comprises: a processor configured to execute computer executable instructions; a memory storing one or more computer executable instructions, which, when executed by the processor, implement each step of the method for implementing PI-IP regulator switching according to any one of claims 1 to 8.
10. A processor that implements PI-IP regulator switching, the processor comprising: The processor is configured to execute computer executable instructions, which, when executed by the processor, implement each step of the method for implementing PI-IP regulator switching according to any one of claims 1 to 8.
11. A computer readable storage medium, characterized in that, A computer program is stored thereon, which can be executed by a processor to implement each step of the method for implementing PI-IP regulator switching according to any one of claims 1 to 8.