I want to add a weaving option to a robot that will be used for welding applications. I've set up the base code for a simple condition (z=0).
My code doesn't give the right results, because I just tried to implement a 2D formula in 3D enviroment
I would like to add another condition, that the torch to held in angle to the XY plane.
For beginning of the program run, I have the start position coordinates in WORLD coordinate system (Ax, Ay, AZ), and the end point coordinates of the end point in WORLD coordinate system (bx, By, Bz). I have the orientations too, but for calculations I will copy the first's point orientations.
Concept of the code:
- calculate the length between the end point and start point
- divide length by pitch/4
- find the perpendicular point of magnitude 'Amplitude' at point on the line AB in step pitch/4
And this is the step where I'm stuck. I need a general formula to get this perpendicular point, considering the 2. option I want to make (the AB line is not in TOOL system's XY plane)
Any help would be appreciated.
Thanks in advance Arnold
EDIT:
The simpliest case is the first case, when the welding torch moves perpendicular to the movement plane.
We know the START point coordinates in 3D space, END point coordinates in 3D space, Amplitude and Pitch.
In the first step I need to calculate the first peak point's coordinates, relative to START point.
If all points were in in 2D, I know the formulas, but I need formulas in 3D coordinates (START and END points are given in an other coordinate system, not in this coordinate system as on the picture), and I need a general formula, to be able to calculate in the 2nd case too.
u,v
and start pointp0
describing the plane where your movement will be and then simply convert your 2D to 3D like this:p = p0 + x*u + y*v:
the perpendicular vector to 2 different vectors is done by simple cross product. – Spektre