Disclosure of Invention
In view of the defects of the prior art, the invention aims to provide an assembly robot based on teaching learning and a control system thereof.
In order to solve the technical problems, the invention adopts the technical scheme that:
the utility model provides a robot shaft hole assembly system based on teaching learning which characterized in that: the device comprises a mechanical arm, a six-dimensional force/torque sensor, a passive flexible RCC (remote Center company) device and a PC (personal computer) upper computer, wherein the six-dimensional force/torque sensor is used for measuring contact force, the mechanical arm is a multi-axis mechanical arm with a motion control function, the six-dimensional force/torque sensor is installed at the tail end of the mechanical arm, the passive flexible RCC device is installed on the six-dimensional force/torque sensor, the PC upper computer is in communication connection with the mechanical arm and the six-dimensional force/torque sensor, in the operation process, the mechanical arm carries a clamping pin part of the passive flexible RCC device to carry out shaft hole assembly under the control instruction of the PC upper computer, and a control system built by the PC upper computer is based on an ROS (reactive oxygen species) platform.
As an improvement, the six-dimensional force/torque sensor monitors the stress state between a clamped workpiece and a shaft hole on the passive flexible RCC device in real time through force feedback, and the posture of the workpiece is adjusted in time through the mechanical arm.
A robot shaft hole assembling method based on teaching learning is characterized by comprising the following steps of:
step one, manual teaching, wherein a mechanical arm drives a pin part to move towards a shaft hole part, a pin is controlled to be in contact with a hole plane and keep constant contact force, the mechanical arm drives the pin part to move on the hole plane and search for the shaft hole, when a six-dimensional force/torque sensor detects sudden change of the contact force, the pin part is positioned in the shaft hole, then manual traction teaching is carried out to assemble the pin part and the shaft hole, values of torque and angular speed in a cooperative assembly process are recorded, M times of repeated teaching is carried out according to the method, and the torque and the angular speed are collected to form a data set;
step two, model learning, namely coding teaching data by adopting a Gaussian mixture model for a data set generated by repeated teaching for many times, obtaining a relation model of force and angular velocity, and performing Gaussian mixture model training based on an expectation-maximization (EM) algorithm to obtain a function mapping relation of moment and angular velocity;
and step three, assembling the shaft hole, taking the direction and the attitude angle of the shaft hole into consideration, driving the pin to move to the surface position of the shaft hole part by the mechanical arm, searching and positioning the shaft hole on the surface of the shaft hole part, positioning the shaft hole, adjusting the attitude through feedback control of a six-dimensional force/torque sensor, calculating the angular velocity value of the tail end of the mechanical arm according to the function mapping relation of the torque and the angular velocity in model learning, and calculating the joint angle of the six-axis mechanical arm through inverse kinematics by combining the output position coordinate of a position controller, so that the tail end of the mechanical arm is controlled to move, and the shaft hole assembling operation is completed.
In the first step, in the process that the mechanical arm drives the pin part to move on the hole plane and search the shaft hole, the pin searches the position of the shaft hole on the hole plane in an Archimedes spiral motion track, and when the six-dimensional force/torque sensor detects the jump of the force in the z direction, the position of the shaft hole is found, and the hole searching is stopped.
As an improvement, the mechanical arm has a joint torque estimation function, can realize reverse driving, can estimate external environment force according to the joint torque, and is mapped to the motion of the robot, so that the mechanical arm is dragged by the person to finish free motion.
As an improvement, the data set ξ ═ F, X for the teaching]TWherein F ═ { M ═x,My},X={ωx,ωyAnd coding teaching data by adopting a Gaussian mixture model to obtain a force and position relation model, wherein a certain data point xi is in the middle of RD×NThe probability of (c) is:
wherein pi
k∈[0,1]Is a priori probability, and
k is the number of Gaussian distributions, R is the real number field, N is the total number of data points, D is the dimensionality of the data, μ
k∈R
D,∑
k∈R
D×DMean and covariance matrices representing the kth Gaussian distribution, respectively, given an input variable ξ
XOutput xi
FThe conditional probability distribution of (a) is:
wherein
Mean and variance of the kth gaussian distribution in the posterior probability:
and is
The k-th gaussian distribution means of X and F respectively,
is the covariance matrix between X and F:
ξFthe probability in the kth Gaussian distribution is
Returning the Gaussian mixture to a given xiFLower xiXOf conditional probability distribution
Thus, the Gaussian mixture model/Gaussian mixture regression is formed by the parameters
Determining the parameter value generally by adopting an expectation maximization algorithm, determining the hyperparameter K as the number of Gaussian distributions by a Bayesian information criterion to obtain the optimal model parameter, and finally obtaining the moment and the angular velocity
The adjustment strategy during the assembly task can be completed through the mapping relation between the two components.
In the first step and the third step, when the shaft hole is searched, the admittance controller is used as the position controller to realize the force control tracking, and the contact force in the x and y directions is reduced while the contact force in the direction perpendicular to the plane of the hole is kept unchanged, so that the flexible contact is realized.
As an improvement, the robot arm performs fine adjustment of the posture through a torque controller, and the torque controller adopts the above-mentioned mapping relationship between the learned torque and the angular velocity:
calculating a target tail end angular velocity value according to the moment acquired in real time, wherein a tail end rotation matrix R (t) is formed by R (t + delta t) ═ delta tS (omega)
a)+I
3×3) R (t) calculation, ω
x,ω
y,ω
zFor the angular velocity of the end axis of the arm in the x, y, z directions, t represents time, Δ t represents the control period of the control system, I
3×3Representing a third order identity matrix, wherein the inverse skew symmetric matrix:
after the rotation matrix is calculated according to the control period, the position output coordinate x of the position controller is combined, and the six-axis mechanical arm joint angle is calculated through inverse kinematics, so that the robot is controlled to move, and the anthropomorphic flexible shaft hole operation is realized.
As an improvement, the teaching times M range from 3 to 9.
The invention has the beneficial effects that:
1. teaching learning is applied to assembly, and only manual teaching is needed, so that the shaft hole assembly can be carried out on the workpiece, the complicated calibration work is avoided, and the application threshold is low;
2. the deployment is rapid, high-precision installation and calibration are not needed, and the assembly efficiency is improved;
3. the algorithm is good in universality, based on the ROS system, convenient for algorithm transplantation and suitable for building different robots and sensor systems.
Detailed Description
(2) As shown in fig. 2, the control system block diagram contains a mechanical arm 1, a six-dimensional force/torque sensor 2 and a PC upper computer 4, the six-dimensional force/torque sensor 2 is used for measuring the contact force, the mechanical arm 1 is a multi-axis mechanical arm 1 with a motion control function, the six-dimensional force/torque sensor 2 is installed at the tail end of the mechanical arm 1, a passive flexible RCC device 3 is installed on the six-dimensional force/torque sensor 2, the PC upper computer 4 is in communication connection with the mechanical arm 1 and the six-dimensional force/torque sensor 2, in the operation process, the mechanical arm 1 carries a passive flexible RCC device 3 clamping pin part to be assembled in a shaft hole under the control instruction of the PC upper computer 4, and the control system built by the PC upper computer 4 is based on an ROS platform. The control system is based on the ROS platform and comprises a control algorithm node, a feedback node based on a six-dimensional force/torque sensor 2 and a real-time motion control node of the mechanical arm 1. The six-dimensional force/torque sensor 2 and the mechanical arm 1 are both connected to the same local area network through network cables and a PC. Adopt Modbus communication protocol between arm 1 and the PC, adopt unified communication interface among the ROS to realize that arm 1 state reads and motion control. The six-dimensional force/torque sensor 2 adopts an Ethernet protocol to send data to a PC end, receives the states of the sensors in a control algorithm node, and calculates a lower period control instruction.
The mechanical arm 1 is a UR3 mechanical arm, is provided with a ROS-based driving program and a function package, and can realize basic motion control and encoder data reading after being installed, so that the construction of a control system is completed. The six-dimensional force/torque sensor 2 has a ROS-based driving program and feeds back contact force data in real time. In the embodiment, the UR3 robot arm is selected as a robot platform, and the six-dimensional force/torque sensor 2 is a HEX-70-XE-200N six-dimensional force/torque sensor of OPTOFORCE in Hungary.
The control algorithm is an active force control algorithm based on force/position hybrid control, the Simulink design is adopted and is converted into a C + + code, the algorithm takes data of a six-dimensional force/torque sensor 2 and a joint encoder of the mechanical arm 1 as input quantities, and based on feedback of the six-dimensional force/torque sensor 2, position and speed control of the mechanical arm 1 is achieved, and assembly operation is completed.
(3) As shown in fig. 3, the teaching learning is to acquire data of a human when executing a task, perform data processing and model training by combining a machine learning method, obtain a skill of the human when completing a certain task, and finally give the skill to the robot, thereby implementing the task execution of robot personification. The teaching learning can be divided into three parts, including manual teaching, model learning and autonomous execution.
The manual teaching process comprises the following steps: a, moving a pin to a hole part, setting the direction and the attitude angle deviation of a hole, and contacting a hole plane and keeping constant contact force; b, in the moving process, the shaft searches the hole position on the hole plane in an Archimedes spiral motion track, when the six-dimensional force/torque sensor 2 detects the jump of the force in the z direction, the hole position is found, and the hole searching is stopped; and C, pressing an I/O button of the end effector to enable the mechanical arm 1 to execute a free driving mode, and realizing the cooperative bolt-in hole of the robot and the mechanical arm 1. And recording the moment M ═ M in the cooperative assembly processx,MyAnd angular velocity ω ═ ωx,ωyThe value of (c) } is repeated a plurality of times, and fig. 4(a) is a phase diagram showing torque and angular velocity of a single teaching. The mechanical arm 1 adopted in the embodiment has a joint torque estimation function, can realize reverse driving, can estimate external environment force according to the joint torque, is mapped to the movement of the robot, and can realize that a person drags the mechanical arm to finish free movement.
Data set xi ═ F, X for teaching]TWherein F ═ { M ═x,My},X={ωx,ωyAnd (6) coding the teaching data by adopting a Gaussian Mixture Model (GMM) and obtaining a relation model of force and position. Wherein a certain data point xi ∈ RD×NThe probability of (c) is:
wherein pi
k∈[0,1]Is a priori probability, and
k is the number of Gaussian distributions, R is the real number domain, N is the total number of data points, and D is the dimensionality of the data. Mu.s
k∈R
D,∑
k∈R
D×DRespectively representing the mean and covariance matrices of the kth gaussian distribution. Given input variable ξ
XOutput xi
FThe conditional probability distribution of (a) is:
wherein
Mean and variance of the kth gaussian distribution in the posterior probability:
and is
The k-th gaussian distribution means of X and F respectively,
as a covariance matrix:
ξFat the k gaussThe probability in the distribution is
Gaussian Mixture Regression (GMR) for a given ξFLower xiXOf conditional probability distribution
Thus, GMM/GMR is defined by parameters
It is decided that the determination of the parameter values generally employs an Expectation Maximization (EM) algorithm. The hyperparameter K is the number of gaussian distributions and is determined by Bayesian Information Criterion (BIC). Obtaining the optimal model parameters, and finally obtaining the moment and the angular velocity
The mapping relationship between the two components, i.e., the adjustment strategy for completing the assembly task, is shown in fig. 4(b) as the distribution relationship between the moment and the angular velocity in the x-axis direction.
Figure 5 shows a force feedback based pin-in-hole control scheme. The position and attitude of the shaft needs to be controlled when performing the assembly task. Force controllers are used for shaft position adjustment, while torque controllers are used for shaft attitude adjustment. The whole process of automatically executing the assembly task comprises the following four steps:
moving a pin to a surface position of a hole component;
searching hole positions on the surface of the hole component;
thirdly, based on the control scheme shown in fig. 5, the admittance controller is adopted as the position controller to realize force control tracking and realize flexible contact. The specific controller structure is as follows:
wherein M isd,Bd,KdIs a virtual mass, damping, stiffness parameter, x is a three-dimensional coordinate of the target position output by the controller, Fd=[0,0,-20N]TFor a set reference contact force, Fa=[Fax,Fay,Faz]TThe feedback value of the contact force in the actual xyz direction. The admittance controller provided here can achieve tracking of the z-direction 20N contact force while reducing the x-and y-direction contact forces to 0.
And fourthly, fine adjustment of the posture is carried out through a torque controller based on the control scheme shown in the figure 5. The torque controller uses the aforementioned learned mapping relationship between torque and angular velocity:
calculating the angular velocity value of the tail end of the target according to the moment acquired in real time, wherein the angular velocity w in the z direction
zIs set to 0. The end rotation matrix is formed by R (t + Δ t) — (Δ tS (ω)
a)+I
3×3) R (t) calculation, wherein the inverse skew symmetric matrix:
in this example, the control period Δ t is 0.008 s. After the rotation matrix is calculated, the position output coordinate x of the position controller is combined, and the joint angle of the six-axis mechanical arm 1 is calculated through inverse kinematics, so that the robot is controlled to move, and the assembly operation of the anthropomorphic flexible shaft hole is realized.