A driving device and motor system for controlling a stepping motor
By introducing a communication interface module, a stepper motor control module and a sine/cosine wave control module into the stepper motor drive device, corresponding sine/cosine wave signals and PWM signals are generated, and processor resource occupation problems caused by frequent sending of instructions in the prior art are solved, automatic acceleration and deceleration and precise control are realized, and the operation efficiency of the motor system is improved.
Patent Information
- Application Number
- CN202411841245.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-04-04
AI Technical Summary
In the prior art, when controlling stepper motors, it is necessary to frequently send commands to control the speed and direction of the motor, resulting in the processor occupying a large amount of resources and affecting the operation of the motor system.
It provides a driving device for controlling a stepper motor, including a communication interface module, a stepper motor control module, a sine/cosine wave control module, a PWM chopping output control module, a PWM control module, a driving module, a clock generator module and a protection module. The stepper motor control module and a sine/cosine wave control module are set through the I2C/SPI communication interface to generate corresponding sine/cosine wave signals and PWM signals to realize automatic acceleration and deceleration and precise control.
By reducing dependence on the processor, the risk of processor occupancy of resources is reduced, the operating efficiency of the motor system is improved, automatic acceleration and deceleration and precise control are achieved, and noise is reduced.
Smart Images

Figure CN119766009A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of motor driving, and in particular to a driving device and a motor system for controlling a stepping motor. Background Art
[0002] A stepper motor is an electric motor that converts electrical pulse signals into corresponding angular displacement or linear displacement. It is also called a pulse motor. Due to its high reliability, stepper motors have been widely used in various industries. The speed of the stepper motor needs to be adjusted accordingly for different scenarios. Therefore, the stepper motor needs to be driven to rotate according to the speed to achieve precise control.
[0003] At present, a Darlington tube is usually set between the processor and the motor, which cannot be controlled automatically and requires frequent instructions to control the speed and direction of the motor; or a cache mode is set, but the speed change cannot be strictly set. During the speed change process, the time needs to be strictly calculated to reduce the pause during the speed change, which will cause the processor to occupy a large amount of resources and affect the operation effect of the motor system. Summary of the invention
[0004] In order to solve the above problems, the present invention provides the following technical solutions:
[0005] The present invention provides a driving device for controlling a stepper motor, comprising a communication interface module, a stepper motor control module, a sine / cosine wave control module, a PWM chopping output control module, a PWM control module, a driving module, a clock generator module and a protection module, wherein the communication interface module, the stepper motor control module, the sine / cosine wave control module, the PWM chopping output control module, the PWM control module and the driving module are connected in sequence, the communication interface module, the stepper motor control module, the sine / cosine wave control module, the PWM chopping output control module and the PWM control module are all connected to the clock generator module, the PWM chopping output control module is also connected to the communication interface module, and the protection module is also connected to the driving module;
[0006] The communication interface module is used to receive the parameter setting values required for the operation of the stepper motor set by the user through an external controller and to read the internal state of the motor, and to send the parameter setting values and the internal state of the motor to the stepper motor control module; the communication interface module is an I2C / SPI communication interface.
[0007] The stepper motor control module is used to cache the parameters received by the communication interface module and generate corresponding control signals to control the sine / cosine wave control module;
[0008] The sine / cosine wave control module generates a sine / cosine wave signal by searching the sine / cosine wave signal value stored inside the control signal generated by the stepper motor control module;
[0009] A PWM chopping output control module is used to generate a PWM signal and determine the pulse width of the PWM signal according to the sine / cosine wave signal generated by the sine / cosine wave control module;
[0010] PWM control module, used to switch the connection mode of the motor;
[0011] A driving module is used to improve the transmission speed and stability of the output PWM signal;
[0012] The clock generator module provides clocks for the communication interface module, the stepper motor control module, the sine / cosine wave control module, the PWM chopping output control module and the PWM control module;
[0013] The protection module is used to control the opening and closing of the drive module.
[0014] Furthermore, the parameters include the control mode, output voltage, rotation frequency, and forward and reverse rotation of the stepper motor; the internal state of the motor includes the number of steps, cache state, and motor rotation state of the stepper motor.
[0015] Further, the stepper motor control module includes a mode cache and control unit, a direction cache and control unit, an amplitude cache and control unit, a frequency cache and control unit, an enable cache and control unit, an angle cache and control unit, an angle counter, a state machine and a control signal output unit, the mode cache and control unit, the direction cache and control unit, the amplitude cache and control unit, the frequency cache and control unit, the enable cache and control unit are connected to the state machine, the angle cache and control unit is connected to the state machine through the angle counter, and the state machine is connected to the control signal output unit;
[0016] The mode cache and control unit, the direction cache and control unit, the amplitude cache and control unit, the frequency cache and control unit, the angle cache and control unit, and the enable cache and control unit control the state machine to generate sinusoidal wave control signals of different resolutions, forward and reverse control signals, sinusoidal wave coefficient control signals of different amplitudes, rotation frequency control signals, step control signals, and enable signals to control the sine / cosine wave control module.
[0017] Specifically, different increments of the sine / cosine counter are used to generate sine wave control signals with different resolutions; the control modes include full step, half step, and subdivision;
[0018] Generate sine wave coefficient control signals with different amplitudes through voltage parameters;
[0019] A rotation frequency control signal is generated by controlling the counting time of the sine / cosine counter;
[0020] Generate forward and reverse control signals by adding or subtracting sine / cosine counters;
[0021] The step control signal is generated by controlling the number of counting cycles of the sine / cosine counter; specifically, the angle of rotation is achieved by controlling the number of sine waves;
[0022] The enable signal makes the sine wave control module work.
[0023] Furthermore, the sine / cosine wave control module includes a counter, a sine / cosine counter-sine / cosine signal value table and a sine / cosine signal output unit. The sine / cosine counter counts according to the frequency and direction generated by the stepper motor control module (the frequency affects the speed of counting, and the direction affects whether the count is increased or decreased), and then outputs the corresponding sine wave or cosine wave value by looking up the counter-sine / cosine signal value table according to the value of the sine / cosine counter. Finally, the sine / cosine signal output unit generates a sine / cosine wave signal according to the value of the sine wave or cosine wave.
[0024] Furthermore, the PWM chopping output control module includes a PWM counter, which generates a frequency-adjustable signal, performs pulse width modulation on the sine / cosine signal, and outputs a PWM signal with corresponding frequency and duty cycle changes.
[0025] Furthermore, the PWM control module includes a logic control unit, which converts the PWM signal generated by the PWM chopping output control module into a signal suitable for motor connection through a logic signal generated by the logic control unit.
[0026] Furthermore, the driving module includes a pre-driving circuit and an H-bridge circuit, wherein the pre-driving circuit is connected to the H-bridge circuit to convert the logic signal into a signal with driving capability and eliminate reflection on the output port of the PWM control module.
[0027] Furthermore, the protection module includes a temperature detection circuit and a voltage detection circuit. When the temperature detection circuit detects that the temperature reaches a preset temperature, it outputs an over-temperature protection signal; when the voltage detection circuit detects that the power supply voltage is lower than a preset voltage, it outputs an under-voltage protection signal; when the protection signal is generated, the control drive module is turned off.
[0028] Further, the motor connection methods include 2-phase 4-wire and 4-phase 5-wire motors;
[0029] When the motor is connected in a 2-wire or 4-wire motor mode, the output is a PWM signal after the complete sine wave is chopped;
[0030] When the motor is connected as a 4-phase 5-wire motor, the output is a PWM signal after half sine wave chopped. Because the 2-phase 4-wire motor has positive and negative current directions, two control signals are required, while the 4-phase 5-wire motor has only one current direction, so the two control signals need to be combined into one control signal.
[0031] Furthermore, the working process of the driving device controlling the stepping motor to realize automatic acceleration and deceleration is as follows:
[0032] (1) Setting the rotation frequency: Set the rotation frequencies A, B, C, D and E for the first five times, and respectively operate the rotation frequencies A, B, C, D and E in the acceleration, constant speed and deceleration states; the rotation frequency of the motor = UPDW_Cycle*Cycle; wherein UPDW_Cycle refers to the rotation frequency base in the acceleration and deceleration mode (which can be understood as fine adjustment), and Cycle refers to the rotation frequency coefficient in the acceleration and deceleration mode (which can be understood as coarse adjustment);
[0033] When setting the rotation frequency A, set the enable signal EN in the stepper motor control module high; when setting the frequency BE, set the enable EN low;
[0034] (2) Setting the rotation angle F: Setting the rotation angle F in the acceleration / deceleration rotation state;
[0035] (3) Setting the rotation angle G: In the uniform rotation state, the rotation angle G is set, and the rotation direction RT is set at the same time when setting G;
[0036] (4) Setting UPDW_STOP: Setting UPDW_STOP is used to force shutdown. When it is set in the uniform speed state, it will enter the deceleration mode. When it is set in the acceleration state, it will skip the uniform speed state and directly enter the deceleration mode. Setting it in the deceleration state is invalid, and UPDW_STOP is used to force the deceleration state.
[0037] The present invention also provides a motor system, comprising the above-mentioned driving device, wherein the driving device is connected to a host computer and a stepping motor respectively.
[0038] The present invention has the following beneficial effects:
[0039] (1) The present invention sets the stepper motor control module and the sine / cosine wave control module through the I2C / SPI communication interface to generate sine / cosine wave signals of corresponding frequency and amplitude, generates PWM pulse waveforms through a fixed frequency pulse width control method, and then controls the motor to rotate according to the set direction and frequency through PWM, which changes the prior art of controlling the speed of the motor by frequently sending instructions, solves the problem that the processor occupies a large amount of resources due to frequent sending of instructions and affects the operation of the motor system, and provides a new idea for motor control.
[0040] (2) The communication interface module of the present invention is compatible with SPI and I2C interfaces and can be applied to more systems.
[0041] (3) The present invention can control the stepper motor to achieve automatic acceleration and deceleration, and there is no jamming during the speed change operation, thereby reducing noise.
[0042] (4) The present invention can control the rotation current, rotation speed, rotation direction and rotation mode through a stepper motor control module.
[0043] (5) The present invention adapts a 2-phase 4-wire motor or a 4-phase 5-wire motor by generating a PWM signal adapted to a 2-phase 4-wire motor or a 4-phase 5-wire motor. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 This is a schematic diagram of module connection in Example 1.
[0045] Figure 2 It is a block diagram of the stepper motor control module in Example 1.
[0046] Figure 3 It is a block diagram of the sine / cosine wave control module in Example 1.
[0047] Figure 4 It is a block diagram of the driving module in Example 1.
[0048] Figure 5 This is the normal working process in Example 2, and a schematic diagram of the working state of the stepper motor when UPDW_Stop is not set.
[0049] Figure 6 This is a schematic diagram of sine / cosine signals of the stepper motor in normal operation when UPDW_Stop is not set in Example 2.
[0050] Figure 7 It is a schematic diagram of the working state of the stepper motor when UPDW_Stop is set under uniform rotation in Example 2.
[0051] Figure 8 It is a schematic diagram of the working state of the stepper motor when UPDW_Stop is set under accelerated rotation in Example 2. DETAILED DESCRIPTION
[0052] The specific implementation methods of the present invention are described in detail below in conjunction with the accompanying drawings. It should be pointed out that the embodiments are only specific explanations of the invention and should not be regarded as limitations of the invention. The purpose of the embodiments is to enable those skilled in the art to better understand and reproduce the technical solutions of the present invention. The protection scope of the present invention shall still be based on the scope defined by the claims.
[0053] Example 1
[0054] like Figure 1 As shown, this embodiment provides a controlled driving device, including a communication interface module, a stepper motor control module, a sine / cosine wave control module, a PWM chopping output control module, a PWM control module, a driving module, a clock generator module and a protection module, wherein the communication interface module, the stepper motor control module, the sine / cosine wave control module, the PWM chopping output control module, the PWM control module and the driving module are connected in sequence, the communication interface module, the stepper motor control module, the sine / cosine wave control module, the PWM chopping output control module and the PWM control module are all connected to the clock generator module, the PWM chopping output control module is also connected to the communication interface module, and the protection module is also connected to the driving module;
[0055] The communication interface module is used to receive the parameter setting values required for the operation of the stepper motor set by the user through the external controller and read the internal state of the motor, and send the parameter setting values and the internal state of the motor to the stepper motor control module; the communication interface module is an I2C / SPI communication interface. The parameters include the control mode, output voltage, rotation frequency, and forward and reverse rotation of the stepper motor; the internal state of the motor includes the number of steps of the stepper motor, the cache state, and the motor rotation state.
[0056] like Figure 2 As shown, the stepper motor control module is used to cache the parameters received by the communication interface module and generate corresponding control signals to control the sine / cosine wave control module; specifically, the stepper motor control module includes a mode cache and control unit, a direction cache and control unit, an amplitude cache and control unit, a frequency cache and control unit, an enable cache and control unit, an angle cache and control unit, an angle counter, a state machine and a control signal output unit, the mode cache and control unit, the direction cache and control unit, the amplitude cache and control unit, the frequency cache and control unit, the enable cache and control unit are connected to the state machine, the angle cache and control unit is connected to the state machine through the angle counter, and the state machine is connected to the control signal output unit;
[0057] The mode cache and control unit, direction cache and control unit, amplitude cache and control unit, frequency cache and control unit, angle cache and control unit, enable cache and control unit control state machines to generate sine wave control signals of different resolutions, forward and reverse control signals, sine wave coefficient control signals of different amplitudes, rotation frequency control signals, step control signals and enable signals to control the sine / cosine wave control module. The enable signal enables the sine wave control module to work. Specifically, sine wave control signals of different resolutions are generated by different increments of the sine / cosine counter; control modes include full step, half step, and subdivision;
[0058] Generate sine wave coefficient control signals with different amplitudes through voltage parameters;
[0059] A rotation frequency control signal is generated by controlling the counting time of the sine / cosine counter;
[0060] Generate forward and reverse control signals by adding or subtracting sine / cosine counters;
[0061] The step control signal is generated by controlling the number of counting cycles of the sine / cosine counter; specifically, the angle of rotation is achieved by controlling the number of sine waves;
[0062] like Figure 3 As shown, the sine / cosine wave control module generates a sine / cosine wave signal by searching the sine / cosine wave signal value stored in the internal control signal generated by the stepper motor control module; specifically, the sine / cosine wave control module includes a counter, a sine / cosine counter-sine / cosine signal value table and a sine / cosine signal output unit. The sine / cosine counter counts according to the frequency and direction generated by the stepper motor control module (the frequency affects the speed of counting, and the direction affects whether the counting is increased or decreased), and then outputs the corresponding sine wave or cosine wave value by searching the counter-sine / cosine signal value table according to the value of the sine / cosine counter. Finally, the sine / cosine signal output unit generates a sine / cosine wave signal according to the value of the sine wave or cosine wave. Among them, the sine / cosine counter-sine / cosine signal value table is pre-saved, which refers to the state change table of the sine / cosine counter after each clock cycle. This table shows how the internal state (i.e., the output value of the counter) of the sine / cosine counter changes after receiving the clock signal.
[0063] The PWM chopping output control module is used to generate a PWM signal and determine the pulse width of the PWM signal according to the sine / cosine wave signal generated by the sine / cosine wave control module; specifically, the PWM chopping output control module includes a PWM counter, which generates a frequency-adjustable signal through the PWM counter, performs pulse width modulation on the sine / cosine signal through the signal, and outputs a PWM signal with corresponding frequency and duty cycle changes.
[0064] The PWM control module is used to switch the connection mode of the motor; specifically, the PWM control module includes a logic control unit, which converts the PWM signal generated by the PWM chopping output control module into a signal suitable for the motor connection through the logic signal generated by the logic control unit. The connection modes of the motor include 2-phase 4-wire and 4-phase 5-wire motors;
[0065] When the motor is connected in a 2-wire or 4-wire motor mode, the output is a PWM signal after the complete sine wave is chopped;
[0066] When the motor is connected as a 4-phase 5-wire motor, the output is a PWM signal after half sine wave chopped. Because the 2-phase 4-wire motor has positive and negative current directions, two control signals are required, while the 4-phase 5-wire motor has only one current direction, so the two control signals need to be combined into one control signal.
[0067] like Figure 4 As shown, the driving module is used to improve the transmission speed and stability of the output PWM signal; the driving module includes a pre-driving circuit and an H-bridge circuit, and the pre-driving circuit is connected to the H-bridge circuit to convert the logic signal into a signal with driving capability. Among them, the pre-driving circuit is an intermediate circuit used to amplify the signal of the control circuit (that is, to amplify the signal of the control circuit so that it can drive the power transistor), and the H-bridge circuit is a typical DC motor control circuit. It consists of 4 MOS tubes forming 4 vertical legs of H, and the motor is the horizontal bar in H. The working principle of the H-bridge circuit is to realize the forward rotation, reverse rotation and stop of the motor by controlling the conduction and shutdown of the switching devices on the diagonal. Specifically, when a pair of switching devices on the diagonal is turned on, the current flows from the positive pole of the power supply through one of the switching devices into the motor, and then flows out from the other switching device and returns to the negative pole of the power supply, thereby driving the motor to rotate. By changing the pair of switching devices that are turned on, the direction of the current can be changed, and then the rotation direction of the motor can be changed. If the switching devices on the non-diagonal lines are not turned on, the motor stops rotating.
[0068] The clock generator module provides clocks for the communication interface module, the stepper motor control module, the sine / cosine wave control module, the PWM chopping output control module, and the PWM control module; wherein the clock generator module uses a clock generating circuit in the prior art, and the clock circuit is an oscillation circuit that produces accurate movement like a clock, and is composed of a crystal oscillator, a crystal oscillation control chip, and a capacitor.
[0069] The protection module is used to control the opening and closing of the driving module. Specifically, the protection module includes a temperature detection circuit and a voltage detection circuit. When the temperature detection circuit detects that the temperature reaches the preset temperature, it outputs an over-temperature protection signal; when the voltage detection circuit detects that the power supply voltage is lower than the preset voltage, it outputs an under-voltage protection signal; when the protection signal is generated, the control driving module is turned off. Among them, the temperature detection circuit is an electronic circuit used to monitor temperature changes, and accurate temperature measurement is achieved through different sensors and components. The voltage detection circuit determines the working state or fault condition of the circuit based on the changes in the working voltage at each point in the circuit.
[0070] The present invention sets the stepper motor control module and the sine / cosine wave control module through the I2C / SPI communication interface to generate sine / cosine wave signals of corresponding frequency and amplitude, generates PWM pulse waveforms through a fixed frequency pulse width control method, and then controls the motor to rotate according to the set direction and frequency through PWM, thereby changing the prior art of controlling the speed of the motor by frequently sending instructions, solving the problem that the processor occupies a large amount of resources and affects the operation of the motor system due to frequent sending of instructions, and providing a new idea for motor control.
[0071] Example 2
[0072] This embodiment provides a workflow for controlling a stepper motor to achieve automatic acceleration and deceleration, specifically:
[0073] (1) Setting the rotation frequency: Set the rotation frequencies A, B, C, D and E for the first five times, and respectively operate the rotation frequencies A, B, C, D and E in the acceleration, constant speed and deceleration states; the rotation frequency of the motor = UPDW_Cycle*Cycle; wherein, UPDW_Cycle refers to the rotation frequency base in the acceleration and deceleration mode (which can be understood as fine adjustment), and Cycle refers to the rotation frequency coefficient in the acceleration and deceleration mode (which can be understood as coarse adjustment); the rotation frequencies AE can be set to the same value, which will greatly increase the rotation angle, thereby reducing the command sending and calculation of the external controller.
[0074] When setting the rotation frequency A, set the enable signal EN in the stepper motor control module high; when setting the frequency BE, set the enable EN low;
[0075] (2) Setting the rotation angle F: Setting the rotation angle F in the acceleration / deceleration rotation state;
[0076] (3) Setting the rotation angle G: Set the rotation angle G in the uniform rotation state. When setting G, set the rotation direction RT at the same time, such as Figure 5 As shown;
[0077] like Figure 6 As shown in the figure, the schematic diagram of the sine / cosine signal of the stepper motor in normal operation when UPDW_Stop is not set, and the rotation angle F of the stepper motor at the rotation frequency A in the acceleration state;
[0078] In the acceleration state, the stepper motor rotates at an angle F at a rotation frequency B;
[0079] In the acceleration state, the stepper motor rotates at an angle F at a rotation frequency C;
[0080] In the acceleration state, the stepper motor rotates at an angle F at a rotation frequency D;
[0081] Under uniform speed, the stepper motor rotates at an angle G at a rotation frequency E;
[0082] In the deceleration state, the stepper motor rotates at an angle F at a rotation frequency D;
[0083] In the deceleration state, the stepper motor rotates at an angle F at a rotation frequency C;
[0084] In the deceleration state, the stepper motor rotates at an angle F at a rotation frequency B;
[0085] In the deceleration state, the stepper motor rotates at an angle F at a rotation frequency A;
[0086] (4) Setting UPDW_STOP: Setting UPDW_STOP is used to force shutdown; when set in a uniform speed state, it will enter the deceleration mode, such as Figure 7 As shown; when set in the acceleration state, it will skip the uniform speed state and directly enter the deceleration mode, such as Figure 8 As shown in the figure; the setting is invalid in the deceleration state, where UPDW_STOP is used to force the deceleration state.
[0087] Example 3
[0088] This embodiment provides a motor system, including the above-mentioned driving device, wherein the driving device is connected to a host computer and a stepping motor respectively.
[0089] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
[0090] It should be noted that the technical features not described in detail in the present invention can be implemented by any existing technology.
Claims
1. A driving device for controlling a stepping motor, characterized in that: It includes a communication interface module, a stepper motor control module, a sine / cosine wave control module, a PWM chopping output control module, a PWM control module, a driving module, a clock generator module and a protection module, wherein the communication interface module, the stepper motor control module, the sine / cosine wave control module, the PWM chopping output control module, the PWM control module and the driving module are connected in sequence, the communication interface module, the stepper motor control module, the sine / cosine wave control module, the PWM chopping output control module and the PWM control module are all connected to the clock generator module, the PWM chopping output control module is also connected to the communication interface module, and the protection module is connected to the driving module; The communication interface module is used to receive parameter setting values required for the operation of the stepper motor set by the user through an external controller and read the internal state of the motor, and send the parameter setting values and the internal state of the motor to the stepper motor control module; The stepper motor control module is used to cache the parameters received by the communication interface module and generate corresponding control signals to control the sine / cosine wave control module; The sine / cosine wave control module generates a sine / cosine wave signal by searching the sine / cosine wave signal value stored inside the control signal generated by the stepper motor control module; A PWM chopping output control module is used to generate a PWM signal and determine the pulse width of the PWM signal according to the sine / cosine wave signal generated by the sine / cosine wave control module; PWM control module, used to switch the connection mode of the motor; A driving module is used to improve the transmission speed and stability of the output PWM signal; The clock generator module provides clocks for the communication interface module, the stepper motor control module, the sine / cosine wave control module, the PWM chopping output control module and the PWM control module; The protection module is used to control the opening and closing of the drive module.
2. A driving device for controlling a stepping motor according to claim 1, characterized in that: The parameters include the control mode, output voltage, rotation frequency, and forward and reverse rotation of the stepper motor; the internal state of the motor includes the number of steps of the stepper motor, the cache state, and the motor rotation state.
3. A driving device for controlling a stepping motor according to claim 2, characterized in that: The stepper motor control module includes a mode cache and control unit, a direction cache and control unit, an amplitude cache and control unit, a frequency cache and control unit, an enable cache and control unit, an angle cache and control unit, an angle counter, a state machine and a control signal output unit, wherein the mode cache and control unit, the direction cache and control unit, the amplitude cache and control unit, the frequency cache and control unit, and the enable cache and control unit are connected to the state machine, the angle cache and control unit is connected to the state machine via the angle counter, and the state machine is connected to the control signal output unit; The mode cache and control unit, the direction cache and control unit, the amplitude cache and control unit, the frequency cache and control unit, the angle cache and control unit, and the enable cache and control unit control the state machine to generate sinusoidal wave control signals of different resolutions, forward and reverse control signals, sinusoidal wave coefficient control signals of different amplitudes, rotation frequency control signals, step control signals, and enable signals to control the sine / cosine wave control module.
4. A driving device for controlling a stepping motor according to claim 2, characterized in that: The sine / cosine wave control module includes a counter, a sine / cosine counter-sine / cosine signal value table and a sine / cosine signal output unit. The sine / cosine counter counts according to the frequency and direction generated by the stepper motor control module, and then outputs the corresponding sine wave or cosine wave value by looking up the counter-sine / cosine signal value table according to the value of the sine / cosine counter. Finally, the sine / cosine signal output unit generates a sine / cosine wave signal according to the value of the sine wave or cosine wave.
5. A driving device for controlling a stepping motor according to claim 2, characterized in that: The PWM chopping output control module includes a PWM counter, which generates a frequency-adjustable signal, performs pulse width modulation on the sine / cosine signal, and outputs a PWM signal with corresponding frequency and duty cycle changes.
6. A driving device for controlling a stepping motor according to claim 2, characterized in that: The PWM control module includes a logic control unit, which converts the PWM signal generated by the PWM chopping output control module into a signal suitable for motor connection through a logic signal generated by the logic control unit.
7. A driving device for controlling a stepping motor according to claim 6, characterized in that: The driving module includes a pre-driving circuit and an H-bridge circuit. The pre-driving circuit is connected to the H-bridge circuit to convert a logic signal into a signal with driving capability.
8. A driving device for controlling a stepping motor according to claim 2, characterized in that: The protection module includes a temperature detection circuit and a voltage detection circuit. When the temperature detection circuit detects that the temperature reaches a preset temperature, it outputs an over-temperature protection signal; when the voltage detection circuit detects that the power supply voltage is lower than a preset voltage, it outputs an under-voltage protection signal; when the protection signal is generated, the control drive module is turned off.
9. A driving device for controlling a stepping motor according to claim 1 or 6, characterized in that: The motor connection methods include 2-phase 4-wire and 4-phase 5-wire motors; When the motor is connected in a 2-wire or 4-wire motor mode, the output is a PWM signal after the complete sine wave is chopped; When the motor is connected as a 4-phase 5-wire motor, a PWM signal is output after half sine wave chopped.
10. The driving device for controlling a stepping motor according to claim 1, characterized in that: The working process of the driving device controlling the stepping motor to realize automatic acceleration and deceleration is as follows: (1) Setting the rotation frequency: Set the rotation frequencies A, B, C, D and E for the first five times, and respectively operate the rotation frequencies A, B, C, D and E in the acceleration, constant speed and deceleration states; the motor rotation frequency = UPDW_Cycle*Cycle; UPDW_Cycle refers to the rotation frequency base in the acceleration and deceleration mode, and Cycle refers to the rotation frequency coefficient in the acceleration and deceleration mode; When setting the rotation frequency A, set the enable signal EN in the stepper motor control module high; when setting the frequency BE, set the enable EN low; (2) Setting the rotation angle F: Setting the rotation angle F in the acceleration / deceleration rotation state; (3) Setting the rotation angle G: In the uniform rotation state, the rotation angle G is set, and the rotation direction RT is set at the same time when setting G; (4) Setting UPDW_STOP: Setting UPDW_STOP is used to force shutdown. When it is set in the uniform speed state, it will enter the deceleration mode. When it is set in the acceleration state, it will skip the uniform speed state and directly enter the deceleration mode. Setting it in the deceleration state is invalid, and UPDW_STOP is used to force the deceleration state.
11. A motor system, characterized in that: It comprises the driving device described in any one of claims 1 to 10, and the driving device is connected to the host computer and the stepping motor respectively.