A method for optimizing control parameters of a 2-phase stepping motor

By optimizing the PI calculation parameters KP and Ki of the 2-phase stepper motor and updating the input voltage based on the actual current comparison, the problem of inconsistent control effects among different series of stepper motors was solved, achieving more efficient control and shorter calculation time.

CN114744944BActive Publication Date: 2025-11-18SHENZHEN NOKE TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210481298.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-05
Publication Date
2025-11-18
Estimated Expiration
2042-05-05

AI Technical Summary

Technical Problem

When debugging different series of stepper motor control systems, the selection of PI calculation parameters KP and Ki leads to inconsistent control effects and varying calculation times, affecting control performance and efficiency.

Method used

By receiving user commands, sampling the actual current of the stepper motor, updating the input voltage using PI calculation, and optimizing the KP and Ki parameters by comparing the actual current with the preset current until the optimal value is reached, the matching relationship is stored for subsequent fast matching.

Benefits of technology

The PI calculation parameters were optimized, the control voltage acquisition time was shortened, and the control effect and efficiency of different series of stepper motors were improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114744944B_ABST
    Figure CN114744944B_ABST
Patent Text Reader

Abstract

This application relates to a method for optimizing the control parameters of a two-phase stepper motor; it includes: receiving a parameter tuning command, controlling the stepper motor to run, and adjusting the actual current I every preset time interval T. F Sampling is performed; when the actual current I is received F At that time, the input voltage U is updated through PI calculation. M When the number of samples reaches the preset number of samples n, sampling stops, and I is... FMAX respectively with X * I R Y*I R Perform a comparison; if I FMAX < X *I R Then K P Updated to K P +△K P ;if I FMAX >Y*I R Then K P Updated to K P -△K P Repeat the above steps until X * I R ≤I FMAX ≤Y*I R If X * I R ≤I FMAX ≤Y*I R Then the steady-state value of the current I FV With Z* I R W* I R Perform a comparison, if I FV <Z* I R Then K i Updated to K i +△K i , if I FV > W * I R Then K i Updated to K i -△K i Repeat the above steps until Z* I R ≤I FV ≤W * I R If K P and K i Once all values ​​reach their optimal values, a message indicating successful tuning is displayed. This application features the ability to match optimal K values ​​for different types of stepper motors. P K i This optimizes the control effect on different types of stepper motors.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of stepper motor control, and in particular to a method for optimizing the control parameters of a two-phase stepper motor. Background Technology

[0002] A 2-phase hybrid stepper motor is a type of hybrid motor. The control system for a 2-phase stepper motor is used to control its operation. When using this control system to control stepper motors of different specifications and models, the actual current I of the stepper motor may encounter issues. F (The current collected during the operation of the stepper motor) and the preset control current I R (When the control system uses a preset input voltage U) M To control the stepper motor during operation, the control system outputs a voltage equal to the input voltage U. M There is a deviation between the corresponding currents; the larger the deviation, the worse the controller's control effect on the stepper motor. Therefore, in order to optimize the controller's control effect on the stepper motor, the control system can call PI calculation to eliminate the above deviation and calculate the value that will make the actual current I... F Equal to control current I R The corresponding control voltage U R PI calculation involves calculating the deviation between a given value and the actual output value, then linearly combining the proportion and integral of this deviation to form a correction value, which is used to regulate the controlled object. Applying PI calculation to the current deviation value yields the control voltage for a stepper motor. The specific calculation method is as follows:

[0003] The control system first determines the input voltage U based on the preset input voltage U. M This controls the operation of the stepper motor and controls a preset current acquisition device to collect the actual current I at preset intervals. F Each time a sample is taken, the actual current I obtained from the current sample is calculated. F With preset control current I R The deviation value is then used to calculate the voltage correction ΔU using the PI calculation formula. Among them, K P K is the proportional control parameter in the PI calculation formula. i The integral term control parameters in the PI calculation formula are all manually set constants; n is the actual current I. F The corresponding number of times it was collected. This represents the sum of n deviation values; the control system will adjust the input voltage U based on the currently sampled ΔU. M Updated to U M +△U, then through the updated input voltage U MControl the stepper motor to run so that the updated input voltage U can be obtained in the next sampling. M The corresponding actual current I F After n samplings and adjustments to the input voltage after each sampling, the actual current I... F It will gradually approach and equal the control current I. R This eliminates the deviation value.

[0004] Regarding the aforementioned related technologies, the inventors have discovered at least the following problems: As can be seen from the PI calculation formula, K... P and K i This will affect the result of each PI calculation, and thus affect the control voltage U obtained through the PI calculation. R The duration when the control system uses the above K P and K i When debugging different series of 2-phase stepper motors, although the control voltage can eventually be calculated, obtaining the control voltage U is difficult. R The varying time required results in different control effects of the stepper motor control system on different stepper motors. Summary of the Invention

[0005] In order to match the optimal K for different timing motors P and K i This application provides a method for optimizing the control parameters of a two-phase stepper motor, thereby optimizing the control effect of the control system on different stepper motors.

[0006] Firstly, this application provides a method for optimizing the control parameters of a two-phase stepper motor, employing the following technical solution:

[0007] A method for optimizing control parameters of a two-phase stepper motor includes the following steps:

[0008] Receive parameter tuning commands from users via smart terminals, based on preset input voltage U. M To control the operation of the stepper motor, at preset time intervals T, a preset sampling device is controlled to measure the actual current I of the stepper motor. F Sampling is performed, and the actual current I obtained from each sampling is received and saved. F ;

[0009] Whenever the actual current I obtained from the sampling is received F At that time, based on the actual current I obtained from the current sampling F and the preset control current I R Based on pre-stored K P and K i The input voltage U is updated through PI calculation. MAnd based on the updated input voltage U M Control the operation of the stepper motor;

[0010] When the sampling device measures the actual current I F When the number of samplings reaches the preset number of samplings n, sampling stops, and all actual currents I are... F The maximum value in is determined as the maximum actual current value I. FMAX All actual currents I F The mode in the equation is determined as the steady-state value of the current I. FV , will I FMAX respectively with X*I R Y*I R The comparison is performed, where X and Y are preset constants, and 1 ≤ X. <Y;

[0011] If I FMAX <X*I R Then the preset K P Updated to K P +△K P ;if I FMAX >Y*I R Then the preset K P Updated to K P -△K P Based on the updated K P and the preset input voltage U M Repeat the above steps for the actual current I of the stepper motor. F Perform n samplings and obtain the maximum actual current value I through PI calculation. FMAX and the steady-state value of current I FV , will I FMAX respectively with X*I R Y*I R Perform a comparison operation; where △K P A constant greater than 0;

[0012] If X*I R ≤I FMAX ≤Y*I R Then determine the K P To reach the optimal value, the steady-state current value I will be... FV With Z*I R W*I R A comparison was performed, where Z and W are both preset constants greater than 0, and Z... <W;

[0013] If I FV <Z*I R Then the preset K i Updated to K i +△K i , if I FV>W*I R Then the preset K i Updated to K i -△K i Based on the updated K i K has already reached its optimal value. P and the preset input voltage U M Repeat the above steps for the actual current I of the stepper motor. F Perform n samplings and obtain the maximum actual current value I through PI calculation. FMAX and the steady-state value of current I FV , will I FMAX respectively with X*I R Y*I R Perform a comparison operation; where △K i A constant greater than 0;

[0014] If Z*I R ≤I FV ≤W*I R Then determine the K i To reach the optimal value;

[0015] If K P and K i Once all parameters reach their optimal values, a message indicating that tuning is complete will be displayed so that the user is aware that parameter tuning has been finished.

[0016] Preferably, the method further includes:

[0017] If the K P >K PMAX Then the K P Updated to K PMAX If the K P <K PMIN Then the K P Updated to K PMIN ;where K PMAX K PMIN This is a preset constant;

[0018] If the K i >K iMAX Then the K i Updated to K iMAX If the K i Less than K iMIN Then the K i Updated to K iMIN ;where K iMAX K iMIN This is a preset constant;

[0019] If X*I R ≤I FMAX≤Y*I R Then determine the K P To achieve the optimal value, the following are included:

[0020] If X*I R ≤I FMAX ≤Y*I R or K P =K PMAX or K P =K PMIN Then determine the K P To reach the optimal value;

[0021] If Z*I R ≤I FV ≤W*I R Then determine the K i To achieve the optimal value, the following are included:

[0022] If Z*I R ≤I FV ≤W*I R or K i =K iMAX or K i =K iMIN Then determine the K i The optimal value has been achieved.

[0023] Preferably, the method further includes:

[0024] In each control, the preset sampling device collects the actual current I. F The timing begins simultaneously and continues until the actual current I is obtained from the current sampling. F And the PI operation completes the calculation of the input voltage U M The timer stops during the update and the timeout duration is set to the correction duration T. n Based on the correction duration T n And update the preset sampling period table with the current sampling count n, the sampling period table being used to store the sampling count n and the correction duration T. n The correspondence;

[0025] Every preset time interval T, a preset sampling device is controlled to sample the actual current I of the stepper motor. F Sampling is performed, and the actual current I obtained from each sampling is received and saved. F ;include:

[0026] When K i When I = 0, every preset time interval T, the preset sampling device is controlled to sample the actual current I of the stepper motor. F Sampling is performed, and the actual current I obtained from each sampling is received and saved. F ;

[0027] When K i When ≠0, based on the number of samplings n and the correction duration T n The correspondence, every preset time interval T n The preset sampling device controls the actual current I of the stepper motor. F Sampling is performed, and the actual current I obtained from each sampling is received and saved. F .

[0028] Preferably, the sampling device measures the actual current I F Sampling stops when the number of samples reaches the preset number of samples n, including:

[0029] If there exists a target sampling number less than the preset sampling number n, and the target sampling number and the actual current I corresponding to its first m samples... F If all values ​​are the same, stop sampling and set the actual current I corresponding to the target number of samplings. F The actual current value I corresponding to each sample from the target sampling number up to the nth sampling number. F Save it; otherwise, when the sampling device detects the actual current I... F Sampling stops when the number of samplings reaches the preset number of samplings n.

[0030] Preferably, the parameter tuning instructions include at least a motor attribute label, which is used to distinguish different types of stepper motors;

[0031] If K P and K i Once all parameters reach their optimal values, a message indicating successful tuning will be displayed to inform the user that parameter tuning has been completed. This includes:

[0032] If K P and K i If all values ​​reach their optimal values, then K will be... P and K i The corresponding motor attribute tags in the parameter tuning instructions are added to the preset control parameter matching table, and the tuning completion information is displayed so that the user is aware that the parameter tuning has been completed; the control parameter matching table is used to store the motor attribute tags and K. P K i The correspondence;

[0033] The method further includes:

[0034] Receive parameter matching instructions sent by the user through a smart terminal, wherein the parameter matching instructions include at least motor attribute data;

[0035] If a target motor attribute label exists in the control parameter matching table, and the content of the target motor attribute label matches the content of the motor attribute data, then the target K corresponding to the target motor attribute label is determined. P and target K i Using the target K P and target K i Update current K P and K i Display and save the successful match information;

[0036] If the motor attribute data does not exist in the control parameter matching table, a matching failure message will be displayed so that the user can determine whether a parameter tuning command needs to be issued based on the displayed information.

[0037] Preferably, the successful matching information includes the K corresponding to the motor attribute tag whose content matches the motor attribute data. P and K i The method also includes: the time corresponding to a successful match;

[0038] The number of successful matches within a preset time interval is counted every preset time interval, and based on the counted successful matches, each group K in the control parameter matching table is determined. P and K i The number of successful matches, based on each group K P and K i The number of successful matches and preset rules are used to update all K values ​​in the control parameter matching table. P and K i The arrangement and sorting.

[0039] Preferably, the motor attribute label includes the inductance value; the step of receiving parameter tuning instructions issued by the user through a smart terminal includes:

[0040] Receive parameter tuning instructions from users via smart terminals;

[0041] Based on the inductance value in the parameter tuning instruction, a first inductance value is determined from the control parameter matching table. The first inductance value is less than the inductance value corresponding to the parameter tuning instruction and is closest to the inductance value corresponding to the parameter tuning instruction. A second inductance value is determined from the control parameter matching table. The second inductance value is greater than the inductance value corresponding to the parameter tuning instruction and is closest to the inductance value corresponding to the parameter tuning instruction.

[0042] Based on the parameter tuning instructions, determine the K value corresponding to the first inductance value. P and K i And K corresponding to the second inductance value P and K iThe K values ​​corresponding to the first and second inductance values ​​are... P The average value is updated to the pre-stored K. P The K values ​​corresponding to the first and second inductance values ​​are... i Update to pre-stored K i .

[0043] Secondly, this application provides a system for optimizing the control parameters of a two-phase stepper motor, comprising: a PI tuning module, used to receive parameter tuning commands issued by a user through a smart terminal, based on a preset input voltage U. M To control the operation of the stepper motor, at preset time intervals T, a preset sampling device is controlled to measure the actual current I of the stepper motor. F Sampling is performed, and the actual current I obtained from each sampling is received and saved. F It is also used to detect the actual current I obtained from each sample received. F At that time, based on the actual current I obtained from the current sampling F and the preset control current I R Based on pre-stored K P and K i The input voltage U is updated through PI calculation. M And based on the updated input voltage U M Controlling the operation of the stepper motor; also used when the sampling device detects the actual current I F When the number of samplings reaches the preset number of samplings n, sampling stops, and all actual currents I are... F The maximum value in is determined as the maximum actual current value I. FMAX All actual currents I F The mode in the equation is determined as the steady-state value of the current I. FV , will I FMAX respectively with X*I R Y*I R The comparison is performed, where X and Y are preset constants, and 1 ≤ X. <Y;

[0044] K P K i Update module, used in I FMAX <X*I R At that time, the preset K will be used. P Updated to K P +△K P Also used in I FMAX >Y*I R At that time, the preset K will be used. P Updated to K P -△K P It is also used based on the updated K. P and the preset input voltage U M, repeat the above operation of sampling the actual current I of the stepper motor F for n times, obtaining the maximum actual current value I through PI operation FMAX and the current steady-state value I FV ; compare I FMAX with X*I R and Y*I R respectively; where △K P is a constant greater than 0; it is also used to compare the current steady-state value I R ≤I FMAX ≤Y*I R with Z*I FV and W*I R respectively, where both Z and W are preset constants greater than 0 and Z < W; it is also used to update the preset K R to K FV <Z*I R ; it is also used to update the preset K i to K i +△K i when I FV >W*I R ; it is also used to repeat the above operation of sampling the actual current I of the stepper motor i for n times, obtaining the maximum actual current value I through PI operation i and the current steady-state value I i based on the updated K i , the K P that has reached the optimal value, and the preset input voltage U M , and compare I F with X*I FMAX and Y*I FV respectively; FMAX R R

[0045] Optimization result processing module, used to determine that the K R ≤I FV ≤W*I R has reached the optimal value; it is also used to display the information indicating that the optimization is completed when both K i and K P and K i have reached the optimal value, so that the user can know that the parameter optimization has been completed.

[0046] In a third aspect, a two-phase stepper motor control system provided by this application includes a memory and a processor, and a computer program capable of being loaded and executed by the processor, which is the same as any method in the first aspect, is stored on the memory.

[0047] Fourthly, this application provides a computer-readable storage medium storing a computer program that can be loaded by a processor and executed as in any of the methods of the first aspect.

[0048] In summary, this application includes at least one of the following beneficial technical effects:

[0049] 1. Optimize K in the PI calculation formula P K i This optimizes the control effect of the stepper motor control system on different types of 2-phase hybrid stepper motors.

[0050] 2. Adjust the sampling frequency according to the calculation time of each PI operation to improve computational efficiency and thus improve the accuracy of K calculations. P K i Optimize efficiency. Attached Figure Description

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

[0052] Figure 1 This is a flowchart of steps 101-104 in an embodiment of a method for optimizing control parameters of a two-phase stepper motor.

[0053] Figure 2 This is a flowchart illustrating steps 105-108 in the embodiment.

[0054] Figure 3 This is a graph showing the actual current change in the embodiment.

[0055] Figure 4 This is a block diagram of a system for optimizing control parameters of a two-phase stepper motor, as described in this embodiment.

[0056] Figure labeling: 1. PI tuning module; 2. K P K i 3. Optimization result processing module. Detailed Implementation

[0057] To make the objectives, technical solutions, and advantages of this invention clearer, the following description will be provided in conjunction with the appendix. Figure 1-4 The embodiments of the present invention will be described in further detail below.

[0058] The stepper motor control system inputs an input voltage U MWhen controlling the operation of different series of stepper motors, the actual current I of the stepper motor is... F Easy to use with the preset control current I R There are deviations between them. In this case, PI calculation is generally used to eliminate the deviations and calculate the control voltage U. R This application discloses a method for optimizing the control parameters of a two-phase stepper motor, mainly used to optimize the proportional term control parameter K in the PI formula when controlling different series of two-phase stepper motors in a stepper motor control system. P and integral term control parameter K i To match the optimal K for a 2-phase stepper motor controlled by the stepper motor control system. P and K i Through the optimal K P and K i To shorten the time required to obtain the control voltage U through PI calculation R The time required for the entire process is calculated, thereby optimizing the control effect of the stepper motor control system on different series of 2-phase stepper motors.

[0059] The aforementioned parameter optimization method is implemented primarily by a stepper motor control system, supplemented by a current sampling device. The stepper motor control system includes a processor and a memory. It controls the operation of the stepper motor and is communicatively connected to the current sampling device to control the device in collecting the actual current I of the stepper motor during operation. F and receive the above actual current value I F The current sampling device is used to collect the current during the operation of the stepper motor. The specific sampling method and corresponding hardware are existing technologies and will not be elaborated upon here. It should also be noted that this parameter optimization method is specifically for a two-phase stepper motor, and based on the symmetry of the two-phase windings of the two-phase stepper motor (hereinafter referred to as phase A and phase B), this method will only perform K-parameter optimization based on phase A. P and K i Optimized matching, K phase B P and K i Then, based on symmetry, the K corresponding to phase A is directly adopted. P and K i .

[0060] The following will be combined with the appendix Figure 1-3 The specific optimization process of the above parameter optimization method is explained in detail below:

[0061] Step 101: Receive parameter tuning instructions from the user via a smart terminal, based on the preset input voltage U. M To control the operation of the stepper motor, at preset time intervals T, a preset sampling device is controlled to measure the actual current I of the stepper motor. FSampling is performed, and the actual current I obtained from each sampling is received and saved. F .

[0062] In implementation, the stepper motor control system can be equipped with a touch screen, allowing users to optimize K as needed. P and K i The stepper motor control system triggers parameter tuning commands. Specifically, the system displays tuning buttons on its built-in touchscreen for users to tap. When a user taps the tuning button, the stepper motor control system will adjust the parameters based on a preset input voltage U. M Controlling the stepper motor's operation; the parameter optimization command can include the stepper motor's operating voltage range, and the stepper motor control system can update the preset input voltage U according to the operating voltage range in the parameter optimization command. M For example, the minimum value of the operating voltage range is used to update the input voltage U. M At this time, the stepper motor will work under the control of the stepper motor control system.

[0063] The stepper motor control system will control a preset current sampling device to sample the actual current I of the stepper motor every preset time interval T. F The stepper motor control system receives and stores the actual current I. F The preset duration T is a constant stored in the stepper motor control system. The value of the preset duration T can be between 40us and 60us. In this embodiment, T = 50us.

[0064] Step 102, whenever the sampled actual current I is received F At that time, based on the actual current I obtained from the current sampling F and the preset control current I R Based on pre-stored K P and K i The input voltage U is updated through PI calculation. M And based on the updated input voltage U M Control the operation of the stepper motor.

[0065] In implementation, the stepper motor control system receives the actual current I each time. F At that time, based on the actual current I received F and the preset control current I R The actual current I F and control current I R Input the PI expression to perform the calculation, where the PI expression is as follows: Among them, the control current I R To pre-store the current value in the stepper motor control system, I RSpecifically, it can be 'a' times the rated current of the motor, where the value of 'a' can range from 0.2 to 0.5; I R -I F Indicates the actual current I F Relative control current I R The deviation value, where n represents the number of samplings. The stepper motor control system updates the input voltage U using the calculated ΔU. M Specifically, the input voltage U M Updated to U M +△U; The stepper motor control system then uses the updated U M Reactivate the stepper motor so that the sampling device can obtain the updated U at the next sampling time point. M The corresponding actual current I F .

[0066] Step 103, when the sampling device detects the actual current I F When the number of samplings reaches the preset number of samplings n, sampling stops, and all actual currents I are... F The maximum value in is determined as the maximum actual current value I. FMAX All actual currents I F The mode in the equation is determined as the steady-state value of the current I. FV , will I FMAX respectively with X*I R Y*I R The comparison is performed, where X and Y are preset constants, and 1 ≤ X. <Y。

[0067] In implementation, the preset sampling number n is a constant pre-stored in the stepper motor control system, which can be 200. The sampling number n can be set according to the needs of the actual tuning process, as long as the actual current I is guaranteed. F The goal is to eventually reach a steady-state value. The stepper motor control system can accumulate the number of samples after each sampling. That is, the stepper motor control system can preset a sampling count table, including a sampling count field containing Arabic numerals, which is used when the actual current I is received each time. F When the sampling count field reaches 200, the stepper motor control system will increment the sampling count field by 1. When the sampling count field reaches 200, the stepper motor control system will stop sampling and clear the sampling count field to zero for the purpose of counting subsequent samples.

[0068] In implementation, the stepper motor control system can preset a current data table, which stores the actual current I corresponding to each sample during n sampling processes. F The stepper motor control system can also base its decisions on the actual current I obtained from n samplings. F Draw using preset drawing software, such as Figure 3 The actual current change curve shown is used to represent the actual current I during n sampling processes F ; where the abscissa is the sampling number, and the ordinate represents the actual current value.

[0069] In implementation, the stepping motor control system can, while stopping sampling, determine the maximum actual current value I from the current data table FMAX , and the current steady-state value I FV . Specifically, the stepping motor control system can obtain the maximum actual current value I by comparing the actual current I F one by one, and determine the current steady-state value I by counting the number of times each actual current I FMAX value appears repeatedly in the current data table F . Then, the stepping motor control system can compare I FV with X*I FMAX and Y*I R respectively to determine whether the K R used in the current PI operation formula reaches the optimal value, where X and Y are both preset constants, and 1 ≤ X < Y. In this embodiment, X can be 1 and Y can be 1.2. P

[0070] Step 104, if I FMAX < X*I R , then update the preset K P to K P +△K P ; if I FMAX > Y*I R , then update the preset K P to K P -△K P ; based on the updated K P and the preset input voltage U M , repeat the above operations of sampling the actual current I of the stepping motor n times, obtaining the maximum actual current value I F and the current steady-state value I FMAX , and comparing I FV with X*I FMAX and Y*I R respectively; where △K R is a constant greater than 0; P

[0071] In implementation, if I<00​​​​​​​​​​​F The value that eventually reaches steady state is less than I. FMAX If even I FMAX Both are less than X*I R , then I F The value that eventually reaches steady state will inevitably be less than I. R And cannot equal I R At this point, it is necessary to increase K. P To make I FMAX Get bigger, when I FMAX <X*I R At that time, the stepper motor control system will set the preset K... P Updated to K P +△K P Similarly, if I FMAX >Y*I R , that is I FMAX Too large, easily leads to I F The final steady-state value is greater than I. R Therefore, the stepper motor control system will preset K P Updated to K P -△K P In order to reduce K P To achieve K P The optimization, in which △K P This is a preset constant.

[0072] In both of the above cases, the stepper motor control system will be based on the updated K. P Repeat steps 101, 102, and 103 to plot the updated K. P The corresponding actual current change curve is used to determine the updated K. P The corresponding I FMAX and I FV , will I FMAX respectively with X*I R Y*I R Perform comparisons until the updated K is reached. P The corresponding I FMAX Satisfy: X*I R ≤I FMAX ≤Y*I R .

[0073] Step 105, if X*I R ≤I FMAX ≤Y*I R Then determine K P To reach the optimal value, the steady-state current value I will be... FV With Z*I R W*I RA comparison was performed, where Z and W are both preset constants greater than 0, and Z... <W。

[0074] In implementation, if X*I R ≤I FMAX ≤Y*I R This indicates that the current K P The optimal value has been reached, and the work on K has been completed. P After optimization, the stepper motor control system will I FV With Z*I R W*I R To determine K, a comparison is performed. i Whether the optimal value has been reached; in this embodiment, Z is 0.95 and W is 1.05.

[0075] Step 106, if I FV <Z*I R Then the preset K i Updated to K i +△K i , if I FV >W*I R Then the preset K i Updated to K i -△K i Based on the updated K i K has already reached its optimal value. P and the preset input voltage U M Repeat the above steps for the actual current I of the stepper motor. F Perform n samplings and obtain the maximum actual current value I through PI calculation. FMAX and the steady-state value of current I FV , will I FMAX respectively with X*I R Y*I R Perform a comparison operation;

[0076] In implementation, if I FV <Z*I R , indicating I F with I R The deviation still exists, and I F The current value corresponding to the steady state is less than I. R At this point, it is necessary to increase K. i To lower I F The current value corresponding to the eventual steady state is determined by the preset K value in the stepper motor control system. i Updated to K i +△K i Similarly, if I FV >W*I R , indicating I Fwith I R The deviation still exists, and I F The value corresponding to reaching steady state is greater than I. R At this point, it is necessary to reduce K. i To increase I F The current value corresponding to the eventual steady state is used to achieve control over K. i The stepper motor control system completes the tuning of K under the above two conditions. i After the update, it will be based on the updated K i K has already reached its optimal value. P Repeat steps 101, 102, and 103: plot the updated K. P The corresponding actual current change curve is used to determine the updated K. P The corresponding I FMAX and I FV , will I FMAX respectively with X*I R Y*I R A comparison was performed because K P The optimal value has been reached; therefore, the operation will proceed smoothly to step 106, and the updated K will be determined. i Has the optimal value been reached?

[0077] Step 107, if Z*I R ≤I FV ≤W*I R Then determine K i To reach the optimal value;

[0078] Step 108, if K P and K i Once all parameters reach their optimal values, a message indicating that tuning is complete will be displayed so that the user is aware that parameter tuning has been finished.

[0079] In implementation, if Z*I R ≤I FV ≤W*I R This indicates that K i When the optimal value is reached, K P and K i All reached their optimal values, and due to the preset K... P and K i Already in K P and K i The K is updated during the optimization process, therefore, the current K P and K iThis is the optimal value after tuning. At this point, the stepper motor control system can display the tuning completion information on the preset touch screen, so that the user knows that the parameter tuning has been completed. The specific content of the above information can be such as "The corresponding control parameters have been optimized based on the current motor, and the optimized K..." P and K i The value is ...... (specific numerical value)”

[0080] Optionally, the maximum actual current value I can be obtained through sampling and PI calculation. FMAX and the steady-state value of current I FV Throughout the entire operation, when K i When n ≠ 0, as the number of samplings n increases, the computational load of the PI operation will gradually increase, and the time consumed by the PI operation will also gradually increase. Therefore, in order to shorten the time required to obtain I... FMAX and I FV The time taken for the process can be adjusted by changing the interval between adjacent sampling time points based on the computation time consumed by the PI operation after each sampling. Specifically, the parameter optimization method also includes the following processing steps:

[0081] In each control, the preset sampling device collects the actual current I. F The timing begins simultaneously and continues until the actual current I is obtained from the current sampling. F And the PI operation completes the calculation of the input voltage U M The timer stops during the update and the timeout duration is set to the correction duration T. n Based on the correction duration T n And update the preset sampling period table with the current sampling count n, the sampling period table being used to store the sampling count n and the correction duration T. n The correspondence;

[0082] In step 101, "every preset time interval T, control the preset sampling device to sample the actual current I of the stepper motor". F Sampling is performed, and the actual current I obtained from each sampling is received and saved. F "Includes the following sub-steps:"

[0083] When K i When I = 0, every preset time interval T, the preset sampling device is controlled to sample the actual current I of the stepper motor. F Sampling is performed, and the actual current I obtained from each sampling is received and saved. F ;

[0084] When K i When ≠0, based on the number of samplings n and the correction duration T n The correspondence, every preset time interval T nThe preset sampling device controls the actual current I of the stepper motor. F Sampling is performed, and the actual current I obtained from each sampling is received and stored. F In practice, the interval between adjacent sampling time points generally includes the actual current I collected by the sampling device. F Duration of time, receiving I F The time consumed, and based on the currently received I F The corresponding ΔU is obtained through PI calculation, and the input voltage U is updated. M Duration; in K i When K = 0, the interval between adjacent sampling time points can be considered equal; therefore, the sampling time interval can be directly controlled by the preset duration T. However, at K... i When n ≠ 0, among all the above time durations, only the time consumed to acquire ΔU increases with the increase of n. Therefore, the stepper motor control system can control the sampling device to acquire the actual current I each time. F The timing begins simultaneously, and the input voltage U is updated upon completion. M When the timer stops, the above-mentioned time duration is the interval between the current sampling time point and the next sampling time point. The stepper motor control system can determine the above-mentioned statistical duration as the correction duration T. n and T n The correspondence between n and the sampling period is stored in a preset sampling period table, as shown in Table 1, which is used to store the number of samplings n and the correction duration T. n The correspondence is as follows: for example, when n=1, the corresponding Tn=40us, which means that the time interval between the first sampling time point and the second sampling time point is 40us.

[0085] Table 1

[0086] Number of samplings n 1 2 …… 199 Correction duration Tn 40us 40.05us …… 50us

[0087] Optional, combined Figure 3 It can be seen that the actual current I F As the number of samplings n increases, a steady-state value will eventually be reached. If the actual current I... F If a steady state is reached before the number of samplings reaches n, then to further improve the tuning efficiency, sampling can be terminated earlier; specifically, in step 103, "when the sampling device detects the actual current I..." F The step of "stop sampling when the number of samplings reaches the preset number of samplings n" also includes the following sub-steps:

[0088] If there exists a target sampling number less than the preset sampling number n, and the target sampling number and the actual current I corresponding to its first m samples... FIf all values ​​are the same, stop sampling and set the actual current I corresponding to the target number of samplings. F The actual current value I corresponding to each sample from the target sampling number up to the nth sampling number. F Save it; otherwise, when the sampling device detects the actual current I... F Sampling stops when the number of samplings reaches the preset number of samplings n.

[0089] In implementation, m can be 3, and the stepper motor control system can receive the actual current I each time. F and the actual current I F While saving to the current data table, the current actual current I is also saved. F The actual current I corresponding to the previous sampling time point in the current data table F For comparison, if the actual current I in the two cases is... F If the values ​​are the same, then the current actual current I will be... F The actual current I corresponding to a sampling time point previously F If the compared values ​​are still consistent, then the actual current I is determined. F Once a steady state is reached at the current sampling time point, the sampling count corresponding to the current sampling time point is the target sampling count. At this time, the stepper motor control system will increment the sampling count field to n (i.e., 200 in this embodiment), stop sampling, and set the actual current I corresponding to the target sampling count. F The actual current I corresponding to each sample from the target sampling number up to the nth sampling number. F Save the data to the current data table to supplement the actual current value of each sample from the target sampling number to the nth sampling number; for example, the actual current I obtained at the 180th sampling. F The actual current I obtained from the 179th and 178th samplings F When the current is consistent, the stepper motor control system will stop sampling and convert the actual current I obtained from the 180th sample into a constant value. F The actual current values ​​from the 180th to the 200th sample are stored in the current data table; conversely, if the target sampling number does not exist before the preset sampling number n, then the stepper motor control system will receive the actual current I corresponding to the nth sample. F Afterwards, the sampling equipment was controlled to stop sampling.

[0090] Optionally, parameter optimization methods also include:

[0091] If K P >K PMAX Then K P Updated to K PMAX If KP <K PMIN Then K P Updated to K PMIN ;where K PMAX K PMIN This is a preset constant;

[0092] If K i >K iMAX Then K i Updated to K iMAX If K i Less than K iMIN Then K i Updated to K iMIN ;where K iMAX K iMIN This is a preset constant;

[0093] In step 105, "If X*I" R ≤I FMAX ≤Y*I R Then determine K P "Achieving the optimal value" includes:

[0094] If X*I R ≤I FMAX ≤Y*I R or K P =K PMAX or K P =K PMIN Then determine K P To reach the optimal value;

[0095] In step 107, "If Z*I" R ≤I FV ≤W*I R Then determine K i "Achieving the optimal value" includes:

[0096] If Z*I R ≤I FV ≤W*I R or K i =K iMAX or K i =K iMIN Then determine K i The optimal value has been achieved.

[0097] In implementation, combining the steps described above, when it is necessary to process the pre-stored K... P and K i When making updates and adjustments, K can be adjusted. P The value is increased or decreased by △K P Adjustments, or adjustments to K i The value is increased or decreased by △K iAdjustments were made to prevent K from causing problems. P and K i Frequent additions and subtractions lead to K P and K i The situation where the optimization process gets stuck in an infinite loop and can never reach the optimal value is specifically referred to as K. P and K i Set the maximum and minimum values ​​respectively; where K PMAX That is, K P The maximum value of K PMIN That is, K P Minimum value, K iMAX That is, K i The maximum value, K iMIN That is, K i The minimum value.

[0098] The parameter optimization method in this application is applicable to two-phase hybrid stepper motors of series 20, 28, 39, 42, 57, 60, and 86; therefore, those skilled in the art will understand the K... PMAX K PMIN K iMAX K iMIN The numerical values ​​are based on actual test results of all the above-mentioned series of stepper motors. Specifically, K PMAX =0.36, K PMIN =0.2, K iMAX =0.003, K iMIN =0, pre-stored K P Value (i.e., K) P The initial value before optimization can be set to 0.5*(K). PMAX +K PMIN ), pre-stored K i (i.e. K) i The initial value before optimization can be set to K. i =K iMIN =0; in addition, △K P =(K PMAX -K PMIN ) / 100, △K i =(K iMAX -K iMIN ) / 100. And "Z*I" in step 107 R ≤I FV ≤W*I R Then determine K i "To reach the optimal value."

[0099] Optionally, to avoid matching the optimal K that has already been matched before. P and K iBy repeatedly optimizing the motor, the stepper motor can be matched with the optimal K-type stepper motor. P and K i Establish and store the corresponding relationships. When the stepper motor control system is needed to control the motor again, the corresponding K can be directly called. P and K i To improve the control efficiency of the stepper motor control system; specifically,

[0100] The parameter tuning instructions in step 101 include at least a motor attribute label, which is used to distinguish different types of stepper motors;

[0101] In step 108, "If K" P and K i Once all parameters reach their optimal values, a message indicating successful tuning will be displayed so that the user is aware that parameter tuning has been completed. This includes:

[0102] If K P and K i If all values ​​reach their optimal values, then K will be... P and K i The corresponding motor attribute labels in the parameter tuning instructions are added to the preset control parameter matching table, and the tuning completion information is displayed so that the user knows that the parameter tuning has been completed; the control parameter matching table is used to store the motor attribute labels and K P K i The correspondence;

[0103] Parameter optimization methods also include:

[0104] Receive parameter matching instructions sent by the user through a smart terminal. The parameter matching instructions include at least motor attribute data.

[0105] If a target motor attribute label exists in the control parameter matching table, and the content of the target motor attribute label matches the content of the motor attribute data, then the target K corresponding to the target motor attribute label is determined. P and target K i Using target K P and target K i Update current K P and K i Display and save the successful match information;

[0106] If the motor attribute data does not exist in the control parameter matching table, a matching failure message will be displayed so that the user can determine whether a parameter tuning command needs to be issued based on the displayed information.

[0107] In implementation, motor attribute labels are used to distinguish different types of stepper motors. The stepper motor control system can display attribute label input boxes on the touch screen for users to input the corresponding attribute label content. When the user completes the input of the attribute label content and touches the parameter tuning button, the parameter tuning command can be triggered.

[0108] The content and function of motor attribute data are the same as those of motor attribute tags. Both are used to characterize motor attributes and distinguish different types of motors. Specific content may include motor frame size, motor operating voltage range, motor inductance value, etc.

[0109] After completing K for a certain stepper motor P and K i After optimal matching, the stepper motor control system can become the optimal value of K. P and K i The motor attribute tags in the corresponding parameter tuning instructions are stored in a preset control parameter matching table.

[0110] When the user needs to match the optimal K for other different types of motors P and K i At this time, the stepper motor control system's built-in touch screen also displays a parameter matching button and a motor attribute data input box. Therefore, the user can manually enter the motor attribute data in the motor attribute data input box. When the user completes the input of the motor attribute data and touches the parameter matching button, the parameter matching instruction is triggered. At this time, the stepper motor control system can compare the motor attribute data with each motor attribute label in the control parameter matching table to determine whether there is a motor attribute label in the control parameter matching table that matches the content of the motor attribute data.

[0111] If it exists, it means that the above motor has already been matched with the optimal K. P and K i And it is stored in the control parameter matching table. The above motor attribute label is the target motor attribute label. At this time, the stepper motor control system can use the current K P and K i The initial value is updated to K corresponding to the target motor attribute label. P and K i The system displays a successful match message, such as "Match Successful," on the touchscreen. Conversely, if the target motor attribute label is not present in the control parameter matching table, the stepper motor control system displays a matching failure message, such as "Match Failed. You can tap the parameter optimization button to optimize parameters." In summary, this method avoids repeatedly matching the same motor to the optimal K. P and K i .

[0112] Optionally, to improve the efficiency of the stepper motor control system in comparing motor attribute data with each motor attribute label in the control parameter matching table, all groups K in the control parameter matching table can be compared. P and K i Sort by the number of successful matches from largest to smallest; specifically: successful match information includes the K corresponding to the motor attribute tag whose content matches the motor attribute data. P and K i And the time corresponding to a successful match;

[0113] Parameter optimization methods also include:

[0114] The number of successful matches within a preset time interval is counted every preset time interval, and based on the counted successful matches, the K group in the control parameter matching table is determined. P and K i The number of successful matches, based on each group K P and K i The number of successful matches and preset rules are used to update all K values ​​in the control parameter matching table. P and K i The arrangement and sorting.

[0115] In implementation, the "time corresponding to the successful match" in the successful match information can be represented in the form of year, month, and day; the preset duration can be 7 days or 30 days; the stepper motor control system can calculate the required time range according to the preset duration, starting from the initial time (e.g., February 1, 2022), such as February 1, 2022 to February 7, 2022. Then, based on the above time range, the stepper motor control system determines the successful match information within the above time range from the stored matching information. Next, the stepper motor control system counts the K values ​​from all successful match information that meet the above time range conditions. P and K i The number of times it appears is counted; if it does not appear again, the number of times it appears is 0, and the stepper motor control system will not include K in the above successful matching information. P and K i The corresponding repetition count is set to 0. The stepper motor control system first sets the corresponding K in descending order of the repetition count. P and K i Arrange the control parameter matching table from front to back.

[0116] Optionally, those skilled in the art can combine the optimized K P and K i Based on the corresponding motor attribute tags, the following pattern emerges: the larger the motor inductance value, the higher the K value.P The larger the optimal value, the better. Based on this principle, the parameter optimization method in this application also includes the following processing:

[0117] The motor attribute label includes the inductance value; step 101, "receiving parameter tuning instructions sent by the user through the smart terminal," includes:

[0118] Receive parameter tuning instructions from users via smart terminals;

[0119] Based on the inductance value in the parameter tuning instruction, a first inductance value is determined from the control parameter matching table. The first inductance value is less than the inductance value corresponding to the parameter tuning instruction and is closest to the inductance value corresponding to the parameter tuning instruction. A second inductance value is determined from the control parameter matching table. The second inductance value is greater than the inductance value corresponding to the parameter tuning instruction and is closest to the inductance value corresponding to the parameter tuning instruction.

[0120] Based on the parameter tuning instructions, determine the K value corresponding to the first inductance value. P and K i And K corresponding to the second inductance value P and K i The K values ​​corresponding to the first and second inductance values ​​are... P The average value is updated to the pre-stored K. P The K values ​​corresponding to the first and second inductance values ​​are... i Update to pre-stored K i .

[0121] In implementation, when there is no motor attribute label in the control parameter matching table that matches the motor attribute data, in order to make K P and K i The initial value before optimization is closer to the final optimal value, improving optimization efficiency. The stepper motor control system can find the two sets of inductance values ​​closest to the inductance value in the control parameter matching table based on the inductance value in the motor attribute data, namely the first inductance value and the second inductance value, where the first inductance value < the inductance value in the motor attribute data < the second inductance value. Then, the stepper motor control system sets the K corresponding to the first inductance value and the second inductance value. P The average value is updated to the pre-stored K. P Value (i.e., K) P (Initial values ​​before optimization), and K corresponding to the first inductance value and the second inductance value. i Update to pre-stored K i (i.e. K) i (Initial values ​​before optimization).

[0122] In summary, the parameter optimization method of this application eliminates the actual current I of the stepper motor through PI calculation. F With control current I RThe previous deviation value was used to calculate the control voltage U. R The maximum actual current value I is determined during the above PI calculation process. FMAX and steady-state current value I FV Then based on the maximum actual current value I FMAX and steady-state current value I FV Come to K P and K i The values ​​are optimized to match the optimal K for the stepper motor controlled by the stepper motor control system. P and K i To optimize the control effect of the stepper motor control system on different series of stepper motors.

[0123] This application includes a system for optimizing the control parameters of a two-phase stepper motor, comprising:

[0124] PI tuning module 1 is used to receive parameter tuning commands from the user via a smart terminal, based on a preset input voltage U. M To control the operation of the stepper motor, at preset time intervals T, a preset current sampling device is controlled to sample the actual current I of the stepper motor. F Sampling is performed, and the actual current I obtained from each sampling is received and saved. F It is also used to detect the actual current I obtained from each sample received. F At that time, based on the actual current I obtained from the current sampling F and the preset control current I R Based on pre-stored K P and K i The input voltage U is updated through PI calculation. M And based on the updated input voltage U M Controlling the operation of the stepper motor; also used when the sampling device detects the actual current I F When the number of samplings reaches the preset number of samplings n, sampling stops, and all actual currents I are... F The maximum value in is determined as the maximum actual current value I. FMAX All actual currents I F The mode in the equation is determined as the steady-state value of the current I. FV , will I FMAX respectively with X*I R Y*I R Perform a comparison;

[0125] K P K i Update module 2, used in I FMAX <X*I R At that time, the preset K will be used. P Updated to K P +△K P; It is also used in I AMAX >Y * I R When, preset K P Is updated to K P - △K P ; It is also used based on the updated K P , And the preset input voltage U M , Repeat the above operation of sampling the actual current I of the stepper motor F For n times, obtaining the maximum actual current value I through PI operation FMAX And the current steady-state value I FV , Comparing I FMAX With X * I R , Y * I R Respectively; where △K P , X, and Y are all preset constants, and △K P Is greater than 0, 1 ≤ X < Y; It is also used when X * I R ≤ I FMAX ≤ Y * I R When, comparing the current steady-state value I FV With Z * I R , W * I R Respectively, where Z and W are both preset constants greater than 0, and Z < W; It is also used when I FV < Z * I R When, preset K i Is updated to K i + △K i , It is also used when I FV > W * I R When, preset K i Is updated to K i - △K i , It is also used based on the updated K i , The K that has reached the optimal value P And the preset input voltage U M , Repeat the above operation of sampling the actual current I of the stepper motor F For n times, obtaining the maximum actual current value I through PI operation FMAX And the current steady-state value I FV , Comparing I FMAX With X * I R , Y * I R Respectively;

[0126] The optimization result processing module 3 is used to determine that K R ≤ I FV ≤ W * I R When, K i Reaches the optimal value; It is also used when K P And Ki When all parameters reach their optimal values, a message indicating that tuning is complete will be displayed so that the user is aware that parameter tuning has been completed.

[0127] Optional, also includes K P K i Control module, used in K P >K PMAX At that time, K P Updated to K PMAX Also used in the K P <K PMIN At that time, K P Updated to K PMIN ;where K PMAX K PMIN It is a preset constant; it is also used in K i >K iMAX At that time, K i Updated to K iMAX It is also used in K i Less than K iMIN At that time, K i Updated to K iMIN ;where K iMAX K iMIN This is a preset constant;

[0128] K P K i Update module 2 is also used in X*I R ≤I FMAX ≤Y*I R or K P =K PMAX or K P =K PMIN When, determine K P To achieve the optimal value; also used in Z*I R ≤I FV ≤W*I R or K i =K iMAX or K i =K iMIN When, determine K i The optimal value has been achieved.

[0129] Optionally, a correction duration determination module is also included, used to collect the actual current I at each time the preset sampling device is controlled. F The timing begins simultaneously and continues until the actual current I is obtained from the current sampling. F And the PI operation completes the calculation of the input voltage U M The timer stops during the update and the timeout duration is set to the correction duration T. n Based on the correction duration T nAnd update the preset sampling period table with the current sampling count n. The sampling period table is used to store the sampling count n and the correction duration T. n The correspondence;

[0130] PI tuning module 1 is also used in K i When I = 0, every preset time interval T, the preset sampling device is controlled to sample the actual current I of the stepper motor. F Sampling is performed, and the actual current I obtained from each sampling is received and saved. F Also used in K i When ≠0, based on the number of samplings n and the correction duration T n The correspondence, every preset time interval T n The preset sampling device controls the actual current I of the stepper motor. F Sampling is performed, and the actual current I obtained from each sampling is received and stored. F .

[0131] Optionally, the PI tuning module 1 is also used to address situations where the target sampling number is less than the preset sampling number n, and the actual current I corresponding to the target sampling number and its first m samples is... F If all values ​​are the same, stop sampling and set the actual current I corresponding to the target number of samplings. F The actual current value I corresponding to each sample from the target sampling number up to the nth sampling number. F Save; conversely, when the sampling device samples the actual current I... F Sampling stops when the number of samplings reaches the preset number of samplings n.

[0132] Optionally, the parameter tuning instructions should include at least a motor attribute label, which is used to distinguish different types of stepper motors;

[0133] The optimization result processing module 3 is also used in K P and K i When all values ​​reach their optimal values, K will be... P and K i The corresponding motor attribute labels from the parameter tuning instructions are added to the preset control parameter matching table, and the tuning completion information is displayed so that the user is aware that the parameter tuning has been completed; the control parameter matching table is used to store the motor attribute labels and K... P K i The correspondence;

[0134] It also includes a parameter matching module, used to receive parameter matching instructions issued by the user through a smart terminal, the parameter matching instructions including at least motor attribute data; and used to determine the target K corresponding to the target motor attribute label when a target motor attribute label exists in the control parameter matching table and the content of the target motor attribute label is consistent with the content of the motor attribute data. P and target K i Using target K P and target K i Update current K P and K i It displays and saves successful matching information; it is also used to display failed matching information when the motor attribute data does not exist in the control parameter matching table, so that the user can determine whether to issue a parameter tuning command based on the displayed information.

[0135] Optionally, successful matching information includes the K corresponding to the motor attribute tag whose content matches the motor attribute data. P and K i And the time corresponding to a successful match;

[0136] It also includes a matching table update module, which counts the number of successful matches within a preset time interval, and determines each group K in the control parameter matching table based on the counted successful matches. P and K i The number of successful matches, based on each group K P and K i The number of successful matches and preset rules are used to update all K values ​​in the control parameter matching table. P and K i The arrangement and sorting.

[0137] Optionally, the motor attribute label includes the inductance value;

[0138] The PI tuning module 1 is further configured to receive parameter tuning commands issued by the user via a smart terminal; to determine a first inductance value from a control parameter matching table based on the inductance value in the parameter tuning command, wherein the first inductance value is less than and closest to the inductance value corresponding to the parameter tuning command; to determine a second inductance value from the control parameter matching table, wherein the second inductance value is greater than and closest to the inductance value corresponding to the parameter tuning command; and to determine the K value corresponding to the first inductance value based on the parameter tuning command. P and K i And K corresponding to the second inductance value P and K i The K values ​​corresponding to the first and second inductance values ​​are... P The average value is updated to the pre-stored K. PThe K values ​​corresponding to the first and second inductance values ​​are... i Update to pre-stored K i .

[0139] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0140] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for optimizing control parameters of a two-phase stepper motor, characterized in that: Includes the following steps: Receive parameter tuning commands from users via smart terminals, based on preset input voltage U. M To control the operation of the stepper motor, at preset time intervals T, a preset sampling device is controlled to measure the actual current I of the stepper motor. F Sampling is performed, and the actual current I obtained from each sampling is received and saved. F ; Whenever the actual current I obtained from the sampling is received F At that time, based on the actual current I obtained from the current sampling F and the preset control current I R Based on pre-stored K P and K i The input voltage U is updated through PI calculation. M And based on the updated input voltage U M Control the operation of the stepper motor; When the sampling device measures the actual current I F When the number of samplings reaches the preset number of samplings n, sampling stops, and all actual currents I are... F The maximum value in is determined as the maximum actual current value I. FMAX All actual currents I F The mode in the equation is determined as the steady-state value of the current I. FV , will I FMAX respectively with X * I R Y*I R The comparison is performed, where X and Y are preset constants, and 1 ≤ X. <Y; If I FMAX < X *I R Then the preset K P Updated to K P +△K P ;if I FMAX >Y*I R Then the preset K P Updated to K P -△K P Based on the updated K P and the preset input voltage U M Repeat the above steps for the actual current I of the stepper motor. F Perform n samplings and obtain the maximum actual current value I through PI calculation. FMAX and the steady-state value of current I FV , will I FMAX respectively with X * I R Y*I R Perform a comparison operation; where △K P A constant greater than 0; If X * I R ≤I FMAX ≤Y*I R Then determine the K P To reach the optimal value, the steady-state current value I will be... FV With Z* I R W* I R A comparison is performed, where Z and W are both preset constants greater than 0, and Z < W; If I FV <Z* I R Then the preset K i Updated to K i +△K i , if I FV > W * I R Then the preset K i Updated to K i -△K i Based on the updated K i K has already reached its optimal value. P and the preset input voltage U M Repeat the above steps for the actual current I of the stepper motor. F Perform n samplings and obtain the maximum actual current value I through PI calculation. FMAX and the steady-state value of current I FV , will I FMAX respectively with X * I R Y*I R Perform a comparison operation; where △K i A constant greater than 0; If Z* I R ≤I FV ≤W * I R Then determine the K i To reach the optimal value; If K P and K i Once all parameters reach their optimal values, a message indicating that tuning is complete will be displayed so that the user is aware that parameter tuning has been completed. The parameter tuning instructions include at least a motor attribute label, which is used to distinguish different types of stepper motors; If K P and K i Once all parameters reach their optimal values, a message indicating successful tuning will be displayed to inform the user that parameter tuning has been completed. This includes: If K P and K i If all values ​​reach their optimal values, then K will be... P and K i The corresponding motor attribute tags in the parameter tuning instructions are added to the preset control parameter matching table, and the tuning completion information is displayed so that the user is aware that the parameter tuning has been completed; the control parameter matching table is used to store the motor attribute tags and K. P K i The correspondence; The method further includes: Receive parameter matching instructions sent by the user through a smart terminal, wherein the parameter matching instructions include at least motor attribute data; If a target motor attribute label exists in the control parameter matching table, and the content of the target motor attribute label matches the content of the motor attribute data, then the target K corresponding to the target motor attribute label is determined. P and target K i Using the target K P and target K i Update current K P and K i Display and save the successful match information; If the motor attribute data does not exist in the control parameter matching table, a matching failure message is displayed so that the user can determine whether a parameter tuning command needs to be issued based on the displayed information. The motor attribute label includes the inductance value; receiving parameter tuning instructions from the user via a smart terminal includes: Receive parameter tuning instructions from users via smart terminals; Based on the inductance value in the parameter tuning instruction, a first inductance value is determined from the control parameter matching table. The first inductance value is less than the inductance value corresponding to the parameter tuning instruction and is closest to the inductance value corresponding to the parameter tuning instruction. A second inductance value is determined from the control parameter matching table. The second inductance value is greater than the inductance value corresponding to the parameter tuning instruction and is closest to the inductance value corresponding to the parameter tuning instruction. Based on the parameter tuning instructions, determine the K value corresponding to the first inductance value. P and K i And K corresponding to the second inductance value P and K i The K values ​​corresponding to the first and second inductance values ​​are... P The average value is updated to the pre-stored K. P The K values ​​corresponding to the first and second inductance values ​​are... i Update to pre-stored K i .

2. The method for optimizing the control parameters of a two-phase stepper motor according to claim 1, characterized in that: The method further includes: If the K P K PMAX Then the K P Updated to K PMAX If the K P < K PMIN Then the K P Updated to K PMIN ;where K PMAX K PMIN This is a preset constant; If the K i >K iMAX Then the K i Updated to K iMAX If the K i Less than K iMIN Then the K i Updated to K iMIN ;where K iMAX K iMIN This is a preset constant; If X * I R ≤I FMAX ≤Y*I R Then determine the K P To achieve the optimal value, the following are included: If X * I R ≤I FMAX ≤Y*I R or K P =K PMAX or K P = K PMIN Then determine the K P To reach the optimal value; If Z* I R ≤I FV ≤W * I R Then determine the K i To achieve the optimal value, the following are included: If Z* I R ≤I FV ≤W * I R or K i =K iMAX or K i =K iMIN Then determine the K i The optimal value has been achieved.

3. The method for optimizing the control parameters of a two-phase stepper motor according to claim 1, characterized in that: The method further includes: In each control, the preset sampling device collects the actual current I. F The timing begins simultaneously and continues until the actual current I is obtained from the current sampling. F And the PI operation completes the calculation of the input voltage U M The timer stops during the update and the timeout duration is set to the correction duration T. n Based on the correction duration T n And update the preset sampling period table with the current sampling count n, the sampling period table being used to store the sampling count n and the correction duration T. n The correspondence; Every preset time interval T, a preset sampling device is controlled to sample the actual current I of the stepper motor. F Sampling is performed, and the actual current I obtained from each sampling is received and saved. F ;include: When K i When I = 0, every preset time interval T, the preset sampling device is controlled to sample the actual current I of the stepper motor. F Sampling is performed, and the actual current I obtained from each sampling is received and saved. F ; When K i When ≠0, based on the number of samplings n and the correction duration T n The correspondence, every preset time interval T n The preset sampling device controls the actual current I of the stepper motor. F Sampling is performed, and the actual current I obtained from each sampling is received and saved. F .

4. The method for optimizing the control parameters of a two-phase stepper motor according to claim 1, characterized in that: When the sampling device measures the actual current I F Sampling stops when the number of samples reaches the preset number of samples n, including: If there exists a target sampling number less than the preset sampling number n, and the target sampling number and the actual current I corresponding to its first m samples... F If all values ​​are the same, stop sampling and set the actual current I corresponding to the target number of samplings. F The actual current value I corresponding to each sample from the target sampling number up to the nth sampling number. F Save it; otherwise, when the sampling device detects the actual current I... F Sampling stops when the number of samplings reaches the preset number of samplings n.

5. The method for optimizing the control parameters of a two-phase stepper motor according to claim 1, characterized in that: The successful matching information includes the K corresponding to the motor attribute tag whose content matches the motor attribute data. P and K i And the time corresponding to a successful match; The method further includes: The number of successful matches within a preset time interval is counted every preset time interval, and based on the counted successful matches, each group K in the control parameter matching table is determined. P and K i The number of successful matches, based on each group K P and K i The number of successful matches and preset rules are used to update all K values ​​in the control parameter matching table. P and K i The arrangement and sorting.

6. A system for optimizing control parameters of a two-phase stepper motor, applied to the method for optimizing control parameters of a two-phase stepper motor as described in claim 1, characterized in that: include: PI tuning module (1) is used to receive parameter tuning instructions sent by the user through a smart terminal, based on the preset input voltage U. M To control the operation of the stepper motor, at preset time intervals T, a preset sampling device is controlled to measure the actual current I of the stepper motor. F Sampling is performed, and the actual current I obtained from each sampling is received and saved. F It is also used to detect the actual current I obtained from each sample received. F At that time, based on the actual current I obtained from the current sampling F and the preset control current I R Based on pre-stored K P and K i The input voltage U is updated through PI calculation. M And based on the updated input voltage U M Controlling the operation of the stepper motor; also used when the sampling device detects the actual current I F When the number of samplings reaches the preset number of samplings n, sampling stops, and all actual currents I are... F The maximum value in is determined as the maximum actual current value I. FMAX All actual currents I F The mode in the equation is determined as the steady-state value of the current I. FV , will I FMAX respectively with X * I R Y*I R The comparison is performed, where X and Y are preset constants, and 1 ≤ X. <Y; K P K i Update module (2), used in I FMAX < X *I R At that time, the preset K will be used. P Updated to K P +△K P Also used in I FMAX >Y*I R At that time, the preset K will be used. P Updated to K P -△K P It is also used based on the updated K. P and the preset input voltage U M Repeat the above steps for the actual current I of the stepper motor. F Perform n samplings and obtain the maximum actual current value I through PI calculation. FMAX and the steady-state value of current I FV , will I FMAX respectively with X * I R Y*I R Perform a comparison operation; where △K P It is a constant greater than 0; it is also used in X * I R ≤I FMAX ≤Y*I R At that time, the steady-state value of the current I FV With Z* I R W* I R A comparison is performed, where Z and W are both preset constants greater than 0, and Z < W; it is also used in I FV <Z* I R At that time, the preset K will be used. i Updated to K i +△K i It is also used in I FV > W * I R At that time, the preset K will be used. i Updated to K i -△K i It is also used based on the updated K i K has already reached its optimal value. P and the preset input voltage U M Repeat the above steps for the actual current I of the stepper motor. F Perform n samplings and obtain the maximum actual current value I through PI calculation. FMAX and the steady-state value of current I FV , will I FMAX respectively with X * I R Y*I R Perform a comparison operation; The optimization result processing module (3) is used to process Z*I R ≤I FV ≤W * I R When, determine the K i To achieve the optimal value; also used in K P and K i When all parameters reach their optimal values, a message indicating that tuning is complete will be displayed so that the user is aware that parameter tuning has been completed.

7. A two-phase stepper motor control system, characterized in that: It includes a memory and a processor, wherein the memory stores a computer program that can be loaded by the processor and executed according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that: The computer program is stored that can be loaded by a processor and executed according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Automatic Tuning Method for Control Gains in CenterPosition Control of Steel Sheet

    KR1020020052714A