Disclosure of Invention
Aiming at the problems in the prior art, the application provides a sliding mode variable structure control method and device for robot servo, which can construct a sliding plane switching function according to current, rotating speed and position feedback information, then calculate the output of a controller according to the switching function, apply the output to a controlled object and complete closed-loop control.
In order to solve at least one of the above problems, the present application provides the following technical solutions:
in a first aspect, the present application provides a sliding mode variable structure control method for robot servo, including:
establishing a controlled object transfer function and a three-order sliding mode variable structure control model of a servo system;
a current sensor and a position sensor are adopted to collect motor current and real-time position and speed feedback;
calculating an error and a second order differential of the error according to the command and the feedback information;
calculating a switching surface function s according to the error state;
and calculating the variable structure control law output U according to the switching surface function s and the selected approach rate.
Further, the establishing of the controlled object transfer function of the servo system includes:
establishing a controlled model transfer function of the servo system as follows:
wherein:
r is motor phase resistance, L is motor phase inductance, K
tIs a torque constant, K
eAnd J is the rotor inertia for the back emf coefficient.
Further, the calculating the error and the second order differential of the error according to the instruction and the feedback information includes:
the system control period is 50us, the system error is defined as e, position theta, speed v(s) and current feedback I(s) signals are collected in each period, and x is used1,x2,x3A second order differential, representing the error and the error, respectively, can be calculated in conjunction with instruction P (t) as follows:
x1=e=P(t)-Bpθ(t)
further, the calculating the variable structure control law output U according to the switching surface function s and the selected approach rate includes:
according to the error term, selecting the switching surface function s ═ f (x)1,x2,x3)=c1x1+c2x2+x3The designed approach rate function is:
wherein, c1,c2And epsilon and k are adjusting parameters of the variable structure sliding film controller.
Further, the calculating the variable structure control law output U includes:
according to the approach rate and the second-order differential of the error, the output of the variable structure controller is designed as follows:
in a second aspect, the present application provides a sliding mode variable structure control device for robot servo, comprising:
the model establishing module is used for establishing a controlled object transfer function and a three-order sliding variable structure control model of the servo system;
the motor information acquisition module is used for acquiring motor current and real-time position and speed feedback by adopting a current sensor and a position sensor;
the error calculation module is used for calculating an error and a second-order differential of the error according to the instruction and the feedback information;
the switching surface function calculation module is used for calculating a switching surface function s according to the error state;
and the output calculation module is used for calculating the variable structure control law output U according to the switching surface function s and the selected approach rate.
In a third aspect, the present application provides an electronic device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the method for controlling a sliding mode variable structure of a robot servo.
In a fourth aspect, the present application provides a computer readable storage medium having stored thereon a computer program which, when being executed by a processor, carries out the steps of the method for controlling a sliding kinematic structure of a robot servo.
According to the technical scheme, the sliding mode variable structure control method and device for the robot servo are provided, and a controlled object transfer function and a three-order sliding mode variable structure control model of a servo system are established; a current sensor and a position sensor are adopted to collect motor current and real-time position and speed feedback; calculating an error and a second order differential of the error according to the command and the feedback information; calculating a switching surface function s according to the error state; and calculating the variable structure control law output U according to the switching surface function s and the selected approach rate, constructing a sliding surface switching function according to the current, the rotating speed and the position feedback information, calculating the output of the controller according to the switching function, and applying the output to the controlled object to complete closed-loop control.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, 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 some embodiments of the present application, but not all 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.
Considering that the current robot servo mainly adopts a three-ring cascade PID control method, the method has the following defects: 1) in order to prevent overshoot, the position loop generally adopts a single proportional controller, and the steady-state precision is poor. 2) The PID control has poor adaptability to system parameter perturbation and external parameter change. 3) Aiming at the problem that the uncertainty of a system and the uncertainty of a model cannot keep excellent dynamic performance, the application provides a sliding mode variable structure control method and device of robot servo, and a controlled object transfer function and a three-order sliding mode variable structure control model of a servo system are established; a current sensor and a position sensor are adopted to collect motor current and real-time position and speed feedback; calculating an error and a second order differential of the error according to the command and the feedback information; calculating a switching surface function s according to the error state; and calculating the variable structure control law output U according to the switching surface function s and the selected approach rate, constructing a sliding surface switching function according to the current, the rotating speed and the position feedback information, calculating the output of the controller according to the switching function, and applying the output to the controlled object to complete closed-loop control.
In order to construct a sliding surface switching function according to current, rotation speed and position feedback information, and then calculate the output of a controller according to the switching function, apply the output to a controlled object, and complete closed-loop control, the present application provides an embodiment of a sliding surface variable structure control method of a robot servo, and referring to fig. 1, the sliding surface variable structure control method of the robot servo specifically includes the following contents:
step S101: establishing a controlled object transfer function and a three-order sliding mode variable structure control model of a servo system;
step S102: a current sensor and a position sensor are adopted to collect motor current and real-time position and speed feedback;
step S103: calculating an error and a second order differential of the error according to the command and the feedback information;
step S104: calculating a switching surface function s according to the error state;
step S105: and calculating the variable structure control law output U according to the switching surface function s and the selected approach rate.
As can be seen from the above description, the sliding mode variable structure control method for robot servo provided in the embodiments of the present application can be implemented by establishing a controlled object transfer function and a three-order sliding mode variable structure control model of a servo system; a current sensor and a position sensor are adopted to collect motor current and real-time position and speed feedback; calculating an error and a second order differential of the error according to the command and the feedback information; calculating a switching surface function s according to the error state; and calculating the variable structure control law output U according to the switching surface function s and the selected approach rate, constructing a sliding surface switching function according to the current, the rotating speed and the position feedback information, calculating the output of the controller according to the switching function, and applying the output to the controlled object to complete closed-loop control.
In an embodiment of the sliding mode variable structure control method for robot servo, the establishing a controlled object transfer function of the servo system includes:
establishing a controlled model transfer function of the servo system as follows:
wherein:
r is motor phase resistance, L is motor phase inductance, K
tIs a torque constant, K
eAnd J is the rotor inertia for the back emf coefficient.
In an embodiment of the present invention, the method for controlling a sliding variable structure of a robot servo according to the present application, the calculating an error and a second order differential of the error according to the command and the feedback information includes:
the system control period is 50us, the system error is defined as e, position theta, speed v(s) and current feedback I(s) signals are collected in each period, and x is used1,x2,x3A second order differential, representing the error and the error, respectively, can be calculated in conjunction with instruction P (t) as follows:
x1=e=P(t)-Bpθ(t)
in an embodiment of the sliding-mode variable-structure control method for robot servo according to the present application, the calculating a variable-structure control law output U according to the switching surface function s and the selected approach rate includes:
according to the error term, selecting the switching surface function s ═ f (x)1,x2,x3)=c1x1+c2x2+x3The designed approach rate function is:
wherein, c1,c2And epsilon and k are adjusting parameters of the variable structure sliding film controller.
In an embodiment of the sliding mode variable structure control method for robot servo according to the present application, the calculating variable structure control law output U includes:
according to the approach rate and the second-order differential of the error, the output of the variable structure controller is designed as follows:
in order to construct a sliding surface switching function according to current, rotation speed and position feedback information, and then calculate the output of a controller according to the switching function, and apply the output to a controlled object to complete closed-loop control, the present application provides an embodiment of a sliding surface variable structure control device for robot servo, which is used for implementing all or part of the sliding surface variable structure control method for robot servo, and referring to fig. 3, the sliding surface variable structure control device for robot servo specifically comprises the following contents:
the model establishing module 10 is used for establishing a controlled object transfer function and a three-order sliding variable structure control model of the servo system;
the motor information acquisition module 20 is used for acquiring motor current and real-time position and speed feedback by adopting a current sensor and a position sensor;
an error calculation module 30, configured to calculate an error and a second order differential of the error according to the instruction and the feedback information;
a switching surface function calculating module 40, configured to calculate a switching surface function s according to the error state;
and the output calculation module 50 is used for calculating the variable structure control law output U according to the switching surface function s and the selected approach rate.
As can be seen from the above description, the sliding mode variable structure control device for robot servo provided in the embodiments of the present application can control a robot by establishing a controlled object transfer function of a servo system and a three-order sliding mode variable structure control model; a current sensor and a position sensor are adopted to collect motor current and real-time position and speed feedback; calculating an error and a second order differential of the error according to the command and the feedback information; calculating a switching surface function s according to the error state; and calculating the variable structure control law output U according to the switching surface function s and the selected approach rate, constructing a sliding surface switching function according to the current, the rotating speed and the position feedback information, calculating the output of the controller according to the switching function, and applying the output to the controlled object to complete closed-loop control.
In order to further explain the present solution, the present application further provides a specific application example of a sliding mode variable structure control method for implementing robot servo by using the sliding mode variable structure control device for robot servo, which specifically includes the following contents:
1) establishing a controlled model transfer function of the servo system as follows:
wherein:
r is motor phase resistance, and L is motor phase inductance.
KtIs a torque constant, KeAnd J is the rotor inertia for the back emf coefficient.
Then from equation (1.2), there is:
a1=Js2Tm
a2=J
a3=KeKmKt
b=KmKt (1.2)
2) designing a three-order sliding mode variable structure control model according to the controlled object, see fig. 2, wherein the three-order sliding mode variable structure controller receives position commands P, Bi、Bv、BpFor current, velocity, position feedback gain, TfIs the disturbance torque.
3) The system control period is 50us, the system error is defined as e, position theta, speed v(s) and current feedback I(s) signals are collected in each period, and x is used1,x2,x3A second order differential, representing the error and the error, respectively, can be calculated in conjunction with command P (t) as follows:
x1=e=P(t)-Bpθ(t)
4) according to the error term, selecting the switching surface function s ═ f (x)1,x2,x3)=c1x1+c2x2+x3The designed approach rate function is:
wherein c is1,c2And epsilon and k are adjusting parameters of the variable structure sliding film controller.
5) According to the approach rate and the second-order differential of the error, the output of the variable structure controller is designed as follows:
as can be seen from the above description, the following technical effects can also be achieved:
1) the structure of the system is changed through the control of the sliding mode variable structure, the stability is not limited by system parameters, and the robustness is good.
2) The parameters needing to be adjusted are few, and the response speed is higher.
3) Insensitive to disturbance and strong disturbance resistance.
In order to construct a sliding surface switching function according to current, rotation speed and position feedback information, and then calculate the output of a controller according to the switching function, apply the output to a controlled object, and complete closed-loop control, the application provides an embodiment of an electronic device for implementing all or part of the sliding surface variable structure control method of the robot servo, and the electronic device specifically includes the following contents:
a processor (processor), a memory (memory), a communication Interface (Communications Interface), and a bus; the processor, the memory and the communication interface complete mutual communication through the bus; the communication interface is used for realizing information transmission between the sliding mode variable structure control device of the robot servo and relevant equipment such as a core service system, a user terminal, a relevant database and the like; the logic controller may be a desktop computer, a tablet computer, a mobile terminal, and the like, but the embodiment is not limited thereto. In this embodiment, the logic controller may be implemented with reference to the embodiment of the sliding mode variable structure control method of robot servo and the embodiment of the sliding mode variable structure control device of robot servo in the embodiment, and the contents thereof are incorporated herein, and repeated descriptions are omitted.
It is understood that the user terminal may include a smart phone, a tablet electronic device, a network set-top box, a portable computer, a desktop computer, a Personal Digital Assistant (PDA), an in-vehicle device, a smart wearable device, and the like. Wherein, intelligence wearing equipment can include intelligent glasses, intelligent wrist-watch, intelligent bracelet etc..
In practical applications, part of the sliding mode variable structure control method of the robot servo can be executed on the electronic device side as described above, and all the operations can be completed in the client device. The selection may be specifically performed according to the processing capability of the client device, the limitation of the user usage scenario, and the like. This is not a limitation of the present application. The client device may further include a processor if all operations are performed in the client device.
The client device may have a communication module (i.e., a communication unit), and may be communicatively connected to a remote server to implement data transmission with the server. The server may include a server on the task scheduling center side, and in other implementation scenarios, the server may also include a server on an intermediate platform, for example, a server on a third-party server platform that is communicatively linked to the task scheduling center server. The server may include a single computer device, or may include a server cluster formed by a plurality of servers, or a server structure of a distributed apparatus.
Fig. 4 is a schematic block diagram of a system configuration of an electronic device 9600 according to an embodiment of the present application. As shown in fig. 4, the electronic device 9600 can include a central processor 9100 and a memory 9140; the memory 9140 is coupled to the central processor 9100. Notably, this fig. 4 is exemplary; other types of structures may also be used in addition to or in place of the structure to implement telecommunications or other functions.
As can be seen from the above description, the electronic device provided in the embodiment of the present application controls the model by establishing a transfer function of a controlled object of a servo system and a three-order sliding deformation structure; a current sensor and a position sensor are adopted to collect motor current and real-time position and speed feedback; calculating an error and a second order differential of the error according to the command and the feedback information; calculating a switching surface function s according to the error state; and calculating the variable structure control law output U according to the switching surface function s and the selected approach rate, constructing a sliding surface switching function according to the current, the rotating speed and the position feedback information, calculating the output of the controller according to the switching function, and applying the output to the controlled object to complete closed-loop control.
In another embodiment, the sliding mode variable structure control device for robot servo may be configured separately from the central processing unit 9100, for example, the sliding mode variable structure control device for robot servo may be configured as a chip connected to the central processing unit 9100, and the sliding mode variable structure control method function of robot servo is realized by the control of the central processing unit.
As shown in fig. 4, the electronic device 9600 may further include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It is noted that the electronic device 9600 also does not necessarily include all of the components shown in fig. 4; further, the electronic device 9600 may further include components not shown in fig. 4, which may be referred to in the art.
As shown in fig. 4, a central processor 9100, sometimes referred to as a controller or operational control, can include a microprocessor or other processor device and/or logic device, which central processor 9100 receives input and controls the operation of the various components of the electronic device 9600.
The memory 9140 can be, for example, one or more of a buffer, a flash memory, a hard drive, a removable media, a volatile memory, a non-volatile memory, or other suitable device. The information relating to the failure may be stored, and a program for executing the information may be stored. And the central processing unit 9100 can execute the program stored in the memory 9140 to realize information storage or processing, or the like.
The input unit 9120 provides input to the central processor 9100. The input unit 9120 is, for example, a key or a touch input device. Power supply 9170 is used to provide power to electronic device 9600. The display 9160 is used for displaying display objects such as images and characters. The display may be, for example, an LCD display, but is not limited thereto.
The memory 9140 can be a solid state memory, e.g., Read Only Memory (ROM), Random Access Memory (RAM), a SIM card, or the like. There may also be a memory that holds information even when power is off, can be selectively erased, and is provided with more data, an example of which is sometimes called an EPROM or the like. The memory 9140 could also be some other type of device. Memory 9140 includes a buffer memory 9141 (sometimes referred to as a buffer). The memory 9140 may include an application/function storage portion 9142, the application/function storage portion 9142 being used for storing application programs and function programs or for executing a flow of operations of the electronic device 9600 by the central processor 9100.
The memory 9140 can also include a data store 9143, the data store 9143 being used to store data, such as contacts, digital data, pictures, sounds, and/or any other data used by an electronic device. The driver storage portion 9144 of the memory 9140 may include various drivers for the electronic device for communication functions and/or for performing other functions of the electronic device (e.g., messaging applications, contact book applications, etc.).
The communication module 9110 is a transmitter/receiver 9110 that transmits and receives signals via an antenna 9111. The communication module (transmitter/receiver) 9110 is coupled to the central processor 9100 to provide input signals and receive output signals, which may be the same as in the case of a conventional mobile communication terminal.
Based on different communication technologies, a plurality of communication modules 9110, such as a cellular network module, a bluetooth module, and/or a wireless local area network module, may be provided in the same electronic device. The communication module (transmitter/receiver) 9110 is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide audio output via the speaker 9131 and receive audio input from the microphone 9132, thereby implementing ordinary telecommunications functions. The audio processor 9130 may include any suitable buffers, decoders, amplifiers and so forth. In addition, the audio processor 9130 is also coupled to the central processor 9100, thereby enabling recording locally through the microphone 9132 and enabling locally stored sounds to be played through the speaker 9131.
An embodiment of the present application also provides a computer-readable storage medium capable of implementing all the steps in the sliding variable structure control method for robot servo in which the execution subject is a server or a client in the above-described embodiment, the computer-readable storage medium having stored thereon a computer program that, when executed by a processor, implements all the steps in the sliding variable structure control method for robot servo in which the execution subject is a server or a client in the above-described embodiment.
As can be seen from the above description, the computer-readable storage medium provided in the embodiments of the present application controls a model by establishing a transfer function of a controlled object of a servo system and a three-order sliding deformation structure; a current sensor and a position sensor are adopted to collect motor current and real-time position and speed feedback; calculating an error and a second order differential of the error according to the command and the feedback information; calculating a switching surface function s according to the error state; and calculating the variable structure control law output U according to the switching surface function s and the selected approach rate, constructing a sliding surface switching function according to the current, the rotating speed and the position feedback information, calculating the output of the controller according to the switching function, and applying the output to the controlled object to complete closed-loop control.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (devices), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The principle and the implementation mode of the invention are explained by applying specific embodiments in the invention, and the description of the embodiments is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, 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 invention.