CN110829911B - Driving method and driving equipment for stepping motor - Google Patents
Driving method and driving equipment for stepping motor Download PDFInfo
- Publication number
- CN110829911B CN110829911B CN201810901564.0A CN201810901564A CN110829911B CN 110829911 B CN110829911 B CN 110829911B CN 201810901564 A CN201810901564 A CN 201810901564A CN 110829911 B CN110829911 B CN 110829911B
- Authority
- CN
- China
- Prior art keywords
- stepping motor
- current value
- state
- configuration parameters
- current
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 35
- 238000004891 communication Methods 0.000 claims description 25
- 238000004590 computer program Methods 0.000 claims description 14
- 230000002035 prolonged effect Effects 0.000 abstract description 4
- 238000010438 heat treatment Methods 0.000 abstract description 3
- 238000010586 diagram Methods 0.000 description 12
- 230000008859 change Effects 0.000 description 11
- 230000006870 function Effects 0.000 description 5
- 238000012986 modification Methods 0.000 description 5
- 230000004048 modification Effects 0.000 description 5
- 238000012545 processing Methods 0.000 description 5
- 230000008569 process Effects 0.000 description 4
- 230000009286 beneficial effect Effects 0.000 description 3
- 238000006073 displacement reaction Methods 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 230000011664 signaling Effects 0.000 description 2
- 238000010146 3D printing Methods 0.000 description 1
- 230000001133 acceleration Effects 0.000 description 1
- 230000009471 action Effects 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000011022 operating instruction Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000012805 post-processing Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H02—GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
- H02P—CONTROL OR REGULATION OF ELECTRIC MOTORS, ELECTRIC GENERATORS OR DYNAMO-ELECTRIC CONVERTERS; CONTROLLING TRANSFORMERS, REACTORS OR CHOKE COILS
- H02P8/00—Arrangements for controlling dynamo-electric motors rotating step by step
- H02P8/12—Control or stabilisation of current
Landscapes
- Engineering & Computer Science (AREA)
- Power Engineering (AREA)
- Control Of Stepping Motors (AREA)
Abstract
The application discloses a stepping motor driving method and driving equipment. After preset configuration parameters, control instructions and enabling signals are obtained, the configuration parameters are current values corresponding to different working states of the stepping motor, and the control instructions are used for controlling the current working state of the stepping motor; acquiring a current value of the stepping motor in the current working state based on the current working state, the configuration parameters and the enabling signal of the stepping motor controlled by the control instruction; and setting the acquired current value as the current of the stepping motor. Therefore, different driving currents can be set according to the current working state of the stepping motor, so that the heating phenomena of the driving device and the stepping motor caused by the fact that the stepping motor is in a locking state in the prior art are avoided, and the service lives of the driving device and the stepping motor are prolonged.
Description
Technical Field
The present application relates to the field of motor technologies, and in particular, to a method and an apparatus for driving a stepping motor.
Background
A stepper motor is an open-loop control element that converts electrical pulse signals into angular or linear displacements. Under normal conditions, the rotation speed and the stop position of the motor only depend on the frequency and the pulse number of the pulse signal and are not influenced by load change. With the popularization of the application of the stepping motor in computer peripherals, the stepping motor is widely applied to industries such as numerical control machines, automation equipment, instruments and meters, and the like, such as 3D printing, printers, automobile post-processing systems and the like.
The stepping motor driving apparatus can change the operation state of the stepping motor under the control of the enable signal and the pulse signal, the operation state including an operation state, a stop state and a lock state. The running state is the state of the stepping motor in normal work; the locking state is the state of the stepping motor when not working, and under the state, the stepping motor driving equipment does not provide pulse signals but provides driving current for locking the current position of the rotation of the stepping motor; the stop state is a state in which the stepping motor is not operated, and the stepping motor driving device does not supply the pulse signal and the driving current. When the stepping motor is in a running state and a locking state, an enabling signal received by the stepping motor driver is an effective signal, such as a high level; when the stepping motor is in a stop state, the enable signal received by the stepping motor driving device is an invalid signal, such as a low level.
However, the stepping motor driving device in the market at present can only preset the magnitude of the driving current, and cannot change the magnitude of the driving current in real time in the operation process of driving the stepping motor by the stepping motor driving device, so that when the stepping motor is in a locked state, the stepping motor driving device still provides the originally set driving current, the stepping motor and the stepping motor driving device continuously generate heat, and the service lives of the stepping motor and the stepping motor driving device are shortened.
Disclosure of Invention
The application provides a stepping motor driving method and driving equipment, which are used for solving the problem that the service life of a stepping motor and a stepping motor driver in the prior art is short.
In a first aspect, there is provided a stepping motor driving method, which may include:
acquiring preset configuration parameters, control instructions and enabling signals, wherein the configuration parameters are current values corresponding to different working states of the stepping motor, the control instructions are used for controlling the current working state of the stepping motor, and the enabling signals are signals for enabling the stepping motor to work;
acquiring a current value of the stepping motor in the current working state based on the current working state, configuration parameters and an enabling signal of the stepping motor controlled by the control instruction, wherein the enabling signal is a signal for allowing the stepping motor to work;
and setting the acquired current value as the current of the stepping motor.
In an alternative implementation, the control instructions include lock instructions;
obtaining the current value of the stepping motor in the current working state based on the current working state, the configuration parameters and the enabling signal of the stepping motor controlled by the control instruction, wherein the current value comprises the following steps:
when the working state of the stepping motor controlled by the locking instruction is a locking state, searching a target current value corresponding to the locking state in the configuration parameters;
and acquiring the current value of the stepping motor in the locking state based on a target current value and the enabling signal.
In an optional implementation, obtaining the current value of the stepping motor in the locked state based on the target current value and the enable signal includes:
and when the enable signal is at an effective level, taking the target current value as the current value of the stepping motor in the locking state.
In an optional implementation, when the control instruction includes an operation instruction, acquiring a current value of the stepping motor in a current operating state based on the current operating state of the stepping motor controlled by the control instruction, the configuration parameter, and the enable signal, includes:
when the current working state of the stepping motor is controlled to be the running state by the running instruction, searching a target current value corresponding to the running state in the configuration parameters;
and acquiring the current value of the stepping motor in the running state based on the target current value and the enabling signal.
In an optional implementation, the method further comprises:
acquiring a pulse signal, wherein the pulse signal is used for controlling the current working state of the stepping motor;
determining the current working state of the stepping motor to be an operating state based on the enable signal and the pulse signal;
searching a target current value corresponding to the running state in the configuration parameters;
determining a target current value as a current value of the stepping motor in the operating state.
In an optional implementation, after obtaining the preset configuration parameters and the control instruction, the method further includes: the configuration parameters are stored.
In a second aspect, there is provided a stepping motor driving apparatus, which may include:
the apparatus comprises: the device comprises a communication interface, an MCU controller, a signal interface, a stepping motor driving device and a driving interface;
the communication interface is used for acquiring preset configuration parameters and control instructions and sending the configuration parameters and the control instructions to the MCU controller, wherein the configuration parameters are current values corresponding to different working states of the stepping motor, and the control instructions are used for controlling the current working state of the stepping motor;
the signal interface is used for acquiring an enabling signal and sending the enabling signal to the MCU controller and the stepping motor driving device, wherein the enabling signal is a signal for enabling the stepping motor to work, and the enabling signal is a signal for allowing the stepping motor to work;
the MCU controller is used for outputting a pulse signal to the stepping motor driving device based on a control instruction, and the pulse signal is used for controlling the current working state of the stepping motor; acquiring a current value of the stepping motor in the current working state based on the current working state of the stepping motor, the configuration parameters and the enabling signal;
and the stepping motor driving device is used for acquiring the current value acquired by the MCU controller through a driving interface and setting the current value as the current of the stepping motor.
In an alternative implementation, the control instructions include lock instructions;
the MCU controller is specifically used for searching a target current value corresponding to the locking state in the configuration parameters when the locking instruction controls the working state of the stepping motor to be the locking state;
and acquiring the current value of the stepping motor in the locking state based on the target current value and the enabling signal.
In an optional implementation, the MCU controller is further specifically configured to determine the target current value as a current value of the stepping motor in the locked state when the enable signal is at an active level.
In an optional implementation, when the control instruction includes an operation instruction, the MCU controller is specifically configured to search for a target current value corresponding to the operation state in the configuration parameter when the current working state of the stepping motor controlled by the operation instruction is the operation state;
and acquiring the current value of the stepping motor in the running state based on the target current value and the enabling signal.
In an optional implementation, the signal interface is further configured to acquire a pulse signal and send the pulse signal to the stepping motor driving device;
the MCU controller is also used for searching a target current value corresponding to the running state in the configuration parameters based on the enabling signal when the current working state of the stepping motor is detected to be the running state;
determining the target current value as a current value of the stepping motor in the operating state.
In an optional implementation, the MCU controller is further configured to store the configuration parameters.
In a third aspect, an application server is provided, which includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
a processor adapted to perform the method steps of any of the above first aspects when executing a program stored in the memory.
In a fourth aspect, a computer-readable storage medium is provided, having stored therein a computer program which, when executed by a processor, performs the method steps of any of the above first aspects.
After preset configuration parameters, control instructions and enabling signals are obtained, the configuration parameters are current values corresponding to different working states of the stepping motor, and the control instructions are used for controlling the current working state of the stepping motor; acquiring a current value of the stepping motor in the current working state based on the current working state, the configuration parameters and the enabling signal of the stepping motor controlled by the control instruction; and setting the acquired current value as the current of the stepping motor. Therefore, different driving currents can be set according to the current working state of the stepping motor, so that the heating phenomena of the driving device and the stepping motor caused by the fact that the stepping motor is in a locking state in the prior art are avoided, and the service lives of the driving device and the stepping motor are prolonged.
Drawings
Fig. 1 is a schematic structural diagram of a frame of a stepping motor driving apparatus according to an embodiment of the present invention;
fig. 2 is a schematic circuit structure diagram of a stepping motor driving apparatus according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of a stepping motor driving method according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a driving device according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present application without any creative effort belong to the protection scope of the present application.
The following description is made of the operating principle of the stepping motor: the stepping motor mainly comprises a stator and a rotor, wherein the stator is hollow, the rotor is embedded into the stator, and a gap is reserved between the stator and the rotor so as to allow the rotor to rotate. The gap between the stator and the rotor becomes an air gap. The stator is provided with a plurality of magnetic poles, stator teeth are arranged on the magnetic poles, rotor teeth are arranged on the rotor, and the rotor teeth are aligned with the stator teeth when the rotor is static. When the stepping motor driver receives a pulse signal, the pulse signal is transmitted to the stepping motor, the rotor rotates according to a set rotating direction when the stepping motor receives a pulse signal, the rotor teeth move by the distance of one stator tooth under the action of a magnetic field between the rotor teeth and the stator teeth, the next stator tooth in the advancing direction is aligned at the moment, the stepping motor rotates by a step angle, and the stepping motor rotates in one step.
Therefore, the number of the pulse signals can control the angular displacement, so that the aim of accurate positioning is fulfilled; the frequency of the pulse signal can control the rotating speed and the acceleration of the stepping motor.
The stepping motor driving method provided by the present application is applied to the stepping motor driving apparatus shown in fig. 1, and the stepping motor driving apparatus may include: a communication interface 110, a Micro Controller Unit (MCU) controller 120, a signal interface 130, a stepper motor driver 140, and a drive interface 150.
Optionally, the device may also include a power interface 160. The power interface 160 is used to supply power to the entire stepping motor driving apparatus.
And a communication interface 110, configured to obtain preset configuration parameters and control instructions, and send the configuration parameters and the control instructions to the MCU controller 120.
The configuration parameters are current values corresponding to different working states of the stepping motor. Since the operating state of the stepping motor may include an operating state (e.g., a rotating state), a locking state, and a stopping state, the configuration parameters may include a current value corresponding to the operating state, a current value corresponding to the locking state, and a current value corresponding to the stopping state.
The control instruction is used for controlling the current working state of the stepping motor. The control commands may include a run command, a lock command, and a stop command based on different operating states of the stepper motor. The running instruction is used for controlling the current working state of the stepping motor to be a running state; the locking instruction is used for controlling the current working state of the stepping motor to be a locking state; the stop command is used for controlling the current working state of the stepping motor to be a stop state.
It should be noted that the operation state can also be classified into an operation state of rotating speed change and an operation state of direction change, and in this case, the configuration parameter can also include a current value corresponding to the operation state of rotating speed change and a current value corresponding to the direction change. The stepping motor may also include other working states, and the embodiment of the present invention is not described herein.
And a signal interface 130 for acquiring the enable signal and transmitting the enable signal to the MCU controller 120 and the stepping motor driving device 140.
The enable signal is a signal that allows the stepper motor to operate. Presetting an enable signal with a high level as an effective signal, and controlling the working state of the stepping motor to be a running state or a locking state at the moment if the enable signal is marked as 1; the enable signal at low level is set as an invalid signal, and as noted as 0, the operation state of the stepping motor can be controlled to stop.
Optionally, the signal interface 130 is further configured to obtain a pulse signal and send the pulse signal to the stepping motor driving device 140 to control the current working state of the stepping motor.
The MCU controller 120 is configured to output a pulse signal to the stepping motor driving device 140 based on the control instruction, where the pulse signal is used to control a current working state of the stepping motor; and acquiring the current value of the stepping motor in the current working state based on the current working state, the configuration parameters and the enabling signal of the stepping motor.
That is, the MCU controller 120 may detect the enable signal and the current operating state of the stepping motor.
Specifically, the MCU controller 120 is further configured to store the configuration parameters before outputting the pulse signal to the stepping motor driving device 140 based on the control command.
Two ways for the MCU controller to obtain the current value of the stepping motor in the current working state are described below:
in a first mode, when a control instruction is received: the MCU controller 120 generates a pulse signal corresponding to the control command according to the control command, and outputs the pulse signal to the stepping motor driving device 140. After the MCU controller 120 detects the current working state of the stepping motor controlled by the pulse signal, it obtains the current value of the stepping motor in the current working state based on the current working state, the configuration parameters, and the enable signal of the stepping motor.
For example, if the control command is a lock command, the MCU controller 120 generates a pulse signal corresponding to the lock command. When the MCU controller 120 detects the enable signal as an invalid signal, it determines that the stepping motor is in a stopped state. The MCU controller 120 detects that the enable signal is an effective signal, and detects that the pulse signal controls the step motor to be in the locked state, then searches for a target current value corresponding to the locked state in the configuration parameters, and determines the target current value as the current value of the step motor in the locked state.
If the control command is an operation command, the MCU controller 120 generates a pulse signal corresponding to the operation command. When the MCU controller 120 detects the enable signal as an invalid signal, it determines that the stepping motor is in a stopped state. The MCU controller 120 detects that the enable signal is an effective signal, and detects that the pulse signal controls the running state of the stepping motor, then searches for a target current value corresponding to the running state in the configuration parameters, and determines the target current value as the current value of the stepping motor in the running state.
In the second mode, under the condition that the control instruction is not received: after the MCU controller 120 detects the current working state of the stepping motor controlled by the pulse signal received by the signal interface 130, the current value of the stepping motor in the current working state is obtained based on the current working state of the stepping motor, the configuration parameter, and the enable signal.
For example, when the MCU controller 120 detects the enable signal as an invalid signal, it determines that the stepping motor is in a stopped state. The MCU controller 120 detects that the enable signal is an effective signal, and detects that the pulse signal controls the step motor to be in the locked state, then searches for a target current value corresponding to the locked state in the configuration parameters, and determines the target current value as the current value of the step motor in the locked state.
When the MCU controller 120 detects the enable signal as an invalid signal, it determines that the stepping motor is in a stopped state. The MCU controller 120 detects that the enable signal is an effective signal, and detects that the pulse signal controls the running state of the stepping motor, then searches for a target current value corresponding to the running state in the configuration parameters, and determines the target current value as the current value of the stepping motor in the running state.
It can be seen that the MCU controller 120 can set different driving currents for different working states of the stepping motor according to the stored configuration parameters. In addition, the above two ways can be seen that the pulse signal of the signal interface 130 can directly control the operation of the stepping motor, and the pulse signal generated by the control instruction of the communication interface 110 can also control the operation of the stepping motor.
And a stepping motor driving device 140 for receiving the current value acquired by the MCU controller 120 through the driving interface 150 and setting the current value as the present current of the stepping motor.
The stepping motor driving device 140 is further configured to receive the pulse signal sent by the signal interface 130.
Alternatively, the circuit configuration of the stepping motor driving device may be as shown in fig. 2.
The driving device obtains preset configuration parameters, control instructions and enabling signals, wherein the configuration parameters are current values corresponding to different working states of the stepping motor, and the control instructions are used for controlling the current working state of the stepping motor; acquiring a current value of the stepping motor in the current working state based on the current working state, the configuration parameters and the enabling signal of the stepping motor controlled by the control instruction; and setting the acquired current value as the current of the stepping motor. Therefore, the driving equipment can set different driving currents according to the current working state of the stepping motor, the flexibility of controlling the stepping motor is improved, the phenomenon that the driving equipment and the stepping motor generate heat when the stepping motor is in a locking state in the prior art is avoided, and the service lives of the driving equipment and the stepping motor are prolonged.
Fig. 3 is a schematic flowchart of a stepping motor driving method according to an embodiment of the present invention. As shown in fig. 3, the method may include:
and 310, acquiring preset configuration parameters, control instructions and enabling signals, wherein the configuration parameters are current values corresponding to different working states of the stepping motor, and the control instructions are used for controlling the current working state of the stepping motor.
Since the operating state of the stepping motor may include an operating state (e.g., a rotating state), a locking state, and a stopping state, the configuration parameters may include a current value corresponding to the operating state, a current value corresponding to the locking state, and a current value corresponding to the stopping state.
The control instruction is used for controlling the current working state of the stepping motor. The control commands may include a run command, a lock command, and a stop command based on different operating states of the stepper motor. The running instruction is used for controlling the current working state of the stepping motor to be a running state; the locking instruction is used for controlling the current working state of the stepping motor to be a locking state; the stop command is used for controlling the current working state of the stepping motor to be a stop state.
The enable signal is a signal that allows the stepper motor to operate. Presetting an enable signal with a high level as an effective signal, and controlling the working state of the stepping motor to be a running state or a locking state at the moment if the enable signal is marked as 1; the enable signal at low level is set as an invalid signal, and as noted as 0, the operation state of the stepping motor can be controlled to stop.
It should be noted that the operation state can also be classified into an operation state of rotating speed change and an operation state of direction change, and in this case, the configuration parameter can also include a current value corresponding to the operation state of rotating speed change and a current value corresponding to the direction change. The stepping motor may also include other working states, and the embodiment of the present invention is not described herein.
And step 320, acquiring the current value of the stepping motor in the current working state based on the current working state, the configuration parameters and the enabling signal of the stepping motor controlled by the control instruction.
And generating a pulse signal corresponding to the control instruction according to the control instruction, wherein the pulse signal is used for controlling the current working state of the stepping motor, and acquiring the current value of the stepping motor in the current working state based on the current working state, the configuration parameters and the enabling signal of the stepping motor.
And if the control instruction is a locking instruction, generating a pulse signal corresponding to the locking instruction, and determining the stop state of the stepping motor when the enable signal is an invalid signal. And when the enabling signal is an effective signal and the pulse signal is detected to control the locking state of the stepping motor, searching a target current value corresponding to the locking state in the configuration parameters, and determining the target current value as the current value of the stepping motor in the locking state.
And if the control instruction is an operation instruction, generating a pulse signal corresponding to the operation instruction, and determining the stop state of the stepping motor when the enable signal is an invalid signal. When the enabling signal is an effective signal and the running state of the stepping motor controlled by the pulse signal is detected, a target current value corresponding to the running state in the configuration parameters is searched, and the target current value is determined as the current value of the stepping motor in the running state.
Alternatively, before step 320 is executed, the pulse signal may be directly acquired to control the current operating state of the stepping motor. And acquiring the current value of the stepping motor in the current working state based on the current working state, the configuration parameters and the enabling signal of the stepping motor.
And if the enable signal is an invalid signal, determining that the stepping motor is in a stop state. If the enabling signal is an effective signal and the pulse signal is detected to control the locking state of the stepping motor, searching a target current value corresponding to the locking state in the configuration parameters, and determining the target current value as the current value of the stepping motor in the locking state.
And if the enable signal is an invalid signal, determining that the stepping motor is in a stop state. If the enabling signal is an effective signal and the running state of the stepping motor controlled by the pulse signal is detected, searching a target current value corresponding to the running state in the configuration parameters, and determining the target current value as the current value of the stepping motor in the running state.
Therefore, the method can set different driving currents for different working states of the stepping motor according to the stored configuration parameters. In addition, the two ways of obtaining the current value of the stepping motor in the current working state can be known to the fact that the method can directly control the operation of the stepping motor, and can also control the operation of the stepping motor through a pulse signal generated by the obtained control instruction, so that the control flexibility is improved.
And step 330, setting the acquired current value as the current of the stepping motor.
The driving method comprises the steps that preset configuration parameters, control instructions and enabling signals are obtained, the configuration parameters are current values corresponding to different working states of the stepping motor, and the control instructions are used for controlling the current working state of the stepping motor; acquiring a current value of the stepping motor in the current working state based on the current working state, the configuration parameters and the enabling signal of the stepping motor controlled by the control instruction; and setting the acquired current value as the current of the stepping motor. Therefore, different driving currents can be set according to the current working state of the stepping motor, the flexibility of controlling the stepping motor is improved, the heating phenomena of the driving device and the stepping motor caused by the fact that the stepping motor is in a locking state in the prior art are avoided, and the service lives of the driving device and the stepping motor are prolonged.
Corresponding to the above method, an embodiment of the present invention further provides a driving apparatus, as shown in fig. 4, the driving apparatus may include: an acquisition unit 410 and a setting unit 420.
An obtaining unit 410, configured to obtain preset configuration parameters, a control instruction and an enable signal, where the configuration parameters are current values corresponding to different working states of the stepping motor, the control instruction is used to control a current working state of the stepping motor, and the enable signal is a signal for enabling the stepping motor to work;
acquiring a current value of the stepping motor in the current working state based on the current working state, the configuration parameters and the enabling signal of the stepping motor controlled by the control instruction;
a setting unit 420 for setting the obtained current value as the present current of the stepping motor.
In an alternative implementation, the control instructions include lock instructions;
the obtaining unit 410 is specifically configured to search a target current value corresponding to a locking state in the configuration parameters when the working state of the stepping motor controlled by the locking instruction is the locking state;
and acquiring the current value of the stepping motor in the locking state based on a target current value and the enabling signal.
In an optional implementation, the obtaining unit 410 is further configured to use the target current value as a current value of the stepping motor in the locked state when the enable signal is at an active level.
In an optional implementation, the obtaining unit 410 is further specifically configured to search a target current value corresponding to the operating state in the configuration parameter when the current operating state of the stepping motor is controlled by the operating instruction to be the operating state;
and acquiring the current value of the stepping motor in the running state based on the target current value and the enabling signal.
In an optional implementation, the apparatus further includes a determining unit 430 and a searching unit 440.
The obtaining unit 410 is further configured to obtain a pulse signal, where the pulse signal is used to control a current working state of the stepping motor;
a determining unit 430, configured to determine, based on the enable signal and the pulse signal, that a current operating state of the stepping motor is an operating state;
a searching unit 440, configured to search for a target current value corresponding to the operating state in the configuration parameter;
a determining unit 430, configured to determine a target current value as a current value of the stepping motor in the operating state.
In an alternative implementation, the apparatus further comprises a storage unit 450.
The storage unit 450 is configured to store the configuration parameters after acquiring the preset configuration parameters and the control command.
The functions of the functional units of the driving apparatus provided in the above embodiments of the present invention can be implemented by the above method steps, and therefore, detailed working processes and beneficial effects of the units in the driving apparatus provided in the embodiments of the present invention are not repeated herein.
An embodiment of the present invention further provides an electronic device, as shown in fig. 5, including a processor 510, a communication interface 520, a memory 530 and a communication bus 540, where the processor 510, the communication interface 520, and the memory 530 complete mutual communication through the communication bus 540.
A memory 530 for storing a computer program;
the processor 510, when executing the program stored in the memory 530, implements the following steps:
acquiring preset configuration parameters, control instructions and enabling signals, wherein the configuration parameters are current values corresponding to different working states of the stepping motor, the control instructions are used for controlling the current working state of the stepping motor, and the enabling signals are signals allowing the stepping motor to work;
acquiring a current value of the stepping motor in the current working state based on the current working state, the configuration parameters and the enabling signal of the stepping motor controlled by the control instruction;
and setting the acquired current value as the current of the stepping motor.
In an alternative implementation, the control instructions include lock instructions;
obtaining the current value of the stepping motor in the current working state based on the current working state, the configuration parameters and the enabling signal of the stepping motor controlled by the control instruction, wherein the current value comprises the following steps:
when the working state of the stepping motor controlled by the locking instruction is a locking state, searching a target current value corresponding to the locking state in the configuration parameters;
and acquiring the current value of the stepping motor in the locking state based on a target current value and the enabling signal.
In an optional implementation, obtaining the current value of the stepping motor in the locked state based on the target current value and the enable signal includes:
and when the enable signal is at an effective level, taking the target current value as the current value of the stepping motor in the locking state.
In an optional implementation, when the control instruction includes an operation instruction, acquiring a current value of the stepping motor in a current operating state based on the current operating state of the stepping motor controlled by the control instruction, the configuration parameter, and the enable signal, includes:
when the current working state of the stepping motor is controlled to be the running state by the running instruction, searching a target current value corresponding to the running state in the configuration parameters;
and acquiring the current value of the stepping motor in the running state based on the target current value and the enabling signal.
In an optional implementation, a pulse signal is obtained, and the pulse signal is used for controlling the current working state of the stepping motor;
determining the current working state of the stepping motor to be an operating state based on the enable signal and the pulse signal;
searching a target current value corresponding to the running state in the configuration parameters;
determining a target current value as a current value of the stepping motor in the operating state.
In an alternative implementation, after the preset configuration parameters and the control instructions are obtained, the configuration parameters are stored.
The aforementioned communication bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
Since the implementation and the beneficial effects of the problem solving of each device of the electronic device in the above embodiment can be realized by referring to each step in the embodiment shown in fig. 3, detailed working processes and beneficial effects of the electronic device provided by the embodiment of the present invention are not described herein again.
In still another embodiment provided by the present invention, there is also provided a computer-readable storage medium having stored therein instructions, which when run on a computer, cause the computer to execute the stepping motor driving method described in any one of the above embodiments.
In yet another embodiment provided by the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the stepper motor driving method as described in any of the above embodiments.
As will be appreciated by one of skill in the art, the embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, embodiments of the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including the preferred embodiment and all changes and modifications that fall within the true scope of the embodiments of the present application.
It is apparent that those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the embodiments of the present application. Thus, if such modifications and variations of the embodiments of the present application fall within the scope of the claims of the embodiments of the present application and their equivalents, the embodiments of the present application are also intended to include such modifications and variations.
Claims (10)
1. A stepping motor driving method, characterized by comprising:
acquiring preset configuration parameters, control instructions and enabling signals, wherein the configuration parameters are current values corresponding to different working states of a stepping motor, the control instructions are used for controlling the current working state of the stepping motor, and the enabling signals are signals allowing the stepping motor to work;
acquiring a current value of the stepping motor in the current working state based on the current working state of the stepping motor controlled by the control instruction, the configuration parameter and the enabling signal;
setting the obtained current value as the current of the stepping motor;
wherein the control instruction comprises a lock instruction;
obtaining the current value of the stepping motor in the current working state based on the current working state of the stepping motor, the configuration parameters and the enabling signal controlled by the control instruction, wherein the obtaining of the current value of the stepping motor in the current working state comprises the following steps:
when the working state of the stepping motor controlled by the locking instruction is a locking state, searching a target current value corresponding to the locking state in the configuration parameters;
acquiring a current value of the stepping motor in the locked state based on the target current value and the enable signal, specifically: and when the enable signal is at an effective level, taking the target current value as the current value of the stepping motor in the locking state.
2. The method of claim 1, wherein when the control instruction comprises an operation instruction, obtaining a current value of the stepper motor in a current operation state based on the current operation state of the stepper motor controlled by the control instruction, the configuration parameter and the enable signal, comprises:
when the current working state of the stepping motor is controlled to be the running state by the running instruction, searching a target current value corresponding to the running state in the configuration parameters;
and acquiring the current value of the stepping motor in the running state based on the target current value and the enabling signal.
3. The method of claim 1, wherein the method further comprises:
acquiring a pulse signal, wherein the pulse signal is used for controlling the current working state of the stepping motor;
determining the current working state of the stepping motor to be an operating state based on the enable signal and the pulse signal;
searching a target current value corresponding to the running state in the configuration parameters;
determining the target current value as a current value of the stepping motor in the operating state.
4. The method of claim 1, wherein after obtaining the preset configuration parameters and the control instructions, the method further comprises:
and storing the configuration parameters.
5. A stepping motor driving apparatus, characterized in that the apparatus comprises: the system comprises a communication interface, a Micro Control Unit (MCU) controller, a signal interface, a stepping motor driving device and a driving interface;
the communication interface is used for acquiring preset configuration parameters and control instructions and sending the configuration parameters and the control instructions to the MCU controller, wherein the configuration parameters are current values corresponding to different working states of the stepping motor, and the control instructions are used for controlling the current working state of the stepping motor;
the signal interface is used for acquiring an enabling signal and sending the enabling signal to the MCU controller and the stepping motor driving device, wherein the enabling signal is a signal for allowing the stepping motor to work;
the MCU controller is used for outputting a pulse signal to the stepping motor driving device based on the control instruction, and the pulse signal is used for controlling the current working state of the stepping motor; acquiring a current value of the stepping motor in the current working state based on the current working state of the stepping motor, the configuration parameters and the enabling signal;
the stepping motor driving device is used for acquiring a current value acquired by the MCU controller through the driving interface and setting the current value as the current of the stepping motor;
wherein the control instruction comprises a lock instruction;
the MCU controller is specifically used for searching a target current value corresponding to the locking state in the configuration parameters when the locking instruction controls the working state of the stepping motor to be the locking state;
acquiring a current value of the stepping motor in the locking state based on the target current value and the enabling signal;
the MCU controller is further specifically configured to determine the target current value as a current value of the stepping motor in the locked state when the enable signal is at an active level.
6. The device according to claim 5, wherein when the control instruction includes an operation instruction, the MCU controller is specifically configured to search for a target current value corresponding to the operation state in the configuration parameter when the operation instruction controls the current operating state of the stepping motor to be the operation state;
and acquiring the current value of the stepping motor in the running state based on the target current value and the enabling signal.
7. The apparatus of claim 5, wherein the signal interface is further configured to obtain a pulse signal and send the pulse signal to the stepper motor driver;
the MCU controller is also used for searching a target current value corresponding to the running state in the configuration parameters based on the enabling signal when the current working state of the stepping motor is detected to be the running state;
determining the target current value as a current value of the stepping motor in the operating state.
8. The device of claim 5, wherein the MCU controller is further configured to store the configuration parameters.
9. An electronic device, characterized in that the electronic device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1-4 when executing a program stored on a memory.
10. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of claims 1 to 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810901564.0A CN110829911B (en) | 2018-08-09 | 2018-08-09 | Driving method and driving equipment for stepping motor |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810901564.0A CN110829911B (en) | 2018-08-09 | 2018-08-09 | Driving method and driving equipment for stepping motor |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110829911A CN110829911A (en) | 2020-02-21 |
CN110829911B true CN110829911B (en) | 2021-08-24 |
Family
ID=69540855
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810901564.0A Active CN110829911B (en) | 2018-08-09 | 2018-08-09 | Driving method and driving equipment for stepping motor |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110829911B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113419956B (en) * | 2021-06-30 | 2022-04-12 | 深圳市杰美康机电有限公司 | Motor driver parameter adjusting method and device |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US4459527A (en) * | 1980-12-01 | 1984-07-10 | Cubic Western Data | Stepper motor control circuit |
CN1808885A (en) * | 2005-12-26 | 2006-07-26 | 北京航空航天大学 | Step motor network control apparatus applicable to medical robot |
CN201639535U (en) * | 2010-01-21 | 2010-11-17 | 南京师范大学 | Intelligent driver of multi-task stepper motors |
-
2018
- 2018-08-09 CN CN201810901564.0A patent/CN110829911B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US4459527A (en) * | 1980-12-01 | 1984-07-10 | Cubic Western Data | Stepper motor control circuit |
CN1808885A (en) * | 2005-12-26 | 2006-07-26 | 北京航空航天大学 | Step motor network control apparatus applicable to medical robot |
CN201639535U (en) * | 2010-01-21 | 2010-11-17 | 南京师范大学 | Intelligent driver of multi-task stepper motors |
Non-Patent Citations (1)
Title |
---|
控打机中的步进电机及其锁定问题;马广胜;《微特电机》;19811231;第50-52页 * |
Also Published As
Publication number | Publication date |
---|---|
CN110829911A (en) | 2020-02-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106374791B (en) | Zero setting method and device for servo motor of incremental encoder | |
CN112824059B (en) | Encoder data conversion method, device and equipment | |
CN106404032B (en) | Method for controlling speed synchronization of main shaft of encoder | |
CN110661454A (en) | Dual-motor synchronous control method and device, storage medium and vehicle | |
CN110829911B (en) | Driving method and driving equipment for stepping motor | |
CN107916509B (en) | Needle position detection, needle stop position setting and needle stop control method, system, terminal and device | |
CN113193789B (en) | Motor starting control parameter optimization method and device and motor starting control system | |
CN113162478B (en) | Motor starting parameter testing method and system, terminal equipment and storage medium | |
JP3370845B2 (en) | Absolute encoder | |
CN114377862A (en) | Method and device for controlling a centrifuge, centrifuge and storage medium | |
JP5081633B2 (en) | Motor control device | |
US7460030B2 (en) | System and method for encoder failure detection | |
CN108988694B (en) | Vibrating device, motor control method and system thereof, and readable storage medium | |
WO2015092462A1 (en) | Method and system for controlling an electric motor | |
CN113635136B (en) | Tool magazine stop control method, device, equipment and storage medium | |
CN107504929B (en) | Positioning method and system of structural member and computer device | |
CN109256990B (en) | Motor control method and device | |
CN109973318B (en) | Control system and method for generator rotor locking pin | |
CN113726250B (en) | Synchronous motor cogging torque calibration method and device and electronic equipment | |
CN114046808B (en) | Motor Hall phase sequence self-learning method and device and electronic equipment | |
CN111293930B (en) | Method and device for controlling an electric machine | |
CN115833661A (en) | Feedback method and device for FG (FG) signal of brushless motor | |
CN114389512A (en) | Method, device, equipment and medium for controlling phase sequence of adjustable speed motor | |
CN104639013B (en) | Motion control apparatus, motion controller, and motion control method | |
CN114070139A (en) | Starting method and device of brushless direct current motor, storage medium and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |