# Help with a program to generate x,y coordinates between two arc profiles

• Hello Friends,

I am newbie with kuka robots and krl programming. I am looking for some help from the experts with logic or a formula to perform Welding between two arc profiles as shown in the attached pic (sorry I don't have a cad drawing). The profiles are on a steel plate and no welding allowed outside the profiles. Welding need to start at one end of profile 1 and move along y-direction until profile 2. Then robot need to advance 2 mm in x-direction and repeat welding.

How to program the robot to advance both x, y directions after each weld bead and also finding the weld bead length in y-direction between two profiles.

Thanks in advance.

Ashwin

## Images

• AD
• first you need to clarigy how those two arcs are aligned relative to each other. are you SURE that number you provided are radius and not diameter?

if the two arcs are concentric and with radius you specified, then with 44mm gap at the top, normal distance between two is constantly changing.

if those were full circles, gap at the bottom would be 132mm and not 44mm.

futher, one would need to find when vertical distance is 120mm since you did not bother to provide info about plate size and distance from each arc tip to nearest plate edge.

left side shows what you get if those values are diameter

right side shows what you get if those values are radii

So depending if the values are radius or diameter would have an effect on width of the plate or the green segment.

EDIT.. .this is a better picture

btw geneal equation for circle (x-x0)^2 + (y-y0)^2=R^2

have at it....

1) read pinned topic: READ FIRST...

2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

3) read 1 and 2

• Thank you for the response. They are two concentric circles whose normal distance is constantly changing from 44mm at the top. In your edited picture the one right side resembles the two arc profiles. The way I am thinking to program this is to teach point at ends of the both arcs where the vertical is maximum (120mm) and move the robot in y direction between two points then advance two points in 2mm increments in x direction. But the increment points should be on the arcs not outside the arcs. Is there any method to find out the x,y coordinates of the incremental points.

## Images

Edited once, last by AshwinM ().

• so in this case two circles have different centers and you still did not provide key dimensions. in other words you are making it harder to help you because

one would need to setup and solve a system of equations. why not simplify it and measure how wide the plate is and how far top of ieach sircle is from the bottom edge of the plate?

i am not some mechanical guy but i think all dimensions should be defined from same reference (datum line), just like in electrical circuits all voltages are measured from some known reference (ground/neutral/dc common). you don't have any of your dimensions use common reference (line, not curve)

1) read pinned topic: READ FIRST...

2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

3) read 1 and 2

• Start points of the arcs are the edges of plate. I will find out the distance between top of each circle from bottom of the edge. Thank you.

• i got them already from geometry... created and solved set of equations then wrote little something that is nice, short and fully parametric.

run it in OL and ploted computed points, it is spot on.

1) read pinned topic: READ FIRST...

2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

3) read 1 and 2

• What do you have weldY, weldX, weldLines, p1.y and p2.y. Are those the equations. Can you post them here if you are ok with it.

Thank you

Edited once, last by AshwinM ().

• yes, there are equations.

they would likley not be blurred out if you did not make me go through all the effort since you refused to post the more compelling case.

so thanks for the challenge and enjoy the partial solution - KRL code is shared. start equation is shared

i could share the data, equations and how to derive them but now ... that will cost you.

to complete it all you need is a bit of high school math. it is a good opportunity to refresh what you learned.

if you do it right you will get the correct formulas. this is output that posted KRL code generated:

1) read pinned topic: READ FIRST...

2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

3) read 1 and 2

• No problem. Thank you very much for your help. It is really appreciated.

• you are welcome.

to make math simpler and reduce number of offsets to manage, i used symetry about vertical line at the cnter. it passes through centers of both circles.

since you have two circles, you need to create two equations (one for each of them).

so first equation is for top circle which has center at the origin of base.

then using the values you shared, you cna find cente of lower circle since they are not concentric.

normally you would look for intersect of the two curves but this does not happen here ince only X matches, but not Y.

we need to find where the vertical distance is 120mm.

so to findwhere the vertical distance is 120mm i simply moved (temporarily) one circle by 120 mm. to make them intersect.

this means modifying one of the equation... i chose to list lower circle by 120mm (since it's center is not at origin anyway).

next thing was to substitute few things, for example with this arrangement

both circles have centers at x=0

therefore X01 and x02 are zero and first term of the circle is just x^2 in both equations.

now it is easy to subtract the two and X^2 cancels out and you solve for Y.

then you use this to get X and voila - this value is half of width of the plate.

then using original circle equations, you can use Algebra to transform them so that y1=f1(x) and y2=f2(x).

then one can use loop tp vary X from left to right side of the plate using step of your choice (2mm or whatever)

both P1 and P2 will have same X but Y1 and Y2 will be different.

that was it...

oh and when calculating P! and P2, i adjusted Y so that base origin is at the bottom of the plate, rather than center of outside circle.

1) read pinned topic: READ FIRST...

2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

3) read 1 and 2

• I programmed it after refreshing my math skills. First, i found the x,y coordinates of the start points for both arcs by finding their vertical and horizontal distances from their centers. Then using pythagoras theorem was able to find next set of coordinates for both arcs since I know the radius and increment value.

To find the distances I draw two circles and aligned them so that the distance between top of two circles is 44mm.

Thanks again for your suggestions.

## Images

• How did you generated the arc profiles using the KRL code. Is there any software where we can write the program and see the output. I generated those profile in excel using the formulas. But it will be very helpful if we can see the output for the code. I am completely new with robots. Please suggest if there are any such softwares. Thank you.

• i used CWRITE to save x,y1 and y2.

another way is to declare an array in a DAT file. note, only declaring it is not enough, in this case each array element must be also initialized there.

then during program execution save values to those arrays. when program is finished there will be updated values (calculated instead of zeroes).

then you can import this into an Excel for example

Code
``````DECL REAL x_val[500]
x_val[1]=0
x_val[2]=0
x_val[3]=0
...
x_val[500]=0``````

1) read pinned topic: READ FIRST...

2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

3) read 1 and 2

• ok. Where did you execute the program. Is their any simulator.

• there are different ways to run KRL programs:

1. real controller

2. real controller without robot arm (set environment to office)

3. OPS (Offline Programming Station) is a KUKA desktop PC. it is a hardware PC that works like KPC. more compact than real controller

4. OL (OfficeLite), software running inside virtual machine. this is the most portable version.

i am using OL (OfficeLite 8.5)

years ago OfficeLite used to be offered as a 30day trial version. one shoud still be able to find it in the simulaiton section of this forum.

i think it was OL 4.x

1) read pinned topic: READ FIRST...

2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

3) read 1 and 2

• Hello Panicmode, just thought to share with you. Thanks for your suggestions.

## Images

Edited once, last by AshwinM ().

## Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account
Sign up for a new account in our community. It's easy!
Sign in
Already have an account? Sign in here.