Calibration-based double-ring PID (Proportion Integration Differentiation) single-motor electric lifting table control method
By calibrating the dual-loop PID control method and combining it with polynomial fitting, the control accuracy problem caused by load changes in the vertical movement of the electric lift table is solved, and high-precision desktop height adjustment is achieved, which has good engineering applicability.
Patent Information
- Application Number
- CN202510879271.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-27
- Publication Date
- 2025-09-26
AI Technical Summary
Existing electric lift table control methods have problems with inconsistent control accuracy and speed due to load changes during vertical movement, making it difficult to achieve efficient control, especially under millimeter-level movement accuracy requirements.
A calibration-based dual-loop PID control method is adopted. By calibrating the motor speed under different PWM duty cycles and combining it with polynomial fitting, the actual output PWM values in rising, falling and horizontal states are calculated to achieve precise control.
It effectively solves the control accuracy problem of electric lift tables under different load conditions, realizes high-precision desktop height adjustment, and has good engineering scalability.
Smart Images

Figure QLYQS_1 
Figure QLYQS_2 
Figure BDA0005471994180000021
Abstract
Description
Technical Field
[0001] The present invention relates to a control method for an electric lift table, and in particular to a control method for an electric lift table with a double-loop PID and a single motor based on calibration. Background Art
[0002] The existing driving method of the lifting table is to adjust the height of the lifting table by controlling the rotation of the motor to drive the transmission shaft. Since it moves in the vertical direction, it is affected by the gravity of the table itself and the load. When the same PWM duty cycle is used for rising and falling, the speed of the table movement is different. In addition, the electric lifting table requires the movement accuracy at the millimeter (mm) level, which further increases the complexity of the electric lifting table control. Summary of the Invention
[0003] Purpose of the invention: The purpose of the present invention is to propose a calibration-based dual-loop PID single-motor electric lift table control method, which can achieve high-precision control of the lift table while ensuring the versatility and scalability of the method.
[0004] Technical solution: The present invention comprises the following steps:
[0005] S1. The mobile phone or hand control panel sends a control request, issuing an instruction to adjust or move the height of the table;
[0006] S2. MCU arbitrates the received control request;
[0007] S3: The processed control request is sent to the action logic module, where algorithm-related processing is performed: first, calibration is performed, and then, based on the PWM value output by the dual-loop PID, the calibrated PWM value is combined with the speed fitting polynomial to calculate the actual output PWM value corresponding to the increase or decrease;
[0008] S4, output PWM to control the motor to perform related actions.
[0009] The S3 specifically includes:
[0010] S31. Calibrate the motor speed corresponding to different PWM values during the rise, control the lifting table according to a fixed PWM value at every duty cycle, and calculate the current motor speed based on the pulse signal fed back by the motor;
[0011] S32, calibrate the motor speed corresponding to different PWM values during descent, control the lift table according to a fixed PWM value at every duty cycle, and calculate the current motor speed based on the pulse signal fed back by the motor;
[0012] S33, calibrating the motor speed corresponding to different PWM values when the lifting table is in the horizontal state, controlling the lifting table according to a fixed PWM value at every duty cycle, and calculating the current motor speed based on the pulse signal fed back by the motor;
[0013] S34, after the MCU receives the moving target height H sent by the hand controller panel or APP target When the height of the lifting table is H cur , calculate the distance H to be moved err , and determine the direction to move Direction, H err The first-layer position loop PID is input to calculate the target speed v targect ;
[0014] S35, according to the target speed v input in the previous step targect , combined with the current motor speed v cur , calculate the speed error v err , v err Bring in the second-layer speed loop PID to calculate the target PWM value p0;
[0015] S36. Fit the above three sets of data into three linear polynomials with speed as a variable.
[0016] When calibrating the motor speed, the lifting table is controlled according to a fixed PWM value at every 10% duty cycle from 0% to 90%.
[0017] When the calibration is increased, the current motor speed is calculated as:
[0018] n up ={0,10,20,30,40,50,60,70,80,90},
[0019] v uq ={v0,v 10 ,v 20 ,v 30 ,v 40 ,v 50 ,v 60 ,v 70 ,v 80 ,v 90}.
[0020] When the calibration is lowered, the current motor speed is calculated as:
[0021] n down ={0,10,20,30,40,50,60,70,80,90},
[0022] v down ={v0,v10 ,v 20 ,v 30 ,v 40 ,v 50 ,v 60 ,v 70 ,v 80 ,v 90}.
[0023] The calibration lifting table is in a horizontal state, and the current motor speed is calculated as:
[0024] n normal ={0,10,20,30,40,50,60,70,80,90},
[0025] v normal ={v0,v 10 ,v 20 ,v 30 ,v 40 ,v 50 ,v 60 ,v 70 ,v 80 ,v 90}.
[0026] The target speed v taget The calculation formula is:
[0027]
[0028] The calculation formula of the PWM value p0 is as follows:
[0029]
[0030] The three first-order polynomials are: N0=f0(v), N1=f1(v), N2=f2(v), N0 is the polynomial fitted from the horizontal state calibration data, N1 is the polynomial fitted from the descending state calibration data, and N2 is the polynomial fitted from the ascending state calibration data.
[0031] The control PWM value p0 calculated by the second-layer speed loop PID is used as the horizontal coordinate v0 corresponding to this point. The vertical coordinate values p1 and p2 corresponding to the polynomial N1 and polynomial N2 are calculated based on this horizontal coordinate. Then, combined with the moving direction Direction, if it is a descending working condition, p1 is used as the control PWM value, and if it is an ascending working condition, p2 is used as the control PWM value.
[0032] Beneficial effects: The present invention can eliminate the problem that the PWM calculated by the dual-loop PID has different control effects due to different loads when rising and falling. After engineering testing, it can effectively solve the control problem of a single-motor lifting table; it has good engineering scalability, and its principles can be used to apply to similar problems caused by various non-directly related input quantities. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 Schematic diagram of polynomial fitted by calibration data in different states according to an embodiment of the present invention;
[0034] Figure 2 is a flow chart of the present invention;
[0035] Figure 3 This is the physical model of the lifting table of the present invention. DETAILED DESCRIPTION
[0036] The present invention will be further described below with reference to the accompanying drawings.
[0037] like Figure 2 As shown, the calibration-based dual-loop PID single-motor electric lift table control method of this embodiment includes the following steps:
[0038] S1. The mobile phone or hand control panel sends a control request, issuing an instruction to adjust or move the height of the table;
[0039] S2. MCU arbitrates the received control request;
[0040] S3: The processed control request is sent to the action logic module, where algorithm-related processing is performed;
[0041] like Figure 3As shown, the motor needs to drive two objects: the weight of the table itself, M0, and the weight of the computer or other equipment placed on the desk, M1. The input to this system is the motor's output torque, T0. After passing through the reducer, this torque is converted to T1 = kT0, where k is a proportional coefficient. The function of the reducer is to amplify the output torque at the expense of reducing the travel distance. The movement of objects is always affected by force, and the lifting table uses a DC brushed motor, which can only feedback Hall pulse signals. It is not possible to directly equate PWM with the motor output force. In addition, because the lifting table moves vertically, the force required for upward and downward movement is different. This means that the lifting table cannot be controlled simply according to the same set of calibrated PWM. Therefore, the present invention proposes a method of first calibrating the PWM value, then combining the calibrated PWM with the speed fitting polynomial based on the PWM value output by the dual-loop PID to calculate the actual output PWM value corresponding to the upward or downward movement. This eliminates the control problems caused by different movement directions. This is a universal, relatively simple to implement, and easy to adapt method.
[0042] The electric lifting table moves in the vertical direction. When the table is raised, it needs to overcome its own weight and the gravity of its load, which requires a large torque. When the table is lowered, it is also affected by its own weight and the gravity of the load, and the torque required is smaller. In addition, in actual use, the load on the table is also an unknown quantity.
[0043] Electric lift tables generally use low-cost DC brushed motors. This type of motor is controlled by current, and there is no torque or position control method. These factors combined together increase the difficulty of using current to control the motor to rotate to a specified position (a pulse signal is emitted when the motor rotates). In order to solve this problem, the present invention proposes a method of first calibrating, then performing position loop PID calculation, and outputting the target speed v target , and then set the target speed v target The target motor speed v is calculated by passing it to the speed loop PID out Finally, the actual PWM value sent is calculated by interpolation based on the calibrated reference table. The specific steps include:
[0044] S31. Calibrate the motor speed corresponding to different PWM values during the rise, and control the lifting table according to the fixed PWM value at every 10% duty cycle from 0% to 90%, and calculate the current motor speed through the pulse signal fed back by the motor to obtain the following two arrays:
[0045] n up ={0,10,20,30,40,50,60,70,80,90},
[0046] v uq ={v0,v 10,v 20 ,v 30 ,v 40 ,v 50 ,v 60 ,v 70 ,v 80 ,v 90}.
[0047] S32. Calibrate the motor speed corresponding to different PWM values when descending, and control the lifting table according to the fixed PWM value every 10% according to the duty cycle from 0% to 90%, and calculate the current motor speed through the pulse signal fed back by the motor to obtain the following two arrays
[0048] n down ={0,10,20,30,40,50,60,70,80,90},
[0049] v down ={v0,v 10 ,v 20 ,v 30 ,v 40 ,v 50 ,v 60 ,v 70 ,v 80 ,v 90}.
[0050] S33. Calibrate the motor speed corresponding to different PWM values when the lifting table is in the horizontal state. Control the lifting table according to the fixed PWM value at every 10% duty cycle from 0% to 90%, and calculate the current motor speed through the pulse signal fed back by the motor to obtain the following two arrays:
[0051] n normal ={0,10,20,30,40,50,60,70,80,90},
[0052] v normal ={v0,v 10 ,v 20 ,v 30 ,v 40 ,v 50 ,v 60 ,v 70 ,v 80 ,v 90}.
[0053] S34, after the MCU receives the moving target height H sent by the hand controller panel or APP target When the height of the lifting table is H cur , calculate the distance H to be moved err, and determine the direction to move Direction, H err The first-layer position loop PID is input to calculate the target speed v targect , the calculation formula is as follows,
[0054]
[0055] S35, according to the target speed v input in the previous step targect , combined with the current motor speed v cur , calculate the speed error v err , v err The second-layer speed loop PID is input to calculate the target PWM value p0. The calculation formula is as follows:
[0056]
[0057] S36. The three sets of data are fitted into three first-order polynomials N0=f0(v), N1=f1(v), and N2=f2(v) with speed as the variable. N0 is the polynomial fitted from the horizontal state calibration data, N1 is the polynomial fitted from the descending state calibration data, and N2 is the polynomial fitted from the ascending state calibration data. Figure 1 As shown in the figure, the blue straight line is polynomial N0, the red straight line is polynomial N1, and the yellow straight line is polynomial N2.
[0058] like Figure 1 As shown in the figure, the control PWM value p0 calculated by the second-layer PID is used to calculate the vertical coordinate values p1 and p2 corresponding to the polynomial N1 and polynomial N2 based on the horizontal coordinate v0 corresponding to this point. Then, combined with the moving direction Direction, if it is a descending working condition, p1 is used as the control PWM value, and if it is an ascending working condition, p2 is used as the control PWM value.
[0059] S4, output PWM to control the motor to perform related actions.
Claims
1. A calibration-based dual-loop PID single-motor electric lift table control method, characterized in that: The following steps are involved: S1. The mobile phone or hand control panel sends a control request, issuing an instruction to adjust or move the height of the table; S2. MCU arbitrates the received control request; S3: The processed control request is sent to the action logic module, where algorithm-related processing is performed: first, calibration is performed, and then, based on the PWM value output by the dual-loop PID, the calibrated PWM value is combined with the speed fitting polynomial to calculate the actual output PWM value corresponding to the increase or decrease; S4, output PWM to control the motor to perform related actions.
2. The calibration-based dual-loop PID single-motor electric lift table control method according to claim 1 is characterized in that: The S3 specifically includes: S31. Calibrate the motor speed corresponding to different PWM values during the rise, control the lifting table according to a fixed PWM value at every duty cycle, and calculate the current motor speed based on the pulse signal fed back by the motor; S32, calibrate the motor speed corresponding to different PWM values during descent, control the lift table according to a fixed PWM value at every duty cycle, and calculate the current motor speed based on the pulse signal fed back by the motor; S33, calibrating the motor speed corresponding to different PWM values when the lifting table is in the horizontal state, controlling the lifting table according to a fixed PWM value at every duty cycle, and calculating the current motor speed based on the pulse signal fed back by the motor; S34, after the MCU receives the moving target height H sent by the hand controller panel or APP target When the height of the lifting table is H cur , calculate the distance H to be moved err , and determine the direction to move Direction, H err The first-layer position loop PID is input to calculate the target speed v targect ; S35, according to the target speed v input in the previous step targect , combined with the current motor speed v cur , calculate the speed error v err , v err Bring in the second-layer speed loop PID to calculate the target PWM value p0; S36. Fit the above three sets of data into three linear polynomials with speed as a variable.
3. The calibration-based dual-loop PID single-motor electric lift table control method according to claim 2, characterized in that: When calibrating the motor speed, the lifting table is controlled according to a fixed PWM value at every 10% duty cycle from 0% to 90%.
4. The calibration-based dual-loop PID single-motor electric lift table control method according to claim 2, characterized in that: When the calibration is increased, the current motor speed is calculated as: n up ={0,10,20,30,40,50,60,70,80,90}, v uq ={v0,v 10 ,v 20 ,v 30 ,v 40 ,v 50 ,v 60 ,v 70 ,v 80 ,v 90 }。 5. The calibration-based dual-loop PID single-motor electric lift table control method according to claim 2, characterized in that: When the calibration is lowered, the current motor speed is calculated as: n down ={0,10,20,30,40,50,60,70,80,90}, v down ={v0,v 10 ,v 20 ,v 30 ,v 40 ,v 50 ,v 60 ,v 70 ,v 80 ,v 90 }。 6. The calibration-based dual-loop PID single-motor electric lift table control method according to claim 2, characterized in that: The calibration lifting table is in a horizontal state, and the current motor speed is calculated as: n normal ={0,10,20,30,40,50,60,70,80,90}, v normal ={v0,v 10 ,v 20 ,v 30 ,v 40 ,v 50 ,v 60 ,v 70 ,v 80 ,v 90 }。 7. The calibration-based dual-loop PID single-motor electric lift table control method according to claim 2, characterized in that: The target speed v taget The calculation formula is:
8. The calibration-based dual-loop PID single-motor electric lift table control method according to claim 1, characterized in that: The calculation formula of the PWM value p0 is as follows:
9. The calibration-based dual-loop PID single-motor electric lift table control method according to claim 2, characterized in that: The three first-order polynomials are: N0=f0(v), N1=f1(v), N2=f2(v), N0 is the polynomial fitted from the horizontal state calibration data, N1 is the polynomial fitted from the descending state calibration data, and N2 is the polynomial fitted from the ascending state calibration data.
10. The calibration-based dual-loop PID single-motor electric lift table control method according to claim 2, characterized in that: The control PWM value p0 calculated by the second-layer speed loop PID is used as the horizontal coordinate v0 corresponding to this point. The vertical coordinate values p1 and p2 corresponding to the polynomial N1 and polynomial N2 are calculated based on this horizontal coordinate. Then, combined with the moving direction Direction, if it is a descending working condition, p1 is used as the control PWM value, and if it is an ascending working condition, p2 is used as the control PWM value.