CN111628682B - Stepping motor synchronous driving method, stepping motor synchronous driving device, terminal and storage medium - Google Patents

Stepping motor synchronous driving method, stepping motor synchronous driving device, terminal and storage medium Download PDF

Info

Publication number
CN111628682B
CN111628682B CN202010447286.3A CN202010447286A CN111628682B CN 111628682 B CN111628682 B CN 111628682B CN 202010447286 A CN202010447286 A CN 202010447286A CN 111628682 B CN111628682 B CN 111628682B
Authority
CN
China
Prior art keywords
value
pulse signal
frequency compensation
determining
target
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
CN202010447286.3A
Other languages
Chinese (zh)
Other versions
CN111628682A (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.)
Shenzhen Zhaowei Machinery and Electronics Co Ltd
Original Assignee
Shenzhen Zhaowei Machinery and Electronics 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 Shenzhen Zhaowei Machinery and Electronics Co Ltd filed Critical Shenzhen Zhaowei Machinery and Electronics Co Ltd
Priority to CN202010447286.3A priority Critical patent/CN111628682B/en
Publication of CN111628682A publication Critical patent/CN111628682A/en
Application granted granted Critical
Publication of CN111628682B publication Critical patent/CN111628682B/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/40Special adaptations for controlling two or more stepping motors

Landscapes

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

Abstract

The application is applicable to the technical field of motor control, and provides a stepping motor synchronous driving method, a stepping motor synchronous driving device, a stepping motor synchronous driving terminal and a storage medium, wherein the stepping motor synchronous driving method comprises the following steps: acquiring a first rotating speed signal of a first motor and a second rotating speed signal of a second motor; determining a first pulse signal according to the first rotating speed signal, and determining a second pulse signal according to the second rotating speed signal; then determining a first target frequency compensation value according to the first pulse signal and a preset value, and determining a second target frequency compensation value according to the second pulse signal and the preset value; determining a first target pulse signal according to the first pulse signal and the first target frequency compensation value, and determining a second target pulse signal according to the second pulse signal and the second target frequency compensation value; and finally, driving the first motor according to the first target pulse signal, and driving the second motor according to the second target pulse signal, so as to realize the accurate control of the synchronous driving of the first motor and the second motor.

Description

Stepping motor synchronous driving method, stepping motor synchronous driving device, terminal and storage medium
Technical Field
The application belongs to the technical field of motor control, and particularly relates to a synchronous driving method and device for a stepping motor, a terminal and a storage medium.
Background
The stepping motor is an open-loop control element for converting an electric pulse signal into angular displacement or linear displacement, the rotating speed and the stopping position of the stepping motor only depend on the frequency and the pulse number of the pulse signal, and the angular displacement of the stepping motor can be controlled by controlling the number of pulses, so that the aim of accurate positioning is fulfilled; meanwhile, the rotating speed and the acceleration of the stepping motor can be controlled by controlling the pulse frequency, so that the purpose of speed regulation is achieved.
In industrial servo control, a dual-motor synchronous driving mode of a shafting is widely applied, and the mode has two advantages compared with a single-motor driving mode: 1) larger torque can be output to drag heavy loads; 2) the volume size of the equipment can be reduced, and the utilization rate of the space is improved.
At present, the synchronous drive control strategies of the double motors mainly include: a) parallel control, the system is equivalent to open-loop control, when a certain motor is disturbed in the running process, synchronous deviation is generated among the motors, and the synchronous performance is poor; b) the speed master-slave control, the disturbance on the slave motor can not be fed back to the main motor, and when the load changes, the synchronization precision between the motors can not be ensured.
As can be seen from the dual-motor control strategy, the existing dual-motor control system has the problem of low synchronous driving precision.
Disclosure of Invention
The embodiment of the application provides a synchronous driving method, a synchronous driving device, a synchronous driving terminal and a synchronous driving storage medium for a stepping motor, and can solve the problem of low synchronous driving precision of double motors.
In a first aspect, an embodiment of the present application provides a synchronous driving method for a stepping motor, including:
acquiring a first rotating speed signal of a first motor and a second rotating speed signal of a second motor;
determining a first pulse signal according to the first rotating speed signal, and determining a second pulse signal according to the second rotating speed signal;
determining a first target frequency compensation value and a second target frequency compensation value according to the first pulse signal, the second pulse signal and a preset value;
determining a first target pulse signal according to the first pulse signal and the first target frequency compensation value, and determining a second target pulse signal according to the second pulse signal and the second target frequency compensation value;
and driving the first motor according to the first target pulse signal, and driving the second motor according to the second target pulse signal.
In a possible implementation manner of the first aspect, the determining a first target frequency compensation value according to the first pulse signal and a preset value, and determining a second target frequency compensation value according to the second pulse signal and the preset value includes:
calculating the absolute value of the difference value between the frequency value of the first pulse signal and the frequency value of the second pulse signal to obtain a frequency absolute difference value;
comparing the absolute frequency difference value with the preset value, and determining a frequency compensation value according to a comparison result;
and comparing the frequency value of the first pulse signal with the frequency value of the second pulse signal, and determining the first target frequency compensation value and the second target frequency compensation value according to the comparison result and the frequency compensation value.
In a possible implementation manner of the first aspect, the preset value includes a first preset value and a second preset value, and the first preset value is smaller than the second preset value; the comparing the absolute frequency difference value with the preset value and determining a frequency compensation value according to a comparison result includes:
determining zero as the frequency compensation value when the absolute difference value of the frequencies is smaller than the first preset value;
determining the first preset value as the frequency compensation value under the condition that the absolute difference of the frequencies is greater than or equal to the first preset value and less than or equal to the second preset value;
and determining the second preset value as the frequency compensation value when the absolute difference value of the frequencies is larger than the second preset value.
In a possible implementation manner of the first aspect, the preset values further include a third preset value, and the third preset value is greater than the second preset value; the comparing the absolute frequency difference value with the preset value and determining a frequency compensation value according to the comparison result further comprises:
under the condition that the absolute difference value of the frequencies is larger than the third preset value, generating a first brake signal and a second brake signal;
the first brake signal is used for controlling the first motor to brake, and the second brake signal is used for controlling the second motor to brake.
In a possible implementation manner of the first aspect, the first target frequency compensation value and the second target frequency compensation value are opposite numbers; the comparing the frequency value of the first pulse signal with the frequency value of the second pulse signal and determining the first target frequency compensation value and the second target frequency compensation value according to the comparison result and the frequency compensation value includes:
determining an absolute value of the frequency compensation value as the second target frequency compensation value in a case where the frequency value of the first pulse signal is greater than the frequency value of the second pulse signal;
determining an absolute value of the frequency compensation value as the first target frequency compensation value in a case where the frequency value of the first pulse signal is less than the frequency value of the second pulse signal.
In one possible implementation manner of the first aspect, the frequency of the first target pulse signal is equal to the sum of the frequency of the first pulse signal and the first target frequency compensation value;
the frequency of the second target pulse signal is equal to the sum of the frequency of the second pulse signal and the second target frequency compensation value.
In one possible implementation manner of the first aspect, the method includes:
and acquiring the first rotating speed signal and the second rotating speed signal through light sensing or encoder acquisition.
In a second aspect, an embodiment of the present application provides a synchronous driving apparatus for a stepping motor, including:
the acquisition module is used for acquiring a first rotating speed signal of a first motor and a second rotating speed signal of a second motor;
the pulse signal determining module is used for determining a first pulse signal according to the first rotating speed signal and determining a second pulse signal according to the second rotating speed signal;
the target frequency compensation value determining module is used for determining a first target frequency compensation value according to the first pulse signal and a preset value and determining a second target frequency compensation value according to the second pulse signal and the preset value;
the target pulse signal determining module is used for determining a first target pulse signal according to the first pulse signal and the first target frequency compensation value and determining a second target pulse signal according to the second pulse signal and the second target frequency compensation value;
and the control module is used for driving the first motor according to the first target pulse signal and driving the second motor according to the second target pulse signal.
In a third aspect, an embodiment of the present application provides a terminal device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the method of any one of the above first aspects when executing the computer program.
In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements the method of any one of the above first aspects.
In a fifth aspect, the present application provides a computer program product, which when run on a terminal device, causes the terminal device to execute the method of any one of the above first aspects.
It is understood that the beneficial effects of the second aspect to the fifth aspect can be referred to the related description of the first aspect, and are not described herein again.
Compared with the prior art, the embodiment of the application has the advantages that:
the method comprises the steps of obtaining a first rotating speed signal of a first motor and a second rotating speed signal of a second motor; determining a first pulse signal according to the first rotating speed signal, and determining a second pulse signal according to the second rotating speed signal; then determining a first target frequency compensation value according to the first pulse signal and a preset value, and determining a second target frequency compensation value according to the second pulse signal and the preset value; determining a first target pulse signal according to the first pulse signal and the first target frequency compensation value, and determining a second target pulse signal according to the second pulse signal and the second target frequency compensation value; and finally, driving the first motor according to the first target pulse signal, and driving the second motor according to the second target pulse signal. When the first motor and the second motor are asynchronous, a first target frequency compensation value and a second target frequency compensation value are generated, a first target pulse signal is determined by the first pulse signal and the first target frequency compensation value, a second target pulse signal is determined by the second pulse signal and the second target frequency compensation value, then the first motor is driven according to the first target pulse signal, and the second motor is driven according to the second target pulse signal, so that the accurate control of the synchronous driving of the first motor and the second motor is realized.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a flowchart of a synchronous driving method for a stepping motor according to an embodiment of the present application;
fig. 2 is a flowchart of a synchronous driving method for a stepping motor according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a synchronous driving device of a stepping motor according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to" determining "or" in response to detecting ". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
At present, the synchronous drive control strategies of the double motors mainly include: a) parallel control, the system is equivalent to open-loop control, when a certain motor is disturbed in the running process, synchronous deviation is generated among the motors, and the synchronous performance is poor; b) the speed master-slave control, the disturbance on the slave motor can not be fed back to the main motor, and when the load changes, the synchronization precision between the motors can not be ensured.
As can be seen from the dual-motor control strategy, the existing dual-motor control system has the problem of low synchronous driving precision.
Based on the above problem, the embodiment of the present application discloses a synchronous driving method for a stepping motor, which includes obtaining a first rotation speed signal of a first motor and a second rotation speed signal of a second motor; determining a first pulse signal according to the first rotating speed signal, and determining a second pulse signal according to the second rotating speed signal; then determining a first target frequency compensation value according to the first pulse signal and a preset value, and determining a second target frequency compensation value according to the second pulse signal and the preset value; determining a first target pulse signal according to the first pulse signal and the first target frequency compensation value, and determining a second target pulse signal according to the second pulse signal and the second target frequency compensation value; and finally, driving the first motor according to the first target pulse signal, and driving the second motor according to the second target pulse signal. When the first motor and the second motor are asynchronous, a first target frequency compensation value and a second target frequency compensation value are generated, a first target pulse signal is determined by the first pulse signal and the first target frequency compensation value, a second target pulse signal is determined by the second pulse signal and the second target frequency compensation value, then the first motor is driven according to the first target pulse signal, and the second motor is driven according to the second target pulse signal, so that the accurate control of the synchronous driving of the first motor and the second motor is realized.
In order to explain the technical solution described in the present application, the following description will be given by way of specific examples.
Fig. 1 shows a flowchart of a synchronous driving method for a stepping motor provided in an embodiment of the present application, and by way of example and not limitation, the method may include the following steps:
s101, a first rotating speed signal of a first motor and a second rotating speed signal of a second motor are obtained.
Specifically, the rotation speeds of the first motor and the second motor may be tested by a testing device to obtain a first rotation speed signal and a second rotation speed signal, for example, the first rotation speed signal and the second rotation speed signal are acquired by a light sensor or an encoder.
S102, determining a first pulse signal according to the first rotating speed signal, and determining a second pulse signal according to the second rotating speed signal.
Specifically, as can be seen from the operating principle of the stepping motor, the frequency of the pulse signal determines the rotational speed of the stepping motor. The rotation speed (first rotation speed signal) of the first motor is obtained in step S101, and the first pulse signal can be obtained by calculation in combination with the technical parameters of the first motor; the rotation speed (second rotation speed signal) of the second motor is obtained in step S101, and the second pulse signal can be calculated by combining the technical parameters of the second motor.
S103, determining a first target frequency compensation value and a second target frequency compensation value according to the first pulse signal, the second pulse signal and a preset value.
For example, as shown in fig. 2, step S103 may specifically include:
and S1031, calculating an absolute value of a difference value between the frequency value of the first pulse signal and the frequency value of the second pulse signal to obtain a frequency absolute difference value.
Specifically, the frequency value of the first pulse signal and the frequency value of the second pulse signal are subtracted, and then an absolute value is obtained, and the obtained absolute frequency difference value can represent an error range of the first pulse signal and the second pulse signal, wherein the larger the absolute frequency difference value is, the larger the error range of the first pulse signal and the second pulse signal is, the larger the difference between the corresponding rotating speed of the first motor and the corresponding rotating speed of the second motor is; the smaller the absolute difference of the frequencies is, the smaller the error range of the first pulse signal and the second pulse signal is, and the smaller the difference between the rotating speed of the first motor and the rotating speed of the second motor is.
S1032, comparing the frequency absolute difference value with a preset value, and determining a frequency compensation value according to the comparison result.
Specifically, the absolute difference of the frequencies may reflect the error range of the first pulse signal and the second pulse signal, and further reflect the error range of the first motor speed and the second motor speed. The larger the absolute difference of the frequencies is, the larger the error range of the first pulse signal and the second pulse signal is, the larger the difference between the corresponding rotating speed of the first motor and the rotating speed of the second motor is, and the larger the required frequency compensation value is at the moment; the smaller the absolute difference of the frequencies is, the smaller the error range between the first pulse signal and the second pulse signal is, and the smaller the difference between the corresponding rotating speed of the first motor and the rotating speed of the second motor is, the smaller the frequency compensation value is required at this time.
For example, step S1032 may specifically include:
and A1, in the case that the absolute difference value of the frequency is smaller than the first preset value, determining zero as the frequency compensation value.
Specifically, the absolute difference of the frequencies is smaller than the first preset value, and the error at this time is determined to be within the range of the accuracy requirement, and at this time, frequency compensation is not needed, so that zero is determined as the frequency compensation value.
It should be noted that the first preset value is set according to the precision requirement of synchronous driving of the stepping motor, and when the precision requirement of synchronous rotation of the motor is higher, the first preset value is designed to be smaller; when the requirement on the synchronous rotation precision of the motor is lower, the first preset value is designed to be larger.
And B1, determining the first preset value as the frequency compensation value when the absolute difference of the frequencies is greater than or equal to the first preset value and less than or equal to the second preset value.
Specifically, when the absolute difference of the frequencies is greater than or equal to a first preset value and less than or equal to a second preset value, the error range of the first pulse signal and the second pulse signal is large, frequency compensation needs to be performed on the first pulse signal and the second pulse signal, the first preset value is determined as a frequency compensation value, and after the frequency compensation, the error of the first pulse signal and the second pulse signal meets the requirement.
And C1, determining the second preset value as the frequency compensation value under the condition that the absolute difference of the frequency is larger than the second preset value.
Specifically, the absolute difference of the frequencies is greater than a second preset value, the error range of the first pulse signal and the second pulse signal is large at this time, frequency compensation needs to be performed on the first pulse signal and the second pulse signal, the second preset value is determined as a frequency compensation value at this time, and after the frequency compensation is performed, the error of the first pulse signal and the error of the second pulse signal meet the requirement.
In an embodiment of the application, step S1032 may further include:
and D1, generating a first brake signal and a second brake signal under the condition that the absolute difference of the frequencies is larger than a third preset value.
Specifically, when the absolute difference of the frequencies is greater than a third preset value, the error range of the first pulse signal and the error range of the second pulse signal are too large, the difference between the rotating speeds of the first motor and the second motor is too large, potential safety hazards can be caused to other equipment, and the first braking signal and the second braking signal are generated to brake the first motor and the second motor respectively so as to protect other equipment from being damaged.
S1033, comparing the frequency value of the first pulse signal with the frequency value of the second pulse signal, and determining a first target frequency compensation value and a second target frequency compensation value according to the comparison result and the frequency compensation value.
Specifically, by comparing the frequency value of the first pulse signal with the frequency value of the second pulse signal, the frequency magnitude relationship between the first pulse signal and the second pulse signal can be obtained, and then a first target frequency compensation value and a second target frequency compensation value are determined in combination with the frequency compensation value, wherein the first target frequency compensation value is used for compensating the first pulse signal, and the second target frequency compensation value is used for compensating the second pulse signal.
Illustratively, step S1033 may specifically include:
a2, in the case where the frequency value of the first pulse signal is greater than the frequency value of the second pulse signal, determining the absolute value of the frequency compensation value as a second target frequency compensation value.
Specifically, the frequency value of the first pulse signal is greater than the frequency value of the second pulse signal, which indicates that the rotation speed of the first motor is greater than the rotation speed of the second motor. At this time, the absolute value of the frequency compensation value is determined as a second target frequency compensation value, and the first target frequency compensation value and the second target frequency compensation value are opposite numbers, so that the first target frequency compensation value is a negative value, and the frequency of the first pulse signal can be reduced; the second target frequency compensation value is a positive value, and the frequency of the second pulse signal can be increased.
B2, in case that the frequency value of the first pulse signal is smaller than the frequency value of the second pulse signal, determining the absolute value of the frequency compensation value as the first target frequency compensation value.
Specifically, the frequency value of the first pulse signal is smaller than the frequency value of the second pulse signal, which indicates that the rotation speed of the first motor is smaller than the rotation speed of the second motor. At this time, the absolute value of the frequency compensation value is determined as a first target frequency compensation value, and since the first target frequency compensation value and the second target frequency compensation value are opposite numbers, the first target frequency compensation value is a positive value, and the frequency of the first pulse signal can be increased; the second target frequency compensation value is a negative value, and the frequency of the second pulse signal can be reduced.
And S104, determining a first target pulse signal according to the first pulse signal and the first target frequency compensation value, and determining a second target pulse signal according to the second pulse signal and the second target frequency compensation value.
Specifically, the frequency of the first target pulse signal is equal to the sum of the frequency of the first pulse signal and the first target frequency compensation value, and the frequency of the second target pulse signal is equal to the sum of the frequency of the second pulse signal and the second target frequency compensation value.
And S105, driving the first motor according to the first target pulse signal, and driving the second motor according to the second target pulse signal.
Specifically, the first target pulse signal and the second target pulse signal determined in step S104 are compensated signals, and the first motor is driven according to the first target pulse signal and the second motor is driven according to the second target pulse signal, so that accurate synchronous rotation of the first motor and the second motor can be ensured.
To clearly illustrate the principle of the synchronous driving method of the stepping motor, a specific embodiment is described as an example, wherein the frequency of the first pulse signal is n1The frequency of the second pulse signal is n2The first preset value is 50, and the second preset value is 100.
(1) When | n1-n2When | < 50, the frequency error of the first pulse signal and the second pulse signal meets the requirement, and compensation is not needed, and the frequency compensation value n is used3=0。
(2) When the absolute value of n is more than or equal to 501-n2When | is less than or equal to 100, the frequency compensation value n3=50;
When n is1<n2At this time, the first target frequency compensation value n4=n350, second target frequency compensation value n5=-n4-50; the frequency of the first target pulse signal is N1=n1+n4=n1+50, the frequency of the second target pulse signal is N2=n2+n5=n2-50;
When n is1>n2At this time, the first target frequency compensation value n4=-n3-50, second target frequency compensation value n5=-n450; the frequency of the first target pulse signal is N1=n1+n4=n1-50, the frequency of the second target pulse signal being N2=n2+n5=n2+50。
(3) When 100 < | n1-n2When l, the frequency compensation value n is now3=100;
When n is1<n2At this time, the first target frequency compensation value n4=n3100, second target frequency compensation value n5=-n4-100; the frequency of the first target pulse signal is N1=n1+n4=n1+100, the frequency of the second target pulse signal is N2=n2+n5=n2-100;
When n is1>n2At this time, the first target frequency compensation value n4=-n3-100, second target frequency compensation value n5=-n4100; the frequency of the first target pulse signal is N1=n1+n4=n1100, the frequency of the second target pulse signal is N2=n2+n5=n2+100。
And respectively compensating the first pulse signal and the second pulse signal, determining a first target pulse signal and a second target pulse signal, enabling the frequency of the first target pulse signal and the frequency error of the second target pulse signal to meet requirements, and ensuring that the synchronous driving precision of the first motor and the second motor meets the requirements.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Fig. 3 shows a schematic structural diagram of a synchronous driving apparatus for a stepping motor according to an embodiment of the present application, where the synchronous driving apparatus for a stepping motor may include an obtaining module 31, a pulse signal determining module 32, a target frequency compensation value determining module 33, a target pulse signal determining module 34, and a control module 35;
the acquiring module 31 is configured to acquire a first rotation speed signal of a first motor and a second rotation speed signal of a second motor;
the pulse signal determining module 32 is configured to determine a first pulse signal according to the first rotation speed signal and determine a second pulse signal according to the second rotation speed signal;
a target frequency compensation value determining module 33, configured to determine a first target frequency compensation value according to the first pulse signal and a preset value, and determine a second target frequency compensation value according to the second pulse signal and the preset value;
a target pulse signal determination module 34, configured to determine a first target pulse signal according to the first pulse signal and the first target frequency compensation value, and determine a second target pulse signal according to the second pulse signal and the second target frequency compensation value;
and the control module 35 is configured to drive the first motor according to the first target pulse signal, and drive the second motor according to the second target pulse signal.
In one embodiment of the present application, the target frequency compensation value determining module 33 may include a calculating unit, a frequency compensation value determining unit, and a target frequency compensation value determining unit;
the calculating unit is used for calculating the absolute value of the difference value between the frequency value of the first pulse signal and the frequency value of the second pulse signal to obtain a frequency absolute difference value;
the frequency compensation value determining unit is used for comparing the frequency absolute difference value with the preset value and determining a frequency compensation value according to a comparison result;
and the target frequency compensation value determining unit is used for comparing the frequency value of the first pulse signal with the frequency value of the second pulse signal and determining the first target frequency compensation value and the second target frequency compensation value according to the comparison result and the frequency compensation value.
In an embodiment of the present application, the preset values include a first preset value and a second preset value, the first preset value is smaller than the second preset value, and the frequency compensation value determining unit may include a first frequency compensation value determining subunit, a second frequency compensation value determining subunit, and a third frequency compensation value determining subunit;
a first frequency compensation value determining subunit, configured to determine zero as the frequency compensation value when the absolute difference of the frequencies is smaller than the first preset value;
a second frequency compensation value determining subunit, configured to determine, when the absolute difference of the frequencies is greater than or equal to the first preset value and is less than or equal to the second preset value, the first preset value as the frequency compensation value;
and the third frequency compensation value determining subunit is configured to determine the second preset value as the frequency compensation value when the absolute frequency difference is greater than the second preset value.
In an embodiment of the present application, the preset values further include a third preset value, the third preset value is greater than the second preset value, and the frequency compensation value determining unit may further include a fourth frequency compensation value determining subunit;
the fourth frequency compensation value determining subunit is configured to generate a first brake signal and a second brake signal when the absolute difference of the frequencies is greater than the third preset value;
the first brake signal is used for controlling the first motor to brake, and the second brake signal is used for controlling the second motor to brake.
In an embodiment of the present application, the first target frequency compensation value and the second target frequency compensation value are opposite numbers, and the target frequency compensation value determining unit may include
A first target frequency compensation value determining subunit, configured to determine, as the second target frequency compensation value, an absolute value of the frequency compensation value when the frequency value of the first pulse signal is greater than the frequency value of the second pulse signal;
a second target frequency compensation value determining subunit configured to determine, as the first target frequency compensation value, an absolute value of the frequency compensation value in a case where the frequency value of the first pulse signal is smaller than the frequency value of the second pulse signal.
It should be noted that, for the information interaction, execution process, and other contents between the above-mentioned devices/units, the specific functions and technical effects thereof are based on the same concept as those of the embodiment of the method of the present application, and specific reference may be made to the part of the embodiment of the method, which is not described herein again.
In addition, the stepping motor synchronous driving apparatus shown in fig. 3 may be a software unit, a hardware unit, or a combination of software and hardware unit built in the existing terminal device, may be integrated into the terminal device as an independent pendant, or may exist as an independent terminal device.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
Fig. 4 is a schematic structural diagram of a terminal device according to an embodiment of the present application. As shown in fig. 4, the terminal device 4 of this embodiment may include: at least one processor 40 (only one processor 40 is shown in fig. 4), a memory 41, and a computer program 42 stored in the memory 41 and executable on the at least one processor 40, wherein the processor 40 executes the computer program 42 to implement the steps of any of the above-mentioned method embodiments, for example, the steps S101 to S105 in the embodiment shown in fig. 1. Alternatively, the processor 40, when executing the computer program 42, implements the functions of the modules/units in the above-described device embodiments, such as the functions of the modules 31 to 35 shown in fig. 3.
Illustratively, the computer program 42 may be partitioned into one or more modules/units that are stored in the memory 41 and executed by the processor 40 to implement the present invention. The one or more modules/units may be a series of instruction segments of the computer program 42 capable of performing specific functions, which are used to describe the execution process of the computer program 42 in the terminal device 4.
The terminal device 4 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The terminal device 4 may include, but is not limited to, a processor 40, a memory 41. Those skilled in the art will appreciate that fig. 4 is merely an example of the terminal device 4, and does not constitute a limitation of the terminal device 4, and may include more or less components than those shown, or combine some components, or different components, such as an input-output device, a network access device, and the like.
The Processor 40 may be a Central Processing Unit (CPU), and the Processor 40 may be other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 41 may in some embodiments be an internal storage unit of the terminal device 4, such as a hard disk or a memory of the terminal device 4. In other embodiments, the memory 41 may also be an external storage device of the terminal device 4, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like provided on the terminal device 4. Further, the memory 41 may also include both an internal storage unit and an external storage device of the terminal device 4. The memory 41 is used for storing an operating system, an application program, a Boot Loader (Boot Loader), data, and other programs, such as program codes of the computer program 42. The memory 41 may also be used to temporarily store data that has been output or is to be output.
The present application further provides a computer-readable storage medium, where a computer program 42 is stored, and when the computer program 42 is executed by the processor 40, the steps in the above-mentioned method embodiments may be implemented.
The embodiments of the present application provide a computer program product, which when running on a mobile terminal, enables the mobile terminal to implement the steps in the above method embodiments when executed.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. With this understanding, all or part of the processes in the methods of the embodiments described above can be implemented by the computer program 42 to instruct the relevant hardware, where the computer program 42 can be stored in a computer readable storage medium, and when the computer program 42 is executed by the processor 40, the steps of the methods of the embodiments described above can be implemented. Wherein the computer program 42 comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may include at least: any entity or apparatus capable of carrying computer program code to a terminal device, recording medium, computer Memory, Read-Only Memory (ROM), Random-Access Memory (RAM), electrical carrier wave signals, telecommunications signals, and software distribution medium. Such as a usb-disk, a removable hard disk, a magnetic or optical disk, etc. In certain jurisdictions, computer-readable media may not be an electrical carrier signal or a telecommunications signal in accordance with legislative and patent practice.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/network device and method may be implemented in other ways. For example, the above-described apparatus/network device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implementing, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (8)

1. A synchronous driving method of a stepping motor is characterized by comprising the following steps:
acquiring a first rotating speed signal of a first motor and a second rotating speed signal of a second motor;
determining a first pulse signal according to the first rotating speed signal, and determining a second pulse signal according to the second rotating speed signal;
determining a first target frequency compensation value and a second target frequency compensation value according to the first pulse signal, the second pulse signal and a preset value;
determining a first target pulse signal according to the first pulse signal and the first target frequency compensation value, and determining a second target pulse signal according to the second pulse signal and the second target frequency compensation value;
driving the first motor according to the first target pulse signal, and driving the second motor according to the second target pulse signal;
the determining a first target frequency compensation value and a second target frequency compensation value according to the first pulse signal, the second pulse signal and a preset value includes:
calculating the absolute value of the difference value between the frequency value of the first pulse signal and the frequency value of the second pulse signal to obtain a frequency absolute difference value;
comparing the absolute frequency difference value with the preset value, and determining a frequency compensation value according to a comparison result;
comparing the frequency value of the first pulse signal with the frequency value of the second pulse signal, and determining the first target frequency compensation value and the second target frequency compensation value according to the comparison result and the frequency compensation value;
the preset values comprise a first preset value and a second preset value, and the first preset value is smaller than the second preset value; the comparing the absolute frequency difference value with the preset value and determining a frequency compensation value according to a comparison result includes:
determining zero as the frequency compensation value when the absolute difference value of the frequencies is smaller than the first preset value;
determining the first preset value as the frequency compensation value under the condition that the absolute difference of the frequencies is greater than or equal to the first preset value and less than or equal to the second preset value;
and determining the second preset value as the frequency compensation value when the absolute difference value of the frequencies is larger than the second preset value.
2. The stepping motor synchronous driving method according to claim 1, wherein the preset values further include a third preset value, the third preset value being greater than the second preset value; the comparing the absolute frequency difference value with the preset value and determining a frequency compensation value according to the comparison result further comprises:
under the condition that the absolute difference value of the frequencies is larger than the third preset value, generating a first brake signal and a second brake signal;
the first brake signal is used for controlling the first motor to brake, and the second brake signal is used for controlling the second motor to brake.
3. The stepping motor synchronous driving method according to claim 1, wherein the first target frequency compensation value and the second target frequency compensation value are opposite numbers; the comparing the frequency value of the first pulse signal with the frequency value of the second pulse signal and determining the first target frequency compensation value and the second target frequency compensation value according to the comparison result and the frequency compensation value includes:
determining an absolute value of the frequency compensation value as the second target frequency compensation value in a case where the frequency value of the first pulse signal is greater than the frequency value of the second pulse signal;
determining an absolute value of the frequency compensation value as the first target frequency compensation value in a case where the frequency value of the first pulse signal is less than the frequency value of the second pulse signal.
4. The stepping motor synchronous driving method according to claim 1, wherein a frequency of the first target pulse signal is equal to a sum of the frequency of the first pulse signal and the first target frequency compensation value;
the frequency of the second target pulse signal is equal to the sum of the frequency of the second pulse signal and the second target frequency compensation value.
5. The stepping motor synchronous driving method according to claim 1, comprising:
and acquiring the first rotating speed signal and the second rotating speed signal through light sensing or encoder acquisition.
6. A synchronous drive device for a stepping motor, comprising:
the acquisition module is used for acquiring a first rotating speed signal of a first motor and a second rotating speed signal of a second motor;
the pulse signal determining module is used for determining a first pulse signal according to the first rotating speed signal and determining a second pulse signal according to the second rotating speed signal;
the target frequency compensation value determining module is used for determining a first target frequency compensation value and a second target frequency compensation value according to the first pulse signal, the second pulse signal and a preset value;
the target pulse signal determining module is used for determining a first target pulse signal according to the first pulse signal and the first target frequency compensation value and determining a second target pulse signal according to the second pulse signal and the second target frequency compensation value;
the control module is used for driving the first motor according to the first target pulse signal and driving the second motor according to the second target pulse signal;
the target frequency compensation value determining module comprises a calculating unit, a frequency compensation value determining unit and a target frequency compensation value determining unit;
the calculating unit is used for calculating the absolute value of the difference value between the frequency value of the first pulse signal and the frequency value of the second pulse signal to obtain a frequency absolute difference value;
the frequency compensation value determining unit is used for comparing the frequency absolute difference value with the preset value and determining a frequency compensation value according to a comparison result;
a target frequency compensation value determining unit, configured to compare a frequency value of the first pulse signal with a frequency value of the second pulse signal, and determine a first target frequency compensation value and a second target frequency compensation value according to a comparison result and the frequency compensation value;
the preset values comprise a first preset value and a second preset value, and the first preset value is smaller than the second preset value; the comparing the absolute frequency difference value with the preset value and determining a frequency compensation value according to a comparison result includes:
determining zero as the frequency compensation value when the absolute difference value of the frequencies is smaller than the first preset value;
determining the first preset value as the frequency compensation value under the condition that the absolute difference of the frequencies is greater than or equal to the first preset value and less than or equal to the second preset value;
and determining the second preset value as the frequency compensation value when the absolute difference value of the frequencies is larger than the second preset value.
7. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 1 to 5 when executing the computer program.
8. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 5.
CN202010447286.3A 2020-05-25 2020-05-25 Stepping motor synchronous driving method, stepping motor synchronous driving device, terminal and storage medium Active CN111628682B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010447286.3A CN111628682B (en) 2020-05-25 2020-05-25 Stepping motor synchronous driving method, stepping motor synchronous driving device, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010447286.3A CN111628682B (en) 2020-05-25 2020-05-25 Stepping motor synchronous driving method, stepping motor synchronous driving device, terminal and storage medium

Publications (2)

Publication Number Publication Date
CN111628682A CN111628682A (en) 2020-09-04
CN111628682B true CN111628682B (en) 2022-02-18

Family

ID=72260745

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010447286.3A Active CN111628682B (en) 2020-05-25 2020-05-25 Stepping motor synchronous driving method, stepping motor synchronous driving device, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN111628682B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117375462B (en) * 2023-12-07 2024-03-08 深圳市恒永达科技股份有限公司 Stepping motor calibration method, device, equipment and computer storage medium

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02159999A (en) * 1988-12-14 1990-06-20 Casio Comput Co Ltd Stepping motor driving circuit
JP2001231298A (en) * 2000-02-10 2001-08-24 Casio Comput Co Ltd Equipment and method for controlling stepping motor
JP4678434B2 (en) * 2008-12-08 2011-04-27 富士ゼロックス株式会社 Stepping motor control device and program
JP5156149B1 (en) * 2012-01-18 2013-03-06 三菱電機株式会社 Power converter
CN105141204B (en) * 2015-09-24 2017-07-11 大连理工大学 A kind of multi-motor control system based on LabVIEW
CN107370425B (en) * 2016-05-13 2019-12-03 深圳市智创电机有限公司 The control method and device of motor
JP7155653B2 (en) * 2018-06-22 2022-10-19 コニカミノルタ株式会社 Drive device, image forming device, and control program
CN111130405A (en) * 2019-12-27 2020-05-08 深圳市越疆科技有限公司 Motor control method and device and terminal equipment

Also Published As

Publication number Publication date
CN111628682A (en) 2020-09-04

Similar Documents

Publication Publication Date Title
CN110793553A (en) Zero point positioning method, system, servo motor and storage medium
CN107681933B (en) Control method and system for driving stepping motor
CN111376256A (en) Steering engine angle calibration method and system, robot and storage medium
CN112987812B (en) Torque control method and device, terminal equipment and storage medium
CN111628682B (en) Stepping motor synchronous driving method, stepping motor synchronous driving device, terminal and storage medium
CN111106780B (en) Motor control method and device, terminal equipment and storage medium
CN114260892B (en) Elastic joint moment control method and device, readable storage medium and robot
CN111380499B (en) Method and device for detecting rotation angle
CN112104292B (en) Motor control method, device, terminal equipment and storage medium
CN112720463A (en) Method and device for controlling robot and terminal equipment
CN109634273B (en) Following control method and device for movable equipment
CN111404429B (en) Vehicle, motor control method and device thereof and computer readable storage medium
CN114421840B (en) Control method and device for tower crane, controller, tower crane and storage medium
CN111185908A (en) Robot control method and device for recognizing friction force, robot and storage medium
CN114665749B (en) Motor high-precision subdivision control method, system, terminal equipment and storage medium
CN107544573B (en) Control method and system for driving stepping motor
CN112054741B (en) Motor control method and device, terminal equipment and storage medium
CN114977941B (en) Inertia identification method, device and medium for alternating current servo system
US20210046647A1 (en) Position control method for servo, computer readable storage medium, and robot
CN114280928B (en) Method, device, terminal equipment and storage medium for controlling movement of object
CN112067218B (en) Method, device and equipment for realizing optical anti-shake vibration generator
CN111669104B (en) Motor driving method, device, terminal and storage medium
CN112556739B (en) Absolute position reference point calibration method and device of rotary encoder
CN117674660B (en) Second-order rapid discretization method for full-order observer of induction motor
CN118353335A (en) Method and device for evaluating torque performance of motor, electronic equipment and storage medium

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