0

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.

arnoldino
  • 1,969
  • 2
  • 13
  • 15
  • 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 Jun 08 '20 at 07:18
  • 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 Jun 08 '20 at 14:51
  • 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 Jun 08 '20 at 15:06
  • I edited the question post. By perpendicular point I mean a point laying on the perpendicular line. – arnoldino Jun 08 '20 at 15:47
  • @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 etc – MBo Jun 08 '20 at 16:10
  • The Start and End point has yaw, pitch and roll parameters too, relative to the World frame. For the movement I will copy the start point's orientations. Is this what you ask? – arnoldino Jun 08 '20 at 16:38
  • @arnoldino no its not enough. You have `start` and `end` points of the path but you also need any other point which lie on the plane (not on the `start-end` line) or the plane `normal` vector otherwise your path can't be docked onto the plane and could rotate around the `start-end` line. From this you can either construct 2 or 3 basis vectors or transform matrix itself easily. – Spektre Jun 09 '20 at 06:30
  • OK, I think I understand your point. – arnoldino Jun 09 '20 at 09:07
  • And I think this is the main issue what confuses me too. When I record the START point (register the coordinates and orientations) in WORLD frame, I have the TOOL frame's origin at the same point, and in the 1st case I say, that the movement should be in TOOL frame's XY plane. This should define the plane of movement. – arnoldino Jun 09 '20 at 09:14
  • I have the calculations in 2D, but I don't know how to implement it in this case, when I have WORLD coordinates, and TOOL coordinates. Probably I need to transform the START and END point's coordinate in TOOL coordinates, and then I can apply the 2D calculations. – arnoldino Jun 09 '20 at 09:14
  • Actually maybe a formula similar to this in the 1st answer, only in 3D would be usefull https://stackoverflow.com/questions/47040213/find-perpendicular-line-using-points-on-that-line – arnoldino Jun 09 '20 at 09:32
  • @arnoldino that would not help for the same reasons... Also do not confuse tool cordinates with desired weld path... What you should do is to 1. compute 3D path of the weld in world coordinates 2. then compute inverse kinematics to drive the tool to wanted position in time... there are usual constraints like angle of intercept of tool and the surface etc ... however you always need at least 3 points or 2 points and vector to describe a plane or any other additional information ... So where is the plate or whatever you are welding placed on in respect to your world coordinates ? – Spektre Jun 09 '20 at 15:53
  • @arnoldino If its aligned to world axises then you simply use that as normal vector ... So what exactly you have known as input? – Spektre Jun 09 '20 at 15:54
  • for input we know the start point's coordinates and orientation, the end point's coordinates and orientation in WORLD frame, pitch and amplitude. The first point's orientation should define the plane of weaving. When I record the first point, the actual orientation of the torch is defining the Z axis of TOOL frame. For further calculations I constrain that the movement should be in XY plane of TOOL frame. Is this not clear enough? – arnoldino Jun 10 '20 at 16:45

1 Answers1

0

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

arnoldino
  • 1,969
  • 2
  • 13
  • 15