Mechanical arm kinematics self-calibration method based on binocular visionTechnical Field
The invention relates to the field of self-adaptive control, in particular to a mechanical arm kinematics self-calibration method based on binocular vision.
Background
In recent years, mechanical arm control as a technology with great prospect and application value plays an important role in the fields of automobile manufacturing, fruit picking, flow line operation, surgical operation and the like, and has important significance on the development of industry, agriculture and manufacturing industry. Most of multi-degree-of-freedom mechanical arm systems are essentially of a semi-closed loop control structure, the system can only accurately control the position of a joint servo motor, and the relationship between the position of the motor and the position of an end effector of a mechanical arm is determined through kinematics. At present, mechanical arms produced by mechanical arm manufacturers at home and abroad are influenced by machining and assembling, absolute fit of each module cannot be guaranteed, and non-geometric factors such as motor abrasion and external noise directly influence model parameters of the mechanical arms in the operation process of the mechanical arms, so that inevitable errors exist between a theoretical kinematics model and an actual model, and errors of the tail end position are caused. In the current environment, a complete set of calibration techniques usually comes in the form of a combination of mechanical arm modeling, hand-eye calibration, and computer vision assistance. The mechanical arm model comprises two categories, namely a model and a model-free model, wherein the model comprises a D-H model, an MDH model, a CPC model, a POE model and the like, and the model has a method for constructing a coordinate system by fitting a space circle based on feedforward control and actual measurement data of a mixed model. In the aspect of hand-eye calibration, on the aspects of improving algorithm precision and reducing the dependence on a calibration object, expensive equipment such as a laser tracker and a demonstrator is used for acquiring data, and optimization is performed by an off-line or on-line means. Computer vision assistance is mainly used in aspects such as object positioning, environment recognition, classification problem solving, and the like. The calibration process is tedious, the cost is high and manual participation is required. In order to solve the problem, the invention fuses the mechanical arm model and the hand-eye conversion matrix on the premise of ensuring the absolute positioning accuracy of the mechanical arm, does not need to additionally carry out hand-eye calibration, improves the whole calibration system and realizes the automation of the whole calibration process by a set of low-cost equipment.
Disclosure of Invention
Aiming at the problems that the existing mechanical arm kinematics calibration process is complicated, the cost is too high and manual participation is needed, the invention provides a mechanical arm kinematics self-calibration method based on binocular vision, multiple group self-adaptive difference algorithm is adopted to carry out parameter identification on the provided mixed model parameters, the influence of non-geometric factors on the tail end positioning precision is reduced, the redundancy of a calibration system is simplified, the automation of the whole calibration process is realized, a servo motor model is established, and the least square method is adopted to optimize the model, so that the absolute positioning precision of the mechanical arm is further improved.
A mechanical arm kinematics self-calibration method based on binocular vision comprises the following specific technical scheme steps:
the method comprises the following steps: collecting data: acquiring tail end position information of the mechanical arm through a binocular camera, acquiring actual rotation angles of joints of the mechanical arm by using a six-axis gyroscope, and converting a randomly generated instruction set into angles serving as theoretical rotation angles;
step two: the method for identifying the parameters of the kinematic hybrid model of the designed mechanical arm comprises the following steps: and (4) fusing a DH theory and a hand-eye calibration theory to establish a mechanical arm kinematics mixed model. Training the model by using a multi-population adaptive differential algorithm, and solving parameters of the mixed model;
step three: designing a servo motor model, and obtaining the compensated angle through training: and establishing each servo motor model by a polynomial fitting method, and solving polynomial parameters and compensating and predicting by using a least square method.
Further, the first step specifically includes:
randomly generating n groups of instructions to form an instruction set, and converting the instructions in the instruction set into the angle to be rotated of each steering engine to be used as a theoretical rotation angle;
and executing the instruction in the instruction set, and simultaneously reading the actual rotation angle of each joint of the mechanical arm acquired by the gyroscope and the tail end position information of the mechanical arm acquired by the binocular camera.
Further, the second step specifically comprises:
constructing a Cartesian space coordinate system for each joint of the mechanical arm, deriving the conversion relation from the base to the tail end of the mechanical arm through the positive kinematics of a DH (DH) model, and obtaining adjacent coordinate systemsiToi-1 the transformation relationship is shown in equation (1):
can be derived as:
in the formula (2)
cTo represent
cos,
sTo represent
sin。
Representing the rotation of the coordinate system of the adjacent link,
representing the translation of the adjacent link coordinate system.
The mechanical arm base and mechanical arm tail end conversion matrix is shown as formula (3):
the conversion relation between the coordinate system of the binocular camera and the coordinate system of the mechanical arm base is formed by windingX、Y、ZThe rotational translation of the three axes is obtained as shown in equation (4):
in the formuladx、dy、dzRespectively represent an edgeX、Y、ZDistance of shaft translationAfter the separation, the water is separated from the water,ax、ay、azrespectively represent windingsX、Y、ZThe angle of rotation of the shaft.
The conversion relationship of the hybrid model is as follows:
Tthe matrix is a 4 × 4 matrix, and the above derivation results can be simplified as follows:
in the formula (6)
To represent
iThe shaft mechanical arm joint inputs variables,
representing the terminal coordinates of the mechanical arm under the camera coordinate system,
representing the robot arm tip pose.
Further, the third step specifically comprises:
the design of the steering engine error model is shown as a formula (7):
in the formulaf(x) Andxrespectively representing the acquired theoretical rotation angle and the actual rotation angle of the mechanical arm.
The least squares loss function is designed as follows:
and (3) solving the partial derivative of the objective function to complete further optimization:
……
and solving a polynomial coefficient by using a least square method to complete the error compensation of the steering engine.
The invention also provides a mechanical arm kinematics self-calibration method based on binocular vision, which comprises a hybrid model for mechanical arm absolute positioning precision calibration, a steering engine error compensation and optimization strategy and a multi-population self-adaptive difference algorithm. The hybrid model for calibrating the absolute positioning precision of the mechanical arm is used for constructing the conversion relation between the terminal coordinate system of the mechanical arm and the camera coordinate system. And the steering engine error compensation and optimization strategy is used for reducing the influence of the steering engine error on the absolute positioning precision of the mechanical arm. In the multi-population self-adaptive differential algorithm, in the process of optimizing the parameters of the mechanical arm mixed model, the scaling factor and the cross probability in the parameters of the differential algorithm are dynamically changed.
The invention has the beneficial effects that:
1. the calculation of a Jacobian matrix in the kinematic inverse solution of the mechanical arm in the traditional method is avoided by acquiring angle and coordinate data after the mechanical arm moves, the reading is more accurate, and manual participation is not needed;
2. and (3) establishing a hybrid model, namely directly establishing a mapping relation from the angle of the mechanical arm servo motor to a camera coordinate system. The establishment of a mechanical arm base coordinate system in the previous hand-eye calibration link is avoided, so that high-cost equipment such as a laser tracker, a demonstrator and the like is not needed, and the influence of manual participation is avoided;
3. the steering engine error model is established to further reduce the influence of the steering engine error on the absolute positioning precision of the mechanical arm;
4. compared with a general differential algorithm, the multi-population self-adaptive differential algorithm has the advantages that the scaling factor and the cross probability are dynamically changed, the search range is larger, and the local optimal solution is not easy to fall into.
Drawings
The innovative aspects of the present invention will be explained more clearly in the light of the attached drawings, which will be described in greater detail below.
FIG. 1 is a diagram of the structure of the method of the present patent.
Fig. 2 is a view showing a robot arm model.
Fig. 3 is a structural diagram of the coordinate system of the mechanical arm base and the coordinate system of the binocular camera.
FIG. 4 is a graph of the multi-population adaptive difference algorithm results.
FIG. 5 is the hybrid model solution speed.
FIG. 6 is a steering engine model fitting curve after data normalization processing.
Detailed Description
The following describes in detail an embodiment of the present invention, an example of which is shown in fig. 1, a binocular vision based robot arm kinematics self-calibration method. The embodiments described below with reference to the drawings are exemplary only and should not be construed as limiting the invention.
The method comprises the following steps of collecting tail end position information of a mechanical arm, theoretical rotating angles of a servo motor and actual rotating angles of the servo motor, wherein the collecting mode is as follows:
optionally, determining the instruction data range of each servo motor according to the mechanical structure of the mechanical arm, and acquiring 50 groups of data, for any N-axis rigid mechanical arm. And randomly generating 50 groups of instructions, wherein each group of instructions contains N steering engine rotation information, and converting the instructions into angles to be used as the theoretical rotation angle of the servo motor.
In the process of executing the command, the mechanical arm uses the gyroscope to collect the rotation angle of each joint, 50 groups of commands correspond to 50 groups of actual rotation angles, and therefore the collection of the actual rotation angles of 50 groups of servo motors is completed.
The acquisition of the tail end position information of the mechanical arm is obtained by identifying and positioning the mass center of the small ball at the tail end of the mechanical arm through a binocular camera. The collected coordinate points are the spatial coordinates of the end of the mechanical arm under the camera coordinate system.
In the acquisition process, after the mechanical arm is executed according to a randomly generated instruction, the gyroscope acquires the actual rotation angle of the servo motor, the binocular camera positions the tail end of the mechanical arm, and in order to avoid data confusion in the data acquisition link, a thread lock is added into each subsystem or each subsystem is dormant for 2 s.
The method for identifying the parameters of the kinematic hybrid model of the designed mechanical arm comprises the following steps: and (4) fusing a DH theory and a hand-eye calibration theory to establish a mechanical arm kinematics mixed model. Each joint of the mechanical arm constructs a Cartesian space coordinate system, the conversion relation from the base to the tail end of the mechanical arm is obtained through forward kinematics derivation, and adjacent coordinate systemsiToi-1 the transformation relationship is shown in equation (9):
the matrix form is:
in the formula (10)
cTo represent
cos,
sTo represent
sin。
Representing the rotation of the coordinate system of the adjacent link,
representing translations of adjacent link coordinate systems, where 0<
i<N+1。
The robot base and robot end transformation matrix is shown in formula (11):
conversion relation between binocular camera coordinate system and mechanical arm base coordinate systemAs shown in fig. 3, may be passed by windingX、Y、ZRotational translation of the three axes is obtained as shown in the following equation:
in the formula (12)dx、dy、dzRespectively represent an edgeX、Y、ZThe distance that the shaft is translated is,ax、ay、azrespectively represent windingsX、Y、ZThe angle of rotation of the shaft.
The conversion relationship of the hybrid model is as follows:
Tthe matrix is a 4 × 4 matrix, and the derivation process can be simplified as follows:
in formula (14)
Represents the input variable of the joint of the N-axis mechanical arm,
representing the terminal coordinates of the mechanical arm under the camera coordinate system,
representing the robot arm tip pose.
The mixed model has 4N +6 parameters, wherein the parameters based on the DH method (
) There are N group, and there are 6 camera coordinate system and arm base coordinate system parameters, are respectively:
dx、
dy、
dz、
ax、
ay、
az. Adaptive differential computation using multiple populationsThe method identifies the parameters.
The actual rotation angles of 50 sets of servo motors are used as the input of the hybrid model, the terminal position coordinates identified by the binocular camera are used as the output of the hybrid model, and the identification result is shown in fig. 4. The parameter identification process does not need manual participation, and the scaling factor and the cross probability in the differential algorithm parameters are dynamically changed. The search range is expanded, and meanwhile, the local optimal solution is not easy to fall into. The cost function chosen is as follows:
the convergence rate of the algorithm is shown in fig. 5, and the solution of the model takes 18 s.
Establishment of the hybrid model in order to establish a mapping relation from a theoretical angle of rotation of each joint of the mechanical arm to the tail end of the mechanical arm and further improve the absolute positioning accuracy of the mechanical arm, the invention establishes mapping from the theoretical angle of rotation of each joint of the mechanical arm to an actual angle of rotation through polynomial fitting. Before fitting, normalization processing needs to be carried out on the data, so that the optimization process of the optimal solution is more smooth.
The servo motor model is designed as follows:
in the formulaf(x) Andxrespectively representing the acquired theoretical rotation angle and the actual rotation angle of the mechanical arm.kUnknown parameters of a polynomial of degreekA coefficient and 1 constant term.
The least squares loss function is designed as follows:
and (3) solving the partial derivative of the objective function to complete further optimization:
……
and (3) solving a polynomial coefficient by using a least square method, so that a mapping relation between a theoretical rotation angle and an actual rotation angle of the mechanical arm can be established, the fitting condition is shown in fig. 6, the horizontal and vertical coordinates respectively represent the normalized theoretical rotation angle and actual rotation angle of the mechanical arm, and then the steering engine error compensation is completed by performing inverse normalization processing on data.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the present invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.