Welding track based on machine vision is proofreaied and correct Special testing device and method
Technical field
The present invention relates to a kind of welding track and proofread and correct Special testing device, especially a kind of welding track based on machine vision is proofreaied and correct Special testing device and method, belongs to welding track alignment technique field.
Background technology
Because artificial welding exists severe operational environment, the amount of labour is large, with problems such as inefficiencies, automobile at home of current robot welding, engineering machinery, and many fields such as container production have progressively obtained application, welding robot adopts the work of teaching reproduction mode conventionally, " teach programming " refers to complete by following manner the establishment of program: completed the action of expection by artificial guiding robot end effector (as: welding gun) Lai Shi robot, " task program " is one group of motion and miscellaneous function instruction, specifically expect operation in order to determine robot." reproduction " refers to that robot obtains task program according to teach programming, constantly repetition.
Implement at concrete welding surroundings for guaranteeing " teaching reproduction " this mode of operation, in front operation, need to complete welding work pieces location by artificial spot welding, this can cause position error, thus robot trajectory while causing teach programming acquisition robot welding track to depart from reproduction.
For addressing the above problem, conventionally need to adopt mechanical vision inspection technology to proofread and correct the welding track reproducing, as shown in Figure 1.Machine vision technique refers to by industrial camera 1 and converts welded part 2 to picture signal, sends image processing system to, according to the information such as pixel distribution and brightness, color, is transformed into digitized signal; Picture system carries out various computings to these signals and carrys out the feature of extracting objects, thereby determines and reproduce welding track side-play amount, and welding robot 3 can accurately be welded welding work pieces 2; But this accuracy evaluation of being determined welding track side-play amount by machine vision technique but occurs there are no relevant apparatus with verifying, therefore need to develop a set of Special testing device, can the welding track side-play amount precision of being determined by machine vision technique be assessed and be verified, and the reason of analytical error generation, thereby continue to optimize the image processing method in machine vision technique, make to realize the accurate testing requirement of welding track side-play amount.
Summary of the invention
The object of the invention is the defect in order to solve above-mentioned prior art, provide a kind of can realization based on machine vision technique to complete welding track based on the machine vision correction Special testing device of welding work pieces track in x axle and the detection of y direction of principal axis side-play amount.
Another object of the present invention is to provide a kind of welding track based on machine vision to proofread and correct the method for testing of Special testing device.
Object of the present invention can be by taking following technical scheme to reach:
Welding track based on machine vision is proofreaied and correct Special testing device, it is characterized in that: comprise workbench, precision positioning mechanism, machine vision collecting device and control appliance, described precision positioning mechanism is connected with control appliance respectively with machine vision collecting device, described precision positioning mechanism, machine vision collecting device and control appliance are arranged on workbench, and described machine vision collecting device is positioned at the top of precision positioning mechanism; Described precision positioning mechanism comprises x direction of principal axis driver element, y direction of principal axis driver element, x direction of principal axis position detection unit and y direction of principal axis position detection unit; In the time of test, described y direction of principal axis driver element drives welding work pieces to move along y direction of principal axis, and described x direction of principal axis driver element drives y direction of principal axis driver element that welding work pieces is moved along x direction of principal axis.
Preferably, described x direction of principal axis driver element comprises the first AC servo motor, the first shaft coupling and the first ball screw that connect successively, is provided with x direction of principal axis travelling carriage on described the first ball screw; Described y direction of principal axis driver element comprises the second AC servo motor, the second shaft coupling and the second ball screw that connect successively, is provided with y direction of principal axis travelling carriage on described the second ball screw; Described y direction of principal axis driver element is placed on x direction of principal axis travelling carriage, and described y direction of principal axis travelling carriage is used for placing welding work pieces in the time of test; Described x direction of principal axis position detection unit and y direction of principal axis position detection unit adopt respectively the first linear grid ruler and the second linear grid ruler, described the first linear grid ruler is arranged on a side of x direction of principal axis driver element, and described the second linear grid ruler is arranged on a side of y direction of principal axis driver element.
Preferably, described machine vision collecting device comprises industrial camera, camera lens and light source, and described camera lens is connected with industrial camera and aims at precision positioning mechanism, and described distribution of light sources is around camera lens.
Preferably, described control appliance comprises industrial control host, motion controller, the first AC servo driver and the second AC servo driver, described the first AC servo driver is connected with the first AC servo motor, described the second AC servo driver is connected with the second AC servo motor, described the first AC servo driver and the second AC servo driver are set up communication by motion controller and industrial control host respectively, described the first linear grid ruler is connected with motion controller by communication interface respectively with the second linear grid ruler, described industrial control host is connected with industrial camera by bus communication card, described industrial control host is connected with the display for realizing man-machine interaction.
Preferably, described workbench adopts frame structure, one side of this frame structure is provided with vertical supports, in described vertical supports, be vertically fixed with horizontal support, described precision positioning mechanism is arranged in the top planes of frame structure, described control appliance is arranged on the inside of frame structure, and described machine vision collecting device is fixed on horizontal support.
Preferably, the bottom of described frame structure is provided with four wheels that can make movable workbench.
Preferably, the frame structure that the frame structure that described workbench adopts is 1000*800*700mm.
Another object of the present invention can be by taking following technical scheme to reach:
The method of testing of proofreading and correct Special testing device based on the welding track of machine vision, is characterized in that comprising the following steps:
1) adopt scaling board to demarcate, obtain industrial camera intrinsic parameter and outer parameter;
2) welding work pieces is positioned on the y direction of principal axis travelling carriage of precision positioning mechanism, according to the current location of welding work pieces, captures welding work pieces image and set up welding work pieces template by industrial camera;
3) set welding work pieces x axle and the y axle offset amount on workbench by industrial control host, controlling the first AC servo motor and the first ball screw drives welding work pieces to move to the x axle offset amount position of setting, control the y axle offset amount position that the second AC servo motor and the second ball screw driving welding work pieces move to setting, obtain respectively x axle and the y axle real offset (x of current welding work pieces by the first linear grid ruler and the second linear grid ruler
r, y
r);
4) after welding work pieces skew, again capture the welding work pieces image of current location by industrial camera, and adopt image noise reduction algorithm to process image;
5) adopt the template matching algorithm based on gray value, obtain x axle and the y axial side-play amount (x of welding work pieces with respect to template workpiece
m, y
m);
6) compare (x
r, y
r) and (x
m, y
m) value, reproduce process allowable error according to welding robot, judge whether the precision of Machine Vision Detection meets the demands, judge whether to meet
Wherein Δ x and Δ y are the error that welding system allows; If meet the demands, can be integrated in industrial robot control system and apply; If do not meet the demands, the reason that analytical error produces, is optimized from industrial camera demarcation, image noise reduction Processing Algorithm and template matching algorithm, improves certainty of measurement, thereby meets instructions for use.
Preferably, step 4) specific as follows:
After welding work pieces skew, again capture the welding work pieces image of current location by industrial camera, this image is 24bit coloured image, transfer the gray level image of 256 grades to by image binaryzation, adopt again mean filter to complete noise reduction process, wherein mean filter mask size is m × n, and in image, any point (x, y) response is:
Wherein, g (x, y) is mask pixel average,
Preferably, step 5) specific as follows:
A) adopt the template matching algorithm based on gray value, by calculating normalizated correlation coefficient NCC, determine the similarity of current welding work pieces image and template image coupling, determine thus welding work pieces with respect to the side-play amount of template workpiece x axle and y axle in image coordinate system (x '
m, y '
m):
Wherein, t (i, j) is welding work pieces template gray value, and f (x+i, y+j) is current welding work pieces gradation of image value, m
ttemplate average gray value,
the variance of all gray values of template, m
f(x, y) and m
f(x, y) is average gray value and the variance of each point in the current welding work pieces template of translation; In the time of normalizated correlation coefficient NCC=± 1, between welding work pieces template and current welding work pieces image, mate completely, and normalizated correlation coefficient NCC absolute value
more approaches 1, represent that welding work pieces template is more approaching with the welding work pieces image detecting;
B) industrial camera obtains intrinsic parameter and outer parameter after demarcating, x axle above-mentioned steps a) being obtained through seven submatrixs conversion and affine transformation and the side-play amount of y axle (x '
m, y '
m) be converted to x axle and y axle offset amount (x in tool coordinates system
m, y
m).
The present invention has following beneficial effect with respect to prior art:
Welding track based on machine vision of the present invention is proofreaied and correct Special testing device, by precision positioning mechanism and machine vision collecting device are set, can realize based on machine vision technique and complete welding work pieces track in x axle and the detection of y direction of principal axis side-play amount, and utilize industrial control host testing result is assessed and verified, in the time meeting required precision, can be integrated in industrial robot control system and apply, the reason that analytical error produces in the time not meeting required precision, continue to optimize the image processing method in machine vision technique, thereby realize the object that welding track side-play amount accurately detects.
Accompanying drawing explanation
Fig. 1 is the welding robot operative scenario schematic diagram that applied for machines vision technique carries out welding track correction.
Fig. 2 is that the welding track based on machine vision of the present invention is proofreaied and correct Special testing device structural representation.
Fig. 3 is that the welding track based on machine vision of the present invention is proofreaied and correct Special testing device structural principle block diagram.
Fig. 4 is that the welding track based on machine vision of the present invention is proofreaied and correct Special testing device control circuit figure.
Fig. 5 is that the welding track based on machine vision of the present invention is proofreaied and correct Special testing device human-computer interaction interface figure.
Fig. 6 is the control software architecture diagram that the welding track based on machine vision of the present invention is proofreaied and correct Special testing device.
In Fig. 2 and Fig. 3,1-workbench (frame structure), 2-wheel, 3-vertical supports, 4-horizontal support, 5-x direction of principal axis driver element, 6-y direction of principal axis driver element, 7-x direction of principal axis position detection unit (the first linear grid ruler), 8-y direction of principal axis position detection unit (the second linear grid ruler), 9-industrial camera, 10-camera lens, 11-light source, 12-industrial control host, 13-motion controller, 14-the first AC servo driver, 15-the second AC servo driver, 16-bus communication card, 17-display.
The specific embodiment
Embodiment 1:
As shown in Figures 2 and 3, the welding track based on machine vision of the present embodiment is proofreaied and correct Special testing device, comprise workbench 1, precision positioning mechanism, machine vision collecting device and control appliance, described workbench 1 adopts frame structure 1, the frame structure that this frame structure 1 is 1000*800*700mm, adopt 40*40 standard aluminum section bar to form, its bottom is provided with four wheels 2 that can make workbench 1 move, one side is provided with vertical supports 3, in described vertical supports 3, be vertically fixed with horizontal support 4, described precision positioning mechanism is arranged in the top planes of frame structure 1, described control appliance is arranged on the inside of frame structure 1, described machine vision collecting device is fixed on horizontal support 4, described machine vision collecting device is positioned at the top of precision positioning mechanism, described precision positioning mechanism comprises x direction of principal axis driver element 5, y direction of principal axis driver element 6, x direction of principal axis position detection unit 7 and y direction of principal axis position detection unit 8,
Described x direction of principal axis driver element 5 comprises the first AC servo motor 5-1, the first shaft coupling 5-2 and the first ball screw 5-3 that connect successively, is provided with x direction of principal axis travelling carriage 5-4 on described the first ball screw 5-3; Described y direction of principal axis driver element 6 comprises the second AC servo motor 6-1, the second shaft coupling 6-2 and the second ball screw 6-3 that connect successively, is provided with y direction of principal axis travelling carriage 6-4 on described the second ball screw 6-3; It is upper that described y direction of principal axis driver element 6 is placed in x direction of principal axis travelling carriage 5-4, and described y direction of principal axis travelling carriage 6-4 is used for placing welding work pieces in the time of test; Described x direction of principal axis position detection unit 7 and y direction of principal axis position detection unit 8 adopt respectively the first linear grid ruler 7 and the second linear grid ruler 8, described the first linear grid ruler 7 is arranged on a side of x direction of principal axis driver element 5, and described the second linear grid ruler 8 is arranged on a side of y direction of principal axis driver element 6;
Described machine vision collecting device comprises industrial camera 9, camera lens 10 and light source 11, and described camera lens 10 is connected with industrial camera 9 and aims at precision positioning mechanism, and described light source 11 is distributed in camera lens 10 around;
Described control appliance comprises industrial control host 12, motion controller 13, the first AC servo driver 14 and the second AC servo driver 15.
In the present embodiment, the HC-KFS-23A model motor that described the first AC servo motor 5-1 is Japanese mitsubishi electric Co., Ltd, the HC-KFS-43A model motor that described the second AC servo motor 6-1 is Japanese mitsubishi electric Co., Ltd; Described the first ball screw 5-3 and the second ball screw 6-3 all adopt the KK6005P-600A1-FE-CS2 model screw mandrel of Taiwan Shang Yin Co., Ltd, and its helical pitch is 5mm, and effectively rail length is 600mm, and precision is ± 0.01mm; Described the first linear grid ruler 7 and the second linear grid ruler 8 all adopt the Spain MKT-52 of Fa Ge FAGOR company model, and effective travel is 520mm, and resolution ratio is 5um, and precision is ± 10um; Described industrial camera 9 adopts 800,000 pixel 1394 cameras of German Ying Meijing Co., Ltd (IMAGINGSOURCE), model is DMK31AF03, resolution ratio is 1024x768, Pixel Dimensions horizontal direction is 4.65um, vertical direction is 4.65um, camera lens 10 adopts the M2514-MP2 model mega pixel camera lens of Japanese Computar company, and focal length is 25mm; GTS-400-PV (G)-PCI movement sequence controller that described motion controller adopts solid High Seience Technology Co., Ltd. to produce; Described the first AC servo driver 14 adopts the MR-J2S-20A model servo-driver of Japanese mitsubishi electric Co., Ltd, and described the second AC servo driver 15 adopts the MR-J2S-40A model servo-driver of Japanese mitsubishi electric Co., Ltd.
Proofread and correct Special testing device control circuit figure in conjunction with the welding track based on machine vision shown in Fig. 4, described the first AC servo driver 14 is connected with the first AC servo motor 5-1, described the second AC servo driver 15 is connected with the second AC servo motor 6-1, described the first AC servo driver 14 and the second AC servo driver 15 are set up communication by motion controller 13 and industrial control host 12 respectively, described the first linear grid ruler 7 is connected with motion controller 13 with CN13 communication interface by CN12 respectively with the second linear grid ruler 8, described industrial control host 12 is connected with industrial camera 9 by 1394 bus communication cards 16, described industrial control host 12 is connected with display 17, can realize man-machine interaction, set the kinematic parameter of x axle and y axle by the man-machine interface shown in Fig. 5, motion controller 13 is exported pulse and direction signal to the first AC servo driver 14 and the second AC servo driver 15, drive the firstth AC servo motor 5-1 to drive x direction of principal axis travelling carriage 5-4, and drive the second AC servo motor 6-1 to drive y direction of principal axis travelling carriage 6-4 to arrive anchor point, the first linear grid ruler 7 and the second linear grid ruler 8 detect the x shaft position signal of x direction of principal axis travelling carriage 5-4 and the y shaft position signal of y direction of principal axis travelling carriage 6-4, and be input to motion controller 13 through 2 tunnel quadruple increment type auxiliaring coding devices, can obtain testing result in man-machine interface.
As shown in Figure 6, described industrial control host 12 is used Control System Software, and this software adopts Microsoft VisualStudio2005 platform development, is divided into four levels, and first level is Drivers Library, is provided by each equipment supplier; Second level is communication and monitoring programme, comprises monitoring module, communication module and fault diagnosis and alarm module, and it is responsible for real-time communication and operation monitoring between the each module of application program, and to diagnosing malfunction and warning; The 3rd level is control program layer, comprises motion-control module, position detecting module, Machine Vision Detection module and four parts of human-computer interaction module, and it is the core of whole control system; The 4th layer is primary control program layer, comprises main control module and file and data management module two parts, and wherein first, second, and third layer is real-time control module, and the 4th layer is coordinator, is non-real-time control routine.
The welding track based on machine vision of the present embodiment is proofreaied and correct the method for testing of Special testing device, it is characterized in that comprising the following steps:
1) adopt scaling board to demarcate, obtain industrial camera intrinsic parameter and outer parameter;
2) welding work pieces is positioned on the y direction of principal axis travelling carriage of precision positioning mechanism, according to the current location of welding work pieces, captures welding work pieces image and set up welding work pieces template by industrial camera;
3) set welding work pieces x axle and the y axle offset amount on workbench by industrial control host, moving control module for controlling the first AC servo motor and the first ball screw drive welding work pieces to move to the x axle offset amount position of setting, control the y axle offset amount position that the second AC servo motor and the second ball screw driving welding work pieces move to setting, obtain respectively x axle and the y axle real offset (x of current welding work pieces by the first linear grid ruler and the second linear grid ruler
r, y
r);
4) after welding work pieces skew, call Machine Vision Detection module, again capture the welding work pieces image of current location by industrial camera, and adopt image noise reduction algorithm to process image, specific as follows:
After welding work pieces skew, again capture the welding work pieces image of current location by industrial camera, this image is 24bit coloured image, transfer the gray level image of 256 grades to by image binaryzation, Machine Vision Detection module adopts mean filter to complete noise reduction process again, wherein mean filter mask size is m × n, and in image, any point (x, y) response is:
Wherein, g (x, y) is mask pixel average,
5) Machine Vision Detection module adopts the template matching algorithm based on gray value, obtains x axle and the y axial side-play amount (x of welding work pieces with respect to template workpiece
m, y
m), specific as follows:
A) adopt the template matching algorithm based on gray value, by calculating normalizated correlation coefficient NCC, determine the similarity of current welding work pieces image and template image coupling, determine thus welding work pieces with respect to the side-play amount of template workpiece x axle and y axle in image coordinate system (x '
m, y '
m):
Wherein, t (i, j) is welding work pieces template gray value, and f (x+i, y+j) is current welding work pieces gradation of image value, m
ttemplate average gray value,
the variance of all gray values of template, m
f(x, y) and s
f(x, y) is average gray value and the variance of each point in the current welding work pieces template of translation; In the time of normalizated correlation coefficient NCC=± 1, between welding work pieces template and current welding work pieces image, mate completely, and normalizated correlation coefficient NCC absolute value more approaches 1, represent that welding work pieces template is more approaching with the welding work pieces image detecting;
B) industrial camera obtains intrinsic parameter and outer parameter after demarcating, x axle above-mentioned steps a) being obtained through seven submatrixs conversion and affine transformation and the side-play amount of y axle (x '
m, y '
m) be converted to x axle and y axle offset amount (x in tool coordinates system
m, y
m);
6) compare (x
r, y
r) and (x
m, y
m) value, reproduce process allowable error according to welding robot, judge whether the precision of Machine Vision Detection meets the demands, judge whether to meet
Wherein Δ x and Δ y are the error that welding system allows; If meet the demands, Machine Vision Detection module can be integrated in industrial robot control system and apply; If do not meet the demands, the reason that analytical error produces, is optimized from industrial camera demarcation, image noise reduction Processing Algorithm and template matching algorithm, improves the certainty of measurement of Machine Vision Detection module, thereby meets instructions for use.
In sum, welding track based on machine vision correction Special testing device of the present invention can be realized based on machine vision technique and complete welding work pieces track in x axle and the detection of y direction of principal axis side-play amount, and testing result is assessed and verified, the reason that analytical error produces, continue to optimize the image processing method in machine vision technique, thereby realize the object that welding track side-play amount accurately detects.
The above; it is only patent preferred embodiment of the present invention; but the protection domain of patent of the present invention is not limited to this; anyly be familiar with those skilled in the art in the disclosed scope of patent of the present invention; according to the present invention, the technical scheme of patent and inventive concept thereof are equal to replacement or are changed, and all belong to the protection domain of patent of the present invention.