CN114676389A - Motor control method, motor control device, computer equipment and storage medium - Google Patents

Motor control method, motor control device, computer equipment and storage medium Download PDF

Info

Publication number
CN114676389A
CN114676389A CN202210342575.6A CN202210342575A CN114676389A CN 114676389 A CN114676389 A CN 114676389A CN 202210342575 A CN202210342575 A CN 202210342575A CN 114676389 A CN114676389 A CN 114676389A
Authority
CN
China
Prior art keywords
movement
motion
distance
parameter information
interval
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.)
Granted
Application number
CN202210342575.6A
Other languages
Chinese (zh)
Other versions
CN114676389B (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 Dazu Robot Co ltd
Original Assignee
Shenzhen Dazu Robot 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 Dazu Robot Co ltd filed Critical Shenzhen Dazu Robot Co ltd
Priority to CN202210342575.6A priority Critical patent/CN114676389B/en
Publication of CN114676389A publication Critical patent/CN114676389A/en
Application granted granted Critical
Publication of CN114676389B publication Critical patent/CN114676389B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/18Complex mathematical operations for evaluating statistical data, e.g. average values, frequency distributions, probability functions, regression analysis
    • 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
    • H02P29/00Arrangements for regulating or controlling electric motors, appropriate for both AC and DC motors
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/60Other road transportation technologies with climate change mitigation effect
    • Y02T10/72Electric energy management in electromobility

Abstract

The application relates to a motor control method, a motor control device and computer equipment. The method comprises the following steps: acquiring the total movement distance of the motor and interval speed parameter information of each movement state interval identification, and calculating to obtain movement parameter information corresponding to each movement state interval identification by using a preset incidence relation among the movement distance, the speed parameter information and the movement parameter information; respectively establishing target association relations between interval movement routes and time based on the movement parameter information, and acquiring movement time points of interval identifiers of all movement states; calculating the target movement distance of the movement time point of each movement state interval identification by using the movement time point based on the target association relation; and controlling the motor based on the target movement distance of the movement time point identified by each movement state interval so that the motor moves according to the target movement distance of the movement time point identified by each movement state interval and reaches the total distance. By adopting the method, the control efficiency of the motor can be improved.

Description

Motor control method, motor control device, computer equipment and storage medium
Technical Field
The present application relates to the field of motor motion technologies, and in particular, to a method, an apparatus, a computer device, a storage medium, and a computer program product for controlling a motor.
Background
With the development of industrialization, the use of machines in different industries is more and more important, and the operation of the machines can not be powered by the motor, so that the operation of the machines can be controlled according to the motion track of the motor. For example, the angle through which the stepper motor is rotated is controlled by varying a given number of pulses. The existing motor motion control method comprises a trapezoidal curve algorithm and an S-shaped curve algorithm, but the speed of the existing trapezoidal curve is in a linear ascending and descending rule in the acceleration and deceleration processes, the speed change rule of the motor is not completely met, and the motor is damaged due to overshoot. The S-shaped curve algorithm has more segments for the motor motion process, the realization of a computer program is complex, the time consumption for calculating the distance of the motor is too long, more calculation force resources are consumed, and the problem of low motor control efficiency is caused.
Disclosure of Invention
In view of the above, it is necessary to provide a motor control method, a motor control apparatus, a computer device, a computer readable storage medium, and a computer program product, which can save computational resources and improve motor control efficiency.
In a first aspect, the present application provides a motor control method. The method comprises the following steps:
acquiring the total movement distance of the motor and interval speed parameter information corresponding to each movement state interval identification;
calculating motion parameter information by using the total motion distance and the interval speed parameter information based on the preset incidence relation among the motion distance, the speed parameter information and the motion parameter information to obtain the motion parameter information corresponding to each motion state interval identification;
respectively establishing a target association relation between the interval movement distance and time based on the movement parameter information corresponding to each movement state interval identification, and acquiring each movement time point corresponding to each movement state interval identification in the movement parameter information;
calculating the movement distance by using each movement time point based on the target association relation to obtain the target movement distance of each movement time point corresponding to each movement state interval identifier;
and controlling the motor based on the target movement distance of each movement time point corresponding to each movement state interval mark, so that the motor moves according to the target movement distance of each movement time point corresponding to each movement state interval mark and reaches the total distance.
In a second aspect, the present application further provides a motor control apparatus. The device comprises:
and the acquisition module is used for acquiring the total movement distance of the motor and interval speed parameter information corresponding to each movement state interval identification.
And the parameter calculation module is used for calculating the motion parameter information by using the total motion distance and the interval speed parameter information based on the preset association relationship among the motion distance, the speed parameter information and the motion parameter information to obtain the motion parameter information corresponding to each motion state interval identifier.
And the association relation module is used for respectively establishing a target association relation between the interval movement distance and the time based on the movement parameter information corresponding to each movement state interval identification, and acquiring each movement time point corresponding to each movement state interval identification in the movement parameter information.
And the path calculation module is used for calculating the movement path by using each movement time point based on the target association relation to obtain the target movement path of each movement time point corresponding to each movement state interval identifier.
And the control module is used for controlling the motor based on the target movement distance of each movement time point corresponding to each movement state interval mark so that the motor moves according to the target movement distance of each movement time point corresponding to each movement state interval mark and reaches the total distance.
In a third aspect, the present application also provides a computer device. The computer device comprises a memory storing a computer program and a processor implementing the following steps when executing the computer program:
acquiring the total movement distance of the motor and interval speed parameter information corresponding to each movement state interval identification; calculating motion parameter information by using the total motion distance and interval speed parameter information based on the preset association relationship among the motion distance, the speed parameter information and the motion parameter information to obtain motion parameter information corresponding to each motion state interval identifier;
respectively establishing a target association relation between the interval movement distance and time based on the movement parameter information corresponding to each movement state interval identification, and acquiring each movement time point corresponding to each movement state interval identification in the movement parameter information;
calculating the movement distance by using each movement time point based on the target association relation to obtain the target movement distance of each movement time point corresponding to each movement state interval mark;
and controlling the motor based on the target movement distance of each movement time point corresponding to each movement state interval mark, so that the motor moves according to the target movement distance of each movement time point corresponding to each movement state interval mark and reaches the total distance.
In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of:
acquiring the total movement distance of the motor and interval speed parameter information corresponding to each movement state interval identification; calculating motion parameter information by using the total motion distance and the interval speed parameter information based on the preset incidence relation among the motion distance, the speed parameter information and the motion parameter information to obtain the motion parameter information corresponding to each motion state interval identification;
respectively establishing a target association relation between the interval movement distance and time based on the movement parameter information corresponding to each movement state interval identification, and acquiring each movement time point corresponding to each movement state interval identification in the movement parameter information;
calculating the movement distance by using each movement time point based on the target association relation to obtain the target movement distance of each movement time point corresponding to each movement state interval mark;
and controlling the motor based on the target movement distance of each movement time point corresponding to each movement state interval mark, so that the motor moves according to the target movement distance of each movement time point corresponding to each movement state interval mark and reaches the total distance.
In a fifth aspect, the present application further provides a computer program product. The computer program product comprising a computer program which when executed by a processor performs the steps of:
acquiring the total movement distance of the motor and interval speed parameter information corresponding to each movement state interval identification; calculating motion parameter information by using the total motion distance and the interval speed parameter information based on the preset incidence relation among the motion distance, the speed parameter information and the motion parameter information to obtain the motion parameter information corresponding to each motion state interval identification;
respectively establishing a target association relation between the interval movement distance and time based on the movement parameter information corresponding to each movement state interval identification, and acquiring each movement time point corresponding to each movement state interval identification in the movement parameter information;
calculating the movement distance by using each movement time point based on the target association relation to obtain the target movement distance of each movement time point corresponding to each movement state interval mark;
and controlling the motor based on the target movement distance of each movement time point corresponding to each movement state interval mark, so that the motor moves according to the target movement distance of each movement time point corresponding to each movement state interval mark and reaches the total distance.
According to the motor control method, the motor control device, the computer equipment, the storage medium and the computer program product, the target motion distance of each motion time point corresponding to each motion state interval mark can be obtained by using the preset association relationship among the motion distance, the speed parameter information and the motion parameter information and the target association relationship among the interval motion distance and the interval time and using the total motion distance and the interval speed parameter information to carry out motion parameter information calculation and motion distance calculation, so that the motor moves according to the target motion distance of each motion time point corresponding to each motion state interval mark and reaches the total distance. The computational power resource is saved, and the motor can move according to the calculated target movement distance, so that the motor control efficiency is improved.
Drawings
FIG. 1 is a diagram of an exemplary motor control method;
FIG. 2 is a schematic flow chart of a motor control method according to one embodiment;
FIG. 3 is a flow diagram illustrating a process for calculating athletic parameter information, according to one embodiment;
FIG. 4 is a schematic diagram of a process for calculating a start-stop time of a sport in one embodiment;
FIG. 5a is a schematic diagram of a motor motion acceleration curve in one embodiment;
FIG. 5b is a schematic diagram of a motor speed profile for one embodiment;
FIG. 6 is a schematic diagram of a motor motion profile in one embodiment;
FIG. 7 is a schematic flow chart of a process for calculating a 3-th order spline interpolation function in an embodiment;
FIG. 8 is a block diagram showing the structure of a motor control device according to an embodiment;
FIG. 9 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The motor control method provided by the embodiment of the application can be applied to the application environment shown in fig. 1. Wherein the terminal 102 communicates with and controls the motor. The terminal 102 may receive the total movement distance of the motor and the interval speed parameter information corresponding to each movement state interval identifier, which are input by the user. The terminal 102 acquires a preset association relation among the movement distance, the speed parameter information and the movement parameter information, and the terminal 102 calculates the movement parameter information by using the total movement distance and the interval speed parameter information based on the preset association relation among the movement distance, the speed parameter information and the movement parameter information to obtain the movement parameter information corresponding to each movement state interval identification; the terminal 102 establishes a target association relationship between the interval movement distance and the time respectively based on the movement parameter information corresponding to each movement state interval identification, and acquires each movement time point corresponding to each movement state interval identification in the movement parameter information; the terminal 102 calculates the movement distance by using each movement time point based on the target association relation to obtain the target movement distance of each movement time point corresponding to each movement state interval identifier; the terminal 102 controls the motor based on the target movement distance of each movement time point corresponding to each movement state interval identifier, so that the motor moves according to the target movement distance of each movement time point corresponding to each movement state interval identifier and reaches the total distance. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, internet of things devices and portable wearable devices, and the internet of things devices may be smart speakers, smart televisions, smart air conditioners, smart car-mounted devices, and the like. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, and the like.
In one embodiment, as shown in fig. 2, a motor control method is provided, which is described by taking the application of the method to the server in fig. 1 as an example, and includes the following steps:
step 202, acquiring the total movement distance of the motor and interval speed parameter information corresponding to each movement state interval identification.
And 204, calculating the motion parameter information by using the total motion distance and the interval speed parameter information based on the preset association relationship among the motion distance, the speed parameter information and the motion parameter information to obtain the motion parameter information corresponding to each motion state interval identifier.
The total movement distance refers to a preset distance that the motor needs to move, the total movement distance includes a distance corresponding to the movement state interval identified by each movement state interval, and the motor moves according to a certain movement state change rule to reach the total movement distance. The motion state interval identifier refers to identification information corresponding to each motion state interval. The interval speed parameter is speed information of a motor motion state corresponding to each motion state interval and is used for representing a speed parameter of motor speed change. The incidence relation refers to an incidence relation established by different parameters according to a physical rule, and the incidence relation can be a relational expression. The preset association relationship refers to a preset association relationship for calculating the motion parameter information, and may be one or more. The motion parameter information refers to data information indicating the motion state of the motor in the motion process of the motor, and the motion parameter information comprises parameter information such as the motion time, the motion speed and the motion distance of the motor.
Specifically, the terminal can receive the total movement distance of the motor and the interval speed parameter information corresponding to each movement state interval identification, which are input by a user, and after the terminal acquires the total movement distance of the motor and the interval speed parameter information corresponding to each movement state interval identification, the preset association relationship among the movement distance, the speed parameter information and the movement parameter information is acquired from the data storage system through the server. The preset incidence relation among the movement distance, the speed parameter information and the movement parameter information can be that a user stores the preset incidence relation in a database storage system of a server in advance, so that the terminal can directly call the preset incidence relation through the server when detecting data input by the user. The preset incidence relation among the movement distance, the speed parameter information and the movement parameter information can also be stored in a local storage space in advance, and the preset incidence relation is directly obtained from the local storage space when the device is used. The preset incidence relation among the movement distance, the speed parameter information and the movement parameter information can be a relational expression among the movement distance, the speed parameter information and the movement parameter information, and the terminal calculates the movement parameter information of the total movement distance and the interval speed parameter information according to the relational expression to obtain the movement parameter information corresponding to each movement state interval identification.
And step 206, respectively establishing a target association relation between the interval movement distance and the time based on the movement parameter information corresponding to each movement state interval identification, and acquiring each movement time point corresponding to each movement state interval identification in the movement parameter information.
The interval movement distance refers to a specific movement distance of the motor in the movement state interval. The target association relationship between the interval movement distance and the time refers to an association relationship established by the interval movement distance and the time according to a physical rule, and is used for calculating the interval movement distance corresponding to each movement state interval identifier of the motor, wherein different movement state interval identifiers correspond to different target association relationships, and can be a relational expression of the interval distance and the time. The movement time point refers to the current time point to which the motor moves in the corresponding journey of each movement state interval.
Specifically, the terminal takes the motion parameter information corresponding to each motion state interval identifier as a coefficient corresponding to a relational expression of the known parameter calculation interval distance and time, and then the terminal establishes the relational expression of the interval distance and time corresponding to each motion state interval identifier through the calculated coefficient. The terminal can associate the relational expression of the interval distance and the time with the corresponding motion state interval identification. And then the terminal can store the relational expression of the interval routes and the time corresponding to each motion state interval identification to the local, and can directly call the interval routes and the time according to the motion state interval identifications in subsequent calculation. Then, the terminal can obtain the motion time corresponding to each motion state interval identifier in the motion parameter information and determine each motion time point corresponding to each motion state interval identifier.
And step 208, calculating the movement distance by using each movement time point based on the target association relation, and obtaining the target movement distance of each movement time point corresponding to each movement state interval identifier.
The target movement distance refers to a target position to which the motor should move at a certain time point.
Specifically, the terminal may obtain a target association relationship between the corresponding interval route and time according to the motion state interval identifier, and perform motion route calculation using the target association relationship between the interval route and time according to each motion time point corresponding to each motion state interval identifier, to obtain a target motion route corresponding to each time point in the motion time period corresponding to each motion state interval identifier.
And step 210, controlling the motor based on the target movement distance of each movement time point corresponding to each movement state interval mark, so that the motor moves according to the target movement distance of each movement time point corresponding to each movement state interval mark and reaches the total distance.
Specifically, the terminal sends a target movement path command to the motor according to the target movement path of each movement time point corresponding to each movement state interval identifier, so that the motor moves to the corresponding target movement path at each time point until the motor moves to the total path.
In the motor control method, the preset incidence relation among the movement distance, the speed parameter information and the movement parameter information and the target incidence relation among the interval movement distance and the interval movement time are used. And the target movement distance of each movement time point corresponding to each movement state interval mark can be obtained by calculating the movement parameter information and the movement distance by using the total movement distance and the interval speed parameter information, so that the motor moves according to the target movement distance of each movement time point corresponding to each movement state interval mark and reaches the total distance. The computing power resource is saved, the motor can move according to the calculated target movement distance and reach the total movement distance, and therefore the motor control efficiency and the user experience are improved.
In one embodiment, as shown in fig. 3, a flow diagram for calculating motion parameter information is provided; the speed parameter information comprises motion jerk; the motion parameter information comprises motion starting and stopping time, motion starting and stopping distance and motion starting and stopping speed; step 204, calculating motion parameter information by using the total motion distance and the interval speed parameter information based on the preset association relationship among the motion distance, the speed parameter information and the motion parameter information to obtain motion parameter information corresponding to each motion state interval identifier, including:
and step 302, calculating the movement time corresponding to each movement state interval identifier by using a preset first association relation among the total movement distance, the movement jerk and the time to obtain the movement start-stop time corresponding to each movement state interval identifier.
The preset first incidence relation refers to a relational expression which calculates the motion time corresponding to each motion state interval by using the total motion distance and the motion jerk which are calculated in advance. The preset first association relation comprises a motion time calculation formula corresponding to each motion state interval. The motion starting and stopping time refers to the starting time and the ending time of the motion of the motor in each motion state interval. The motion jerk is used for representing the change rate of the motor acceleration, and the motion jerk corresponding to each motion state interval is always larger than zero.
Specifically, the terminal may obtain the first preset association relationship from the database storage system through the server, or the terminal may locally obtain the first preset association relationship. And the terminal determines a corresponding movement time calculation formula from the first preset association relation according to the movement state interval identification, and then calculates according to the calculation rule of the movement time calculation formula by using the total distance data and the movement acceleration to obtain the movement time corresponding to each movement state interval identification. The motion time corresponding to each motion state interval mark is continuous, that is, the end time corresponding to the current motion state interval mark is the start time corresponding to the next motion state interval mark. The movement end time of the movement time corresponding to each movement state interval identifier may be a time period calculated from the 0 th second, for example, if the end time T1 corresponding to the first movement state identifier is 2s, the start time corresponding to the first movement state identifier is 0s, and the movement time is 2 s; if the end time T2 corresponding to the second motion state flag is 5 seconds, the start time corresponding to the second motion state flag is 2s, and the motion time is 3 s.
In a specific embodiment, the total movement distance includes movement state intervals corresponding to four movement state identifiers, and the preset first association relationship among the total movement distance, the movement jerk and the time includes movement time calculation formulas corresponding to the four movement state intervals; the motion time calculation formula corresponding to the first motion state interval is shown as formula (1):
Figure BDA0003579875990000091
Figure BDA0003579875990000092
wherein, T1 represents the end time corresponding to the first motion state interval; s represents the total motion range, J1 represents the motion jerk corresponding to the first motion state segment, J2 represents the motion jerk corresponding to the second motion state segment, J3 represents the motion jerk corresponding to the third motion state segment, and J4 represents the motion jerk corresponding to the fourth motion state segment.
The terminal can directly use the motion jerk and the total motion distance corresponding to each motion state interval to calculate according to the formula (1), and the end time corresponding to the first motion state interval is T1, the start time corresponding to the first motion state interval is 0, and the motion time is T1-0.
The motion time calculation formula corresponding to the second motion state interval is shown as formula (2):
Figure BDA0003579875990000093
t2 represents the end time corresponding to the second motion state interval. The terminal may calculate an ending time T2 corresponding to the second moving state section using T1, J1 and J2 according to equation (2) after calculating the ending time T1 corresponding to the first moving state section, and the starting time corresponding to the second moving state section is T1 and the moving time is T2-T1.
The motion time calculation formula corresponding to the third motion state interval is shown in formula (3):
Figure BDA0003579875990000094
t3 represents the end time corresponding to the third motion state interval. The terminal may use T1, J1, J2, J3, and J4 to calculate according to equation (3) to obtain the end time T3 corresponding to the third motion state interval, and the start time corresponding to the third motion state interval is T2 and the motion time is T3-T2.
The motion time calculation formula corresponding to the fourth motion state interval can also be shown as formula (4):
Figure BDA0003579875990000101
t4 represents the end time corresponding to the fourth motion state interval. The terminal may use T1, J1, J2, J3, and J4 to calculate according to equation (4) to obtain the end time T4 corresponding to the fourth movement state interval, and the start time corresponding to the fourth movement state interval is T3 and the movement time is T4-T3.
The motion time calculation formula corresponding to the third motion state interval may also be as shown in formula (5):
Figure BDA0003579875990000102
after the end time T4 corresponding to the fourth movement state section is obtained, the terminal may use T4, J3, and J4 to calculate according to equation (5) to obtain the end time T3 corresponding to the third movement state section.
And step 304, respectively calculating the interval movement distance corresponding to each movement state interval identification by using the preset second association relation among the movement jerk, the movement starting and stopping time and the interval movement distance to obtain the movement starting and stopping distance corresponding to each movement state interval identification.
The interval movement distance refers to the movement distance of the motor in each movement state interval. The preset first incidence relation refers to a pre-calculated relational expression for calculating the motion distance corresponding to each motion state interval by using the motion jerk and the motion start-stop time. The preset second association relation comprises a motion path calculation formula corresponding to each motion state interval. The movement starting and stopping distance refers to a starting distance corresponding to the starting time and an ending distance corresponding to the ending time of the motor in each movement state interval.
Specifically, after the terminal calculates the movement time corresponding to each movement state identifier, the terminal may obtain the second preset association relationship from the database storage system through the server, or the terminal may obtain the second preset association relationship locally. And the terminal determines a corresponding movement path calculation formula from the second preset association relation according to the movement state interval identification, and then the terminal respectively calculates the movement starting and stopping time and the movement accelerated speed corresponding to each movement state identification according to the calculation rule of the movement path calculation formula to obtain the movement starting and stopping path corresponding to the movement starting and stopping time corresponding to each movement state interval identification. The end course of the respective movement state interval identification corresponding interval movement courses may be a course calculated from the distance 0. And the ending route corresponding to the current motion state interval identification is the starting route corresponding to the next motion state interval identification.
In a specific embodiment, the total movement distance includes movement state intervals corresponding to four movement state interval identifiers, and the preset second association relationship between the movement jerk, the movement start-stop time and the interval movement distance includes a relational expression between the movement jerk, the movement start-stop time and the interval movement distance corresponding to each movement state interval identifier;
the motion path calculation formula corresponding to the end time T1 of the motor in the first motion state interval is shown in formula (6):
Figure BDA0003579875990000111
the terminal uses J1 and T1 to calculate according to equation (6), and obtains a movement distance s (T1) corresponding to the end time in the first movement state interval, and the movement distance corresponding to the start time in the first movement state interval is 0.
The motion path calculation formula corresponding to the end time T2 of the motor in the second motion state interval is shown in formula (7):
Figure BDA0003579875990000112
the terminal performs calculation according to formula (7) using J1, J2, T1, and T2, and obtains a movement distance s (T2) corresponding to the end time in the second movement state interval, and a movement distance s (T1) corresponding to the start time in the second movement state interval.
The equation for calculating the motion distance corresponding to the end time T3 of the motor in the third motion state interval is shown in equation (8):
Figure BDA0003579875990000113
the terminal uses J1, J2, J3, T1, T2 and T3 to calculate according to the formula (8), and obtains a motion distance s (T3) corresponding to the end time in the third motion state interval, and the motion distance s (T2) corresponding to the start time in the third motion state interval.
The motion path calculation formula corresponding to the end time T4 of the motor in the fourth motion state interval is shown as formula (9):
Figure BDA0003579875990000121
the terminal uses J1, J2, J3, J4, T1, T2, T3 and T4 to calculate according to the formula (9), and obtains a motion distance s (T4) corresponding to the end time in the fourth motion state interval, and the motion distance s (T3) corresponding to the start time in the fourth motion state interval.
And step 306, calculating the movement speed corresponding to each movement state interval identifier by using a preset third correlation of the movement jerk, the movement start-stop time and the movement speed to obtain the movement start-stop speed corresponding to each movement state interval identifier.
The preset third correlation is a pre-calculated relational expression for calculating the motion speed corresponding to each motion state interval by using the motion jerk and the motion start-stop time. The preset third correlation includes a motion speed calculation formula corresponding to each motion state interval. The motion starting and stopping speed refers to a starting speed corresponding to the starting time and an ending speed corresponding to the ending time of the motion of the motor in each motion state interval.
Specifically, the terminal may obtain the second preset association relationship from the database storage system through the server, or the terminal may locally obtain the second preset association relationship. And the terminal determines a corresponding motion speed calculation formula from the third preset association relation according to the motion state interval identification, and then the terminal respectively calculates the motion starting and stopping time and the motion jerk corresponding to each motion state identification according to the calculation rule of the motion speed calculation formula to obtain the motion starting and stopping speed corresponding to the motion starting and stopping time corresponding to each motion state interval identification.
In a specific embodiment, the total movement distance includes movement state intervals corresponding to four movement state interval identifiers, and the preset second association relationship between the movement jerk, the movement start-stop time and the interval movement distance includes a relational expression between the movement jerk, the movement start-stop time and the interval movement speed corresponding to each movement state interval identifier;
the calculation formula of the motion speed corresponding to the end time T1 of the motor in the first motion state interval is shown in formula (10):
Figure BDA0003579875990000131
the terminal calculates according to the formula (10) using J1 and T1, and obtains a moving speed v (T1) corresponding to the end time in the first moving state interval, and a moving speed corresponding to the start time in the first moving state interval is 0.
The calculation formula of the movement speed corresponding to the end time T2 of the motor in the second movement state interval is shown as formula (11):
Figure BDA0003579875990000132
the terminal performs calculation according to equation (11) using J1, J2, T1, and T2, and obtains a moving speed v (T2) corresponding to the end time in the second moving state interval, and a moving speed v (T1) corresponding to the start time in the second moving state interval.
The motion speed calculation formula corresponding to the end time T3 of the motor in the third motion state interval is shown in formula (12):
Figure BDA0003579875990000133
the terminal calculates according to formula (12) using J1, J2, J3, T1, T2, and T3, and obtains a moving speed v (T3) corresponding to the end time in the third moving state interval, and a moving speed v (T2) corresponding to the start time in the third moving state interval.
The motion speed calculation formula corresponding to the end time T4 of the motor in the fourth motion state interval is shown in formula (13):
Figure BDA0003579875990000134
the terminal calculates according to formula (13) using J1, J2, J3, J4, T1, T2, T3, and T4, to obtain a moving speed v (T4) corresponding to the end time in the fourth moving state interval, and a moving speed v (T3) corresponding to the start time in the fourth moving state interval.
In this embodiment, the terminal may directly use the relevant association relationship for calculation when calculating the motion parameter information through the pre-calculated preset first association relationship, the pre-calculated preset second association relationship, and the pre-calculated preset third association relationship, so that computational resources are saved, and the motor control efficiency is improved.
In one embodiment, as shown in FIG. 4, a flow chart for calculating a start-stop time of a sport is provided; step 302, calculating the motion time corresponding to each motion state interval identifier by using a preset first association relation among the total motion distance, the motion jerk and the time, to obtain the motion start-stop time corresponding to each motion state interval identifier, including:
step 402, acquiring preset constraint parameter information, and acquiring constraint association relation between the preset constraint parameter information and motion jerk and time based on the preset constraint parameter information;
step 404, generating a preset first association relationship among the total movement distance, the movement jerk and the time according to the preset constraint parameter information and the constraint association relationship;
and 406, calculating the motion time corresponding to each motion state interval identifier by using a preset first association relation to obtain the motion start-stop time corresponding to each motion state interval identifier.
The constraint parameter information refers to known parameter information which is in accordance with an objective physical law and exists in the motion process of the motor, and the known parameter information comprises acceleration parameter information, speed parameter information, distance parameter information and the like and is used for calculating the motion starting and stopping time. For example, the object stops after moving to a preset distance, and the speed and the acceleration of the object are zero. The constraint incidence relation refers to a relational expression of preset constraint parameter information, motion jerk and time.
Specifically, the terminal acquires preset constraint parameter information, and the terminal respectively acquires relational expressions with motion jerk and time according to acceleration parameter information, speed parameter information and distance parameter information in the preset constraint parameter information, and indicates that corresponding constraint parameter information can be obtained by performing specific calculation on the motion jerk and the time. And then the terminal acquires known parameters corresponding to the speed parameter information, the speed parameter information and the route parameter information in the preset constraint parameter information, and performs reverse operation on the corresponding relational expressions of the preset constraint parameter information, the motion jerk and the time according to the known parameters corresponding to the speed parameter information, the speed parameter information and the route parameter information to obtain the relational expressions of the motion time, the total motion route and the motion jerk corresponding to each motion state interval identifier. And calculating the motion time through a relational expression of the motion time corresponding to each motion state interval identifier, the total motion distance and the motion jerk to obtain the motion starting and stopping time corresponding to each motion state interval identifier.
In the embodiment, the relational expression of the time, the total movement distance and the movement jerk can be obtained through the known parameters and the obtained constraint association relation, and the movement time is calculated according to the relational expression of the movement time, the total movement distance and the movement jerk to obtain the movement starting and stopping time corresponding to each movement state interval mark, so that the calculation force resource for calculating the movement starting and stopping time is saved, and the efficiency of motor control is improved.
In one embodiment, each motion state interval identifier comprises an acceleration interval identifier, a deceleration interval identifier, an acceleration/deceleration interval identifier and a deceleration/deceleration interval identifier; acquiring preset constraint parameter information, including:
acquiring preset motion acceleration of end time corresponding to the acceleration and deceleration interval identification and the deceleration and deceleration interval identification respectively, acquiring preset motion speed of the end time corresponding to the deceleration and deceleration interval identification, and acquiring a preset path of the end time corresponding to the deceleration and deceleration interval identification; and obtaining preset constraint parameter information based on the preset motion acceleration, the preset motion speed and the preset distance.
The acceleration section identification, the acceleration and deceleration section identification, the deceleration and acceleration section identification and the deceleration and deceleration section identification refer to identification information of motion state sections of which the motion states of the motor are acceleration, deceleration, acceleration and deceleration. The acceleration, deceleration, acceleration and deceleration are motion states in which the motor acceleration changes, the rate of change of the motor acceleration is determined by the acceleration, and the motion acceleration is the absolute value of the acceleration. The motion acceleration rate corresponding to acceleration, deceleration, acceleration, deceleration and deceleration can be set by a user in a user-defined way, and the numerical values are the same or different. The preset motion acceleration, the preset motion speed and the preset distance refer to specific numerical values corresponding to acceleration parameter information, speed parameter information and distance parameter information in preset constraint parameter information.
Specifically, as shown in fig. 5a, a schematic diagram of a motor motion acceleration curve is provided; the motor motion state is that the acceleration of the motor is gradually increased when acceleration is added until the maximum acceleration is reached. The motor motion state is that the acceleration of the motor is gradually reduced when the acceleration is reduced until the acceleration is zero, and the speed of the motor is maximum at the moment. The motor motion state is that the absolute value | a | of the motor acceleration is gradually increased when the motor is accelerated and decelerated until the maximum absolute value of the acceleration is reached. The motor motion state is that the absolute value of the motor acceleration is gradually reduced when the speed is reduced until the absolute value of the acceleration is zero, and the motor speed is zero at the moment.
As shown in fig. 5b, a schematic diagram of a motor motion speed curve is provided; the motion state of the acceleration addition and the deceleration is a state in which the motor speed is gradually increased, and the motor speed reaches the maximum at the end time of the motion state of the deceleration. The acceleration and deceleration movement state is a state that the motor speed is gradually reduced, the motor speed is reduced to zero at the ending time of the deceleration movement state, and the movement path of the motor is the total path. Therefore, the constraint parameter information is:
a (T2) is 0, T2 represents the end time corresponding to the deceleration section identifier, and a (T2) represents the motion acceleration corresponding to the end time corresponding to the deceleration section identifier;
a (T4) is 0, T4 represents the end time corresponding to the deceleration reduction interval identifier, and a (T4) represents the motion acceleration of the end time corresponding to the deceleration reduction interval identifier;
v (T4) is 0, and v (T4) represents the movement speed of the end time corresponding to the deceleration section identifier;
s (T4) is S, S represents the total movement distance of the motor, and S (T4) represents the movement distance at the end time corresponding to the deceleration section flag.
The terminal acquires preset motion acceleration a (T2) and a (T4) of the end time corresponding to the acceleration and deceleration section identification and the deceleration section identification respectively to be 0, acquires preset motion speed v (T4) of the end time corresponding to the deceleration section identification to be 0, and acquires preset distance S (T4) of the end time corresponding to the deceleration section identification to be S; the terminal then sets a (T2) to 0, a (T4) to 0, v (T4) to 0, and S (T4) to S as preset constraint parameter information.
In a specific embodiment, the relational expression of the acceleration parameter information, the motion jerk and the time corresponding to the deceleration interval identification is shown as formula (14):
a (T2) ═ J1T 1-J2T 2 formula (14)
The relational expression of the acceleration parameter information, the motion jerk and the time corresponding to the deceleration interval identification is shown as formula (15):
a (T4) ═ J1T 1-J2T 2-J3T 3+ J4T 4 formula (15)
The relational expression of the speed parameter information, the motion jerk and the time corresponding to the deceleration interval identification is shown as formula (13):
the relational expression of the distance parameter information, the motion jerk and the time corresponding to the deceleration interval identification is shown as a formula (9).
The terminal acquires the preset constraint parameter information: after a (T2) is 0, a (T4) is 0, v (T4) is 0, and S (T4) is S, obtaining the relational expression of the preset constraint parameter information and the motion jerk and time from the local storage database: formula (14), formula (15), formula (13) and formula (9), using the preset constraint parameter information to perform inverse operation on the relation expression between the preset constraint parameter information and the motion jerk and time, to obtain motion time calculation formulas of end times T1, T2, T3 and T4 corresponding to the acceleration interval identifier, the acceleration/deceleration interval identifier, the deceleration/acceleration interval identifier and the deceleration/deceleration interval identifier: formula (1), formula (2), formula (3), formula (4) and formula (5). The terminal may then store the calculated motion time calculation formulas of T1, T2, T3, and T4 in a local storage database, and the terminal may directly use the calculated motion time calculation formulas from the local storage database when calculating the end times corresponding to the acceleration interval identifier, the deceleration interval identifier, and the deceleration interval identifier.
In the embodiment, the preset constraint parameter information and the relation expression of the preset constraint parameter information and the motion jerk and time are used for reverse calculation to obtain the expression of the end time corresponding to each motion state interval identifier, so that the calculation steps are simplified, the end time corresponding to each motion state interval identifier can be directly used when the end time corresponding to each motion state interval identifier is calculated, and the calculation force resource is saved.
In one embodiment, step 306, respectively establishing a target association relationship between the interval motion distance and the time based on the motion parameter information corresponding to each motion state interval identifier, includes:
respectively calculating correlation coefficients based on the motion starting and stopping time, the motion starting and stopping distance and the motion starting and stopping speed corresponding to each motion state interval identifier to obtain the correlation coefficients corresponding to each motion state interval identifier;
and establishing a target association relation between the interval motion distance and time corresponding to each motion state interval identification based on the association coefficient.
Wherein, the correlation coefficient refers to a coefficient in a relational expression of the interval movement distance and the time.
Specifically, the target association relationship between the interval motion distance and the time may be a 3-order spline interpolation function, where the expression of the 3-order spline interpolation function is shown in formula (16):
f(t)=a*t3+b*t2+ c t + d formula (16)
a. b, c and d are coefficients of a 3-order spline interpolation function;
the coefficients of the 3-time spline interpolation functions corresponding to the motion state interval identifications are different. The terminal can obtain a coefficient calculation formula corresponding to a spline interpolation function for 3 times which is calculated in advance, and then the movement starting and stopping time, the movement starting and stopping distance and the movement starting and stopping speed corresponding to each movement state interval mark are respectively calculated according to the coefficient calculation formula corresponding to each movement state interval mark, so that the coefficient of the spline interpolation function for 3 times corresponding to each movement state interval mark is obtained. And generating a corresponding 3-order spline interpolation function according to the calculated coefficient.
In one embodiment, the coefficient calculation formula for the 3-th-order spline interpolation function is shown in formula (16), formula (17), formula (18), and formula (19):
Figure BDA0003579875990000171
Figure BDA0003579875990000172
Figure BDA0003579875990000181
Figure BDA0003579875990000182
t0, t1, s0, s1, v0 and v1 respectively refer to the starting time, the ending time, the starting distance, the ending distance, the starting speed and the ending speed corresponding to each motion state section.
After the terminal calculates and obtains the motion start-stop time, the motion start-stop distance and the motion start-stop speed corresponding to each motion state interval identifier, the terminal obtains a coefficient calculation formula corresponding to a 3-time spline interpolation function from a local storage space: and (3) a formula (16), a formula (17), a formula (18) and a formula (19), and then the terminal respectively calculates specific numerical values of the coefficients a, b, c and d corresponding to the motion state interval identifications by using the motion starting and stopping time, the motion starting and stopping distance and the motion starting and stopping speed according to a coefficient calculation formula. And the terminal respectively combines the specific numerical values of the coefficients a, b, c and d corresponding to the motion state interval identifications obtained by calculation with a formula (16) to obtain a 3-time spline interpolation function corresponding to each motion state interval identification.
In one embodiment, as shown in FIG. 6, a schematic diagram of a motor path curve is provided; and after the terminal obtains the 3 times of spline interpolation functions corresponding to the motion state interval identifications through calculation, calculating the target motion distance s (t) corresponding to each time point of the motor according to the 3 times of spline interpolation functions and the time points corresponding to the motion state interval identifications.
In this embodiment, the motion start-stop time, the motion start-stop distance, and the motion start-stop speed corresponding to each motion state interval identifier may be directly calculated using a coefficient calculation formula to obtain the coefficient of the 3-time spline interpolation function corresponding to each motion state interval identifier, so as to obtain the 3-time spline interpolation function corresponding to each motion state interval identifier. Therefore, the target movement path of each time point corresponding to each movement state interval mark can be obtained through the 3-time spline interpolation function corresponding to each movement state interval mark, so that the motor moves according to the movement path of the template, the calculation force resource for calculating the 3-time spline interpolation function is saved, and the motor control efficiency is improved.
In one embodiment, step 310, controlling the motor based on the target movement distance of each movement time point corresponding to each movement state interval identifier includes:
and sending the target movement distance corresponding to each movement time point to a driver corresponding to the motor, so that the driver calculates current information according to the target movement distance, and driving the motor to move by using the current information.
Specifically, the motion time point may be a time point within a motion start-stop time corresponding to the motion state interval. The target movement distance may be an angle that the motor should rotate, or may be a distance that the motor should rotate, for example, a distance that the rotating motor rotates once is 131072count (number of pulses). And the terminal sends the target movement distance corresponding to each movement time point to a driver corresponding to the motor, and the driver can automatically calculate current according to the target movement distance when receiving the target movement distance to obtain a current value corresponding to the target movement distance and return the current value to the terminal. And the terminal drives the motor according to the current value corresponding to the target movement distance, so that the motor moves according to the target movement distance.
In the embodiment, the motor moves according to the target movement path corresponding to each time point, so that the motor can stably move in the total movement path, and the precision of the distance from the motor to the target is improved.
In one embodiment, as shown in FIG. 7, a flow diagram for calculating a 3-th order spline interpolation function is provided;
the terminal acquires motion state interval identifications input by a user as motion jerks J1, J2, J3, J4 and a total motion distance S corresponding to the acceleration interval identification, the deceleration interval identification and the deceleration interval identification;
then the terminal obtains a relational expression of the preset constraint parameter information and the motion jerk and time, and the relational expression of the preset constraint parameter information a (T2) 0, a (T4) 0, v (T4) 0 and S (T4) S and the motion jerk and time is obtained through the following steps: calculating an equation (14), an equation (15), an equation (13) and an equation (9) to obtain motion time calculation equations of the end times T1, T2, T3 and T4 corresponding to the motion state section identifiers: and then the terminal calculates by using the motion time calculation formulas of J1, J2, J3, J4 and S and T1, T2, T3 and T4 to obtain specific values of T1, T2, T3 and T4, and obtains the motion start and stop time corresponding to each motion state section identification by using the specific values of T1, T2, T3 and T4.
Then the terminal calculates the formula according to the movement path corresponding to each movement state interval mark: equation (6), equation (7), equation (8), and equation (9), and the motion velocity calculation equation corresponding to each motion state interval identification: and (3) calculating by using J1, J2, J3, J4, T1, T2, T3, T4 and S according to the formula (10), the formula (11), the formula (12) and the formula (13) to obtain the motion starting and stopping distance and the motion starting and stopping speed corresponding to each motion state interval identifier.
The terminal obtains a coefficient calculation formula corresponding to the spline interpolation function for 3 times: and (3) calculating by using the motion starting and stopping time, the motion starting and stopping distance and the motion starting and stopping speed corresponding to each motion state interval mark according to a formula (16), a formula (17), a formula (18) and a formula (19) to obtain a coefficient value corresponding to each motion state interval mark. And then the terminal combines the coefficient value corresponding to each motion state interval identifier with a 3-time spline interpolation function expression formula (16) to obtain a 3-time spline interpolation function corresponding to each motion state interval identifier.
It should be understood that, although the steps in the flowcharts related to the embodiments as described above are sequentially displayed as indicated by arrows, the steps are not necessarily performed sequentially as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in the flowcharts related to the embodiments described above may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the execution order of the steps or stages is not necessarily sequential, but may be rotated or alternated with other steps or at least a part of the steps or stages in other steps.
Based on the same inventive concept, the embodiment of the present application further provides a motor control device for implementing the above-mentioned motor control method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the method, so the specific limitations in one or more embodiments of the motor control device provided below can be referred to the limitations on the motor control method in the foregoing, and details are not described here.
In one embodiment, as shown in fig. 8, there is provided a motor control apparatus 800 including: an obtaining module 802, a parameter calculating module 804, an association relation module 806, a route calculating module 808, and a control module 810, wherein:
and the acquisition module is used for acquiring the total movement distance of the motor and interval speed parameter information corresponding to each movement state interval identification.
And the parameter calculation module is used for calculating the motion parameter information by using the total motion distance and the interval speed parameter information based on the preset association relationship among the motion distance, the speed parameter information and the motion parameter information to obtain the motion parameter information corresponding to each motion state interval identifier.
And the association relation module is used for respectively establishing a target association relation between the interval movement distance and the time based on the movement parameter information corresponding to each movement state interval identification, and acquiring each movement time point corresponding to each movement state interval identification in the movement parameter information.
And the path calculation module is used for calculating the movement paths by using the movement time points based on the target association relation to obtain the target movement paths of the movement time points corresponding to the movement state interval identifications.
And the control module is used for controlling the motor based on the target movement distance of each movement time point corresponding to each movement state interval mark so that the motor moves according to the target movement distance of each movement time point corresponding to each movement state interval mark and reaches the total distance.
In one embodiment, the parameter calculation module 804 includes:
the motion parameter calculation unit is used for calculating motion time corresponding to each motion state interval identifier by using a preset first association relation among the total motion distance, the motion jerk and the time to obtain motion starting and stopping time corresponding to each motion state interval identifier;
respectively calculating the interval movement distance corresponding to each movement state interval identification by using the preset second association relation among the movement acceleration, the movement starting and stopping time and the interval movement distance to obtain the movement starting and stopping distance corresponding to each movement state interval identification;
and respectively calculating the motion speed corresponding to each motion state interval identifier by using a preset third correlation of the motion jerk, the motion start-stop time and the motion speed to obtain the motion start-stop speed corresponding to each motion state interval identifier.
In one embodiment, the parameter calculation module 804 includes:
the constraint parameter calculation unit is used for acquiring preset constraint parameter information and acquiring constraint association relation between the preset constraint parameter information and the motion jerk and time based on the preset constraint parameter information;
generating a preset first incidence relation among the total movement distance, the movement jerk and the time according to the preset constraint parameter information and the constraint incidence relation;
and respectively calculating the movement time corresponding to each movement state interval mark by using a preset first association relation to obtain the movement starting and stopping time corresponding to each movement state interval mark.
In one embodiment, the parameter calculation module 804 includes:
the constraint parameter acquisition unit is used for acquiring preset motion acceleration of the ending time corresponding to the deceleration interval identification and the deceleration interval identification respectively, acquiring preset motion speed of the ending time corresponding to the deceleration interval identification and acquiring a preset path of the ending time corresponding to the deceleration interval identification;
and obtaining preset constraint parameter information based on the preset motion acceleration, the preset motion speed and the preset distance.
In one embodiment, association module 806 includes:
the correlation coefficient calculation unit is used for respectively calculating correlation coefficients based on the motion starting and stopping time, the motion starting and stopping distance and the motion starting and stopping speed corresponding to each motion state interval identifier to obtain the correlation coefficients corresponding to each motion state interval identifier;
and establishing a target association relation between the interval motion distance and time corresponding to each motion state interval identification based on the association coefficient.
In one embodiment, the control module 810 includes:
and the driver unit is used for sending the target movement distance corresponding to each movement time point to the driver corresponding to the motor so that the driver can calculate current information according to the target movement distance and drive the motor to move by using the current information.
The respective modules in the above-described motor control apparatus may be entirely or partially implemented by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 9. The computer apparatus includes a processor, a memory, an input/output interface, a communication interface, a display unit, and an input device. The processor, the memory and the input/output interface are connected by a system bus, and the communication interface, the display unit and the input device are connected by the input/output interface to the system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The input/output interface of the computer device is used for exchanging information between the processor and an external device. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless communication can be realized through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a motor control method. The display unit of the computer equipment is used for forming a visual picture, and can be a display screen, a projection device or a virtual reality imaging device, the display screen can be a liquid crystal display screen or an electronic ink display screen, the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on a shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 9 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In an embodiment, a computer device is further provided, which includes a memory and a processor, the memory stores a computer program, and the processor implements the steps of the above method embodiments when executing the computer program.
In an embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.
In an embodiment, a computer program product is provided, comprising a computer program which, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.
It should be noted that, the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) referred to in the present application are information and data authorized by the user or sufficiently authorized by each party, and the collection, use and processing of the related data need to comply with the relevant laws and regulations and standards of the relevant country and region.
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 hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, database, or other medium used in the embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include a Read-Only Memory (ROM), a magnetic tape, a floppy disk, a flash Memory, an optical Memory, a high-density embedded nonvolatile Memory, a resistive Random Access Memory (ReRAM), a Magnetic Random Access Memory (MRAM), a Ferroelectric Random Access Memory (FRAM), a Phase Change Memory (PCM), a graphene Memory, and the like. Volatile Memory can include Random Access Memory (RAM), external cache Memory, and the like. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), for example. The databases referred to in various embodiments provided herein may include at least one of relational and non-relational databases. The non-relational database may include, but is not limited to, a block chain based distributed database, and the like. The processors referred to in the embodiments provided herein may be general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic devices, quantum computing based data processing logic devices, etc., without limitation.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.

Claims (10)

1. A method of controlling a motor, the method comprising:
acquiring the total movement distance of the motor and interval speed parameter information corresponding to each movement state interval identification;
based on the preset association relationship among the motion distance, the speed parameter information and the motion parameter information, calculating the motion parameter information by using the total motion distance and the interval speed parameter information to obtain the motion parameter information corresponding to each motion state interval identification;
respectively establishing a target association relation between the interval movement distance and time based on the movement parameter information corresponding to each movement state interval identification, and acquiring each movement time point corresponding to each movement state interval identification in the movement parameter information;
calculating the movement distance by using each movement time point based on the target association relation to obtain the target movement distance of each movement time point corresponding to each movement state interval identifier;
and controlling the motor based on the target movement distance of each movement time point corresponding to each movement state interval mark, so that the motor moves according to the target movement distance of each movement time point corresponding to each movement state interval mark and reaches the total distance.
2. The method of claim 1, wherein the velocity parameter information comprises motion jerk; the motion parameter information comprises motion starting and stopping time, motion starting and stopping distance and motion starting and stopping speed;
the calculating of the motion parameter information by using the total motion distance and the interval speed parameter information based on the preset incidence relation among the motion distance, the speed parameter information and the motion parameter information to obtain the motion parameter information corresponding to each motion state interval identification comprises the following steps:
respectively calculating the motion time corresponding to each motion state interval identifier by using the preset first association relation among the total motion distance, the motion jerk and the time to obtain the motion starting and stopping time corresponding to each motion state interval identifier;
respectively calculating the interval motion distance corresponding to each motion state interval identification by using the motion jerk, the motion start-stop time and a preset second association relation of the interval motion distance to obtain the motion start-stop distance corresponding to each motion state interval identification;
and respectively calculating the motion speed corresponding to each motion state interval identifier by using the motion jerk, the motion start-stop time and the motion speed, so as to obtain the motion start-stop speed corresponding to each motion state interval identifier.
3. The method according to claim 2, wherein the calculating the movement time corresponding to each movement state interval identifier by using the preset first association relationship among the total movement distance, the movement jerk, and the time to obtain the movement start and stop time corresponding to each movement state interval identifier comprises:
acquiring preset constraint parameter information, and acquiring constraint association relation among the preset constraint parameter information, motion jerk and time based on the preset constraint parameter information;
generating a preset first association relation among the total movement distance, the movement jerk and the time according to the preset constraint parameter information and the constraint association relation;
and respectively calculating the movement time corresponding to each movement state interval identifier by using the preset first association relation to obtain the movement starting and stopping time corresponding to each movement state interval identifier.
4. The method according to claim 3, wherein each motion state interval identification comprises an acceleration interval identification, a deceleration interval identification, an acceleration and deceleration interval identification and a deceleration and deceleration interval identification; the acquiring of the preset constraint parameter information includes:
acquiring preset motion acceleration of end time corresponding to the deceleration interval identification and the deceleration interval identification respectively, acquiring preset motion speed of the end time corresponding to the deceleration interval identification, and acquiring preset distance of the end time corresponding to the deceleration interval identification;
and obtaining the preset constraint parameter information based on the preset motion acceleration, the preset motion speed and the preset distance.
5. The method according to claim 2, wherein the establishing of the target association relationship between the interval motion distance and the time based on the motion parameter information corresponding to each motion state interval identifier comprises:
respectively calculating correlation coefficients based on the motion starting and stopping time, the motion starting and stopping distance and the motion starting and stopping speed corresponding to each motion state interval identifier to obtain the correlation coefficients corresponding to each motion state interval identifier;
and establishing a target association relation between the interval motion distance and time corresponding to each motion state interval identification based on the association coefficient.
6. The method according to claim 1, wherein the controlling the motor based on the target movement distance of each movement time point corresponding to each movement state interval identifier comprises:
and sending the target movement distance corresponding to each movement time point to a driver corresponding to the motor, so that the driver calculates current information according to the target movement distance, and driving the motor to move by using the current information.
7. A motor control apparatus, characterized in that the apparatus comprises:
the acquisition module is used for acquiring the total movement distance of the motor and interval speed parameter information corresponding to each movement state interval identification;
the parameter calculation module is used for calculating motion parameter information by using the total motion distance and the interval speed parameter information based on the preset incidence relation among the motion distance, the speed parameter information and the motion parameter information to obtain the motion parameter information corresponding to each motion state interval identification;
the incidence relation module is used for respectively establishing target incidence relation between interval movement distance and time based on the movement parameter information corresponding to each movement state interval identification, and acquiring each movement time point corresponding to each movement state interval identification in the movement parameter information;
the route calculation module is used for calculating the movement routes by using the movement time points based on the target association relation to obtain the target movement routes of the movement time points corresponding to the movement state interval identifications;
and the control module is used for controlling the motor based on the target movement distance of each movement time point corresponding to each movement state interval identifier so as to enable the motor to move according to the target movement distance of each movement time point corresponding to each movement state interval identifier and reach the total distance.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 6.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 6.
CN202210342575.6A 2022-04-02 2022-04-02 Motor control method, apparatus, computer device, and storage medium Active CN114676389B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210342575.6A CN114676389B (en) 2022-04-02 2022-04-02 Motor control method, apparatus, computer device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210342575.6A CN114676389B (en) 2022-04-02 2022-04-02 Motor control method, apparatus, computer device, and storage medium

Publications (2)

Publication Number Publication Date
CN114676389A true CN114676389A (en) 2022-06-28
CN114676389B CN114676389B (en) 2023-06-27

Family

ID=82075252

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210342575.6A Active CN114676389B (en) 2022-04-02 2022-04-02 Motor control method, apparatus, computer device, and storage medium

Country Status (1)

Country Link
CN (1) CN114676389B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102298391A (en) * 2011-04-27 2011-12-28 哈尔滨工业大学 Motion trail planning method for heavy-duty industrial robot in operating space
CN102647152A (en) * 2011-02-18 2012-08-22 株式会社日立高新技术仪器 Motor control system and motor control method
US20150323324A1 (en) * 2013-04-23 2015-11-12 Igor Katsman Systems and methods for handheld device based battery efficient context monitoring, detection of a vehicular motion and identification of a specific vehicle
CN106313043A (en) * 2015-10-14 2017-01-11 山东世纪元通智能科技有限公司 Control method of path point type walking robot system
CN106671902A (en) * 2015-11-10 2017-05-17 冯春魁 Measuring, calculating, supervising, monitoring and processing method and system synthesizing vehicle data
CN109505069A (en) * 2018-11-19 2019-03-22 杰克缝纫机股份有限公司 Motion trail planning method and its device, bag-bonding machine and storage medium
CN110147077A (en) * 2019-04-19 2019-08-20 深圳科瑞技术股份有限公司 A kind of cosine interpolating method of industrial robot under space line operation
CN111246095A (en) * 2020-01-17 2020-06-05 腾讯科技(深圳)有限公司 Method, device and equipment for controlling lens movement and storage medium
US20210009128A1 (en) * 2018-03-30 2021-01-14 Jaguar Land Rover Limited Vehicle control method and apparatus
CN112720450A (en) * 2019-10-28 2021-04-30 大族激光科技产业集团股份有限公司 Robot joint angle inspection method, device, equipment and medium
CN112925425A (en) * 2019-12-05 2021-06-08 佛山市云米电器科技有限公司 Device control method, mobile terminal, and computer-readable storage medium

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102647152A (en) * 2011-02-18 2012-08-22 株式会社日立高新技术仪器 Motor control system and motor control method
CN102298391A (en) * 2011-04-27 2011-12-28 哈尔滨工业大学 Motion trail planning method for heavy-duty industrial robot in operating space
US20150323324A1 (en) * 2013-04-23 2015-11-12 Igor Katsman Systems and methods for handheld device based battery efficient context monitoring, detection of a vehicular motion and identification of a specific vehicle
CN106313043A (en) * 2015-10-14 2017-01-11 山东世纪元通智能科技有限公司 Control method of path point type walking robot system
CN106671902A (en) * 2015-11-10 2017-05-17 冯春魁 Measuring, calculating, supervising, monitoring and processing method and system synthesizing vehicle data
US20210009128A1 (en) * 2018-03-30 2021-01-14 Jaguar Land Rover Limited Vehicle control method and apparatus
CN109505069A (en) * 2018-11-19 2019-03-22 杰克缝纫机股份有限公司 Motion trail planning method and its device, bag-bonding machine and storage medium
CN110147077A (en) * 2019-04-19 2019-08-20 深圳科瑞技术股份有限公司 A kind of cosine interpolating method of industrial robot under space line operation
CN112720450A (en) * 2019-10-28 2021-04-30 大族激光科技产业集团股份有限公司 Robot joint angle inspection method, device, equipment and medium
CN112925425A (en) * 2019-12-05 2021-06-08 佛山市云米电器科技有限公司 Device control method, mobile terminal, and computer-readable storage medium
CN111246095A (en) * 2020-01-17 2020-06-05 腾讯科技(深圳)有限公司 Method, device and equipment for controlling lens movement and storage medium

Non-Patent Citations (7)

* Cited by examiner, † Cited by third party
Title
SUNEET KUMAR SINGH等: "Impact Analysis of Start-Up Lost Time at Major Intersections on Sathorn Road Using a Synchro Optimization and a Microscopic SUMO Traffic Simulation", 《IEEE》 *
刘苗等: "基于SIMOTION的高速装箱机的控制系统开发", 《机器人技术与应用》 *
祁超等: "精密转台S曲线轨迹规划及高精度控制", 《光学精密工程》 *
葛伟伟;: "数控系统加减速的实现方法", 中国科技信息 *
蒋勇敏等: "基于自定义时间的数控加工运动规划方法", 《机床与液压》 *
赵达等: "曲线磨削冲程运动速度规划研究", 《机械制造》 *
鲍久圣等: "重型煤炭运输车分布式混合动力系统设计及控制策略", 《煤炭学报》 *

Also Published As

Publication number Publication date
CN114676389B (en) 2023-06-27

Similar Documents

Publication Publication Date Title
EP3360083B1 (en) Dueling deep neural networks
US20180189647A1 (en) Machine-learned virtual sensor model for multiple sensors
US10372319B2 (en) Method, apparatus and computer program product for enabling scrubbing of a media file
CA2959677C (en) Parametric inertia and apis
CN110546653B (en) Action selection for reinforcement learning using manager and worker neural networks
JP2013242761A (en) Method, and controller and control program thereof, for updating policy parameters under markov decision process system environment
CN103077184B (en) The method obtained for rule-based sight
JP2021064387A (en) Neural episodic control
CN106056359A (en) Note task progress tracking method, device and terminal
CN109933066A (en) A kind of method and apparatus of robot motion track playback
CN114581565A (en) Animation path visual editing method and device, computer equipment and storage medium
CN109902588A (en) A kind of gesture identification method, device and computer readable storage medium
CN115847422A (en) Gesture recognition method, device and system for teleoperation
US20190205757A1 (en) Model-free control for reinforcement learning agents
CN114676389A (en) Motor control method, motor control device, computer equipment and storage medium
CN106303722B (en) animation playing method and device
CN112966193B (en) Travel intention deducing method, model training method, related device and electronic equipment
CN105719330A (en) Animation curve generation method and device
Alroobaea et al. Markov decision process with deep reinforcement learning for robotics data offloading in cloud network
CN115905342B (en) Method and device for thinning track of moving object on water and computer equipment
US20220317302A1 (en) Occupancy clustering according to radar data
US11941572B1 (en) Machine learning item delivery using sensor data
CN116061181A (en) Method, device, equipment, medium and product for determining movement track of robot
CN116974250A (en) Industrial equipment action data acquisition method and device and computer equipment
CN108710688B (en) Method and device for generating animation in page and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant