Control method based on variable parameter PID algorithm, control method and electronic device

CN122962927APending Publication Date: 2026-10-23DONGGUAN OSENLONG TECH DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510512994.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-23
Publication Date
2026-10-23

AI Technical Summary

Technical Problem

[0002]传统按摩设备所采用的控制算法,存在对按摩件(如按摩球、按摩头等)的位置跟踪速度慢、压力超调严重、安全保护不足等问题,难以兼顾响应速度与稳定性

Benefits of technology

[0031]本发明技术方案具有以下优点,在使用按摩设备时,通过本申请的基于变参数PID算法的控制方法控制按摩设备的按摩件,获取按摩件的实际位置,并计算与按摩件期望位置的位置偏差,然后基于位置偏差,采用变参数PID算法生成压力设定值,并计算与实际压力反馈值的压力偏差,进而调节输出压力,从而在输出压力的作用下将按摩件带动至期望位置,采用上述方法,本申请能够更好地把握位置精度,通过变参数PID算法生成压力设定值,使得输出压力能够适应按摩件的不同运动阶段。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122962927A_ABST
    Figure CN122962927A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of massage equipment, and particularly discloses a control method based on a variable parameter PID algorithm, the control method, electronic equipment and a computer readable storage medium. The control method based on the variable parameter PID algorithm comprises the following steps: acquiring an actual position of a massage piece; calculating a position deviation by taking the actual position and an expected position of the massage piece as the input; generating a pressure set value by adopting a variable parameter PID algorithm based on the position deviation; acquiring an actual pressure feedback value; calculating a pressure deviation according to the pressure set value and the actual pressure feedback value; generating a control output signal by adopting a fixed parameter PID algorithm based on the pressure deviation, and adjusting an output pressure according to the control output signal. By adopting the method, the position accuracy can be better grasped, the pressure set value is generated by adopting the variable parameter PID algorithm, and the output pressure can adapt to different movement stages of the massage piece.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical field of massage equipment, and in particular to a control method, control method and electronic equipment based on a variable parameter PID algorithm. Background Technology

[0002] Traditional massage devices employ control algorithms that suffer from slow position tracking of massage components (such as massage balls and heads), severe pressure overshoot, and insufficient safety protection, making it difficult to balance response speed and stability. Furthermore, existing technologies lack the ability to adjust dynamic parameters during motion phases, easily leading to issues such as integral saturation or uncontrolled output. Summary of the Invention

[0003] Based on this, the main objective of the present invention is to provide a control method, control method and electronic device based on a variable parameter PID algorithm, which aims to solve at least one of the above-mentioned problems.

[0004] To achieve the above objectives, the present invention provides a control method based on a variable parameter PID algorithm, comprising:

[0005] Obtain the actual position of the massage device;

[0006] The positional deviation is calculated by comparing the actual position with the desired position of the massage element;

[0007] Based on the aforementioned positional deviation, a variable-parameter PID algorithm is used to generate the pressure setpoint.

[0008] Obtain the actual pressure feedback value;

[0009] Calculate the pressure deviation based on the pressure setpoint and the actual pressure feedback value;

[0010] Based on the pressure deviation, a fixed-parameter PID algorithm is used to generate a control output signal, and the output pressure is adjusted according to the control output signal.

[0011] Optionally, the positional deviation is calculated using the following formula: epos(k) = rpos(k) - ypos(k);

[0012] Where epos(k) refers to the position deviation, rpos(k) refers to the set value of the desired position, and ypos(k) refers to the feedback value of the actual position.

[0013] The pressure setpoint is generated using the following formula: Pset(k)=Kppos(k)·epos(k)+Kipos(k)·∑(i=0-N)epos(ki)·T+Kdpos(k)·epos(k)-epos(k-1)T;

[0014] Wherein, Pset(k) is the pressure setpoint, Kppos(k)·epos(k) is the proportional term used to proportionally adjust the position deviation epos(k), Kipos(k)·∑(i=0-N)epos(ki) is the integral term used to eliminate static deviation, N is a positive integer greater than or equal to 2, T is the sampling period, and T ranges from 5 to 15 ms, and Kdpos(k)·epos(k)-epos(k-1) is the derivative term used to suppress overshoot.

[0015] Optionally, the pressure deviation is calculated using the following formula: epress(k) = Pset(k) - ypress(k);

[0016] Where epos(k) refers to the pressure deviation, rpos(k) refers to the pressure setpoint, and ypos(k) refers to the actual pressure feedback value.

[0017] The output pressure is calculated using the following formula: u(k)=Kppress·epress(k)+Kipress·∑(i=0-N)epress(ki)·T+Kdpress·epress(k)-epress(k-1)T;

[0018] Where u(k) is the control output signal, Kppress·epress(k) is the proportional term used to proportionally adjust the pressure deviation epress(k) mentioned above, Kipress·∑(i=0-N)epress(ki) is the integral term used to eliminate the static pressure deviation, N is a positive integer greater than or equal to 2, T is the sampling period, and Kdpress·epress(k)-epress(k-1) is the derivative term used to suppress pressure fluctuations.

[0019] Optionally, the control method based on the variable parameter PID algorithm further includes: clearing the integral term when the position deviation exceeds 15% of the movement range of the massage piece.

[0020] Optionally, the range of the output pressure is 0-Pmax(area), where Pmax(area) is 0.1-0.3MPa.

[0021] Optionally, the slope of the output pressure change ΔPstep ≤ 0.05 MPa / s.

[0022] To achieve the above objectives, the present invention also provides a control method, comprising:

[0023] Obtain the actual position of the massage device;

[0024] The positional deviation is calculated by comparing the actual position with the desired position of the massage element;

[0025] Based on the aforementioned positional deviation, a variable-parameter PID algorithm is used to generate the pressure setpoint.

[0026] The pressure setpoint is converted into a duty cycle signal by PWM modulation, and the output pressure is adjusted according to the duty cycle signal.

[0027] Optionally, the pressure setpoint is converted into the duty cycle signal via PWM modulation using the following formula:

[0028] duty_cycle(k)=(Pset(k) / 0.3MPa)×255;

[0029] Where duty_cycle(k) is the duty cycle, duty_cycle(k)∈[30,220], and Pset(k) is the pressure setpoint.

[0030] To achieve the above objectives, the present invention also provides an electronic device, the electronic device including a memory and a processor, the electronic device being used to execute a program stored in the memory and run the above-described method.

[0031] The technical solution of this invention has the following advantages: When using a massage device, the massage component of the massage device is controlled by the control method based on the variable parameter PID algorithm of this application. The actual position of the massage component is obtained, and the position deviation from the desired position of the massage component is calculated. Then, based on the position deviation, the pressure setpoint is generated by the variable parameter PID algorithm, and the pressure deviation from the actual pressure feedback value is calculated. The output pressure is then adjusted, so that the massage component is driven to the desired position under the action of the output pressure. By using the above method, this application can better grasp the position accuracy. By generating the pressure setpoint through the variable parameter PID algorithm, the output pressure can adapt to different movement stages of the massage component. Attached Figure Description

[0032] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the devices shown in these drawings without creative effort.

[0033] Figure 1 This is a flowchart illustrating a control method based on a variable parameter PID algorithm according to one embodiment.

[0034] Figure 2 This is a flowchart illustrating a control method according to one embodiment.

[0035] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0036] 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 a part of the embodiments of the present invention, and not all of them. 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.

[0037] It should be noted that all directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of the present invention are only used to explain the relative positional relationship and movement of the components in a specific posture (as shown in the attached figure). If the specific posture changes, the directional indication will also change accordingly. Furthermore, the descriptions involving "first," "second," etc., in the present invention are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, features defined with "first" or "second" may explicitly or implicitly include at least one of those features. Additionally, the term "and / or" throughout the text includes three solutions. Taking A and / or B as an example, it includes technical solution A, technical solution B, and a technical solution that simultaneously satisfies A and B. Furthermore, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed by the present invention.

[0038] This invention provides a control method, electronic device, and computer-readable storage medium based on a variable parameter PID algorithm for controlling the operation of massage components in massage devices, such as eye massagers, neck massagers, and back massagers.

[0039] Definition: Sampling period T refers to the time required from obtaining the actual pressure feedback value to outputting the control output signal. In this application, the output pressure is provided by output devices such as air pumps or motors, and various data or signals are received and output by the control center. In other words, the sampling period T is the time required from the control center receiving the actual pressure feedback value to sending the control output signal to the air pump or other output devices.

[0040] The following section will mainly describe the specific details of the control method based on the variable parameter PID algorithm.

[0041] like Figure 1 As shown, a control method based on a variable parameter PID algorithm includes:

[0042] S100, Obtain the actual position of the massage component;

[0043] S200 calculates the positional deviation by comparing the actual position with the desired position of the massage piece;

[0044] The S300 uses a variable-parameter PID algorithm to generate pressure setpoints based on position deviation.

[0045] S400, obtains actual pressure feedback values;

[0046] S500 calculates the pressure deviation based on the pressure setpoint and the actual pressure feedback value;

[0047] The S600 uses a fixed-parameter PID algorithm to generate a control output signal based on the pressure deviation, and adjusts the output pressure according to the control output signal.

[0048] When using a massage device, the massage components of the device are controlled by the variable parameter PID algorithm control method of this application. The actual position of the massage components is obtained, and the position deviation from the desired position of the massage components is calculated. Then, based on the position deviation, a pressure setpoint is generated using the variable parameter PID algorithm, and the pressure deviation from the actual pressure feedback value is calculated. The output pressure is then adjusted, thereby driving the massage components to the desired position under the action of the output pressure. By using the above method, this application can better control the position accuracy. By generating the pressure setpoint through the variable parameter PID algorithm, the output pressure can adapt to different movement stages of the massage components.

[0049] This application employs dual closed-loop (position loop and pressure loop) control, separating position and pressure control to balance position accuracy and dynamic performance. Furthermore, the control method of this application can adjust the PID parameters according to different tissue hardness. Since different parts of the human body have different tissue hardness, when massaging areas with harder tissue, the massage force of the massage device can be increased by adjusting the PID parameters.

[0050] In this embodiment, the massage element is a massage ball. It is understood that in other embodiments, the massage element can also be any structure that can achieve massage without affecting the implementation of this technical solution, such as a massage head.

[0051] Steps S100 to S600 do not represent an absolute order of steps; they are acceptable as long as the technical solution can be achieved. For example, in this application, steps S100 and S400 can be performed simultaneously to obtain the actual position and actual pressure feedback values ​​at the same time.

[0052] In this embodiment, the position deviation is calculated using the following formula: epos(k) = rpos(k) - ypos(k); where epos(k) refers to the position deviation, rpos(k) refers to the set value of the desired position, and ypos(k) refers to the feedback value of the actual position. Specifically, the above formula belongs to the position loop. Through the position loop, this application obtains the position deviation, that is, the deviation between the current actual position and the target position.

[0053] The pressure setpoint is generated using the following formula: Pset(k)=Kppos(k)·epos(k)+Kipos(k)·∑(i=0-N)epos(ki)·T+Kdpos(k)·epos(k)-epos(k-1)T; where Pset(k) is the pressure setpoint, Kppos(k)·epos(k) is the proportional term used to proportionally adjust the position deviation epos(k), Kipos(k)·∑(i=0-N)epos(ki) is the integral term used to eliminate static deviation, N is a positive integer greater than or equal to 2, T is the sampling period, and T ranges from 5 to 15 ms, and Kdpos(k)·epos(k)-epos(k-1) is the derivative term used to suppress overshoot. Specifically, the proportional term is used to proportionally adjust the position deviation, enabling a rapid response to the position deviation. The integral term accumulates the deviation over the past N+1 sampling periods (i = 0 to N) to eliminate static deviation and ensure long-term accuracy. The derivative term is adjusted according to the rate of change of the deviation to suppress overshoot and improve system stability. In this embodiment, N is 4; in other embodiments, N can be larger or smaller.

[0054] In this embodiment, by setting pressure sensors at different locations, when the pressure sensor detects the pressure applied by the massage element, it indicates that the massage element is at the current position of the pressure sensor, thus obtaining the actual position of the massage element, so there is no need to set up an additional position sensor.

[0055] Furthermore, this method can dynamically adjust the PID parameters according to the motion state. For example, during acceleration, a high proportional and derivative term is selected to enhance fast tracking capability, while a low integral term is selected to avoid integral saturation. During deceleration, a low proportional and derivative term is selected to suppress overshoot, while a high integral term is selected to eliminate steady-state deviation.

[0056] In this embodiment, the pressure deviation is calculated using the following formula: epress(k) = Pset(k) - ypress(k); where epos(k) refers to the pressure deviation, rpos(k) refers to the pressure setpoint, and ypos(k) refers to the actual pressure feedback value. Specifically, the above formula belongs to the pressure loop. Through the pressure loop, this application obtains the pressure deviation, that is, the deviation between the current actual pressure and the target pressure.

[0057] In this embodiment, the pressure value corresponding to the output pressure adjusted according to the control output signal is expressed by the following formula: u(k)=Kppress·epress(k)+Kipress·∑(i=0-N)epress(ki)·T+Kdpress·epress(k)-epress(k-1)T; where u(k) is the control output signal, Kppress·epress(k) is the proportional term used to proportionally adjust the previous pressure deviation epress(k), Kipress·∑(i=0-N)epress(ki) is the integral term used to eliminate static pressure deviation, N is a positive integer greater than or equal to 2, T is the sampling period, and Kdpress·epress(k)-epress(k-1) is the derivative term used to suppress output pressure fluctuations. Specifically, the proportional term proportionally adjusts the current pressure deviation epress(k) to quickly respond to pressure changes, the integral term accumulates the pressure deviation of the past N+1 sampling periods to eliminate static pressure deviation, and the derivative term adjusts according to the rate of change of pressure deviation to suppress pressure fluctuations and improve control accuracy. The N here is the same as the N mentioned above, that is, N is 4 in this embodiment. In other embodiments, N can be larger or smaller.

[0058] The position loop ensures position accuracy through PID control, and the output serves as the pressure setpoint for the pressure loop. The pressure loop then adjusts the actual pressure through PID control, forming a dual closed-loop control that improves the accuracy and stability of the massage force.

[0059] Specifically, for example, the control method of this application is used to control the massage element to move back and forth between positions A and B. When the massage element moves from position A to position B, the air pump can continue to drive the massage element to move closer to position A for a preset time to avoid positional deviation due to incomplete movement of the massage element, thereby ensuring positional accuracy. For example, the preset time is 3 seconds, but it can also be set to be larger or smaller as needed. Furthermore, air pumps can be set at positions A and B respectively, so that the movement of the massage element can be controlled by controlling the start and stop of the two air pumps and the output of the two air pumps.

[0060] Furthermore, exhaust valves can be installed at positions A and B respectively. For example, initially, the air pump at position B works to move the massage element closer to position A. After the massage element reaches position A, the air pump at position B can be turned off, and exhaust can be released through the exhaust valve at position B. Then, the air pump at position A can be turned on to move the massage element closer to position B. Of course, other control methods can also be used to make the massage element move back and forth between positions A and B.

[0061] In this embodiment, the control method based on the variable parameter PID algorithm further includes: clearing the integral term when the position deviation exceeds 15% of the massage component's movement range to prevent output runaway. Specifically, if the massage component moves back and forth between positions A and B, then the distance between positions A and B is the movement range of the massage component, and the path between positions A and B can be a curve.

[0062] In this embodiment, the output pressure range is 0-Pmax(area), where Pmax(area) is 0.1-0.3MPa.

[0063] In this embodiment, the slope of the output pressure change, ΔPstep, is ≤0.05 MPa / s. Specifically, this setting avoids sudden pressure changes.

[0064] Furthermore, this method also includes fault detection, specifically by jointly judging position deviation and overpressure. When the position deviation > 20 mm and the output pressure > 0.15 MPa, emergency protection is triggered. When emergency protection is triggered, the air pump stops working, the exhaust valve releases air, and the massage device stops working until the massage components no longer move.

[0065] like Figure 2 As shown, a control method includes:

[0066] S100, Obtain the actual position of the massage component;

[0067] S200 calculates the positional deviation by comparing the actual position with the desired position of the massage piece;

[0068] The S300 uses a variable-parameter PID algorithm to generate pressure setpoints based on position deviation.

[0069] The S400 converts the pressure setpoint into a duty cycle signal through PWM modulation and adjusts the output pressure according to the duty cycle signal.

[0070] Furthermore, the pressure setpoint is converted into a duty cycle signal via PWM modulation using the following formula: duty_cycle(k) = (Pset(k) / 0.3MPa) × 255; this linearly maps the pressure setpoint to the PWM duty cycle, where duty_cycle(k) is the duty cycle and Pset(k) is the pressure setpoint. Furthermore, duty_cycle(k) ∈ [30, 220], this setting preserves a duty cycle margin and prevents over-driving of the air pump.

[0071] This method, through the aforementioned variable-parameter PID algorithm, achieved the following results in actual testing:

[0072] High position control accuracy: Specifically, the position control accuracy is within ±2mm when static and within ±5mm when dynamic.

[0073] Overshoot <5%;

[0074] The emergency braking time is short, specifically, the output pressure is released to the safe pressure within <80ms;

[0075] It consumes less energy, specifically saving more than 18% energy compared to traditional PID algorithm control methods.

[0076] This application also provides an electronic device, which includes a memory and a processor, for executing a program stored in the memory and running the above-described method.

[0077] The application also provides a computer-readable storage medium for storing a computer program for performing the above-described method.

[0078] The above are merely preferred embodiments of the present invention and do not limit the patent scope of the present invention. Any equivalent device transformations made based on the inventive concept of the present invention and the contents of the specification and drawings of the present invention, or direct / indirect applications in other related technical fields, are included within the patent protection scope of the present invention.

Claims

1. A control method based on a variable parameter PID algorithm, characterized in that, include: Obtain the actual position of the massage device; The positional deviation is calculated by comparing the actual position with the desired position of the massage element; Based on the aforementioned positional deviation, a variable-parameter PID algorithm is used to generate the pressure setpoint. Obtain the actual pressure feedback value; The pressure deviation is calculated based on the pressure setpoint and the actual pressure feedback value. Based on the pressure deviation, a fixed-parameter PID algorithm is used to generate a control output signal, and the output pressure is adjusted according to the control output signal.

2. The control method based on the variable parameter PID algorithm as described in claim 1, characterized in that, The positional deviation is calculated using the following formula: epos(k) = rpos(k) - ypos(k); Where epos(k) refers to the position deviation, rpos(k) refers to the set value of the desired position, and ypos(k) refers to the feedback value of the actual position. The pressure setpoint is generated using the following formula: Pset(k)=Kppos(k)·epos(k)+Kipos(k)·∑(i=0-N)epos(ki)·T+Kdpos(k)·epos(k)-epos(k-1)T; Wherein, Pset(k) is the pressure setpoint, Kppos(k)·epos(k) is the proportional term used to proportionally adjust the position deviation epos(k), Kipos(k)·∑(i=0-N)epos(ki) is the integral term used to eliminate static deviation, N is a positive integer greater than or equal to 2, T is the sampling period, and T ranges from 5 to 15 ms, and Kdpos(k)·epos(k)-epos(k-1) is the derivative term used to suppress overshoot.

3. The control method based on the variable parameter PID algorithm as described in claim 1, characterized in that, The pressure deviation is calculated using the following formula: epress(k) = Pset(k) - ypress(k); Where epos(k) refers to the pressure deviation, rpos(k) refers to the pressure setpoint, and ypos(k) refers to the actual pressure feedback value. The output pressure is calculated using the following formula: u(k)=Kppress·epress(k)+Kipress·∑(i=0-N)epress(ki)·T+Kdpress·epress(k)-epress(k-1)T; Where u(k) is the control output signal, Kppress·epress(k) is the proportional term used to proportionally adjust the pressure deviation epress(k) mentioned above, Kipress·∑(i=0-N)epress(ki) is the integral term used to eliminate the static pressure deviation, N is a positive integer greater than or equal to 2, T is the sampling period, and Kdpress·epress(k)-epress(k-1) is the derivative term used to suppress pressure fluctuations.

4. The control method based on the variable parameter PID algorithm as described in claim 2 or 3, characterized in that, The control method based on the variable parameter PID algorithm further includes: clearing the integral term when the position deviation exceeds 15% of the movement range of the massage piece.

5. The control method based on the variable parameter PID algorithm as described in claim 1, characterized in that, The output pressure range is 0-Pmax(area), where Pmax(area) is 0.1-0.3MPa.

6. The control method based on the variable parameter PID algorithm as described in claim 1, characterized in that, The slope of the output pressure change ΔPstep ≤ 0.05 MPa / s.

7. A control method, characterized in that, include: Obtain the actual position of the massage device; The positional deviation is calculated by comparing the actual position with the desired position of the massage element; Based on the aforementioned positional deviation, a variable-parameter PID algorithm is used to generate the pressure setpoint. The pressure setpoint is converted into a duty cycle signal by PWM modulation, and the output pressure is adjusted according to the duty cycle signal.

8. The control method as described in claim 7, characterized in that, The pressure setpoint is converted into the duty cycle signal by PWM modulation using the following formula: duty_cycle(k)=(Pset(k) / 0.3MPa)×255; Where duty_cycle(k) is the duty cycle, duty_cycle(k)∈[30,220], and Pset(k) is the pressure setpoint.

9. An electronic device, characterized in that, The electronic device includes a memory and a processor, and is configured to execute a program stored in the memory to perform the method as described in any one of claims 1-6.