Closed-loop position control method and device applied to stepping motor driver

By adopting a closed-loop position control method in the stepper motor driver, combined with ab/dq conversion, weak magnetic control and high-performance position control, the problem of stepper loss and low position control accuracy of stepper motor during load sudden change or high-speed operation is solved, and high-precision and low vibration position control is achieved.

CN120034048APending Publication Date: 2025-05-23GUOXIN NEW ENERGY TECH (CHANGZHOU) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510153927.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-12
Publication Date
2025-05-23

AI Technical Summary

Technical Problem

Stepper motors are prone to lose steps when load changes suddenly or high-speed operation, have low position control accuracy, and are relatively large in vibration and noise. The existing closed-loop control strategy still has shortcomings in dynamic performance and torque fluctuations.

Method used

The closed-loop position control method is adopted to detect the current and position of the stepper motor in real time, perform ab/dq conversion, output d-axis and q-axis currents, and combine weak magnetic control and high-performance position control to optimize modulation methods and current control to reduce vibration and noise.

Benefits of technology

It significantly improves position control accuracy, reduces step loss, achieves rapid response and high-speed operation, reduces vibration and noise, and improves system stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120034048A_ABST
    Figure CN120034048A_ABST
Patent Text Reader

Abstract

The invention provides a closed-loop position control method and device applied to a stepping motor driver. The method comprises the following steps: acquiring a position detection value theta M; obtaining an output position compensation value theta dx according to the theta M, and obtaining a corresponding electrical angle theta e according to the theta dx; outputting id and iq according to thetae, ia and ib; a control position controller outputs a q-axis current reference value # imgabs1 # and a maximum output voltage # imgabs2 # according to # imgabs0 # and theta M, controls a flux weakening controller to output a d-axis current reference value # imgabs4 # according to # imgabs3 #, controls a current controller to output a d-axis voltage reference value # imgabs6 # q-axis voltage reference value # imgabs7 # according to # imgabs5 # id and iq, outputs a DC voltage udc of a # imgabs10 # stepping motor according to # imgabs8 # and theta e, and outputs a switch state of a driver to the driver. Through vector control, field weakening control, position control and a modulation method, the rotating speed range of the motor can be effectively widened, optimization of dynamic and steady-state performance is achieved, and the method is suitable for various types of stepping motors and has high universality and practicability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of motors, and in particular to a closed-loop position control method applied to a stepper motor driver, and a closed-loop position control device applied to a stepper motor driver. Background Art

[0002] Stepper motors are widely used in industrial automation, robotics, CNC machine tools, medical equipment and other fields due to their simple structure, easy control and high positioning accuracy.

[0003] At present, the control strategy of stepper motor mainly adopts open-loop control, that is, the speed and position control of the motor are realized by controlling the pulse frequency and number. Although this control method is simple and easy to implement, it has the following problems: 1. Loss of step problem: When the load changes suddenly or when running at high speed, the motor is prone to lose step due to insufficient torque, resulting in failure of position control; 2. Low position control accuracy: open-loop control cannot detect the rotor position in real time, and it is difficult to compensate for position deviations caused by manufacturing errors, magnetic circuit asymmetry or load fluctuations; 3. Vibration and noise: Since open-loop control cannot accurately adjust the current and torque, the motor is prone to vibration and noise during operation, affecting the stability of the system.

[0004] In order to overcome the limitations of open-loop control, a closed-loop control strategy has been proposed in related technologies. By introducing position sensors (such as encoders) or using sensorless technologies such as back electromotive force, the rotor position is detected in real time and feedback control is performed. The closed-loop control strategy can significantly improve the accuracy of position control and reduce the phenomenon of out-of-step, but there are still the following shortcomings: 1. Poor dynamic performance: The closed-loop control strategy mostly uses simple PID (Proportional Integral Derivative) control or position loop control, which is difficult to achieve fast response at high speed or load mutation; 2. Torque fluctuation problem: Under low speed or high load conditions, closed-loop control may still cause torque fluctuations due to inaccurate current regulation, affecting the smoothness of operation. Summary of the invention

[0005] In order to solve the above technical problems, the present invention provides a closed-loop position control method applied to a stepper motor driver.

[0006] The invention also provides a closed-loop position control device applied to a stepping motor driver.

[0007] The technical solution adopted by the present invention is as follows:

[0008] The first embodiment of the present invention proposes a closed-loop position control method for a stepper motor driver, comprising the following steps: real-time detection of the current of the stepper motor to obtain the current i of the a-phase coil and the b-phase coil a 、ib ; Perform position detection on the stepper motor to obtain a position detection value θ M ; According to the position detection value θ M Get the output position compensation value θ dx , according to the output position compensation value θ dx , get the output position compensation value θ dx The corresponding electrical angle θ e ; According to the electrical angle θ e 、i a 、i b Perform ab / dq conversion and output d-axis current i d and q-axis current i q And input to the current controller; control the position controller according to the position reference value and the position detection value θ M , output q-axis current reference value and maximum output voltage Set the q-axis current reference value and maximum output voltage Input to the weak magnetic controller, control the weak magnetic controller according to the maximum output voltage Output d-axis current reference value Set the d-axis current reference value Input into the current controller; control the current controller according to the q-axis current reference value D-axis current reference value d-axis current i d , q-axis current i q , output d-axis voltage reference value Q-axis voltage reference value According to the d-axis voltage reference value Q-axis voltage reference value and electrical angle θ e Perform dq / ab conversion and output a-axis voltage reference value b-axis voltage reference value Using the modulation algorithm of the stepper motor, according to the a-axis voltage reference value b-axis voltage reference value DC voltage u of stepper motor dc , output the switching state of the driver to the driver, so that the driver outputs the coil voltage according to the switching state to drive the stepper motor to operate.

[0009] The closed-loop position control method applied to the stepper motor driver of the present invention also has the following additional technical features:

[0010] According to one embodiment of the present invention, based on the position detection value θ M Get the output position compensation value θdx , according to the output position compensation value θ dx , get the output position compensation value θ dx The corresponding electrical angle θ e , specifically including: obtaining the stepper motor position detection value θ M and position compensation value θ dx The mapping relationship F is used to obtain the position detection value θ according to the mapping relationship F. M The corresponding position compensation value θ dx ; According to the position detection value θ M and position compensation value θ dx The difference between the position correction value θ cx ; Calculate 1+pθ cx , and take the decimal part of the output result and assign it to the electrical angle θ e , p is the number of poles of the stepper motor.

[0011] According to one embodiment of the present invention, the stepper motor position detection value θ is obtained. M and position compensation value θ dx The mapping relationship F includes: establishing the angle value θ of each magnetic pole in the ideal stepper motor u (m), m is the magnetic pole number, m is a positive integer; the actual angle value θ of each magnetic pole of the stepper motor is measured by experimental method r (m); according to θ d (m) = θ r (m)-θ u (m) Establish a magnetic pole position compensation sequence, and obtain the interpolation position compensation value corresponding to the angle between each magnetic pole through interpolation method to obtain the position compensation value θ dx and the position detection value θ M The mapping relationship between them is F, where θ dx =F(θ M ).

[0012] According to one embodiment of the present invention, based on the position reference value and the position detection value θ M , output maximum output voltage Specifically include: setting the position reference value After rate conversion, we get kT p Position reference value at time T p is the control period of the position controller, k is an integer; With the delayed signal Subtract, and divide the result by D θ T p ,get D θ is a positive integer; After rate conversion, the maximum output voltage is obtained

[0013] According to one embodiment of the present invention, the magnetic field weakening controller is controlled according to the maximum output voltage Output d-axis current reference value Specifically include: the maximum output voltage Find the absolute value and will Input to the hysteresis comparator, the hysteresis comparator output signal F V , among which, when When F V =0; On the basis of Gradually rising, F V Remains at 0 until When F V =1; if and Gradually decreases, then F V Remains at 1 until When F V =0, V min 、V max is the lower limit and upper limit of the hysteresis comparator; according to Output d-axis current reference value in, is the d-axis current setting value, I max is the maximum current setting value, is the maximum reference value of q-axis current, is the q-axis current reference value.

[0014] The second embodiment of the present invention proposes a closed-loop position control device for a stepper motor driver, comprising: a current detection module, the current detection module is used to detect the current of the stepper motor in real time, and obtain the current i of the a-phase coil and the b-phase coil a 、i b ; A position detection module, the position detection module is used to detect the position of the stepper motor and obtain a position detection value θ M ; A compensation module, the compensation module is used according to the position detection value θ M Get the output position compensation value θ dx , according to the output position compensation value θ dx , get the output position compensation value θ dx The corresponding electrical angle θ e ab / dq conversion module, the ab / dq conversion module is used to convert the electrical angle θ e 、i a 、i bPerform ab / dq conversion and output d-axis current i d and q-axis current i q ; A position controller, the position controller is used to and the position detection value θ M , output q-axis current reference value and maximum output voltage A field weakening controller is used to adjust the maximum output voltage according to the Output d-axis current reference value The current controller is used to control the q-axis current reference value according to the D-axis current reference value d-axis current i d , q-axis current i q , output d-axis voltage reference value Q-axis voltage reference value The dq / ab conversion module is used to convert the d-axis voltage into Q-axis voltage reference value and electrical angle θ e Perform dq / ab conversion and output a-axis voltage reference value b-axis voltage reference value The modulation module is used to use the modulation algorithm of the stepper motor to adjust the voltage reference value of the a-axis according to the a-axis voltage reference value. b-axis voltage reference value DC voltage u of stepper motor dc , output the switching state of the driver to the driver, so that the driver outputs the coil voltage according to the switching state to drive the stepper motor to operate.

[0015] The closed-loop position control device for a stepper motor driver of the present invention also has the following additional technical features:

[0016] According to one embodiment of the present invention, the compensation module is specifically used to: obtain the stepper motor position detection value θ M and position compensation value θ dx The mapping relationship F is used to obtain the position detection value θ according to the mapping relationship F. M The corresponding position compensation value θ dx ; According to the position detection value θ M and position compensation value θ dx The difference between the position correction value θ cx ; Calculate 1+pθ cx , and take the decimal part of the output result and assign it to the electrical angle θ e , p is the number of poles of the stepper motor.

[0017] According to one embodiment of the present invention, the compensation module is further used to: establish the angle value θ of each magnetic pole in the ideal stepper motor u (m), m is the magnetic pole number, m is a positive integer; the actual angle value θ of each magnetic pole of the stepper motor is measured by experimental method r (m); according to θ d (m) = θ r (m)-θ u (m) Establish a magnetic pole position compensation sequence, and obtain the interpolation position compensation value corresponding to the angle between each magnetic pole through interpolation method to obtain the position compensation value θ dx and the position detection value θ M The mapping relationship between them is F, where θ dx =F(θ M ).

[0018] According to one embodiment of the present invention, the position controller is specifically used to: After rate conversion, we get kT p Position reference value at time T p is the control period of the position controller, k is an integer; With the delayed signal Subtract, and divide the result by D θ T p ,get D θ is a positive integer; After rate conversion, the maximum output voltage is obtained

[0019] According to one embodiment of the present invention, the magnetic field weakening controller is specifically used to: Find the absolute value and will Input to the hysteresis comparator, the hysteresis comparator output signal F V , among which, when When F V =0; On the basis of Gradually rising, F V Remains at 0 until When F V =1; if and Gradually decreases, then F V Remains at 1 until <V min When F V =0, V min 、V max are the lower and upper limits of the hysteresis comparator;

[0020] according to Output d-axis current reference value in, is the d-axis current setting value, I max is the maximum current setting value, is the maximum reference value of q-axis current, is the q-axis current reference value.

[0021] The present invention has the following beneficial effects:

[0022] The present invention can significantly improve the position control accuracy and reduce the out-of-step phenomenon through closed-loop control and vector control. At the same time, combined with high-performance position control and weak magnetic control, it can achieve fast response and high-speed operation. By optimizing the modulation method and current control, it can reduce vibration and noise and improve system stability. The entire control strategy is applicable to various types of stepper motors, has strong versatility and practicality, and can be widely used in industrial automation, robots, precision instruments, medical equipment and other fields. It provides a new solution for high-performance control of stepper motors and has important theoretical significance and engineering application value. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 is a flow chart of a closed-loop position control method applied to a stepper motor driver according to an embodiment of the present invention;

[0024] Figure 2 is a principle block diagram of a closed-loop position control method applied to a stepper motor driver according to an embodiment of the present invention;

[0025] Figure 3 is a principle block diagram of a position controller according to an embodiment of the present invention;

[0026] Figure 4 is a schematic diagram of the working principle of a hysteresis comparator according to an embodiment of the present invention;

[0027] Figure 5 is a principle block diagram of a d-axis unit of a current controller according to an embodiment of the present invention;

[0028] Figure 6 is a principle block diagram of a q-axis unit of a current controller according to an embodiment of the present invention;

[0029] Figure 7 is a schematic diagram of the principle of a modulation algorithm according to an embodiment of the present invention;

[0030] Figure 8 is a schematic diagram of a modulation signal according to an embodiment of the present invention;

[0031] Fig. 9 4 is a block diagram of a closed-loop position control device applied to a stepper motor driver according to an embodiment of the present invention. DETAILED DESCRIPTION

[0032] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0033] The following describes a closed-loop position control method applied to a stepper motor driver and a closed-loop position control device applied to a stepper motor driver proposed in an embodiment of the present invention in conjunction with the accompanying drawings.

[0034] Figure 1 FIG. 1 is a flow chart of a closed-loop position control method applied to a stepper motor driver according to an embodiment of the present invention. Figure 1 As shown, the method comprises the following steps:

[0035] S1, real-time detection of the stepper motor current, obtain the a-phase coil and b-phase coil current i a 、i b .

[0036] Specifically, Figure 2 As shown, by real-time detection of the stepper motor, the current i of the a-phase coil and the b-phase coil of the stepper motor is obtained. a 、i b .

[0037] S2, perform position detection on the stepper motor to obtain the position detection value θ M .

[0038] Specifically, the position detection value θ is obtained by real-time detection of the stepper motor. M .

[0039] S3, according to the position detection value θ M Get the output position compensation value θ dx , according to the output position compensation value θ dx , get the output position compensation value θ dx The corresponding electrical angle θ e .

[0040] Further, in one embodiment of the present invention, according to the position detection value θ M Get the output position compensation value θ dx , according to the output position compensation value θ dx , get the output position compensation value θdx The corresponding electrical angle θ e , specifically including: obtaining the stepper motor position detection value θ M and position compensation value θ dx The mapping relationship F is used to obtain the position detection value θ according to the mapping relationship F. M The corresponding position compensation value θ dx ; According to the position detection value θ M and position compensation value θ dx The difference between the position correction value θ cx ; Calculate 1+pθ cx , and take the decimal part of the output result and assign it to the electrical angle θ e , p is the number of poles of the stepper motor.

[0041] Furthermore, the stepper motor position detection value θ is obtained. M and position compensation value θ dx The mapping relationship F includes: establishing the angle value θ of each magnetic pole in the ideal stepper motor u (m), m is the magnetic pole number, m is a positive integer; the actual angle value θ of each magnetic pole of the stepper motor is measured by experimental method r (m); according to θ d (m) = θ r (m)-θ u (m) Establish a magnetic pole position compensation sequence, and obtain the interpolation position compensation value corresponding to the angle between each magnetic pole through interpolation method to obtain the position compensation value θ dx and the position detection value θ M The mapping relationship between them is F, where θ dx =F(θ M ).

[0042] Specifically, Figure 2 As shown, according to the mapping relationship F, the position detection value θ can be directly obtained M The corresponding position compensation value θ dx , and then according to θ cx =θ M ―θ dx Get the position correction value θ cx , then calculate 1+pθ cx , and take the decimal part of the output result and assign it to the electrical angle θ e , p is the number of stepper motor poles, p = 90° / θ step ,θ step is the step angle of the motor, θ step A common value is 1.8°. M ,θ dx ,θ cx ,θ e The range is -1 to 1.

[0043] S4, according to the electrical angle θ e 、i a 、i b Perform ab / dq conversion and output d-axis current i d and q-axis current i q And input to the current controller.

[0044] S5, controls the position controller according to the position reference value and position detection value θ M , output q-axis current reference value and maximum output voltage Set the q-axis current reference value and maximum output voltage Input to the weak magnetic controller, control the weak magnetic controller according to the maximum output voltage Output d-axis current reference value Set the d-axis current reference value Input to the current controller.

[0045] Specifically, Figure 3 As shown, the input of the position controller is the position reference value (set value) and position detection value θ M , after rate conversion, we get kT p Position reference value at time kT p The position detection value θ at the moment M (k), T p is the control period of the position controller, k is an integer. The output of the position controller is kT p The q-axis current reference value at time The q-axis current reference value is obtained after rate conversion Figure 3 In the figure, PL1, PL2 and PL3 are the first limiter, the second limiter and the third limiter respectively, PD1, PD2 and PD3 are the first delay link, the second delay link and the third delay link respectively, PI1, PI2, PI3 and PI4 are the first integral link, the second integral link, the third integral link and the fourth integral link respectively, The transfer function of the first integral link, the second integral link, the third integral link and the fourth integral link, the user sets the variables in advance. At the same time, the position controller is equipped with relevant adders and subtractors, see Figure 3 shown.

[0046] The function of the delay link is to delay the input by T p Output after time, that is, the input is When The input is θ I (k), the output is θ I (k-1).

[0047] Among them, the q-axis current reference value With position reference value Position detection value θ M The calculation formula for (k) is:

[0048] θ D (k) is the input of the third integration link.

[0049] e θL (k) is the output of PL1, maxe θ 、mine θ The variables are set for the user, which are the maximum value and the minimum value of the output of the first limiter PL1.

[0050] θ I (k) is the input of PL2.

[0051] θ IL (k) is the output of PL2, maxθ I 、minθ I The variables are set for the user, which are the maximum value and the minimum value of the output of the second limiter PL2.

[0052] θ o (k) is the input of PL3.

[0053] maxθ o 、minθ o The variables are set for the user, which are the maximum and minimum values ​​of the output of the third limiter PL3.

[0054] In one embodiment of the present invention, according to the position reference value and position detection value θ M , output maximum output voltage Specifically include: setting the position reference value After rate conversion, we get kT p Position reference value at time T p is the control period of the position controller, k is an integer; With the delayed signal Subtract, and divide the result by D θ T p ,get Dθ It is a positive integer, set by the user; After rate conversion, the maximum output voltage is obtained

[0055] Right now, After rate conversion, we get

[0056] Control the field weakening controller according to the maximum output voltage Output d-axis current reference value Specifically include: the maximum output voltage Find the absolute value and will Input to the hysteresis comparator, the hysteresis comparator output signal F V , among which, when When F V =0; On the basis of Gradually rising, F V Remains at 0 until When F V =1; if and Gradually decreases, then F V Remains at 1 until When F V =0, V min 、V max is the lower limit and upper limit of the hysteresis comparator; according to Output d-axis current reference value in, is the d-axis current setting value, I max is the maximum current setting value, is the maximum reference value of q-axis current, is the q-axis current reference value.

[0057] The principle of hysteresis comparator can be found in Figure 4 .

[0058] S6, controls the current controller according to the q-axis current reference value D-axis current reference value d-axis current i d , q-axis current i q , output d-axis voltage reference value Q-axis voltage reference value

[0059] Specifically, the principle of the current controller can be found in the attached Figure 5 and Figure 6 As shown, Figure 5 is the d-axis unit of the current controller, Figure 6is the q-axis unit of the current controller, Figure 5-6 In the figure, Ld1 represents the fourth limiter, Dd1 is the fourth delay link, Dd2 is the fifth delay link, Lq1 represents the fifth limiter, Dq1 is the sixth delay link, Dq2 is the seventh delay link, and the current controller also includes related integrators, adders and subtractors. C rd , C rq is the transfer function of the corresponding integral link.

[0060] like Figure 5 , the input of the d-axis unit is i d , after rate conversion, we get kT i The d-axis current reference value at time kT i The d-axis current i at time d (k), T i is the control period of the current controller, and k is an integer.

[0061] i d (k) The relationship is:

[0062]

[0063] in, z d (k), x d (k), z d (k-1), x d (k-1) are all intermediate variables.

[0064] like Figure 6 In the d-axis unit, the delay links Dd1 and Dd2 are used to delay the input by T i Output after time, that is, the input amount is x d (k), the output is x d (k-1); the input is z d (k), the output is z d (k-1). Ld1 restricts the input variables, and the relationship is:

[0065] Among them, maxu d 、minu d The variables are set by the user, which are the maximum and minimum values ​​of the output of the limiter Ld1.

[0066] After rate conversion, the output

[0067] The input of the q-axis unit is After rate conversion, we get kT i The q-axis current reference value at time kT i The q-axis current i at the moment q (k), T i is the control period of the current controller (9), and k is an integer. i q (k) The relationship is:

[0068]

[0069] in, z q (k), x q (k), z q (k-1), x q (k-1) are all intermediate variables.

[0070] In the q-axis unit, the function of the delay links Dq1 and Dq2 is to delay the input by T i Output after time, that is, the input amount is x q (k), the output is x q (k-1); the input is z q (k), the output is z q (k-1). In the q-axis unit, the fifth limiter Lq1 limits the input variable, and the relationship is:

[0071]

[0072] Among them, maxu q 、minu q The variables are set by the user, which are the maximum value and the minimum value of the output of the fifth limiter Lq1.

[0073] After rate conversion, the output

[0074] S6, according to the d-axis voltage reference value Q-axis voltage reference value and electrical angle θ e Perform dq / ab conversion and output a-axis voltage reference value b-axis voltage reference value

[0075] S7, using the modulation algorithm of the stepper motor, according to the a-axis voltage reference value b-axis voltage reference value DC voltage u of stepper motor dc, output the switching state of the driver to the driver, so that the driver outputs the coil voltage according to the switching state to drive the stepper motor to operate.

[0076] Specifically, in the implementation process of the modulation algorithm, as shown in the attached Figure 7 As shown, the input After calculation, the output signal x a 、x b , and the relationship is:

[0077]

[0078] x a 、x b After calculation, the output signal W is expressed as W = 2x a +x b +1: u dc After calculation, the output signal D a , D b , D 0 , and the relationship is: W.D a , D b , D 0 After calculation, output D A , D B , D C , D D , and the relationship is:

[0079]

[0080] D A , D B , D C , D D The switching signal S of the driver A phase, B phase, C phase and D phase bridge arm A , S B , S C , S D is the corresponding duty cycle, as shown in the attached Figure 8 shown. Figure 8 In, T PWM is the modulation period, which is set by the user. PWM Within S x =1 is T x , S x = 0 is T PWM ―T x , T x is the high level time in one modulation cycle, T x =D x T PWMIn the above description, x = (A, B, C, D), A, B, C, D represent the A-phase, B-phase, C-phase and D-phase bridge arms of the driver respectively.

[0081] By adjusting the input switch state S of the driver A , S B , S C , S D , output stepper motor coil voltage u AB 、u CD .

[0082] In summary, the closed-loop position control method applied to the stepper motor driver according to the embodiment of the present invention can significantly improve the position control accuracy and reduce the out-of-step phenomenon through closed-loop control and vector control. At the same time, combined with high-performance position control and weak magnetic control, fast response and high-speed operation can be achieved. By optimizing the modulation method and current control, vibration and noise can be reduced and the system stability can be improved. The entire control strategy is applicable to various types of stepper motors, has strong versatility and practicality, and can be widely used in industrial automation, robots, precision instruments, medical equipment and other fields. It provides a new solution for high-performance control of stepper motors, which has important theoretical significance and engineering application value.

[0083] Corresponding to the above-mentioned closed-loop position control method applied to the stepper motor driver, the present invention also proposes a closed-loop position control device applied to the stepper motor driver. Since the device embodiment of the present invention corresponds to the above-mentioned method embodiment, details not disclosed in the method embodiment can be referred to the above-mentioned method embodiment, and will not be repeated in the present invention.

[0084] Fig. 9 is a block diagram of a closed-loop position control device applied to a stepper motor driver according to an embodiment of the present invention. Fig. 9 As shown, the closed-loop position control device applied to the stepper motor driver includes: a current detection module, a position detection module, a compensation module, an ab / dq conversion module, a position controller, a weak magnetic controller, a current controller and a modulation module.

[0085] The current detection module is used to detect the current of the stepper motor in real time and obtain the current i of the a-phase coil and the b-phase coil. a 、i b ; The position detection module is used to detect the position of the stepper motor and obtain the position detection value θ M ; The compensation module is used to detect the position value θ M Get the output position compensation value θ dx , according to the output position compensation value θ dx , get the output position compensation value θ dx The corresponding electrical angle θe ; ab / dq conversion module is used to convert the electrical angle θ e 、i a 、i b Perform ab / dq conversion and output d-axis current i d and q-axis current i q ; The position controller is used to adjust the position according to the position reference value and position detection value θ M , output q-axis current reference value and maximum output voltage The field weakening controller is used to adjust the maximum output voltage Output d-axis current reference value The current controller is used to adjust the q-axis current reference value D-axis current reference value d-axis current i d , q-axis current i q , output d-axis voltage reference value Q-axis voltage reference value The dq / ab conversion module is used to convert the d-axis voltage reference value into Q-axis voltage reference value and electrical angle θ e Perform dq / ab conversion and output a-axis voltage reference value b-axis voltage reference value The modulation module is used to use the modulation algorithm of the stepper motor to adjust the voltage reference value of the a-axis b-axis voltage reference value DC voltage u of stepper motor dc , output the switching state of the driver to the driver, so that the driver outputs the coil voltage according to the switching state to drive the stepper motor to operate.

[0086] According to one embodiment of the present invention, the compensation module is specifically used to: obtain the stepper motor position detection value θ M and position compensation value θ dx The mapping relationship F is used to obtain the position detection value θ according to the mapping relationship F. M The corresponding position compensation value θ dx ; According to the position detection value θ M and position compensation value θ dx The difference between the position correction value θ cx ; Calculate 1+pθ cx , and take the decimal part of the output result and assign it to the electrical angle θ e , p is the number of poles of the stepper motor.

[0087] According to one embodiment of the present invention, the compensation module is further used to: establish the angle value θ of each magnetic pole in the ideal stepper motor u(m), m is the magnetic pole number, m is a positive integer; the actual angle value θ of each magnetic pole of the stepper motor is measured by experimental method r (m); according to θ d (m) = θ r (m)-θ u (m) Establish a magnetic pole position compensation sequence, and obtain the interpolation position compensation value corresponding to the angle between each magnetic pole through interpolation method to obtain the position compensation value θ dx and the position detection value θ M The mapping relationship between them is F, where θ dx =F(θ M ).

[0088] According to one embodiment of the present invention, the position controller is specifically used to: After rate conversion, we get kT p Position reference value at time T p is the control period of the position controller, k is an integer; With the delayed signal Subtract, and divide the result by D θ T p ,get D θ is a positive integer; After rate conversion, the maximum output voltage is obtained

[0089] According to one embodiment of the present invention, the magnetic field weakening controller is specifically used to: Find the absolute value and will Input to the hysteresis comparator, the hysteresis comparator output signal F V , among which, when When F V =0; On the basis of Gradually rising, F V Remains at 0 until When F V =1; if and Gradually decreases, then F V Remains at 1 until <V min When F V =0, V min 、V max is the lower limit and upper limit of the hysteresis comparator; according to Output d-axis current reference value in, is the d-axis current setting value, Imax is the maximum current setting value, is the maximum reference value of q-axis current, is the q-axis current reference value.

[0090] According to the closed-loop position control device applied to the stepper motor driver according to the embodiment of the present invention, the position control accuracy can be significantly improved and the out-of-step phenomenon can be reduced through closed-loop control and vector control. At the same time, combined with high-performance position control and weak magnetic control, fast response and high-speed operation can be achieved. By optimizing the modulation method and current control, vibration and noise can be reduced and the system stability can be improved. The entire control strategy is applicable to various types of stepper motors, has strong versatility and practicality, and can be widely used in industrial automation, robots, precision instruments, medical equipment and other fields. It provides a new solution for high-performance control of stepper motors and has important theoretical significance and engineering application value.

[0091] In the description of the present invention, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. "Multiple" means two or more, unless otherwise clearly and specifically defined.

[0092] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they are contradictory.

[0093] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present invention belong.

[0094] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute the instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.

[0095] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0096] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0097] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0098] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.

[0099] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.

Claims

1. A closed-loop position control method for a stepper motor driver, characterized in that: The following steps are involved: The current of the stepper motor is detected in real time to obtain the current i of the phase a coil and the phase b coil a 、i b ; Perform position detection on the stepper motor to obtain a position detection value θ M ; According to the position detection value θ M Get the output position compensation value θ dx , according to the output position compensation value θ dx , get the output position compensation value θ dx The corresponding electrical angle θ e ; According to the electrical angle θ e 、i a 、i b Perform ab / dq conversion and output d-axis current i d and q-axis current i q And input into the current controller; Control the position controller according to the position reference value and the position detection value θ M , output q-axis current reference value and maximum output voltage Set the q-axis current reference value and maximum output voltage Input to the weak magnetic controller, control the weak magnetic controller according to the maximum output voltage Output d-axis current reference value Set the d-axis current reference value Input to the current controller; Control the current controller according to the q-axis current reference value D-axis current reference value d-axis current i d , q-axis current i q , output d-axis voltage reference value Q-axis voltage reference value According to the d-axis voltage reference value Q-axis voltage reference value and electrical angle θ e Perform dq / ab conversion and output a-axis voltage reference value b-axis voltage reference value Using the modulation algorithm of the stepper motor, according to the a-axis voltage reference value b-axis voltage reference value DC voltage u of stepper motor dc , output the switching state of the driver to the driver, so that the driver outputs the coil voltage according to the switching state to drive the stepper motor to operate.

2. The closed-loop position control method for a stepper motor driver according to claim 1, characterized in that: According to the position detection value θ M Get the output position compensation value θ dx , according to the output position compensation value θ dx , get the output position compensation value θ dx The corresponding electrical angle θ e , including: Get the stepper motor position detection value θ M and position compensation value θ dx The mapping relationship F is used to obtain the position detection value θ according to the mapping relationship F. M The corresponding position compensation value θ dx ; According to the position detection value θ M and position compensation value θ dx The difference between the position correction value θ cx ; Calculate 1+pθ cx , and take the decimal part of the output result and assign it to the electrical angle θ e , p is the number of poles of the stepper motor.

3. The closed-loop position control method for a stepper motor driver according to claim 2, characterized in that: Get the stepper motor position detection value θ M and position compensation value θ dx The mapping relationship F specifically includes: Establish the angle value θ of each magnetic pole in the ideal stepper motor u (m), m is the magnetic pole number, m is a positive integer; The actual angle value θ of each magnetic pole of the stepper motor is measured by experimental method r (m); According to θ d (m) = θ r (m)-θ u (m) Establish a magnetic pole position compensation sequence, and obtain the interpolation position compensation value corresponding to the angle between each magnetic pole through interpolation method to obtain the position compensation value θ dx and position detection value θ M The mapping relationship between them is F, where θ dx =F(θ M ).

4. The closed-loop position control method for a stepper motor driver according to claim 1, characterized in that: According to the position reference value and the position detection value θ M , output maximum output voltage Specifically include: The position reference value After rate conversion, we get kT p Position reference value at time T p is the control period of the position controller, k is an integer; With the delayed signal Subtract, and divide the result by D θ T p ,get D θ is a positive integer; After rate conversion, the maximum output voltage is obtained 5. The closed-loop position control method for a stepper motor driver according to claim 1, characterized in that: Control the field weakening controller according to the maximum output voltage Output d-axis current reference value Specifically include: For maximum output voltage Find the absolute value and will Input to the hysteresis comparator, the hysteresis comparator output signal F V , among which, when When F V =0; On the basis of Gradually rising, F V Remains at 0 until When F V =1; if and Gradually decreases, then F V Remains at 1 until When F V =0, V min 、V max are the lower and upper limits of the hysteresis comparator; according to Output d-axis current reference value in, is the d-axis current setting value, I max is the maximum current setting value, is the maximum reference value of q-axis current, is the q-axis current reference value.

6. A closed-loop position control device for a stepper motor driver, characterized in that: include: The current detection module is used to detect the current of the stepper motor in real time and obtain the current i of the a-phase coil and the b-phase coil a 、i b ; A position detection module is used to detect the position of the stepper motor and obtain a position detection value θ M ; A compensation module is used to compensate the position of the detected value θ M Get the output position compensation value θ dx , according to the output position compensation value θ dx , get the output position compensation value θ dx The corresponding electrical angle θ e ; The ab / dq conversion module is used to convert the electrical angle θ e 、i a 、i b Perform ab / dq conversion and output d-axis current i d and q-axis current i q ; The position controller is used to and the position detection value θ M , output q-axis current reference value and maximum output voltage A field weakening controller is used to adjust the maximum output voltage according to the Output d-axis current reference value The current controller is used to control the q-axis current reference value according to the D-axis current reference value d-axis current i d , q-axis current i q , output d-axis voltage reference value Q-axis voltage reference value The dq / ab conversion module is used to convert the d-axis voltage into Q-axis voltage reference value and electrical angle θ e Perform dq / ab conversion and output a-axis voltage reference value b-axis voltage reference value The modulation module is used to use the modulation algorithm of the stepper motor to adjust the voltage reference value of the a-axis according to the a-axis voltage reference value. b-axis voltage reference value DC voltage u of stepper motor dc , output the switching state of the driver to the driver, so that the driver outputs the coil voltage according to the switching state to drive the stepper motor to operate.

7. The closed-loop position control device for a stepper motor driver according to claim 6, characterized in that: The compensation module is specifically used for: Get the stepper motor position detection value θ M and position compensation value θ dx The mapping relationship F is used to obtain the position detection value θ according to the mapping relationship F. M The corresponding position compensation value θ dx ; According to the position detection value θ M and position compensation value θ dx The difference between the position correction value θ cx ; Calculate 1+pθ cx , and take the decimal part of the output result and assign it to the electrical angle θ e , p is the number of poles of the stepper motor.

8. The closed-loop position control device for a stepper motor driver according to claim 7, characterized in that: The compensation module is further used for: Establish the angle value θ of each magnetic pole in the ideal stepper motor u (m), m is the magnetic pole number, m is a positive integer; The actual angle value θ of each magnetic pole of the stepper motor is measured by experimental method r (m); According to θ d (m) = θ r (m)-θ u (m) Establish a magnetic pole position compensation sequence, and obtain the interpolation position compensation value corresponding to the angle between each magnetic pole through interpolation method to obtain the position compensation value θ dx and position detection value θ M The mapping relationship between them is F, where θ dx =F(θ M ).

9. The closed-loop position control device for a stepper motor driver according to claim 6, characterized in that: The position controller is specifically used for: The position reference value After rate conversion, we get kT p Position reference value at time T p is the control period of the position controller, k is an integer; With the delayed signal Subtract, and divide the result by D θ T p ,get D θ is a positive integer; After rate conversion, the maximum output voltage is obtained 10. The closed-loop position control device for a stepper motor driver according to claim 6, characterized in that: The magnetic field weakening controller is specifically used for: For maximum output voltage Find the absolute value and will Input to the hysteresis comparator, the hysteresis comparator output signal F V , among which, when When F V =0; On the basis of Gradually rising, F V Remains at 0 until When F V =1; if and Gradually decreases, then F V Remains at 1 until When F V =0, V min 、V max are the lower and upper limits of the hysteresis comparator; according to Output d-axis current reference value in, is the d-axis current setting value, I max is the maximum current setting value, is the maximum reference value of q-axis current, is the q-axis current reference value.