Automatic speed gradient control of stepper motors

Loading and programming the acceleration and deceleration prescaler values ​​of the stepper motor through DMA transmission solves the problem of reduced CPU performance when the stepper motor accelerates and decelerates, realizes automated speed gradient control, and improves the performance and design of the stepper motor. flexibility.

CN112889218BActive Publication Date: 2024-09-03MICROCHIP TECHNOLOGY INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201980069834.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2019-01-23
Filing Date
2019-06-20
Publication Date
2024-09-03
Estimated Expiration
2039-06-20

AI Technical Summary

Technical Problem

Existing stepper motors require software overhead when accelerating and decelerating, causing high-priority interrupts to the CPU and reducing the performance of other software functions.

Method used

Direct memory access (DMA) transfers are used to load and program the acceleration and deceleration prescaler values ​​of the digitally controlled oscillator (NCO), reducing CPU intervention and achieving automated speed ramp control.

Benefits of technology

Automating stepper motor acceleration and deceleration through DMA transfer reduces the CPU's software instruction execution time, improves performance, and simplifies the design experience, especially suitable for computer numerical control (CNC) machines.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112889218B_ABST
    Figure CN112889218B_ABST
Patent Text Reader

Abstract

Automated speed ramp control of stepper motor acceleration and deceleration using direct memory access (DMA) and core independent peripherals (CIP) includes a numerically controlled oscillator (NCO) controlled by direct memory access (DMA) transfer of prescale values, the NCO being used in conjunction with a clock oscillator to generate clock pulses that are a function of the clock oscillator frequency and the prescale value. This automates the change of the frequency of the NCO to control more abrupt motor speeds without requiring computer processing unit (CPU) overhead. The DMA module is enabled during a first number of clock pulses for stepper speed acceleration, disabled during a second number of clock pulses for normal operation at full step speed, and then re-enabled during a third number of clock pulses for stepper speed deceleration. A table in memory may store and provide a plurality of acceleration and deceleration prescale values ​​for DMA transfer to the NCO.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] Related patent applications

[0002] This application claims priority to commonly owned U.S. Provisional Patent Application Serial No. 62 / 750,434, filed on October 25, 2018 by Keith Edwin Curtis, entitled “Automated Speed ​​Ramp Control for Stepper Motors”; and is hereby incorporated herein by reference for all purposes. Technical Field

[0003] The present disclosure relates to speed control of stepper motors, and more particularly, to methods and apparatus for automated speed ramp control of stepper motors. Background Art

[0004] Stepper motors are synchronous positioning motors. In order to run at high stepping rates, stepper motors must be accelerated and decelerated (stepping speed gradient control) to maintain lock. By using a stepping circuit based on a numerically controlled oscillator (NCO), stepping speed sequencing can be automated. However, this requires software overhead to accelerate and decelerate the stepper motor. When the stepper motor speed increases or decreases, the software running on the central processing unit (CPU) of the microcomputer or microcontroller must provide new prescaler NCO values ​​and load them into the prescaler NCO. This requires a high priority interrupt to the CPU, thereby reducing the performance of other software-related functions. Summary of the invention

[0005] Therefore, there is a need for an automated stepper motor acceleration and deceleration (speed ramp control) method and apparatus that uses direct memory access (DMA) to reduce core processing (e.g., central processing unit (CPU)) loading and improve its software instruction execution timing.

[0006] According to one embodiment, a method for performing speed gradient control of a stepper motor using direct memory access (DMA) transfer may include the following steps: providing a digitally controlled oscillator (NCO) having an oscillator input and a prescaler value input and an output providing a clock pulse, wherein the frequency of the clock pulse may be a function of the oscillator frequency and the prescaler value; providing a table of acceleration and deceleration prescaler values ​​in a memory; programming the NCO for a first number of clock pulses by using an acceleration prescaler value from a memory transferred using direct memory access (DMA); inhibiting DMA transfer to the NCO for a second number of clock pulses; and programming the NCO for a third number of clock pulses by using a deceleration prescaler value from a memory transferred using DMA.

[0007] According to another embodiment of the method, the step of counting a certain number of clock pulses from the NCO before performing a DMA transfer to the NCO may be included. According to another embodiment of the method, the step of counting the number of clock pulses from the NCO and then inhibiting the output of the NCO after the number of clock pulses reaches a maximum count may be included.

[0008] According to another embodiment, an apparatus for automated speed gradient control of stepper motor acceleration and deceleration may include: an oscillator having an output; a digitally controlled oscillator (NCO) having an oscillator input and a prescaler value input and an output providing a clock pulse, wherein the NCO oscillator input may be coupled to the oscillator output and the frequency of the clock pulse from the NCO may be a function of the frequency from the oscillator and the prescaler value; a memory for storing a plurality of acceleration and deceleration prescaler values; and a direct memory access (DMA) control circuit coupled between the NCO prescaler value input and the memory and the output of the NCO, wherein the DMA control circuit may provide the NCO with an acceleration prescaler value from the memory for a first number of clock pulses, inhibit the DMA control circuit for a second number of clock pulses, and may then provide the NCO with a deceleration prescaler value from the memory for a third number of clock pulses.

[0009] According to another embodiment, an accumulator counter may be coupled between the output of the NCO and the DMA control circuit, wherein the DMA control circuit may provide a single prescale value to the NCO after a certain number of clock pulses have occurred. According to another embodiment, a maximum counter may be coupled to the output of the NCO and inhibit operation of the NCO after receiving a certain maximum number of clock pulses from the NCO.

[0010] According to another embodiment, the DMA control circuit may include: a pulse width modulation (PWM) module having an input connected to a clock output of the NCO and an output; and a data signal modulator (DSM) having a first input connected to the clock output of the NCO, a second input connected to a fixed logic level, an output connected to a DMA trigger input of the DMA module, and a control input connected to the PWM module output for selectively connecting the output of the DSM between its first input and second input, wherein the first input can be selected when the output of the PWM module can be at a first logic level, and the second input can be selected when the output of the PWM module can be at a second logic level.

[0011] According to another embodiment, the accumulator counter may be coupled between the output of the NCO and a first input of the DSM and an input of the PWM module, wherein the DMA module may provide a single prescale value to the NCO after a certain number of clock pulses have occurred. According to another embodiment, the duty cycle of the PWM module may be programmable to provide a first logic level output during a first number of clock pulses, a second logic level output during a second number of clock pulses, and a first logic level output during a third number of clock pulses. According to another embodiment, the first logic level may be a logic zero and the second logic level may be a logic one. According to another embodiment, the first logic level may be a logic one and the second logic level may be a logic zero. According to another embodiment, the output of the DSM may be configured to switch between its first input and its second input on an edge of a control signal to a control input of the DSM.

[0012] According to another embodiment, the DMA control circuit may include: a first counter, which is used to count a first number of clock pulses; a second counter, which is used to count a second number of clock pulses; a third counter, which is used to count a third number of clock pulses; and a multiplexer, which has a first input connected to the NCO output, a second input connected to a fixed logic level, an output connected to the DMA module, and an input selection controlled by the first counter, the second counter and the third counter; wherein the first counter controls the multiplexer to connect the first input to its output during the first number of clock pulses, the second counter controls the multiplexer to connect the second input to its output during the second number of clock pulses, and the third counter controls the multiplexer to connect the first input to its output during the third number of clock pulses.

[0013] According to yet another embodiment, an apparatus for automated speed ramp control of stepper motor acceleration and deceleration may include: an oscillator having an output; a digitally controlled oscillator (NCO) having an oscillator input and a prescaler value input and an output providing a clock pulse, wherein the NCO oscillator input may be coupled to the oscillator output and the frequency of the clock pulse may be a function of the frequency from the oscillator and the prescaler value; a memory for storing a plurality of acceleration and deceleration prescaler values; a direct memory access (DMA) module coupled between the NCO prescaler value input and the memory; and a pulse width modulation (PWM) module. , the pulse width modulation module having an input connected to the clock output of the NCO; and a data signal modulator (DSM) having a first input connected to the clock output of the NCO, a second input connected to a fixed logic level, an output connected to a DMA trigger input of the DMA module, and a control input for selectively connecting the output of the DSM between its first input and second input; wherein the DMA module programs the NCO with a speed-up prescaler value during a first number of clock pulses, does not program the NCO during a second number of clock pulses, and programs the NCO with a speed-down prescaler value during a third number of clock pulses.

[0014] According to another embodiment, an accumulator counter may be coupled between a clock output of the NCO and a first input of the DSM and an input of the PWM module, wherein the DMA module may provide a single prescale value to the NCO after a certain number of clock pulses have occurred. According to another embodiment, a maximum counter may be coupled to the output of the NCO and inhibit operation of the NCO after receiving a certain maximum number of clock pulses from the NCO. According to another embodiment, the duty cycle of the PWM module may be programmable to provide a first logic level output during a first number of clock pulses, a second logic level output during a second number of clock pulses, and a first logic level output during a third number of clock pulses. According to another embodiment, the output of the DSM may be configured to switch between its first input and second input on an edge of a control signal to a control input of the DSM. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] A more complete understanding of the present disclosure may be obtained by referring to the following description taken in conjunction with the accompanying drawings, in which:

[0016] Figure 1 shows a schematic block diagram of a three-axis stepper motor circuit according to the teachings of the present disclosure;

[0017] Figure 2 , Figure 3 and Figure 4shows a schematic block diagram of an automated speed ramp control circuit according to a specific exemplary embodiment of the present invention, the automated speed ramp control circuit using direct memory access (DMA) transfer to load speed ramp control values ​​for acceleration and deceleration of a stepper motor;

[0018] Figure 5 Shows Figure 2 , Figure 3 and Figure 4 A schematic diagram of the operation of the automated speed ramp control circuit shown; and

[0019] Figure 6 Shows Figure 2 , Figure 3 and Figure 4 A schematic block diagram of functional circuit variations of the automatic speed gradient control circuit shown.

[0020] Although the present disclosure is susceptible to various modifications and alternative forms, specific exemplary embodiments thereof have been shown in the drawings and described in detail herein. However, it should be understood that the description of specific exemplary embodiments herein is not intended to limit the present disclosure to the form disclosed herein. DETAILED DESCRIPTION

[0021] Embodiments of the present invention may provide automated speed ramp control for accelerating and decelerating a stepper motor using direct memory access (DMA) transfers to load speed ramp control values ​​without intervention or program execution of an integrated circuit digital processor (e.g., a central processing unit (CPU) (e.g., but not limited to, a microcontroller unit (MCU)) to maintain the acceleration and deceleration operations of the stepper motor. In addition, core independent peripherals (CIPs) may be used to facilitate the design of automated stepper motor acceleration and deceleration (speed ramp control) circuits. CIPs are functional module blocks designed to handle their tasks without software code or supervision from a CPU. Because CIP functions are performed in hardware rather than software, CIPs achieve circuit performance far exceeding the capabilities of a typical microcontroller unit (MCU) while simplifying the design experience and reducing memory costs. Designers may create complex control circuits while having the flexibility to more easily innovate their embedded solutions. This functionality is particularly advantageous for use in computer numerical control (CNC) machines.

[0022] According to a specific exemplary embodiment of the present invention, automated stepper motor acceleration and deceleration operation information (output clock frequency that determines the stepping speed) can be provided by a digitally controlled oscillator (NCO). An NCO is a timer that uses the overflow from the addition of the incremental value to divide a signal having an input frequency by a divisor value, thereby outputting a signal having a frequency that is the input signal divided by the divisor value. The advantage of using this addition method over a simple counter-driven timer or pulse width modulator (PWM) is that the resolution of the division does not vary with the divider value, thereby resulting in true linear frequency control. NCOs are best suited for applications that require linear frequency control, high frequency accuracy, and fine resolution at a fixed duty cycle.

[0023] According to the teachings of the present disclosure, the NCO can be configured as a frequency prescaler (hereinafter referred to as a "prescaler NCO") and have frequency prescale data provided via direct memory access (DMA) transfer without intervention or program execution of the CPU of the MCU. This automates the change of frequency prescale data into the prescaler NCO. The DMA control circuit can be used to control the enabling and disabling of DMA transfers, wherein DMA transfers are enabled during step speed acceleration and deceleration, and disabled during normal operation of the step speed. Tables in memory can be provided for step speed acceleration and deceleration frequency prescale data (determining clock frequency-step speed), whereby DMA pauses are all that is needed to build a complete step speed acceleration / deceleration profile between the end of step speed acceleration and the beginning of step speed deceleration.

[0024] According to a specific exemplary embodiment of the present disclosure, CPU program software intervention can be eliminated from the stepper motor acceleration and deceleration process. The acceleration / deceleration curve (determining the clock pulse speed profile) can be loaded into the memory, and then the stepper motor operation can be started. The circuit automatically ramps up (accelerating the stepper speed) within a specific first number of NCO frequency cycles (clock pulses), then runs at the highest NCO frequency based on the last frequency pre-divided data DMA transferred to the NCO during the acceleration phase within a specific second number of NCO frequency cycles, and then starts the deceleration phase (slowing down the stepper speed) within a specific third number of NCO frequency cycles. When the acceleration / deceleration curve has been completed, the automated stepper motor acceleration and deceleration circuit can provide an interrupt to trigger the software loading of the next stepper motor movement curve (profile), such as from the CPU. The acceleration and deceleration curve (profile) is started again and the CNC machine continues to operate.

[0025] An advantage of an automated stepper motor acceleration and deceleration circuit is that the acceleration and deceleration of the CNC clock is completely automatic without intervention from the CPU of the CNC circuit.

[0026] The speed up / speed down table may be programmed into, for example, but not limited to, flash memory. The DMA CIP may be used to automate the operation of the speed up and speed down circuits independent of the CPU program steps. No program software (e.g., firmware) overhead is required other than the initial step frequency profile table loading and starting operation.

[0027] Referring now to the drawings, the details of the exemplary embodiments are schematically shown. Like elements in the drawings will be represented by like numerals, and similar elements will be represented by like numerals with different lower case letter suffixes.

[0028] See also Figure 1 , depicts a schematic block diagram of a three-axis stepper motor circuit according to the teachings of the present disclosure. A three-axis (x, y, and z) stepper motor circuit generally represented by numeral 100, CPU 132, and memory 130 is shown, but the following disclosure also applies to dual-axis and single-axis stepper motor circuits.

[0029] NCO 126 may function as a frequency prescaler and receive a clock signal having a frequency Fosc and a prescale value from clock oscillator 128 and provide a CNC_CLK signal having a frequency that is a function of the clock signal Fosc and the prescale value. NCO 126 may be programmed with the prescale value stored in memory 130. The frequency of signal CNC_CLK may be the frequency Fosc from clock oscillator 128 divided by the prescale value.

[0030] The X stepper driver 108 drives the X stepper motor 102 at a step rate determined by the frequency of the signal from the X-NCO 120 (which is a function of the frequency of CNC_CLK) and the X step rate programmed into the X-NCO 120 (e.g., from the CPU 132). The X counter 114 can monitor the number of step pulses (frequency cycles) from the X-NCO 120 and inhibit further output of the X-NCO 120 when a programmed count (#X steps) is reached (e.g., programmed from the CPU 132). The output of the X-NCO 120 can be a function of the frequency of the input signal (CNC_CLK) from the prescaler NCO 126 divided by the X step rate.

[0031] The Y stepper driver 110 drives the Y stepper motor 104 at a step rate determined by the frequency of the signal from the Y-NCO 122 and the Y step rate programmed into the Y-NCO 122 (e.g., from the CPU 132). The Y counter 116 can monitor the number of step pulses (frequency cycles) from the Y-NCO 122 and inhibit further output of the Y-NCO 122 when the programmed count (#Y steps) (e.g., programmed from the CPU 132) is reached. The output signal frequency from the Y-NCO 122 can be the frequency of the input signal (CNC_CLK) from the prescaler NCO 126 divided by the Y step rate. The NCO 126 receives a clock signal having a frequency Fosc from the clock oscillator 128 and outputs a signal having a frequency CNC_CLK, as described above.

[0032] The Z stepper driver 112 drives the Z stepper motor 106 at a step rate determined by the frequency of the signal from the Z-NCO 124 and the Z step rate programmed into the Z-NCO 124 (e.g., from the CPU 132). The Z counter 118 can monitor the number of step pulses (frequency cycles) from the Z-NCO 124 and inhibit further output of the Z-NCO 124 when a programmed count (#Z steps) is reached (e.g., programmed from the CPU 132). The output signal frequency from the Y-NCO 122 can be the frequency of the input signal (CNC_CLK) from the prescaler NCO 126 divided by the Y step rate. The NCO 126 receives a clock signal having a frequency Fosc from the clock oscillator 128 and outputs a signal having a frequency CNC_CLK, as described above.

[0033] When the stepping rates of the X stepper motor 102 and the Y stepper motor 104 are the same, an angular movement of 45 degrees will result. When the X stepping rate and the Y stepping rate are different, different angular movements will result. The number of stepping pulses will determine how far the CNC machine will move when controlled by the stepper motors. Therefore, tracking the number of stepping pulses from the X-NCO will determine the moving position of the tool controlled by the X stepper motor 102, and similarly for the Y stepper motor 104 and the Z stepper motor 106.

[0034] The Y stepper portion and the Z stepper portion of the three-axis stepper circuit operate in substantially the same manner as described above for the X stepper. By programming unique X, Y, and Z stepper rates into the X-NCO 120, Y-NCO 122, and Z-NCO 124, respectively, the movement of the CNC tool can be programmed to produce any pattern desired. In addition, the X step counter (X-CNTR) 114, the Y step counter (Y-CNTR) 116, and the Z step counter (Z-CNTR) 118 can be programmed with the maximum number of steps allowed for the X stepper motor 102, the Y stepper motor 104, and the Z stepper motor 106, respectively, for example, a predetermined count #X step, #Y step, #Z step. If the maximum number of steps is reached, the step counter (114, 116, 118) can inhibit the output of the step from the corresponding NCO (120, 122, 124).

[0035] See also Figure 2 , depicts a schematic block diagram of an automated speed ramp control circuit according to a specific exemplary embodiment of the present invention, which uses direct memory access (DMA) transfers to load speed ramp control values ​​for acceleration and deceleration of a stepper motor. The digitally controlled oscillator (NCO) 126 is configured as a frequency prescaler having: a clock input coupled to a clock signal having a frequency Fosc supplied from, for example but not limited to, the clock oscillator 128; a prescale input coupled to the DMA control circuit 240; and an output supplying a CNC_CLK signal, the frequency of which is prescaled in response to an input divisor value, for example, the frequency of the signal CNC_CLK is the frequency Fosc divided by the prescale value.

[0036] The NCO 126 will generate a clock pulse CNC_CLK whose frequency is a function of the frequency Fosc divided by the prescaler value. The prescaler value can be programmed into the NCO 126 by the DMA control circuit 240. The DMA control circuit 240 may include a direct memory access (DMA) module 232, a data signal modulator (DSM) 234, and a pulse width modulator (PWM) module 238. The DMA module 232 may obtain the prescaler value from the memory 130. The memory 130 stores the prescaler values ​​for both acceleration and deceleration of the stepper motor. The DMA module 232 may be, for example, but not limited to, a CIP, which may function independently of the CPU 132. When, for example, the DMA module 232 is reset from the CPU 132, its address counter may be reset, the first prescaler value may be obtained from the memory 130 and programmed into the NCO 126. This turns on the NCO 126 , which generates clock pulses (CNC_CLK) at a frequency determined by the frequency Fosc from the clock oscillator 128 divided by the prescale value programmed into the NCO 126 .

[0037] The PWM module 238 (when reset) also starts with a first output (logical low for purposes of explanation), which is received at the MOD input of the DSM 234. The logic low at the MOD input of the DSM 234 couples the CNC_CLK clock pulse to the trigger input of the DMA module 232. Each time a CNC_CLK clock pulse is received, an address counter in the DMA module 232 will increment, and the DMA module 232 will read a new prescale value from the memory 130 and transfer the new prescale value to the NCO 126 (DMA transfer). After the PWM module 238 has received a certain number of CNC_CLK clock pulses, its output will go to a second logic level (logical high for purposes of explanation), and the output of the DSM 234 can be decoupled from the CNC_CLK clock pulse and remain at a logic low, so that no DMA transfer will occur. After the PWM module 238 has received a further number of CNC_CLK clock pulses, its output will return to the first logic level, and then the CNC_CLK clock pulses will be again coupled to the trigger input (address counter) of the DMA module 232, and the DMA transfer to the prescaler NCO 126 will resume within the deceleration phase of the stepper motor speed profile. For any desired ratio of the first logic level to the second logic level, the PWM duty cycle of the PWM module 238 can be programmed from the CPU 132 via the duty cycle signal based on the number of CNC_CLK clock pulses to be received. The above circuits and functions can be provided by the microcontroller 200.

[0038] The DSM 234 can be configured to switch on the edges of the modulated signal. This prevents shortened pulses due to asynchronous timing between the modulating signal (output from the PWM module 238) and the modulated signal (CNC_CLK).

[0039] See also Figure 3 , depicts a schematic block diagram of an automated speed ramp control circuit according to another specific exemplary embodiment of the present invention, which uses direct memory access (DMA) transfer to load speed ramp control values ​​for acceleration and deceleration of a stepper motor. Figure 3 The circuit shown is based on Figure 2The circuit shown and described above functions in substantially the same manner with the addition of an accumulator counter 236 coupled between the output of the NCO 126 and the inputs of the PWM 238 and DSM 234 modules. The accumulator counter 236 allows a certain number of CNC_CLK pulses to occur before the DMA module 232 initiates the next DMA transfer. For example, in response to an accumulator count load input received from the CPU 132, a number of CNC_CLK clock pulses will occur before the next DMA transfer is initiated. The circuits and functions described above may be provided by the microcontroller 300.

[0040] See also Figure 4 , depicts a schematic block diagram of an automated speed ramp control circuit according to yet another specific exemplary embodiment of the present invention, which uses direct memory access (DMA) transfer to load speed ramp control values ​​for acceleration and deceleration of a stepper motor. Figure 4 The circuit shown adds counter 228 to Figure 2 and Figure 3 The circuit shown and described above functions in substantially the same manner. Counter 228 can be programmed with a maximum count Max_Count received from CPU 132, which causes prescaler NCO 126 to inhibit outputting additional CNC_CLK clock pulses when the programmed maximum count is reached. It can also be used to reset PWM module 238. This prevents the CNC tool from exceeding the maximum travel distance. Counter 228 can be reset by CPU 132 when a new acceleration / deceleration profile is started. The above circuits and functions can be provided by microcontroller 400.

[0041] See also Figure 5 , depicting Figure 2 , Figure 3 and Figure 4Schematic diagram of the operation of the automated stepper motor acceleration and deceleration circuit shown. The output waveform 540 from the PWM module 238 is shown with respect to the relative frequency of DMA transfers 542 (acceleration DMA transfer 542a and deceleration DMA transfer 542b) and CNC_CLK clock pulses 544. Initially, when the output 540 is at a first logic level, the acceleration DMA transfer 542a is allowed, and when the output 540 is at a second logic level, there is no DMA transfer 542 (the DMA start trigger to the DMA module 232 is inhibited). The frequency of the CNC_CLK clock pulse is determined by the NCO 126 based on the pre-scale value from the acceleration / deceleration table, which is stored in the memory 230 and programmed into the NCO 126 during each DMA transfer 542. Once the programmed prescale value that provides the highest frequency of CNC_CLK clock pulses is reached, for example, based on the desired number of accelerated DMA transfers 542a, further DMA transfers are inhibited until another number of clock pulses (CNC_CLK) occur, and then the NCO 126 is again programmed with the prescale value to slow down DMA transfers 542b to reduce the frequency of the CNC_CLK clock pulses, thereby used to slow down the stepper motor.

[0042] It is contemplated and within the scope of the present disclosure that the functionality of the DSM module 234 may be provided by other combinations of multiplexers or logic functions known to those of ordinary skill in the art of digital electronics design and who would benefit from the present disclosure. It is also contemplated and within the scope of the present disclosure that counters and combinational logic may be used in place of the PWM module 238. See Figure 6 , depicting Figure 2 , Figure 3 and Figure 4 Schematic block diagram of functional circuit variations of the circuits shown. For example, but not limitation, DMA control circuit 640 may include DMA module 232, multiplexer 634, speed-up counter 640, maximum speed counter 642, speed-down counter 644, and associated logic gates (not numbered).

[0043] Multiplexer 634 can be used in place of DSM module 234, where a logic "0" at the cntl input connects the CNC_CLK clock pulse to the trigger input of DMA module 232, and a logic "1" inhibits the CNC_CLK clock pulse thereto. Acceleration counter 640 can count the number of CNC_CLK clock pulses during the acceleration of the stepper motor, maximum speed counter 642 can count the number of CNC_CLK clock pulses during the maximum speed of the stepper motor, and deceleration counter 644 can count the number of CNC_CLK clock pulses during the deceleration of the stepper motor. Using combinational logic, the outputs of counters 640 and 642 can control the input selection of multiplexer 634. When the deceleration of the stepper motor has been completed, counter 644 can provide an interrupt to CPU 132a. The above circuits and functions can be provided by microcontroller 600.

[0044] The present disclosure has been described according to one or more embodiments, and it should be understood that many equivalents, alternatives, variations and modifications are possible and within the scope of the present disclosure, in addition to those explicitly stated. Although the present disclosure is susceptible to various modifications and alternative forms, specific exemplary embodiments thereof have been shown in the drawings and described in detail herein. However, it should be understood that the description of specific exemplary embodiments herein is not intended to limit the present disclosure to the specific forms disclosed herein.

Claims

1. A device for automatic speed gradient control of stepper motor acceleration and deceleration, comprising: an oscillator having an oscillator output; a digitally controlled oscillator (NCO) having an oscillator input and a prescaler value input and a clock output providing a clock pulse, wherein the NCO oscillator input is coupled to the oscillator output and the frequency of the clock pulse from the NCO is configured as a function of the frequency of the oscillator and the prescaler value; A memory, the memory being used to store a plurality of acceleration pre-scaling values ​​and deceleration pre-scaling values; and A direct memory access (DMA) control circuit is connected between the NCO prescaler value input and the memory, wherein the DMA control circuit is configured to: providing the speed up prescale value from the memory to the NCO for a first number of clock pulses; providing no value to the NCO during a second number of clock pulses; as well as then providing the NCO with the reduced speed prescale value from the memory for a third number of clock pulses, And wherein the DMA control circuit comprises: a first counter, the first counter being configured to count the first number of clock pulses; a second counter, the second counter being configured to count the second number of clock pulses; a third counter configured to count the third number of clock pulses; and a multiplexer having a first input coupled to the clock output of the NCO, a second input coupled to a fixed logic level, an output coupled to the DMA control circuit, and an input selection controlled by the first counter, the second counter, and the third counter; in: the first counter being configured to control the multiplexer to couple the first input to the output thereof during the first number of clock pulses, the second counter being configured to control the multiplexer to couple the second input to the output thereof during the second number of clock pulses, and The third counter is configured to control the multiplexer to couple the first input to the output thereof during the third number of clock pulses. 2 . The apparatus of claim 1 , wherein the DMA control circuit is further configured to not perform programming of the NCO during the second number of clock pulses. 3 . The apparatus according to claim 1 , wherein the DMA control circuit is further configured to be inhibited for the second number of clock pulses.

4. The apparatus of any one of claims 1 to 2, wherein providing the speed-up prescaler value to the NCO and providing the speed-down prescaler value to the NCO comprises programming the NCO with the speed-up prescaler value and the speed-down prescaler value.

5. The apparatus of any one of claims 1 to 2, further comprising an accumulator counter coupled between the clock output of the NCO and the DMA control circuit, wherein the DMA control circuit is configured to provide a single prescale value to the NCO after a specific number of clock pulses have occurred.

6. The apparatus of any one of claims 1 to 2, further comprising a maximum counter coupled to the clock output of the NCO, the maximum counter being configured to inhibit operation of the NCO after receiving a certain maximum number of clock pulses from the NCO.

7. The apparatus according to any one of claims 1 to 2, wherein the DMA control circuit comprises: a pulse width modulation (PWM) circuit having an input coupled to the clock output of the NCO and an output; and A data signal modulator DSM having a first input coupled to the clock output of the NCO, a second input coupled to a fixed logic level, an output coupled to a DMA trigger input of the DMA control circuit, and a control input coupled to the PWM circuit output for selectively coupling the output of the DSM between the first and second inputs thereof, wherein the first input is configured to be selected when the output of the PWM circuit is at a first logic level and the second input is selected when the output of the PWM circuit is at a second logic level.

8. The apparatus of claim 7 further comprising an accumulator counter coupled between the clock output of the NCO and the first input of the DSM and the input of the PWM circuit, wherein the DMA control circuit is configured to provide a single prescale value to the NCO after a specific number of clock pulses have occurred.

9. The apparatus of claim 7, wherein the duty cycle of the PWM circuit is programmable to provide the first logic level output during the first number of clock pulses, to provide the second logic level output during the second number of clock pulses, and to provide the first logic level output during the third number of clock pulses.

10. The apparatus of claim 7, wherein the first logic level is a logic zero and the second logic level is a logic one.

11. The apparatus of claim 7, wherein the first logic level is a logic one and the second logic level is a logic zero.

12. The apparatus of claim 7, wherein the output of the DSM is configured to switch between its first input and second input on an edge of a control signal to the control input of the DSM.

13. The device according to any one of claims 1 to 2, further comprising: a pulse width modulation (PWM) circuit having an input coupled to the clock output of the NCO; and a data signal modulator DSM having a first input coupled to the clock output of the NCO, a second input coupled to a fixed logic level, an output coupled to a DMA trigger input of the DMA control circuit, and a control input for selectively coupling the output of the DSM between the first and second inputs thereof.

14. The apparatus of claim 13 further comprising an accumulator counter coupled between the clock output of the NCO and the first input of the DSM and the input of the PWM circuit, wherein the DMA control circuit is configured to provide a single prescale value to the NCO after a specific number of clock pulses have occurred.

15. The apparatus of claim 13, further comprising a maximum counter coupled to the clock output of the NCO and configured to inhibit operation of the NCO after receiving a certain maximum number of clock pulses from the NCO.

16. The apparatus of claim 13, wherein the duty cycle of the PWM circuit is programmable to provide: a first logic level output during said first number of clock pulses; a second logic level output during said second number of clock pulses; and The first logic level is output during the third number of clock pulses.

17. The apparatus of claim 13, wherein the output of the DSM is configured to switch between its first and second inputs on an edge of a control signal to the control input of the DSM.

18. A speed control system for a stepper motor, comprising: Stepper motor; and Any one of the devices for automated speed gradient control of stepper motor acceleration and deceleration according to claims 1 to 17.

19. A method for performing speed gradient control of a stepper motor using direct memory access (DMA) transfer, the method comprising the following steps: providing a digitally controlled oscillator NCO having an oscillator input and a prescaler value input and a clock output providing a clock pulse, wherein the frequency of the clock pulse is a function of the oscillator frequency and the prescaler value; providing a table of acceleration and deceleration prescaler values ​​in memory; programming the NCO for a first number of clock pulses using the speed up prescale value transferred from the memory using direct memory access (DMA); suppressing DMA transfers to the NCO for a second number of clock pulses; as well as programming the NCO for a third number of clock pulses by using the reduced speed prescale value from the memory transferred using the DMA, The method further comprises: supply: a first counter, the first counter being configured to count the first number of clock pulses; a second counter, the second counter being configured to count the second number of clock pulses; a third counter configured to count the third number of clock pulses; and a multiplexer having a first input coupled to the clock output of the NCO, a second input coupled to a fixed logic level, an output coupled to a DMA control circuit, and an input selection controlled by the first counter, the second counter, and the third counter; utilizing a first counter, controlling the multiplexer to couple the first input to the output thereof during the first number of clock pulses; utilizing the second counter, controlling the multiplexer to couple the second input to the output thereof during the second number of clock pulses; and Using the third counter, the multiplexer is controlled to couple the first input to the output thereof during the third number of clock pulses.

20. The method of claim 19, further comprising the step of counting a certain number of clock pulses from the NCO prior to making the DMA transfer to the NCO.

21. A method according to any one of claims 19 to 20, further comprising the step of counting the number of the clock pulses from the NCO and then inhibiting the clock output of the NCO after the number of clock pulses reaches a maximum count.

22. The method of any one of claims 19 to 20, further comprising not performing programming of the NCO during the second number of clock pulses.

23. A method as claimed in any one of claims 19 to 20, further comprising providing a single prescale value to the NCO after a certain number of clock pulses have occurred.

24. The method of any one of claims 19 to 20, further comprising inhibiting operation of the NCO after receiving a certain maximum number of clock pulses from the NCO using a maximum counter coupled to the clock output of the NCO.

25. The method according to any one of claims 19 to 20, further comprising: The DMA control circuit comprises: providing a pulse width modulation (PWM) circuit having an input coupled to the clock output of the NCO and an output; and A data signal modulator (DSM) is provided, having a first input coupled to the clock output of the NCO, a second input coupled to a fixed logic level, an output coupled to a DMA trigger input of the DMA control circuit, and a control input coupled to the PWM circuit output for selectively coupling the output of the DSM between the first and second inputs thereof, wherein the first input is configured to be selected when the output of the PWM circuit is at a first logic level, and the second input is selected when the output of the PWM circuit is at a second logic level.

26. The method of claim 25 further comprising, utilizing the DMA control circuit, providing a prescale value to the NCO after a certain number of clock pulses have occurred, wherein an accumulator counter is coupled between the clock output of the NCO and the first input of the DSM and the input of the PWM circuit.

27. The method of claim 25, wherein the duty cycle of the PWM circuit is used to provide the first logic level output during the first number of clock pulses, to provide the second logic level output during the second number of clock pulses, and to provide the first logic level output during the third number of clock pulses.

28. The method of claim 25, wherein the first logic level is a logic zero and the second logic level is a logic one.

29. The method of claim 25, wherein the first logic level is a logic one and the second logic level is a logic zero.

30. The method of claim 25, wherein the output of the DSM is configured to switch between its first and second inputs on an edge of a control signal to the control input of the DSM.

31. The method according to any one of claims 19 to 20, further comprising: providing a pulse width modulation (PWM) circuit having an input coupled to the clock output of the NCO; as well as A data signal modulator DSM is provided, having a first input connected to the clock output of the NCO, a second input connected to a fixed logic level, an output connected to a DMA trigger input of the DMA control circuit, and a control input for selectively connecting the output of the DSM between its first input and the second input.

32. The method of claim 31 further comprising: providing an accumulator counter coupled between the clock output of the NCO and the first input of the DSM and the input of the PWM circuit; as well as A single prescale value is provided to the NCO after a certain number of clock pulses have occurred.

33. The method of claim 31 further comprising inhibiting operation of the NCO after receiving a certain maximum number of clock pulses from the NCO using a maximum counter coupled to the clock output of the NCO.

34. The method of claim 31 , further comprising programming a duty cycle of the PWM circuit to provide: a first logic level output during said first number of clock pulses; a second logic level output during said second number of clock pulses; and The first logic level is output during the third number of clock pulses.

35. The method of claim 31 further comprising switching an output of the DSM between the first input and the second input thereof on an edge of a control signal to the control input of the DSM.