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

Dynamically Changing TCP for Milling Operations

  • Carleton Hall
  • December 17, 2021 at 2:21 PM
  • Thread is Unresolved
  • Carleton Hall
    Reactions Received
    1
    Trophies
    3
    Posts
    20
    • December 17, 2021 at 2:21 PM
    • #1

    Hello,

    I am trying to dynamically change the TCP of our spindle to be along the bit based on a specified cut depth. We have software that is sending XYZABC coordinates that are normal to the surface we are attempting to mill and we are wanting a pocket cut that follows the shape. If we are able to move the TCP by 1/2 an inch up, we should be able to do this successfully, however when running this code, it does not use the new calculated TCP but rather the one saved in TOOL_DATA[9].

    Code
    DEF  millingSide1 ( )
    DECL int count, resetCounter
    DECL FRAME millingOffsetTCP, millingOffsetTCPSave
    E6POS currentPos
    $STOPNOAPROX = FALSE
    toolpathPosIndex = 0
    robUpdateToolpathArr = FALSE
    
    
    ;FOLD INI;%{PE}
      ;FOLD BASISTECH INI
        GLOBAL INTERRUPT DECL 3 WHEN $STOPMESS==TRUE DO IR_STOPM ( )
        INTERRUPT ON 3 
        BAS (#INITMOV,0 )
      ;ENDFOLD (BASISTECH INI)
      ;FOLD USER INI
        ;Make your modifications here
        count = 1
      ;ENDFOLD (USER INI)
    ;ENDFOLD (INI)
    
    FOR resetCounter = 1 to 10000 STEP 1
       ToolpathData[resetCounter] = {X 0,Y 0,Z 0,A 0,B 0,C 0,E1 0,E2 -90,E3 90,E4 0.0,E5 0.0,E6 0.0}
    ENDFOR
    
    goHome(1)
    
    WAIT SEC 0
    
    ;FOLD TOOLPATH LOADING AND INITIALIZATION
    robUpdateToolpathArr = TRUE ;REQUEST POINTS TO BE SENT
    
    WAIT FOR $IN[57] ;SOFTWARE STARTING TO SEND
    
    ;MOVE TO SAFE POS
    
    SLIN XP28 WITH $VEL = SVEL_CP(1.0, , LCPDAT32), $TOOL = STOOL2(FP28), $BASE = SBASE(FP28.BASE_NO), $IPO_MODE = SIPO_MODE(FP28.IPO_FRAME), $LOAD = SLOAD(FP28.TOOL_NO), $ACC = SACC_CP(LCPDAT32), $ORI_TYPE = SORI_TYP(LCPDAT32), $APO = SAPO(LCPDAT32), $JERK = SJERK(LCPDAT32), $COLLMON_TOL_PRO[1] = USE_CM_PRO_VALUES(0) C_Spl
    
    SPTP XP25 WITH $VEL_AXIS[1] = SVEL_JOINT(50.0), $TOOL = STOOL2(FP25), $BASE = SBASE(FP25.BASE_NO), $IPO_MODE = SIPO_MODE(FP25.IPO_FRAME), $LOAD = SLOAD(FP25.TOOL_NO), $ACC_AXIS[1] = SACC_JOINT(PPDAT20), $APO = SAPO_PTP(PPDAT20), $GEAR_JERK[1] = SGEAR_JERK(PPDAT20), $COLLMON_TOL_PRO[1] = USE_CM_PRO_VALUES(0) C_Spl
    
    
    WAIT FOR NOT $IN[57] ;SOFTWARE DONE SENDING
    
    robUpdateToolpathArr = FALSE ;REQUEST POINTS TO NOT BE SENT
    
    ;ENDFOLD
    
    millingOffsetTCP = TOOL_DATA[9]
    millingOffsetTCP.Z = millingOffsetTCP.Z - softMillingCutDepth
    $TOOL = millingOffsetTCP
    
    WHILE count < toolpathArrSizeInt
       
        IF count == 1 THEN
           
          $VEL.CP = 0.3
          $APO.CDIS = 0
          $ACC.CP = 1
          
          SLIN ToolpathData[count] WITH $TOOL = millingOffsetTCP
          
          toolpathPosIndex = toolpathPosIndex + 1
          count = count + 1
          
          WAIT SEC 0
          enableSpindle()
          WAIT SEC 0
          
        ELSE
           
          $VEL.CP = softToolpathVelocity
          $APO.CDIS = 1
          $ACC.CP = 1
          
          SLIN ToolpathData[count] WITH $TOOL = millingOffsetTCP C_DIS
          
          toolpathPosIndex = toolpathPosIndex + 1
          count = count + 1
          
        ENDIF
        
    ENDWHILE
    
    LIN ToolpathData[count-1]:{X 0,Y 0,Z -150,A 0,B 0,C 0}
    
    WAIT SEC 0
    disableSpindle()
    WAIT SEC 0
    
    ;MOVE TO SAFE POS
    SLIN XP26 WITH $VEL = SVEL_CP(1.0, , LCPDAT30), $TOOL = STOOL2(FP26), $BASE = SBASE(FP26.BASE_NO), $IPO_MODE = SIPO_MODE(FP26.IPO_FRAME), $LOAD = SLOAD(FP26.TOOL_NO), $ACC = SACC_CP(LCPDAT30), $ORI_TYPE = SORI_TYP(LCPDAT30), $APO = SAPO(LCPDAT30), $JERK = SJERK(LCPDAT30), $COLLMON_TOL_PRO[1] = USE_CM_PRO_VALUES(0) C_Spl
    
    SPTP XP29 WITH $VEL_AXIS[1] = SVEL_JOINT(50.0), $TOOL = STOOL2(FP29), $BASE = SBASE(FP29.BASE_NO), $IPO_MODE = SIPO_MODE(FP29.IPO_FRAME), $LOAD = SLOAD(FP29.TOOL_NO), $ACC_AXIS[1] = SACC_JOINT(PPDAT23), $APO = SAPO_PTP(PPDAT23), $GEAR_JERK[1] = SGEAR_JERK(PPDAT23), $COLLMON_TOL_PRO[1] = USE_CM_PRO_VALUES(0) C_Spl
    ;ENDFOLD
    
    goHome(1)
    
    END
    Display More

    I'm honestly not sure where the error in this is as my program compiles correctly and when I attempt to debug and monitor my millingOffsetTCP values, they are populated correctly, the motion is just using the wrong tool. I am currently running KSS 8.5.8 on a KUKA KRC4 controller, and any help would be much appreciated! Thank you and have a good day.

  • Fubini
    Reactions Received
    283
    Trophies
    9
    Posts
    1,904
    • December 17, 2021 at 2:57 PM
    • #2

    Did you use $tool_c to check? $tool is advance run $tool_c main run. So the tool of the currently running motion is tool_c.

    Fubini

  • Carleton Hall
    Reactions Received
    1
    Trophies
    3
    Posts
    20
    • December 20, 2021 at 6:41 PM
    • #3
    Quote from Fubini

    Did you use $tool_c to check? $tool is advance run $tool_c main run. So the tool of the currently running motion is tool_c.

    Fubini

    Thank you for the tip, I added a wait to stop the advanced run and everything is working properly.

  • Online
    cosmos16
    Trophies
    1
    Posts
    16
    • April 18, 2023 at 2:04 PM
    • #4

    Hello,
    A robot is selected at a specific point with a specific tool and base (for example, tool no: 2, base no: 2). I want to shift the TCP point by the Z value based on the XYZ coordinates. Can I calculate this and write it to another tool?
    It may be a simple process, but I cannot fully visualize it in my mind. I would appreciate it if you could help me.

  • panic mode
    Reactions Received
    1,297
    Trophies
    11
    Posts
    13,141
    • April 18, 2023 at 3:25 PM
    • #5

    DECL FRAME OffsetFL, OffsetTCP

    OffsetFL = {X 0, Y 0, Z 0, A 0, B 0, C 0} ; adjust relative to flange

    OffsetTCP = {X 10, Y 0, Z 0, A 0, B 0, C 0}; adjust relative to current TCP

    TOOL_DATA[12]=OffsetFL:TOOL_DATA[2]:OffsetTCP

    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
  • krc5
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • 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
  • krc5
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000

Tags

  • KUKA
  • Programming
  • milling
  • motion
  • frame
  • tcp
  • spindle
  • cut depth
  • normal

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