CN116476046A - Mechanical arm calibration and control device and method based on particle swarm optimization - Google Patents
Mechanical arm calibration and control device and method based on particle swarm optimization Download PDFInfo
- Publication number
- CN116476046A CN116476046A CN202310302560.1A CN202310302560A CN116476046A CN 116476046 A CN116476046 A CN 116476046A CN 202310302560 A CN202310302560 A CN 202310302560A CN 116476046 A CN116476046 A CN 116476046A
- Authority
- CN
- China
- Prior art keywords
- arm
- light source
- end position
- pixel coordinates
- pixel
- 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
- 239000002245 particle Substances 0.000 title claims abstract description 45
- 238000005457 optimization Methods 0.000 title claims abstract description 31
- 238000000034 method Methods 0.000 title claims abstract description 26
- 238000012545 processing Methods 0.000 claims abstract description 8
- 210000000323 shoulder joint Anatomy 0.000 claims description 30
- 210000002310 elbow joint Anatomy 0.000 claims description 29
- 238000001514 detection method Methods 0.000 claims description 14
- XAGFODPZIPBFFR-UHFFFAOYSA-N aluminium Chemical compound [Al] XAGFODPZIPBFFR-UHFFFAOYSA-N 0.000 claims description 13
- 229910052782 aluminium Inorganic materials 0.000 claims description 13
- 239000003638 chemical reducing agent Substances 0.000 claims description 12
- 238000004364 calculation method Methods 0.000 claims description 7
- 238000002955 isolation Methods 0.000 claims description 7
- 238000013178 mathematical model Methods 0.000 claims description 6
- 238000012935 Averaging Methods 0.000 claims description 4
- 238000012937 correction Methods 0.000 claims description 3
- 238000000605 extraction Methods 0.000 claims description 3
- 238000004519 manufacturing process Methods 0.000 description 5
- 230000003287 optical effect Effects 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 230000000007 visual effect Effects 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 238000006243 chemical reaction Methods 0.000 description 2
- 238000013461 design Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 239000011159 matrix material Substances 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000011160 research Methods 0.000 description 2
- 239000000523 sample Substances 0.000 description 2
- 238000006467 substitution reaction Methods 0.000 description 2
- 230000006978 adaptation Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000013016 damping Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000009826 distribution Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 230000001788 irregular Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 230000004044 response Effects 0.000 description 1
Classifications
-
- B—PERFORMING OPERATIONS; TRANSPORTING
- B25—HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
- B25J—MANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
- B25J9/00—Programme-controlled manipulators
- B25J9/16—Programme controls
- B25J9/1679—Programme controls characterised by the tasks executed
- B25J9/1692—Calibration of manipulator
-
- B—PERFORMING OPERATIONS; TRANSPORTING
- B25—HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
- B25J—MANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
- B25J9/00—Programme-controlled manipulators
- B25J9/16—Programme controls
- B25J9/1694—Programme controls characterised by use of sensors other than normal servo-feedback from position, speed or acceleration sensors, perception control, multi-sensor controlled systems, sensor fusion
- B25J9/1697—Vision controlled systems
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02T—CLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
- Y02T10/00—Road transport of goods or passengers
- Y02T10/10—Internal combustion engine [ICE] based vehicles
- Y02T10/40—Engine management systems
Landscapes
- Engineering & Computer Science (AREA)
- Robotics (AREA)
- Mechanical Engineering (AREA)
- Manipulator (AREA)
Abstract
The invention discloses a mechanical arm calibration and control device and method based on particle swarm optimization, wherein the method comprises the following steps: acquiring a photograph of the end position of the second arm; processing the photograph of the end position of the second arm, and extracting pixel coordinates of the light source reflector; extracting the light source edge of the light source reflector, and calculating the pixel coordinate of the end position of the second arm to obtain a pixel coordinate sequence of the end position of the first arm; converting the pixel coordinate sequence of the end position of the second arm into a corresponding coordinate sequence under a camera coordinate system; acquiring the coordinates of a light source reflector under a laser tracker coordinate system, and calculating a pixel coordinate sequence of the end position of the second arm to obtain the pixel coordinate sequence of the end position of the second arm; and reducing the error between the pixel coordinate sequence of the end position of the first arm and the pixel coordinate sequence of the end position of the second arm to a preset range by using a particle swarm optimization algorithm, and realizing the calibration and control of the mechanical arm. The mechanical arm control with higher calibration precision can be realized.
Description
Technical Field
The invention relates to the field of detection and control research of tail end tracks of rotating heavy-duty mechanical arms, in particular to a mechanical arm calibration and control device and method based on particle swarm optimization.
Background
The heavy-duty mechanical arm structure is similar to a human arm, has strong load capacity and response speed which is several times faster than that of a common joint mechanical arm, and is suitable for plane positioning, assembly line work and the like. With the increasing requirement on the motion precision of the mechanical arm and the progress of the visual detection technology, the mechanical arm is continuously developed towards the visual detection and control direction at present. However, on one hand, the mechanical arm body has motion errors due to the influence of factors such as design, manufacturing, assembly errors and the like of the mechanical arm; on the other hand, the detection error is generated due to the reasons of pixel size limitation and numerical processing distortion existing in the visual detection and method. Therefore, the design of the device for accurately detecting and controlling the tail end position of the rotary heavy-duty second arm by using the industrial camera has important research significance and practical value.
Disclosure of Invention
In order to solve the technical problems, the invention aims to provide the mechanical arm calibration and control device and method based on particle swarm optimization, which can train the second arm tail end position motion error acquired by a camera and a laser tracking ball through the particle swarm optimization algorithm to obtain a control error compensation amount and realize mechanical arm control with higher calibration precision.
The first technical scheme adopted by the invention is as follows: a mechanical arm calibration and control method based on particle swarm optimization comprises the following steps:
acquiring a second arm tail end position photo, and processing the second arm tail end position photo to obtain a pixel coordinate of the light source reflector;
extracting the light source edge of the light source reflector by using the pixel coordinates of the light source reflector, and calculating the pixel coordinates of the end position of the second arm to obtain a first sequence of the pixel coordinates of the end position of the second arm;
converting the first sequence of pixel coordinates of the tail end position of the second arm into a corresponding coordinate sequence under a camera coordinate system, and solving a corresponding angle sequence;
acquiring the pixel coordinates of the tail end of the mechanical arm under a laser tracker coordinate system, and obtaining a second sequence of the pixel coordinates of the tail end position of the second arm;
and reducing the error between the first sequence of the pixel coordinates of the end position of the second arm and the second sequence of the pixel coordinates of the end position of the second arm under the camera coordinate system to a preset range by using a particle swarm algorithm to obtain a control error compensation quantity, thereby realizing the calibration and control of the mechanical arm.
In the method, the motion data of the tail end of the mechanical arm is obtained in real time through the camera and is compared with the motion data of the tail end of the mechanical arm obtained by the laser tracker, the optimization is carried out through the particle swarm algorithm, the error is reduced, and the mechanical arm control with higher calibration precision is realized.
Further, the step of obtaining a photograph of the end position of the second arm, and processing the photograph of the end position of the second arm to obtain the pixel coordinates of the light source reflector further includes:
and performing perspective distortion correction on the pixel coordinates of the light source reflector to obtain ideal pixel coordinates of the light source reflector.
Further, the perspective distortion includes radial distortion and tangential distortion, which are specifically expressed as;
mathematical model of radial distortion:
W=w(1+k 1 r 2 +k 2 r 4 +k 3 r 6 )
H=h(1+k 1 r 2 +k 2 r 4 +k 3 r 6 )
wherein (W, H) represents a distorted pixel, (W, H) represents an ideal pixel, r 2 =w 2 +h 2 ,k 1 、k 2 、k 3 Representing a distortion vector;
mathematical model of tangential distortion:
U=u+[2p 1 v+p 2 (r 2 +2u 2 )]
V=v+[2p 1 (r 2 +2v 2 )+p 2 u]
wherein (U, V) represents a distorted pixel, (U, V) represents an ideal pixel, r 2 =w 2 +h 2 ,P 1 、P 2 Representing the distortion vector.
In the technical scheme, the defects that the self light source characteristic of a camera is imperfect and errors caused by the fact that an image sensor and an optical axis of the camera are not vertically installed in the production and manufacturing process can be overcome through perspective distortion correction, so that the calibration of the mechanical arm is more accurate.
Further, the step of extracting a light source edge of the light source reflector by using pixel coordinates of the light source reflector, and calculating pixel coordinates of a second arm end position to obtain a first sequence of pixel coordinates of the second arm end position specifically includes:
calculating the gradient amplitude and direction of the image by utilizing an edge extraction operator based on the pixel coordinates of the light source reflector, and searching the gradient of the image to obtain the light source edge of the light source reflector;
separating and fitting the light source edge of the light source reflector, and calculating the center coordinates of the light source edge of the fitted light source reflector;
averaging the circle center coordinates of the light source edge of the fitted light source reflector to obtain pixel coordinates of the tail end position of the second arm;
and adding the pixel coordinates of the end position of the second arm into the queue to obtain a first sequence of the pixel coordinates of the end position of the second arm.
Further, the step of averaging the center coordinates of the light source edge of the fitted light source reflector to obtain the pixel coordinates of the end position of the second arm specifically includes:
calculating the actual size of the photo pixels according to the photo size and the photo pixel size;
and calculating the pixel coordinate of the end position of the second arm by adopting an average value algorithm according to the actual size of the photo pixel, the pixel coordinate of the light source reflector and the circle center pixel coordinate of the light source reflector.
Further, the specific calculation formula of the average value algorithm is as follows:
wherein, (x) ci ,y ci ) Watch (watch)Pixel coordinates (x) showing the position of the second arm end at the ith shot 1i ,y 1i ) And (x) 2i ,y 2i ) Respectively representing pixel coordinates of the first and second light source reflectors at the ith photographing, (x) 3i ,y 3i ) And (x) 4i ,y 4i ) The pixel coordinates of the circle centers of the first light source reflector and the second light source reflector during the ith shooting are represented, x represents the dimension of the photo, and N represents the pixel size of the photo.
Further, the ideal kinematic model used for solving the corresponding angle sequence is:
wherein (x, y) represents the pixel coordinates of the second arm end position, (θ) 1 ,θ 2 ) Indicating the angle of the mechanical arm, l 1 Indicating the first arm length, l 2 Representing the second arm length.
Further, the error is expressed as:
wherein e i Representing an error between an ith pixel coordinate in a first sequence of pixel coordinates of a second arm end position and an ith pixel coordinate in a second sequence of pixel coordinates of the second arm end position in a camera coordinate system, (x) ci ,y ci ) Is the pixel coordinates of the end position of the mechanical part detected by the camera, (x) gi ,y gi ) Is the pixel coordinates of the laser tracker detecting the position of the second arm end.
The second technical scheme adopted by the invention is as follows: the mechanical arm calibration and control device based on particle swarm optimization comprises a heavy-duty mechanical arm body unit, a tail end position detection and calibration unit and a control unit:
the heavy-duty mechanical arm body unit comprises a vibration isolation table, an aluminum profile bracket, a base, an electric slip ring, a first arm, a second arm, an elbow joint servo motor, a shoulder joint servo motor, an elbow joint speed reducer and a shoulder joint speed reducer;
the vibration isolation table is connected with the base through bolts, and the base is used for fixing the first arm;
the aluminum profile bracket is used for fixing an industrial camera;
the electric slip ring is arranged in the center of the top of the aluminum profile bracket and is used for providing power for the shoulder joint servo motor;
the elbow joint servo motor and the elbow joint speed reducer are arranged at the first arm and used for driving the first arm to move;
the shoulder joint servo motor and the shoulder joint speed reducer are arranged at the second arm and used for driving the second arm to move;
the tail end position detection and calibration unit comprises an industrial camera, a laser tracker and two light source reflectors;
the two light source reflectors are arranged at the top of the tail end of the second arm;
the industrial camera is arranged on the aluminum profile bracket, is connected with the PC end network, and is used for transmitting an image of the tail end position of the second arm, extracting pixels of two light source reflectors to further obtain the actual tail end position of the second arm, and carrying out particle swarm optimization calculation by combining detection data of the laser tracker to obtain a control error compensation quantity;
the control unit comprises a shoulder joint servo driver, an elbow joint servo driver, a control card and a PC end;
the joint servo driver and the elbow joint servo driver are respectively connected with the shoulder joint servo motor, the elbow joint servo motor and the motion control card and are used for driving the shoulder joint servo motor and the elbow joint servo motor to move so as to realize the motion of the tail end of the second arm;
the control card is used for receiving the PC end signal, combining the control error compensation quantity to carry out kinematic inverse solution, and transmitting the processed signals to the shoulder joint servo driver and the elbow joint servo driver.
The mechanical arm calibration and control device and method based on particle swarm optimization have the beneficial effects that: according to the invention, the motion data of the tail end of the mechanical arm is obtained in real time through the camera, and compared with the motion data of the tail end of the mechanical arm obtained by the laser tracker, and the motion error compensation quantity is obtained by optimizing a particle swarm algorithm, so that the mechanical arm control with higher calibration precision is realized.
Drawings
FIG. 1 is a flow chart of steps of a robot arm calibration and control method optimized based on a particle swarm algorithm;
FIG. 2 is a block diagram of a robot arm calibration and control device optimized based on a particle swarm algorithm;
FIG. 3 is a fitted view of the light source edge of the light source reflector provided by the present invention;
FIG. 4 is a diagram of a particle swarm distribution and iterative optimization process provided by the present invention;
reference numerals: 1. a vibration isolation table; 2. a base; 3. elbow joint servo motor; 4. an elbow joint decelerator; 5. a first arm; 6. a laser trackball; 7. an aluminum profile bracket; 8. an industrial camera; 9. an electrical slip ring; 10. a shoulder joint servo motor; 11. a shoulder joint decelerator; 12. a light source reflector; 3. a second arm; 14. a laser probe.
Detailed Description
The invention will now be described in further detail with reference to the drawings and to specific examples. The step numbers in the following embodiments are set for convenience of illustration only, and the order between the steps is not limited in any way, and the execution order of the steps in the embodiments may be adaptively adjusted according to the understanding of those skilled in the art.
Example 1
As shown in fig. 1, the invention provides a mechanical arm calibration and control method based on particle swarm optimization, which comprises the following steps:
101. and obtaining a second arm end position photo, and processing the second arm end position photo to obtain the pixel coordinates of the light source reflector.
In this embodiment, the camera adopts an industrial camera, such as an area-array camera or a linear-array camera, and is connected to the computer end, where the connection mode may adopt a wired connection, such as RJ45 network connection, FC optical fiber line, coaxial cable, power carrier line, and the connection mode may also adopt a wireless connection, such as WIFI, 4G, or 5G network, and the industrial camera and the computer may perform data transmission. Firstly, a computer sends an instruction to the industrial camera, the industrial camera receiving the computer instruction is started to enter a working state, a moving photo of the tail end of the mechanical arm in operation is collected in real time, and the moving photo is transmitted back to the computer end. After the computer receives the moving photo of the tail end of the mechanical arm, the photo of the tail end of the mechanical arm is processed, and the pixel coordinates of the two light source reflectors are extracted.
102. And extracting the light source edge of the light source reflector by using the pixel coordinates of the light source reflector, and calculating the pixel coordinates of the end position of the second arm to obtain a first sequence of the pixel coordinates of the end position of the second arm.
In this embodiment, the Sobel operator is preferably used to extract the light source edge of the light source reflector. Firstly, a convolution template is used for acting in the x direction and the y direction of a domain respectively, then the amplitude and the direction of an image gradient are calculated, the image gradient is searched, and the light source edge of a light source reflector is obtained, wherein the calculation formula is expressed as follows:
wherein dx is a convolution result of the image I and the template with the odd size by horizontal change, dy is a convolution result of the image I and the template with the odd size by vertical change, I is an image to be processed, S is the size of the point gray level calculated by combining a formula of the horizontal gray level value and the longitudinal gray level value of each pixel of the image, and θ is the gradient direction.
As shown in fig. 3, since the extracted light source edge of the light source reflector has an irregular shape, the light source edge is fitted to obtain the light source edge of the regular light source reflector, the center coordinates of the light source edge are obtained on the basis, the pixel coordinates of the end position of the second arm are calculated by taking the average value of the center coordinates of the light source edges of the two light source reflectors, and the calculation process of the average value is as follows:
wherein, (x) ci ,y ci ) Pixel coordinates (x) representing the position of the end of the second arm in the ith shot 1i ,y 1i ) And (x) 2i ,y 2i ) Respectively representing pixel coordinates of the first and second light source reflectors at the ith photographing, (x) 3i ,y 3i ) And (x) 4i ,y 4i ) The pixel coordinates of the circle centers of the first light source reflector and the second light source reflector in the ith shooting are respectively represented, x represents the dimension of the photo, and N represents the pixel size of the photo.
And finally, adding all the pixel coordinates of the end position of the second arm into the sequence to obtain a first sequence of the pixel coordinates of the end position of the second arm.
103. And converting the first sequence of pixel coordinates of the end position of the second arm into a corresponding coordinate sequence under a camera coordinate system, and solving a corresponding angle sequence.
In this embodiment, the first sequence of pixel coordinates of the end position of the second arm obtained above is converted into a coordinate sequence in the camera coordinate system by using a conversion relation matrix of the image coordinate system and the camera coordinate system, where the conversion relation matrix is expressed as:
wherein, (x) c ,y c ,z c ) Representing coordinates in the camera coordinate system, (x, y) representing coordinates in the image coordinate system, f representing camera focal length, z c Is the vertical distance of the light source reflector from the camera lens.
After obtaining the coordinate sequence of the pixel coordinate sequence of the second arm tail end position under the camera coordinate system, solving a corresponding angle sequence by using an ideal kinematic model, wherein the solving formula is specifically as follows:
wherein, (x) c ,y c ) Representing pixel coordinates (θ) in a camera coordinate system 1 ,θ 2 ) Indicating the angle of the mechanical arm, l 1 Indicating the first arm length, l 2 Representing the second arm length.
Definition (x) c ,y c )=f(θ 1 ,θ 2 ) Then use (θ) 1 ,θ 2 )=f -1 (x c ,y c ) And solving the angle of the mechanical arm. And adding the angles of the mechanical arms corresponding to all the pixel coordinates into the sequence to obtain a corresponding angle sequence.
104. And acquiring the pixel coordinates of the tail end of the mechanical arm under the laser tracker coordinate system, and obtaining a second sequence of the pixel coordinates of the tail end position of the second arm.
In this embodiment, a laser tracker coordinate system is established in the laser tracker, the center of the laser probe is taken as an origin, the reading direction of 0 on the scale is taken as an X-axis, the upward direction of the normal line of the scale plane is taken as a Z-axis, and the Y-axis is determined regularly by a right-hand coordinate system. On the basis, the coordinates of the laser tracking ball relative to the origin of coordinates are obtained, the pixel coordinates of the tail end of the mechanical arm measured by the laser tracking ball when the tracking rotating mirror and the target mirror are not moving are obtained, and the pixel coordinates of the tail end of the mechanical arm measured by the laser tracking ball are added into the sequence to obtain a second sequence of the pixel coordinates of the tail end position of the second arm.
105. And reducing the error between the first sequence of the pixel coordinates of the end position of the second arm and the second sequence of the pixel coordinates of the end position of the second arm under the camera coordinate system to a preset range by using a particle swarm optimization algorithm to obtain a control error compensation quantity, and realizing the calibration and control of the mechanical arm.
In this embodiment, an error formula between a first sequence of pixel coordinates of a second arm end position and a second sequence of pixel coordinates of the second arm end position in a camera coordinate system is first established as a particle swarm adaptation function, and is expressed as follows:
wherein e i Representing an error between an ith pixel coordinate in a first sequence of pixel coordinates of a second arm end position and an ith pixel coordinate in a second sequence of pixel coordinates of the second arm end position in a camera coordinate system, (x) ci ,y ci ) Is the pixel coordinates of the end position of the mechanical part detected by the camera, (x) gi ,y gi ) Is the pixel coordinates of the laser tracker detecting the position of the second arm end.
On the basis, optimizing and optimizing the particle swarm optimization algorithm. First, each two-dimensional particle in a particle population is defined asSpeed v= (V) 1 ,V 2 …V N );
Wherein, (x) ci ,y ci ) Is the pixel coordinates of the second arm end position under the camera coordinate system detected by the camera, (x) gi ,y gi ) Is the pixel coordinates of the laser tracker detecting the position of the second arm end,represents the position of the ith particle, V i The speed of the i-th particle is represented, i=1, 2, …, N, and N represents the total number of particles.
The individual extremum of the particle so far searched for the optimal position is then noted as: p (P) best =(P 1 ,P 2 .....P N ) The global extremum of the optimal position searched so far for the whole population is noted as: g best =(G 1 ,G 2 .....G N ). Find G best And P best Then, the speed and the position of the particle swarm are updated through the following equation;
the particle swarm updating process comprises the following steps:
V(t+1)=wV i (t)+c 1 r 1 (t)[P i (t)-X i (t)]+c 2 r 2 (t)[G i (t)-x i (t)]
x i (t+1)=X i (t)+V i (t+1)
wherein W is an inertial weight, c 1 And c 2 R is the learning factor 1 And r 2 Is [0,1]Uniform random number within range, V i Is the velocity of the particles. And updating the particle swarm position through iteration for a plurality of times, and finding the position reaching the allowable error range.
As shown in fig. 4, when the particle finds the optimal position, if the corresponding error is within the preset range, the iteration is ended, the control error compensation amount is obtained, the inverse kinematics solution is performed according to the control error compensation amount, and the angle compensation amount corresponding to the end position of the second arm is obtained, so that the accurate calibration control is realized.
Example 2
On the basis of the embodiment 1, since the industrial camera cannot be accurately and vertically mounted on the measured object, perspective distortion exists in the acquired photograph of the end position of the second arm, including radial distortion and tangential distortion. The radial distortion is caused by imperfect optical properties of the radial distortion, and the mathematical model is as follows:
W=w(1+k 1 r 2 +k 2 r 4 +k 3 r 6 )
H=h(1+k 1 r 2 +k 2 4+k 3 r 6 )
wherein (W, H) represents a distorted pixel, (W, H) represents an ideal pixel, r 2 =w 2 +h 2 ,k 1 、k 2 、k 3 Representing distortionVector.
The tangential distortion is caused by the fact that the camera fails to enable the image sensor to be arranged perpendicular to the optical axis in the production and manufacturing process, and the mathematical model is as follows:
U=u+[2p 1 v+p 2 (r 2 +2u 2 )]
V=v+[2p 1 (r 2 +2v 2 )+p 2 u]
wherein (U, V) represents a distorted pixel, (U, V) represents an ideal pixel, r 2 =w 2 +h 2 ,P 1 、P 2 Representing the distortion vector.
And according to the radial distortion and tangential distortion model, the ideal pixel coordinate of the end position of the second arm is reversely solved, and then the light source edge extraction and other operations of the light source reflector are carried out, so that the more accurate calibration and control of the mechanical arm can be realized.
As shown in FIG. 2, the mechanical arm calibration and control device based on particle swarm optimization comprises a heavy-duty mechanical arm body unit, an end position detection and calibration unit and a control unit, wherein
The heavy-duty mechanical arm body unit comprises a vibration isolation platform 1, a base 2, an elbow joint servo motor 3, an elbow joint speed reducer 4, a first arm 5, an aluminum frame 7, an electric slip ring 9, a shoulder joint servo motor 10, a shoulder joint speed reducer 11 and a second arm 13. The vibration isolation table 1 is square, is connected with the base 2 through bolts to fix the robot arm, and has a damping effect; the aluminum section bracket 7 plays a role in supporting and fixing the industrial camera 8; the electric slip ring 9 is arranged at the center of the top of the aluminum profile bracket 7, so as to conveniently provide power for the shoulder joint servo motor 10; the shoulder joint servo motor 10 is arranged at the second arm 13, the elbow joint servo motor 3 is arranged at the first arm 5, the elbow joint servo motor 3 and the elbow joint speed reducer 4 drive the first arm 5, the shoulder joint servo motor 10 and the shoulder joint speed reducer 11 drive the second arm 6 to move, and the tail end of the second arm 13 is moved to a desired position;
the end position detection and calibration unit comprises an industrial camera 8, a laser tracker and a light source reflector 12 on top of the end of the second arm 13. Two light source reflectors are mounted on top of the distal end of the second arm 13; the laser tracker consists of a laser tracking ball 6 and a laser detecting head 14, wherein the laser tracking ball 6 is arranged at the exact center of the two light source reflectors, namely the actual center point of the tail end position; the industrial camera 8 is arranged on the aluminum profile 7, is connected with a PC end through a network, transmits an image of the tail end position of the second arm 13, extracts the pixel of the light source reflector to obtain the actual tail end position of the second arm, and performs particle swarm optimization calculation by combining the detection data of the laser tracker to obtain the control error compensation quantity;
the control unit comprises an elbow joint servo driver B, a shoulder joint servo driver A, a control card and a PC. The shoulder joint servo driver A and the elbow joint servo driver B are respectively connected with the shoulder joint servo motor 10 and the elbow joint servo motor 3 and the motion control card; the motion control card receives the PC signal, combines the control error compensation quantity to carry out the inverse kinematics solution, and transmits the inverse kinematics solution to the shoulder joint servo driver A and the elbow joint servo driver B after processing. The shoulder servo driver A and the elbow servo driver B respectively drive the shoulder servo motor 10 and the elbow servo motor 3 to move, so that the tail end of the second arm 13 moves.
The content in the method embodiment is applicable to the embodiment of the device, and the functions specifically realized by the embodiment of the device are the same as those of the method embodiment, and the obtained beneficial effects are the same as those of the method embodiment.
While the preferred embodiment of the present invention has been described in detail, the invention is not limited to the embodiment, and various equivalent modifications and substitutions can be made by those skilled in the art without departing from the spirit of the invention, and these modifications and substitutions are intended to be included in the scope of the present invention as defined in the appended claims.
Claims (9)
1. The mechanical arm calibration and control method based on particle swarm optimization is characterized by comprising the following steps:
acquiring a second arm tail end position photo, and processing the second arm tail end position photo to obtain a pixel coordinate of the light source reflector;
extracting the light source edge of the light source reflector by using the pixel coordinates of the light source reflector, and calculating the pixel coordinates of the end position of the second arm to obtain a first sequence of the pixel coordinates of the end position of the second arm;
converting the first sequence of pixel coordinates of the tail end position of the second arm into a corresponding coordinate sequence under a camera coordinate system, and solving a corresponding angle sequence;
acquiring the pixel coordinates of the tail end of the mechanical arm under a laser tracker coordinate system, and obtaining a second sequence of the pixel coordinates of the tail end position of the second arm;
and reducing the error between the first sequence of the pixel coordinates of the end position of the second arm and the second sequence of the pixel coordinates of the end position of the second arm under the camera coordinate system to a preset range by using a particle swarm algorithm to obtain a control error compensation quantity, thereby realizing the calibration and control of the mechanical arm.
2. The method for calibrating and controlling a mechanical arm based on particle swarm optimization according to claim 1, wherein the step of obtaining a photograph of the end position of the second arm, processing the photograph of the end position of the second arm, and obtaining the pixel coordinates of the light source reflector further comprises:
and performing perspective distortion correction on the pixel coordinates of the light source reflector to obtain ideal pixel coordinates of the light source reflector.
3. The method for calibrating and controlling a mechanical arm based on optimization of a particle swarm algorithm according to claim 2, wherein the perspective distortion comprises radial distortion and tangential distortion, which are specifically expressed as;
mathematical model of radial distortion:
W=w(1+k 1 r 2 +k 2 r 4 +k 3 r 6 )
H=h(1+k 1 r 2 +k 2 r 4 +k 3 r 6 )
wherein (W, H) represents a distorted pixel, (W, H) represents an ideal pixel, r 2 =w 2 +h 2 ,k 1 、k 2 、k 3 Representing a distortion vector;
mathematical model of tangential distortion:
U=u+[2p 1 v+p 2 (r 2 +2u 2 )]
V=v+[2p 1 (r 2 +2v 2 )+p 2 u]
wherein (U, V) represents a distorted pixel, (U, V) represents an ideal pixel, r 2 =w 2 +h 2 ,P 1 、P 2 Representing the distortion vector.
4. The method for calibrating and controlling a mechanical arm based on particle swarm optimization according to claim 1, wherein the step of extracting a light source edge of the light source reflector by using pixel coordinates of the light source reflector, and calculating pixel coordinates of a second arm end position to obtain a first sequence of pixel coordinates of the second arm end position comprises the following steps:
calculating the gradient amplitude and direction of the image by utilizing an edge extraction operator based on the pixel coordinates of the light source reflector, and searching the gradient of the image to obtain the light source edge of the light source reflector;
separating and fitting the light source edge of the light source reflector, and calculating the center coordinates of the light source edge of the fitted light source reflector;
averaging the circle center coordinates of the light source edge of the fitted light source reflector to obtain pixel coordinates of the tail end position of the second arm;
and adding the pixel coordinates of the end position of the second arm into the queue to obtain a first sequence of the pixel coordinates of the end position of the second arm.
5. The method for calibrating and controlling a mechanical arm based on particle swarm optimization according to claim 4, wherein the step of averaging the center coordinates of the light source edge of the fitted light source reflector to obtain the pixel coordinates of the end position of the second arm comprises the following steps:
calculating the actual size of the photo pixels according to the photo dimensions and the photo pixel sizes;
and calculating the pixel coordinate of the end position of the second arm according to the actual size of the photo pixel, the pixel coordinate of the light source reflector and the circle center pixel coordinate of the light source reflector by adopting an average value algorithm.
6. The method for calibrating and controlling a mechanical arm based on optimization of a particle swarm optimization according to claim 5, wherein the average value algorithm specifically comprises the following calculation formula:
wherein, (x) ci ,y ci ) Pixel coordinates (x) representing the position of the second arm end at the ith shot 1i ,y 1i ) And (x) 2i ,y 2i ) Respectively representing pixel coordinates of the first and second light source reflectors in the ith shooting, (x) 3i ,y 3i ) And (x) 4i ,y 4i ) The pixel coordinates of the circle centers of the first light source reflector and the second light source reflector in the ith shooting are respectively represented, x represents the dimension of the photo, and N represents the pixel size of the photo.
7. The method for calibrating and controlling a mechanical arm based on optimization of a particle swarm optimization according to claim 6, wherein the ideal kinematic model used for solving the corresponding angle sequence is:
wherein (x, y) represents the pixel coordinates of the second arm end position, (θ) 1 ,θ 2 ) Indicating the angle of the mechanical arm, l 1 Indicating the first arm length, l 2 Representing the second arm length.
8. The method for calibrating and controlling a mechanical arm based on optimization of a particle swarm optimization according to claim 1, wherein the error is expressed as:
wherein e i Representing an error between an ith pixel coordinate in a first sequence of pixel coordinates of a second arm end position and an ith pixel coordinate in a second sequence of pixel coordinates of the second arm end position in a camera coordinate system, (x) ci ,y ci ) Is the pixel coordinates of the end position of the mechanical part detected by the camera, (x) gi ,y gi ) Is the pixel coordinates of the laser tracker detecting the position of the second arm end.
9. The utility model provides a mechanical arm calibration and controlling means based on particle swarm optimization, includes heavy load mechanical arm body unit, terminal position detection and calibration unit and control unit, its characterized in that:
the heavy-duty mechanical arm body unit comprises a vibration isolation table, an aluminum profile bracket, a base, an electric slip ring, a first arm, a second arm, an elbow joint servo motor, a shoulder joint servo motor, an elbow joint speed reducer and a shoulder joint speed reducer;
the vibration isolation table is connected with the base through bolts, and the base is used for fixing the first arm;
the aluminum profile bracket is used for fixing an industrial camera;
the electric slip ring is arranged in the center of the top of the aluminum profile bracket and is used for providing power for the shoulder joint servo motor;
the elbow joint servo motor and the elbow joint speed reducer are arranged at the first arm and used for driving the first arm to move;
the shoulder joint servo motor and the shoulder joint speed reducer are arranged at the second arm and used for driving the second arm to move;
the tail end position detection and calibration unit comprises an industrial camera, a laser tracker and two light source reflectors;
the two light source reflectors are arranged at the top of the tail end of the second arm;
the industrial camera is arranged on the aluminum profile bracket, is connected with the PC end network, and is used for transmitting an image of the tail end position of the second arm, extracting pixels of two light source reflectors to further obtain the actual tail end position of the second arm, and carrying out particle swarm optimization calculation by combining detection data of the laser tracker to obtain a control error compensation quantity;
the control unit comprises a shoulder joint servo driver, an elbow joint servo driver, a control card and a PC end;
the joint servo driver and the elbow joint servo driver are respectively connected with the shoulder joint servo motor, the elbow joint servo motor and the motion control card and are used for driving the shoulder joint servo motor and the elbow joint servo motor to move so as to realize the motion of the tail end of the second arm;
the control card is used for receiving the PC end signal, combining the control error compensation quantity to carry out kinematic inverse solution, and transmitting the processed signals to the shoulder joint servo driver and the elbow joint servo driver.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310302560.1A CN116476046A (en) | 2023-03-27 | 2023-03-27 | Mechanical arm calibration and control device and method based on particle swarm optimization |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310302560.1A CN116476046A (en) | 2023-03-27 | 2023-03-27 | Mechanical arm calibration and control device and method based on particle swarm optimization |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116476046A true CN116476046A (en) | 2023-07-25 |
Family
ID=87218604
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310302560.1A Pending CN116476046A (en) | 2023-03-27 | 2023-03-27 | Mechanical arm calibration and control device and method based on particle swarm optimization |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116476046A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118544360A (en) * | 2024-07-25 | 2024-08-27 | 佛山大学 | Robot vision detection method, system, terminal and medium based on laser compensation |
-
2023
- 2023-03-27 CN CN202310302560.1A patent/CN116476046A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118544360A (en) * | 2024-07-25 | 2024-08-27 | 佛山大学 | Robot vision detection method, system, terminal and medium based on laser compensation |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110421562B (en) | Mechanical arm calibration system and calibration method based on four-eye stereoscopic vision | |
CN110238845B (en) | Automatic hand-eye calibration method and device for optimal calibration point selection and error self-measurement | |
JP2022039906A (en) | Multi-sensor combined calibration device and method | |
CN108582076A (en) | A kind of Robotic Hand-Eye Calibration method and device based on standard ball | |
CN111127568B (en) | Camera pose calibration method based on spatial point location information | |
CN109238168A (en) | Large-scale metrology part surface three dimension shape high-precision measuring method | |
CN112833786B (en) | Cabin attitude and pose measuring and aligning system, control method and application | |
CN106767913B (en) | Compound eye system calibration device and calibration method based on single LED luminous point and two-dimensional rotary table | |
CN116476046A (en) | Mechanical arm calibration and control device and method based on particle swarm optimization | |
CN111220120A (en) | Moving platform binocular ranging self-calibration method and device | |
CN111733673B (en) | Non-contact measuring method and device for road surface unevenness based on mobile platform | |
CN114993608A (en) | Wind tunnel model three-dimensional attitude angle measuring method | |
CN113177918A (en) | Intelligent and accurate inspection method and system for electric power tower by unmanned aerial vehicle | |
CN108931236B (en) | Industrial robot tail end repeated positioning precision measuring device and method | |
CN114670199A (en) | Identification positioning device, system and real-time tracking system | |
CN113043332B (en) | Arm shape measuring system and method of rope-driven flexible robot | |
CN110595374A (en) | Large structural part real-time deformation monitoring method based on image transmission machine | |
CN110568866A (en) | Three-dimensional curved surface vision guiding alignment system and alignment method | |
CN114034205A (en) | Box filling system and filling method | |
CN113781558A (en) | Robot vision locating method with decoupled posture and position | |
CN114998422B (en) | High-precision rapid three-dimensional positioning system based on error compensation model | |
CN114998444B (en) | Robot high-precision pose measurement system based on two-channel network | |
CN110160460B (en) | Metal structure deformation measuring device and method based on digital photography | |
CN109211174B (en) | Space vector pull rope measuring method and device | |
CN115246123A (en) | Robot kinematics parameter calibration method and system based on monocular mobile vision |
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 | ||
CB02 | Change of applicant information | ||
CB02 | Change of applicant information |
Country or region after: China Address after: No.33, Guangyun Road, Shishan town, Nanhai District, Foshan City, Guangdong Province 528225 Applicant after: Foshan University Address before: No.33, Guangyun Road, Shishan town, Nanhai District, Foshan City, Guangdong Province 528225 Applicant before: FOSHAN University Country or region before: China |