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

FOR code in KUKA

  • mhanbildiren
  • August 28, 2020 at 4:36 PM
  • Thread is Unresolved
  • mhanbildiren
    Trophies
    2
    Posts
    3
    • August 28, 2020 at 4:36 PM
    • #1

    Hello, i have products it seems straight metal sheet their heights are 5mm, i have box which has this metal sheets, i want TL get sheets and put the other area, i will repeat this 1000 10.000 times maybe.

    Top of product's height from the ground is 1000mm, this sheets Putted on Top on each other so lower sheet's height from the ground is nearly 10mm

    How can i do robot's pick point get lower per lap?

    Probably i have to use for loop but how?

    **İ know the long way is typing 1.000.000 lime codes but what is shortcut?:thinking_face:

  • spiral
    Reactions Received
    2
    Trophies
    3
    Posts
    146
    • August 28, 2020 at 5:45 PM
    • #2

    For this is better to use interrupt.You can trigger the interrupt with sensor on the gripper that detects the metal sheet.

  • Online
    SkyeFire
    Reactions Received
    1,052
    Trophies
    12
    Posts
    9,431
    • August 28, 2020 at 5:48 PM
    • #3

    This is pretty simple. This example assumes you have hand-taught the Pick position for the top item in the stack, in Base 1, with the Base's -Z axis pointing down. The variable rPartThickness is assumed to be set to how thick each sheet metal sheet is.

    Code
    DECL _nCounter
    DECL FRAME _fShift
    ......
    FOR _nCounter = 0 TO 10000
      $BASE = BASE_DATA[1] ; make sure "above Pick" motion is not affected by FOR
      PTP XPick : {X 0,Y 0,Z 100,A 0,B 0,C 0} C_PTP ; move to approach point 100mm above highest pick
      _fShift = $NULLFRAME ; set to all 0s
      _fShift.Z = (0-_nCounter) * rPartThickness; convert counter value into a negative Z shift
      $BASE = BASE_DATA[1] : _fShift ; move the Base
      LIN XPick
      ; activate gripper here
      $BASE = BASE_DATA[1] ; reset Base to original value
       LIN XPick : {X 0,Y 0,Z 100,A 0,B 0,C 0} C_PTP ; move to depart point 100mm above highest pick
       ; Move to dropoff position, drop sheet, etc
    ENDFOR
    Display More

    However, a FOR loop may not be a good way to do this -- everything has to be inside the loop, including your moves over to the Dropoff area. A better way would be to use a counter variable, and increase it by 1 every time you pick a sheet. Then your Pick routine and Drop routine (and other routines, like Move Home, Move To Maintenance, etc) can be separated.

  • panic mode
    Reactions Received
    1,280
    Trophies
    11
    Posts
    13,088
    • August 28, 2020 at 5:52 PM
    • #4
    Quote from mhanbildiren

    **İ know the long way is typing 1.000.000 lime codes but what is shortcut?:thinking_face:

    shortcut to typing 1000000 lines of code is reading 300 page manual :winking_face:

    if you are sure of product thickness and tight tolerances, you may compute pick point as you go - one per pick... or calculate all of them before you start.

    but while this can work, it is very inflexible without feedback.

    for calculation look up geometric operator or palletizer code samples

    for feedback, lookup up search with interrupt (RESUME command)

    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

  • mhanbildiren
    Trophies
    2
    Posts
    3
    • August 28, 2020 at 6:10 PM
    • #5
    Quote from panic mode

    shortcut to typing 1000000 lines of code is reading 300 page manual :winking_face:

    if you are sure of product thickness and tight tolerances, you may compute pick point as you go - one per pick... or calculate all of them before you start.

    but while this can work, it is very inflexible without feedback.

    for calculation look up geometric operator or palletizer code samples

    for feedback, lookup up search with interrupt (RESUME command)


    I only need this example, How can i do? What i need about code statement?


    Ground to sheet height:

    1000mm

    Pick

    Process..

    995mm

    Pick

    Proces..

    990mm

    Pick

    Process..

    985mm

    Pick

    Process..

    980mm

    Pick

    Process

    .

    .

    .

    .

    10mm

    Pick

    Process..

    5mm

    Pick

    Process..


    END

  • panic mode
    Reactions Received
    1,280
    Trophies
    11
    Posts
    13,088
    • August 28, 2020 at 6:23 PM
    • #6
    Code
    DEF MAIN)
    DECL INT n
    
    PTP HOME VEL 100% DEFAULT ....
    
    FOR n=1000 TO 5 STEP -5
       Pick(n)
       Process()
    ENDFOR
    
    PTP HOME VEL 100% DEFAULT ....
    
    END
    
    DEF Pick(height:in)
      DECL INT height
      DECL E6Pos PickPos, StartPos
      BAS(#tool,1) ; gripper
      BAS(#base,3) ; whatever
      StartPos=$PosAct
      PickPos = xPickPos
      PickPos.Z=height
      LIN PickPos
      GripperClose()
      LIN StartPos
    END
    
    DEF Process()
      WAIT SEC 5
    END
    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

  • mhanbildiren
    Trophies
    2
    Posts
    3
    • August 29, 2020 at 6:55 PM
    • #7
    Quote from panic mode
    Code
    DEF MAIN)
    DECL INT n
    
    PTP HOME VEL 100% DEFAULT ....
    
    FOR n=1000 TO 5 STEP -5
       Pick(n)
       Process()
    ENDFOR
    
    PTP HOME VEL 100% DEFAULT ....
    
    END
    
    DEF Pick(height:in)
      DECL INT height
      DECL E6Pos PickPos, StartPos
      BAS(#tool,1) ; gripper
      BAS(#base,3) ; whatever
      StartPos=$PosAct
      PickPos = xPickPos
      PickPos.Z=height
      LIN PickPos
      GripperClose()
      LIN StartPos
    END
    
    DEF Process()
      WAIT SEC 5
    END
    Display More

    thank you i will try

  • Y105657LL
    Reactions Received
    1
    Trophies
    2
    Posts
    35
    • September 2, 2020 at 9:38 AM
    • #8

    Oh...this is too much products and difference. I used to work in a project that's up to 10 unstable roofs with one gripper.at first,I've tried to use forloop with num=num -1 .but it was a changed num..it was damn to teach operator to change the num.sol used interrupt.trigger with part sensor.but it didn't work well as l imagine .you know it can't run farst oR it will occur bad collision...so l set the OV =5%:neutral_face::neutral_face:...maybe you could ref my bad exp:tired_face:

  • spiral
    Reactions Received
    2
    Trophies
    3
    Posts
    146
    • September 2, 2020 at 9:52 AM
    • #9

    You can put one laser sensor on the gripper that detects the part at a distance and use interrupt to reduce the speed for the last 100mm maybe.

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

Similar Threads

  • BRAKE, RESUME, continues path and RESUME point

    • saeid ss
    • August 20, 2020 at 11:36 AM
    • KUKA Robot Forum
  • Is it OK to maintain KUKA code on git?

    • s2007.ravi
    • February 8, 2020 at 5:14 AM
    • KUKA Robot Forum
  • How can I integrate the g code into krl?

    • ardobebe
    • July 12, 2018 at 8:57 AM
    • KUKA Robot Forum
  • cant start kuka vkr 200/2 to run program

    • danao
    • August 10, 2020 at 11:48 AM
    • KUKA Robot Forum
  • Kuka signal input assigned program lines

    • smc
    • August 20, 2020 at 7:22 PM
    • KUKA Robot Forum
  • Optimizing my submit program

    • Vaibhav Shah
    • October 23, 2019 at 9:51 AM
    • KUKA Robot Forum
  • Serial Communication (PC -> KUKA KRC2 5.2)

    • Guedes24
    • July 10, 2019 at 2:47 PM
    • KUKA Robot Forum

Tags

  • KUKA
  • KRC2
  • For
  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