1. Home
    1. Dashboard
    2. Search
  2. Forum
    1. Unresolved Threads
    2. Members
      1. Recent Activities
      2. Users Online
      3. Team Members
      4. Search Members
      5. Trophys
  3. Articles
  4. Blog
  5. Videos
  6. Jobs
  7. Shop
    1. Orders
  • Login or register
  • Search
This Thread
  • Everywhere
  • This Thread
  • This Forum
  • Articles
  • Pages
  • Forum
  • Blog Articles
  • Products
  • More Options
  1. Robotforum - Support and discussion community for industrial robots and cobots
  2. Forum
  3. Industrial Robot Support and Discussion Center
  4. KUKA Robot Forum
Your browser does not support videos RoboDK Software for simulation and programming
Visit our Mainsponsor
IRBCAM
Robotics Channel
Robotics Training
Advertise in robotics
Sponsored Ads

Pause milling from remote control upgrade

  • Marco
  • April 14, 2017 at 12:44 PM
  • Thread is Resolved
  • Marco
    Reactions Received
    3
    Trophies
    3
    Posts
    116
    • April 14, 2017 at 12:44 PM
    • #1

    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:

    Code
    DEF MoveAway()
      BRAKE ; need to pause current robot motion
      $OUT[10] = FALSE ;fieldbus reference values
      $VEL.CP = 0.005
      $ACC.CP = 0.01
    
    
      LIN_REL {Z 50} ; move robot up 
      $TIMER[12] = -10000
      $TIMER_STOP[12] = FALSE
      WHILE NOT $TIMER_FLAG[12]
      ENDWHILE
    
    
      WAIT FOR NOT $OUT[7] ; wait until PAUSE is released
    
    
      $OUT[10] = TRUE ;fieldbus reference values
    
    
      $TIMER[13] = -10000
      $TIMER_STOP[13] = FALSE
      WHILE NOT $TIMER_FLAG[13]
      ENDWHILE
    
    
      LIN $POS_RET  ; return to last position to resume work
    END
    Display More

    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

  • Online
    Leon
    Reactions Received
    32
    Trophies
    5
    Posts
    463
    • April 14, 2017 at 3:28 PM
    • #2

    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:

    Code
    IF X_pos => 0 Then
      IF X_pos => Y_pos or X_pos => Y * -1 Then
        Move in x positive direction to move away from product
      ELSE
        IF Y_pos => 0 Then
          Move in y positive direction to move away from product
        ELSE
          Move in y negative direction to move away from product
        ENDIF
      ENDIF
    ELSE
      Same structure for when x_pos is negative
    ENDIF
    Display More

    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.

  • Marco
    Reactions Received
    3
    Trophies
    3
    Posts
    116
    • April 14, 2017 at 8:12 PM
    • #3

    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 (April 14, 2017 at 8:14 PM).

  • SkyeFire
    Reactions Received
    1,044
    Trophies
    12
    Posts
    9,391
    • April 17, 2017 at 9:16 PM
    • #4

    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/questions/1510…-two-3d-vectors

  • panic mode
    Reactions Received
    1,268
    Trophies
    11
    Posts
    13,040
    • April 17, 2017 at 10:58 PM
    • #5

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

    Code
    SWITCH $ACT_TOOL_C
    CASE 1 ; robot is using tool 1 (EndMill?)
       LIN_REL {Z 50} #TOOL
    CASE 2 ; this is using tool 2 (SAW?)
       LIN_REL {Z 150} #BASE
    CASE 3 ; this is the beer opener
       ; robot is using tool 3
       Open_beer()
       Serve_beer()
    DEFAULT
      ; not expected tool number
    ENDSWITCH
    Display More

    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

  • Marco
    Reactions Received
    3
    Trophies
    3
    Posts
    116
    • April 17, 2017 at 11:59 PM
    • #6
    Quote from SkyeFire


    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

  • panic mode
    Reactions Received
    1,268
    Trophies
    11
    Posts
    13,040
    • April 18, 2017 at 12:45 AM
    • #7

    that would be your tool direction. did you define TCP and orientation for 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

  • Marco
    Reactions Received
    3
    Trophies
    3
    Posts
    116
    • April 19, 2017 at 7:32 PM
    • #8

    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?

    Images

    • IMG_0793.JPG
      • 88.74 kB
      • 720 × 1,280
      • 25

    Files

    IMG_0793.JPG_thumb 21.15 kB – 29 Downloads

    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 (April 19, 2017 at 7:40 PM).

  • panic mode
    Reactions Received
    1,268
    Trophies
    11
    Posts
    13,040
    • April 19, 2017 at 9:07 PM
    • #9

    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.

    Images

    • sample_dir.png
      • 439.76 kB
      • 1,406 × 600
      • 27

    Files

    sample_dir.png_thumb 13.73 kB – 26 Downloads

    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

  • Marco
    Reactions Received
    3
    Trophies
    3
    Posts
    116
    • April 19, 2017 at 10:02 PM
    • #10

    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

  • panic mode
    Reactions Received
    1,268
    Trophies
    11
    Posts
    13,040
    • April 19, 2017 at 10:47 PM
    • #11

    are your saw tool axes [size=2px]X and Y parallel to [/size]plane of saw?

    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

  • Marco
    Reactions Received
    3
    Trophies
    3
    Posts
    116
    • April 19, 2017 at 11:03 PM
    • #12

    Yes they are. Your diagram is correct.

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

  • panic mode
    Reactions Received
    1,268
    Trophies
    11
    Posts
    13,040
    • April 19, 2017 at 11:23 PM
    • #13

    if that is the case, following should work (may change sign or use X axis)


    LIN_REL {Y 200} #TOOL

    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

  • Marco
    Reactions Received
    3
    Trophies
    3
    Posts
    116
    • April 20, 2017 at 7:47 AM
    • #14

    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

  • panic mode
    Reactions Received
    1,268
    Trophies
    11
    Posts
    13,040
    • April 20, 2017 at 5:29 PM
    • #15

    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

IRBCAM
Robotics Channel
Robotics Training
Advertise in robotics
Advertise in Robotics
Advertise in Robotics

Job Postings

  • Anyware Robotics is hiring!

    yzhou377 February 23, 2025 at 4:54 AM
  • How to see your Job Posting (search or recruit) here in Robot-Forum.com

    Werner Hampel November 18, 2021 at 3:44 PM
Your browser does not support videos RoboDK Software for simulation and programming

Tag Cloud

  • abb
  • Backup
  • calibration
  • Communication
  • CRX
  • DCS
  • dx100
  • dx200
  • error
  • Ethernet
  • Ethernet IP
  • external axis
  • Fanuc
  • help
  • hmi
  • I/O
  • irc5
  • IRVIsion
  • karel
  • kawasaki
  • KRC2
  • KRC4
  • KRC 4
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • robodk
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000

Thread Tag Cloud

  • abb
  • Backup
  • calibration
  • Communication
  • CRX
  • DCS
  • dx100
  • dx200
  • error
  • Ethernet
  • Ethernet IP
  • external axis
  • Fanuc
  • help
  • hmi
  • I/O
  • irc5
  • IRVIsion
  • karel
  • kawasaki
  • KRC2
  • KRC4
  • KRC 4
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • robodk
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000

Users Viewing This Thread

  • 1 Guest
  1. Privacy Policy
  2. Legal Notice
Powered by WoltLab Suite™
As a registered Member:
* You will see no Google advertising
* You can translate posts into your local language
* You can ask questions or help the community with your knowledge
* You can thank the authors for their help
* You can receive notifications of replies or new topics on request
* We do not sell your data - we promise

JOIN OUR GREAT ROBOTICS COMMUNITY.
Don’t have an account yet? Register yourself now and be a part of our community!
Register Yourself Lost Password
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on Google Play
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on the App Store
Download