Linear motor current loop self-tuning method, device, storage medium and electronic equipment
The current loop parameters are adjusted through the Bode diagram frequency sweep method and algorithm, and the motor is broken due to the incorrect phase position in the current loop debugging, achieving stable operation of the motor and efficient debugging of the current loop.
Patent Information
- Application Number
- CN202411278810.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-12
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2044-09-12
AI Technical Summary
If the phase position of the current ring is incorrect during debugging, a large q-axis current component may be generated during large current, causing the motor to run wild and cause serious failure.
The current loop debugging is performed using Bode diagram sweeping method, and the motor response is detected through rapidly changing frequency, reducing the motor's large movement and avoiding the motor's storm. At the same time, the current loop gain and parameters are adjusted through algorithms to reduce human intervention and ensure accurate phase position.
It effectively reduces the probability of large-scale movement and storm of the motor, reduces human intervention errors, and ensures the stable operation of the current ring within the entire current range.
Smart Images

Figure CN119135019B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of current loop self-tuning, and specifically relates to a linear motor current loop self-tuning method, device, storage medium and electronic equipment. Background Art
[0002] Current loop debugging is a key step to ensure fast response and stable operation of the motor control system. During the debugging process, the parameters of the PI controller need to be accurately adjusted, and actual tests need to be performed to optimize system performance. When debugging the current loop, the command ID current is generally increased from 10% to 100%, and debugging is required within the full current range. If the phase position is incorrect, a large q-axis current component may be generated at high current, causing the motor to run away and cause serious failures. Summary of the invention
[0003] The purpose of the present application is to provide a linear motor current loop self-tuning method, device, storage medium and electronic device to solve the problem in the prior art that when the current loop is debugged, if the phase position is incorrect, a large current may generate a large q-axis current component, causing the motor to run away and cause serious faults.
[0004] In order to achieve the above-mentioned object, the first aspect of the present application provides a linear motor current loop self-tuning method, comprising:
[0005] Setting initial tuning parameters and expected bandwidth based on system parameters, and inputting tuning current, the system parameters including inductance, resistance, rated current and servo frequency, the initial tuning parameters including initial proportional gain, initial integral gain, initial reverse proportional gain and initial zero crossing gain;
[0006] Iterate the proportional gain and the integral gain based on the update scheme, and obtain the Bode diagram of the current iteration after the iteration;
[0007] Determine whether the current resonance amplitude, the previous resonance amplitude, and the update scheme of the current iteration meet a preset condition, and if the preset condition is not met, generate an update scheme for the next iteration based on the current resonance amplitude, the previous resonance amplitude, the concave characteristic of the Bode diagram of the current iteration, and the update scheme of the current iteration, until the preset condition is met, wherein the current resonance amplitude and the previous resonance amplitude are the resonance amplitudes of the Bode diagrams of the current iteration and the previous iteration, respectively;
[0008] Based on the current bandwidth, the previous bandwidth and the expected bandwidth, determine whether the proportional gain and the integral gain of the current iteration meet the requirements, and if they do not meet the requirements, generate an update plan for the next iteration based on the current bandwidth and the expected bandwidth until they meet the requirements, and increase the number of parameter successes by 1, wherein the current bandwidth and the previous bandwidth are the bandwidths of the current iteration and the previous iteration respectively;
[0009] When the total number of parameter successes reaches a first threshold, the parameter tuning of the proportional gain and the integral gain is completed, and the zero-crossing gain is tuned based on the tuned proportional gain and the integral gain.
[0010] In one or more embodiments, the step of setting the initial tuning parameters and the desired bandwidth based on the system parameters includes:
[0011] estimating the initial proportional gain and the initial integral gain based on the inductance and the resistance;
[0012] Based on the servo frequency, setting a desired bandwidth; and / or,
[0013] The initial inverse proportional gain and the initial zero-crossing gain are 0.
[0014] In one or more embodiments, the step of iterating the proportional gain and / or the integral gain based on the update scheme and obtaining the Bode diagram of the current iteration after the iteration includes:
[0015] Poll the status of the Bode graph in each iteration;
[0016] If the state of the Bode graph is not started, the number of Bode graph iterations is increased by 1, and it is determined whether the total number of Bode graph iterations exceeds a second threshold;
[0017] If not, obtain the current proportional gain and integral gain, and calculate the total number of gain acquisitions;
[0018] If the total number of times the current gain is obtained is not 1, the proportional gain and the integral gain are updated based on the update scheme, and the start Bode flag is set so that the plotBode class object detects the start Bode flag and generates a Bode plot;
[0019] If the status of the Bode graph is completed, get the Bode graph of the current iteration.
[0020] In one or more embodiments, the step of setting the start Bode flag to position also includes:
[0021] Determining whether the proportional gain and the integral gain are unchanged;
[0022] If so, switch to the error state and reset to the initial state; and / or,
[0023] The step of iterating the proportional gain and / or the integral gain based on the update scheme and obtaining the Bode diagram of the current iteration after the iteration also includes:
[0024] If the total number of Bode diagram iterations exceeds the second threshold, the system switches to an error state and resets to an initial state.
[0025] In one or more embodiments, the preset conditions include: the current resonance amplitude is less than 1 dB, the previous resonance amplitude is greater than 1 dB, and the integral gain in the current iterative update scheme is reduced.
[0026] In one or more embodiments, the step of generating an update scheme for the next iteration based on the current resonance amplitude, the previous resonance amplitude, the concave characteristics of the Bode diagram of the current iteration, and the update scheme of the current iteration includes:
[0027] When the current resonance amplitude and the previous resonance amplitude are both less than 1 dB, increasing the integral gain by a preset proportion in the next iteration; and / or,
[0028] When the current resonance amplitude is greater than 1 dB and the deviation between the current resonance amplitude and the previous resonance amplitude is less than 10%, based on the update scheme of the current iteration, the change of the proportional gain and the integral gain in the current iteration is determined;
[0029] If only the proportional gain changes in the current iteration, the integral gain is increased by a preset ratio in the next iteration;
[0030] If the proportional gain and the integral gain do not change in the current iteration, the integral gain is reduced by a preset ratio in the next iteration;
[0031] If only the integral gain changes in the current iteration, determine whether there is a depression before the resonance point in the Bode diagram of the current iteration;
[0032] If there is no depression, the proportional gain is increased by a preset ratio in the next iteration;
[0033] If there is a depression, reducing the proportional gain by a preset ratio in the next iteration; and / or,
[0034] When the current resonance amplitude is greater than 1 dB and the current resonance amplitude is greater than the previous resonance amplitude, the integral gain is reduced by a preset proportion in the next iteration; and / or,
[0035] When the current resonance amplitude is greater than 1 dB and the current resonance amplitude is less than the previous resonance amplitude, the update scheme of the current iteration is used as the update scheme of the next iteration; and / or,
[0036] When the current resonance amplitude is less than 1 dB, the previous resonance amplitude is greater than 1 dB, and the integral gain is not reduced in the update scheme of the current iteration, the integral gain is increased by a preset proportion in the next iteration.
[0037] In one or more embodiments, the step of judging whether the proportional gain and the integral gain of the current iteration meet the requirements based on the current bandwidth, the previous bandwidth and the expected bandwidth includes:
[0038] Determine whether the deviation between the current bandwidth and the previous bandwidth is within 5%;
[0039] If yes, add 1 to the number of bandwidth saturation times, and determine whether the total number of bandwidth saturation times is less than a third threshold;
[0040] If so, compare the current bandwidth with the expected bandwidth;
[0041] If the current bandwidth is greater than the first multiple of the expected bandwidth and less than the second multiple of the expected bandwidth, the proportional gain and integral gain of the current iteration meet the requirements.
[0042] In one or more embodiments, the step of determining whether the proportional gain and the integral gain of the current iteration meet the requirements based on the current bandwidth, the previous bandwidth, and the expected bandwidth further includes:
[0043] If the deviation between the current bandwidth and the previous bandwidth is not within 5%, the total number of bandwidth saturation is reset to zero, and the current bandwidth is compared with the expected bandwidth; and / or,
[0044] The step of generating an update solution for the next iteration based on the current bandwidth and the expected bandwidth when the requirement is not met comprises:
[0045] If the current bandwidth is less than the first multiple of the expected bandwidth, the proportional gain and the integral gain are increased synchronously by a preset ratio in the next iteration; and / or,
[0046] If the current bandwidth is greater than the second multiple of the expected bandwidth, the proportional gain and the integral gain are synchronously reduced by a preset ratio in the next iteration.
[0047] In one or more embodiments, it further includes:
[0048] If the total number of parameter successes does not reach the first threshold, the last resonance amplitude is cleared and the resonance detection pass flag is set.
[0049] In order to achieve the above-mentioned object, the second aspect of the present application provides a linear motor current loop self-tuning device, comprising:
[0050] An initialization module, used to set initial setting parameters and expected bandwidth based on system parameters, and input setting current, wherein the system parameters include inductance, resistance, rated current and servo frequency, and the initial setting parameters include initial proportional gain, initial integral gain, initial reverse proportional gain and initial zero crossing gain;
[0051] A Bode diagram acquisition module, used for iterating the proportional gain and / or the integral gain based on the update scheme, and obtaining the Bode diagram of the current iteration after the iteration;
[0052] A resonance amplitude determination module, used to determine whether the current resonance amplitude, the previous resonance amplitude, and the update scheme of the current iteration meet a preset condition, and if the preset condition is not met, generate an update scheme for the next iteration based on the current resonance amplitude, the previous resonance amplitude, the concave characteristics of the Bode diagram of the current iteration, and the update scheme of the current iteration, until the preset condition is met, wherein the current resonance amplitude and the previous resonance amplitude are the resonance amplitudes of the Bode diagrams of the current iteration and the previous iteration, respectively;
[0053] A bandwidth determination module is used to determine whether the proportional gain and integral gain of the current iteration meet the requirements based on the current bandwidth, the previous bandwidth and the expected bandwidth, and if they do not meet the requirements, generate an update scheme for the next iteration based on the current bandwidth and the expected bandwidth until the proportional gain and integral gain of the current iteration meet the requirements, and increase the number of parameter successes by 1, wherein the current bandwidth and the previous bandwidth are the bandwidths of the current iteration and the previous iteration respectively;
[0054] The tuning completion module is used to complete the parameter tuning of the proportional gain and the integral gain when the total number of parameter successes reaches a first threshold, and to tune the zero-crossing gain based on the tuned proportional gain and the integral gain.
[0055] In order to achieve the above-mentioned object, the third aspect of the present application provides an electronic device, including:
[0056] at least one processor; and
[0057] A memory storing instructions, which, when executed by the at least one processor, enables the at least one processor to execute the linear motor current loop self-tuning method as described in any of the above embodiments.
[0058] In order to achieve the above-mentioned purpose, the fourth aspect of the present application provides a machine-readable storage medium, which stores executable instructions, and when the instructions are executed, the machine executes the linear motor current loop self-tuning method as described in any of the above-mentioned embodiments.
[0059] Different from the prior art, the beneficial effects of this application are:
[0060] The present application uses a Bode plot frequency sweep method to debug the current loop. During the frequency sweep, the system detects the motor response through rapidly changing frequencies, and the physical movement of the motor is very small, which greatly reduces large-scale movement of the motor and avoids motor runaway. In addition, human intervention is reduced, and phase position errors that may be caused by manual debugging misoperation or human intervention are avoided, thereby avoiding the generation of larger Iq components and motor runaway. The algorithm adjusts the current loop gain and parameters, starting within a smaller current range and gradually increasing the current without the need for manual intervention by the user, thus avoiding errors caused by manual intervention. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0062] Figure 1 It is a flow chart of an implementation method of a linear motor current loop self-tuning method of the present application;
[0063] Figure 2 It is the control diagram of the current loop;
[0064] Figure 3 It is the Bode diagram of the current loop of the type I standard system;
[0065] Figure 4 yes Figure 1 A schematic diagram of a flow chart of an implementation method corresponding to S200;
[0066] Figure 5 yes Figure 1 A schematic diagram of a flow chart of an implementation method corresponding to S400;
[0067] Figure 6 It is a schematic diagram of an implementation method of a zerocorss curve of the present application;
[0068] Figure 7 It is a structural schematic diagram of an implementation method of a linear motor current loop self-tuning device of the present application;
[0069] Figure 8 It is a schematic structural diagram of an embodiment of an electronic device of the present application. DETAILED DESCRIPTION
[0070] In order to enable those skilled in the art to better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work should fall within the scope of protection of the present application.
[0071] In order to solve the problem that in the current current loop debugging process, if the phase position is incorrect, a large q-axis current component may be generated when the current is large, causing the motor to run away, the applicant has developed a new DC motor current loop self-tuning method. This method uses a Bode diagram sweep frequency method to debug the current loop, which greatly reduces the probability of large-scale movement or even runaway of the motor, and uses an algorithm for debugging to avoid the possibility of phase position errors caused by human intervention errors.
[0072] Specifically, see Figure 1 , Figure 1 It is a flow chart of an implementation method of a linear motor current loop self-tuning method of the present application.
[0073] like Figure 1 As shown, the method includes:
[0074] S100, set initial setting parameters and expected bandwidth based on system parameters, and input setting current.
[0075] The system parameters include inductance, resistance, rated current and servo frequency, and the initial setting parameters include initial proportional gain, initial integral gain, initial reverse proportional gain and initial zero crossing gain.
[0076] Specifically, the initial proportional gain and initial integral gain can be estimated based on the inductance and resistance, as described in detail below:
[0077] See also Figure 2 , Figure 2 is the control diagram of the current loop. Figure 2 As shown, in order to make the current loop have faster current following performance, the control model of the current loop is simplified, the model of the current loop can be made into a type I standard system, and the system stability can be improved by zero-pole cancellation.
[0078] Specifically, zero-pole cancellation means that Figure 2 The zero point of the current loop PI regulator is equal to the pole of the controlled object, and the following formula is obtained: Among them, Kp is the proportional gain, Ki is the integral gain, and R is the resistance.
[0079] At the same time, let the current loop be a type I standard system, and Kpwm is 1 in the ideal state, and the following formula can be obtained: T = 1.5Ts. According to classical control theory, the system performance is best when the damping ratio is 0.707. Based on the relationship between the typical I-type system following performance index and the frequency index and parameters, it can be seen that when the damping ratio is 0.707, KT = 0.5, thus obtaining the following formula:
[0080] Based on the above two equations, we can get the relationship between proportional gain and integral gain and inductance and resistance: Therefore, the initial proportional gain and initial integral gain can be estimated based on the inductance and resistance.
[0081] In order to prevent the preset value from affecting the tuning result, the initial reverse proportional gain and the initial zero-crossing gain can both be 0.
[0082] The desired bandwidth is the target of the setting, which can be obtained based on the preset servo frequency. In one embodiment, 1 / 5 of the PWM switching period can be used as the desired bandwidth for correction. In other embodiments, the desired bandwidth can also be adjusted accordingly based on the actual working conditions.
[0083] The setting current is selected based on the rated current. In one embodiment, the setting current can be gradually increased from 10% to 100% of the rated current, so that the parameters can be set within the full current range.
[0084] S200, iterating the proportional gain and the integral gain based on the update scheme, and obtaining the Bode diagram of the current iteration after the iteration.
[0085] In one embodiment, a method for obtaining the Bode diagram of the current iteration may be to set a start Bode flag after the iteration, and the plotBode class object may detect the start Bode flag and generate the Bode diagram of the current iteration.
[0086] By iteratively updating the proportional gain and integral gain and obtaining the Bode diagram corresponding to each iteration, the update plan for the next iteration can be obtained based on the Bode diagram until the Bode diagram reaches an ideal state and parameter tuning is completed.
[0087] See also Figure 3 , Figure 3 is the Bode diagram of the current loop of the type I standard system, Figure 3 Figure a is the Bode diagram under ideal conditions, where there is no resonance point and the bandwidth is relatively high; Figure b has overshoot, and Figure c has amplitude attenuation in the frequency range before the resonance point -3dB, both of which do not meet the requirements.
[0088] The update strategy of the present application is to scan the Bode diagram, adjust the parameters based on the Bode diagram, eliminate the resonance point, make the Bode diagram shape meet the requirements, and then adjust the parameters to make the bandwidth meet the expected value under the premise that the shape meets the requirements, thus completing the parameter setting.
[0089] The following is a detailed description of the method for obtaining the Bode diagram in this application. Figure 4 , Figure 4 yes Figure 1 A schematic flow chart of an implementation method corresponding to S200.
[0090] like Figure 4 As shown, the iterative methods include:
[0091] S201 , polling and determining the status of the Bode diagram in each iteration.
[0092] S202: If the state of the Bode graph is not started, increase the number of Bode graph iterations by 1, and determine whether the total number of Bode graph iterations exceeds a second threshold.
[0093] First, the state of the Bode graph can be determined by polling. The Bode graph includes the states of not started, in progress and generated. If the Bode graph has not started, it means that the Bode flag is not set at this time. At this time, the number of Bode graph iterations can be increased by 1, and it can be determined whether the total number of iterations exceeds the second threshold.
[0094] Among them, the second threshold is preset and is used to determine whether there is an error in the system. When the total number of iterations exceeds the second threshold and the parameter tuning is still not completed, it can be determined that there is an error in the system. At this time, it can be switched to the error state and reset to the initial state to restart self-tuning.
[0095] In one implementation, the second threshold may be 50 times. In other implementations, it may also be adjusted based on actual working conditions, and the requirements of this implementation can be achieved.
[0096] If the total number of Bode graph iterations does not exceed the second threshold, the method further includes:
[0097] S203, obtaining the current proportional gain and integral gain, and calculating the total number of gain acquisition times.
[0098] S204: If the total number of current gain acquisitions is not 1, the proportional gain and the integral gain are updated based on the update scheme, and the start Bode flag is set so that the plotBode class object detects the start Bode flag and generates a Bode plot.
[0099] It can be understood that when the total number of gain acquisitions is 1, that is, the current iteration is the first time to obtain the proportional gain and integral gain, there is no need to update at this time, and the start Bode flag can be directly set to obtain the corresponding Bode diagram; when it is not the first time to obtain the proportional gain and integral gain, it is necessary to update the parameters and then set the start Bode flag to obtain the corresponding Bode diagram.
[0100] Among them, the update scheme may include increasing, decreasing and keeping unchanged the proportional gain and the integral gain, which can be obtained based on the subsequent analysis of the Bode diagram and the bandwidth, or it can be a preset adjustment rule, or it can be a random adjustment, or it can be a combination of several, all of which can achieve the effect of this embodiment.
[0101] In one embodiment, after the proportional gain and the integral gain are updated, it can also be determined whether the proportional gain and the integral gain have not changed. If there is no change, it can be determined that there is an error in the system, and the system can be switched to an error state and reset to an initial state to restart self-tuning.
[0102] S205: If the state of the Bode graph is generated, obtain the Bode graph of the current iteration.
[0103] In response to the start Bode flag being set, the plotBode class object starts to generate a Bode diagram. When S201 determines that the state of the Bode diagram is generated, the Bode diagram of the current iteration is obtained.
[0104] S300, determining whether the current resonance amplitude, the previous resonance amplitude, and the update scheme of the current iteration meet the preset conditions, and if the preset conditions are not met, generating the update scheme of the next iteration based on the current resonance amplitude, the previous resonance amplitude, the concave characteristics of the Bode diagram of the current iteration, and the update scheme of the current iteration, until the preset conditions are met.
[0105] The current resonance amplitude and the last resonance amplitude are the resonance amplitudes of the Bode diagrams of the current iteration and the last iteration, respectively.
[0106] Based on the above S200, the Bode diagram of the current iteration is obtained. By comparing the resonance amplitudes of the Bode diagrams of the current iteration and the previous iteration, and combining the concave characteristics of the Bode diagram of the current iteration and the update scheme of the current iteration, an update scheme for the next iteration can be generated, so that the Bode diagram of the next iteration can change in the desired direction.
[0107] Until the resonance amplitudes of the Bode diagrams of the current iteration and the previous iteration and the update scheme of the current iteration meet the preset conditions, the resonance detection pass flag can be set to proceed to the next step of the judgment procedure.
[0108] Specifically, the following describes in detail how to generate the update scheme for the next iteration based on the current resonance amplitude, the previous resonance amplitude, the concave characteristic of the Bode diagram of the current iteration, and the update scheme of the current iteration.
[0109] In an application scenario, when the current resonance amplitude and the previous resonance amplitude are both less than 1 dB, the integral gain is increased by a preset proportion in the next iteration, that is, the update scheme for the next iteration is to increase the integral gain by a preset proportion, wherein the preset proportion can be 30% or the like, and can be adjusted based on actual working conditions.
[0110] In an application scenario, when the current resonance amplitude is greater than 1 dB and the deviation between the current resonance amplitude and the previous resonance amplitude is less than 10%, based on the update scheme of the current iteration, the change of the proportional gain and the integral gain in the current iteration is determined;
[0111] If only the proportional gain changes in the current iteration, the integral gain is increased by a preset ratio in the next iteration, that is, the update scheme for the next iteration is to increase the integral gain by a preset ratio, wherein the preset ratio may be 30%, etc., and may be adjusted based on actual working conditions;
[0112] If the proportional gain and the integral gain do not change in the current iteration, the integral gain is reduced by a preset ratio in the next iteration, that is, the update scheme of the next iteration is to reduce the integral gain by a preset ratio, wherein the preset ratio may be 30%, etc., and may be adjusted based on actual working conditions;
[0113] If only the integral gain changes in the current iteration, it means that the proportional gain needs to change in the next iteration, and further analysis is required based on the concave characteristics of the Bode plot of the current iteration, as follows:
[0114] If there is no depression before the resonance point in the Bode diagram of the current iteration, the proportional gain is increased by a preset ratio in the next iteration, that is, the update scheme of the next iteration is to increase the proportional gain by a preset ratio, wherein the preset ratio may be 30%, etc., and may be adjusted based on actual working conditions;
[0115] If there is a depression before the resonance point in the Bode diagram of the current iteration, the proportional gain is reduced by a preset proportion in the next iteration, that is, the update scheme of the next iteration is to reduce the proportional gain by a preset proportion, wherein the preset proportion can be 30% or the like, and can be adjusted based on actual working conditions.
[0116] In an application scenario, when the current resonance amplitude is greater than 1dB and the current resonance amplitude is greater than the previous resonance amplitude, the integral gain is reduced by a preset proportion in the next iteration, that is, the update scheme for the next iteration is to reduce the integral gain by a preset proportion, wherein the preset proportion can be 30% or the like, and can be adjusted based on actual working conditions.
[0117] In an application scenario, when the current resonance amplitude is less than 1dB, the previous resonance amplitude is greater than 1dB, and the integral gain has not decreased in the current iteration update scheme, the integral gain is increased by a preset proportion in the next iteration, that is, the next iteration update scheme is to increase the integral gain by a preset proportion, wherein the preset proportion can be 30% or the like, and can be adjusted based on actual operating conditions.
[0118] Based on the update scheme of the next iteration obtained by the above analysis, the Bode diagram of the parameters is continuously updated until the current resonance amplitude, the previous resonance amplitude and the update scheme of the current iteration meet the preset conditions.
[0119] In one embodiment, after the preset conditions are met, the resonance detection pass flag can be set to proceed to the next bandwidth determination procedure; synchronously, when starting to determine whether the current resonance amplitude, the previous resonance amplitude, and the current iterative update scheme meet the preset conditions, it can be first determined whether the resonance detection pass flag is set. If it is set, it can be directly determined that the resonance amplitude does not need to be adjusted, and the next bandwidth determination procedure can be directly entered.
[0120] In one embodiment, the preset condition is: the current resonance amplitude is less than 1 dB, the previous resonance amplitude is greater than 1 dB, and the integral gain in the current iterative update scheme is reduced.
[0121] Of course, in other implementations, preset conditions may also be set based on actual needs.
[0122] S400, based on the current bandwidth, the previous bandwidth and the expected bandwidth, determine whether the proportional gain and the integral gain of the current iteration meet the requirements, and if they do not meet the requirements, generate an update plan for the next iteration based on the current bandwidth and the expected bandwidth until the requirements are met, and increase the number of parameter successes by 1.
[0123] The current bandwidth and the previous bandwidth are the bandwidths of the current iteration and the previous iteration respectively.
[0124] After the above resonance amplitude judgment is passed, in order to further make the bandwidth close to the expected bandwidth, a bandwidth judgment analysis can be performed to adjust the parameters accordingly until the bandwidth meets the expected bandwidth. At this time, the proportional gain and the integral gain meet the requirements.
[0125] Specifically, see Figure 5 , Figure 5 yes Figure 1 A flow chart of an implementation method corresponding to S400 in FIG.
[0126] like Figure 5 As shown, the bandwidth determination procedure includes:
[0127] S401: Determine whether the deviation between the current bandwidth and the previous bandwidth is within 5%.
[0128] If the deviation is within 5%, it also includes:
[0129] S402a: Add 1 to the number of bandwidth saturation times, and determine whether the total number of bandwidth saturation times is less than a third threshold.
[0130] The third threshold may be any preset value, such as 2, and may be adjusted based on actual needs.
[0131] If the deviation is not within 5%, the synchronization with S502a also includes:
[0132] S402b. Clear the total number of bandwidth saturation times to zero.
[0133] After S502a and S502b, if the total number of bandwidth saturation times is less than the third threshold, the method further includes:
[0134] S403: Compare the current bandwidth with the expected bandwidth.
[0135] By comparing the current bandwidth with the expected bandwidth, it can be determined whether the current bandwidth meets expectations. If so, the proportional gain and integral gain meet the requirements.
[0136] Specifically, it includes:
[0137] S404a: If the current bandwidth is greater than the first multiple of the expected bandwidth and less than the second multiple of the expected bandwidth, the proportional gain and integral gain of the current iteration meet the requirements.
[0138] The first multiple and the second multiple may be preset values, for example, the first multiple may be 0.8 and the second multiple may be 1.5, thereby limiting the current bandwidth to meet the desired range and being adjustable based on actual needs.
[0139] Synchronized with S404a also include:
[0140] S404b: If the current bandwidth is less than the first multiple of the expected bandwidth, the proportional gain and the integral gain are increased synchronously by a preset ratio in the next iteration.
[0141] That is, the update scheme for the next iteration is to increase the proportional gain and the integral gain synchronously at a preset ratio to increase the bandwidth of the next iteration and make it closer to the desired bandwidth, wherein the preset ratio may be 30% or the like and may be adjusted based on actual working conditions.
[0142] S404c: If the current bandwidth is greater than the second multiple of the expected bandwidth, the proportional gain and the integral gain are synchronously reduced by a preset ratio in the next iteration.
[0143] That is, the update scheme for the next iteration is to simultaneously reduce the proportional gain and the integral gain at a preset ratio to reduce the bandwidth of the next iteration and bring it closer to the desired bandwidth, wherein the preset ratio may be 30%, etc., and may be adjusted based on actual working conditions.
[0144] In an application scenario, if the total number of bandwidth saturation times is greater than or equal to the third threshold, it means that the proportional gain and integral gain of the current iteration need to be further updated, and the bandwidth is compared with the expected bandwidth after the update is completed.
[0145] Based on the above steps, until the proportional gain and integral gain of the current iteration meet the requirements, it also includes:
[0146] S500: When the total number of parameter successes reaches a first threshold, complete parameter tuning of the proportional gain and the integral gain, and tune the zero-crossing gain based on the tuned proportional gain and the integral gain.
[0147] When the proportional gain and integral gain of the current iteration meet the requirements, the number of parameter successes is increased by 1, and the total number of parameter successes is obtained.
[0148] If the total number of parameter successes reaches the first threshold, the parameter tuning of the proportional gain and the integral gain is completed.
[0149] In an application scenario, if the total number of parameter successes does not reach the first threshold, the last resonance amplitude needs to be cleared and the resonance detection pass flag is set to avoid using the last resonance amplitude in the next bandwidth detection process to ensure result preparation. In the next iteration, since the resonance detection pass flag is set, the resonance amplitude determination process can be directly skipped and the bandwidth determination process can be entered.
[0150] Based on the above-tuned proportional gain and integral gain, the zerocorss curve can be obtained. Figure 6 , Figure 6 It is a schematic diagram of an implementation method of the zerocorss curve of the present application.
[0151] like Figure 6 As shown, based on the slope of the zerocorss curve, K can be obtained i_1 and K i_2 Two parameters, thus based on the following formula:
[0152] ZeroCrossB=1.25K i_2 -0.25K i_1
[0153]
[0154] The two parameters ZeroCrossA and ZeroCross B are calculated to achieve the setting of zero-crossing gain.
[0155] In addition, it should be noted that in an application scenario, when the set current is 100% of the rated current, it is only necessary to determine whether there is overshoot in the Bode diagram, that is, Figure 3 In case b, if there is any overshoot, reduce the integral gain until there is no overshoot. The reason is that, in general, a large integral gain is used at a small set current, and a small integral gain is used at a large current. The same proportional gain is used at different currents. Therefore, after the adjustment is completed at other set currents, such as 20% current, there is no need to adjust the proportional gain, only the integral gain needs to be adjusted.
[0156] Based on the above self-tuning method, the current loop is debugged through the Bode diagram sweeping method. During the sweeping process, the system detects the motor response through rapidly changing frequencies. The physical movement of the motor is very small, which greatly reduces the large-scale movement of the motor and reduces the probability of motor runaway. In addition, human intervention is reduced, avoiding manual debugging misoperation or phase position errors that may be caused by human intervention, thereby avoiding the generation of large Iq components and motor runaway. The algorithm adjusts the current loop gain and parameters, starting within a smaller current range and gradually increasing the current. No manual intervention by the user is required, thus avoiding errors caused by manual intervention.
[0157] This application also provides a linear motor current loop self-tuning device, see Figure 7 , Figure 7 It is a structural schematic diagram of an implementation method of a linear motor current loop self-tuning device of the present application.
[0158] like Figure 7 As shown, the device includes an initialization module 21, a Bode diagram acquisition module 22, a resonance amplitude determination module 23, a bandwidth determination module 24 and a setting completion module 25.
[0159] The initialization module 21 is used to set initial setting parameters and expected bandwidth based on system parameters, and input setting current. The system parameters include inductance, resistance, rated current and servo frequency. The initial setting parameters include initial proportional gain, initial integral gain, initial reverse proportional gain and initial zero crossing gain.
[0160] The Bode diagram acquisition module 22 is used to iterate the proportional gain and / or the integral gain based on the update scheme, and obtain the Bode diagram of the current iteration after the iteration;
[0161] The resonance amplitude determination module 23 is used to determine whether the current resonance amplitude, the previous resonance amplitude, and the update scheme of the current iteration meet the preset conditions, and if the preset conditions are not met, generate the update scheme of the next iteration based on the current resonance amplitude, the previous resonance amplitude, the concave characteristics of the Bode diagram of the current iteration, and the update scheme of the current iteration, until the preset conditions are met, wherein the current resonance amplitude and the previous resonance amplitude are the resonance amplitudes of the Bode diagrams of the current iteration and the previous iteration, respectively;
[0162] The bandwidth determination module 24 is used to determine whether the proportional gain and integral gain of the current iteration meet the requirements based on the current bandwidth, the previous bandwidth and the expected bandwidth, and if they do not meet the requirements, generate an update scheme for the next iteration based on the current bandwidth and the expected bandwidth until the proportional gain and integral gain of the current iteration meet the requirements, and increase the number of parameter successes by 1, and the current bandwidth and the previous bandwidth are the bandwidths of the current iteration and the previous iteration respectively;
[0163] The setting completion module 25 is used to complete the parameter setting of the proportional gain and the integral gain when the total number of parameter successes reaches a first threshold, and to set the zero-crossing gain based on the set proportional gain and the integral gain.
[0164] As above Figures 1 to 6 , a linear motor current loop self-tuning method according to an embodiment of this specification is described. The details mentioned in the above description of the method embodiment are also applicable to the linear motor current loop self-tuning device of the embodiment of this specification. The above linear motor current loop self-tuning device can be implemented by hardware, or by software, or a combination of hardware and software.
[0165] This application also provides an electronic device, see Figure 8 , Figure 8 Schematic diagram of the structure of an electronic device of the present application. Figure 8 As shown, the electronic device 30 may include at least one processor 31, a memory 32 (e.g., a non-volatile memory), a memory 33, and a communication interface 34, and the at least one processor 31, the memory 32, the memory 33, and the communication interface 34 are connected together via a bus 35. At least one processor 31 executes at least one computer-readable instruction stored or encoded in the memory 32.
[0166] It should be understood that the computer executable instructions stored in the memory 32, when executed, cause at least one processor 31 to perform the above combined operations in various embodiments of the present specification. Figure 1-Figure 6 Describes the various operations and functions.
[0167] In the embodiments of the present specification, the electronic device 30 may include, but is not limited to, personal computers, server computers, workstations, desktop computers, laptop computers, notebook computers, mobile electronic devices, smart phones, tablet computers, cellular phones, personal digital assistants (PDAs), handheld devices, messaging devices, wearable electronic devices, consumer electronic devices, and the like.
[0168] According to one embodiment, a program product such as a machine-readable medium is provided. The machine-readable medium may have instructions (i.e., the above-mentioned elements implemented in the form of software), which, when executed by a machine, causes the machine to perform the above-mentioned combination of various embodiments of this specification. Figure 1-Figure 6 Specifically, a system or device equipped with a readable storage medium may be provided, on which a software program code implementing the functions of any of the above-mentioned embodiments is stored, and a computer or processor of the system or device reads and executes the instructions stored in the readable storage medium.
[0169] In this case, the program code itself read from the machine-readable medium can realize the function of any one of the above embodiments, and thus the machine-readable code and the machine-readable storage medium storing the machine-readable code constitute part of this specification.
[0170] Examples of readable storage media include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD-RW), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, the program code may be downloaded from a server computer or a cloud via a communication network.
[0171] Those skilled in the art should understand that the various embodiments disclosed above can be modified and altered in various ways without departing from the essence of the invention. Therefore, the protection scope of this specification should be defined by the appended claims.
[0172] It should be noted that not all steps and units in the above-mentioned processes and system structure diagrams are necessary, and some steps or units can be ignored according to actual needs. The execution order of each step is not fixed and can be determined as needed. The device structure described in the above-mentioned embodiments can be a physical structure or a logical structure, that is, some units may be implemented by the same physical client, or some units may be implemented by multiple physical clients, or some components in multiple independent devices may be implemented together.
[0173] In the above embodiments, the hardware unit or module can be realized by mechanical or electrical means. For example, a hardware unit, module or processor can include permanent dedicated circuit or logic (such as special processor, FPGA or ASIC) to complete the corresponding operation. The hardware unit or processor can also include programmable logic or circuit (such as general-purpose processor or other programmable processor), which can be temporarily set by software to complete the corresponding operation. Specific implementation (mechanical method or dedicated permanent circuit or temporary circuit) can be determined based on cost and time consideration.
[0174] The specific embodiments described above in conjunction with the accompanying drawings describe exemplary embodiments, but do not represent all embodiments that can be implemented or fall within the scope of protection of the claims. The term "exemplary" used throughout this specification means "used as an example, instance or illustration" and does not mean "preferred" or "having advantages" over other embodiments. For the purpose of providing an understanding of the described technology, the specific embodiments include specific details. However, these technologies can be implemented without these specific details. In some instances, in order to avoid making the concepts of the described embodiments difficult to understand, well-known structures and devices are shown in block diagram form.
[0175] The above description of the present disclosure is provided to enable any person of ordinary skill in the art to implement or use the present disclosure. Various modifications to the present disclosure will be apparent to those of ordinary skill in the art, and the general principles corresponding to the present disclosure may be applied to other variations without departing from the scope of protection of the present disclosure. Therefore, the present disclosure is not limited to the examples and designs described herein, but is consistent with the widest range of principles and novel features disclosed herein.
Claims
1. A linear motor current loop self-tuning method, characterized in that: include: Setting initial tuning parameters and expected bandwidth based on system parameters, and inputting tuning current, the system parameters including inductance, resistance, rated current and servo frequency, the initial tuning parameters including initial proportional gain, initial integral gain, initial reverse proportional gain and initial zero crossing gain; Iterate the proportional gain and the integral gain based on the update scheme, and obtain the Bode diagram of the current iteration after the iteration; Determine whether the current resonance amplitude, the previous resonance amplitude, and the update scheme of the current iteration meet a preset condition, and if the preset condition is not met, generate an update scheme for the next iteration based on the current resonance amplitude, the previous resonance amplitude, the concave characteristic of the Bode diagram of the current iteration, and the update scheme of the current iteration, until the preset condition is met, wherein the current resonance amplitude and the previous resonance amplitude are the resonance amplitudes of the Bode diagrams of the current iteration and the previous iteration, respectively; Based on the current bandwidth, the previous bandwidth and the expected bandwidth, determine whether the proportional gain and the integral gain of the current iteration meet the requirements, and if they do not meet the requirements, generate an update plan for the next iteration based on the current bandwidth and the expected bandwidth until they meet the requirements, and increase the number of parameter successes by 1, wherein the current bandwidth and the previous bandwidth are the bandwidths of the current iteration and the previous iteration respectively; When the total number of parameter successes reaches a first threshold, the parameter tuning of the proportional gain and the integral gain is completed, and the zero-crossing gain is tuned based on the tuned proportional gain and the integral gain.
2. The linear motor current loop self-tuning method according to claim 1, characterized in that: The step of setting the initial setting parameters and the expected bandwidth based on the system parameters comprises: estimating the initial proportional gain and the initial integral gain based on the inductance and the resistance; Based on the servo frequency, setting a desired bandwidth; and / or, The initial inverse proportional gain and the initial zero-crossing gain are 0.
3. The linear motor current loop self-tuning method according to claim 1, characterized in that: The step of iterating the proportional gain and / or the integral gain based on the update scheme and obtaining the Bode diagram of the current iteration after the iteration includes: Poll the status of the Bode graph in each iteration; If the state of the Bode graph is not started, the number of Bode graph iterations is increased by 1, and it is determined whether the total number of Bode graph iterations exceeds a second threshold; If not, obtain the current proportional gain and integral gain, and calculate the total number of gain acquisitions; If the total number of current gain acquisitions is not 1, the proportional gain and the integral gain are updated based on the update scheme, and the start Bode flag is set so that the plotBode class object detects the start Bode flag and generates a Bode plot; If the status of the Bode graph is completed, get the Bode graph of the current iteration.
4. The linear motor current loop self-tuning method according to claim 3, characterized in that: The step of setting the start Bode flag bit also includes: Determining whether the proportional gain and the integral gain are unchanged; If so, switch to the error state and reset to the initial state; and / or, The step of iterating the proportional gain and / or the integral gain based on the update scheme and obtaining the Bode diagram of the current iteration after the iteration also includes: If the total number of Bode diagram iterations exceeds the second threshold, the system switches to an error state and resets to an initial state.
5. The linear motor current loop self-tuning method according to claim 1, characterized in that: The preset conditions include: the current resonance amplitude is less than 1 dB, the previous resonance amplitude is greater than 1 dB, and the integral gain in the current iterative update scheme is reduced.
6. The linear motor current loop self-tuning method according to claim 1, characterized in that: The step of generating an update scheme for the next iteration based on the current resonance amplitude, the previous resonance amplitude, the concave characteristic of the Bode diagram of the current iteration, and the update scheme of the current iteration comprises: When the current resonance amplitude and the previous resonance amplitude are both less than 1 dB, increasing the integral gain by a preset proportion in the next iteration; and / or, When the current resonance amplitude is greater than 1 dB and the deviation between the current resonance amplitude and the previous resonance amplitude is less than 10%, based on the update scheme of the current iteration, the change of the proportional gain and the integral gain in the current iteration is determined; If only the proportional gain changes in the current iteration, the integral gain is increased by a preset ratio in the next iteration; If the proportional gain and the integral gain do not change in the current iteration, the integral gain is reduced by a preset ratio in the next iteration; If only the integral gain changes in the current iteration, determine whether there is a depression before the resonance point in the Bode diagram of the current iteration; If there is no depression, the proportional gain is increased by a preset ratio in the next iteration; If there is a depression, reducing the proportional gain by a preset ratio in the next iteration; and / or, When the current resonance amplitude is greater than 1 dB and the current resonance amplitude is greater than the previous resonance amplitude, the integral gain is reduced by a preset proportion in the next iteration; and / or, When the current resonance amplitude is greater than 1 dB and the current resonance amplitude is less than the previous resonance amplitude, the update scheme of the current iteration is used as the update scheme of the next iteration; and / or, When the current resonance amplitude is less than 1 dB, the previous resonance amplitude is greater than 1 dB, and the integral gain is not reduced in the update scheme of the current iteration, the integral gain is increased by a preset proportion in the next iteration.
7. The linear motor current loop self-tuning method according to claim 1, characterized in that: The step of judging whether the proportional gain and the integral gain of the current iteration meet the requirements based on the current bandwidth, the previous bandwidth and the expected bandwidth comprises: Determine whether the deviation between the current bandwidth and the previous bandwidth is within 5%; If yes, add 1 to the number of bandwidth saturation times, and determine whether the total number of bandwidth saturation times is less than a third threshold; If so, compare the current bandwidth with the expected bandwidth; If the current bandwidth is greater than the first multiple of the expected bandwidth and less than the second multiple of the expected bandwidth, the proportional gain and integral gain of the current iteration meet the requirements.
8. The linear motor current loop self-tuning method according to claim 7, characterized in that: The step of judging whether the proportional gain and the integral gain of the current iteration meet the requirements based on the current bandwidth, the previous bandwidth and the expected bandwidth also includes: If the deviation between the current bandwidth and the previous bandwidth is not within 5%, the total number of bandwidth saturation is reset to zero, and the current bandwidth is compared with the expected bandwidth; and / or, The step of generating an update solution for the next iteration based on the current bandwidth and the expected bandwidth when the requirement is not met comprises: If the current bandwidth is less than the first multiple of the expected bandwidth, the proportional gain and the integral gain are increased synchronously by a preset ratio in the next iteration; and / or, If the current bandwidth is greater than the second multiple of the expected bandwidth, the proportional gain and the integral gain are synchronously reduced by a preset ratio in the next iteration.
9. The linear motor current loop self-tuning method according to claim 1, characterized in that: Also includes: If the total number of parameter successes does not reach the first threshold, the last resonance amplitude is cleared and the resonance detection pass flag is set.
10. A linear motor current loop self-tuning device, characterized in that: include: An initialization module, used to set initial setting parameters and expected bandwidth based on system parameters, and input setting current, wherein the system parameters include inductance, resistance, rated current and servo frequency, and the initial setting parameters include initial proportional gain, initial integral gain, initial reverse proportional gain and initial zero crossing gain; A Bode diagram acquisition module, used for iterating the proportional gain and / or the integral gain based on the update scheme, and obtaining the Bode diagram of the current iteration after the iteration; A resonance amplitude determination module, used to determine whether the current resonance amplitude, the previous resonance amplitude, and the update scheme of the current iteration meet a preset condition, and if the preset condition is not met, generate an update scheme for the next iteration based on the current resonance amplitude, the previous resonance amplitude, the concave characteristics of the Bode diagram of the current iteration, and the update scheme of the current iteration, until the preset condition is met, wherein the current resonance amplitude and the previous resonance amplitude are the resonance amplitudes of the Bode diagrams of the current iteration and the previous iteration, respectively; A bandwidth determination module is used to determine whether the proportional gain and integral gain of the current iteration meet the requirements based on the current bandwidth, the previous bandwidth and the expected bandwidth, and if they do not meet the requirements, generate an update scheme for the next iteration based on the current bandwidth and the expected bandwidth until the proportional gain and integral gain of the current iteration meet the requirements, and increase the number of parameter successes by 1, wherein the current bandwidth and the previous bandwidth are the bandwidths of the current iteration and the previous iteration respectively; The tuning completion module is used to complete the parameter tuning of the proportional gain and the integral gain when the total number of parameter successes reaches a first threshold, and to tune the zero-crossing gain based on the tuned proportional gain and the integral gain.
11. An electronic device, comprising: at least one processor; as well as A memory storing instructions, which, when executed by the at least one processor, enables the at least one processor to execute the linear motor current loop self-tuning method according to any one of claims 1 to 9. 12 . A machine-readable storage medium storing executable instructions, wherein when the instructions are executed, the machine executes the linear motor current loop self-tuning method according to claim 1 .
Citation Information
Patent Citations
Enhanced gain robust fractional-order PID (proportion integration differentiation) controller parameter setting method
CN104777746A
Speed loop control parameter setting method and device
CN109713977A