Motor control digital circuit and driving system

By using digital circuitry for motor control to achieve synchronous acceleration, deceleration, and distance compensation for stepper motors, the problems of high cost and complexity in existing technologies are solved, and efficient stepper motor control is realized.

CN120979241APending Publication Date: 2025-11-18HANGZHOU RUIMENG TECH

Patent Information

Application Number
CN202511076502.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-01
Publication Date
2025-11-18

AI Technical Summary

Technical Problem

In existing technologies, the motion contour driving of stepper motors mainly relies on external microcontroller programming, which results in high cost, high complexity, and the inability to achieve synchronous operation and time precision control, making it unsuitable for diverse scenarios.

Method used

The motor control digital circuit is adopted, including a first delay timing module, an acceleration/deceleration synchronization module, a stepping direction selection module, and an absolute position module. The digital circuit realizes the synchronous control of acceleration/deceleration function and distance compensation, reducing the dependence on microcontroller resources.

Benefits of technology

It achieves synchronous acceleration and deceleration control of stepper motors, reducing costs and complexity, improving work efficiency, and supporting applications in diverse scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120979241A_ABST
    Figure CN120979241A_ABST
Patent Text Reader

Abstract

The invention discloses a motor control digital circuit and a driving system, and the circuit comprises a first delay time sequence module which transmits a secondary delay pulse to an acceleration and deceleration synchronization module based on a synchronization signal and delay time; the acceleration and deceleration synchronization module obtains path input after receiving the secondary delay pulse, and selects acceleration and deceleration path write-in and acceleration and deceleration position write-in sent to the acceleration and deceleration module; the stepping direction selection module receives the stepping and direction signals of the acceleration and deceleration module and the stepping and direction signals of the distance compensation module, and outputs stepping control and direction control of the motor according to the stepping direction selection signals; and the absolute position module outputs an absolute position based on stepping control and direction control of the motor. A synchronous control function and an absolute position function are added into an existing acceleration and deceleration function, so that a user can freely switch among three modes of acceleration and deceleration, synchronous acceleration and deceleration and distance compensation, an original complex algorithm is realized through a digital circuit, and the working efficiency and the integration degree are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of motor motion control technology, and in particular to a digital circuit and drive system for motor control. Background Technology

[0002] Stepper motors are widely used in modern society, in industrial automation, medical applications, and anywhere rotation is required. Due to the significant differences in these applications, the driving requirements for stepper motors are numerous. However, currently, most stepper motor motion profile control is implemented using external microcontroller programming. The drive signals are programmed into the microcontroller and then input into the chip to drive the motor. This method is not only costly and complex, but also wastes microcontroller resources. In a specific application scenario involving lens driving, when driving zoom and focus motors, to prevent missed steps, the motor speed must be reduced. Simultaneously, complex acceleration / deceleration algorithms and step compensation algorithms need to be written in the microcontroller to ensure smooth and stable motor operation.

[0003] The Chinese patent document "A Digital Circuit, Method, Device, and Storage Medium for Motor Control," publication number CN115051605A, published on September 13, 2022, includes: a speed calculation module for acquiring the current speed of the motor during movement and determining the current movement stage of the motor through a motion indication signal returned from a comparator; a remaining distance determination module for determining the current movement distance based on the integral of the current speed and determining the remaining distance of the motor from the target position based on the current movement distance; a deceleration distance determination module for determining the deceleration distance based on the current speed and a first preset speed when the motor reaches the target position; and a comparator for comparing the remaining distance with the deceleration distance and outputting a motion indication signal based on the comparison result. This allows the motor to move according to different movement stages while saving microcontroller resources and improving efficiency. However, this technology only implements the acceleration and deceleration algorithms using hardware digital circuits, and it cannot achieve synchronous operation for acceleration and deceleration functions. Furthermore, the running time is uncontrollable; after determining the speed profile, it can only control the target distance, making it unsuitable for scenarios requiring high time accuracy and limiting its application to diverse scenarios. Summary of the Invention

[0004] The present invention aims to overcome the problems in the prior art where acceleration and deceleration algorithms are implemented using hardware digital circuits. These problems include the inability to achieve synchronous operation and uncontrollable running time when only acceleration and deceleration functions are used, the inability to control the target distance after the speed profile is determined, the inability to achieve high time accuracy, and the inability to be applied to diverse scenarios. The present invention provides a motor control digital circuit and drive system.

[0005] To achieve the above objectives, the present invention adopts the following technical solution: A digital circuit for motor control, comprising: The first delay timing module sends a second-level delay pulse to the acceleration / deceleration synchronization module based on the synchronization signal and the delay time; The acceleration / deceleration synchronization module receives the secondary delay pulse, acquires the distance input, and selects the acceleration / deceleration distance writing and acceleration / deceleration position writing to be sent to the acceleration / deceleration module according to the step direction selection signal. The stepping direction selection module receives the stepping and direction signals from the acceleration / deceleration module and the travel compensation module, and outputs the stepping control and direction control of the motor according to the stepping direction selection signal. The absolute position module outputs the absolute position based on the stepping control and direction control of the motor.

[0006] It should be noted that this invention incorporates synchronous control into the acceleration / deceleration function, making the initiation of acceleration / deceleration controllable. Furthermore, a distance compensation function is added, allowing the synchronous acceleration / deceleration function to be flexible in terms of end time; any unfinished distance is retained and added to the next synchronous acceleration / deceleration run. An absolute position function is also included, allowing users to freely switch between three modes. Especially when switching from synchronous acceleration / deceleration and distance compensation functions to automatic acceleration / deceleration, the previously traveled relative distance is still added to the actual acceleration / deceleration position, ensuring that the absolute position always originates from the initial starting point. Both the acceleration / deceleration and distance compensation functions are improved from complex algorithms in a microcontroller to implementation through digital circuits. Moreover, the digital circuits for distance compensation and synchronous acceleration / deceleration can be integrated as separate modules into any required chip, significantly improving work efficiency and integration while reducing cost and complexity.

[0007] Preferably, the acceleration / deceleration synchronization module includes: The first latching circuit receives the secondary delay pulse and outputs the distance input to the acceleration / deceleration distance circuit; Acceleration / deceleration distance circuit: The distance input is added to the remaining distance due to acceleration / deceleration to obtain the acceleration / deceleration distance, which is then input to the first selection circuit. The remaining acceleration / deceleration distance circuit is obtained by subtracting the acceleration / deceleration position read from the acceleration / deceleration module from the acceleration / deceleration distance written in; The first selection circuit selects the output acceleration / deceleration distance writing and acceleration / deceleration position writing.

[0008] Preferably, the first selection circuit includes: The selection signal generation circuit generates a step direction selection switching pulse based on the step direction selection signal and sends it to the first multiplexer and the second multiplexer. The first multiplexer selects whether to output the acceleration / deceleration distance or absolute position to the acceleration / deceleration module. The second multiplexer selects whether to output the acceleration / deceleration position or the absolute position to the acceleration / deceleration module.

[0009] Preferably, the acceleration / deceleration module outputs acceleration / deceleration step signals and acceleration / deceleration direction signals to the step direction selection module based on the acceleration / deceleration distance and acceleration / deceleration position written by the acceleration / deceleration synchronization module. The distance compensation module outputs a distance compensation step signal and a distance compensation direction signal to the step direction selection module based on the input distance and time.

[0010] Preferably, the step direction selection module includes: The third multiplexer selects the acceleration / deceleration step signal from the acceleration / deceleration module or the distance compensation step signal from the distance compensation module as the motor stepping control output, based on the stepping direction selection signal. The fourth multiplexer selects either the acceleration / deceleration direction signal from the acceleration / deceleration module or the distance compensation direction signal from the distance compensation module as the motor direction control output, based on the stepping direction selection signal.

[0011] Preferably, the absolute position module is enabled by the input motor stepper control to accumulate or subtract the absolute position, and the accumulation or subtraction is selected by the input motor direction signal to calculate the absolute position representing the current actual position.

[0012] Preferably, the distance compensation module includes: The speed calculation module, based on the first-level delay pulse and the input distance and time, combined with the estimated remaining distance fed back by the remaining distance calculation module, calculates the total distance sent to the remaining distance calculation module and the synchronization speed sent to the step direction signal generation module. The step direction signal generation module calculates and outputs the actual speed, direction signal, and step signal to the remaining distance calculation module based on the two-level delay pulse and synchronization speed.

[0013] Preferably, the remaining distance calculation module includes: The actual displacement circuit calculates the actual displacement based on the step signal and the direction signal. The first remaining distance circuit calculates the current remaining distance by subtracting the actual displacement from the total distance. The circuit operates on the distance traveled. After receiving the first-level delay pulse, it calculates the distance traveled at the actual speed within the second-level delay time. The second remaining distance circuit subtracts the distance traveled at the actual speed during the second-level delay time from the current remaining distance to obtain the expected remaining distance.

[0014] A drive system, wherein the drive chip in the drive system includes the circuit as described in any one of claims 1-8, and the drive chip further includes a two-way comparator module and a DC motor drive circuit. The input terminals of the two comparator modules are respectively connected to the zoom motor origin detection circuit and the focus motor origin detection circuit through optocoupler circuits. The outputs of the two comparator modules are connected to the MCU module; the DC motor drive circuit is connected to the infrared filter switching motor.

[0015] Preferably, the driver chip includes a voltage control mode for low-speed operation and a current control mode for high-speed operation. When the microstepping speed TSTEP is greater than the switching speed threshold TPWMTHRS, the driver chip switches from voltage control mode to current control mode; the current control mode is a current closed-loop control mode.

[0016] This invention offers the following advantages: It incorporates synchronous control into the acceleration / deceleration function, making the initiation of acceleration / deceleration controllable. Furthermore, it adds a distance compensation function, allowing the synchronous acceleration / deceleration function to be flexible regarding the end time, retaining any unfinished distance and adding it to the next synchronous acceleration / deceleration run. The addition of an absolute position function allows users to freely switch between three modes, especially when switching from synchronous acceleration / deceleration and distance compensation functions to automatic acceleration / deceleration, where the previously traveled relative distance is still added to the actual acceleration / deceleration position, ensuring the absolute position always originates from the initial starting point. The acceleration / deceleration and distance compensation functions are improved from complex algorithms in a microcontroller to implementation via digital circuits. Moreover, the digital circuits for distance compensation and synchronous acceleration / deceleration can be integrated as separate modules into any desired chip, significantly improving efficiency and integration while reducing cost and complexity. Attached Figure Description

[0017] Figure 1 This is a schematic diagram of a digital circuit for motor control in this invention.

[0018] Figure 2 This is a circuit diagram of a digital circuit for motor control in this invention.

[0019] Figure 3 This is a schematic diagram of the distance compensation module in this invention.

[0020] Figure 4 This is a circuit diagram of the distance compensation module in this invention.

[0021] Figure 5 This is a schematic diagram showing the switching between voltage control mode and current control mode of the driver chip in this invention.

[0022] Figure 6This is a schematic diagram of the automatic acceleration / deceleration function in this invention.

[0023] Figure 7 This is a schematic diagram of the synchronous acceleration and deceleration function in this invention.

[0024] Figure 8 This is a schematic diagram of the distance compensation function in this invention.

[0025] In the diagram: 1. Distance; 2. Time; 3. Synchronization signal; 4. Step direction selection; 5. First-level delay time; 6. Second-level delay time; 7. Distance compensation direction signal; 8. Distance compensation step signal; 9. Motor stepping control; 10. Motor direction control; 11. Acceleration / deceleration position. Detailed Implementation

[0026] The present invention will now be further described with reference to the accompanying drawings and specific embodiments.

[0027] like Figure 1 As shown, a digital circuit for motor control includes: The first delay timing module sends a second-level delay pulse to the acceleration / deceleration synchronization module based on the synchronization signal and the delay time; The acceleration / deceleration synchronization module receives the secondary delay pulse, acquires the distance input, and selects the acceleration / deceleration distance writing and acceleration / deceleration position writing to be sent to the acceleration / deceleration module according to the step direction selection signal. The stepping direction selection module receives the stepping and direction signals from the acceleration / deceleration module and the travel compensation module, and outputs the stepping control and direction control of the motor according to the stepping direction selection signal. The absolute position module outputs the absolute position based on the stepping control and direction control of the motor.

[0028] It should be noted that the existing acceleration and deceleration functions cannot achieve synchronous operation, and the running time is uncontrollable. Once the speed profile is determined, only the target distance can be controlled, which is not feasible when high time accuracy is required. However, acceleration and deceleration functions are very beneficial for reducing motor start-stop losses, significantly reducing motor wear. The existing distance compensation function has a large difference between start and stop speeds; it directly reaches the running speed upon startup and directly drops to 0 upon shutdown, resulting in significant motor wear. However, the distance compensation function can guarantee absolute control over the running time and is simple to set up, requiring only the target distance and running time. Therefore, it is necessary to improve upon the shortcomings of these two functions, allowing for functional switching based on the actual application scenario when they are combined.

[0029] It is worth noting that, to address the shortcomings of the two functions operating independently, this invention incorporates synchronous control into the acceleration / deceleration function, making the initiation of acceleration / deceleration controllable. Furthermore, a distance compensation function is added, allowing the synchronous acceleration / deceleration function to be flexible in terms of completion time; any unfinished distance will be retained and added to the next synchronous acceleration / deceleration run.

[0030] The existing acceleration / deceleration function operates in absolute position mode, meaning the distance traveled each time is added to the actual position, starting from the last reached position. However, the synchronous acceleration / deceleration and distance compensation functions operate in relative position mode, meaning the distance traveled each time starts from 0. Therefore, the absolute position function allows users to freely switch between the three modes. Especially when switching from synchronous acceleration / deceleration and distance compensation functions to automatic acceleration / deceleration, the previously traveled relative distance is still added to the actual position during acceleration / deceleration, ensuring that the absolute position always originates from the initial starting point. The acceleration / deceleration and distance compensation functions are improved from complex algorithms in a microcontroller to implementation through digital circuits. Furthermore, the digital circuits for distance compensation and synchronous acceleration / deceleration can be integrated as separate modules into any required chip, significantly improving efficiency and integration while reducing cost and complexity.

[0031] Specifically, the first delay timing module receives the synchronization signal 3, the first-level delay time 5, and the second-level delay time 6, and outputs the second-level delay pulse to the acceleration / deceleration synchronization module as the acceleration / deceleration synchronization signal.

[0032] The acceleration / deceleration synchronization module receives the external input signals of distance 1, step direction selection 4, and acceleration / deceleration position 11. It also receives the absolute position from the absolute position module and the acceleration / deceleration position read from the acceleration / deceleration module. Based on the secondary delay pulse that serves as the acceleration / deceleration synchronization signal, it calculates the acceleration / deceleration distance write and acceleration / deceleration position write input to the acceleration / deceleration module.

[0033] The acceleration / deceleration module is a publicly available technology. It calculates based on the input acceleration / deceleration distance and acceleration / deceleration position, and outputs acceleration / deceleration step signals and acceleration / deceleration direction signals to the step direction selection module. Therefore, it will not be described in detail.

[0034] The distance compensation module, based on the input distance 1, time 2, synchronization signal 3, first-level delay time 5, and second-level delay time 6, outputs a distance compensation step signal 8 and a distance compensation direction signal 7 to the step direction selection module. Only the distance and direction need to be provided; the speed and direction will be automatically calculated. If a new run is to begin before the running time has ended, the distance compensation module will record the unfinished distance and compensate for it in the next run, increasing or decreasing the speed to ensure that the target position is reached within the specified time.

[0035] The step direction selection module receives acceleration / deceleration step signals and acceleration / deceleration direction signals from the acceleration / deceleration module, as well as distance compensation step signals and distance compensation direction signals from the distance compensation module. It selects the appropriate step direction based on the step direction selection signal and outputs the motor direction control 10 signal and the motor step control 9 signal to the outside.

[0036] The absolute position module receives signals from the motor stepping control 9 and motor direction control 10 output from the stepping direction selection module, calculates the absolute position, and inputs it into the acceleration / deceleration synchronization module. Adding the absolute position, which is counted only based on the final generated stepping direction signal, represents the absolute position of the motor's operation. Writing the absolute position simultaneously updates the target distance and actual position in the acceleration / deceleration module's functions.

[0037] As a specific example, such as Figure 2 As shown, the acceleration / deceleration synchronization module includes: The first latching circuit receives the secondary delay pulse and outputs the distance input to the acceleration / deceleration distance circuit; Acceleration / deceleration distance circuit: The distance input is added to the remaining distance due to acceleration / deceleration to obtain the acceleration / deceleration distance, which is then input to the first selection circuit. The remaining acceleration / deceleration distance circuit is obtained by subtracting the acceleration / deceleration position read from the acceleration / deceleration module from the acceleration / deceleration distance written in; The first selection circuit selects the output acceleration / deceleration distance writing and acceleration / deceleration position writing.

[0038] It should be noted that the first latch circuit receives the secondary delay pulse from the first delay timing module as an acceleration / deceleration synchronization signal, and sends the distance input to the acceleration / deceleration distance circuit based on the input distance 1 information. The acceleration / deceleration distance circuit calculates the acceleration / deceleration distance based on the distance input and the remaining acceleration / deceleration distance from the remaining acceleration / deceleration distance circuit, and sends it to the first selection circuit. The remaining acceleration / deceleration distance circuit determines the remaining acceleration / deceleration distance based on the acceleration / deceleration distance written from the first selection circuit and the acceleration / deceleration position read from the acceleration / deceleration module. The first selection circuit selects the acceleration / deceleration distance written and acceleration / deceleration position written based on the step direction selection 4 signal.

[0039] Furthermore, the first selection circuit includes: The selection signal generation circuit generates a step direction selection switching pulse based on the step direction selection signal and sends it to the first multiplexer and the second multiplexer. The first multiplexer selects whether to output the acceleration / deceleration distance or absolute position to the acceleration / deceleration module. The second multiplexer selects whether to output the acceleration / deceleration position 11 or the absolute position to the acceleration / deceleration module.

[0040] It is worth noting that the circuit in this invention is a digital circuit. The first latch circuit U5 performs signal latching and is a latching circuit. When the second-level delay pulse arrives, U5 is enabled to latch the input distance information, and the distance input for this synchronous acceleration and deceleration operation is sent to the acceleration and deceleration distance circuit U6.

[0041] The acceleration / deceleration distance circuit U6 performs addition calculations, functioning as an additive circuit. It calculates the acceleration / deceleration distance for this synchronous operation using the following formula: Acceleration / deceleration distance = Distance input + Remaining acceleration / deceleration distance. This acceleration / deceleration distance, along with the absolute position, is selected by the step direction selection pulse signal, generating the acceleration / deceleration distance, which is then written into the acceleration / deceleration module for acceleration / deceleration operation.

[0042] The remaining acceleration / deceleration distance circuit U7 performs a subtraction calculation. The remaining acceleration / deceleration distance equals the acceleration / deceleration distance written minus the acceleration / deceleration position read from the acceleration / deceleration module. This remaining acceleration / deceleration distance is accumulated into the distance input to obtain the total acceleration / deceleration distance.

[0043] The step direction selection circuit U4 performs edge detection calculations. When the step direction selection signal is at its rising or falling edge, the first register U4.1 and the second register U4.2 of U4 will output opposite values, and the step direction selection switching pulse will output a clock pulse signal. When the step direction selection switching pulse is enabled, the absolute position is written into the distance and position of the acceleration / deceleration module, thereby synchronizing the relative position of the distance compensation operation with the absolute position of the acceleration / deceleration module.

[0044] As a specific example, such as Figure 2 As shown, the first delay timing module includes: The synchronization pulse generation circuit generates a corresponding synchronization signal pulse based on the received synchronization signal 3; The first-level delay circuit generates a corresponding first-level delay pulse based on the first-level delay time 5 after receiving the synchronization signal pulse; the second-level delay circuit generates a corresponding second-level delay pulse based on the second-level delay time 6 after receiving the first-level delay pulse.

[0045] It should be noted that the synchronization pulse generation circuit U1 can detect the rising edge of the synchronization signal. When the synchronization signal 3 is at the rising edge, the first register U1.1 of U1 will output 1, and U1.2 will output 0. The synchronization pulse generation circuit will output a clock pulse signal, which will be used as the synchronization signal pulse input to the first-stage delay circuit.

[0046] The first-level delay circuit U2 can perform first-level delay counting. When the synchronization signal pulse arrives, it enables U2 to be reset to the first-level delay time DT1, and decrements by 1 every clock cycle starting from DT1 until U2 equals 0. At this time, a clock pulse signal will be output as the first-level delay pulse to indicate that the first-level delay counting is complete.

[0047] The secondary delay circuit U3 can perform secondary delay counting. When the primary delay pulse arrives, it enables U3 to be reset to the secondary delay time DT2, and decrements by 1 every clock cycle starting from DT2 until U3 equals 0. At this time, it will output a clock pulse signal as the secondary delay pulse to indicate that the secondary delay counting is complete.

[0048] As a specific example, such as Figure 2 As shown, the step direction selection module includes: The third multiplexer selects signal 4 according to the stepping direction, and selects either the acceleration / deceleration stepping signal of the acceleration / deceleration module or the distance compensation stepping signal 8 of the distance compensation module as the output of motor stepping control 9. The fourth multiplexer selects signal 4 based on the stepping direction, and selects either the acceleration / deceleration direction signal of the acceleration / deceleration module or the distance compensation direction signal 7 of the distance compensation module as the output of motor direction control 10.

[0049] It should be noted that after the acceleration / deceleration module and the distance compensation module generate their respective stepping signals STEP and DIR, the stepping direction selection signal performs a 2-to-1 selection to obtain the final motor stepping control signal 9 and motor direction control signal 10.

[0050] It is worth noting that this invention can realize automatic acceleration / deceleration, synchronous acceleration / deceleration, and distance compensation functions, allowing for different operating modes to be selected in different application environments and seamless switching. The synchronous deceleration mode is an improvement on the acceleration / deceleration mode. Synchronization is added during the writing of the actual position and target distance. The remaining distance is calculated based on the written acceleration / deceleration target distance and the actual acceleration / deceleration position, and compensation calculations are performed during the next synchronous write, compensating for the unfinished distance in the new operation. In this mode, all registers related to acceleration / deceleration need to be configured. The synchronous acceleration / deceleration function will automatically accelerate / decelerate according to the configured parameters, and the speed profile control method is the same as that of the automatic acceleration / deceleration function.

[0051] The distance compensation function automatically provides a constant running speed after the target position and running time are set. After a first-level delay and a second-level delay, it begins constant running to ensure that the target position is reached by the end of the running time, and then stops immediately upon arrival. To ensure the motor can reach the target position within the specified time, and to compensate for any unfinished motor distance at the start of a new movement, the chip increases the speed to ensure the motor completes the sum of the remaining and new distances within the running time.

[0052] Optionally, the absolute position module is enabled by the input motor stepper control 9 to accumulate or subtract the absolute position, and the input motor direction control 10 signal is used to select whether to accumulate or subtract, and calculate the absolute position representing the current actual position.

[0053] It should be noted that the absolute position module U8 is a counting and accumulating digital circuit. The positive and negative directions of the motor direction control signal 10 are respectively accumulated or subtracted, and the absolute position is enabled by the motor stepping control signal 9, which is based on the absolute position = absolute position - 1 or absolute position = absolute position + 1.

[0054] It's worth noting that the target distance for the distance compensation function is a relative distance. The actual position is reset to zero at the start of each synchronization signal, and the target distance only represents the distance and direction of this synchronized run. The target distance for the automatic acceleration / deceleration function is an absolute distance. The actual position accumulates based on the step direction signal generated by the automatic acceleration / deceleration function, but this accumulation does not occur in synchronous acceleration / deceleration mode or distance compensation mode. The absolute position is counted only based on the final generated step direction signal, representing the absolute position of the run. When switching from distance compensation mode to acceleration / deceleration mode or writing the absolute position, the absolute position is written to the distance and position in the acceleration / deceleration module function.

[0055] To achieve seamless mode switching, the target distance and actual position during mode switching need to be modified: When switching from acceleration / deceleration mode to distance compensation mode: no operation is required on the target distance or the actual position; when switching from acceleration / deceleration mode to synchronous acceleration / deceleration mode: no operation is required on the target distance or the actual position; when switching from distance compensation mode to acceleration / deceleration mode: the absolute position is written to the target distance and the actual position; when switching from distance compensation mode to synchronous acceleration / deceleration mode: no operation is required on the target distance or the actual position; when switching from synchronous acceleration / deceleration mode to acceleration / deceleration mode: the absolute position is written to the target distance and the actual position; when switching from synchronous acceleration / deceleration mode to distance compensation mode: no operation is required on the target distance or the actual position.

[0056] As a specific embodiment, the acceleration / deceleration module writes the acceleration / deceleration distance and acceleration / deceleration position based on the acceleration / deceleration synchronization module outputting them to the step direction selection module, and outputs acceleration / deceleration step signals and acceleration / deceleration direction signals. Based on the input distance 1 and time 2, the distance compensation module outputs a distance compensation step signal 8 and a distance compensation direction signal 7 to the step direction selection module.

[0057] It should be noted that, as Figure 3 As shown, the distance compensation module includes: The speed calculation module, based on the first-level delay pulse and the input distance 1 and time 2, combined with the estimated remaining distance fed back by the remaining distance calculation module, calculates the total distance sent to the remaining distance calculation module and the synchronization speed sent to the step direction signal generation module. The step direction signal generation module calculates and outputs the actual speed, direction signal, and step signal to the remaining distance calculation module based on the two-level delay pulse and the synchronization speed; the direction signal and step signal output by the distance compensation module are the distance compensation direction signal 7 and the distance compensation step signal 8. The remaining distance calculation module receives the first-level delay pulse from the second delay timing module and the second-level delay time 6 from the outside, as well as the total distance from the speed calculation module and the actual speed, distance compensation direction signal 7 and distance compensation step signal 8 from the step direction signal generation module, and outputs the estimated remaining distance to the speed calculation module. The second delay timing module receives the synchronization signal 3, the first-level delay time 5, and the second-level delay time 6, sends a first-level delay pulse to the speed calculation module, a second-level delay pulse to the step direction signal generation module, and a first-level delay pulse to the remaining distance calculation module.

[0058] It's worth noting that the distance compensation process enters a first-level delay upon the arrival of the rising edge of the synchronization signal, during which distance and time can be written. After the first-level delay, a second-level delay begins, during which the running speed is calculated, and operation commences at the end of the second-level delay. By simply setting the target position and running time, the system automatically provides a constant running speed, and after the first and second-level delays, it begins constant-speed operation to ensure that the target position is reached by the end of the running time, and stops immediately upon arrival. The original algorithm's distance compensation calculation is implemented using digital circuits, ensuring continuous operation of the motor without missing steps during high-speed, high-frequency reciprocating motion; reducing the use of microcontroller resources; and simplifying the configuration of the motor drive.

[0059] To ensure the motor reaches the target position within the specified time, and to allow the motor to complete the remaining distance and the new distance within the allotted time at the start of a new movement if there is any unfinished distance, the speed can be increased. For example: In the first run, the distance is set to 100, the time to 10, and the speed to 100 / 10, completing the run when time reaches 10. In the second run, the distance is set to 100, the time to 10, and the speed to 10 / 10. If the run is not completed, a third run is initiated with a distance of 100 and a time of 10. The speed will be increased, but the run will still complete the run when time reaches 10.

[0060] Specifically, such as Figure 4As shown, the circuit of the second delay timing module is similar to that of the first delay timing module. The synchronization pulse generation circuit generates a corresponding synchronization signal pulse based on the received synchronization signal 3. The first-level delay circuit, upon receiving the synchronization signal pulse, generates a corresponding first-level delay pulse based on the first-level delay time 5 and sends it to the speed calculation module and the remaining distance calculation module. The secondary delay circuit, after receiving the primary delay pulse, generates a corresponding secondary delay pulse based on the secondary delay time 6 and sends it to the step direction signal generation module.

[0061] The synchronization pulse generation circuit U11 can detect the rising edge of the synchronization signal. When the synchronization signal 3 is at the rising edge, the first register U11.1 of U11 will output 1, and U11.2 will output 0. The synchronization pulse generation circuit will output a clock pulse signal VD_PLS_POS, which will be used as the synchronization signal pulse input to the first-stage delay circuit U12.

[0062] The first-level delay circuit U12 can perform first-level delay counting. When the synchronization signal pulse VD_PLS_POS arrives, it enables U12 to be reset to the first-level delay time DT1, and decrements by 1 every clock cycle starting from DT1 until U2 equals 0. At this time, a clock pulse signal will be output as the first-level delay pulse DT1_PLS to indicate that the first-level delay counting is complete.

[0063] The secondary delay circuit U13 can perform secondary delay counting. When the primary delay pulse DT1_PLS arrives, it enables U13 to be reset to the secondary delay time DT2, and decrements by 1 every clock cycle starting from DT2 until U3 equals 0. At this time, it will output a clock pulse signal as the secondary delay pulse DT2_PLS to indicate that the secondary delay counting is complete.

[0064] When the speed calculation module receives the DT1_PLS pulse from the first-level delay counting module, it latches the write path PSUM_write and the write time RUNT_write. Based on the write path PSUM_write and the estimated remaining path PSUM_remain_DT2 (calculated by the remaining path calculation module as the unfinished path from the previous run), the speed calculation module calculates the total path XTARGET for this synchronization run: XTARGET = PSUM_write + PSUM_remain_DT2. The synchronization speed VACTUAL_pr for this synchronization run is calculated as XTARGET / RUNT_write. After calculation, the speed calculation module inputs the total path XTARGET to the remaining path calculation module and the synchronization speed VACTUAL_pr to the step direction signal generation module.

[0065] The path latch circuit U14 and the time latch circuit U15 are both latch circuits in digital circuits. When the first-level delay pulse DT1_PLS arrives, U14 and U15 are enabled to latch the path PSUM and the time RUNT respectively, so as to obtain the write path PSUM_write and write time RUNT_write for this synchronous operation.

[0066] The total distance calculation circuit U16 is an adder circuit that performs addition calculations to calculate the total distance of this synchronous operation: XTARGET = PSUM_write + PSUM_remain_DT2. PSUM_remain_DT2 is the remaining distance after the expected second-level delay time DT2 ends.

[0067] The synchronization speed calculation circuit U17 is a division circuit that performs division calculations to calculate the synchronization speed of this synchronization operation. VACTUAL_pr = XTARGET / RUNT_write, where RUNT_write is the latch write time.

[0068] When the step direction signal generation module receives the second-level delay pulse DT2_PLS indicating the completion of the second-level delay count, it latches the synchronization speed VACTUAL_pr to obtain the actual speed VACTUAL for this synchronous operation. The step direction signal generation module then performs step counting accumulation based on the actual speed to obtain the distance-compensated step signal STEP and the distance-compensated direction signal DIR, and outputs them to the stepper motor and the remaining distance calculation module.

[0069] The speed latch circuit U18 is a latch circuit in the digital circuit. When the second-level delay pulse DT2_PLS arrives, U18 is enabled to latch the synchronous speed VACTUAL_pr, so as to obtain the actual speed VACTUAL of this synchronous operation.

[0070] The direction signal circuit U19 is a counting overflow circuit in the digital circuit. When U19 reaches full amplitude or overflows, it outputs a clock pulse signal STEP as a distance compensation step signal. The distance compensation direction signal DIR is equal to the most significant bit of the actual speed VACTUAL, representing the direction of travel. Specifically, whenever the actual speed is input, the step count is calculated and added to the actual speed. If the final result is less than or equal to the maximum step count value, the step count is updated with this result; if the final result is greater than the maximum step count value, the step count is updated by subtracting the maximum step count value from the result, and the step signal STEP is output.

[0071] The remaining distance calculation module includes: The actual displacement circuit calculates the actual displacement XACTUAL by accumulating the distance compensation step signal STEP and the distance compensation direction signal DIR. The first remaining distance circuit calculates the current remaining distance PSUM_remain by subtracting the total distance XTARGET from the actual displacement XACTUAL; After receiving the first-level delay pulse DT1_PLS, the running path circuit calculates the distance distance_DT2 traveled at the actual speed VACTUAL within the second-level delay time DT2. The second remaining distance circuit subtracts the distance traveled at the actual speed during the second-level delay time, distance_DT2, from the current remaining distance PSUM_remain to obtain the estimated remaining distance PSUM_remain_DT2.

[0072] The actual displacement circuit U20 is a counting and accumulation circuit in the digital circuit. It accumulates based on the distance compensation step signal and the distance compensation direction signal. The step signal STEP (one clock pulse) enables the actual displacement XACTUAL to be accumulated or subtracted, which is selected by the direction signal DIR. The accumulated XACTUAL result represents the current actual position.

[0073] The first remaining distance circuit U21 is a subtraction circuit that performs subtraction calculations to calculate the current remaining distance. PSUM_remain = XTARGET - XACTUAL, which represents the remaining distance to the current position.

[0074] The running distance circuit U22 is a multiplication circuit that performs multiplication calculations to calculate the distance traveled at the current actual speed within the second-level delay time DT2 when the first-level delay pulse DT1_PLS arrives: distance_DT2 = VACTUAL * DT2.

[0075] The second remaining distance circuit U23 is a subtraction circuit that performs subtraction calculations to calculate the estimated remaining distance: PSUM_remain_DT2 = PSUM_remain - distance_DT2. This represents the estimated distance remaining at the end of the second-level delay time DT2. The distance subsequently added to the write distance PSUM_write represents the total distance after compensation.

[0076] As a specific embodiment, this application also provides a driving system. The driving chip of the driving system has a motor control digital circuit as described above. The driving chip also includes two comparator modules and a DC motor driving circuit. The input terminals of the two comparator modules are respectively connected to the zoom motor origin detection circuit and the focus motor origin detection circuit through optocoupler circuits. The output terminals of the two comparator modules are connected to the MCU module. The DC motor driving circuit is connected to the infrared filter switching motor.

[0077] Furthermore, the driver chip includes a voltage control mode for low-speed operation and a current control mode for high-speed operation; when the microstep speed TSTEP is greater than the switching speed threshold TPWMTHRS, the driver chip switches from the voltage control mode to the current control mode; the current control mode is a current closed-loop control mode.

[0078] In existing technologies, lens drive systems typically include one or two zoom motors, one focus motor, one infrared filter switching motor, and one aperture motor.

[0079] Zoom motors are typically stepper motors, and their main function is to drive the optical zoom components within the lens to achieve smooth and precise zooming. This is achieved by the motor driving the lens elements within the lens to move back and forth, thereby changing the focal length. The use of zoom motors allows the lens to make smooth and rapid focal length adjustments during shooting, providing more stable and higher-quality images.

[0080] The focusing motor is usually a stepper motor, and its main function is to drive the focusing lens group to move to the position specified by the program, thereby achieving autofocus. When the lens of the camera or webcam is pointed at the subject, one or more sensors in the autofocus system "read" the framed scene or object and control the movement of the autofocus lens group through the motor.

[0081] Infrared filter switching motors are typically DC brushed motors. During the day, when there is sufficient light, the circuit control board drives the switcher to switch and position itself to operate the infrared cut-off filter. At this time, the CCD or CMOS sensor can reproduce true colors, avoiding interference from infrared light. At night, when visible light is insufficient, the infrared cut-off filter automatically moves away, and the full-spectrum optical glass begins to operate. It then senses the infrared light from the infrared lamp, allowing the CCD or CMOS sensor to fully utilize all light sources, thus greatly improving the night vision performance of the infrared camera, resulting in a clear and natural image.

[0082] The existing MS41908 basically contains all the motor drive components required for a lens drive system. Most current lens drive solutions use driver chips similar to the MS41908M, which integrates two 5V stepper motor drivers and one aperture motor driver with hall feedback. In the zoom and focus subsystems, when detecting the system origin, optocoupler sensing circuits and comparator circuits need to be added so that the main control MCU can accurately identify the origin. When driving the zoom and focus motors, to prevent the motors from losing steps, the motor speed must be reduced, and complex acceleration / deceleration algorithms must be used on the main control MCU.

[0083] To address the aforementioned issues, the motor control digital circuit of this invention improves the driver chip, directly integrating two comparator modules and a DC motor drive circuit within the chip. Because the driver chip incorporates two comparator modules, the output of the optocoupler signal can be directly fed to the driver chip. After passing through the internal comparator modules, the comparison result is sent to the MCU as a trigger signal for origin position detection. Similarly, since the driver chip incorporates a DC motor drive circuit, all driver chips can directly drive the infrared filter switching motor without adding extra drive circuitry and occupying MCU I / O resources. Compared to existing solutions that require external two comparators and a DC motor drive circuit, this significantly reduces the complexity of the external circuitry.

[0084] Furthermore, compared to existing technologies, the driver chip in this application integrates an automatic switching function between voltage control mode and current control mode, solving the problem of not only extremely quiet operation at low speeds but also stable operation at high speeds without step loss. Simultaneously, the current closed-loop control mode in the current control mode solves the problem of potential current instability during motor operation and shutdown, without requiring MCU intervention.

[0085] like Figure 5 As shown, the microstepping speed TSTEP represents the actual measured time between two 256-microstep pulses on the pulse input pin, in units of 2 / fCLK. The switching speed threshold TPWMTHRS represents the maximum speed in silent mode (i.e., voltage control mode). TPOWERDOWN sets the delay time from the standby mode (stst) to the motor turning off, ranging from approximately 0 to 4 seconds. IHOLDDELAY sets the number of clock cycles it takes for the current to decrease from IRUN to IHOLD, decreasing by 1 for every (2^18 * 2 * tCLK * IHOLDDELAY).

[0086] The driver chip integrates an automatic switching function between voltage control and current control modes. The mode switching threshold is the switching speed threshold TPWMTHRS set in the TPWMTHRS register. Therefore, by setting a reasonable TPWMTHRS value in the design, the motor can be guaranteed to be extremely quiet at standstill and low speeds, as well as stable and fast operation at high speeds. Furthermore, the driver chip's current control mode is a closed-loop current control mode, meaning that as long as the running current and holding current registers are configured, the motor can operate at a constant current, eliminating concerns about changes in motor current due to differences in motor speed or parameters.

[0087] like Figure 6 The diagram shown is a schematic of the automatic acceleration / deceleration function of the present invention. Figure 7The diagram shows the synchronous acceleration and deceleration function of this invention. Its acceleration and deceleration ramps better match the motor torque curve, with acceleration divided into four stages and deceleration into two stages, configured to achieve a more flexible and optimized motion curve.

[0088] In the diagram, VSTART represents the motor's starting speed. A1 indicates the acceleration when the speed is less than VA1 but greater than VSTART. VA1 represents the first-stage acceleration / deceleration threshold; A1 is disabled when the speed exceeds this threshold. A2 indicates the acceleration when the speed is less than VA2 but greater than VA1. VA2 represents the second-stage acceleration / deceleration threshold; A1 and A2 are disabled when the speed exceeds this threshold. A3 indicates the acceleration when the speed is less than VA3 but greater than VA2. VA3 represents the third-stage acceleration / deceleration threshold; A1, A2, and A3 are disabled when the speed exceeds this threshold. AMAX indicates the acceleration when the speed is less than VMAX but greater than VA3. VMAX represents the maximum acceleration / deceleration speed. DMAX indicates the deceleration when the speed is less than VMAX but greater than VD1. VD1 represents the first-stage acceleration / deceleration threshold; D1 is disabled when the speed exceeds this threshold. D1 represents the deceleration when the speed is less than VD1 but greater than VSTOP. VSTOP represents the motor's stopping speed (set VSTOP≥VSTART). VD_A_EN indicates that the VD synchronous acceleration / deceleration mode is enabled when VD_EN=1. PSUM represents the target number of steps for the synchronous acceleration / deceleration mode.

[0089] When using the automatic acceleration / deceleration and synchronous acceleration / deceleration functions in the motor control digital circuit of this invention, the user only needs to set the target position XTARGET, and the motor will automatically start running according to the set acceleration / deceleration curve. Setting the VD_A_EN synchronization signal in the register to 1 on the rising edge enables the synchronous acceleration / deceleration mode. In this mode, the motor's acceleration profile needs to be set, and the target number of steps needs to be input. The acceleration profile setting is the same as in the acceleration / deceleration mode. After reaching the maximum speed VMAX, the motor will begin to rotate at a constant speed, and then automatically decelerate according to the remaining steps until the set number of steps is completed.

[0090] like Figure 8 The diagram shows the distance compensation function in this invention. VD_A_EN indicates that the VD synchronous acceleration / deceleration mode is enabled when VD_EN = 1. PSUM represents the target number of steps in the distance compensation mode. RUNT represents the running time of the distance compensation mode.

[0091] When applying the distance compensation mode in the motor control digital circuit of this invention, the user only needs to set the target position and running time. The chip will automatically provide a constant running speed and begin constant running after a first-level delay time DT1 and a second-level delay time DT2 to ensure that the target position is reached by the end of the running time. Upon reaching the target position, the chip will stop immediately. To ensure that the motor can reach the target position within the specified time, and if there is any unfinished motor distance at the start of a new movement, the chip will increase the speed to ensure that the motor completes the sum of the remaining distance and the new distance within the running time.

[0092] The camera lens motor drive system employing the motor control circuit and drive chip of this invention can utilize acceleration and deceleration functions when the camera needs to be powered on for focusing. For continuous image capture, a distance compensation function can be used. When multiple runs are required, and a one-click return to a fixed position is needed, to avoid position coordinate confusion caused by the relative distance of the synchronization function, a mode integrating an absolute position function can be used, combining these features to achieve mode switching for different application scenarios.

[0093] The above embodiments are further elaborations and descriptions of the present invention to facilitate understanding, and are not intended to limit the present invention in any way. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A digital circuit for motor control, characterized in that, include: The first delay timing module sends a second-level delay pulse to the acceleration / deceleration synchronization module based on the synchronization signal and the delay time; The acceleration / deceleration synchronization module receives the secondary delay pulse, acquires the distance input, and selects the acceleration / deceleration distance writing and acceleration / deceleration position writing to be sent to the acceleration / deceleration module according to the step direction selection signal. The stepping direction selection module receives the stepping and direction signals from the acceleration / deceleration module and the travel compensation module, and outputs the stepping control and direction control of the motor according to the stepping direction selection signal. The absolute position module outputs the absolute position based on the stepping control and direction control of the motor.

2. The digital circuit for motor control according to claim 1, characterized in that, The acceleration / deceleration synchronization module includes: a first latching circuit, which receives a secondary delay pulse and outputs the distance input to the acceleration / deceleration distance circuit; Acceleration / deceleration distance circuit: The distance input is added to the remaining distance due to acceleration / deceleration to obtain the acceleration / deceleration distance, which is then input to the first selection circuit. The remaining acceleration / deceleration distance circuit is obtained by subtracting the acceleration / deceleration position read from the acceleration / deceleration module from the acceleration / deceleration distance written in; The first selection circuit selects the output acceleration / deceleration distance writing and acceleration / deceleration position writing.

3. The digital circuit for motor control according to claim 2, characterized in that, The first selection circuit includes: a selection signal generation circuit, which generates a step direction selection switching pulse based on the step direction selection signal and sends it to the first multiplexer and the second multiplexer; The first multiplexer selects whether to output the acceleration / deceleration distance or absolute position to the acceleration / deceleration module. The second multiplexer selects whether to output the acceleration / deceleration position or the absolute position to the acceleration / deceleration module.

4. A digital circuit for motor control according to claim 1, 2, or 3, characterized in that, The acceleration / deceleration module writes the acceleration / deceleration distance and acceleration / deceleration position based on the acceleration / deceleration synchronization module outputting the acceleration / deceleration distance and acceleration / deceleration position, and outputs acceleration / deceleration step signal and acceleration / deceleration direction signal to the step direction selection module. The distance compensation module outputs a distance compensation step signal and a distance compensation direction signal to the step direction selection module based on the input distance and time.

5. A digital circuit for motor control according to claim 4, characterized in that, The step direction selection module includes: The third multiplexer selects the acceleration / deceleration step signal from the acceleration / deceleration module or the distance compensation step signal from the distance compensation module as the motor stepping control output, based on the stepping direction selection signal. The fourth multiplexer selects either the acceleration / deceleration direction signal from the acceleration / deceleration module or the distance compensation direction signal from the distance compensation module as the motor direction control output, based on the stepping direction selection signal.

6. A digital circuit for motor control according to claim 1, 2, 3, or 5, characterized in that, The absolute position module is enabled by the input motor stepper control to accumulate or subtract the absolute position. The accumulation or subtraction is selected by the input motor direction signal to calculate the absolute position representing the current actual position.

7. A digital circuit for motor control according to claim 4, characterized in that, The distance compensation module includes: a speed calculation module, which calculates the total distance sent to the remaining distance calculation module and the synchronization speed sent to the step direction signal generation module based on the first-level delay pulse and the input distance and time, combined with the expected remaining distance fed back by the remaining distance calculation module. The step direction signal generation module calculates and outputs the actual speed, direction signal, and step signal to the remaining distance calculation module based on the two-level delay pulse and synchronization speed.

8. A digital circuit for motor control according to claim 7, characterized in that, The remaining distance calculation module includes: an actual displacement circuit, which calculates the actual displacement based on the step signal and the direction signal; The first remaining distance circuit calculates the current remaining distance by subtracting the actual displacement from the total distance. The circuit operates on the distance traveled. After receiving the first-level delay pulse, it calculates the distance traveled at the actual speed within the second-level delay time. The second remaining distance circuit subtracts the distance traveled at the actual speed during the second-level delay time from the current remaining distance to obtain the expected remaining distance.

9. A drive system, characterized in that, The drive chip in the drive system includes the circuit as described in any one of claims 1-8, and the drive chip further includes a two-way comparator module and a DC motor drive circuit. The input terminals of the two comparator modules are respectively connected to the zoom motor origin detection circuit and the focus motor origin detection circuit through optocoupler circuits. The outputs of the two comparator modules are connected to the MCU module; The DC motor drive circuit is connected to the infrared filter switching motor.

10. A drive system according to claim 9, characterized in that, The driver chip includes a voltage control mode for low-speed operation and a current control mode for high-speed operation. When the microstepping speed TSTEP is greater than the switching speed threshold TPWMTHRS, the driver chip switches from voltage control mode to current control mode; the current control mode is a current closed-loop control mode.

Citation Information

Patent Citations

  • Motor control digital circuit, method, equipment and storage medium

    CN115051605A

Cited By

  • Multi-path stepping motor control method based on time compensation and medium

    CN121689907A