0
votes

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).

  1. My code doesn't give the right results, because I just tried to implement a 2D formula in 3D enviroment Condition z0

  2. I would like to add another condition, that the torch to held in angle to the XY plane. enter image description here

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.

enter image description here

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.

1
create basis vectors u,v and start point p0 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
I don't need a perpendicular vector to the movement plane. I need perpendicular point to the movement vector in movement plane The foot of the perpendicular line is at pitch/4 distance from the start point.arnoldino
What is perpendicular point? I do not recognize that term ... can you show it on the image or better describe... Also currently its not really clear what is known and unknown for the step in question.Spektre
I edited the question post. By perpendicular point I mean a point laying on the perpendicular line.arnoldino
@arnoldino As I wrote in comment to you, it is not enough to have two points in 3D to define unique "frame". You should also define orientation with some other point, plane, line etcMBo

1 Answers

0
votes

I've succeed ro get this problem solved. Basically I've done the dollowing steps.

-what we know is Start and End point coordinates and orientation relative to World system, pitch and amplitude

  1. Define the first step point between Start and End point in World system, deviding the distance by pitch/4.
  2. This new Intermediate coordinates are known already, I've interpolated the Z orientation too, the other 2 orientation remains as Start's orientation
  3. Create transformation matrix from Wolrd to this Intermediate point's system
  4. Using the inverse tranaformation matrix define End point's coordinates relative to Intermediate point's system
  5. Create a unit vector from Intermediate point toward End point in Intermediate point's system
  6. Calculate cross product between this unit vector and Intermediate system's Z axis (v) , and the inverse (-v) for alternating effect
  7. Scaling the result by the known constant Amplitude
  8. In iteration calculate next point on line between Start and End in World system
  9. Make movement to next point and offset it by v or - v

I can share more details, if anybody needs it