CN113965140A - Servo motor control method, device, equipment and medium - Google Patents
Servo motor control method, device, equipment and medium Download PDFInfo
- Publication number
- CN113965140A CN113965140A CN202010692602.3A CN202010692602A CN113965140A CN 113965140 A CN113965140 A CN 113965140A CN 202010692602 A CN202010692602 A CN 202010692602A CN 113965140 A CN113965140 A CN 113965140A
- Authority
- CN
- China
- Prior art keywords
- parameter
- target
- control
- acceleration
- determining
- 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.)
- Pending
Links
Images
Classifications
-
- H—ELECTRICITY
- H02—GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
- H02P—CONTROL OR REGULATION OF ELECTRIC MOTORS, ELECTRIC GENERATORS OR DYNAMO-ELECTRIC CONVERTERS; CONTROLLING TRANSFORMERS, REACTORS OR CHOKE COILS
- H02P29/00—Arrangements for regulating or controlling electric motors, appropriate for both AC and DC motors
-
- H—ELECTRICITY
- H02—GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
- H02P—CONTROL OR REGULATION OF ELECTRIC MOTORS, ELECTRIC GENERATORS OR DYNAMO-ELECTRIC CONVERTERS; CONTROLLING TRANSFORMERS, REACTORS OR CHOKE COILS
- H02P23/00—Arrangements or methods for the control of AC motors characterised by a control method other than vector control
- H02P23/04—Arrangements or methods for the control of AC motors characterised by a control method other than vector control specially adapted for damping motor oscillations, e.g. for reducing hunting
-
- H—ELECTRICITY
- H02—GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
- H02P—CONTROL OR REGULATION OF ELECTRIC MOTORS, ELECTRIC GENERATORS OR DYNAMO-ELECTRIC CONVERTERS; CONTROLLING TRANSFORMERS, REACTORS OR CHOKE COILS
- H02P23/00—Arrangements or methods for the control of AC motors characterised by a control method other than vector control
- H02P23/20—Controlling the acceleration or deceleration
Landscapes
- Engineering & Computer Science (AREA)
- Power Engineering (AREA)
- Control Of Electric Motors In General (AREA)
Abstract
The application discloses a servo motor control method, a servo motor control device, servo motor control equipment and a servo motor control medium, wherein the method comprises the following steps: obtaining an IO control signal; determining control parameters according to the IO control signals and the current state parameters of the servo motor corresponding to the servo driver; determining a target jerk according to the control parameters; determining a target acceleration according to the target acceleration and the control parameter; performing instruction planning based on the control parameters, the target acceleration and the target acceleration to obtain a target control instruction; and controlling the motion of the servo motor by using the target control command. Therefore, the acceleration of the movement can be controlled, so that the acceleration and the stable transition of the speed in the movement process are controlled, the mechanical vibration of the servo motor is reduced, and the machine is prevented from being damaged.
Description
Technical Field
The present disclosure relates to the field of control technologies, and in particular, to a method, an apparatus, a device, and a medium for controlling a servo motor.
Background
The traditional smooth transition strategy adopted on a servo product is mostly trapezoidal programming, and trapezoidal curve programming of speed and position can enable acceleration of a servo system in the acceleration and deceleration processes to be controllable by programming step instructions of various positions or speeds into trapezoidal acceleration and deceleration instructions, so that mechanical impact can be reduced to a certain extent. Therefore, how to control the smooth transition of the speed and the acceleration during the motion of the servo product to reduce the mechanical vibration is a main problem to be solved in the field.
Disclosure of Invention
In view of this, an object of the present application is to provide a method, an apparatus, a device, and a medium for controlling a servo motor, which can control an acceleration in a motion process, so as to control a smooth transition between the acceleration and a speed in the motion process, so as to reduce mechanical vibration of the servo motor and ensure that the machine is not damaged. The specific scheme is as follows:
in a first aspect, the present application discloses a servo motor control method applied to a servo driver, including:
obtaining an IO control signal;
determining control parameters according to the IO control signals and the current state parameters of the servo motor corresponding to the servo driver;
determining a target jerk according to the control parameters;
determining a target acceleration according to the target acceleration and the control parameter;
performing instruction planning based on the control parameters, the target acceleration and the target acceleration to obtain a target control instruction;
and controlling the motion of the servo motor by using the target control command.
Optionally, the determining a control parameter according to the IO control signal and a current state parameter of a servo motor corresponding to the servo driver includes:
when the IO control signal is a speed control signal, reading a first parameter stored locally, wherein the first parameter comprises a smoothing time parameter, an acceleration time parameter and a deceleration time parameter;
determining a target speed parameter according to the IO control signal;
and determining the first parameter, the target speed parameter and the current state parameter of the servo motor corresponding to the servo driver as the control parameter, wherein the state parameter comprises the current initial speed parameter, the current initial acceleration parameter and the current time parameter of the servo motor.
Optionally, the determining a target jerk according to the control parameter includes:
when the IO control signal is an acceleration control signal, determining the target acceleration according to the target speed parameter, the initial speed parameter, the smoothing time parameter and the acceleration time parameter;
and when the IO control signal is a deceleration control signal, determining the target acceleration according to the target speed parameter, the initial speed parameter, the smoothing time parameter and the deceleration time parameter.
Optionally, the determining a target acceleration according to the target jerk and the control parameter includes:
when the IO control signal is an acceleration control signal, determining a time value of a first preset time point according to the smoothing time parameter and the acceleration time parameter;
determining the target acceleration of the first preset time point according to the time value of the first preset time point and the target acceleration;
correspondingly, the performing instruction planning based on the control parameter, the target jerk and the target acceleration to obtain a target control instruction includes:
determining a speed value of the first preset time point by using the initial speed parameter, the time value of the first preset time point, the target acceleration of the first preset time point and the target jerk;
and performing instruction planning based on the speed value of the first preset time point, the time value of the first preset time point, the target acceleration of the first preset time point and the target jerk to obtain a target control instruction.
Optionally, the determining a control parameter according to the IO control signal and a current state parameter of a servo motor corresponding to the servo driver includes:
when the IO control signal is a point location control signal, reading a second parameter stored locally, wherein the second parameter comprises the first parameter and a maximum speed parameter;
determining a target point bit parameter according to the IO control signal;
and determining the second parameter, the target point position parameter and the current state parameter of the servo motor corresponding to the servo driver as the control parameter, wherein the state parameter comprises the current initial speed parameter, the current initial acceleration parameter, the current time parameter and the initial point position parameter of the servo motor.
Optionally, before determining the target jerk according to the control parameter, the method further includes:
and determining the uniform motion time corresponding to the maximum speed parameter based on the target point location parameter, the initial point location parameter, the maximum speed parameter, the smoothing time parameter, the acceleration time parameter and the deceleration time parameter.
Optionally, the determining a target acceleration according to the target jerk and the control parameter includes:
determining a time value of a second preset time point based on the smoothing time parameter, the acceleration time parameter, the deceleration time parameter and the uniform motion time;
determining the target acceleration of the second preset time point according to the time value of the second preset time point and the target acceleration;
correspondingly, the performing instruction planning based on the control parameter, the target jerk and the target acceleration to obtain a target control instruction includes:
determining the point location of the second preset time point based on the target acceleration, the target acceleration of the second preset time point, the initial point location parameter and the time value of the second preset time point;
and performing instruction planning based on the time value of the second preset time point, the point position of the second preset time point, the target acceleration and the target acceleration of the second preset time point to obtain a target control instruction.
In a second aspect, the present application discloses a servo motor control device applied to a servo driver, including:
the signal acquisition module is used for acquiring IO control signals;
the first parameter determining module is used for determining control parameters according to the IO control signals and the current state parameters of the servo motor corresponding to the servo driver;
the second parameter determining module is used for determining the target acceleration according to the control parameters;
the third parameter determining module is used for determining a target acceleration according to the target acceleration and the control parameter;
the command planning module is used for carrying out command planning on the basis of the control parameters, the target acceleration and the target acceleration to obtain a target control command;
and the control module is used for controlling the motion of the servo motor by utilizing the target control instruction.
In a third aspect, the present application discloses a servo driver comprising:
a memory and a processor;
wherein the memory is used for storing a computer program;
the processor is used for executing the computer program to realize the servo motor control method disclosed in the foregoing.
In a fourth aspect, the present application discloses a computer readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the servo motor control method disclosed above.
It can be seen that, according to the method and the device, an IO control signal needs to be acquired first, then a control parameter is determined according to the IO control signal and a current state parameter of the servo motor corresponding to the servo driver, a target acceleration is determined according to the control parameter, then the target acceleration is determined according to the target acceleration and the control parameter, and based on the control parameter, the target acceleration and the target acceleration, instruction planning is performed to obtain a target control instruction, so that the target control instruction can be utilized to control the motion of the servo motor. Therefore, after the IO control signal is acquired, the control parameters can be determined according to the IO control signal and the current state parameters of the servo motor corresponding to the servo driver, then the target acceleration is determined according to the control parameters, then the target acceleration is determined according to the target acceleration and the control parameters, then the command planning is carried out on the basis of the control parameters, the target acceleration and the target acceleration, the planned command is used for controlling the motion of the servo motor, the acceleration of the motion can be controlled, and the smooth transition of the acceleration and the speed in the motion process is controlled, so that the mechanical vibration of the servo motor is reduced, and the mechanical damage is avoided.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flow chart of a servo motor control method disclosed in the present application;
FIG. 2 is a schematic diagram of an S-shaped curve plan disclosed herein;
FIG. 3 is a flow chart of a particular servo motor control method disclosed herein;
FIG. 4 is a flow chart of a speed control disclosed herein;
FIG. 5 is a flow chart of a particular servo motor control method disclosed herein;
FIG. 6 is a point location control flow disclosed herein;
fig. 7 is a schematic structural diagram of a servo motor control device disclosed in the present application;
fig. 8 is a structural diagram of a servo driver disclosed in the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
At present, the speed and position planning in a servo product generally adopts a trapezoidal curve planning, the trapezoidal curve planning can enable the acceleration of a servo system in the acceleration and deceleration processes to be controllable, and the mechanical impact can be reduced to a certain extent, but the situation that the speed or acceleration is changed in a step change exists in the servo starting and reaching stages can cause mechanical vibration in the speed starting stage and the speed reaching stage, and the mechanical structure can be damaged. In view of this, the present application provides a method for controlling a servo motor, which can control the acceleration of a motion, so as to control the acceleration and the smooth transition of the velocity in the motion process, so as to reduce the mechanical vibration of the servo motor and ensure that the machine is not damaged.
Referring to fig. 1, an embodiment of the present application discloses a servo motor control method applied to a servo driver, where the method includes:
step S11: and obtaining an IO control signal.
In practical application, an IO (Input/Output) control signal needs to be obtained first, where the IO control signal includes a speed control signal and a point control signal. The IO control signal comprises a target speed parameter or a target point parameter so as to determine the speed or the point position to be reached by the servo motor.
Step S12: and determining control parameters according to the IO control signals and the current state parameters of the servo motor corresponding to the servo driver.
Correspondingly, after the IO control signal is obtained, a control parameter needs to be determined according to the IO control signal and the current state parameter of the servo motor corresponding to the servo driver.
Target parameters may be determined according to the IO control signals. Specifically, when the IO control signal is a speed control signal, a target speed parameter can be determined according to the IO control signal, and the target speed parameter is a speed required by the IO control signal and reached by the servo motor. The IO control signal may include a specific target speed parameter, or different speed parameters may be stored in the servo controller, and then a number is given to each speed parameter, and the IO control signal is sent when the speed needs to be adjusted each time, where the IO control signal includes the number of the target speed parameter, so that the target speed parameter can be determined according to the number of the target speed parameter in the IO control information. Correspondingly, if the IO control signal is a point location control signal, the same method is also used to determine the target point location parameter.
Determining the current state parameters of the servo motor so as to determine the initial parameters of local motion control. The state parameters include, but are not limited to, a current initial speed parameter, an initial acceleration parameter, an initial point number, a current time parameter, and the like of the servo motor.
In addition, after the IO control signal is acquired, some parameters stored locally, including but not limited to a smoothing time parameter, an acceleration time parameter, a deceleration time parameter, a maximum speed parameter, and the like, need to be read, so as to control the speed or the point location within each period of time more accurately. Wherein the smoothing time parameter represents a time when the acceleration is uniformly changed.
And determining target parameters, the current state parameters of the servo motor and some read locally stored parameters according to the IO control signals to be used as the control parameters so as to control the motion of the servo motor.
Step S13: and determining the target jerk according to the control parameter.
After the target parameter is determined, a target jerk may be determined using the control parameter. Specifically, the target jerk may be determined using the initial speed parameter, the target speed parameter, the smoothing time parameter, the acceleration time parameter and/or the deceleration time parameter, and a kinematic formula.
Step S14: and determining the target acceleration according to the target acceleration and the control parameter.
After the target jerk is obtained, a target acceleration may be determined using the target jerk and the control parameter. Specifically, the target acceleration at a preset time point is determined by using the target jerk, the smoothing time parameter, the acceleration time parameter and/or the deceleration time parameter, wherein the preset time point is some time points determined according to the smoothing time parameter, the acceleration time parameter and the deceleration time parameter, so as to control the speed or point position of the servo motor, and to ensure that the speed or the acceleration is in smooth transition.
Step S15: and performing instruction planning based on the control parameters, the target acceleration and the target acceleration to obtain a target control instruction.
After the target acceleration is obtained, command planning can be performed based on the control parameter, the target jerk and the target acceleration to obtain a target control command.
Specifically, when the IO control signal is a speed control signal, the speed value of the preset time point is determined according to the initial speed parameter, the time value of the preset time point, the target acceleration of the preset time point, and the target jerk, then a control formula of the speed in each time period is determined according to the speed value of the preset time point, the time value of the preset time point, the target acceleration of the preset time point, and the target jerk, and then a target control instruction is determined according to the control formula of the speed in each time period and the corresponding time.
When the IO control signal is a point location control signal, determining a speed value of the preset time point according to the initial speed parameter, the time value of the preset time point, the target acceleration of the preset time point and the target jerk, then determining a point location of the preset time point based on the target jerk, the target acceleration of the preset time point, the initial point location parameter, the speed value of the preset time point and the time value of the preset time point, then determining a point location control formula in each time period based on the time value of the preset time point, the point location of the preset time point, the target jerk and the target acceleration, and then determining a target control instruction according to the point location control formula and the corresponding time in each time period.
Step S16: and controlling the motion of the servo motor by using the target control command.
It will be appreciated that after the target control command is determined, the target control command may be used to control the movement of the servo motor.
Therefore, the acceleration and the jerk in the motion process are controlled, an S-shaped curve plan can be obtained, the speed and acceleration changes in each time period are in stable transition, the vibration between machines in the motion process can be reduced, and the service life of the machines is prolonged.
In addition, compared with the method that a Programmable Logic Controller (PLC) is adopted for command planning, the method and the system can directly carry out command planning in the servo driver, and therefore system cost can be saved.
It can be seen that, according to the method and the device, an IO control signal needs to be acquired first, then a control parameter is determined according to the IO control signal and a current state parameter of the servo motor corresponding to the servo driver, a target acceleration is determined according to the control parameter, then the target acceleration is determined according to the target acceleration and the control parameter, and based on the control parameter, the target acceleration and the target acceleration, instruction planning is performed to obtain a target control instruction, so that the target control instruction can be utilized to control the motion of the servo motor. Therefore, after the IO control signal is acquired, the control parameters can be determined according to the IO control signal and the current state parameters of the servo motor corresponding to the servo driver, then the target acceleration is determined according to the control parameters, then the target acceleration is determined according to the target acceleration and the control parameters, then the command planning is carried out on the basis of the control parameters, the target acceleration and the target acceleration, the planned command is used for controlling the motion of the servo motor, the acceleration of the motion can be controlled, and the smooth transition of the acceleration and the speed in the motion process is controlled, so that the mechanical vibration of the servo motor is reduced, and the mechanical damage is avoided.
Referring to fig. 2, a schematic diagram of the S-shaped curve is shown. In the figure Vs represents the initial speed parameter, Vm represents the maximum speed parameter and Ve represents the target speed parameter. J1 and J2 represent jerk values for the variable acceleration and deceleration sections, respectively. Tsl is defined as a smoothing time parameter, Tacc is defined as an acceleration time parameter, and Tdec is defined as a deceleration time parameter, wherein Tacc is seen as a time difference between an intersection of an extension line of a uniform acceleration section and an extension line of a maximum speed parameter and an intersection of an extension line of a uniform acceleration section and an abscissa, and Tdec is a time difference between an intersection of an extension line of a uniform acceleration and deceleration section and an extension line of a maximum speed parameter and an intersection of an extension line of a uniform acceleration section and an abscissa. t0-t1 represents an acceleration uniform increasing period, t1-t2 represents a uniform acceleration period, t2-t3 represents an acceleration uniform decreasing period, t3-t4 represents a uniform motion period, t4-t5 represents a deceleration uniform increasing period, t5-t6 represents a uniform deceleration period, t6-t7 represents a deceleration uniform decreasing period, #1 represents a t0-t1 period, #2 represents a t1-t2 period, #3 represents a t2-t3 period, #4 represents a t3-t4 period, #5 represents a t4-t5 period, #6 represents a t5-t6 period, and #7 represents a t6-t7 period.
Referring to fig. 3, an embodiment of the present application discloses a specific method for acquiring an IO control signal, which is applied to a servo driver, and the method includes:
step S21: and obtaining an IO control signal.
Step S22: and when the IO control signal is a speed control signal, reading a first parameter stored locally, wherein the first parameter comprises a smoothing time parameter, an acceleration time parameter and a deceleration time parameter.
After the IO control signal is acquired, if the IO control signal is a speed control signal, a first parameter stored locally needs to be read, where the first parameter includes a smoothing time parameter, an acceleration time parameter, and a deceleration time parameter.
Step S23: and determining a target speed parameter according to the IO control signal.
A target speed parameter is also determined from the IO control signal. Specifically, the target speed parameter in the IO control signal may be directly obtained, or the number of the target speed parameter in the IO control signal may be obtained, and the target speed parameter may be determined according to the number of the target speed parameter, the locally stored speed parameter, and the correspondence relationship between the numbers.
Step S24: and determining the first parameter, the target speed parameter and the current state parameter of the servo motor corresponding to the servo driver as the control parameter, wherein the state parameter comprises the current initial speed parameter, the current initial acceleration parameter and the current time parameter of the servo motor.
Step S25: and determining the target jerk according to the control parameter.
After determining the control parameter, a target jerk may be determined based on the control parameter. And when the IO control signal is an acceleration control signal, determining the target acceleration according to the target speed parameter, the initial speed parameter, the smoothing time parameter and the acceleration time parameter. Specifically, the target jerk is determined according to a first operation formula, the target speed parameter, the initial speed parameter, the smoothing time parameter, and the acceleration time parameter, where the first operation formula is
And when the IO control signal is a deceleration control signal, determining the target acceleration according to the target speed parameter, the initial speed parameter, the smoothing time parameter and the deceleration time parameter. The specific calculation may refer to a calculation method at the time of acceleration.
Step S26: and when the IO control signal is an acceleration control signal, determining a time value of a first preset time point according to the smoothing time parameter and the acceleration time parameter.
In an actual application process, when the IO control signal is an acceleration control signal, determining a time value of a first preset time point according to the smoothing time parameter and the acceleration time parameter. Wherein, the first preset time points are time points t0, t1, t2 and t 3. Specifically, the time value of the first preset time point is shown in table 1 below.
TABLE 1
Step S27: and determining the target acceleration of the first preset time point according to the time value of the first preset time point and the target acceleration.
After the time value of the first preset time point is determined, the target acceleration of the first preset time point can be determined according to the time value of the first preset time point and the target jerk. Specifically, the target acceleration at the first preset time point is determined according to a second operation formula, the time value at the first preset time point and the target jerk, where the second operation formula is that a is a0+ Jt, wherein, a0Represents the initial acceleration, J represents jerk, t represents time, and a represents acceleration. If the initial acceleration parameter is 0, the acceleration value at the first preset time point is shown in table 2 below.
TABLE 2
Where a0 denotes the target acceleration at time t0, a1 denotes the target acceleration at time t1, a2 denotes the target acceleration at time t2, and a3 denotes the target acceleration at time t 3.
Step S28: and determining the speed value of the first preset time point by using the initial speed parameter, the time value of the first preset time point, the target acceleration of the first preset time point and the target jerk.
After the target acceleration at the first preset time point is determined, the speed value at the first preset time point may be determined by using the initial speed parameter, the time value at the first preset time point, the target acceleration at the first preset time point, and the target jerk. Specifically, the speed value at the first preset time point is determined by using a third operation formula, the initial speed parameter, the time value at the first preset time point, the target acceleration at the first preset time point, and the target jerk, where the third operation formula is: v is Vc+ at, where Vc denotes the initial velocity and V denotes the velocity.
Specifically, the speed value at the first preset time point is shown in table 3 below.
TABLE 3
Where V0 denotes the speed at time t0, V1 denotes the speed at time t1, V2 denotes the speed at time t2, and V2 denotes the speed at time t 3.
Step 29: and performing instruction planning based on the speed value of the first preset time point, the time value of the first preset time point, the target acceleration of the first preset time point and the target jerk to obtain a target control instruction.
After the speed value at the first preset time point is determined, command planning may be performed based on the speed value at the first preset time point, the time value at the first preset time point, the target acceleration at the first preset time point, and the target jerk to obtain a target control command. Specifically, a speed control formula of each time period corresponding to the first preset time point is determined based on the speed value of the first preset time point, the time value of the first preset time point, the target acceleration of the first preset time point and the target jerk, and then a target control instruction is determined according to the speed control formula and the corresponding time in each time period. The velocity control formula for each time period can be seen in table 4.
TABLE 4
Correspondingly, when the IO control signal is a deceleration control signal, the determination process of the target control instruction is the same as that in acceleration.
In a specific implementation process, the setting of the smoothing time parameter Tsl and the acceleration time parameter Tacc needs to satisfy a certain requirement, that is: tacc > Tsl, otherwise the S-shaped velocity profile will not be correctly planned.
Accordingly, the setting of the smoothing time parameter Tsl and the deceleration time parameter Tdec also needs to satisfy certain requirements, namely: tdec > Tsl.
Referring to fig. 4, a flow chart of speed control is shown. Taking acceleration as an example, the jerk J1 is calculated, then the time nodes of each planning interval are calculated, the acceleration of each time node is calculated, then the velocity of each time node is calculated, and then the S-shaped curve planning velocity timing calculation can be started.
Referring to fig. 5, an embodiment of the present application discloses a specific servo motor control method applied to a servo driver, where the method includes:
step S301: and obtaining an IO control signal.
Step S302: and when the IO control signal is a point location control signal, reading a second parameter stored locally, wherein the second parameter comprises the first parameter and a maximum speed parameter.
After the IO control signal is acquired, if the IO control signal is a point location control signal, reading a second parameter stored locally, wherein the second parameter includes the first parameter and a maximum speed parameter. That is, the second parameter includes the smoothing time parameter, the acceleration time parameter, the deceleration time parameter, and the maximum speed parameter.
Step S303: and determining a target point bit parameter according to the IO control signal.
The target point bit parameters are also determined according to the IO control signals. Specifically, the target point bit parameter in the IO control signal may be directly obtained, or the number of the target point bit parameter in the IO control signal may be obtained, and the target point bit parameter may be determined according to the number of the target point bit parameter, the locally stored point bit parameter, and the correspondence between the numbers.
Step S304: and determining the second parameter, the target point position parameter and the current state parameter of the servo motor corresponding to the servo driver as the control parameter, wherein the state parameter comprises the current initial speed parameter, the current initial acceleration parameter, the current time parameter and the initial point position parameter of the servo motor.
Step S305: and determining the uniform motion time corresponding to the maximum speed parameter based on the target point location parameter, the initial point location parameter, the maximum speed parameter, the smoothing time parameter, the acceleration time parameter and the deceleration time parameter.
After the control parameters are determined, the uniform motion time corresponding to the maximum speed parameter can be determined based on the target point location parameter, the initial point location parameter, the maximum speed parameter, the smoothing time parameter, the acceleration time parameter and the deceleration time parameter. Determining the uniform motion time corresponding to the maximum speed parameter based on a fourth operational formula, wherein the fourth operational formula is as follows:
S=Vs*(Tsl+Tacc)+0.5*Vm*(Tsl+Tacc)+Vm*tm+Ve*(Tsl+Tdec)+0.5*Vm*(Tsl+Tdec)
wherein, tmAnd S represents the difference value between the target point location parameter and the initial point location parameter.
Step S306: and determining the target jerk according to the control parameter.
After determining the control parameter, a target jerk may be determined based on the control parameter. Wherein the target jerk parameter includes a jerk value J1 for a variable acceleration segment and a jerk value J2 for a variable deceleration segment. Determining a jerk value J1 of the variable acceleration section by using a fifth operation formula, and determining a jerk value J2 of the variable deceleration section by using a sixth operation formula, wherein the fifth operation formula and the sixth operation formula are respectively:
step S307: and determining a time value of a second preset time point based on the smoothing time parameter, the acceleration time parameter, the deceleration time parameter and the uniform motion time.
In an actual application process, a time value of a second preset time point is further determined based on the smoothing time parameter, the acceleration time parameter, the deceleration time parameter, and the uniform motion time, where the second preset time point is time points t0, t1, t2, t3, t4, t5, t6, and t7, and specifically, the time value of the second preset time point is shown in table 5 below.
TABLE 5
Step S308: and determining the target acceleration of the second preset time point according to the time value of the second preset time point and the target acceleration.
And determining the target acceleration at the second preset time point according to the time value at the second preset time point and the target jerk. If the initial acceleration parameter is 0, the acceleration value at the second preset time point is shown in table 6 below.
TABLE 6
a4 denotes the target acceleration at time t4, a5 denotes the target acceleration at time t5, a6 denotes the target acceleration at time t6, and a7 denotes the target acceleration at time t 7.
Step S309: and determining the point location of the second preset time point based on the target acceleration, the target acceleration of the second preset time point, the initial point location parameter and the time value of the second preset time point.
After the target acceleration at the second preset time point is determined, the point location at the second preset time point may be determined based on the target jerk, the target acceleration at the second preset time point, the initial point location parameter, and the time value at the second preset time point.
Specifically, the speed value at the second preset time point needs to be determined based on the initial speed parameter, the time value at the second preset time point, the target acceleration at the second preset time point, and the target jerk. In an actual process, the velocity value determination formula may refer to the aforementioned third operation formula, and the velocity values at the second preset time points may be obtained through calculation, and the velocity values at the second preset time points are shown in table 7.
TABLE 7
After the speed value of the second preset time point is determined, the point location of the second preset time point may be determined based on the target jerk, the target acceleration of the second preset time point, the initial point location parameter, the time value of the second preset time point, and the speed value of the second preset time point.
Specifically, the point location calculation of each second preset time point may be calculated according to a displacement calculation formula in kinematics, and a point location value of each second preset time point may be obtained through calculation, where the point location of each second preset time point is shown in table 8.
TABLE 8
Step S310: and performing instruction planning based on the time value of the second preset time point, the point position of the second preset time point, the target acceleration and the target acceleration of the second preset time point to obtain a target control instruction.
After the speed values at the time points are determined, command planning can be performed based on the time value at the second preset time point, the point location at the second preset time point, the target jerk and the target acceleration at the second preset time point, so that a target control command is obtained.
In a specific implementation process, the setting of the smoothing time parameter Tsl and the acceleration time parameter Tacc needs to satisfy certain requirements, that is: tacc > Tsl, otherwise the S-shaped velocity profile will not be correctly planned.
Accordingly, the setting of the smoothing time parameter Tsl and the deceleration time parameter Tdec also needs to satisfy certain requirements, namely: tdec > Tsl. In addition, the duration t of the maximum rotation speed end needs to be satisfiedm>0, otherwise, the point S-shaped curve cannot be correctly planned.
Specifically, a point location control formula in each time period is determined based on the time value of the preset time point, the point location of the preset time point, the target jerk, and the target acceleration of the preset time point, and then a target control command may be determined according to the point location control formula in each time period and the corresponding time. The point location control formula in each time period may refer to a displacement calculation formula in kinematics, and after the point location control formula in each time period is determined by using the displacement calculation formula, the obtained point location control formula in each time period is shown in table 9.
TABLE 9
Referring to fig. 6, a point location control flow chart is shown. Firstly, determining constant-speed running time according to the displacement travel and the maximum rotating speed, then calculating the jerk J1 of an acceleration section and the jerk J2 of a deceleration section, then calculating the time nodes of each planning interval, calculating the acceleration of each time node, then calculating the speed of each time node, then calculating the position of each time node, and then starting the S-shaped curve planning position timing calculation.
Referring to fig. 7, an embodiment of the present application discloses a servo motor control device, which is applied to a servo driver, and includes:
the signal acquisition module 11 is configured to acquire an IO control signal;
a first parameter determining module 12, configured to determine a control parameter according to the IO control signal and a current state parameter of a servo motor corresponding to the servo driver;
a second parameter determining module 13, configured to determine a target jerk according to the control parameter;
a third parameter determining module 14, configured to determine a target acceleration according to the target jerk and the control parameter;
the instruction planning module 15 is configured to perform instruction planning based on the control parameter, the target jerk, and the target acceleration to obtain a target control instruction;
and the control module 16 is used for controlling the motion of the servo motor by using the target control instruction.
It can be seen that, according to the method and the device, an IO control signal needs to be acquired first, then a control parameter is determined according to the IO control signal and a current state parameter of the servo motor corresponding to the servo driver, a target acceleration is determined according to the control parameter, then the target acceleration is determined according to the target acceleration and the control parameter, and based on the control parameter, the target acceleration and the target acceleration, instruction planning is performed to obtain a target control instruction, so that the target control instruction can be utilized to control the motion of the servo motor. Therefore, after the IO control signal is acquired, the control parameters can be determined according to the IO control signal and the current state parameters of the servo motor corresponding to the servo driver, then the target acceleration is determined according to the control parameters, then the target acceleration is determined according to the target acceleration and the control parameters, then the command planning is carried out on the basis of the control parameters, the target acceleration and the target acceleration, the planned command is used for controlling the motion of the servo motor, the acceleration of the motion can be controlled, and the smooth transition of the acceleration and the speed in the motion process is controlled, so that the mechanical vibration of the servo motor is reduced, and the mechanical damage is avoided.
Further, referring to fig. 8, an embodiment of the present application further discloses a servo driver, including: a processor 21 and a memory 22.
Wherein the memory 22 is used for storing a computer program; the processor 22 is configured to execute the computer program to implement the servo motor control method disclosed in the foregoing embodiment.
For the specific process of the servo motor control method, reference may be made to the corresponding contents disclosed in the foregoing embodiments, and details are not repeated herein.
Further, an embodiment of the present application also discloses a computer-readable storage medium for storing a computer program, wherein the computer program is executed by a processor to implement the servo motor control method disclosed in any of the foregoing embodiments.
For the specific process of the servo motor control method, reference may be made to the corresponding contents disclosed in the foregoing embodiments, and details are not repeated herein.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Finally, it is further noted that, herein, 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. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of other elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The method, the device, the equipment and the medium for controlling the servo motor provided by the application are described in detail, specific examples are applied in the description to explain the principle and the implementation mode of the application, and the description of the embodiments is only used for helping to understand the method and the core idea of the application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.
Claims (10)
1. A servo motor control method is applied to a servo driver and comprises the following steps:
obtaining an IO control signal;
determining control parameters according to the IO control signals and the current state parameters of the servo motor corresponding to the servo driver;
determining a target jerk according to the control parameters;
determining a target acceleration according to the target acceleration and the control parameter;
performing instruction planning based on the control parameters, the target acceleration and the target acceleration to obtain a target control instruction;
and controlling the motion of the servo motor by using the target control command.
2. The servo motor control method according to claim 1, wherein the determining the control parameter according to the IO control signal and the current state parameter of the servo motor corresponding to the servo driver comprises:
when the IO control signal is a speed control signal, reading a first parameter stored locally, wherein the first parameter comprises a smoothing time parameter, an acceleration time parameter and a deceleration time parameter;
determining a target speed parameter according to the IO control signal;
and determining the first parameter, the target speed parameter and the current state parameter of the servo motor corresponding to the servo driver as the control parameter, wherein the state parameter comprises the current initial speed parameter, the current initial acceleration parameter and the current time parameter of the servo motor.
3. The servo motor control method of claim 2, wherein the determining a target jerk based on the control parameter comprises:
when the IO control signal is an acceleration control signal, determining the target acceleration according to the target speed parameter, the initial speed parameter, the smoothing time parameter and the acceleration time parameter;
and when the IO control signal is a deceleration control signal, determining the target acceleration according to the target speed parameter, the initial speed parameter, the smoothing time parameter and the deceleration time parameter.
4. The servo motor control method of claim 2, wherein the determining a target acceleration from the target jerk and the control parameter comprises:
when the IO control signal is an acceleration control signal, determining a time value of a first preset time point according to the smoothing time parameter and the acceleration time parameter;
determining the target acceleration of the first preset time point according to the time value of the first preset time point and the target acceleration;
correspondingly, the performing instruction planning based on the control parameter, the target jerk and the target acceleration to obtain a target control instruction includes:
determining a speed value of the first preset time point by using the initial speed parameter, the time value of the first preset time point, the target acceleration of the first preset time point and the target jerk;
and performing instruction planning based on the speed value of the first preset time point, the time value of the first preset time point, the target acceleration of the first preset time point and the target jerk to obtain a target control instruction.
5. The servo motor control method according to claim 2, wherein the determining the control parameter according to the IO control signal and the current state parameter of the servo motor corresponding to the servo driver comprises:
when the IO control signal is a point location control signal, reading a second parameter stored locally, wherein the second parameter comprises the first parameter and a maximum speed parameter;
determining a target point bit parameter according to the IO control signal;
and determining the second parameter, the target point position parameter and the current state parameter of the servo motor corresponding to the servo driver as the control parameter, wherein the state parameter comprises the current initial speed parameter, the current initial acceleration parameter, the current time parameter and the initial point position parameter of the servo motor.
6. The servo motor control method of claim 5, wherein prior to determining the target jerk based on the control parameter, further comprising:
and determining the uniform motion time corresponding to the maximum speed parameter based on the target point location parameter, the initial point location parameter, the maximum speed parameter, the smoothing time parameter, the acceleration time parameter and the deceleration time parameter.
7. The servo motor control method of claim 6, wherein the determining a target acceleration from the target jerk and the control parameter comprises:
determining a time value of a second preset time point based on the smoothing time parameter, the acceleration time parameter, the deceleration time parameter and the uniform motion time;
determining the target acceleration of the second preset time point according to the time value of the second preset time point and the target acceleration;
correspondingly, the performing instruction planning based on the control parameter, the target jerk and the target acceleration to obtain a target control instruction includes:
determining the point location of the second preset time point based on the target acceleration, the target acceleration of the second preset time point, the initial point location parameter and the time value of the second preset time point;
and performing instruction planning based on the time value of the second preset time point, the point position of the second preset time point, the target acceleration and the target acceleration of the second preset time point to obtain a target control instruction.
8. A servo motor control device is characterized by being applied to a servo driver and comprising:
the signal acquisition module is used for acquiring IO control signals;
the first parameter determining module is used for determining control parameters according to the IO control signals and the current state parameters of the servo motor corresponding to the servo driver;
the second parameter determining module is used for determining the target acceleration according to the control parameters;
the third parameter determining module is used for determining a target acceleration according to the target acceleration and the control parameter;
the command planning module is used for carrying out command planning on the basis of the control parameters, the target acceleration and the target acceleration to obtain a target control command;
and the control module is used for controlling the motion of the servo motor by utilizing the target control instruction.
9. A servo driver, comprising:
a memory and a processor;
wherein the memory is used for storing a computer program;
the processor is configured to execute the computer program to implement the servo motor control method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the servo motor control method of any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010692602.3A CN113965140A (en) | 2020-07-17 | 2020-07-17 | Servo motor control method, device, equipment and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010692602.3A CN113965140A (en) | 2020-07-17 | 2020-07-17 | Servo motor control method, device, equipment and medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113965140A true CN113965140A (en) | 2022-01-21 |
Family
ID=79459309
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010692602.3A Pending CN113965140A (en) | 2020-07-17 | 2020-07-17 | Servo motor control method, device, equipment and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113965140A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114475658A (en) * | 2022-02-23 | 2022-05-13 | 广州小鹏自动驾驶科技有限公司 | Method and device for planning automatic driving speed, vehicle and storage medium |
-
2020
- 2020-07-17 CN CN202010692602.3A patent/CN113965140A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114475658A (en) * | 2022-02-23 | 2022-05-13 | 广州小鹏自动驾驶科技有限公司 | Method and device for planning automatic driving speed, vehicle and storage medium |
CN114475658B (en) * | 2022-02-23 | 2023-08-25 | 广州小鹏自动驾驶科技有限公司 | Automatic driving speed planning method and device, vehicle and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110757455B (en) | Speed planning method | |
JP3830475B2 (en) | Control device | |
US10254741B2 (en) | Robot apparatus having learning function | |
CN102006011A (en) | Controller of electric motor having function of estimating inertia and friction simultaneously | |
JPH0799486B2 (en) | Angular acceleration control method | |
JP2018149606A (en) | Robot for executing learning control taking application in production line into consideration and method for control thereof | |
JP2003228800A (en) | Generator for generating recommended control amount for vehicle | |
US6920363B2 (en) | Acceleration and deceleration control method | |
CN112130598B (en) | Torque filtering method and device | |
CN113965140A (en) | Servo motor control method, device, equipment and medium | |
CN112528434B (en) | Information identification method and device, electronic equipment and storage medium | |
CN111993411A (en) | Robot motion planning method and device, robot and storage medium | |
JP7439680B2 (en) | Shift control data generation method, shift control device, shift control system, and vehicle learning device | |
CN111487930B (en) | Motion control system, method and device based on symmetric graph replacement technology, machine tool and storage medium | |
CN105320075A (en) | Numerical controller having function of controlling speed by superimposed control | |
JP2014174842A (en) | S-shaped acceleration/deceleration control program, operation control program, recording medium, controller, s-shaped acceleration/deceleration control calculation method, and work operation control system | |
JPS59181997A (en) | Deciding method of acceleration and deceleration of motor | |
JP7222427B2 (en) | Control system, control device and control method | |
JPH09269831A (en) | Vehicle controller | |
JP2001154719A (en) | Method for interpolating free curve | |
JP2000163114A (en) | Intra-interpolation curve acceleration and deceleration processing method | |
CN114123892B (en) | Observer-based linear traction system terminal sliding mode control method and system | |
CN114030460A (en) | Torque control method and device of hybrid electric vehicle | |
JP5381806B2 (en) | Numerical control device for machine tool, numerical control method for machine tool, and numerical control program for machine tool | |
CN118068780A (en) | S-shaped acceleration and deceleration speed forward-looking end speed correction method, equipment and medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |