Magnetic Flux Angle Compensation Method and Compensation Device for Stepper Motor Driver
By generating the driving voltage reference value and establishing an angle compensation table, the problem of the magnetic flux angle deviation of the stepper motor is solved, the positioning accuracy and operating efficiency of the motor are improved, and the technical advantages are significant.
Patent Information
- Application Number
- CN202510199055.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-24
- Publication Date
- 2025-06-10
- Estimated Expiration
- 2045-02-24
AI Technical Summary
During actual operation, stepper motors may have manufacturing errors, load fluctuations, nonlinearity of magnetic circuits, temperature changes, etc., resulting in a deviation in the magnetic flux angle, affecting positioning accuracy, operating stability and efficiency.
By generating the first driving voltage reference value and the second driving voltage reference value, the stepper motor angle is estimated, and the mean sequence and standard angle sequence are obtained according to the mechanical angle, the angle compensation sequence and mapping relationship are established, the angle compensation table is generated, and the magnetic flux angle is finally compensated according to the compensation angle.
Effectively solve the problem of magnetic flux angle deviation of stepper motors, improve the positioning accuracy, running stability and efficiency of the motor, and has the advantages of low cost, simple implementation and significant results.
Smart Images

Figure CN119675512B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of motors, and particularly to a magnetic flux angle compensation method for a stepping motor driver and a magnetic flux angle compensation device for a stepping motor driver. Background Art
[0002] A stepping motor generates a rotating magnetic field by sequentially exciting stator windings to drive the rotor to rotate step by step. The rotation angle of each step is called the step angle, and its accuracy directly affects the positioning performance of the motor. Currently, the control of stepping motors usually adopts open-loop control, that is, the speed and position of the motor are controlled by controlling the pulse frequency and quantity. With the improvement of the control accuracy requirement and the development of technology, the closed-loop control strategy based on Field-Oriented Control (FOC) has developed rapidly and has the trend of gradually replacing the traditional control strategy.
[0003] In order to achieve precise torque, speed, and position control, a stepping motor driver based on FOC relies on accurate magnetic flux angle detection. However, due to manufacturing errors, load fluctuations, magnetic circuit nonlinearity, temperature changes, positioning errors, etc., there is a certain deviation between the actual magnetic flux direction of the motor and the theoretical magnetic flux direction.
[0004] In related technologies, the compensation methods for the magnetic flux angle deviation of stepping motors mainly include: 1. By improving motor design, increasing manufacturing precision, optimizing the magnetic circuit structure, etc., to reduce the magnetic flux angle deviation. However, this method has a high cost and it is difficult to completely eliminate the deviation. 2. Estimating and compensating the magnetic flux angle deviation through control algorithms. However, most of the compensation methods use a single fixed value for compensation, and it is impossible to compensate each tooth separately, or the compensation method is based on the motor model and sensor feedback. The model parameters of this method are easily affected by external factors, resulting in limited compensation effects. Summary of the Invention
[0005] In order to solve the above technical problems, the present invention provides a magnetic flux angle compensation method for a stepping motor driver to effectively solve the problem of magnetic flux angle deviation in the actual operation of a stepping motor and improve the positioning accuracy, operation stability, and efficiency of the motor.
[0006] The present invention also provides a magnetic flux angle compensation device for a stepping motor driver.
[0007] The technical solutions adopted by the present invention are as follows:
[0008] An embodiment of the first aspect of the present invention provides a method for compensating the magnetic flux angle of a stepper motor driver, including the following steps: generating a first drive voltage reference value and a second drive voltage reference value, estimating the stepper motor angle according to the first drive voltage reference value and the second drive voltage reference value, where the first drive voltage reference value and the second drive voltage reference value have different phases; obtaining the mean value sequence and the standard angle sequence of the stepper motor angle according to the stepper motor angle, establishing an angle compensation sequence according to the mean value sequence and the standard angle sequence, and obtaining the mapping relationship from the mean value sequence to the angle compensation sequence F , according to the mapping relationship F generating an angle compensation table; obtaining a compensation angle according to the mechanical angle output by the stepper motor and the angle compensation table, and performing angle compensation on the magnetic flux angle of the stepper motor driver according to the compensation angle.
[0009] The method for compensating the magnetic flux angle of the stepper motor driver proposed above by the present invention further has the following additional technical features:
[0010] According to an embodiment of the present invention, the first drive voltage reference value u a and the second drive voltage reference value u b are AC signals of non-sinusoidal waves that change periodically. Among them, one period of the first drive voltage reference value u a includes four parts, each part being 0.25T. The first part: starting from 0, linearly rising to the amplitude t sl within the first time h , and remaining unchanged within the second time t f ; The second part: u a within the first time t sl descending linearly from the amplitude h to 0, and remaining unchanged within the second time t f ; The third part: u a within the first time t sl descending linearly from 0 to - h , and remaining unchanged within the second time t f ; The fourth part: u a within the first time t sl rising linearly from - h to 0, and remaining unchanged within the second timet f remain unchanged within a certain period of time; the second drive voltage reference value u b and the first drive voltage reference value u a have a 90° phase difference, t sl < t f <0.25T.
[0011] According to an embodiment of the present invention, estimating the stepping motor angle based on the first drive voltage reference value and the second drive voltage reference value specifically includes: the first drive voltage reference value u a and the second drive voltage reference value u b generate a drive signal through a modulation algorithm, input it into the driver, and the driver outputs a drive voltage to drive the stepping motor to operate. Obtain the mechanical angle output by the stepping motor through position detection θ M ; judge the position state of the stepping motor according to the trend of the mechanical angle θ M changing with time. The position states include: forward rotation state and reverse rotation state; when the motor is in the reverse rotation state, exchange the first drive voltage reference value u a input into the modulation algorithm u b and the second drive voltage reference value θ M , and then detect the trend of the mechanical angle θ p ( k ) changing with time until the motor is in the forward rotation state, and record the forward angle sequence of the stepping motor θ M and according to the mechanical angle i a and the coil current value i a changing with time, when the coil current value θ p ( k ) first appears in the positive value part, record the corresponding k value, and set the parameter C = k ; when the motor is in the forward rotation state, exchange the first drive voltage reference value u a input into the modulation algorithm u b and the second drive voltage reference value, and then detect the mechanical angleθ M The trend over time until the motor is in the reverse state, and record the reverse angle sequence of the stepper motor θ n ( k )
[0012] According to an embodiment of the present invention, specifically record the forward angle sequence of the stepper motor according to the following steps θ p ( k ): For each angle step, record one by one the mechanical angles corresponding to the flat stage θ M , and record the obtained angle sequence as the forward angle sequence θ p ( k ), k = 1, 2, 3, …, N step k p , N step is the number of steps per revolution of the stepper motor, N step = 360° / θ step , θ step is the step angle of the motor, k p is the number of positive revolutions; Collect the mechanical angle θ M and the a-phase coil current value i a , and plot the mechanical angle θ M and the coil current value i a on the same time axis to show the trend over time. When the coil current value i a first appears as a positive part, record the corresponding θ p ( k ) sequence k value, and set the parameter C = k
[0013] According to an embodiment of the present invention, record the reverse angle sequence of the stepper motor according to the following steps θ n ( k ): For each angle step, record one by one the mechanical angles corresponding to the flat stage θ M , and record the obtained angle sequence as the reverse angle sequence θn ( k ), k = 1, 2, 3, …, N step k n , k n is the number of reverse turns, N step is the number of steps per revolution of the stepper motor.
[0014] According to an embodiment of the present invention, a mean sequence and a standard angle sequence of the stepper motor angle are obtained based on the stepper motor angle, and the mapping relationship from the mean sequence to the angle compensation sequence is obtained F , specifically including: based on the forward angle sequence of the stepper motor θ p ( k ) to establish a forward rotation angle matrix θ POS ; based on the reverse angle sequence of the stepper motor θ n ( k ) to establish a reverse rotation angle matrix θ NEG ; according to the forward rotation angle matrix θ POS , calculate the forward rotation mean sequence θ POS_AVG ; according to the reverse rotation angle matrix θ NEG , calculate the reverse rotation mean sequence θ NEG_AVG ; according to the forward rotation mean sequence θ POS_AVG and the reverse rotation mean sequence θ NEG_AVG calculate the mean sequence of the motor angle θ AVG ; according to the forward angle sequence θ p ( k ) in the C values, establish a standard angle sequence θ C ; according to the mean sequence θ AVG and the standard angle sequence θ C , establish an angle compensation sequence θ D ; establish the mapping relationship from the mean sequence θ AVG to the angle compensation sequence θ D F 。
[0015] According to an embodiment of the present invention, a standard angle sequence is established specifically according to the following formula θ C :
[0016] ; where, θ max is the maximum angle value for one full rotation of the motor, N step is the number of steps per revolution of the stepping motor.
[0017] According to an embodiment of the present invention, an angle compensation sequence is established specifically according to the following formula θ D :
[0018] , where, θ C is the standard angle sequence, θ AVG is the mean value sequence.
[0019] According to an embodiment of the present invention, angle compensation is performed on the flux linkage angle of the stepping motor driver according to the compensation angle, which specifically includes: inputting the position reference value and the mechanical angle θ M into the position controller so that the position controller outputs a corresponding current reference value, and inputting the current reference value into the current controller; subtracting the mechanical angle θ M from the compensation angle θ dx to obtain the compensated mechanical angle θ cx ;
[0020] Calculate , and take the decimal part of the calculation result to obtain the electrical angle θ e , which is used as the input for PARK transformation. Through PARK transformation, the current value i a of the a-phase coil of the stepping motor and the current value i b of the b-phase coil are transformed into the current values i d , i q in the rotating coordinate system. Input i d , i q into the current controller, where p is the number of rotor pole pairs; control the current controller according to the current reference value, id and i q Output a reference value of the output voltage, and output a drive signal through a modulation algorithm. Output a drive voltage through a driver, and finally control the operation of the stepping motor.
[0021] The second aspect of the present invention provides a magnetic flux angle compensation device for a stepping motor driver, including: a generation module for generating a first drive voltage reference value and a second drive voltage reference value, estimating the angle of the stepping motor according to the first drive voltage reference value and the second drive voltage reference value, where the first drive voltage reference value and the second drive voltage reference value have different phases; an acquisition module for obtaining a mean sequence and a standard angle sequence of the stepping motor angle according to the stepping motor angle, establishing an angle compensation sequence according to the mean sequence and the standard angle sequence, and obtaining a mapping relationship from the mean sequence to the angle compensation sequence F according to the mapping relationship F generate an angle compensation table; a compensation module for obtaining a compensation angle according to the mechanical angle output by the stepping motor and the angle compensation table, and performing angle compensation on the magnetic flux angle of the stepping motor driver according to the compensation angle.
[0022] The present invention has the following beneficial effects:
[0023] The present invention generates a motor angle sequence by generating a drive voltage, estimates the magnetic flux angle deviation of each tooth of the stepping motor according to the motor angle sequence, establishes an angle compensation table, and performs angle compensation on the magnetic flux angle of the stepping motor driver according to the angle compensation table, which can effectively solve the magnetic flux angle deviation problem of the stepping motor during actual operation, improve the positioning accuracy, operation stability and efficiency of the motor, has a wide application prospect, and has the advantages of low cost, simple implementation and remarkable effect. Description of the Drawings
[0024] Figure 1 is a flowchart of a magnetic flux angle compensation method for a stepping motor driver according to an embodiment of the present invention;
[0025] Figure 2 is a schematic diagram of a first drive voltage reference value according to an embodiment of the present invention u a of the schematic diagram;
[0026] Figure 3 is a schematic diagram of a second drive voltage reference value according to an embodiment of the present invention u b of the schematic diagram;
[0027] Figure 4 is the mechanical angle output when the motor rotates forward according to an embodiment of the present inventionθ M Schematic diagram of collecting the trend varying with time and the forward angle sequence
[0028] Figure 5 is the mechanical angle output when the motor rotates in reverse according to an embodiment of the present invention θ M Schematic diagram of collecting the trend varying with time and the reverse angle sequence
[0029] Figure 6 is a schematic diagram of the setting principle of the C value according to an embodiment of the present invention
[0030] Figure 7 is the schematic diagram of the flux angle compensation principle of the stepper motor driver according to an embodiment of the present invention
[0031] Figure 8 is the block diagram of the flux angle compensation device of the stepper motor driver according to an embodiment of the present invention Specific embodiments
[0032] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention
[0033] Next, the flux angle compensation method and the flux angle compensation device of the stepper motor driver proposed in the embodiments of the present invention will be described in conjunction with the accompanying drawings
[0034] Figure 1 is the flowchart of the flux angle compensation method of the stepper motor driver according to an embodiment of the present invention. As Figure 1 shown, the method includes the following steps
[0035] S1, generating a first drive voltage reference value u a and a second drive voltage reference value u b , estimating the stepper motor angle according to the first drive voltage reference value and the second drive voltage reference value, and the first drive voltage reference value and the second drive voltage reference value have different phases
[0036] In an embodiment of the present invention, as Figure 2 and 3 shown, the first drive voltage reference value u a and the second drive voltage reference value ub It is an AC signal of a periodically changing non-sinusoidal wave. One period T includes four parts, and each part is 0.25T.
[0037] Among them, as Figure 2 shown, in one period T of the first drive voltage reference value u a :
[0038] The first part: u a Starting from 0, it linearly rises to the amplitude t sl within the time of h , and remains unchanged within the time of t f ;
[0039] The second part: u a Within the time of t sl , it linearly drops from the amplitude h to 0, and remains unchanged within the time of t f ;
[0040] The third part: u a Within the time of t sl , it linearly drops from 0 to - h , and remains unchanged within the time of t f ;
[0041] The fourth part: u a Within the time of t sl , it linearly rises from - h to 0, and remains unchanged within the time of t f ;
[0042] As Figure 3 shown, the second drive voltage reference value u b has a 90° phase difference from the first drive voltage reference value u a , t sl < t f <0.25T.
[0043] In one period of the second drive voltage reference value u b :
[0044] Part 1: u b Starting from 0, it remains unchanged within t f time, and then rises linearly to the amplitude within t sl time; h ;
[0045] Part 2: u b It remains unchanged within t f time, and then drops linearly from the amplitude t sl to 0 within h time;
[0046] Part 3: u b It remains unchanged within t f time, and then drops linearly from 0 to - t sl within h time;
[0047] Part 4: u b It remains unchanged within t f time, and then rises linearly from - t sl to 0 within h time.
[0048] Variables T , h , t sl , t f can all be set in advance according to actual needs.
[0049] In an embodiment of the present invention, estimating the stepping motor angle according to the first drive voltage reference value and the second drive voltage reference value specifically includes the following steps S11 - S14:
[0050] S11, the first drive voltage reference value u a and the second drive voltage reference value u b generate a drive signal through a modulation algorithm, input it into the driver, and the driver outputs a drive voltage to drive the stepping motor to operate. The mechanical angle output by the stepping motor is obtained through position detection θ M .
[0051] S12, according to the mechanical angleθ M Judge the position state of the stepper motor according to the trend of change with time t, and the position states include: forward rotation state and reverse rotation state.
[0052] Specifically, as Figure 4 shown, if the mechanical angle θ M gradually rises, suddenly changes to 0 after reaching the maximum value, and cycles like this, the above situation judges that the motor is in the forward rotation state. As Figure 5 shown, if θ M gradually drops to 0, then suddenly changes to the maximum value, and cycles like this, the above situation judges that the motor is in the reverse rotation state.
[0053] It should be noted that, as Figure 4 shown, if the mechanical angle θ M gradually rises, suddenly changes to 0 after reaching the maximum value, and cycles like this, the above situation judges that the motor is in the forward rotation state. In this case, measure the rising stage time t r within each angular step A range and the flat stage time t fl . If t r > t fl , it is necessary to return to step S1, increase the values of the parameters T , t f , generate new drive voltage reference values u a and u b , and then start implementing from step 1 again until t r < t fl is satisfied.
[0054] S13. When the motor is in the reverse rotation state, exchange the first drive voltage reference value u a input to the modulation algorithm and the second drive voltage reference value u b , then detect the trend of change of the mechanical angle θ M with time until the motor is in the forward rotation state, record the forward angle sequence θ p ( k ), and according to the mechanical angle θ M and the coil current value ia The trend changing with time, at the coil current value i a When the positive part first appears, record the corresponding θ p ( k ) sequence k value, and set the parameter C = k .
[0055] In a specific embodiment of the present invention, as Figure 4 shown, specifically record the forward angle sequence of the stepper motor according to the following steps θ p ( k ): For each angle step, record one by one the mechanical angle corresponding to the flat stage θ M , and record the obtained angle sequence as the forward angle sequence θ p ( k ), k = 1, 2, 3, …, N step k p , N step is the number of steps per revolution of the stepper motor, N step = 360° / θ step , θ step is the step angle of the motor, k p is the number of positive revolutions; as Figure 6 shown, collect the mechanical angle θ M and the a-phase coil current value i a , plot the mechanical angle θ M and the coil current value i a on the same time axis for the trend changing with time, at the moment when the positive part first appears in the coil current value i a ( Figure 6 the moment corresponding to the dashed line in θ p ( k ) sequence k value, and set the parameter C = k, For example Figure 5 the coil current value i in aWhen the positive value part appears for the first time, the corresponding angle is θ p (2), so set C = 2.
[0056] S14, when the motor is in the forward rotation state, exchange the first drive voltage reference value input to the modulation algorithm u a and the second drive voltage reference value u b , and then detect the trend of the mechanical angle θ M changing with time until the motor is in the reverse rotation state, and record the reverse angle sequence of the stepper motor θ n ( k ).
[0057] Furthermore, record the reverse angle sequence of the stepper motor according to the following steps θ n ( k ): For each angle step, record the mechanical angle corresponding to the flat stage one by one θ M , and record the obtained angle sequence as the reverse angle sequence θ n ( k ), k = 1, 2, 3,…, N step k n , k n is the number of reverse rotation circles, N step is the number of steps per circle of the stepper motor. See Figure 5 as shown.
[0058] S2, obtain the mean sequence and standard angle sequence of the stepper motor angle according to the stepper motor angle, establish an angle compensation sequence based on the mean sequence and standard angle sequence, and obtain the mapping relationship from the mean sequence to the angle compensation sequence F , according to the mapping relationship F generate an angle compensation table for the mechanical angle output by the stepper motor.
[0059] Furthermore, in an embodiment of the present invention, obtain the mean sequence and standard angle sequence of the stepper motor angle according to the stepper motor angle, and obtain the mapping relationship from the mean sequence to the angle compensation sequence F , specifically including the following steps S21 - S2:
[0060] S21, according to the forward angle sequence of the stepper motor θ p ( k)Establish the forward rotation angle matrix θ POS 。
[0061]
[0062] N step is the number of steps per revolution of the stepper motor, k p is the number of forward rotation revolutions.
[0063] S22. According to the reverse angle sequence of the stepper motor θ n ( k )Establish the reverse rotation angle matrix θ NEG 。
[0064]
[0065] k n is the number of reverse rotation revolutions, N step is the number of steps per revolution of the stepper motor.
[0066] S23. According to the forward rotation angle matrix θ POS , calculate the forward rotation mean sequence θ POS_AVG 。
[0067]
[0068] is the element of the forward rotation mean sequence θ POS_AVG 。
[0069] S24. According to the reverse rotation angle matrix θ NEG , calculate the reverse rotation mean sequence θ NEG_AVG 。
[0070] ;
[0071] is the element of the reverse rotation mean sequence.
[0072] S25. According to the forward rotation mean sequence θ POS_AVG and the reverse rotation mean sequence θ NEG_AVG calculate the mean sequence of the motor angle θ AVG 。
[0073]
[0074] is the mean value sequence of the motor angle θ AVG in the element of
[0075] S26. According to the forward angle sequence θ p ( k ) in the C value, establish the standard angle sequence θ C .
[0076] Specifically, establish the standard angle sequence according to the following formula θ C :
[0077] ;
[0078] wherein, θ max is the maximum value of the angle for one revolution of the motor, N step is the number of steps per revolution of the stepping motor
[0079] S27. According to the mean value sequence θ AVG and the standard angle sequence θ C , establish the angle compensation sequence θ D .
[0080] Specifically, establish the angle compensation sequence according to the following formula θ D :
[0081] ;
[0082] wherein, θ C is the standard angle sequence, θ AVG is the mean value sequence, is the element in the angle compensation sequence θ D in the
[0083] S28. Establish the mapping relationship θ AVG from the mean value sequence θ D to the angle compensation sequence F .
[0084] .
[0085] For the mean value sequenceθ AVG Medium θ avg (1), θ avg (2), θ avg (3), … θ avg ( N step ) The mapping results of the differences between each point are determined by interpolation methods and extrapolation methods. For interpolation methods, methods such as linear point - slope, linear Lagrange, and spline methods can be used. For extrapolation methods, methods such as clipping and linear can be used. Only some interpolation methods and extrapolation methods are listed above, and it is not limited to the above methods.
[0086] The mechanical angle output by the stepper motor corresponds to the mean value sequence θ AVG , according to the mapping relationship F and the interpolation method, an angle compensation table is generated.
[0087] S3. Obtain the compensation angle according to the mechanical angle output by the stepper motor and the angle compensation table, and perform angle compensation on the flux linkage angle of the stepper motor driver according to the compensation angle.
[0088] Furthermore, according to an embodiment of the present invention, performing angle compensation on the flux linkage angle of the stepper motor driver according to the compensation angle specifically includes: inputting the position reference value and the mechanical angle θ M into the position controller so that the position controller outputs the corresponding current reference value, and inputting the current reference value into the current controller; subtracting the mechanical angle θ M from the compensation angle θ dx to obtain the compensated mechanical angle θ cx ; calculating , and taking the decimal part of the calculation result to obtain the electrical angle θ e , which is used as the input for PARK transformation. Through PARK transformation, the current value i a of the a - phase coil of the stepper motor, i b the current value of the b - phase coil i d , i q are transformed into the current values i d , i qInput into the current controller, where p is the number of rotor pole pairs; the control current controller outputs a voltage reference value according to the current reference value, i d and i q and outputs a drive signal through a modulation algorithm, outputs a drive voltage through a driver, and finally controls the operation of the stepper motor.
[0089] Specifically, as Figure 7 shown, the mechanical angle θ M output by the stepper motor, the position reference value and the mechanical angle θ M are input into the position controller, so that the position controller outputs a corresponding current reference value, and the current reference value is input into the current controller. Additionally, through the mapping relationship F , the compensation angle θ M corresponding to the mechanical angle θ dx is obtained. The mechanical angle θ M is subtracted from the compensation angle θ dx to obtain the compensated mechanical angle θ cx . By calculating 1 + p θ cx / 2 and taking the decimal part of the calculation result, the electrical angle θ e is obtained, which is used as the input for PARK transformation. This transformation transforms the coil current values i a , i b into the current values i d , i q in the rotating coordinate system. i d , i q are input into the current controller. The current controller outputs a voltage reference value according to the current reference value, i d and i q and outputs a drive signal through a modulation algorithm, outputs a drive voltage through a driver, and finally controls the operation of the stepper motor.
[0090] In summary, according to the flux angle compensation method of the stepper motor driver in the embodiments of the present invention, by generating a drive voltage to obtain the motor angle sequence, estimating the flux angle deviation of each tooth of the stepper motor according to the motor angle sequence, establishing an angle compensation table, and performing angle compensation on the flux angle of the stepper motor driver according to the angle compensation table, the problem of flux angle deviation of the stepper motor in actual operation can be effectively solved, the positioning accuracy, operation stability and efficiency of the motor can be improved, it has a wide range of application prospects, and has the advantages of low cost, simple implementation and remarkable effect.
[0091] Corresponding to the above flux angle compensation method of the stepper motor driver, the present invention also proposes a flux angle compensation device for a stepper motor driver. Since the device embodiments of the present invention correspond to the above method embodiments, for the details not disclosed in the device embodiments, reference can be made to the above method embodiments, and no further description will be given in the present invention.
[0092] Figure 8 It is a block diagram of a flux angle compensation device for a stepper motor driver according to an embodiment of the present invention. As Figure 8 shown, the control device includes: a generation module 1, an acquisition module 2, and a compensation module 3.
[0093] Among them, the generation module 1 is used to generate a first drive voltage reference value and a second drive voltage reference value, estimate the stepper motor angle according to the first drive voltage reference value and the second drive voltage reference value, and the first drive voltage reference value and the second drive voltage reference value have different phases; the acquisition module 2 is used to obtain the mean sequence and the standard angle sequence of the stepper motor angle according to the stepper motor angle, establish an angle compensation sequence according to the mean sequence and the standard angle sequence, obtain the mapping relationship from the mean sequence to the angle compensation sequence F , according to the mapping relationship F generate an angle compensation table; the compensation module 3 is used to obtain a compensation angle according to the mechanical angle output by the stepper motor and the angle compensation table, and perform angle compensation on the flux angle of the stepper motor driver according to the compensation angle.
[0094] According to the flux angle compensation device of the stepper motor driver in the embodiments of the present invention, by generating a drive voltage to obtain the motor angle sequence, estimating the flux angle deviation of each tooth of the stepper motor according to the motor angle sequence, establishing an angle compensation table, and performing angle compensation on the flux angle of the stepper motor driver according to the angle compensation table, the problem of flux angle deviation of the stepper motor in actual operation can be effectively solved, the positioning accuracy, operation stability and efficiency of the motor can be improved, it has a wide range of application prospects, and has the advantages of low cost, simple implementation and remarkable effect.
[0095] In the description of the present invention, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of such features. The meaning of "a plurality" is two or more, unless specifically defined otherwise.
[0096] In the description of this specification, descriptions with reference to terms such as "one embodiment", "some embodiments", "examples", "specific examples", or "some examples", etc. mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic descriptions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or more embodiments or examples. In addition, without contradiction, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.
[0097] Any process or method description shown in a flowchart or described otherwise herein can be understood to represent a module, segment, or portion of code including one or more executable instructions for implementing a customized logic function or process, and the scope of the preferred embodiments of the present invention includes additional implementations, where the functions may be executed in a manner not shown or discussed, including substantially simultaneously or in a reverse order according to the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention pertain.
[0098] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a definable sequence list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other systems that can fetch and execute instructions from the instruction execution system, apparatus, or device), or used in combination with these instruction execution systems, apparatuses, or devices. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. More specific examples (non-exhaustive list) of computer-readable media include the following: an electrical connection portion with one or more wirings (electronic device), a portable computer diskette (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpretation, or otherwise processing as appropriate, and then storing it in a computer memory.
[0099] It should be understood that various parts of the present invention can be implemented by hardware, software, firmware, or a combination thereof. In the above-described embodiments, multiple 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 in hardware, as in another embodiment, any one or a combination of the following techniques well known in the art can be used: discrete logic circuits having logic gate circuits for implementing logical functions on data signals, application-specific integrated circuits having appropriate combinational logic gate circuits, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.
[0100] Those of ordinary skill in the art of this technology can understand that all or part of the steps carried by the methods of the above-described embodiments can be completed by instructing relevant hardware through a program, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiments.
[0101] In addition, each functional unit in various embodiments of the present invention may be integrated into a processing module, or each unit may exist physically alone, 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. When 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.
[0102] The above-mentioned storage medium may be a read-only memory, a magnetic disk, an optical disk, etc.
[0103] Although the embodiments of the present invention have been shown and described above, it can be understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those of ordinary skill in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present invention.
Claims
1. A flux angle compensation method for a stepper motor driver, characterized in that: The following steps are involved: Generate a first driving voltage reference value and a second driving voltage reference value, estimate the angle of the stepping motor according to the first driving voltage reference value and the second driving voltage reference value, the first driving voltage reference value and the second driving voltage reference value having different phases; According to the stepper motor angle, the mean sequence and standard angle sequence of the stepper motor angle are obtained, and the angle compensation sequence is established according to the mean sequence and the standard angle sequence, and the mapping relationship from the mean sequence to the angle compensation sequence is obtained. F , according to the mapping relationship F Generate an angle compensation table for the mechanical angle output by the stepper motor; Obtain the compensation angle according to the mechanical angle output by the stepper motor and the angle compensation table, and perform angle compensation on the magnetic flux angle of the stepper motor driver according to the compensation angle; The stepper motor angle is estimated according to the first driving voltage reference value and the second driving voltage reference value, specifically including: the first driving voltage reference value u a and the second driving voltage reference value u b The drive signal is generated by the modulation algorithm and input into the driver. The driver outputs the drive voltage to drive the stepper motor to operate. The mechanical angle of the stepper motor output is obtained through position detection. θ M ;according to θ M The trend of change over time determines the position state of the stepper motor, which includes forward state and reverse state. When the motor is in the reverse state, the input to the modulation algorithm is swapped. u a and u b , retest θ M The trend over time until the motor is in the forward rotation state, recording the forward angle sequence of the stepper motor θ p ( k ), and according to θ M and coil current value i a The trend over time, i a When the positive part appears for the first time, record the corresponding θ p ( k ) sequence k value, and set the parameters C = k ; When the motor is in forward rotation, the exchange input to the modulation algorithm u a and u b , retest θ M Trend over time until the motor is in reverse, recording the sequence of reverse angles of the stepper motor θ n ( k ); The standard angle sequence is established according to the following formula θ C : ; in, θ max is the maximum angle of the motor when it rotates one circle. N step The number of steps per revolution of the stepper motor.
2. The flux linkage angle compensation method of the stepper motor driver according to claim 1, characterized in that: The first driving voltage reference value u a and the second driving voltage reference value u b is a periodically changing non-sinusoidal AC signal, where The first driving voltage reference value u a A cycle T includes four parts, each part is 0.25T, the first part: starting from 0, at the first time t sl The amplitude rises linearly to h , and in the second time t f The interior remains unchanged; the second part: u a At the first time t sl Internal Amplitude h It plummets to 0, and in a second t f Remain unchanged over time; Part 3: u a At the first time t sl The time drops from 0 to - h , and in the second time t f Remain unchanged over time; Part 4: u a At the first time t sl Internally - h Straight up to 0, and in the second t f Remain unchanged over time; The second driving voltage reference value u b The first driving voltage reference value u a The phase difference is 90°. t sl < t f <0.25T.
3. The flux linkage angle compensation method of the stepper motor driver according to claim 1, characterized in that: Specifically follow the steps below to record the forward angle sequence of the stepper motor θ p ( k ): For each angle step, record the mechanical angle corresponding to the flat stage one by one θ M , and record the resulting angle sequence as the forward angle sequence θ p ( k ), k =1, 2, 3,…, N step k p , N step is the number of steps per revolution of the stepper motor, N step =360° / θ step , θ step is the step angle of the motor, k p is the number of positive rotations; Collect mechanical angle θ M and a phase coil current value i a , plotting the mechanical angle on the same time axis θ M and coil current value i a Trends over time.
4. The flux linkage angle compensation method of a stepper motor driver according to claim 1, characterized in that: Follow these steps to record the reverse angle sequence of the stepper motor θ n ( k ): For each angle step, record the mechanical angle corresponding to the flat stage one by one θ M , and record the resulting angle sequence as a reverse angle sequence θ n ( k ), k =1, 2, 3,…, N step k n , k n is the number of reverse turns, N step The number of steps per revolution of the stepper motor.
5. The flux linkage angle compensation method of a stepper motor driver according to claim 1, characterized in that: According to the stepper motor angle, a mean value sequence and a standard angle sequence of the stepper motor angle are obtained, and a mapping relationship between the mean value sequence and the angle compensation sequence is obtained. F , specifically including: According to the forward angle sequence of the stepper motor θ p ( k ) Establish the positive rotation angle matrix θ POS ; According to the reverse angle sequence of the stepper motor θ n ( k ) Create an inverted angle matrix θ NEG ; According to the forward rotation angle matrix θ POS , calculate the forward mean sequence θ POS_AVG ; According to the inverted angle matrix θ NEG , calculate the reverse mean sequence θ NEG_AVG ; According to the positive mean sequence θ POS_AVG and the reversed mean series θ NEG_AVG Calculate the mean sequence of motor angles θ AVG ; According to the forward angle sequence θ p ( k ) in C value, establish a standard angle sequence θ C ; According to the mean sequence θ AVG With standard angle sequence θ C , establish the angle compensation sequence θ D ; Constructing a mean sequence θ AVG To angle compensation sequence θ D The mapping relationship F .
6. The flux linkage angle compensation method of the stepper motor driver according to claim 5, characterized in that: Specifically, the angle compensation sequence is established according to the following formula θ D : ; in, θ C Standard angle sequence, θ AVG is the mean sequence.
7. The flux linkage angle compensation method of a stepper motor driver according to claim 1, characterized in that: The magnetic flux angle of the stepper motor driver is compensated according to the compensation angle, specifically including: The position reference value and the mechanical angle θ M inputting the current reference value into the position controller so that the position controller outputs a corresponding current reference value, and inputting the current reference value into the current controller; The mechanical angle θ M With compensation angle θ dx Subtract to get the compensated mechanical angle θ cx ; Calculation 1 + p θ cx / 2, and take the decimal of the result, we can get the electrical angle θ e , used for PARK transformation input, through PARK transformation, the stepper motor a phase coil current value i a , b phase coil current value i b Transformed into the current value in the rotating coordinate system i d , i q ,Will i d , i q Input to the current controller, where p is the number of rotor pole pairs; The control current controller is based on the current reference value, i d and i q The output voltage reference value is used to output the driving signal through the modulation algorithm, and the driving voltage is output through the driver, which finally controls the operation of the stepper motor.
8. A flux angle compensation device for a stepper motor driver, characterized in that: include: A generating module, the generating module is used to generate a first driving voltage reference value and a second driving voltage reference value, and estimate the stepping motor angle according to the first driving voltage reference value and the second driving voltage reference value, wherein the first driving voltage reference value and the second driving voltage reference value have different phases; An acquisition module is used to acquire a mean sequence and a standard angle sequence of the stepper motor angle according to the stepper motor angle, establish an angle compensation sequence according to the mean sequence and the standard angle sequence, and acquire a mapping relationship from the mean sequence to the angle compensation sequence. F , according to the mapping relationship F Generate angle compensation table; A compensation module, the compensation module is used to obtain a compensation angle according to a mechanical angle output by the stepper motor and the angle compensation table, and perform angle compensation on a magnetic flux angle of the stepper motor driver according to the compensation angle; Wherein, the generating module is specifically used for: a first driving voltage reference value u a and the second driving voltage reference value u b The drive signal is generated by the modulation algorithm and input into the driver. The driver outputs the drive voltage to drive the stepper motor to operate. The mechanical angle of the stepper motor output is obtained through position detection. θ M ;according to θ M The trend of change over time determines the position state of the stepper motor, which includes forward state and reverse state. When the motor is in the reverse state, the input to the modulation algorithm is swapped. u a and u b , retest θ M The trend over time until the motor is in the forward rotation state, recording the forward angle sequence of the stepper motor θ p ( k ), and according to θ M and coil current value i a The trend over time, i a When the positive part appears for the first time, record the corresponding θ p ( k ) sequence k value, and set the parameters C = k ; When the motor is in forward rotation, the exchange input to the modulation algorithm u a and u b , retest θ M Trend over time until the motor is in reverse, recording the sequence of reverse angles of the stepper motor θ n ( k ); The standard angle sequence is established according to the following formula θ C : ; in, θ max is the maximum angle of the motor when it rotates one circle. N step The number of steps per revolution of the stepper motor.
Citation Information
Patent Citations
Permanent magnet synchronous motor initial position calibration method based on magnetic encoder
CN116317723A
Specific harmonic transient control system and method based on virtual flux linkage error compensation
CN116742629A