Page 1 of 1

make a arc mid-point coördinaten for kuka robot

Posted: Sun Sep 20, 2020 11:38 pm
by dinosar
]Hello, i have try to get the arc center/ midpoint coördinaten but i dont know how i can get
its for an kuka robot arm the straight lines will work but on an Circular move the robot will run away

i need to place acr midle point and arc end point the start point is where the robot is already

this i need to get
CIRC {X 50,Y 55,Z -5,A 0,B 0,C 0} , {X -5,Y 0,Z -5,A 0,B 0,C 0} C_DIS
this is what i get from sheetcam
CIRC { X -55, Y -0, Z -5.0000 } , { X -5.0000, Y 0.0000, Z -5.0000 }
this example is a half circle of 100mm wide with a tool diameter of 10mm

Code: Select all

function OnArc()
   if(arcAngle <0) then
      post.Text ("CIRC {")
   else
      post.Text ("CIRC {")
   end
      local needComma = false
      
   if(arcCentreX < 1e17) then
      post.Text(" X ")
      post.Number ((arcCentreX - currentX), "0.##")
      needComma = true
   end
   
   if(arcCentreY < 1e17) then
      if(needComma) then post.Text(",") end
      post.Text(" Y ")
      post.Number ((arcCentreY - currentY), "0.##")
      needComma = true
   end
      if(endZ < 1e17) then
      if(needComma) then post.Text(",") end         
      post.Text(" Z ")
      post.Number(endZ * scale,  "0.0000")
      needComma = true
   end
   
   post.Text (" } , { ")


   if(endX < 1e17) then
      post.Text(" X ")
      post.Number(endX * scale,  "0.0000")
      needComma = true
   end
   if(endY < 1e17) then
      if(needComma) then post.Text(",") end         
      post.Text(" Y ")
      post.Number(endY * scale,  "0.0000")
      needComma = true
   end
   if(endZ < 1e17) then
      if(needComma) then post.Text(",") end         
      post.Text(" Z ")
      post.Number(endZ * scale,  "0.0000")
      needComma = true
   end
   post.Text (" }\n")
   post.ModalNumber ("$VEL.CP=", feedRate * scale, "0.0###\n")
   post.Eol()
   
end


this is what the robot need to do on an Circular move

CIRC – Circular – Motion at a defined velocity and accerlation along a circular path or a portion of a circular path. This motion requires the programmer to “teach” two points, the mid-point and the end point. Using the start point of the robot (defined as the end point in the previous motion command) the robot interpolates a circular path through the mid-point and to the end point

Re: make a arc mid-point coördinaten for kuka robot

Posted: Mon Sep 21, 2020 12:40 pm
by Les Newell
Do you need absolute or or relative arc center points? Your code outputs the arc center relative to the start point.
A couple of extra thoughts - you don't need to check if the coordinates are less than 1e17 when cutting arcs. 1e17 indicates the number is unknown. This can only happen for the first few rapid moves.
If those trailing zeros are a problem use the number format "0.##". This only puts in trailing digits if they are needed.

Re: make a arc mid-point coördinaten for kuka robot

Posted: Mon Sep 21, 2020 2:02 pm
by dinosar
i need the a absolute position of the arc center point

Re: make a arc mid-point coördinaten for kuka robot

Posted: Mon Sep 21, 2020 2:03 pm
by Les Newell
Where you have code like this:

Code: Select all

post.Number ((arcCentreX - currentX), "0.##")
Change it to:

Code: Select all

post.Number (arcCentreX, "0.##")

Re: make a arc mid-point coördinaten for kuka robot

Posted: Mon Sep 21, 2020 3:15 pm
by dinosar
did not work it neet the center position from X and y zero location

https://www.youtube.com/watch?v=HEanVlT ... andarTomic like on this video

if i will make a half circle of 100mm and i start the circle on X100 Y100 the center point will be X150 Y150 and the end point will be X200 Y100

but i dont know how i can get this out sheetcam most machines use I and J code

Image

Re: make a arc mid-point coördinaten for kuka robot

Posted: Mon Sep 21, 2020 4:21 pm
by Les Newell
Did you change the code for the Y arc centre as well?

If your robot has plenty of memory you could get the post to break arcs into lots of short lines. Replace your function OnArc() with this one:

Code: Select all

function OnArc()
   post.ArcAsMoves(0.1)
end
Increasing the number will reduce the number of lines of code but it will also reduce accuracy.

Re: make a arc mid-point coördinaten for kuka robot

Posted: Mon Sep 21, 2020 6:04 pm
by dinosar
yes this will work is it also possible to change arcCentreY to anyting else that it will take for the center real x and y coördinaten
now with post.ArcAsMoves(0.1) it is indeed too busy for the memory

Code: Select all

post.Number ((arcCentreY), "0.##")

Re: make a arc mid-point coördinaten for kuka robot

Posted: Tue Sep 22, 2020 9:40 am
by Les Newell
I found a Kuka manual and I now see what the problem is. The reference point is a point on the arc other than the start or end point. It is not the centre point. Give the attached post a try.

Re: make a arc mid-point coördinaten for kuka robot

Posted: Sat Sep 26, 2020 5:47 pm
by dinosar
i have try works good thank you very much

Re: make a arc mid-point coördinaten for kuka robot

Posted: Mon Sep 28, 2020 11:42 am
by dinosar
Les Newell wrote: Tue Sep 22, 2020 9:40 am I found a Kuka manual and I now see what the problem is. The reference point is a point on the arc other than the start or end point. It is not the centre point. Give the attached post a try.
i see today that on an circle this will not work beause the start and endpoint will be the same i see on other cadcam post it will be make a circle with 2 start and 2 end points to make an compleet circle 2 time a half circle

if i make a jet cutting and use microcut the circle will be cutted but on milling i dont get started beause start and end point are the same

from other cadcam

Code: Select all

LIN {X 197.5,Y 100,Z -2.5,A 0,B 0,C 0} C_DIS
CIRC {X 100,Y 197.5,Z -2.5,A 0,B 0,C 0} , {X 2.5,Y 100,Z -2.5,A 0,B 0,C 0} C_DIS
CIRC {X 100,Y 2.5,Z -2.5,A 0,B 0,C 0} , {X 197.5,Y 100,Z -2.5,A 0,B 0,C 0} C_DIS
from sheetcam

Code: Select all

LIN { X 100, Y 2.5, Z -2.5}
CIRC { X 100, Y 197.5, Z -2.5 } , {  X 100, Y 2.5, Z -2.5 }, CA 360

Re: make a arc mid-point coördinaten for kuka robot

Posted: Tue Sep 29, 2020 9:07 am
by Les Newell
This should fix it.

Re: make a arc mid-point coördinaten for kuka robot

Posted: Sat Oct 03, 2020 3:27 pm
by dinosar
yes now it works fine i have set THE CA function off
it was not necessary to mention this sometimes it changes to - if it is + and vice versa then the robot will walk the other way

thank you very much for the support :mrgreen: