An Automatic Posture Planning Software of Arc Robot Based on SolidWorks API

An automatic posture planning software is presented in this paper. The main function of this software is posture planning of the welding torch. This software is developed based on the programming platform SolidWorks API. The four components of the software are path generation module, posture generation module, posture adjustment module and date out put module. This software could supplement a posture planning function to ROBOGUIDE. Some planning experiments are executed to prove the validity of the software.


Introduction
It is crucial that the path and posture planning function in the off-line program of arc robot.The result of path and posture planning must track the welding seam continually and smoothly.Therefore, the path and posture planning module of welding torch coordinate are a critical parts in the off-line program software.
In order to improve the path and posture planning efficiency of arc torch, a program is presented in this paper.It is developed in the API function of SolidWorks.The result of the planning could be used in the off-line program software ROBOGUIDE.
With the API programming function, the real curve can be approximated by a B-spline curve, and all of the corresponding data presenting the curve the can be obtained by recursive computation.In SolidWorks 2006, the representation of curves is open-uniform B-spline.For quadratic curves, such as circles, parabolas and hyperbolas, non-uniform non-rational B-spline is adopted.For cubic curves, non-uniform rational B-spline is introduced.In SolidWorks 2006, there are many the parameters that describing the structure and the properties of a B-spline curve.The parameters include a set of control points, the degree of the polynomial, the weight vector, and the knot vector of a B-spline.

The main function of path and posture planning module
ROBOGUIDE is developed by FANUC a robot company.The main functions of this software are robot modeling, layout planning, the coordinate of robot inputting and outputting, the work process simulating, and communicating with FANUC robot.But the ROBOGUIDE can't generate the path points and postures of complicated space curve automatically.Therefore the practicability of this software is greatly weakened.As the data file of path and posture in ROBOGUIDE could be read freely, the problem above could be solved by the developing a path and posture automatic generating software for ROBOGUIDE.
The main functions of this software are: 1) Extract the path information which generated by three-dimensional CAD software, and then generate the in formation of path points.
2) Plan the postures of welding torch coordinate according to the actual situation.
3) Show the results of planned welding torch coordinate system in three-dimensional CAD software.Judge and modify the planning results artificially.4) Generate the path and posture file according to the format of ROBOGUIDE.
The SolidWorks is a kind of CAD software; the three-dimensional shape could be drawn by it.It has re-exploit function that could be used in generate the data of path and posture planning result automatically.And the drawing operation of this software is convenience.The information such as structural curve and intersecting curve of the 3-D shape could be obtained in IGES file.So the SolidWorks is chosen to exploit the path and posture software.The operation process of the path and posture software is follows:

Realizations of each module functions
At first the panel of these functional modules should be determined according to the functions of each module; then these functional modules should be programmed according to flowchart plan and program function.The function modules of this software are: Path points generating module, posture generating module, posture adjusting module, data output module

Path points generating module
Because of the complexity and dynamicity of spatial path curves of welding seam, the data of the spatial curves couldn't be expressed by a certain formula.The IGES graphics standard could provide the data of the curve by a universal formula.The IGES standard data file of 3-D drawing could be obtained from the SolidWorks.At first, work piece is drawn; then the path curve for welding would be picked up and saved as 'igs' file format.The file could be loaded in path points generating module.The data file will be read by program; the program could calculate the path points automatically according to the type of the curve.There are three entity types could represents the welding path in the SolidWorks, straight-line portion, arc and rational b-spline curve.The type of the curve must be chosen before the program calculating; and the number of path points is inputted.Generally the more point is calculated out by program, the more accurate the expression of curve will be.But the excessive path points will increase workload for off-line programming software at follow step work.So it is very important to choose the suitable quantities points in program according to the size and shape of model.Then the data of path points will be generated automatically by computer program.
The expression of straight-line is: 110,X1,Y1,Z1,X2,Y2,Z2; in the expression the data could express the two ending points of line.
The expression of arc is 100, ZT, X1, Y1, X2, Y2, X1, Y1; these data must be combined with another entity to express the space arc.The conversion matrix entity is used to describe the posture of the arc in the space.
The rational b-spline curve is the complex entity in all three entities.It expression Where p k is the coordinate of the k th control point, and k w is the corresponding weight factor of the k th control point.

Values of min
u and max u are the minimum value, and the maximum of the knot vector respectively.In general, min u is set to 0, and max u is set to 1.The value of parameter d is 2 for lines, 3 for quadratic curves, and 4 for cubic curves.
, ( ) B u is the blending function defined as: Where u j is the j th knot value in the knot vector which is a monotonic decreasing sequence?
The software could be programmed according to the expression above,

posture generating module
The major function of this module is calculating the posture of the corresponding welding torch coordinate with data of path points from the path points generating module.Then the data of posture will be inputted in the posture file.The data is expressed in two type posture expression format, the WPR expression and directional cosine expression.The general theory of welding torch coordinates calculating is below.Each path points' tangential direction is used to represent the moving direction of the welding torch.Then rectify the posture and position of the originality welding torch coordinate in the world coordinate frame.The row and pitch angles of the torch coordinate revolving could be worked out.The originality torch coordinate frame is changed to torch coordinate frame 1.At last the coordinate frame 1 is rotated about x axis of itself with an applicable angle, then the torch coordinate frame 1 is changed into aim torch coordinate frame.Through the change steps above the torch coordinate above could be obtained.Before the program calculation, the value of rotation angle of starting and ending welding point would be input; the program will automatically calculate a series of gradual rotation angle between first and last points; finally, the data could be worked out and the posture data would be outputted.
After the program calculation, function of graphics is used to display the planning result in SolidWorks panel.It also could display the serial number of each welding torch coordinate.The operator could use this information to estimate the planning result, and make a decision whether need to use the posture adjusting module.
The direction of torch x axis in straight-line is the vector of two ending points.The x axis direction of arc entity and rational b-spline curve is the tangent direction of corresponding point.
The tangent direction of arc could be counted through the expression below: It expresses the fact that the tangent direction of corresponding points is uprightness with the vector direction between the centre of a circle and itself.
In the condition of rational b-spline curve, the tangent direction could be obtained by solve the derivative of the expression. , The expression of original frame turn to frame 1 is: The aim frame could be obtained by the expression below:

posture adjusting module
After the operation above, the first planning information could be shown; the users could judge the feasibility of scheme according to the experience and practical situation of welding work pieces.If there is some posture of welding point is not suitable; users could input the starting and ending serial number and the new posture of these points into this module.The new posture also could display in SolidWorks.This step could be used repeatedly, until the planning result could satisfy the practice demand.
Table 1 shows the tolerance of the sample points on the saddle's seam shown in Fig. 3. X, Y and Z are the coordinates calculated by this method; w, p, r are the used to describe the posture of torch frame.

data output module
The main function of the data output module is output the planning result to the ROBOGUIDE.The planning result obtained through the step above, could be used in some off-line program, such as RBOBGUIDE.But the user must input the data manually, so that the work efficiency could be reduced seriously.Because path record files "*.layout" and "*.ini" of ROBOGUIDE could be read and written freely.This module could change data of planning result to the data format of ROBOGUIDE.

Conclusions
This paper has presented a practical CAD-based path automatic generation method for welding robots, which is based on the B-spline approximation of the welding seam.With this method, planar seams, as well as 3D seams, especially the intersection of two free-form surfaces can be extracted.With this method, the quality, the flexibility and the productivity of the welding robots can be increased.With this method, the complexity of robot programming, the time used to programming would be reduced.It also enhanced the capacity of welding robot.Those irregular shaped and contoured parts can be welded.In addition, this method also suits for many other robot applications, such as painting robot, and grasping robot.
1) A VBA program is programmed in the SolidWorks API.The main function of this software is planning the path and posture of welding torch automatically.Some typical work pieces are used in the experimental simulation to prove the validity of this method.
2)The defects of this software are that the automation level of software is still low because the path points on the work piece must be picked up manually; and for most complex space curve, one time in program calculation only could calculate the data of one entity curve, it will increase the complexity and discontinuity.These short points could be overcome in future.
the work above, any space curve of the work piece could be worked out.The pictures below are some examples of the planning result.The work piece in fig.4-(a) shows three intersecting pipes; one pipe intersects vertically with main pipe and another pipe intersects obliquely with main pipe.The main difficulty of this planning work is the small room where three pipes intersected, so coordinate rotation angle of these path points through area round this point should be adjusted.Fig4-(b) shows that the planning path is made up of two semi-circle arcs and two straight-line portions.The welding path is plane curve.The main difficulty is that the welding torch must avoid to colliding the outline of model.The fig.4 -(c) displays a complexity work piece; this model is found in a SolidWorks textbook.It has all kinds space curve such as straight-line portion, arc and rational b-spline curve in the program, includes the cylinder intersecting with cylinder, cylinder intersecting with sphere, plane intersecting with cylinder, plane intersecting with sphere.Further more it must considering that welding torch need to keep off pedestal of main body between joint and cylinder.show normal structure in pipes that pipe welding on flange and welding path be a circle.

Figure 1 .
Figure 1. the space curve obtained from SolidWorks