CN114649982B - Stepping motor load judgment method and stepping motor closed-loop control system - Google Patents

Stepping motor load judgment method and stepping motor closed-loop control system Download PDF

Info

Publication number
CN114649982B
CN114649982B CN202210436584.1A CN202210436584A CN114649982B CN 114649982 B CN114649982 B CN 114649982B CN 202210436584 A CN202210436584 A CN 202210436584A CN 114649982 B CN114649982 B CN 114649982B
Authority
CN
China
Prior art keywords
value
stepping motor
encoder
current
preset
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
Application number
CN202210436584.1A
Other languages
Chinese (zh)
Other versions
CN114649982A (en
Inventor
陈良勇
初雯雯
韩建会
邵克松
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu Ruiqi Haodi Technology Co ltd
Beijing Vrich Haodi Technology Co ltd
Original Assignee
Chengdu Ruiqi Haodi Technology Co ltd
Beijing Vrich Haodi Technology Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Chengdu Ruiqi Haodi Technology Co ltd, Beijing Vrich Haodi Technology Co ltd filed Critical Chengdu Ruiqi Haodi Technology Co ltd
Priority to CN202210436584.1A priority Critical patent/CN114649982B/en
Publication of CN114649982A publication Critical patent/CN114649982A/en
Application granted granted Critical
Publication of CN114649982B publication Critical patent/CN114649982B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02PCONTROL OR REGULATION OF ELECTRIC MOTORS, ELECTRIC GENERATORS OR DYNAMO-ELECTRIC CONVERTERS; CONTROLLING TRANSFORMERS, REACTORS OR CHOKE COILS
    • H02P8/00Arrangements for controlling dynamo-electric motors rotating step by step
    • H02P8/14Arrangements for controlling speed or speed and torque
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R31/00Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
    • G01R31/34Testing dynamo-electric machines
    • G01R31/343Testing dynamo-electric machines in operation

Landscapes

  • Engineering & Computer Science (AREA)
  • Power Engineering (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Control Of Stepping Motors (AREA)

Abstract

The invention discloses a load judgment method of a stepping motor and a stepping motor closed-loop control system, wherein when the stepping motor starts to operate, the operation of obtaining the numerical value of an encoder is responded; comparing the encoder value obtained at the current time with the value of the previous encoder; when the difference value between the encoder value obtained at the current time and the encoder value obtained at the previous time is smaller than the theoretical operation difference value, judging that the stepping motor is out of step in the operation process; and determining a corresponding out-of-step value according to the difference value and determining the load condition of the corresponding stepping motor according to the size of the out-of-step value. The method changes the traditional mode of judging the load condition of the motor by depending on current detection, uses the position data for load judgment and takes the position data as the basis for adjusting the output torque of the stepping motor, thereby improving the positioning accuracy of the stepping motor.

Description

Stepping motor load judgment method and stepping motor closed-loop control system
Technical Field
The invention relates to the technical field of stepping motors, in particular to a stepping motor load judgment method and a stepping motor closed-loop control system.
Background
Stepper motors have found widespread use in industrial and automation applications due to their simple control, high accuracy, and cost-effective advantages. In simple application occasions, an open-loop control mode is generally adopted, namely, the MCU unidirectionally outputs a pulse direction control signal STEP/DIR to the driver, and the motor can operate without STEP-out as long as the load is within the effective torque range of the motor regardless of whether the motor operates in place, so that the positioning accuracy can meet the requirement. However, in applications where the load change interval is large, the requirement for positioning is relatively strict, and there may be a step-out risk, the application requirement may be satisfied by adopting a closed-loop control mode. The existing torque closed-loop control mode judges and adjusts the load of the motor by depending on current in the control process, but the method is influenced by the sudden change of the speed of the motor, so that the output torque (load) of the motor cannot be accurately and dynamically adjusted, and the positioning accuracy of the motor is poor.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method for determining a load of a stepping motor and a stepping motor closed-loop control system, so as to solve a technical problem in the prior art that positioning accuracy is poor when a load condition of the stepping motor is determined and adjusted by current in a control process.
The technical scheme provided by the invention is as follows:
a first aspect of an embodiment of the present invention provides a method for determining a load of a stepping motor, where the method for determining a load of a stepping motor includes: responding to the acquisition operation of the encoder value when the stepping motor starts to operate; comparing the encoder value obtained at the current time with the value of the previous encoder; when the difference value between the encoder value obtained at the current time and the encoder value obtained at the previous time is smaller than the theoretical operation difference value, judging that the stepping motor is out of step in the operation process; and determining a corresponding step-out value according to the difference value and determining the load condition of the corresponding stepping motor according to the step-out value.
Optionally, after comparing the currently obtained encoder value with the previous encoder value, the method further includes: and when the difference value between the encoder value obtained at the current time and the previous encoder value is greater than or equal to the theoretical operation difference value, judging that the step motor does not lose step in the operation process.
Optionally, when the difference between the currently acquired encoder value and the previous encoder value is smaller than the theoretical operation difference, and it is determined that step loss occurs in the operation process of the stepping motor, the method further includes: and adding a corresponding out-of-step identifier.
Optionally, the method further comprises: acquiring the running time of the stepping motor when the encoder value is acquired before and after twice; and calculating the running speed of the stepping motor according to the difference value of the encoder values obtained in the previous and the next times and the running time.
Optionally, when the stepping motor starts to operate, responding to the obtaining operation of the encoder value comprises: acquiring a count value of a timer and comparing the count value with a preset third threshold value, wherein the preset third threshold value is the count threshold value of the timer determined according to the running speed; and when the count value of the timer is equal to the preset third threshold value, acquiring a corresponding encoder value and controlling the timer to respond to recounting.
Optionally, after the count value of the timer is equal to the preset third threshold and the corresponding encoder value is obtained, the method further includes: detecting the desynchronizing mark; when the step-out mark is not detected, controlling a stepping motor to accelerate or run at a constant speed based on the running speed; when the step-out mark is detected, comparing the corresponding step-out value with a preset fourth threshold value, wherein the fourth threshold value represents the maximum step-out value in the step-out value range of the stepping motor; when the step-out value is smaller than the preset fourth threshold value, increasing the corresponding running current value and comparing the running current value with the preset current threshold value; when the running current value is larger than the preset current threshold value, controlling the stepping motor to run in a speed reduction mode based on the running speed; and when the running current value is less than or equal to the preset current threshold value, controlling the stepping motor to accelerate or run at a constant speed based on the running speed.
Optionally, when the operating current value is greater than the preset current threshold, controlling the stepping motor to perform deceleration operation based on the operating speed includes: comparing the current running speed of the stepping motor with a preset speed threshold; when the current running speed is greater than or equal to the speed threshold, controlling the stepping motor to run in a speed reduction mode until a target position is reached; when the current running speed is smaller than the speed threshold, a locked rotor signal is sent out and the stepping motor is controlled to stop; controlling the stepping motor to restart according to the preset retry number; when the locked rotor signal disappears after restarting the operation, controlling the stepping motor to decelerate the operation until reaching the target position; and when the locked rotor signal does not disappear after restarting the operation, the stepping motor is stopped and sends out an alarm signal.
A second aspect of an embodiment of the present invention provides a stepping motor closed-loop control system, including: the stepping motor system comprises a stepping motor, an encoder and a driving controller; and the controller is connected with the stepping motor system and used for controlling the operation of the stepping motor system by using the stepping motor load judgment method according to any one of the first aspect and the first aspect of the embodiment of the invention.
Optionally, one side of the encoder is connected to the controller, and the other side of the encoder is connected to the stepping motor, and the encoder is configured to convert the received position information of the stepping motor into corresponding encoder data and output the encoder data to the controller; and one side of the driving controller is connected with the controller, and the other side of the driving controller is connected with the stepping motor and is used for converting the control signal sent by the controller into a stepping motor operation driving signal.
A third aspect of the embodiments of the present invention provides a load determination device for a stepping motor, including: the response module is used for responding to the acquisition operation of the encoder value when the stepping motor starts to operate; the comparison module is used for comparing the encoder value obtained at the current time with the value of the previous encoder; the judging module is used for judging that the stepping motor is out of step in the running process when the difference value between the currently acquired encoder value and the previous encoder value is smaller than the theoretical running difference value; and the determining module is used for determining a corresponding out-of-step value according to the difference value and determining the load condition of the corresponding stepping motor according to the size of the out-of-step value.
The technical scheme provided by the invention has the following effects:
according to the load judgment method of the stepping motor, when the stepping motor starts to operate, the operation of obtaining the numerical value of the encoder is responded; comparing the encoder value obtained at the current time with the value of the previous encoder; when the difference value between the encoder value obtained at the current time and the previous encoder value is smaller than the theoretical operation difference value, judging that the step motor is out of step in the operation process; and determining a corresponding out-of-step value according to the difference value and determining the load condition of the corresponding stepping motor according to the size of the out-of-step value. The method changes the traditional mode of judging the load condition of the motor by depending on current detection, uses the position data for load judgment and takes the position data as the basis for adjusting the output torque of the stepping motor, thereby improving the positioning accuracy of the stepping motor.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a flow chart of a method of determining stepper motor load according to an embodiment of the present invention;
FIG. 2 is a flow chart of out-of-sync measurements provided in accordance with an embodiment of the present invention;
FIG. 3 is a flow chart of a stepper motor closed-loop control method according to an embodiment of the present invention;
FIG. 4 is a flow chart of a step motor operating speed measurement provided in accordance with an embodiment of the present invention;
FIG. 5 is a block diagram of a stepper motor closed-loop control system according to an embodiment of the present invention;
FIG. 6 is a block diagram of a stepper motor closed-loop control system according to an embodiment of the present invention;
fig. 7 is a block diagram showing the construction of a stepping motor load judging device according to an embodiment of the present invention;
FIG. 8 is a schematic structural diagram of a computer-readable storage medium provided in accordance with an embodiment of the present invention;
fig. 9 is a schematic structural diagram of an electronic device provided in an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to the protection scope of the present invention.
The embodiment of the invention provides a method for judging the load of a stepping motor, which comprises the following steps as shown in figure 1:
step S101: and responding to the acquisition operation of the encoder value when the stepping motor starts to operate. Specifically, the encoder values are used to feed back real-time position data for the stepper motor. And when the stepping motor starts to operate, acquiring a corresponding encoder value.
Step S102: and comparing the encoder value obtained at the current time with the encoder value obtained at the previous time. Specifically, the encoder values obtained two adjacent times (i.e., the current and last times) are compared. The interval between obtaining the values of the two different encoders is set according to actual conditions, for example, the encoder feedback value is recorded once every 50 pulse signals are run.
In an embodiment, as shown in fig. 2, after acquiring the value of the previous encoder and before acquiring the value of the current encoder, it is first determined that 50 pulse signals have been operated in the interval, and if yes, the value of the current encoder is acquired; if not, continuing to send the pulse signals until the number of the current encoder is recorded when 50 pulse signals are operated.
Step S103: and when the difference value between the encoder value obtained at the current time and the encoder value obtained at the previous time is smaller than the theoretical operation difference value, judging that the stepping motor is out of step in the operation process. Specifically, the theoretical operation difference value represents a value obtained by taking the interval between two different encoder values after eliminating factors such as motor operation vibration and mechanical deviation, for example, when 50 pulse signals are operated and an encoder feedback value is recorded once, the theoretical operation difference value is also 50, but a deviation value can be set by considering the factors such as the motor operation vibration and the mechanical deviation, and the magnitude of the deviation value can be determined according to actual needs, for example, the magnitude of the deviation value can be any value in [8, 12 ]. In the embodiment of the present application, the deviation value is within 10 pulse signals, that is, the operation of the stepping motor is considered to be normal, that is, the theoretical operation difference value is 40.
When the difference between the current obtained encoder value and the previous encoder value is smaller than the theoretical operation difference, it can be determined that the stepping motor is out of step in the operation process of obtaining the encoder values twice, as shown in fig. 2.
Step S104: and determining a corresponding out-of-step value according to the difference value and determining the load condition of the corresponding stepping motor according to the size of the out-of-step value. Specifically, the difference between the theoretical operation difference and the current obtained encoder value and the previous encoder value is the step-out value of the stepping motor. For example, when the difference between the encoder value obtained at the previous time and the previous encoder value is 30, the step-out value is the theoretical operation difference of 40-30=10, and then the load condition of the corresponding stepping motor can be determined according to the step-out value. For example, when the step loss value is 10, the output torque difference of the stepping motor is 10. The output torque of the stepping motor can represent the load condition of the stepping motor.
The load judgment method of the stepping motor provided by the embodiment of the invention changes the traditional mode of judging the load condition of the motor by depending on current detection, uses the position data for load judgment and takes the position data as the basis for adjusting the output torque of the stepping motor, thereby improving the positioning accuracy of the stepping motor.
As an optional implementation manner of the embodiment of the present invention, after step S102, the method further includes: and when the difference value between the encoder value obtained at the current time and the encoder value obtained at the previous time is larger than or equal to the theoretical operation difference value, judging that the stepping motor does not lose step in the operation process. Specifically, contrary to the determination process in step S103, when the difference between the currently acquired encoder value and the previous encoder value is greater than or equal to the theoretical operation difference, it indicates that the motor is not out of step in the operation process, as shown in fig. 2.
As an optional implementation manner of the embodiment of the present invention, after it is determined that step-out occurs in the operation process of the stepping motor, a corresponding step-out identifier is added in the operation process, so as to facilitate subsequent detection and use, as shown in fig. 2. Specifically, the step-out flag is a tag or a message to be processed, which is set in a system for controlling the operation of the stepping motor, and is used to indicate that there is a fault to be processed in the operation process.
As an optional implementation manner of the embodiment of the present invention, step S101 includes: acquiring a count value of a timer and comparing the count value with a preset third threshold, wherein the preset third threshold is the count threshold of the timer determined according to the running speed; and when the count value of the timer is equal to the preset third threshold value, acquiring a corresponding encoder value and controlling the timer to respond to recounting. Specifically, the operation of the stepping motor is controlled by a timer interrupt, so that when the stepping motor starts to operate, a hardware counter in the timer starts to count, when the count value reaches a count threshold (third threshold), an interrupt is generated, that is, one control cycle is ended, at which time corresponding encoder data is acquired, and then the timer starts to count again and generates a new interrupt control, as shown in fig. 3. The counting threshold is determined according to the operation speed of the stepping motor, specifically, the faster the operation speed is, the smaller the third threshold is, the slower the operation speed is, and the larger the third threshold is, so that the counting threshold is determined according to the actual situation, and the invention is not particularly limited as long as the requirement is met.
As an optional implementation manner of the embodiment of the present invention, the method further includes: acquiring the running time of the stepping motor when the encoder values are acquired before and after twice; and calculating the running speed of the stepping motor according to the difference value of the encoder values obtained in the previous and the next times and the running time. Specifically, when the corresponding load condition is obtained according to the step-out condition of the stepping motor, the load condition needs to be adjusted. Since the load (magnitude of the output torque) of the stepping motor is inversely proportional to the operating speed of the stepping motor, the operating speed of the stepping motor is first calculated.
Specifically, since the obtained encoder value is used for feeding back the position of the stepping motor, the difference between the obtained encoder values of two times is the running length of the stepping motor, and then the quotient of the difference and the time interval between the obtained encoder values of two times is the running speed of the stepping motor.
In one embodiment, as shown in fig. 4, a timer is initially set to start running, the running frequency is set to be 1/2 of the frequency of the running system of the motor, then the motor control pulse is output according to the motor control flow, when 50 pulses are output, the current running value of the timer is recorded, and the value is the time t, so that the current speed is v =50/t, and the unit is steps/tick.
As an optional implementation manner of the embodiment of the present invention, after the count value of the timer is equal to the preset third threshold and the corresponding encoder value is obtained, the method further includes: detecting the desynchronizing mark; when the step-out mark is not detected, controlling a stepping motor to accelerate or run at a constant speed based on the running speed; when the step-out identification is detected, comparing the corresponding step-out value with a preset fourth threshold value, wherein the fourth threshold value represents the maximum step-out value in the step-out value range of the stepping motor; when the step-out value is smaller than the preset fourth threshold value, increasing the corresponding running current value and comparing the running current value with the preset current threshold value; when the running current value is larger than the preset current threshold value, controlling the stepping motor to run in a speed reduction mode based on the running speed; and when the running current value is less than or equal to the preset current threshold value, controlling the stepping motor to accelerate or run at a constant speed based on the running speed.
Specifically, as shown in fig. 3, after the step-out state of the stepping motor is determined according to the obtained encoder values twice, the step-out flag is detected, and when the step-out flag is not detected, that is, the stepping motor does not step out in the operation process, the stepping motor is controlled to continue to accelerate or operate at a constant speed on the basis of the original operation speed until the target position is reached, and a new control period is calculated again.
When the step-out mark is detected, that is, the step-out occurs in the operation process of the stepping motor, firstly, whether the step-out value exceeds the maximum step-out value (fourth threshold) which can be borne by the stepping motor is judged, if not, the current operation current is increased within the bearing range of the stepping motor, if the adjusted current value does not exceed the current threshold, the load condition of the stepping motor is solved within the range, and at the moment, the stepping motor is controlled to continuously accelerate or run at a constant speed on the basis of the original operation speed until the target position is reached, and a new control period is calculated again.
If the load cannot be overcome by increasing the current (namely the adjusted current value exceeds the current threshold), the running speed of the stepping motor is reduced, the corresponding stepping motor outputs corresponding torque to eliminate external influence until the load disappears, the stepping motor is controlled to continue running until the target position is reached, and a new control period is calculated again.
And when the step-out mark is not detected, controlling the stepping motor to continuously accelerate or run at a constant speed on the basis of the original running speed until the target position is reached and restarting to calculate a new control period.
In this way, the stepping motor can realize positioning control in a certain load range and improve the positioning accuracy.
As an optional implementation manner of the embodiment of the present invention, when the operating current value is greater than the preset current threshold, controlling the stepping motor to perform deceleration operation based on the operating speed includes: comparing the current running speed of the stepping motor with a preset speed threshold; when the current running speed is greater than or equal to the speed threshold, controlling the stepping motor to run at a reduced speed until a target position is reached; when the current running speed is smaller than the speed threshold, a locked rotor signal is sent out, and the stepping motor is stopped; controlling the stepping motor to restart according to the preset retry number; when the locked rotor signal disappears after restarting the operation, controlling the stepping motor to operate in a speed reduction mode until the target position is reached; and when the locked rotor signal does not disappear after restarting the operation, controlling the stepping motor to stop and sending an alarm signal.
Specifically, as shown in fig. 3, when the step out value of the stepping motor exceeds the maximum step out value (fourth threshold) that the stepping motor can bear, and the step-down operation process of the stepping motor is controlled based on the operation speed, the operation speed in the step-down operation process of the stepping motor needs to be determined, and when the operation speed is lower than a set threshold (speed threshold), a stall signal is sent out, and the stepping motor stops operating. The speed threshold is set according to the maximum operating speed of the stepping motor, for example, the speed threshold is set to be 0.3 times of the corresponding maximum operating speed.
After the stepping motor stops running, the stepping motor is restarted for a plurality of times according to the preset restart times (reset times), and if the stepping motor is still locked after being restarted, the stepping motor is stopped and alarmed. And if the locked rotor disappears after restarting, controlling the stepping motor to continuously run until the target position is reached, and restarting to calculate a new control period.
An embodiment of the present invention further provides a stepping motor closed-loop control system, as shown in fig. 5, where the stepping motor closed-loop control system 1 includes:
the stepping motor system 11 includes a stepping motor 111, an encoder 112, and a drive controller 113. Specifically, the encoder is used for feeding back real-time position data of the stepping motor; the drive controller is used for controlling the rotation of the stepping motor.
And the controller 12 is connected with the stepping motor system and is used for controlling the operation of the stepping motor system by using the stepping motor load judgment method according to the embodiment of the invention. Specifically, the running condition of the stepping motor is adjusted and controlled in real time according to the determined load condition, and the specific control process refers to the implementation process of the embodiment of the stepping motor load determination method, which is not described herein again.
According to the stepping motor closed-loop control system provided by the embodiment of the invention, on the premise of not increasing a current sensor, the load condition of the motor is judged and determined by using the load of the stepping motor, the output torque of the stepping motor is dynamically adjusted by using position data, accurate positioning control is realized within a certain overload range, and meanwhile, the step-out is timely compensated by feeding back data through an encoder, so that closed-loop control is realized.
As an optional implementation manner of the embodiment of the present invention, one side of the encoder is connected to the controller, and the other side of the encoder is connected to the stepping motor, and is configured to convert the received position information of the stepping motor into corresponding encoder data and output the encoder data to the controller; and one side of the driving controller is connected with the controller, and the other side of the driving controller is connected with the stepping motor and is used for converting the control signal sent by the controller into a stepping motor operation driving signal. Specifically, the encoder is mounted at the tail of the stepping motor and rotates coaxially with the stepping motor, the change of a photoelectric signal or a magnetic signal of the encoder reflects the rotation condition of the stepping motor, two paths of orthogonal AB signals or SPI data are output, and after the signals are processed, the current position data of the stepping motor is provided for a stepping motor system.
The drive controller presets the working current of the stepping motor through a self-contained current setting interface (dial switch, analog voltage and the like), and outputs the constant working current to the motor through an internal PWM chopping controller according to a current setting value. Specifically, the received pulse driving signal sent by the controller is converted into a driving signal of the stepping motor, and the stepping motor operates according to the received operation direction signal sent by the controller.
In one embodiment, the stepping motor closed-loop control system is shown in fig. 6, and includes a power supply and a communication interface in addition to the controller (MCU), the motor driving module (driving controller), and the encoder. The power supply is used for providing various power supplies used by the system, and comprises a 24V direct-current power supply for driving the motor, a 5V direct-current power supply for the encoder and a 3.3V direct-current power supply for the MCU.
The communication interface completes external communication, is responsible for receiving various control instructions, and decomposes the instruction data into various control parameters to be input to the control system.
An embodiment of the present invention further provides a device for determining a load of a stepping motor, as shown in fig. 7, the device for determining a load of a stepping motor includes:
a response module 701, configured to respond to an operation of obtaining a value of an encoder when the stepping motor starts to operate; for details, refer to the related description of step S101 in the above method embodiment.
A comparison module 702, configured to compare the currently obtained encoder value with a previous encoder value; for details, refer to the related description of step S102 in the above method embodiment.
A determining module 703, configured to determine that the stepping motor is out of step in the operation process when a difference between the currently obtained encoder value and the previous encoder value is smaller than a theoretical operation difference; for details, refer to the related description of step S103 in the above method embodiment.
A determining module 704, configured to determine a corresponding out-of-step value according to the difference value, and determine a load condition of the corresponding stepping motor according to the size of the out-of-step value; for details, refer to the related description of step S104 in the above method embodiment.
The load judgment device of the stepping motor provided by the embodiment of the invention changes the traditional mode of judging the load condition of the motor by depending on current detection, uses the position data for load judgment and takes the position data as the basis for adjusting the output torque of the stepping motor, thereby improving the positioning accuracy of the stepping motor.
As an optional implementation manner of the embodiment of the present invention, the apparatus further includes: and the first judgment module is used for judging that the stepping motor does not lose step in the running process when the difference value between the currently acquired encoder value and the previous encoder value is greater than or equal to the theoretical running difference value.
As an optional implementation manner of the embodiment of the present invention, the apparatus further includes: and the adding module is used for adding the corresponding out-of-step identification.
As an optional implementation manner of the embodiment of the present invention, the apparatus further includes: the first acquisition module is used for acquiring the running time of the stepping motor when the encoder value is acquired for the first time and the second time; and the calculating module is used for calculating the running speed of the stepping motor according to the difference value of the encoder values obtained in the previous and the next times and the running time.
As an optional implementation manner of the embodiment of the present invention, the apparatus further includes: the first comparison module is used for acquiring a count value of a timer and comparing the count value with a preset third threshold value, wherein the preset third threshold value is the count threshold value of the timer determined according to the running speed; and a second obtaining module, configured to, when the count value of the timer is equal to the preset third threshold, obtain a corresponding encoder value and recount the timer.
As an optional implementation manner of the embodiment of the present invention, the apparatus further includes: the detection module is used for detecting the out-of-step mark; the first control module is used for controlling the stepping motor to accelerate or run at a constant speed based on the running speed when the step-out mark is not detected; the second comparison module is used for comparing the corresponding out-of-step value with a preset fourth threshold value when the out-of-step identification is detected, wherein the fourth threshold value represents the maximum out-of-step value in the out-of-step value range of the stepping motor; the third comparison module is used for increasing the corresponding running current value and comparing the running current value with a preset current threshold value when the step-out value is smaller than the preset fourth threshold value; the second control module is used for controlling the stepping motor to operate in a speed reduction mode based on the operation speed when the operation current value is larger than the preset current threshold value; and the third control module is used for controlling the stepping motor to accelerate or run at a constant speed based on the running speed when the running current value is smaller than the preset current threshold.
As an optional implementation manner of the embodiment of the present invention, the apparatus further includes: the fourth comparison module is used for comparing the current running speed of the stepping motor with a preset speed threshold; the fourth control module is used for controlling the stepping motor to run at a reduced speed until the target position is reached when the current running speed is greater than the speed threshold; the fifth control module is used for sending a locked rotor signal and stopping the stepping motor when the current running speed is less than the speed threshold; the sixth control module is used for controlling the stepping motor to restart and operate according to the preset retry number; the seventh control module is used for controlling the stepping motor to run at a reduced speed until the target position is reached when the locked rotor signal disappears after the running is restarted; and the eighth control module is used for controlling the stepping motor to stop and sending an alarm signal when the locked rotor signal does not disappear after the operation is restarted.
The functional description of the load judgment device of the stepping motor provided by the embodiment of the invention refers to the description of the load judgment method of the stepping motor in the embodiment.
An embodiment of the present invention further provides a storage medium, as shown in fig. 8, on which a computer program 801 is stored, and when the instructions are executed by a processor, the steps of the method for determining the load of the stepping motor in the foregoing embodiment are implemented. The storage medium is also stored with audio and video stream data, characteristic frame data, an interactive request signaling, encrypted data, preset data size and the like. The storage medium may be a magnetic Disk, an optical Disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a Flash Memory (Flash Memory), a Hard Disk (Hard Disk Drive, abbreviated as HDD), a Solid State Drive (SSD), or the like; the storage medium may also comprise a combination of memories of the kind described above.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic Disk, an optical Disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a Flash Memory (Flash Memory), a Hard Disk (Hard Disk Drive, abbreviated as HDD), a Solid State Drive (SSD), or the like; the storage medium may also comprise a combination of memories of the kind described above.
An embodiment of the present invention further provides an electronic device, as shown in fig. 9, the electronic device may include a processor 91 and a memory 92, where the processor 91 and the memory 92 may be connected through a bus or in another manner, and fig. 9 takes the connection through the bus as an example.
The processor 91 may be a Central Processing Unit (CPU). The Processor 91 may also be other general purpose processors, 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, or any combination thereof.
The memory 92, which is a non-transitory computer readable storage medium, may be used to store non-transitory software programs, non-transitory computer executable programs, and modules, such as the corresponding program instructions/modules in embodiments of the present invention. The processor 91 executes various functional applications and data processing of the processor by running non-transitory software programs, instructions and modules stored in the memory 92, namely, implements the stepping motor load determination method in the above method embodiment.
The memory 92 may include a storage program area and a storage data area, wherein the storage program area may store an application program required for operating the device, at least one function; the storage data area may store data created by the processor 91, and the like. Further, memory 92 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory 92 may optionally include memory located remotely from the processor 91, and such remote memory may be connected to the processor 91 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The one or more modules are stored in the memory 92 and, when executed by the processor 91, perform a stepper motor load determination method as in the embodiment of fig. 1-4.
The details of the electronic device may be understood by referring to the corresponding descriptions and effects in the embodiments shown in fig. 1 to fig. 4, and are not described herein again.
Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations fall within the scope defined by the appended claims.

Claims (8)

1. A method for judging the load of a stepping motor is characterized by comprising the following steps:
responding to the acquisition operation of the encoder value when the stepping motor starts to operate;
comparing the encoder value obtained at the current time with the value of the previous encoder;
when the difference value between the encoder value obtained at the current time and the encoder value obtained at the previous time is smaller than the theoretical operation difference value, judging that the stepping motor is out of step in the operation process;
determining a corresponding out-of-step value according to the difference value and determining the load condition of the corresponding stepping motor according to the size of the out-of-step value;
when the difference value between the encoder value obtained at the current time and the encoder value obtained at the previous time is smaller than the theoretical operation difference value, and after the step motor is judged to be out of step in the operation process, the method further comprises the following steps: adding a corresponding out-of-step mark;
responding to the acquisition operation of the encoder value when the stepping motor starts to operate, and comprising the following steps:
acquiring a count value of a timer and comparing the count value with a preset third threshold value, wherein the preset third threshold value is the count threshold value of the timer determined according to the running speed of the stepping motor;
when the count value of the timer is equal to the preset third threshold value, acquiring a corresponding encoder value and controlling the timer to respond to recounting;
when the count value of the timer is equal to the preset third threshold value, and after the corresponding encoder value is obtained, the method further includes:
detecting the desynchronizing mark;
when the step-out mark is detected, comparing the corresponding step-out value with a preset fourth threshold value, wherein the fourth threshold value represents the maximum step-out value in the step-out value range of the stepping motor;
when the step-out value is smaller than the preset fourth threshold value, increasing the corresponding running current value and comparing the running current value with the preset current threshold value;
when the running current value is larger than the preset current threshold value, controlling the stepping motor to run in a speed reduction mode based on the running speed;
and when the running current value is less than or equal to the preset current threshold value, controlling the stepping motor to accelerate or run at a constant speed based on the running speed.
2. The method of claim 1, wherein after comparing the currently obtained encoder value with the previous encoder value, the method further comprises:
and when the difference value between the encoder value obtained at the current time and the encoder value obtained at the previous time is larger than or equal to the theoretical operation difference value, judging that the stepping motor does not lose step in the operation process.
3. The method of claim 1, further comprising:
acquiring the running time of the stepping motor when the encoder values are acquired before and after twice;
and calculating the running speed of the stepping motor according to the difference value of the encoder values obtained in the previous and the next times and the running time.
4. The method of claim 1, wherein after the counter value of the timer is equal to the preset third threshold value and the corresponding encoder value is obtained, the method further comprises:
and when the step-out mark is not detected, controlling the stepping motor to accelerate or run at a constant speed based on the running speed.
5. The method of claim 1, wherein controlling a stepper motor to operate at a reduced speed based on the operating speed when the operating current value is greater than the predetermined current threshold comprises:
comparing the current running speed of the stepping motor with a preset speed threshold;
when the current running speed is greater than or equal to the speed threshold, controlling the stepping motor to run in a speed reduction mode until a target position is reached;
when the current running speed is smaller than the speed threshold, a locked rotor signal is sent out and the stepping motor is controlled to stop;
controlling the stepping motor to restart according to the preset retry number;
when the locked rotor signal disappears after restarting the operation, controlling the stepping motor to decelerate the operation until reaching the target position;
and when the locked rotor signal does not disappear after the operation is restarted, controlling the stepping motor to stop and sending an alarm signal.
6. A stepper motor closed-loop control system, comprising:
the stepping motor system comprises a stepping motor, an encoder and a driving controller;
a controller connected to the stepper motor system for controlling the operation of the stepper motor system using the stepper motor load determining method as claimed in any one of claims 1-5.
7. The system of claim 6,
one side of the encoder is connected with the controller, and the other side of the encoder is connected with the stepping motor and used for converting the received position information of the stepping motor into corresponding encoder data and outputting the encoder data to the controller;
and one side of the driving controller is connected with the controller, and the other side of the driving controller is connected with the stepping motor and is used for converting the control signal sent by the controller into a stepping motor operation driving signal.
8. A load judging device for a stepping motor, comprising:
the response module is used for responding to the acquisition operation of the encoder value when the stepping motor starts to operate;
the comparison module is used for comparing the encoder value obtained at the current time with the value of the previous encoder;
the judging module is used for judging that the stepping motor is out of step in the running process when the difference value between the currently acquired encoder value and the previous encoder value is smaller than the theoretical running difference value, and adding a corresponding out-of-step identifier;
the determining module is used for determining a corresponding out-of-step value according to the difference value and determining the load condition of the corresponding stepping motor according to the size of the out-of-step value;
the response module is further configured to obtain a count value of the timer and compare the count value with a preset third threshold, where the preset third threshold is a count threshold of the timer determined according to the running speed of the stepping motor; when the count value of the timer is equal to the preset third threshold value, acquiring a corresponding encoder value and controlling the timer to respond to recounting; detecting the desynchronizing mark; when the step-out mark is detected, comparing the corresponding step-out value with a preset fourth threshold value, wherein the fourth threshold value represents the maximum step-out value in the step-out value range of the stepping motor; when the step-out value is smaller than the preset fourth threshold value, increasing the corresponding running current value and comparing the running current value with the preset current threshold value; when the running current value is larger than the preset current threshold value, controlling the stepping motor to run in a speed reduction mode based on the running speed; and when the running current value is less than or equal to the preset current threshold value, controlling the stepping motor to accelerate or run at a constant speed based on the running speed.
CN202210436584.1A 2022-04-25 2022-04-25 Stepping motor load judgment method and stepping motor closed-loop control system Active CN114649982B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210436584.1A CN114649982B (en) 2022-04-25 2022-04-25 Stepping motor load judgment method and stepping motor closed-loop control system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210436584.1A CN114649982B (en) 2022-04-25 2022-04-25 Stepping motor load judgment method and stepping motor closed-loop control system

Publications (2)

Publication Number Publication Date
CN114649982A CN114649982A (en) 2022-06-21
CN114649982B true CN114649982B (en) 2022-12-02

Family

ID=81996647

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210436584.1A Active CN114649982B (en) 2022-04-25 2022-04-25 Stepping motor load judgment method and stepping motor closed-loop control system

Country Status (1)

Country Link
CN (1) CN114649982B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007228787A (en) * 2006-01-25 2007-09-06 Brother Ind Ltd Motor control unit and sewing machine equipped with it
JP2007336640A (en) * 2006-06-13 2007-12-27 Melec:Cc Method and apparatus for detecting step-out of stepping motor
CN101938241A (en) * 2009-06-30 2011-01-05 河南中光学集团有限公司 Stepping motor control system and control method thereof
JP2012222917A (en) * 2011-04-07 2012-11-12 Ricoh Elemex Corp Stepping motor control device and stepping motor control method
CN104579056A (en) * 2014-12-19 2015-04-29 永州市亿达自动化机械有限公司 Method for compensating position error of stepper motor
CN106941332A (en) * 2016-12-20 2017-07-11 广西风华服饰有限责任公司 A kind of sewing machine method for controlling stepping motor and control system
CN108398916A (en) * 2017-02-08 2018-08-14 欧姆龙株式会社 Control system and pulse outputting unit
CN108631666A (en) * 2017-03-15 2018-10-09 杭州三花研究院有限公司 A kind of motor control method and motor control assembly

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007228787A (en) * 2006-01-25 2007-09-06 Brother Ind Ltd Motor control unit and sewing machine equipped with it
JP2007336640A (en) * 2006-06-13 2007-12-27 Melec:Cc Method and apparatus for detecting step-out of stepping motor
CN101938241A (en) * 2009-06-30 2011-01-05 河南中光学集团有限公司 Stepping motor control system and control method thereof
JP2012222917A (en) * 2011-04-07 2012-11-12 Ricoh Elemex Corp Stepping motor control device and stepping motor control method
CN104579056A (en) * 2014-12-19 2015-04-29 永州市亿达自动化机械有限公司 Method for compensating position error of stepper motor
CN106941332A (en) * 2016-12-20 2017-07-11 广西风华服饰有限责任公司 A kind of sewing machine method for controlling stepping motor and control system
CN108398916A (en) * 2017-02-08 2018-08-14 欧姆龙株式会社 Control system and pulse outputting unit
CN108631666A (en) * 2017-03-15 2018-10-09 杭州三花研究院有限公司 A kind of motor control method and motor control assembly

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
步进电机梯形加减速曲线规划控制实验***设计;冯涛 等;《煤矿机械》;20200731;第41卷(第7期);第23-25页 *

Also Published As

Publication number Publication date
CN114649982A (en) 2022-06-21

Similar Documents

Publication Publication Date Title
US7068191B2 (en) Method for determining the numerical value for the duration of a periodically repeated pulse signal, and device for carrying out said method
US8810187B2 (en) Method and apparatus for misstep detection and recovery in a stepper motor
WO2014019128A1 (en) Method for staring permanent magnet synchronous motor
CN114649982B (en) Stepping motor load judgment method and stepping motor closed-loop control system
WO2022267483A1 (en) Control method and apparatus for direct-current motor, and motor control system
JP6437633B2 (en) Motor driving method and apparatus, electronic device
CN100342640C (en) Motor control method and motor controller
CN115931036A (en) Magnetic encoder fault detection method and device, electronic equipment and storage medium
CN113783481B (en) Motor control method, device, system and storage medium
CN108599107A (en) A kind of and people co-melting robot motor rotation-clogging protection method
CN114123873A (en) Brushless motor controller and control system
CN109546901B (en) Phase changing method of brushless direct current motor
JPH09292264A (en) Absolute encoder
US10396697B2 (en) Motor operating systems and methods thereof
CN115001325B (en) Timed interrupt control method and multi-step motor synchronous control system and method
JP2014154043A (en) Electronic control device and information processor
CN112412636A (en) Method and system for controlling rotating speed of engine of engineering machinery based on stepping motor
CN110829911B (en) Driving method and driving equipment for stepping motor
CN110868109B (en) Motor control method and device, storage medium and robot thereof
CN114157211B (en) Real-time correction method and system for rotary zero position of driving motor for vehicle
CN117411389B (en) Overheat protection method for direct current motor and direct current motor
CN102199843B (en) Detection method for needle collision of flat knitting machine
US8866427B2 (en) Motor control apparatus and method
JP2000338534A (en) Pan tilt camera apparatus
JP2018026921A (en) Servo system

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