A stepping motor drive correction system and method

Through multiple calibrations of the stepper motor drive correction system, the problem of current waveform deviation in stepper motor drive was solved, the drive accuracy and smoothness were improved, and high-precision control was achieved in high-microstepping mode.

CN122247254APending Publication Date: 2026-06-19FORTIOR TECHNOLOGY (SHENZHEN) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
FORTIOR TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2026-02-28
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

In existing stepper motor drive technology, the more subdivision steps there are, the higher the requirements for the accuracy of current sampling and the precision of reference voltage signals inside the drive circuit. This causes the current waveform to deviate from the ideal waveform, resulting in torque fluctuations, increased noise, and decreased positioning accuracy.

Method used

A stepper motor drive correction system is adopted, including a sensing circuit, a sampling circuit, a current-to-voltage conversion circuit, a sine wave generator, a proportional amplifier, a comparator circuit, and a calibration control circuit. Through multiple calibration processes, the error between the sensed voltage and the reference voltage is gradually reduced, thereby improving the driving accuracy.

Benefits of technology

It significantly improves the driving accuracy and smoothness of stepper motors in high-microstepping mode, reduces system errors, and improves the accuracy of current sampling and reference voltage signals.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122247254A_ABST
    Figure CN122247254A_ABST
Patent Text Reader

Abstract

This application proposes a stepper motor drive correction system and method, relating to the field of stepper motor drive technology. The system includes an H-bridge, a sensing circuit, a sampling circuit, a current-to-voltage conversion circuit, a sine wave generator, a proportional amplifier, a comparator circuit, and a calibration control circuit. The sensing circuit samples the current of the low-side switch transistor of the H-bridge, which is then converted into a sensing voltage by the current-to-voltage conversion circuit according to a first preset ratio. The sine wave generator produces an ideal sine waveform, which is scaled by the proportional amplifier according to a second preset ratio to form a reference voltage. The comparator circuit compares the sensing voltage with the reference voltage and outputs the comparison result. Based on the comparison result, the calibration control circuit calibrates the first and second preset ratios sequentially, gradually reducing the error between the two voltages. Through these multiple calibrations, the system error is reduced to below a preset threshold, significantly improving the driving accuracy and smoothness of the stepper motor in high-microstepping mode.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of stepper motor drive technology, and in particular to a stepper motor drive correction system and method. Background Technology

[0002] Stepper motors are widely used due to their precise control characteristics. With increasing demands for motion accuracy, microstepping drive technology has become crucial, achieving smoother motion and higher resolution by subdividing each full step into multiple microsteps.

[0003] However, the more microsteps are involved, the higher the requirements for the accuracy of current sampling within the drive circuit and the precision of the reference voltage signal. In some cases, key parameters such as the sampling current and reference voltage amplitude may deviate. This type of deviation error accumulates during the microstepping process, causing the actual current waveform applied to the motor windings to deviate from the ideal sine or cosine waveform, thereby leading to torque fluctuations, increased noise, and decreased positioning accuracy. Summary of the Invention

[0004] This application proposes a stepper motor drive correction system and method, aiming to solve the technical problem of how to improve the driving accuracy of stepper motors.

[0005] To achieve the above objectives, this application proposes a stepper motor drive correction system, which includes: H-bridge, used to drive stepper motors; The sensing circuit has its control terminal connected to the control terminal of the low-side switch transistor in one of the arms of the H-bridge. The sampling circuit has its first input terminal connected to the drain terminal of the low-side switching transistor, and its second input terminal connected to the sensing circuit, for collecting the sensing current passing through the sensing circuit. A current-to-voltage conversion circuit is used to convert the sensed current into a sensed voltage at a first preset ratio. A sine wave generator is used to generate sinusoidal voltage waveforms. A proportional amplifier is used to scale a sinusoidal voltage waveform by a second preset ratio to generate a reference signal; The comparator circuit is used to compare the sensed voltage with the reference voltage of the reference signal and output the corresponding comparison result; A calibration control circuit is used to calibrate a first preset ratio based on the comparison result so that the error between the sensed voltage and the reference voltage is not higher than a first preset error threshold, and then calibrate a second preset ratio so that the error between the reference voltage and the sensed voltage is not higher than a second preset error threshold.

[0006] In one embodiment, the current-to-voltage conversion circuit includes: a current source array, a switch array, and a conversion resistor; The current source array includes several current source branches; A switch array comprises several switch branches; Each switch branch is connected in series with a corresponding current source branch and then connected to the first terminal of the conversion resistor, and the second terminal of the conversion resistor is grounded. The regulating terminal of each current source branch is used to receive the sensed current, the first terminal of the conversion resistor is used to output the sensed voltage, and the control terminal of each switch branch is connected to the calibration control circuit.

[0007] In one embodiment, the calibration control circuit is further configured to output a corresponding first switch code signal to the switch array based on the comparison result; The first switch encoding signal is used to change the on / off state of each switch branch to adjust the first preset ratio.

[0008] In one embodiment, the proportional amplifier includes: an operational amplifier, 2N switching structures, and 2N+1 voltage divider resistors; The voltage divider resistors are connected in series; The positive input terminal of the operational amplifier is used to receive a sinusoidal voltage waveform, and the output terminal of the operational amplifier is connected to the first terminal of the first voltage divider resistor; The connection point between each pair of voltage divider resistors is also connected to the first terminal of a corresponding switch structure. The second terminal of each switch structure is connected to the first input terminal of the comparator circuit. The control terminal of each switch structure is connected to the calibration control circuit. The first terminal of the (N+1)th switch structure is also connected to the inverting input terminal of the operational amplifier; The second terminal of the last voltage divider resistor is grounded.

[0009] In one embodiment, the calibration control circuit is further configured to output a corresponding second switch code signal to each switch structure based on the comparison result; The second switch encoding signal is used to change the on / off state of each switch structure in order to adjust the second preset ratio.

[0010] In one embodiment, the sine wave generator includes: a trapezoidal digital-to-analog converter, a first adjustable resistor, a second adjustable resistor, and a third adjustable resistor; The input terminal of the trapezoidal digital-to-analog converter is used to connect an external analog voltage, the output terminal of the trapezoidal digital-to-analog converter is connected to the first terminal of the first adjustable resistor, and the adjustment terminal of the trapezoidal digital-to-analog converter is connected to the calibration control circuit. The second end of the first adjustable resistor is connected to the second end of the second adjustable resistor, the first end of the third adjustable resistor, and the proportional amplifier. The first end of the second adjustable resistor is used to connect to an external analog voltage, and the second end of the third adjustable resistor is grounded. The adjustment terminals of the first adjustable resistor, the second adjustable resistor, and the third adjustable resistor are also connected to the calibration control circuit.

[0011] In one embodiment, the calibration control circuit is further configured to send a linear fitting coded signal to the trapezoidal digital-to-analog converter, the first adjustable resistor, the second adjustable resistor, and the third adjustable resistor; The linear fitting encoded signal is used to enable the trapezoidal digital-to-analog converter to perform piecewise linear fitting of the external analog voltage to form a sinusoidal waveform signal, and is used to adjust the voltage division of the sinusoidal waveform signal by the first adjustable resistor, the second adjustable resistor, and the third adjustable resistor to form a sinusoidal waveform voltage.

[0012] In one embodiment, the calibration control circuit is further configured to set the comparison parameters of the comparison circuit so that the offset value of the comparison circuit is not higher than a preset offset threshold.

[0013] Furthermore, to achieve the above objectives, this embodiment also proposes a stepper motor drive correction method, applied to the aforementioned stepper motor drive correction system. The steps of the stepper motor drive correction method include: The sensing circuit senses the current flowing through the low-side switch in one of the arms of the H-bridge circuit and generates a corresponding sensing current. The sensed current is acquired through a sampling circuit; The sensing current is converted into sensing voltage at a first preset ratio through a current-to-voltage conversion circuit; A sinusoidal voltage waveform is generated using a sine wave generator; The sinusoidal voltage waveform is scaled by a proportional amplifier at a second preset ratio to generate a reference signal; The sensed voltage is compared with the reference voltage of the reference signal by a comparison circuit to obtain the corresponding comparison result; Based on the comparison results, the first preset ratio is calibrated so that the error between the sensed voltage and the reference voltage is not higher than the first preset error threshold. Then, the second preset ratio is calibrated so that the error between the reference voltage and the sensed voltage is not higher than the second preset error threshold.

[0014] Furthermore, before the step of comparing the sensed voltage with the reference voltage of the reference signal through the comparison circuit to obtain the corresponding comparison result, the method further includes: The comparison parameters of the comparator circuit are calibrated to ensure that the offset value of the comparator circuit does not exceed the preset offset threshold.

[0015] This application provides a stepper motor drive correction system and method. The stepper motor drive correction system includes: an H-bridge for driving a stepper motor; a sensing circuit, the control terminal of which is connected to the control terminal of a low-side switch transistor in one arm of the H-bridge; a sampling circuit, the first input terminal of which is connected to the drain terminal of the low-side switch transistor, and the second input terminal of which is connected to the sensing circuit, for acquiring the sensing current passing through the sensing circuit; a current-to-voltage conversion circuit for converting the sensing current into a sensing voltage at a first preset ratio; a sine wave generator for generating a sinusoidal voltage waveform; a proportional amplifier for scaling the sinusoidal voltage waveform at a second preset ratio to generate a reference signal; a comparison circuit for comparing the sensing voltage with the reference voltage of the reference signal and outputting the corresponding comparison result; and a calibration control circuit for calibrating the first preset ratio based on the comparison result so that the error value between the sensing voltage and the reference voltage is not higher than a first preset error threshold, and then calibrating the second preset ratio so that the error value between the reference voltage and the sensing voltage is not higher than the second preset error threshold.

[0016] The current of the low-side switch in the H-bridge is sampled by a sensing circuit and converted into a sensing voltage by a current-to-voltage conversion circuit according to a first preset ratio. A sine wave generator produces an ideal sine wave, which is scaled by a proportional amplifier according to a second preset ratio to form a reference voltage. A comparator circuit compares the sensing voltage with the reference voltage and outputs the comparison result. Based on the comparison result, the calibration control circuit calibrates the first and second preset ratios sequentially, gradually reducing the error between the two voltages. Based on the above multiple calibrations, the system error is reduced to below a preset threshold, significantly improving the driving accuracy and smoothness of the stepper motor in high-microstepping mode. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on the structures shown in these drawings without creative effort.

[0018] Figure 1 This is a schematic diagram of the structure of the first embodiment of the stepper motor drive correction system of this application; Figure 2 This is a detailed circuit connection diagram of the current-to-voltage conversion circuit in the second embodiment of the stepper motor drive correction system of this application; Figure 3 This is a detailed circuit connection diagram of the proportional amplifier in the second embodiment of the stepper motor drive correction system of this application; Figure 4This is a detailed circuit connection diagram of the sine wave generator in the second embodiment of the stepper motor drive correction system of this application; Figure 5 This is a schematic diagram of the voltage output waveform of a sine wave generator; Figure 6 This is a circuit connection diagram corresponding to the calibration method of the comparison circuit in the second embodiment of the stepper motor drive calibration system of this application; Figure 7 This is a flowchart illustrating the first embodiment of the stepper motor drive correction method of this application; Figure 8 This is a flowchart illustrating the second embodiment of the stepper motor drive correction method of this application; Figure 9 This is a schematic diagram of the voltage waveform changes during the correction process.

[0019] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0020] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.

[0021] This application proposes a stepper motor drive correction system, referring to... Figure 1 The stepper motor drive correction system includes: H-bridge 10 is used to drive a stepper motor; The sensing circuit 20 has its control terminal connected to the control terminal of the low-side switching transistor in one of the arms of the H-bridge 10. The sampling circuit 30 has its first input terminal connected to the drain terminal of the low-side switching transistor and its second input terminal connected to the sensing circuit 20, for collecting the sensing current passing through the sensing circuit 20. The current-to-voltage conversion circuit 40 is used to convert the sensed current into a sensed voltage Vs at a first preset ratio. Sine wave generator 51 is used to generate sinusoidal voltage waveforms; The proportional amplifier 52 is used to scale the sinusoidal voltage waveform by a second preset ratio to generate a reference signal; The comparator circuit CMP is used to compare the sensed voltage Vs with the reference voltage Vd of the reference signal and output the corresponding comparison result. The calibration control circuit 60 is used to calibrate a first preset ratio based on the comparison result so that the error value between the sensed voltage Vs and the reference voltage Vd is not higher than the first preset error threshold, and then calibrate a second preset ratio so that the error value between the reference voltage Vd and the sensed voltage Vs is not higher than the second preset error threshold.

[0022] It should be understood that, in this embodiment, the H-bridge 10 can be understood as the drive circuit of the stepper motor, such as... Figure 1 As shown, the H-bridge 10 includes a first high-side switch HQ1, a second high-side switch HQ2, a first low-side switch LQ1, a second low-side switch LQ2, and a stepper motor winding L. The first high-side switch HQ1 and the first low-side switch LQ1 form one bridge arm, and the second high-side switch HQ2 and the second low-side switch LQ2 form the other bridge arm. Both upper bridge arms are connected to the stepper motor's drive power supply, and both lower bridge arms are grounded. The midpoints of the two bridge arms are connected through the winding L.

[0023] It should be noted that in this embodiment, the gates of the four switching transistors of the H-bridge 10 are connected to the control circuit of the H-bridge 10, and are switched on and off sequentially according to a specific order and timing based on the control signals provided by the control circuit. This allows the stepper motor to be driven using any of the following driving methods: full-step drive, half-step drive, and micro-step drive. Micro-step drive subdivides a full step into multiple micro-steps (e.g., 256 steps / cycle) by controlling the current in the two-phase winding L to vary according to sine and cosine waveforms. This control method requires controlling not only the direction but also the magnitude of the current, placing high demands on the accuracy of system parameters. To reduce system errors, error calibration is required before officially driving the stepper motor.

[0024] It is worth noting that, in this embodiment, the control circuit of the H-bridge 10 can be integrated into the aforementioned calibration control circuit 60. It can be considered that the calibration control circuit 60 proposed in this embodiment can both perform error calibration for the entire system and control the H-bridge 10 to drive the stepper motor after calibration.

[0025] It should be understood that, in this embodiment, as Figure 1 As shown, during calibration, a specific drive current can be injected externally into the second low-side switch LQ2, and subsequent error calibration can be achieved based on the theoretically injected drive current magnitude.

[0026] It should be noted that, in this embodiment, a sensing circuit 20 can be configured at one of the low-side switching transistors of the H-bridge 10 (e.g., the second low-side switching transistor LQ2 in the figure). The sensing circuit 20 is composed of a sensing transistor Qc, which is formed by multiple transistors connected in series. Its gate terminal is connected to the gate terminal of the corresponding low-side switching transistor, the drain terminal of the uppermost layer is connected to one of the sampling terminals of the sampling circuit 30, and the source terminal of the lowermost layer is grounded. The other sampling terminal of the sampling circuit 30 is connected to the midpoint of the bridge arm where the corresponding low-side switching transistor is located. Based on the above design, the sensing transistor Qc can replicate the driving current flowing through the corresponding low-side switching transistor according to the size ratio n:1 of the corresponding low-side switching transistor and the sensing transistor Qc in the H-bridge 10, forming a sensing current. At this time, the sampling circuit 30 can collect the above sensing current and transmit the sensing current to the current-to-voltage conversion circuit 40.

[0027] It is easy to understand that the first preset ratio refers to the scaling factor in the current-to-voltage conversion circuit 40, which represents the conversion ratio of the sensed current Is to the sensed voltage Vs. In reality, due to the physical characteristics of transistors (device mismatch, temperature drift), certain systematic errors are introduced. Therefore, the above scaling factor needs to be corrected to obtain a sensed voltage Vs that is closer to the actual situation. In this embodiment, the current-to-voltage conversion circuit 40 can convert the sensed current according to the first preset ratio to obtain a sensed voltage Vs that reflects the actual motor drive current.

[0028] It should be noted that the second preset ratio refers to the amplification gain coefficient in the proportional amplifier 52, which is used to precisely control the sinusoidal waveform voltage. In this embodiment, the sine wave generator 51 is mainly responsible for providing a sinusoidal waveform, while the proportional amplifier 52 is mainly responsible for controlling the amplitude of the waveform to compensate for errors. In this way, the reference signal that ideally needs to be provided to the stepper motor drive current can be formed.

[0029] It is easy to understand that, in this embodiment, the comparator circuit CMP can specifically be a comparator, with its inverting input terminal connected as the first input terminal to the proportional amplifier 52, its non-inverting input terminal connected as the second input terminal to the current-to-voltage conversion circuit 40, and its output terminal connected to the calibration control circuit 60. It can compare the voltage value received at the first input terminal with the voltage value received at the second input terminal to form a comparison result, which is then output to the calibration control circuit 60. Specifically, the comparison result can be understood as a pair of high and low voltage levels, where one level indicates that the voltage value received at the first input terminal is greater than the voltage value received at the second input terminal, and the other level indicates that the voltage value received at the first input terminal is less than the voltage value received at the second input terminal.

[0030] It is worth noting that in this embodiment, the first preset error threshold is a system-defined allowable error range, which can be set by the minimum resolution of the current-to-voltage conversion circuit 40. When the error value between the sensed voltage Vs and the reference voltage Vd is lower than the first preset error threshold, it can be considered that the calibration of the current-to-voltage conversion circuit 40 has been completed. Similarly, the second preset error threshold is also a system-defined allowable error range, which can be set by the minimum resolution of the proportional amplifier 52. When the comparison result is lower than the second preset error threshold, it can be considered that the calibration of the proportional amplifier 52 has been completed. In practice, the second preset error threshold is smaller than the first preset error threshold.

[0031] In a specific implementation, a drive current of a specific magnitude can be injected into the H-bridge 10 from the outside. The sensing circuit 20 can replicate the current flowing through the low-side switch of one arm of the H-bridge 10 at a specific ratio (transistor size ratio) to form a sensing current. The sampling circuit 30 connected to the sensing circuit 20 can sample the sensing current and transmit it to the current-to-voltage conversion circuit 40. The current-to-voltage conversion circuit 40 converts the sensing current into a corresponding sensing voltage Vs based on a currently internally set first preset ratio. Simultaneously, the sine wave generator 51 generates a sinusoidal voltage waveform, which is then scaled by the proportional amplifier 52 at a currently internally set second preset ratio to form an ideal reference signal. Subsequently, the comparator circuit CMP compares the sensing voltage Vs with the reference voltage Vd of the reference signal and outputs the corresponding comparison result. The calibration control circuit 60 calibrates the first and second preset ratios sequentially based on the comparison result. When calibrating the first preset ratio, the sensed voltage Vs is made closer to the reference voltage Vd, so that the error between the sensed voltage Vs and the reference voltage Vd is not higher than the first preset error threshold; subsequently, when calibrating the second preset ratio, the reference voltage Vd is made closer to the sensed voltage Vs, so that the error between the reference voltage Vd and the sensed voltage Vs is not higher than the second preset error threshold.

[0032] Based on the above circuit structure, the current sampling and sinusoidal stepping reference were calibrated twice in sequence. Through the above successive approximation calibration mechanism, the internal system error of this system can be reduced as much as possible, which greatly improves the driving accuracy of the stepper motor in high-microstepping mode.

[0033] This application proposes a stepper motor drive correction system, comprising: an H-bridge for driving a stepper motor; a sensing circuit, the control terminal of which is connected to the control terminal of a low-side switch transistor in one arm of the H-bridge; a sampling circuit, the first input terminal of which is connected to the drain terminal of the low-side switch transistor, and the second input terminal of which is connected to the sensing circuit, for acquiring the sensing current passing through the sensing circuit; a current-to-voltage conversion circuit for converting the sensing current into a sensing voltage at a first preset ratio; a reference signal generation circuit for generating a reference signal; a comparison circuit for comparing the sensing voltage with the reference voltage of the reference signal and outputting a corresponding comparison result; and a calibration control circuit for calibrating the first preset ratio based on the comparison result, so that the error between the reference voltage and the sensing voltage is not higher than a first preset error threshold. The sensing circuit samples the current of the low-side switch transistor of the H-bridge, which is then converted into a sensing voltage at a first preset ratio by the current-to-voltage conversion circuit; a sine wave generator generates an ideal sine wave, which is scaled by a proportional amplifier at a second preset ratio to form a reference voltage; and the comparison circuit compares the sensing voltage with the reference voltage and outputs a comparison result. Based on the comparison results, the calibration control circuit calibrates the first preset ratio and the second preset ratio sequentially, gradually reducing the error between the two voltages. Through these multiple calibrations, the system error is reduced to below a preset threshold, significantly improving the driving accuracy and smoothness of the stepper motor in high-microstepping mode.

[0034] Based on the first embodiment of the stepper motor drive correction system of this application, in the second embodiment of the stepper motor drive correction system of this application, the content that is the same as or similar to that in the first embodiment can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 2 , Figure 3 , Figure 4 , Figure 5 as well as Figure 6 In this embodiment, the current-to-voltage conversion circuit 40 includes: a current source array, a switch array, and a conversion resistor Rs; The current source array includes several current source branches; The switch array includes several switch branches; Each of the switch branches is connected in series with a corresponding current source branch, and then connected to the first terminal of the conversion resistor Rs. The second terminal of the conversion resistor Rs is grounded. The adjustment terminal of each current source branch is used to receive the sensed current, the first terminal of the conversion resistor Rs is used to output the sensed voltage Vs, and the control terminal of each switch branch is connected to the calibration control circuit 60.

[0035] It should be understood that reference is possible. Figure 2 A current source array is an array formed by arranging several current source branches side by side, and a switch array is an array formed by arranging several switch branches side by side.

[0036] It should be noted that in this embodiment, each current source branch is equipped with a current source, which can replicate the sensed current and output it according to a specific ratio. Each current source branch also corresponds to a switch branch connected in series. Each switch branch is controlled by a serial digital signal provided by the calibration control circuit 60, which controls the on / off state of each current source branch, thereby controlling the magnitude of the final output current. The conversion resistor Rs is a pull-down resistor set between the voltage output node and the ground line, used to convert the current provided by each current source branch into the sensed voltage Vs. It can also be understood that this embodiment can adjust the above-mentioned first preset ratio by controlling the on / off state of each switch branch.

[0037] As a specific method, such as Figure 3 As shown, there can be five current source branches, including Is1, Is2, Is3, Is4, and Is5. There are at least four switching branches, including at least K1, K2, K3, and K4. Is1, Is2, Is3, and Is4 are connected in series with K1, K2, K3, and K4, respectively. Is5 is a fixed-conducting current source branch (which can be considered as being connected in series with a normally-conducting K5, not shown in the figure), providing 0.5 times the reference current (sensing current). Is1 provides 0.0625 times the current; Is2 provides 0.125 times the current; Is3 provides 0.25 times the current; and Is4 provides 0.5 times the current. Based on the control of the calibration control circuit 60, the connection combination of each current source branch can be changed. Through different combinations, 16 levels of fine adjustment of the original sensing current from 0.5 times to 1.4375 times can be achieved, allowing the first preset ratio to change upwards or downwards based on 1. Furthermore, other branches can be designed to increase the amplification factor of the current, thereby changing the adjustment range of the first preset ratio.

[0038] Further references can be made. Figure 2 In this embodiment, the calibration control circuit 60 is also used to output a corresponding first switch code signal to the switch array based on the comparison result; The first switch encoding signal is used to change the on / off state of each switch branch to adjust the first preset ratio.

[0039] It is easy to understand that the first switch encoding signal is the aforementioned "serial digital signal provided by the calibration control circuit 60 to each switch branch," which can specifically be a binary code, where "0" and "1" are used to indicate that a corresponding switch branch needs to be controlled to be turned on and off, respectively. In this embodiment, the calibration control circuit 60 generates the corresponding first switch encoding signal based on the comparison result, thereby controlling the switching state of each switch branch and connecting the corresponding current source branches to the first terminal of the conversion resistor Rs, thereby completing the calibration work of the first preset ratio.

[0040] Further references can be made. Figure 3 In this embodiment, the proportional amplifier 52 includes: an operational amplifier AMP, 2N switching structures SWn, and 2N+1 voltage divider resistors Rfn; The voltage divider resistors Rfn are connected in series; The positive input terminal of the operational amplifier AMP is used to receive the sinusoidal voltage, and the output terminal of the operational amplifier AMP is connected to the first terminal of the first voltage divider resistor Rfn; The connection point between each pair of voltage divider resistors Rfn is also connected to the first terminal of a corresponding switch structure SWn. The second terminal of each switch structure SWn is connected to the first input terminal of the comparator circuit CMP. The control terminal of each switch structure SWn is connected to the calibration control circuit 60. The first terminal of the (N+1)th switch structure SWn is also connected to the inverting input terminal of the operational amplifier AMP; The second terminal of the last voltage divider resistor Rfn is grounded.

[0041] It should be noted that this can be used as a reference. Figure 3 In this embodiment, the proportional amplifier 52 mainly consists of an operational amplifier AMP and an analog-to-digital converter (ADC). The positive input terminal of the operational amplifier AMP is used to receive a sinusoidal voltage Vout, and its inverting input terminal is used to receive a feedback voltage Vf provided by the ADC. Based on the feedback voltage Vf and the sinusoidal voltage Vout, a stable operational amplifier output voltage Vamp is provided.

[0042] It is easy to understand that, in this embodiment, the aforementioned analog-to-digital conversion unit mainly consists of 2N+1 voltage divider resistors Rfn (N is a positive integer, and n is a value between 1 and 2N+1) and 2N switch structures SWn (N is a positive integer, and n is a value between 1 and 2N). The first terminal of the first voltage divider resistor Rf1 is used to receive the op-amp output voltage Vamp from the operational amplifier AMP. The second terminal of the first voltage divider resistor Rf1 is used to connect to the first terminal of the next voltage divider resistor Rf2, and so on, for any two adjacent voltage divider resistors Rfn and Rfn+1. At the connection point between any two adjacent voltage divider resistors Rfn and Rfn+1, the first terminal of a corresponding switch structure SWn is also connected. The second terminals of all switch structures SWn are connected to the first input terminal of the comparator circuit CMP, and the control terminals of all switch structures SWn are connected to the calibration control circuit 60. The first terminal of the (N+1)th switch structure SWn is also connected to the inverting input terminal of the operational amplifier AMP, enabling the operational amplifier AMP to operate in a closed loop. The output voltage Vamp of the operational amplifier is the same as the feedback voltage Vf formed by the first terminal of the Nth switch structure SWn.

[0043] Based on the above circuit structure, the on / off state of each switch can be changed by altering the digital encoding signal output by the calibration control circuit 60, thereby changing the actual voltage division generated by each voltage divider branch based on the operational amplifier output voltage Vamp. This changes the feedback voltage Vf generated at the first terminal of the Nth switch structure SWn. The operational amplifier output voltage Vamp will change with the feedback voltage Vf, ultimately forming a reference voltage Vd scaled by a second preset ratio, which is then output to the comparator circuit CMP. As a specific method, such as... Figure 4 As shown, specifically, 33 voltage divider resistors Rfn (voltage divider resistors Rf1, ..., voltage divider resistors Rf16, ..., voltage divider resistors Rf33) and 32 switch structures SWn (switch structure SW1, ..., switch SW16, ..., switch structure SW32) can be set, and N is 16. In this way, a higher precision calibration effect can be achieved.

[0044] Furthermore, in this embodiment, the calibration control circuit 60 is also used to output a corresponding second switch code signal to each switch structure SWn based on the comparison result; The second switch encoding signal is used to change the on / off state of each switch structure SWn in order to adjust the second preset ratio.

[0045] It is easy to understand that the second switch encoding signal is the aforementioned "digital signal provided by the calibration control circuit 60 to each switch structure," which can specifically be a binary code, where "0" and "1" are used to indicate that a corresponding switch structure SWn needs to be controlled to be turned on and off, respectively. In this embodiment, after completing the calibration work corresponding to the first preset ratio, the calibration control circuit 60 also generates the corresponding second switch encoding signal based on the comparison result, thereby controlling the switching state of each switch structure SWn, changing the connection relationship between each voltage divider resistor Rfn, and changing the feedback voltage Vf formed at the first end of the Nth switch structure SWn and the Vd formed at its second end, thereby completing the calibration work of the second preset ratio.

[0046] Further references can be made. Figure 4 as well as Figure 5 In this embodiment, the sine wave generator 51 includes: a trapezoidal digital-to-analog converter 511, a first adjustable resistor Rt1, a second adjustable resistor Rt2, and a third adjustable resistor Rt3; The input terminal of the trapezoidal digital-to-analog converter 511 is used to connect to an external analog voltage Vref, the output terminal of the trapezoidal digital-to-analog converter 511 is connected to the first terminal of the first adjustable resistor Rt1, and the adjustment terminal of the trapezoidal digital-to-analog converter 511 is connected to the calibration control circuit 60. The second end of the first adjustable resistor Rt1 is connected to the second end of the second adjustable resistor Rt2, the first end of the third adjustable resistor Rt3, and the proportional amplifier 52. The first end of the second adjustable resistor Rt2 is used to connect to the external analog voltage Vref, and the second end of the third adjustable resistor Rt3 is grounded. The adjustment terminals of the first adjustable resistor Rt1, the second adjustable resistor Rt2, and the third adjustable resistor Rt3 are also connected to the calibration control circuit 60.

[0047] It should be understood that reference is possible. Figure 4 The external analog voltage Vref refers to a fixed voltage provided externally. Its main purpose is to provide a voltage reference for the subsequently synthesized sinusoidal waveform voltage Vout, ensuring that its positive waveform voltage Vout does not exceed the external analog voltage Vref. The sinusoidal waveform voltage Vout is a voltage approximating a sinusoidal waveform synthesized through piecewise linear fitting. In this embodiment, the sine wave generator 51 can be understood as a waveform synthesizer, which can use the externally provided analog voltage Vref as the base voltage and, according to the encoded signal (such as a multi-bit digital binary code) provided by the calibration control circuit 60, output a piecewise linearly fitted sinusoidal waveform voltage Vout.

[0048] Specifically, in this embodiment, the sine wave generator 51 can be constructed by an R-2R linear digital-to-analog converter (trapezoidal digital-to-analog converter 511) in conjunction with a T-type resistor network. The trapezoidal digital-to-analog converter 511 can linearly convert the external analog voltage Vref into an analog voltage based on the received digital binary code. The first adjustable resistor Rt1, the second adjustable resistor Rt2, and the third adjustable resistor Rt3 in the T-type resistor network can change their resistance values ​​based on the received digital binary code, thereby changing the output voltage division of the entire T-type resistor network.

[0049] Furthermore, in this embodiment, the calibration control circuit 60 is also used to send linear fitting encoded signals to the trapezoidal digital-to-analog converter 511, the first adjustable resistor Rt1, the second adjustable resistor Rt2, and the third adjustable resistor Rt3. The linear fitting encoded signal is used to enable the trapezoidal digital-to-analog converter 511 to perform piecewise linear fitting on the external analog voltage to form a sinusoidal waveform signal, and to adjust the voltage division of the sinusoidal waveform signal by the first adjustable resistor Rt1, the second adjustable resistor Rt2, and the third adjustable resistor Rt3 to form a sinusoidal waveform voltage.

[0050] It is easy to understand that, in this embodiment, the calibration control circuit 60 can send an eight-bit digital binary code (i.e., the aforementioned linear fitting encoding signal) to the trapezoidal digital-to-analog converter 511 and the T-type resistor network. The high three bits are used to divide the voltage output by the trapezoidal digital-to-analog converter 511 into eight equal-length segments, and the low five bits are used to control the output voltage of the trapezoidal digital-to-analog converter 511 and the resistance values ​​of the first adjustable resistor Rt1, the second adjustable resistor Rt2, and the third adjustable resistor Rt3. Ultimately, this completes the function of outputting a piecewise linearly fitted sinusoidal waveform voltage Vout, as shown in the figure. Figure 5 As shown.

[0051] Furthermore, in this embodiment, the calibration control circuit 60 is also used to set the comparison parameters of the comparison circuit CMP so that the offset value of the comparison circuit CMP is not higher than a preset offset threshold.

[0052] It should be understood that the offset value of the comparator circuit CMP refers to the offset voltage caused by the comparator circuit CMP itself due to process errors (comparison parameters). When the same voltage is applied to both the first and second input terminals simultaneously, the offset voltage between the first and second input terminals may cause the comparator circuit CMP to mistakenly believe that the voltage received at the first input terminal is higher than the voltage received at the second input terminal, or mistakenly believe that the voltage received at the first input terminal is lower than the voltage received at the second input terminal.

[0053] It should be noted that, as Figure 6As shown, in this embodiment, before calibrating the first and second preset ratios sequentially through the calibration control circuit, the comparator circuit CMP needs to be separated from the system, and the first and second input terminals of the comparator circuit CMP are directly grounded. At this time, the comparator circuit CMP will still output a comparison result based on the voltage difference between the first and second input terminals. This comparison result can be a high-level voltage or a low-level voltage. Subsequently, the calibration control circuit 60 can perform sequential approximation correction on the comparison parameters of the comparator circuit CMP based on the comparison result and according to the binary search method. Finally, an error calibration code corresponding to a digital quantity is generated within the minimum resolution range of the comparison parameters. Subsequently, when the comparator circuit CMP is reconnected to the system, the calibration control circuit 60 can set the comparison parameters of the comparator circuit CMP based on the previously generated error calibration code, so that the offset value (offset voltage) generated by the comparator circuit CMP does not exceed a preset offset threshold.

[0054] It is worth noting that the preset offset threshold is also a system-defined allowable error range, which can be set by the minimum resolution of the comparator circuit CMP. When the offset value of the comparator circuit CMP is lower than the preset offset threshold, it can be considered that the calibration of the comparator circuit CMP has been completed.

[0055] This embodiment performs three calibrations sequentially for voltage comparison, current sampling, and sinusoidal step reference. Based on the above successive approximation calibration mechanism, the system error within this system can be further eliminated.

[0056] Furthermore, to achieve the above objectives, this application also proposes a stepper motor drive correction method, which employs the stepper motor drive correction system described above. Please refer to... Figure 7 The steps of the stepper motor drive correction method include: Step S10: The current flowing through the low-side switch of one of the bridge arms of the H-bridge circuit is sensed by the sensing circuit, and a corresponding sensing current is generated. Step S20: Acquire the sensed current through a sampling circuit; Step S30: The sensing current is converted into a sensing voltage by a first preset ratio through a current-to-voltage conversion circuit; It is easy to understand that, in this embodiment, during the calibration of the drive circuit, the current flowing through the low-side switch can be replicated at a specific size ratio by a sensing circuit located in the lower arm of one of the arms of the H-bridge circuit, forming a corresponding sensing current. The current formed in the sensing circuit is then acquired by a sampling circuit to obtain the sensing current. Subsequently, the sensing current can be converted into a sensing voltage that represents the actual current flowing through the low-side switch according to a first preset ratio by a current-to-voltage conversion circuit.

[0057] Step S40: Generate a sinusoidal voltage waveform using a sine wave generator; Step S50: The sinusoidal voltage waveform is scaled by a proportional amplifier at a second preset ratio to generate a reference signal; It is easy to understand that, in this embodiment, while obtaining the sensing voltage as described above, a reference signal with a sine wave can also be generated by a sine wave generator in conjunction with a proportional amplifier.

[0058] Specifically, in this embodiment, the sine wave generator can use an externally provided analog voltage as a reference voltage, and perform piecewise linear fitting on the external analog voltage based on the received digitally encoded signal to synthesize a sine wave signal that is very close to a sine wave shape. Subsequently, the sine wave signal generated by the sine wave generator is scaled by a proportional amplifier according to a second preset ratio on its voltage (i.e., the aforementioned sine wave voltage) to generate a reference signal with a corresponding reference voltage.

[0059] Step S60: The sensed voltage is compared with the reference voltage of the reference signal by a comparison circuit to obtain the corresponding comparison result; Step S70: Based on the comparison result, the first preset ratio is calibrated so that the error value between the sensed voltage and the reference voltage is not higher than the first preset error threshold. Then the second preset ratio is calibrated so that the error value between the reference voltage and the sensed voltage is not higher than the second preset error threshold.

[0060] It is readily understood that, in this embodiment, after obtaining the reference signal and the sensed voltage, the sensed voltage can be compared with the reference voltage of the reference signal using a comparison circuit, generating a comparison result characterized by high and low voltage levels. Subsequently, based on the obtained comparison result, the first preset ratio of the current-to-voltage conversion circuit can be calibrated to make the generated sensed voltage closer to the reference voltage, thereby ensuring that the error value between the sensed voltage and the reference voltage does not exceed the first preset error threshold. Finally, the second preset ratio of the proportional amplifier is calibrated based on the comparison result to make the generated reference voltage closer to the sensed voltage, thereby ensuring that the error value between the reference voltage and the sensed voltage does not exceed the second preset error threshold.

[0061] The first preset error threshold can be set based on the minimum resolution of the current-to-voltage conversion circuit, and the second preset error threshold can be set based on the minimum resolution of the proportional amplifier. The second preset error threshold is less than the first preset error threshold.

[0062] In this embodiment, the current sampling and the sinusoidal step reference are calibrated twice in sequence. Based on the above-mentioned successive approximation calibration mechanism, the system error inside the system can be further eliminated.

[0063] The stepper motor drive calibration method provided in this application adopts all embodiments of the above-described stepper motor drive calibration system. Therefore, the beneficial effects of the stepper motor drive calibration method provided in this application are the same as the beneficial effects of the stepper motor drive calibration system provided in the above embodiments. Furthermore, the other technical features in the stepper motor drive calibration method are the same as the features disclosed in the methods of the above embodiments, and will not be repeated here.

[0064] Based on the first embodiment of the stepper motor drive correction system of this application, in the second embodiment of the stepper motor drive correction system of this application, the content that is the same as or similar to that in the first embodiment can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 8 as well as Figure 9 In this embodiment, before the step of comparing the sensed voltage with the reference voltage of the reference signal through the comparison circuit to obtain the corresponding comparison result, the method further includes: Step S601: The comparison parameters of the comparison circuit are calibrated so that the offset value of the comparison circuit is not higher than a preset offset threshold.

[0065] It should be noted that before the comparator circuit officially operates, its two input terminals can be disconnected, and the first and second input terminals can be directly grounded. The comparison result can then be directly measured and used as the offset value (offset voltage). Subsequently, the comparison parameters of the comparator circuit can be set based on the measured offset value, ensuring that the offset value (offset voltage) generated by the comparator circuit does not exceed a preset offset threshold. This makes the comparison result between the sensed voltage and the reference voltage more accurate.

[0066] The preset offset threshold can be set based on the minimum resolution of the comparator circuit.

[0067] It is worth noting that during the three calibration processes described above, the voltage changes of the reference voltage Vd and the sensed voltage Vs are as follows: Figure 9 As shown, after three calibrations, the reference voltage Vd and the sensed voltage Vs gradually approach each other, meaning the system error gradually decreases.

[0068] The above are merely preferred embodiments of this application and do not limit the scope of this patent application. Any equivalent structural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of this application.

Claims

1. A stepper motor drive correction system, characterized in that, The stepper motor drive correction system includes: H-bridge, used to drive stepper motors; A sensing circuit, wherein the control terminal of the sensing circuit is connected to the control terminal of the low-side switching transistor disposed in one of the arms of the H-bridge; A sampling circuit, wherein the first input terminal of the sampling circuit is connected to the drain terminal of the low-side switching transistor, and the second input terminal of the sampling circuit is connected to the sensing circuit, for collecting the sensing current passing through the sensing circuit; A current-to-voltage conversion circuit is used to convert the sensed current into a sensed voltage at a first preset ratio; A sine wave generator is used to generate sinusoidal voltage waveforms. A proportional amplifier is used to scale the sinusoidal voltage waveform by a second preset ratio to generate a reference signal; A comparison circuit is used to compare the sensed voltage with the reference voltage of the reference signal and output the corresponding comparison result; A calibration control circuit is configured to calibrate the first preset ratio based on the comparison result, so that the error value between the sensed voltage and the reference voltage is not higher than a first preset error threshold, and then calibrate the second preset ratio so that the error value between the reference voltage and the sensed voltage is not higher than a second preset error threshold.

2. The stepper motor drive correction system as described in claim 1, characterized in that, The current-to-voltage conversion circuit includes: a current source array, a switch array, and a conversion resistor; The current source array includes several current source branches; The switch array includes several switch branches; Each of the aforementioned switch branches is connected in series with a corresponding current source branch, and then connected to the first terminal of the conversion resistor, while the second terminal of the conversion resistor is grounded. The adjustment terminal of each current source branch is used to receive the sensed current, the first terminal of the conversion resistor is used to output the sensed voltage, and the control terminal of each switch branch is connected to the calibration control circuit.

3. The stepper motor drive correction system as described in claim 2, characterized in that, The calibration control circuit is also used to output a corresponding first switch code signal to the switch array based on the comparison result; The first switch encoding signal is used to change the on / off state of each of the switch branches to adjust the first preset ratio.

4. The stepper motor drive correction system as described in claim 1, characterized in that, The proportional amplifier includes: an operational amplifier, 2N switching structures, and 2N+1 voltage divider resistors; The voltage divider resistors are connected in series; The positive input terminal of the operational amplifier is used to receive the sinusoidal voltage, and the output terminal of the operational amplifier is connected to the first terminal of the first voltage divider resistor; The connection point between each pair of voltage divider resistors is also connected to the first terminal of a corresponding switch structure, the second terminal of each switch structure is connected to the first input terminal of the comparator circuit, and the control terminal of each switch structure is connected to the calibration control circuit. The first terminal of the (N+1)th switch structure is also connected to the inverting input terminal of the operational amplifier; The second terminal of the last voltage divider resistor is grounded.

5. The stepper motor drive correction system as described in claim 4, characterized in that, The calibration control circuit is also used to output a corresponding second switch code signal to each of the switch structures based on the comparison result; The second switch encoding signal is used to change the on / off state of each of the switch structures in order to adjust the second preset ratio.

6. The stepper motor drive correction system as described in claim 1, characterized in that, The sine wave generator includes: a trapezoidal digital-to-analog converter, a first adjustable resistor, a second adjustable resistor, and a third adjustable resistor; The input terminal of the trapezoidal digital-to-analog converter is used to connect to an external analog voltage, the output terminal of the trapezoidal digital-to-analog converter is connected to the first terminal of the first adjustable resistor, and the adjustment terminal of the trapezoidal digital-to-analog converter is connected to the calibration control circuit. The second end of the first adjustable resistor is connected to the second end of the second adjustable resistor, the first end of the third adjustable resistor, and the proportional amplifier. The first end of the second adjustable resistor is used to connect to the external analog voltage, and the second end of the third adjustable resistor is grounded. The adjustment terminals of the first adjustable resistor, the second adjustable resistor, and the third adjustable resistor are also connected to the calibration control circuit.

7. The stepper motor drive correction system as described in claim 6, characterized in that, The calibration control circuit is also used to send a linear fitting code signal to the trapezoidal digital-to-analog converter, the first adjustable resistor, the second adjustable resistor, and the third adjustable resistor; The linear fitting encoded signal is used to enable the trapezoidal digital-to-analog converter to perform piecewise linear fitting on the external analog voltage to form a sinusoidal waveform signal, and to adjust the voltage division of the sinusoidal waveform signal by the first adjustable resistor, the second adjustable resistor, and the third adjustable resistor to form the sinusoidal waveform voltage.

8. The stepper motor drive correction system as described in any one of claims 1-7, characterized in that, The calibration control circuit is also used to set the comparison parameters of the comparison circuit so that the offset value of the comparison circuit is not higher than a preset offset threshold.

9. A stepper motor drive correction method, characterized in that, The stepper motor drive calibration method, applied to any one of claims 1-8, comprises the following steps: The sensing circuit senses the current flowing through the low-side switch in one of the arms of the H-bridge circuit and generates a corresponding sensing current. The sensed current is acquired through a sampling circuit; The sensing current is converted into a sensing voltage by a first preset ratio through a current-to-voltage conversion circuit; A sinusoidal voltage waveform is generated using a sine wave generator; The sinusoidal voltage is scaled by a proportional amplifier at a second preset ratio to generate a reference signal; The sensed voltage is compared with the reference voltage of the reference signal by a comparison circuit to obtain the corresponding comparison result; Based on the comparison results, the first preset ratio is calibrated so that the error between the sensed voltage and the reference voltage is not higher than the first preset error threshold. Then, the second preset ratio is calibrated so that the error between the reference voltage and the sensed voltage is not higher than the second preset error threshold.

10. The stepper motor drive correction method as described in claim 9, characterized in that, Before the step of comparing the sensed voltage with the reference voltage of the reference signal through the comparison circuit to obtain the corresponding comparison result, the method further includes: The comparison parameters of the comparison circuit are calibrated so that the offset value of the comparison circuit is not higher than a preset offset threshold.