Construction method of motor PID parameter model, electronic equipment and computer readable storage medium
By constructing a motor operating parameter set and using a neural network to train a PID parameter model and optimize the PID parameters, the accuracy and stability issues of miniaturized products in the servo control system are solved, and efficient motor operation and wide applicability are achieved.
Patent Information
- Application Number
- CN202410369756.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-28
- Publication Date
- 2025-09-30
AI Technical Summary
In the existing technology, the PID parameter self-tuning method of the servo control system cannot effectively adapt to the high-precision and high-efficiency processing requirements of miniaturized products, and there are problems of parameter distortion and insufficient applicability.
By obtaining the motor operating parameter set, including the basic motor parameters, load mass, initial PID parameters, following error and setting time, a PID parameter model is constructed using neural network training to optimize the PID parameters to adapt to actual working conditions.
It improves the operating accuracy and stability of the motor, meets the high-precision and high-efficiency processing requirements of miniaturized products, reduces the technical requirements for on-site commissioning personnel, and is widely applicable to a variety of drives.
Smart Images

Figure CN120722718A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of numerical control technology, and in particular to a method for constructing a motor PID parameter model, an electronic device, and a computer-readable storage medium. Background Art
[0002] The servo control system is a feedback control system used to accurately follow or reproduce a process, and is widely used in CNC equipment in modern industrial production. In many cases, the servo system specifically refers to a feedback control system in which the controlled quantity (the output of the system) is a mechanical displacement or displacement speed or acceleration. Its function is to make the output mechanical displacement (or angle) accurately track the input displacement (or angle). A servo control system usually consists of a controller, a servo drive, a servo motor, and a feedback device. For example Figure 1 As shown in the figure, the servo motor adopts three-loop control, which are the current loop, speed loop and position loop from the inside to the outside. The PID (Proportional, Integral, Differential) algorithm is used to regulate the control deviation between the given value and the actual output value in the three loops (this control deviation is caused by motor response delay and energy loss), that is, three closed-loop negative feedback PID regulation systems.
[0003] In existing technologies, parameter self-tuning technology is commonly used to calculate the three parameters of PID control to achieve the optimal operating state of the servo control system. Parameter self-tuning technology specifically refers to the driver using specific algorithms and operating procedures to identify the electrical parameters of electrical equipment in the servo system, such as motors, cables, and electrical contacts, as well as mechanical parameters such as moment of inertia, load torque, and friction, and use them as driver operating configuration parameters. Currently, the two main self-tuning methods used in the industry are offline parameter self-tuning and online parameter self-tuning.
[0004] For offline parameter auto-tuning, a table of correspondences between moment of inertia ratios and offline parameters is pre-integrated into the driver. During on-site debugging, the driver is then connected to the controller's upper-level software to obtain the corresponding PID parameters based on the different moment of inertia ratios. This offline parameter auto-tuning method requires an operator to perform on-site debugging, which requires a high level of technical expertise. Furthermore, the correspondence between the moment of inertia ratio and offline parameters fluctuates widely, resulting in poor matching between the moment of inertia ratio and offline parameters. Crucially, this offline parameter auto-tuning method only considers the inherent characteristics of the motor and fails to account for changes in motor performance during actual operation, such as loose screws, varying loads, and changes in friction due to lubricant consumption. These changes in motor performance can cause changes in the speed loop, leading to PID parameter distortion.
[0005] For online parameter self-tuning, this method is to identify the rotational inertia of the motor online during the production and processing process to achieve real-time PID parameter adjustment. This online parameter self-tuning method makes the motor easily affected by interference factors such as accidental impact. Since the motor runs for a long time, the production and processing site is usually not equipped with on-site monitoring personnel, and it is impossible to eliminate the aforementioned unexpected situations. As a result, accidental impacts will also be recognized by the motor algorithm as changes in the motor's operating status, which will also cause PID parameter distortion.
[0006] If the motor is designed to be larger, that is, the load mass that the motor can withstand is much greater than the actual mass of the load, the above-mentioned PID parameter distortion will have little effect on the operating state of the servo control system, so that the two parameter self-tuning methods can meet the PID parameter self-tuning requirements of most production and processing industries. However, for small motors used in the processing and assembly of miniaturized products, the above-mentioned PID parameter distortion will affect the positioning accuracy and operating stability of the motor, thereby affecting the processing and assembly accuracy of the miniaturized products. Among them, taking the assembly processing of the camera module as an example, due to the small size of the camera module and the fact that the processing accuracy is an important factor affecting the imaging quality of the camera module, the current camera module assembly equipment has high precision requirements (±30um for ordinary modules and ±15um for high-end modules). The PID parameters obtained by the above-mentioned two parameter self-tuning methods cannot meet the assembly precision requirements of the camera module. In addition, whether it is offline parameter self-tuning or online parameter self-tuning, the driver is required to integrate this function. There are few types of drivers with these functions available on the market, which makes the above-mentioned two self-tuning methods not widely applicable. Summary of the Invention
[0007] In response to the above problems, the present application provides a solution for constructing a motor PID parameter model. By selecting a motor operating parameter set for neural network training, a trained PID parameter model is obtained. In actual application, the optimized PID parameters are determined by the PID parameter model based on the target following error and setting time. The optimized PID parameters are more in line with the actual operating conditions, thereby enabling the control servo system to have a better operating state.
[0008] According to a first aspect of the present application, a method for constructing a motor PID parameter model is provided, characterized by comprising:
[0009] Obtaining a motor operating parameter set, wherein each subset of the parameter set includes basic motor parameters, load mass, initial PID parameters, and corresponding following error and setting time; and
[0010] The motor operating parameter set is input into the basic model for neural network training to obtain a trained PID parameter model.
[0011] According to a second aspect of the present application, an electronic device is provided, including:
[0012] processor; and
[0013] The memory stores a computer program, and the processor implements the method described in the first aspect when executing the computer program in the memory.
[0014] According to a third aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in the first aspect is implemented.
[0015] According to the method for constructing a motor PID parameter model, electronic device and computer-readable storage medium provided in the present application, in order to meet the processing and assembly requirements of small-sized products with high precision and good stability, the basic motor parameters, load mass, initial PID parameters and corresponding following error and setting time are selected to form a motor operating parameter set. This is because the basic motor parameters affect the performance of the motor operation, the load can fit the actual operating conditions, and the following error and setting time reflect the responsiveness of the motor, so that the basic motor parameters, load mass, initial PID parameters and corresponding following error and setting time constitute characteristic indicators associated with the motor operating performance, so that the motor operating parameter set can cover changes in control parameters due to nonlinear disturbances, such as loose screws, load changes, and changes in friction performance due to lubricant consumption, and can also eliminate the influence of unexpected factors during the motor operation process, and allow the span amplitude of multiple data sets to be reduced. The PID parameter model constructed by the motor operating parameter set can better fit the actual operating conditions of the motor.
[0016] In actual application, it is only necessary to input the basic parameters of the motor operation parameter set, load mass, target following error and target setting time into the PID parameter model to obtain the optimized self-tuning PID parameters. The operation is simple and the technical foundation requirements for on-site commissioning personnel are lower. The optimized self-tuning PID parameters are more accurate, so that the motor has a better operating state. Moreover, once the optimized self-tuning PID parameters are determined, there is no need to adjust the PID parameters in real time during the production process, which can improve the operating speed and stability of the motor, thereby improving production efficiency and meeting the PID parameter self-tuning requirements of all types of products, especially the high-precision, high-efficiency processing and assembly requirements of miniaturized products. In addition, the implementation of this method only requires the driver to be able to communicate with the controller. Most drivers on the market are integrated with this function, which can reduce the selection restrictions of the driver and make the application of this solution more extensive. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without exceeding the scope of protection required by this application.
[0018] Figure 1 It is a schematic diagram of the composition of the servo motor in the servo control system.
[0019] Figure 2 This is a flowchart of a method for constructing a motor PID parameter model according to an embodiment of the present application.
[0020] Figure 3 This is a flowchart of obtaining a motor operating parameter set according to an embodiment of the present application.
[0021] Figure 4 This is a flowchart of a method for constructing a motor PID parameter model according to another embodiment of the present application.
[0022] Figure 5 2 is a schematic diagram of a device for acquiring a motor operating parameter set according to an embodiment of the present application.
[0023] Figure 6 This is a structural diagram of an electronic device provided by this application. DETAILED DESCRIPTION
[0024] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making creative efforts are within the scope of protection of this application.
[0025] According to some embodiments, the general idea of the present application is that, in order to adapt to the processing and assembly requirements of small-sized products with high precision and good stability, the basic parameters of the motor, load mass, initial PID parameters and the corresponding following error and setting time are selected to constitute the motor operating parameter set. This is because the basic parameters of the motor affect the performance of the motor operation, the load can fit the actual operating conditions, and the following error and setting time reflect the responsiveness of the motor, so that the basic parameters of the motor, load mass, initial PID parameters and the corresponding following error and setting time constitute characteristic indicators associated with the motor operating performance, so that the motor operating parameter set can cover the changes in control parameters due to nonlinear disturbances, such as loose screws, load changes, and changes in friction performance due to lubricant consumption, and can also eliminate the influence of unexpected factors during the operation of the motor, and allow the span amplitude of multiple data sets to be reduced. The PID parameter model constructed by the motor operating parameter set can better fit the actual operating conditions of the motor. In actual application, it is only necessary to input the basic parameters of the motor, load mass, target following error and target tuning time into the PID parameter model to obtain the optimized self-tuning PID parameters. The operation is simple and the technical foundation requirements for on-site commissioning personnel are lower. The optimized self-tuning PID parameters are more accurate, so that the motor has a better operating state. Moreover, once the optimized self-tuning PID parameters are determined, there is no need to adjust the PID parameters in real time during the production and processing process. The running speed and stability of the motor can be improved, thereby improving production efficiency. It can meet the PID parameter self-tuning requirements of all types of products, especially the high-precision, high-efficiency processing and assembly requirements of miniaturized products.
[0026] According to one aspect of the present application, a method for constructing a motor PID parameter model is provided, such as Figure 2 As shown, the method includes the following steps.
[0027] Step S201, obtaining a motor operating parameter set, wherein each subset of the parameter set includes basic motor parameters, load mass, initial PID parameters, and corresponding following error and setting time; and
[0028] Step S202: Input the motor operating parameter set into a basic model for neural network training to obtain a trained PID parameter model.
[0029] The PID parameter model in this embodiment selects the motor basic parameters, load mass, initial PID parameters and the corresponding following error and setting time to constitute the motor operation parameter set for neural network training. This is because the motor basic parameters affect the performance of the motor operation, the load can fit the actual operating conditions, and the following error and setting time reflect the responsiveness of the motor, so that the motor basic parameters, load mass, initial PID parameters and the corresponding following error and setting time constitute characteristic indicators associated with the motor operation performance, so that the motor operation parameter set can cover the changes in control parameters due to nonlinear disturbances, such as loose screws, load changes, and changes in friction performance due to lubricant consumption, and can also eliminate the influence of unexpected factors during the motor operation process, and allow the span amplitude of multiple data sets to be reduced. The PID parameter model constructed by the motor operation parameter set can better fit the actual operating conditions of the motor.
[0030] According to some embodiments, the motor includes a linear motor. Unlike traditional servo control systems, the linear motor system is directly connected to the load, and the motor and load are directly driven by the driver, eliminating the errors caused by the traditional "coupling + lead screw" structure and greatly improving positioning accuracy. In addition, the linear motor is a contactless motion (similar to magnetic levitation), which greatly reduces mechanical friction loss, has a fast response speed and high sensitivity, greatly improves the acceleration and speed of the motor during operation, and also increases the operating life of the motor, thereby being able to adapt to the positioning accuracy and processing efficiency requirements of high-precision production and processing equipment.
[0031] According to some embodiments, the following error and settling time of the motor motion process are selected as motor operating parameters because the following error and settling time of the motor reflect the responsiveness of the motor and are also important indicators for evaluating the motor operating performance.
[0032] According to some embodiments, basic motor parameters include rotor mass, rated current, rotor resistance, rotor inductance, back electromotive force constant, etc. The reason for selecting the above-mentioned basic motor parameters as motor operating parameters is that, based on the working principle of the motor (when an AC power supply is applied to the primary winding, a traveling wave magnetic field is generated in the air gap. The secondary winding, under the cutting of the traveling wave magnetic field, will induce an electromotive force and generate current. This current interacts with the magnetic field in the air gap to generate electromagnetic thrust), the above-mentioned basic motor parameters have a significant impact on the movement of the motor, and therefore the basic motor parameters are included in the features.
[0033] It will be understood by those skilled in the art that other parameters can be selected as motor operating parameters as needed to participate in the training of the PID parameter model, which all fall within the scope of this application.
[0034] Regarding step S201 of "obtaining a motor operating parameter set", Figure 3Describes the process of obtaining the motor operating parameter set, such as Figure 3 As shown, the process includes the following steps:
[0035] Step S301, obtaining multiple combinations of motor basic parameters, load mass and initial PID parameters;
[0036] Step S302, for any one of the multiple combinations, determine the corresponding following error and the corresponding setting time through on-machine testing; and
[0037] Step S303 , forming a subset of the parameter set according to the motor basic parameters, load mass, initial PID parameters, and corresponding following errors and setting times in any combination.
[0038] According to some embodiments, when the motor operating parameter set includes basic motor parameters, load mass, initial PID parameters, following error, and setting time, first, multiple combinations of the basic motor parameters, load mass, and initial PID parameters are obtained; then, through these multiple combinations, the following error and the corresponding setting time are obtained for each combination through on-machine testing; finally, a subset of the parameter set is formed based on the basic motor parameters, load mass, initial PID parameters, and the corresponding following error and setting time in any combination. In this way, the multiple subsets formed by on-machine testing of multiple combinations together constitute the motor operating parameter set. Among them, the initial PID parameters only consider the motor's own characteristics and do not consider the changes in the motor's operating performance after the load is added. Similar to the rated value of the motor, it is usually provided by the motor manufacturer.
[0039] For example, there are M motors of different specifications, so there are M basic motor parameters; there are N specifications of load mass, so there are N load masses and n groups of initial PID parameters, where M, N and n are all positive integers. For M motors of different specifications, N loads of different specifications and n groups of initial PID parameters, orthogonal design is performed to form M×N×n groups of solutions, that is, M×N×n combinations.
[0040] According to some embodiments, the variation of the basic motor parameters, the load mass, and the initial PID parameters is 8 to 20 times the corresponding variation step size. This ensures that the motor operating parameter set has a sufficient number of samples, ensuring the comprehensiveness of the subsequent training data set and enhancing the generalization and robustness of the model. It is understood that a smaller variation step size and a greater number of samples can make the optimized self-tuning PID parameters obtained by the PID parameter module more accurate and more in line with actual operating conditions. However, this will result in a larger workload for on-machine testing.
[0041] For example, if the supplier specifies that the initial PID parameter settings for P, I, and D range from 50 to 150, respectively, and the step size is 10, then traversing the various setting ranges of P, I, and D according to this step size, there are 11 values for P, I, and D, and 11×11×11 sets of PID parameters (i.e., n=11×11×11). If the load mass setting range is 0.5 to 2 kg, and the specified change gradient is 0.1 kg, then traversing the load mass setting range according to this gradient, there are 16 load mass variations (i.e., N=16). If there are 5 motor specifications (i.e., M=5), then after orthogonal design, the resulting solutions have 5×16×(11×11×11) combinations.
[0042] Next, for each combination of the M×N×n schemes, test them on the device to obtain the following error and setting time of the motor under different control parameters and loads. The following error obtained by the first scheme is FE1, and the setting time is ST1. The following error obtained by the second scheme is FE2, and the setting time is ST2. ... The following error obtained by the M×N×n scheme is FE M×N×n , the setting time is ST M×N×n , and the first motor basic parameter is A1, the first load mass is G1, the first group of initial PID parameters is PID1, the following error FE1 and the setting time ST1 obtained by the first group of schemes together constitute the data set dataset 1 (i.e., a subset of the motor operating parameter set), the second motor basic parameter is A2, the second load mass is G2, the second group of initial PID parameters is PID2, and the following error FE2 and the setting time ST2 obtained by the second group of schemes together constitute the data set dataset 2 (i.e., another subset of the motor operating parameter set) ... The Mth motor basic parameter is A M 、The mass of the Nth load is G N 、The initial PID parameters of the nth group are PID n And the following error FE obtained by the M×N×n group solution M×N×n and set time ST M×N×n Together they constitute the dataset dataset MNn (i.e., another subset of the motor operating parameter set).
[0043] In some embodiments, as Figure 5As shown, the aforementioned device includes a controller, a motor, a driver, a detection module and a calculation module. The controller is used to output an operating instruction to the driver; the output end of the motor is used to connect the load; the driver is connected to the controller and the motor electrical signal, and is used to drive the motor to drive the load to run according to the operating instruction; the detection module is a grating ruler provided at the output end of the motor, and the detection module is connected to the controller electrical signal, and is used to detect the displacement of the load and transmit the displacement and acquisition time to the controller; the calculation module is connected to the controller electrical signal, and is used to calculate according to the displacement and acquisition time received by the controller to obtain the corresponding following error and settling time.
[0044] In other embodiments, the detection module can also be set on the load; the connection between the detection module and the motor output end and the load can be a direct connection, or it can be connected through a third component such as a transmission mechanism, so that the detection module is linked with the motor output end and / or the load.
[0045] Among them, according to the above description, the implementation process of "obtaining multiple combinations of motor basic parameters, load mass and initial PID parameters" in step 301 can be: first, determine the respective setting ranges and respective change steps of the motor basic parameters, load mass and initial PID parameters; then, traverse their respective setting ranges according to their respective change steps to obtain multiple combinations of motor basic parameters, load mass and initial PID parameters.
[0046] In step 302, the following error is the sum of the following errors collected from the start of the motor to the stop of the motor. For example, if the movement time is TT and the time interval for collecting the following error of the motor is T, then the number of collected groups X = TT / T, where T is a positive number and X is a positive integer. The following error of the motor FE = ∑FE X , and FE X =|CMD x -ENC x |, CMDx is the motor's target position at the time of acquisition, and ENCx is the motor's actual position at the time of acquisition. Both the target position and actual position are absolute positions. Furthermore, if the target position remains unchanged for two consecutive acquisitions, the time of the first acquisition is recorded as ta. After ta, if the actual position remains unchanged for two consecutive acquisitions, the motor is considered to have completed motion. The time of the first acquisition is recorded as tb, and the settling time is ST = tb - ta. The settling time can be provided by a third-party sensor.
[0047] In this way, the implementation process of step 302 can be: first, determine the corresponding following error based on the multiple following errors obtained within the motor movement time according to the set acquisition interval; then, determine the corresponding setting time based on the time difference between the corresponding moments when the target position remains unchanged for two consecutive acquisitions and the moment when the motor movement ends.
[0048] After obtaining the motor operating parameter set, neural network training can be performed based on the motor operating parameter set. According to some embodiments, the basic model used for neural network training can adopt the XGBoost model. The XGBoost model can make the model converge faster, speed up the training time, and effectively eliminate overfitting and improve model accuracy. In addition, the basic model can also adopt other models, such as decision tree models, LightGBM, etc.
[0049] Regarding the specific neural network training process, according to one embodiment, the motor operating parameter set can be divided into a learning set and a test set according to a set ratio (randomly). For example, if the motor operating parameter set has 10,000 groups and the set ratios are 0.7 and 0.3 respectively, then the number of groups in the learning set and the test set are 7,000 and 3,000 respectively. Then, the learning set is used for basic model learning to establish an initial PID parameter model, and the test set is used for verification and optimization of the PID parameter model, thereby obtaining model MODEL1. Subsequently, the aforementioned random grouping, learning, verification, and optimization steps are repeated until the optimal model MODELmax is obtained, thereby obtaining the final PID parameter model, that is, the trained PID parameter model.
[0050] Thus, step S202 may include:
[0051] Dividing the motor operating parameter set into a learning set and a test set according to a set ratio;
[0052] Performing neural network training on the basic model according to the learning set; and
[0053] The trained basic model is verified and optimized based on the test set.
[0054] Figure 4 FIG. 1 is a flow chart of a method for constructing a motor PID parameter model according to another embodiment of the present application. Figure 4 As shown, the method includes the following steps:
[0055] Step S401, obtaining a motor operating parameter set, wherein each subset of the parameter set includes basic motor parameters, load mass, initial PID parameters, and corresponding following error and setting time;
[0056] Step S402, performing feature extraction on the motor operating parameter set to obtain a parameter set after feature extraction; and
[0057] Step S403: input the parameter set after feature extraction into the basic model to perform neural network training to obtain a trained PID parameter model.
[0058] Figure 4 Steps S401 and S403 are the same as Figure 2 Steps S201 and S202 are similar and will not be repeated here. After obtaining the motor operating parameter set, feature extraction is performed on it. According to some embodiments, feature extraction can be performed by a learner, for example, a GBDT model can be used. The GBDT model has a high correlation with the motor operating parameter set, so that the PID parameter model finally established can be more in line with the actual working conditions, thereby improving the accuracy of the PID parameters. The learner can also use other models, such as regression models. Feature extraction is mainly to eliminate irrelevant features or obviously unreasonable features. Feature extraction can increase the training speed of neural network training, shorten the training time, and also make the trained PID parameter model more accurate.
[0059] In the actual application process after obtaining the trained PID parameter model, according to some embodiments, for a specific motor (i.e., the target motor), it is first necessary to obtain the motor basic parameters and load mass, and it is also necessary to set the target following error and target setting time that reflect the responsiveness of the motor, that is, the following error and setting time that the target motor is expected to achieve. Then, the motor basic parameters, load mass, target following error and target setting time are input into the trained PID parameter model to obtain the optimized self-tuning PID parameters. This optimized self-tuning PID parameter is the control parameter required by the driver of the target motor. After the optimized self-tuning PID parameter is imported into the driver of the target motor, the operating performance of the motor can be made more in line with the actual working conditions, thereby making the processing and assembly accuracy higher.
[0060] After constructing a trained PID parameter model according to the above-mentioned motor PID parameter model construction method, in one embodiment, the basic parameters of the linear motor include: the mover mass is 0.5kg, the rated current is 3A, and the resistance is 10Ω; the load mass G is 3KG; the target tracking error FE is 30 microns, and the target setting time ST is 30 milliseconds. The above-mentioned parameters are written into the PID parameter model as input, and finally the optimized self-tuning PID parameters can be obtained, P=115, I=358, D=12.
[0061] According to the construction scheme of the motor PID parameter model provided in this application, in order to adapt to the high-precision and good stability processing and assembly requirements of small-sized products, the motor basic parameters, load mass, initial PID parameters and the corresponding following error and setting time are selected to form the motor operation parameter set. This is because the motor basic parameters affect the performance of the motor operation, the load can fit the actual operating conditions, and the following error and setting time reflect the responsiveness of the motor, so that the motor basic parameters, load mass, initial PID parameters and the corresponding following error and setting time constitute characteristic indicators associated with the motor operation performance, so that the motor operation parameter set can cover the changes in control parameters due to nonlinear disturbances, such as loose screws, load changes, and changes in friction performance due to lubricant consumption, and can also eliminate the influence of unexpected factors during the motor operation process, and allow the span amplitude of multiple data sets to be reduced. The PID parameter model constructed by the motor operation parameter set can better fit the actual operating conditions of the motor.
[0062] In actual application, it is only necessary to input the basic motor parameters, load mass, target following error, and target setting time into the PID parameter model to obtain the optimized self-tuning PID parameters. This method is easy to operate and requires less technical knowledge from on-site commissioning personnel. The optimized self-tuning PID parameters are more accurate, allowing the motor to have a better operating state. Moreover, once the optimized self-tuning PID parameters are determined, there is no need to adjust the PID parameters in real time during the production process, which can improve the motor's operating speed and stability, thereby improving production efficiency and meeting the PID parameter self-tuning requirements of all types of products, especially the high-precision, high-efficiency processing and assembly requirements of miniaturized products. In addition, the implementation of this method only requires the driver to be able to communicate with the controller. Most drivers on the market have this function integrated, which can reduce the selection restrictions of the driver and make the application of this solution more extensive.
[0063] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0064] It should be noted that for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all optional embodiments, and the actions and modules involved are not necessarily required by this application.
[0065] In the several embodiments provided in this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical connection or other forms.
[0066] See Figure 6 , Figure 6 An electronic device is provided, comprising a processor and a memory. The memory stores computer instructions, and when the computer instructions are executed by the processor, the processor executes the computer instructions to achieve the following Figures 2 to 4 The method and refinement scheme shown.
[0067] It should be understood that the above-described device embodiments are merely illustrative, and the devices disclosed herein may also be implemented in other ways. For example, the division of units / modules described in the above-described embodiments is merely a logical functional division, and actual implementations may employ alternative divisions. For example, multiple units, modules, or components may be combined or integrated into another system, or some features may be omitted or not implemented.
[0068] In addition, unless otherwise specified, the functional units / modules in the various embodiments of the present invention may be integrated into a single unit / module, each unit / module may exist physically separately, or two or more units / modules may be integrated together. The aforementioned integrated units / modules may be implemented in the form of hardware or software program modules.
[0069] If the integrated unit / module is implemented in hardware, the hardware may be a digital circuit, an analog circuit, or the like. The physical implementation of the hardware structure includes, but is not limited to, transistors, memristors, and the like. Unless otherwise specified, the processor or chip may be any appropriate hardware processor, such as a CPU, GPU, FPGA, DSP, and ASIC. Unless otherwise specified, the on-chip cache, off-chip memory, and storage may be any appropriate magnetic storage medium or magneto-optical storage medium, such as resistive random access memory (RRAM), dynamic random access memory (DRAM), static random access memory (SRAM), enhanced dynamic random access memory (EDRAM), high-bandwidth memory (HBM), hybrid memory cube (HMC), and the like.
[0070] If the integrated unit / module is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a memory, including a number of instructions for enabling a computer electronic device (which can be a personal computer, a server or a network electronic device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned memory includes: various media that can store program codes, such as a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0071] The embodiment of the present application further provides a computer-readable storage medium storing a computer program, wherein the computer program is executed by a processor to implement the following Figures 2 to 4 The method and refinement scheme shown.
[0072] The embodiments of the present application are described in detail above. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only intended to help understand the method and core ideas of the present application. At the same time, changes or modifications made by those skilled in the art based on the ideas of the present application, the specific implementation methods, and the scope of application of the present application, all fall within the scope of protection of the present application. In summary, the contents of this specification should not be construed as limiting the present application.
Claims
1. A method for constructing a motor PID parameter model, characterized in that: include: Obtaining a motor operating parameter set, wherein each subset of the parameter set includes basic motor parameters, load mass, initial PID parameters, and corresponding following error and setting time; as well as The motor operating parameter set is input into the basic model for neural network training to obtain a trained PID parameter model.
2. The method according to claim 1, wherein The step of obtaining the motor operating parameter set includes: Obtain multiple combinations of motor basic parameters, load mass and initial PID parameters; For any one of the multiple combinations, determining a corresponding following error and a corresponding settling time through a computer test; and A subset of the parameter set is formed according to the motor basic parameters, load mass, initial PID parameters, and corresponding following errors and setting times in any combination.
3. The method according to claim 2, wherein The method of obtaining multiple combinations of motor basic parameters, load mass and initial PID parameters includes: Determining respective setting ranges and respective change step sizes of the motor basic parameters, the load mass, and the initial PID parameters, wherein the change values of the motor basic parameters, the load mass, and the initial PID parameters are 8 to 20 times of their corresponding change step sizes; and The respective setting ranges are traversed respectively according to the respective change steps to obtain the multiple combinations of motor basic parameters, load mass and initial PID parameters.
4. The method according to claim 2, wherein The following error and settling time are tested using a device comprising A controller, used to output operating instructions to the driver; A motor, whose output terminal is used to connect a load; The driver is electrically connected to the controller and the motor, and is used to drive the motor to drive the load to operate according to the operation instruction; a detection module, linked to the output terminal of the motor and / or the load, and electrically connected to the controller, for detecting the displacement of the load and transmitting the displacement and acquisition time to the controller; as well as A calculation module is electrically connected to the controller and is used to calculate according to the displacement and acquisition time received by the controller to obtain a corresponding following error and settling time.
5. The method according to claim 4, wherein The detection module is a grating ruler arranged at the output end of the motor.
6. The method according to claim 1, wherein The basic parameters of the motor include rotor mass, rated current, rotor resistance, rotor inductance, and back electromotive force constant.
7. The method according to any one of claims 1 to 6, characterized in that Inputting the motor operating parameter set into a basic model for neural network training includes: Dividing the motor operating parameter set into a learning set and a test set according to a set ratio; Performing neural network training on the basic model according to the learning set; and The trained basic model is verified and optimized based on the test set.
8. The method according to any one of claims 1 to 6, characterized in that Before inputting the motor operating parameter set into the basic model for neural network training, the method further includes: Performing feature extraction on the motor operating parameter set to obtain a parameter set after feature extraction; And wherein, the motor operating parameter set is input into the basic model for neural network training, comprising: The parameter set after feature extraction is input into the basic model for neural network training.
9. An electronic device, characterized in that: The method comprises a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the method according to any one of claims 1 to 8 when executing the computer program in the memory.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.