Non-closed-loop PID (Proportion Integration Differentiation) preprocessing motor control method

Through the non-closed-loop PID preprocessing method, preset parameters and trend linear prediction are used to generate PWM pulse control parameters, which solves the problems of large calculation amount and error accumulation of traditional PID control algorithm, and realizes low-cost and efficient servo motor control, which is suitable for on the FPGA platform.

CN118611515APending Publication Date: 2024-09-06成都市运泰利自动化设备有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410632213.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-21
Publication Date
2024-09-06

AI Technical Summary

Technical Problem

The traditional feedback closed-loop PID control algorithm has the problems of large calculation amount, error accumulation, easy loss of control and integral saturation in servo motor systems. In particular, it has high requirements on processor performance and is difficult to achieve efficient control on a low-cost FPGA platform.

Method used

The non-closed-loop PID preprocessing method is used to calculate parameters through preset control parameters, and use trend linear prediction and starting value error threshold preset to generate PWM pulse control parameters, reduce processor performance requirements, and avoid error accumulation and loss of control.

Benefits of technology

It achieves PID control with low calculation volume and fast response, reduces equipment costs, avoids error accumulation and integral saturation problems, is suitable for parallel processing on FPGA platforms, and improves control accuracy and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118611515A
    Figure CN118611515A
Patent Text Reader

Abstract

The invention aims to provide the non-closed-loop PID preprocessing motor control method which is low in calculation amount of a control processor, high in response speed and free of error accumulation. The method comprises the following specific steps: S1, setting control parameters in a control system, wherein the control parameters comprise a target period A (t), total control time T (a) and a pulse number N (p); s2, in single PID operation, the control system carries out preset condition comparison according to the current period value A (o) and obtains an initial period value A (b), and presetting of the initial period value A (b) is completed; s3, the control system uses the preset initial period value A (b) in the step S2 as a parameter to calculate an incremental quantity K; and S4, the final control system outputs a PID operation result according to the obtained initial period value A (b) and the incremental quantity K, and a PWM driving module generates PWM pulses required by action control of the servo motor according to the operation result. The method is applied to the technical field of motor PID control.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention is applied to the technical field of motor PID control, and particularly relates to a non-closed-loop PID preprocessing motor control method. Background Art

[0002] With the booming development of consumer electronics technology, the demand for industrial automation is growing, and servo motors are widely used in industrial automation production lines. For some servo motor systems that have high requirements for synchronous operation and parallel processing, multi-channel parallel PID control algorithms are usually used to process control instructions. The PID control algorithm is closely related to the control accuracy, linearity, response time and other indicators of the servo motor, and has a decisive influence. The conventional PID algorithm is based on proportional, integral, and differential control, and usually adopts feedback closed-loop automatic control technology, that is, an error correction system that requires real-time measurement, comparison, execution and other steps. Therefore, its control function and accuracy usually need to improve the computing processing power of the control processor to be improved, so the performance requirements of the processor are relatively high. In addition, the traditional control method using feedback closed-loop mode also has the problem of error accumulation, that is, when an error occurs in the system, it is easy to lose control, integral saturation, and cannot be quickly and automatically recovered.

[0003] To this end, if the increasingly low-cost FPGA field programmable gate array can be used to implement multi-channel parallel PID algorithms, PWM pulse modulation and other servo motor processing control functions, and if an efficient, feasible and high-precision control method that can be applied to FPGA can be provided, the shortcomings of the existing technology can be solved. Summary of the invention

[0004] The technical problem to be solved by the present invention is to overcome the deficiencies of the prior art and provide a non-closed-loop PID preprocessing motor control method with low control processor calculation amount, fast response speed and no error accumulation.

[0005] The technical solution adopted by the present invention is: the present invention comprises the following specific steps: Step S1, setting control parameters in the control system, the control parameters including target period A(t), total control time T(a) and number of pulses N(p); Step S2: In a single PID operation, the control system compares the preset conditions according to the current cycle value A(o) and obtains the starting cycle value A(b), thereby completing the preset of the starting cycle value A(b); Step S3, the control system uses the starting cycle value A(b) preset in step S2 as a parameter to calculate the increment K; Step S4: The final control system outputs the PID operation result according to the obtained starting cycle value A(b) and the increment K, and the PWM drive module generates the PWM pulse required for the servo motor motion control according to the operation result.

[0006] It can be seen from the above scheme that the parameter calculation during driving is performed by presetting the control parameters. At the same time, based on the trend linear prediction of step S2 and the processing method of the preset error threshold of the starting value, the calculation process of optimizing the PID control is realized. By calculating the preset starting value and the increment in a single time or in small amounts, the PWM pulse control parameters are generated, so as to provide a non-closed-loop PID proportional control preprocessing optimization scheme that meets the characteristics of FPGA that can process in parallel but has weak computing power. Compared with the traditional PID algorithm control, it can reduce the performance requirements for the processing chip, and at the same time can greatly reduce the accumulation of errors, and avoid the problems of loss of control, integral saturation, and inability to recover automatically and quickly.

[0007] A preferred solution is that in step S2, the current cycle value A(o) is compared with the threshold value for judgment. When the current cycle value A(o) does not meet the threshold judgment condition, the threshold value is taken as the starting cycle value A(b); when the current cycle value A(o) meets the threshold judgment condition, a preset factor x is introduced and the starting cycle value A(b) is calculated according to the calculation formula, and the calculation formula is A(b)=A(o)-x[A(o)-T(a) / N(p)].

[0008] A further preferred solution is that the threshold is 2*T(a) / N(p), and the judgment condition is that when the current period value A(o) is greater than or equal to the threshold, the judgment condition is not met, and when the current period value A(o) is less than the threshold, the judgment condition is met.

[0009] A further preferred solution is that the value of the preset factor x is smaller than the percentage of the current cycle value A(o) as a function of the difference between the current cycle value A(o) and the average cycle T(a) / N(p).

[0010] A further preferred solution is that when starting a single PID operation in step S2, the control system first calculates the threshold value and the preset factor x, and then determines the value of the starting cycle value A(b) after the calculation is completed.

[0011] A preferred solution is that the calculation formula for the incremental amount K in step S3 is K=2*(T(a)-N(p)*A(b)) / N(p) / (N(p)-1).

[0012] A preferred solution is that in step S4, the control system directly and continuously generates a specified number of pulses one by one according to the PWM pulse generation logic, and the pulses start from the starting cycle value A(b) and increase according to the K value. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 It is a work flow chart of the present invention; Figure 2 This is the overall simulation verification diagram of the traditional PID algorithm for the servo motor acceleration and deceleration Matlab software; Figure 3 This is a local simulation verification diagram of the traditional PID algorithm for the servo motor acceleration and deceleration Matlab software; Figure 4 This is the overall simulation verification diagram of the servo motor acceleration and deceleration Matlab software of the present invention; Figure 5 It is a local simulation verification diagram of the servo motor acceleration and deceleration Matlab software of the present invention. DETAILED DESCRIPTION

[0014] like Figure 1 As shown, in this embodiment, the present invention includes the following specific steps: Step S1, when executing the drive, the control system parses the control instruction issued by the host computer to obtain the control parameters and perform parameter setting for PID operation, wherein the control parameters include the target cycle A(t), the total control time T(a) and the number of pulses N(p); the control parameter can be the total operating parameter of a control instruction, or one of multiple operating parameters in a control instruction, and the control system performs single or staged calculation according to the acquired control instruction; Step S2, in a single PID operation, the control system first calculates a threshold value and a preset factor x, the threshold value is 2*T(a) / N(p), the value of the preset factor x is less than the percentage of the difference between the current cycle value A(o) and the average cycle T(a) / N(p) in the current cycle value A(o), and the value of the preset factor x is an integer percentage close to the calculated percentage value, and a preset condition comparison is performed according to the current cycle value A(o) to obtain the starting cycle value A(b), and the starting cycle value A(b) is preset; specifically, the control system sets the current cycle value A(o) to the preset condition comparison. ) is compared with the threshold value for judgment, the judgment condition is that when the current cycle value A(o) is greater than or equal to the threshold value, the judgment condition is not met, and when the current cycle value A(o) is less than the threshold value, the judgment condition is met; when the current cycle value A(o) does not meet the threshold judgment condition, the threshold value is taken as the starting cycle value A(b); when the current cycle value A(o) meets the threshold judgment condition, the preset factor x is introduced and the starting cycle value A(b) is calculated according to the calculation formula, the calculation formula is A(b)=A(o)-x[A(o)-T(a) / N(p)], wherein the preset factor x is a normalization coefficient; Step S3, the control system uses the starting cycle value A(b) preset in step S2 as a parameter to calculate the increment K, and the calculation formula of the increment K is K=2*(T(a)-N(p)*A(b)) / N(p) / (N(p)-1); Step S4, the final control system outputs the PID operation result according to the obtained starting cycle value A(b) and the increment K, and the PWM drive module calculates according to the PWM pulse generation logic, the starting cycle value A(b) and the increment K, and then generates a pulse output to the servo motor driver that directly and continuously generates a specified number of pulses one by one, and starts from the starting cycle value A(b) and increases according to the K value.

[0015] In order to achieve a more linear PID control process, it is necessary to ensure that the starting cycle value A(b), the target cycle A(t), the total control time T(a) and the number of pulses N(p) satisfy a linear relationship. Based on the arithmetic progression, the increment K can be obtained to satisfy the following formula: T(a)=A(b)+[A(b)+K]+[A(b)+2K]+....+[A(b)+(N(p)-1)K] =N(p)*A(b)+N(p)*(N(p)-1)*K / 2 Therefore, the calculation formula of the incremental amount K can be obtained, K=2*(T(a)-N(p)*A(b)) / N(p) / (N(p)-1) ——Formula 1; In the above formula, the target period A(t), total control time T(a), and number of pulses N(p) are all user-set parameters. The starting period A(b) is also an unknown quantity in the initial stage of a single PID operation. Its preset value is related to important parameter indicators such as PID control function, accuracy, and error recovery modulation time.

[0016] In order to ensure that the target period A(t) achieved while the subsequent increment K is linear does not exceed the zero point, the starting period value A(b) must satisfy: A(t)=A(b)+(N(p)-1)*K≥0 ——Formula 2; Substituting equation 1 into equation 2 yields: A(b)+(N(p)-1)*K≥0 A(b)+(N(p)-1)*[2*(T(a)-N(p)*A(b)) / N(p) / (N(p)-1)]≥0 Then, the threshold value in step S2 is obtained: 2*T(a) / N(p).

[0017] like Figures 2 to 5 As shown in between, Figure 2 and Figure 3The traditional PID algorithm is used to simulate and verify the acceleration and deceleration of the servo motor using Matlab software. The traditional closed-loop PID algorithm has better simulation control linearity than the traditional closed-loop PID algorithm because of the real-time error correction calculation. Figure 4 and Figure 5 The control method of the present invention is shown, but in engineering applications, due to limitations such as the accuracy of PWM output pulses and the minimum step of servo motor control, the actual control linearity performance of the system equipment is basically guaranteed to be at the same level without obvious differences.

[0018] The present application uses the threshold as a judgment condition to calculate the pulse increment K in a single or a small number of times to preset the starting cycle value A(b), without the need for real-time calculation and only pre-calculation, which greatly reduces the amount of calculation of the control processor, and then makes the current PID control more linear under the premise of insufficient computing power, that is, through non-closed-loop PID proportional control preprocessing to achieve low-computation control, meeting the working conditions of FPGA executing parallel processing but insufficient computing power. At the same time, since there is no need for real-time error feedback and error correction calculation, the PWM pulse continuous phase response output can be completed faster, effectively reducing the equipment cost while ensuring the control accuracy and efficiency, and greatly increasing the range of choices for the control processor of the drive device. In the single PID control, only independent calculations are performed at the beginning, which also avoids the risks of cumulative errors and integral saturation.

[0019] In addition, the control method of the present invention can process multiple groups of operations in parallel on the FPGA platform. Each group of operations is calculated according to steps S1 to S4 respectively, and finally PWM pulse output is executed according to the timing or the corresponding motor. The response time is faster, that is, pulses with smaller periods can be generated, which provides a processing solution for certain special applications.

[0020] The control method of the present application is driven by a control system composed of an MCU+FPGA architecture, and an adjustable frequency signal is output on two channels through an axis pulse generator, namely an EtherCAT terminal module as a PWM drive module, with four outputs. This signal can be used to control a motor drive or other signal receivers that are controlled by a single cycle. The pulse sequence and number of pulses can be specified directly through process data in the frequency. Alternatively, integrated path control can be used. For each channel, the operating mode (frequency modulation, pulse / direction specification, and incremental encoder simulation) can be selected. In addition, the EtherCAT terminal module can control three output channels in the ABC encoder simulation.

[0021] Although the embodiments of the present invention are described with practical solutions, they do not constitute limitations on the meaning of the present invention. For those skilled in the art, it is obvious to modify the implementation scheme and combine it with other solutions based on this description.

Claims

1. A non-closed-loop PID preprocessing motor control method, characterized in that: It includes the following specific steps: Step S1, setting control parameters in the control system, the control parameters including target period A(t), total control time T(a) and number of pulses N(p); Step S2: In a single PID operation, the control system compares the preset conditions according to the current cycle value A(o) and obtains the starting cycle value A(b), thereby completing the preset of the starting cycle value A(b); Step S3, the control system uses the starting cycle value A(b) preset in step S2 as a parameter to calculate the increment K; Step S4: The final control system outputs the PID operation result according to the obtained starting cycle value A(b) and the increment K, and the PWM drive module generates the PWM pulse required for the servo motor motion control according to the operation result.

2. The non-closed-loop PID preprocessing motor control method according to claim 1, characterized in that: In step S2, the current cycle value A(o) is compared with the threshold value for judgment. When the current cycle value A(o) does not meet the threshold judgment condition, the threshold value is taken as the starting cycle value A(b); when the current cycle value A(o) meets the threshold judgment condition, the preset factor x is introduced and the starting cycle value A(b) is calculated according to the calculation formula, and the calculation formula is A(b)=A(o)-x[A(o)-T(a) / N(p)].

3. The non-closed-loop PID preprocessing motor control method according to claim 2 is characterized in that: The threshold is 2*T(a) / N(p), and the judgment condition is that when the current period value A(o) is greater than or equal to the threshold, the judgment condition is not met, and when the current period value A(o) is less than the threshold, the judgment condition is met.

4. The non-closed-loop PID preprocessing motor control method according to claim 2 is characterized in that: The value of the preset factor x is smaller than the percentage of the difference between the current period value A(o) and the average period T(a) / N(p) in the current period value A(o).

5. The non-closed-loop PID preprocessing motor control method according to claim 2, characterized in that: When starting a single PID operation in step S2, the control system first calculates the threshold value and the preset factor x, and then determines the value of the starting cycle value A(b) after the calculation is completed.

6. The non-closed-loop PID preprocessing motor control method according to claim 1, characterized in that: The calculation formula for the increment K in step S3 is K=2*(T(a)-N(p)*A(b)) / N(p) / (N(p)-1).

7. The non-closed-loop PID preprocessing motor control method according to claim 1, characterized in that: In step S4, the control system directly and continuously generates a specified number of pulses one by one according to the PWM pulse generation logic, and the pulses start from the starting cycle value A(b) and increase according to the K value.