Pause milling from remote control upgrade

  • Hi there,
    My Kuka is equipped for milling and I have an external remote control to set certain useful parameters. Among these I have a pause and resume buttons. When I press the pause button, spindle switches off and the robot moves away from the part. This is my code:


    By now, the tool moves away along Z world axis, so I want to replace LIN_REL {Z 50} with LIN_REL {X-50} #TOOL, to move away 50 mm along the milling tool axis.


    But I'm also facing a different situation as I'm to cut some plates with a circular saw. In this case, if I would press the pause button during a cut with the saw immersed into a plate, the saw would move along tool axis (which is the tool holder axis, same direction of a regular milling bit) and I would get the saw moving against the material and damaging all stuff. I understand I should move the saw out of the material moving on the same plane of the saw but in opposite direction respect to the axis passing by the centre of the saw (i.e. the TCP) and the point where the saw touches the material in the moment I pause the job). I'm wondering what is the best manner to code this out? Of course the moveout case should be automatically selected depending on the tool loaded for the current job, so I imagine there will be also and other if statement that checks what tool is loaded.
    Any suggestion?
    Best,
    Marco

    Kuka KR150-2 KRC2 ed05 V5.6.11<br />VFD TDE Macno<br />Spindle HSD ES915 with Automatic tool changer<br />Sprutcam 11

  • It depends on how your motion program is structured, it can become pretty complex. First of checking active tool if you are using a circular saw is easy, just compare active tool with desired tool number.
    For the second part, the first thing that comes to my mind is check tool position to work-piece center-point if you can (I usually have my base center somewhere near work piece center). if this is possible you can look at where your tcp relative to your base is.


    for example:


    Of course this only works if you only use your saw round the outside of your product, and the shape of your product is not to complex.

    Every problem has a solution, that isn't the problem. The problem is the solution.

  • Well, I have my raw plates fixed on the table oriented as XY world plane. So ideally, the saw should move out of the piece sliding over its plane for 150 mm to be sure that the tool is out of the part. Since I hold the raw plates flat on the table, the saw, independently on the orientation of the TCP should slide along its plane toward positive Z world coordinates (otherwise it would crash into the table). However, to get the correct direction of the move away, I might have to:
    1) get the previews TCP position (A) respect to the one (B) registered when I hit the pause button
    2) calculate the displacement vector (AB) between the 2 positions (this vector will be on the plane of the saw since when you cut with the circular saw you move on one plane along a straight line)
    3) given the TCP position and orientation registered when I hit the pause, I should be able to calculate the normal to the displacement (AB) passing by (B) on the saw plane.


    Unfortunately these steps go beyond my current programming skills.

    Kuka KR150-2 KRC2 ed05 V5.6.11<br />VFD TDE Macno<br />Spindle HSD ES915 with Automatic tool changer<br />Sprutcam 11

    Edited once, last by Marco ().

  • Well, if the robot knows which tool it currently has mounted (end mill or saw), then it should be easy to do this:

    Code
    SWITCH CurrentTool
    CASE #EndMill
      LIN_REL {Z 50} #TOOL
    CASE #Saw
      LIN_REL {Z 150} 
    DEFAULT
      HALT ; illegal/unsupported option
    ENDSWITCH


    This might be as simple as having each program set the CurrentTool variable at the very beginning, based on which tool that program uses.


    Failing that... it sounds like you want the robot to determine which move to used based on whether the Tool Z axis is parallel to the World Z axis (End Mill) or perpendicular to it (saw). Is that correct?


    That's a math problem more than a programming problem. The usual approach is to convert the $POS_ACT value to a matrix, and then perform matrix algebra. If the check is a simple parallel/perpendicular, that shouldn't be too hard, although I lack the math skills to do it myself off the cuff. But this might be of use: http://stackoverflow.com/quest…es-between-two-3d-vectors

  • [size=small]you can also check tool index[/size]
    [/size]
    [/size]

    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


  • Failing that... it sounds like you want the robot to determine which move to used based on whether the Tool Z axis is parallel to the World Z axis (End Mill) or perpendicular to it (saw). Is that correct?


    The case switch is not a big deal as I set the tool at the beginning of every program so whenever I would pause the job the proper move away case will be selected. The issue is how to program the move away in the saw case. I was looking at the system variables manual to find a variable that tells the program line just before the one that is currently executed. Is there such a variable? With that and the coordinates of the tcp at the instanct I would pause the job I would now the vector normal to which I should move away. The link provides useful information about the math actually, thanks. But still I think I need the vector along which the saw is moving.

    Kuka KR150-2 KRC2 ed05 V5.6.11<br />VFD TDE Macno<br />Spindle HSD ES915 with Automatic tool changer<br />Sprutcam 11

  • Yes, I did. The saw is 90 degrees respect to the TCP axis. My TCP with the saw is (X 455.0659, Y-1.288, Z 457.559, A-0.007, B 90.084,C 0.000). The move-away plane will be always the TCP XY plane passing by the centre of the saw. I'm looking into the $POS_BACK, $POS_FOR, $POS_INT variables to calculate the current vector of the movement of the saw when the job is paused (the saw always go straight from one point to another with the same angle respect to the material) . With this vector I should be able to calculate the normal vector for the move-away on the saw plane.
    Any suggestion?

  • since robot flange and orientation are unknown, i don't see how is one could determine tool axes from that image.
    but you could sketch it like this for example.



    you can subtract $POS_FOR and $POS_BACK to get one vector, but there is infinite number of vectors that are perpendicular to it.
    if you do cross product of your path vector with tool Z you should get what you are after.

  • Yes, that's the thing. The image was to show you the orientation of the saw respect the the spindle axis.. I suppose I need to code a matrix in krl to carry out the calculation. Am I right?

    Kuka KR150-2 KRC2 ed05 V5.6.11<br />VFD TDE Macno<br />Spindle HSD ES915 with Automatic tool changer<br />Sprutcam 11

  • This is not possible because it is not always true that the Y axis is normal to the direction of the cut. Maybe I misunderstood your question. This is way i'm looking for the normal to the $pos_back - $pos_for vector that stay on saw plane.

    Kuka KR150-2 KRC2 ed05 V5.6.11<br />VFD TDE Macno<br />Spindle HSD ES915 with Automatic tool changer<br />Sprutcam 11

  • ok, that is true - if saw is moving on arc (cutting big pipe for example) tool direction may not change.





    then do some math...
    you have one vector for path direction (v1)
    you can create another one from TCP orientation Z-axis (v2)
    when you do cross product of those two, you will get vector that is in plane of saw and perpendicular to path direction.

    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

Advertising from our partners