CN110868109B - Motor control method and device, storage medium and robot thereof - Google Patents

Motor control method and device, storage medium and robot thereof Download PDF

Info

Publication number
CN110868109B
CN110868109B CN201911197644.3A CN201911197644A CN110868109B CN 110868109 B CN110868109 B CN 110868109B CN 201911197644 A CN201911197644 A CN 201911197644A CN 110868109 B CN110868109 B CN 110868109B
Authority
CN
China
Prior art keywords
motor
proportional
equal
value
integral
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911197644.3A
Other languages
Chinese (zh)
Other versions
CN110868109A (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.)
Beijing Yunji Technology Co Ltd
Original Assignee
Beijing Yunji Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Yunji Technology Co Ltd filed Critical Beijing Yunji Technology Co Ltd
Priority to CN201911197644.3A priority Critical patent/CN110868109B/en
Publication of CN110868109A publication Critical patent/CN110868109A/en
Application granted granted Critical
Publication of CN110868109B publication Critical patent/CN110868109B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02PCONTROL OR REGULATION OF ELECTRIC MOTORS, ELECTRIC GENERATORS OR DYNAMO-ELECTRIC CONVERTERS; CONTROLLING TRANSFORMERS, REACTORS OR CHOKE COILS
    • H02P3/00Arrangements for stopping or slowing electric motors, generators, or dynamo-electric converters
    • H02P3/06Arrangements for stopping or slowing electric motors, generators, or dynamo-electric converters for stopping or slowing an individual dynamo-electric motor or dynamo-electric converter

Abstract

The application provides a motor control method, a motor control device, a storage medium and a robot thereof, wherein the method comprises the steps of obtaining the current given speed of a motor, and judging whether the current given speed is equal to a preset stop value or not; if so, acquiring the current working speed of the motor; judging whether the current working speed is equal to a preset stop value or not; if so, correcting the integral output of the proportional-integral control of the motor to a preset stop value to obtain a corrected proportional-integral output quantity, wherein the corrected proportional-integral output quantity is the sum of the proportional output and the corrected integral output; and controlling the motor according to the corrected proportional-integral output quantity so as to stop the motor.

Description

Motor control method and device, storage medium and robot thereof
Technical Field
The application relates to the technical field of control, in particular to a motor control method, a motor control device, a storage medium and a robot thereof.
Background
At present, vector control is mostly adopted in a control strategy of a motor, namely, speed closed-loop feedback control and current closed-loop feedback control are adopted to achieve rapid and accurate control over speed, classical PI feedback control is mostly adopted in the speed closed-loop control, and the motor stops unstably when the motor stops due to the fact that the motor uses classical Proportional Integral (PI) feedback control when the motor decelerates to stop, so that the problem of swing back and forth occurs.
Disclosure of Invention
An object of the embodiments of the present application is to provide a motor control method, a motor control device, a storage medium, and a robot thereof, so as to solve the problem that when a motor is decelerated to a stop, the motor stops unstably and swings back and forth due to the use of classical PI feedback control.
In a first aspect, the present application provides a method of controlling a motor, the method comprising: acquiring the current given speed of the motor, and judging whether the current given speed is equal to a preset stop value or not; if so, acquiring the current working speed of the motor; judging whether the current working speed is equal to the preset stop value or not; if so, correcting the integral output of the proportional-integral control of the motor to the preset stop value to obtain a corrected proportional-integral output quantity, wherein the corrected proportional-integral output quantity is the sum of the proportional output and the corrected integral output; and controlling the motor according to the corrected proportional-integral output quantity so as to stop the motor.
In an alternative embodiment of the first aspect, the correcting the integral output in the proportional-integral control of the motor to the preset stop value, where the preset stop value is zero, includes: and correcting the integral output of the proportional-integral control of the motor to be zero.
In the designed motor control method, after the given speed and the working speed of the motor are determined to be the preset stop value (0) at the same time, the integral output part in the proportional-integral control for controlling the motor is corrected to be the preset stop value (0) to obtain the corrected proportional-integral output quantity, and the motor is controlled according to the corrected proportional-integral control quantity, so that the motor can be stopped in time from deceleration to the working speed of the motor being the preset stop value (0), the problem that the motor cannot be stopped stably when stopped and swings back and forth due to the fact that the motor is decelerated to stop by classical PI feedback control is solved, the motor can be stopped stably at one time under the condition that no hardware equipment is added, and the stability and the accuracy of motor speed control are enhanced.
In an optional implementation manner of the first aspect, after the determining whether the current operating speed is equal to the preset stop value, the method further includes: if the current working speed is judged to be equal to the preset stop value, controlling a counter in a reset state to accumulate a preset value; judging whether the accumulated value of the counter is equal to a preset value or not; if so, executing a step of correcting the integral output of the proportional-integral control of the motor to the preset stop value; and if not, controlling the motor according to the proportional-integral output quantity before correction.
In an optional embodiment of the above design, the proportional-integral control mode of the motor is determined by the count value of the counter, the proportional-integral control mode is determined as a corrected proportional-integral control mode when the count value requirement is met, and the proportional-integral control mode before correction is resumed when the count value requirement is not met, so that the control mode of the motor is diversified, the motor is more stable when stopped, and is not affected when not stopped.
In an alternative embodiment of the first aspect, after the controlling the motor according to the modified proportional-integral output quantity, the method further comprises: judging whether a starting given speed of the motor is obtained or not, wherein the starting given speed is not equal to a preset stop value; and if so, adjusting the counter to be in the reset state.
In an optional embodiment of the above design, the counter is adjusted to be in a reset state when the motor is stopped to be started next time, so that the counter can start counting from the reset state when the motor is stopped next time, and the control process is more accurate.
In an optional implementation manner of the first aspect, after the determining whether the current operating speed is equal to the preset stop value, the method further includes: and if the current working speed is not equal to the preset stop value, controlling the motor according to the proportional-integral output quantity before correction.
In an optional implementation of the first aspect, after the determining whether the current given speed is equal to a preset stop value, the method further comprises: and if the current given speed is not equal to the preset stop value, controlling the motor according to the proportional-integral output quantity before correction.
In a second aspect, the present application provides a motor control apparatus, the apparatus comprising: the acquisition module is used for acquiring the current given speed of the motor; the judging module is used for judging whether the current given speed is equal to a preset stop value or not; the obtaining module is further used for obtaining the current working speed of the motor after the judging module judges that the current given speed is equal to the preset stop value; the judging module is further configured to judge whether the current working speed is equal to the preset stop value; the correction module is used for correcting the integral output of the proportional-integral control of the motor to the preset stop value to obtain a corrected proportional-integral output quantity, and the corrected proportional-integral output quantity is the sum of the proportional output and the corrected integral output; and the control module is used for controlling the motor according to the corrected proportional-integral output quantity.
In an alternative embodiment of the second aspect, the preset stop value is zero, and the correction module is specifically configured to correct an integral output of the proportional-integral control of the motor to zero.
In an optional implementation manner of the second aspect, the apparatus further includes an accumulation module, configured to accumulate a preset value for the counter in the reset state after the determination module determines that the current operating speed is equal to the preset stop value; the judging module is further configured to judge whether the accumulated value of the counter is equal to the preset value; the execution module is used for executing the step of correcting the integral output of the proportional-integral control of the motor to the preset stop value after the judgment module judges that the accumulated numerical value of the counter is equal to the preset numerical value; and the control module is also used for controlling the motor according to the proportional-integral output quantity before correction after the judgment module judges that the accumulated numerical value of the counter is not equal to the preset numerical value.
In an optional implementation manner of the second aspect, the determining module is further configured to determine whether a starting given speed of the motor is obtained after the motor is controlled according to the corrected proportional-integral output quantity, where the starting given speed is not equal to the preset stop value; and the adjusting module is used for adjusting the counter to be in the reset state after the judging module judges that the starting given speed of the motor is obtained.
In an optional implementation manner of the second aspect, the control module is further configured to control the motor according to a proportional-integral output quantity before correction after the determination module determines that the current operating speed is not equal to the preset stop value.
In an optional implementation manner of the second aspect, the control module is further configured to control the motor according to a proportional-integral output quantity before correction after the determination module determines that the current given speed is not equal to a preset stop value.
In a third aspect, the present application provides a robot, including a robot body, a motor and a processor, where the motor is electrically connected to the processor, the motor is used to drive the robot body to move, and when the robot body is decelerated and stopped by the motor, the processor executes the method as described in any one of the optional embodiments of the first embodiment to control the motor so as to stop the robot body stably.
In a fourth aspect, the present application provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the method described in any of the optional implementation manners of the first aspect when executing the computer program.
In a fifth aspect, the present application provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method as described in any one of the optional embodiments of the first aspect.
A sixth aspect: the present application provides a computer program product which, when run on a computer, causes the computer to perform the method of the first aspect, any of the alternative implementations of the first aspect.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and that those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
Fig. 1 is a first flowchart of a motor control method according to a first embodiment of the present disclosure;
fig. 2 is a second flowchart of a motor control method according to the first embodiment of the present application;
fig. 3 is a third flowchart of a motor control method according to the first embodiment of the present application;
fig. 4 is a fourth flowchart illustrating a motor control method according to the first embodiment of the present application;
fig. 5 is a schematic structural diagram of a motor control device according to a second embodiment of the present application;
fig. 6 is a schematic structural diagram of a robot according to a third embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present application.
Icon: 10-a robot body; 20-a motor; 30-a processor; 200-an obtaining module; 202-a judging module; 204-a correction module; 206-a control module; 208-an execution module; 210-an adjustment module; 4-an electronic device; 401-a processor; 402-a memory; 403-communication bus.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
First embodiment
As shown in fig. 1, the present application provides a motor control method, which specifically includes the following steps:
step S100: the current given speed of the motor is obtained.
Step S102: judging whether the current given speed of the motor is equal to a preset stop value or not, and if so, turning to the step S104; if not, go to step S1074.
Step S104: and acquiring the current working speed of the motor.
Step S106: judging whether the current working speed of the motor is equal to the preset stop value or not, if so, turning to the step S108;
step S108: and correcting the integral output of the proportional-integral control of the motor to the preset stop value to obtain a corrected proportional-integral output quantity, wherein the proportional-integral output quantity is the sum of the proportional output and the corrected integral output.
Step S110: and controlling the motor according to the corrected proportional-integral output quantity so as to stop the motor.
The motor control method realized by the steps can be applied to a processor or a controller or a server for controlling the motor, and can control all motors adopting classical PI feedback control, wherein the motors can be brushless direct current motors or permanent magnet synchronous motors.
In step S100, obtaining a current given speed of the motor, where the current given speed is a target speed that needs to be reached after a period of time on the premise of the current speed of the motor; taking the processor as an execution subject of the above steps as an example, the current given speed may be set by the user in the external device according to the motor speed requirement, and then sent to the processor by the external control device, and then the processor obtains the current given speed of the motor.
After the processor obtains the current given speed of the motor, the processor performs step S102 to determine whether the current given speed of the motor is equal to a preset stop value. The preset stop value in step S102 may be configured and stored in the processor in advance, and the preset stop value may be 0 or other values, which will be exemplified by the preset stop value being 0 in the following. If the processor determines that the current given speed of the motor is equal to the preset stop value, step S104 is executed to obtain the current working speed of the motor.
In step S104, the current operating speed of the motor refers to a speed at which the motor is running, and the current speed of the motor may be obtained by a speed sensor provided in the motor and sent to the processor after the speed sensor is obtained, and the processor obtains the current operating speed of the motor. Since it has been determined in the foregoing step that the given speed is equal to the preset stop value 0, the motor is in the continuous deceleration process, and in this process, the processor monitors the current operating speed of the motor in real time, and then executes step S106 to determine whether the current operating speed of the motor is equal to the preset stop value.
As for step S106, since the current operating speed of the motor is a real-time monitoring process, and whether the current operating speed of the motor is equal to the preset stop value is determined, that is, whether the operating speed of the motor in the process of continuously decelerating to stop is equal to the preset stop value, it can be seen that only at the moment when the motor stops, the operating speed of the motor is equal to the preset stop value 0, and at this moment, it indicates that the current operating speed of the motor is equal to the preset stop value 0, then step S108 is executed.
In the motor control of this application, the treater is based on proportional-integral output volume to control the motor, and then the speed of control motor, and proportional-integral output volume has contained the sum of two parts, proportional output part and integral output part, and the classic PI control feedback that prior art adopted the motor makes the motor unstable when stopping, and the reason of the back and forth swing is: in the classical PI feedback control, the output value of the proportional regulation P depends on the current situation of the input deviation amount, and the output of the integral regulation includes the history of the input deviation amount, so that the proportional regulation P is 0 at the moment when the motor stops, and the integral regulation I is not the preset stop value 0, so that the proportional integral output is not 0, and the motor swings back and forth after the working speed is 0. The following explains the above process in detail with a simple calculation formula of PI control, assuming that the calculation formula of PI control is:
PI=KP×EK+KI*(EK-EK1)
wherein, PI is proportional integral output quantity, KP is proportional gain constant, KI is integral time constant, EK is difference value of given speed and working speed, EK1 is last EK value.
The above analysis is performed by the above formula, and the rotation direction when the motor starts to decelerate is set as the positive direction, when the given speed and the working speed are both preset stop values of 0, the proportional regulation output value KP × EK is 0, and the integral regulation output value KI (EK-EK1) is negative, so that when the motor decelerates to the working speed of 0, a force in the negative direction is generated, and the motor is driven to rotate in the reverse direction after stopping; at this moment, because the motor rotates in the reverse direction, the working speed is negative, the proportional regulation output value is positive, the integral regulation output value is also positive, the motor is stressed by a positive force and swings in the positive direction, and the operation is repeated for several times until the absolute value of the integral regulation output value is smaller and smaller until the absolute value is zero, and the motor can not be completely stopped.
Therefore, on the basis of the above reasons, the present application provides step S108, in step S108, after determining that the current operating speed of the motor is equal to the preset stop value, the integral output part in the proportional-integral control of the motor is corrected to the preset stop 0, that is, when the motor reaches the operating speed of 0 for the first time from deceleration, the integral output part in the proportional-integral control is corrected to 0, so that the proportional-integral output quantity is 0, the corrected proportional-integral output quantity is obtained, and then the step S110 of controlling the motor according to the corrected proportional-integral output quantity is executed, in step S110, the proportional-integral output quantity is 0, so that the motor is not acted by force any more, and the motor can be stopped in time when the operating speed of 0 for the first time is reached.
In the designed motor control method, after the given speed and the working speed of the motor are determined to be the preset stop value (0) at the same time, the integral output part in the proportional-integral control for controlling the motor is corrected to be the preset stop value (0) to obtain the corrected proportional-integral output quantity, and the motor is controlled according to the corrected proportional-integral control quantity, so that the motor can be stopped in time from deceleration to the working speed of the motor being the preset stop value (0), the problem that the motor cannot be stopped stably when stopped and swings back and forth due to the fact that the motor is decelerated to stop by classical PI feedback control is solved, the motor can be stopped stably at one time under the condition that no hardware equipment is added, and the stability and the accuracy of motor speed control are enhanced.
In an alternative embodiment of this embodiment, the preset stop value may be set by itself, for example, the preset stop value may be set not only to be 0 but also to be 1 or-1, so that when the speed is 1 or-1, the motor stops rotating, i.e. the current given speed/current working speed of the motor is equal to the preset stop value when the current given speed/current working speed is 1 or-1.
In an alternative implementation manner of this embodiment, as shown in fig. 2, before step S108, the method further includes:
step S1070: and after judging that the current working speed is equal to the preset stop value, controlling a counter in a reset state to increase a preset value.
Step S1072: judging whether the accumulated value of the counter is equal to a preset value or not, if so, turning to the step S108; if not, go to step S1074.
Step S1074: and controlling the motor according to the proportional-integral output quantity before correction.
In step S1070, the reset state of the counter can be set to be the clear state, i.e. the count in the counter is 0, and the accumulated preset value represents the value that needs to be increased every time the counter counts, for example, if the preset value is 1, the counter is increased by 1 every time, and if the preset value is 2, the counter is increased by 2 every time. Step S1070 represents that when or after the current operating speed of the motor is equal to the preset stop value (0), the counter starts to count from 0, if the preset value is 1, the counter count is changed to 1, then step S1072 is executed to determine whether the accumulated value of the counter is equal to the preset value, which is represented by the aforementioned example, whether the accumulated value 1 of the counter is equal to the preset value 1, and is obviously equal, step S108 is executed to correct the integral output of the proportional-integral control of the motor to the preset stop value (0). After that, since the motor completely stops, it is determined based on step S106 whether the current operating speed is the preset stop value 0, at this time, if the counter is still in the operating state, the counter will continue to increase the preset value, for example, the accumulated value in the counter is 1+1 to 2, and step S1072 is further executed to determine whether the accumulated value of the counter is equal to the preset value, at this time, the accumulated value 2 of the counter is not equal to the preset value 1 (that is, step S108 is executed only when the count in the counter is 1), so that the accumulated value of the counter is not equal to the preset value, and step S1074 is executed to control the motor according to the proportional-integral output quantity before correction, that is, the proportional-integral output quantity before correction is recovered.
In the above embodiment, the configuration of the counter may be configured in advance, for example, in order to avoid the continuous accumulation of the counter, the maximum count value of the counter may be set to a preset value plus 1, and in such a setting, the continuous accumulation of the counter may not be performed even if the motor is not moved for a long time. In addition, after the proportional output correction is performed in step S108, the power supply of the counter may be turned off, and when the motor is decelerated to stop next time, the power supply of the counter may be turned on again, so as to prevent the counter from being continuously accumulated.
In alternative embodiments of this embodiment, the foregoing manner of resetting the counter may be various: first, the counter is reset when the next given speed/operating speed is not 0 (i.e., when the motor starts again from a stop). Second, the counter is reset during the next deceleration of the motor to a stop. Third, the non-holding counter can be reset by turning off the power of the counter after the proportional output correction is performed in step S108 and turning on the power of the counter when the motor is decelerated to a stop next time, because of the characteristics of the non-holding counter.
Taking the aforementioned first mode as an example, as shown in fig. 4, the specific steps are as follows:
after the step S110 of controlling the motor according to the corrected proportional-integral output quantity, the method further includes:
step S112: and judging whether the starting given speed of the motor is acquired, wherein the starting given speed is not equal to a preset stop value, and if so, turning to the step S114.
Step S114: the counter is adjusted to a reset state.
In step S112, the starting given speed of the motor indicates a given speed sent to the processor by the external device after the motor is completely stopped in step S110, the given speed is required to make the motor move again from the stopped state, therefore, the starting given speed is not equal to the preset stop value, taking the rotation direction before the motor is stopped as a positive direction as an example, when the preset stop value is 0, the starting given speed may be a positive value greater than 0 or a negative value less than 0, when the preset stop value is greater than the positive value, the rotation direction of the motor after the starting given speed is obtained is consistent with the rotation direction before the motor is stopped, and when the preset stop value is less than the negative value, the rotation direction of the motor after the starting given speed is obtained is opposite to the rotation direction before the motor is stopped.
After it is determined in step S112 that the start given speed of the motor is acquired, the counter is adjusted to a reset state, that is, the count in the counter is cleared.
In an alternative implementation of this embodiment, after determining whether the current given speed of the motor is equal to the preset stop value in step S102, the method further includes:
if the current given speed of the motor is not equal to the preset stop value, go to the aforementioned step S1074: and controlling the motor according to the proportional-integral output quantity before correction.
In the embodiment designed above, if the current given speed of the motor is not equal to the preset stop value, it indicates that the motor will not stop, and therefore, the motor is controlled according to the proportional-integral output quantity before correction, that is, the motor is controlled by the conventional classical PI feedback control.
In an alternative embodiment of this embodiment, as shown in fig. 3 and 4, after determining whether the current operating speed of the motor is equal to the preset stop value at step S106, the method further includes:
if the current operating speed of the motor is not equal to the preset stop value, go to step S1074: and controlling the motor according to the proportional-integral output quantity before correction.
In the embodiment designed above, when the given speed of the motor is the preset stop value (0) and the current operating speed is not equal to the preset stop value (0), it indicates that the motor is in the deceleration stage, in which it is controlled according to the conventional classical PI feedback control.
Second embodiment
Fig. 5 shows a schematic structural block diagram of a motor control device provided by the present application, and it should be understood that the device corresponds to the method embodiments in fig. 1 to 4, and can execute the steps involved in the method in the first embodiment, and the specific functions of the device can be referred to the description above, and the detailed description is appropriately omitted here to avoid redundancy. The device includes at least one software function that can be stored in memory in the form of software or firmware (firmware) or solidified in the Operating System (OS) of the device. Specifically, the apparatus includes: an obtaining module 200, configured to obtain a current given speed of the motor; a judging module 202, configured to judge whether a current given speed is equal to a preset stop value; the obtaining module 200 is further configured to obtain the current working speed of the motor after the determining module determines that the current given speed is equal to the preset stop value; the judging module 202 is further configured to judge whether the current working speed is equal to a preset stop value; the correction module 204 is configured to correct the integral output of the proportional-integral control of the motor to a preset stop value, and obtain a corrected proportional-integral output quantity, where the corrected proportional-integral output quantity is a sum of the proportional output and the corrected integral output; and the control module 206 is used for controlling the motor according to the corrected proportional-integral output quantity.
In the motor control device with the design, after the given speed and the working speed of the motor are determined to be the preset stop values at the same time, the integral output part in the proportional-integral control for controlling the motor is corrected to be the preset stop value, the corrected proportional-integral output quantity is obtained, and the motor is controlled according to the corrected proportional-integral control quantity, so that the motor can be stopped in time when the working speed is the preset stop value after being decelerated, the problems that the motor cannot be stopped stably when being stopped and swings back and forth due to the fact that the motor is decelerated to be stopped by using the classical PI feedback control are solved, the motor can be stopped stably at one time under the condition that no hardware equipment is added, and the stability and the accuracy of the motor speed control are enhanced.
In an optional implementation manner of this embodiment, the preset stop value is zero, and the correction module 204 is specifically configured to correct the integral output of the proportional-integral control of the motor to be zero.
In an optional implementation manner of this embodiment, the apparatus further includes a control module 206, configured to control the reset-state counter to increment a preset value after the determining module 202 determines that the current operating speed is equal to the preset stop value; the judging module 202 is further configured to judge whether the accumulated value of the counter is equal to a preset value; an executing module 208, configured to execute the step of correcting the integral output of the proportional-integral control of the motor to a preset stop value after the determining module 202 determines that the accumulated value of the counter is equal to the preset value; the control module 206 is further configured to control the motor according to the proportional-integral output quantity before the correction after the determination module 202 determines that the accumulated value of the counter is not equal to the preset value.
In an optional implementation manner of this embodiment, the determining module 202 is further configured to determine whether a starting given speed of the motor is obtained after the motor is controlled according to the corrected proportional-integral output quantity, where the starting given speed is not equal to a preset stop value; and an adjusting module 210, configured to adjust the counter to a reset state after the determining module 202 determines that the given starting speed of the motor is obtained.
In an optional implementation manner of this embodiment, the control module 206 is further configured to control the motor according to the proportional-integral output quantity before the correction after the determining module 202 determines that the current operating speed is not equal to the preset stop value.
In an optional implementation manner of this embodiment, the control module 206 is further configured to control the motor according to the proportional-integral output quantity before the correction after the determining module 202 determines that the current given speed is not equal to the preset stop value.
Third embodiment
As shown in fig. 6, the present application provides a robot, which includes a robot body 10, a motor 20, and a processor 30, wherein the processor 30 is electrically connected to the motor 20, the motor 20 is used for driving the robot body 10 to move, and when the robot body moves through the motor, decelerates and stops, the processor executes a motor control method as in any one of the optional embodiments of the first embodiment to control the motor, so that the robot body stops smoothly when stopping.
In the robot designed above, the motor control method in the first embodiment is executed by the processor, so that the problem that the robot shakes back and forth when stopping due to the fact that the robot uses classical PI feedback control when stopping is solved, and the robot can stably stop at one time when stopping.
Fourth embodiment
As shown in fig. 7, the present application provides an electronic device 4 including: the processor 401 and the memory 402, the processor 401 and the memory 402 being interconnected and communicating with each other through a communication bus 403 and/or other form of connection mechanism (not shown), the memory 402 storing a computer program executable by the processor 401, the processor 401 executing the computer program when the computing device is running to perform the method of the first embodiment or any alternative implementation of the first embodiment, for example, the steps S100 to S110 in the first embodiment: acquiring the current given speed of the motor, and judging whether the current given speed is equal to a preset stop value or not; if so, acquiring the current working speed of the motor; judging whether the current working speed is equal to the preset stop value or not; if so, correcting the integral output of the proportional-integral control of the motor to the preset stop value to obtain a corrected proportional-integral output quantity, wherein the corrected proportional-integral output quantity is the sum of the proportional output and the corrected integral output; and controlling the motor according to the corrected proportional-integral output quantity so as to stop the motor.
The present application provides a non-transitory storage medium having stored thereon a computer program which, when executed by a processor, performs the method of the first embodiment, any one of the alternative implementations of the first embodiment.
The storage medium may be implemented by any type of volatile or nonvolatile storage device or combination thereof, such as a Static Random Access Memory (SRAM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), an Erasable Programmable Read-Only Memory (EPROM), a Programmable Read-Only Memory (PROM), a Read-Only Memory (ROM), a magnetic Memory, a flash Memory, a magnetic disk, or an optical disk.
The present application provides a computer program product which, when run on a computer, causes the computer to perform the method of the first embodiment, any of its alternative implementations.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the modules is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed.
Furthermore, the functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
In this document, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (9)

1. A method of controlling a motor, the method comprising:
acquiring the current given speed of the motor, and judging whether the current given speed is equal to a preset stop value or not;
if so, acquiring the current working speed of the motor;
judging whether the current working speed is equal to the preset stop value or not;
if so, correcting the integral output of the proportional-integral control of the motor to the preset stop value to obtain a corrected proportional-integral output quantity, wherein the corrected proportional-integral output quantity is the sum of the proportional output and the corrected integral output;
controlling the motor according to the corrected proportional-integral output quantity so as to stop the motor;
after the determining whether the current operating speed is equal to the preset stop value, the method further includes:
if the current working speed is judged to be equal to the preset stop value, controlling a counter in a reset state to increase a preset numerical value;
judging whether the accumulated value of the counter is equal to the preset value or not;
if so, executing a step of correcting the integral output of the proportional-integral control of the motor to the preset stop value;
and if not, controlling the motor according to the proportional-integral output quantity before correction.
2. The method according to claim 1, wherein the preset stop value is zero, and the correcting the integral output in the proportional-integral control of the motor to the preset stop value includes:
and correcting the integral output of the proportional-integral control of the motor to be zero.
3. The method of claim 1, wherein after said controlling the motor based on the modified proportional-integral output, the method further comprises:
judging whether a starting given speed of the motor is obtained or not, wherein the starting given speed is not equal to the preset stop value;
and if so, adjusting the counter to be in the reset state.
4. The method of claim 1, wherein after said determining whether said current operating speed is equal to said preset stop value, said method further comprises:
and if the current working speed is not equal to the preset stop value, controlling the motor according to the proportional-integral output quantity before correction.
5. The method of claim 1, wherein after said determining whether said current given speed is equal to a preset stop value, said method further comprises:
and if the current given speed is not equal to the preset stop value, controlling the motor according to the proportional-integral output quantity before correction.
6. A motor control apparatus, characterized in that the apparatus comprises:
the acquisition module is used for acquiring the current given speed of the motor;
the judging module is used for judging whether the current given speed is equal to a preset stop value or not;
the obtaining module is further used for obtaining the current working speed of the motor after the judging module judges that the current given speed is equal to the preset stop value;
the judging module is further configured to judge whether the current working speed is equal to the preset stop value;
the correction module is used for correcting the integral output of the proportional-integral control of the motor to the preset stop value to obtain a corrected proportional-integral output quantity, and the corrected proportional-integral output quantity is the sum of the proportional output and the corrected integral output;
the control module is used for controlling the motor according to the corrected proportional-integral output quantity;
the control module is also used for controlling a counter in a reset state to increase a preset numerical value after judging that the current working speed is equal to the preset stop value;
the judging module is further configured to judge whether the accumulated value of the counter is equal to the preset value;
the execution module is used for executing the step of correcting the integral output of the proportional-integral control of the motor to the preset stop value after the judgment module judges that the accumulated numerical value of the counter is equal to the preset numerical value;
and the control module is also used for controlling the motor according to the proportional-integral output quantity before correction after the judgment module judges that the accumulated numerical value of the counter is not equal to the preset numerical value.
7. A robot, characterized in that the robot comprises a robot body, a motor and a processor, wherein the motor is electrically connected with the processor, the motor is used for driving the robot body to move, when the robot body performs movement deceleration and stop through the motor, the processor executes the method of any one of claims 1 to 5 to control the motor so as to enable the robot body to stop stably.
8. An electronic device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the method of any of claims 1 to 5 when executing the computer program.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method of any one of claims 1 to 5.
CN201911197644.3A 2019-11-27 2019-11-27 Motor control method and device, storage medium and robot thereof Active CN110868109B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911197644.3A CN110868109B (en) 2019-11-27 2019-11-27 Motor control method and device, storage medium and robot thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911197644.3A CN110868109B (en) 2019-11-27 2019-11-27 Motor control method and device, storage medium and robot thereof

Publications (2)

Publication Number Publication Date
CN110868109A CN110868109A (en) 2020-03-06
CN110868109B true CN110868109B (en) 2021-07-27

Family

ID=69657376

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911197644.3A Active CN110868109B (en) 2019-11-27 2019-11-27 Motor control method and device, storage medium and robot thereof

Country Status (1)

Country Link
CN (1) CN110868109B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112803844B (en) * 2021-02-24 2022-12-13 西安星球通智能装备技术有限公司 DC brushless motor speed estimation method based on zero-speed filtering

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103797194A (en) * 2011-09-15 2014-05-14 住友重机械工业株式会社 Electric turning control apparatus and control method for electric motor for turning
CN106655925A (en) * 2016-10-28 2017-05-10 杭州凯尔达电焊机有限公司 Speed control method for DC motor
US10158311B2 (en) * 2014-06-23 2018-12-18 Shanghai Baicheng Electric Equipment Manufacture Co., Ltd. Electronic switch control method
CN110323977A (en) * 2018-03-30 2019-10-11 日本电产伺服有限公司 Motor unit

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101550945B (en) * 2008-03-31 2010-12-01 上海浪腾工业自动化有限公司 Method and system for high-power blower variable-pitch control
CN101902187B (en) * 2010-06-11 2012-06-27 中国科学院上海技术物理研究所 Control system for low-speed running of permanent magnet motor
CN105227022B (en) * 2015-10-23 2018-06-15 合肥工业大学 Based on the time constant of rotor of asynchronous machine on-line identification method for improving reactive power model
CN106936357A (en) * 2015-12-29 2017-07-07 常州新亚电机有限公司 A kind of motor for washer control method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103797194A (en) * 2011-09-15 2014-05-14 住友重机械工业株式会社 Electric turning control apparatus and control method for electric motor for turning
US10158311B2 (en) * 2014-06-23 2018-12-18 Shanghai Baicheng Electric Equipment Manufacture Co., Ltd. Electronic switch control method
CN106655925A (en) * 2016-10-28 2017-05-10 杭州凯尔达电焊机有限公司 Speed control method for DC motor
CN110323977A (en) * 2018-03-30 2019-10-11 日本电产伺服有限公司 Motor unit

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
永磁同步电动机的非线性 PI 速度控制;王江 等;《中国电机工程学报》;20050430;第25卷(第7期);正文第125页-第130页 *

Also Published As

Publication number Publication date
CN110868109A (en) 2020-03-06

Similar Documents

Publication Publication Date Title
JP2709969B2 (en) Servo motor control method
US9280149B2 (en) Motor control device and motor control method
US10261490B2 (en) Servomotor control device, servomotor control method, and computer readable recording medium
CN111103792B (en) Robot control method, device, electronic equipment and readable storage medium
CN110868109B (en) Motor control method and device, storage medium and robot thereof
US9459598B2 (en) Motor control device
CN113395024B (en) Control method and device for direct current motor and motor control system
KR100661106B1 (en) Motor control device
CN111813132B (en) Positioning control method and device, programmable logic controller and readable storage medium
US10162332B2 (en) Servomotor control device, servomotor control method, and computer-readable recording medium
US20040036435A1 (en) Method for commutating an electronically commutated dc motor, and motor for carrying out said method
US20040027084A1 (en) Method for controlling the commutation of an electronically commutated motor
US20040051489A1 (en) Electornically commutated motor
US11353843B2 (en) Automatic evaluation of a machine behaviour
CN114753940B (en) Engine speed control method, electronic device, engineering machine and storage medium
CN110815233A (en) Robot driving method, device, storage medium and robot
CN109338607A (en) A kind of motor heavy duty control method of sewing machine, device, medium, equipment
CN112162573B (en) Electric steering engine shake control method and device
US10656620B2 (en) Motor control device
CN111106768A (en) Starting control method and device of motor
KR20150063277A (en) Proportional control mothod for controlling position of clutch for automated manual transmission
JP2018108639A (en) Method for controlling electric impulse screw driver according to motor instantaneous rotation frequency, and device adapted to method
CN115556104B (en) Control method and system for single joint position of robot and related equipment
US20220182000A1 (en) Motor control device, motor drive system, hydraulic pressure generator, motor control method, and storage medium
JP3811926B2 (en) Speed control device for electric motor

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
CP01 Change in the name or title of a patent holder

Address after: Room 201, building 4, courtyard 8, Dongbeiwang West Road, Haidian District, Beijing

Patentee after: Beijing Yunji Technology Co.,Ltd.

Address before: Room 201, building 4, courtyard 8, Dongbeiwang West Road, Haidian District, Beijing

Patentee before: BEIJING YUNJI TECHNOLOGY Co.,Ltd.

CP01 Change in the name or title of a patent holder