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

Take piece to punch and stack

  • jesusvaricap
  • November 4, 2022 at 5:18 PM
  • Thread is Unresolved
  • jesusvaricap
    Reactions Received
    4
    Trophies
    4
    Posts
    259
    • November 4, 2022 at 5:18 PM
    • #1

    Hello

    KRC2 KSS 5.2.14 KR2210_L150

    I have a project to take a disk metal with magnetic tool punch the disk and stack the punched disk


    so i need to use 2 cicles "FOR"

    one cicle for take the disk and heigth Z decreasing dependig of the thickess of the disk

    and other cicle "FOR" increase Z height with the finished disk

    reading older post i thik the next code can be useful


    Code
    FOR Height = 10 TO 1 STEP -1
      LIN {X 100,Y 100, Z Height} ; this won't work -- illegal KRL construction
    ENDFOR
    
    
    DECL POS _NextPos
    _NextPos = $NULLFRAME ; init to all 0s
    _NextPos.X = 100
    _NextPos.Y = 100
    FOR Height = 10 TO 1 STEP -1
      _NextPos.Z = Height
      LIN _NextPos ; this works, because all the values of _NextPos were set in advance
    ENDFOR
    Display More

    once finished 50 disk , make a Buzzer sound to take the disk with forklif


    any suggetions to the project ?


    Thanks

  • jesusvaricap
    Reactions Received
    4
    Trophies
    4
    Posts
    259
    • November 16, 2022 at 3:11 AM
    • #2

    Hello ,

    the probles was solved with the next code:

    Code
    DEF increasing_decreasing_Z ( )
    INI
    
    DECL INT TAKE,LEAVE
    DECL REAL DOWN_Z,UP_Z
    
    TAKE=0
    LEAVE=0
    
    DOWN_Z=0.0
    UP_Z=0.0
    
    
    
    PTP HOME Vel=30 % DEFAULT
    
    REPEAT
    
    DOWN_Z=DOWN_Z+6.35 ;thickness of the disk
    
    PTP P1 Vel=30 % PDAT5 Tool[1]:BendTech Base[0]
    PTP P1 Vel=30 % PDAT8 Tool[1]:BendTech Base[0]
    
    ;********NO_MODIFY*************
    BASE_DATA[12].X=$POS_ACT.X
    BASE_DATA[12].Y=$POS_ACT.Y
    BASE_DATA[12].Z=$POS_ACT.Z-DOWN_Z
    ;********NO_MODIFY*************
    
    ;************************************************************
    ;DOWN_Z_TAKE_disk_Base_12
    LIN P81 CONT Vel=.5 m/s CPDAT48 Tool[1]:BendTech Base[12]
    TAKE=TAKE+1
    ;DOWN_Z_TAKE_disK_Base_12
    ;************************************************************
    
    PTP P7 Vel=30 % PDAT9 Tool[1]:Gripper_1 Base[0]
    PTP P8 Vel=30 % PDAT31 Tool[1]:Gripper_1 Base[0]
    
    UP_Z=UP_Z+6.35 ;thickness of the disk
    
    PTP P13 Vel=30 % PDAT36 Tool[1]:Gripper_1 Base[0]
    PTP P78 Vel=30 % PDAT37 Tool[1]:Gripper_1 Base[0]
    
    
    ;********NO_MODIFY*************
    BASE_DATA[12].X=$POS_ACT.X
    BASE_DATA[12].Y=$POS_ACT.Y
    BASE_DATA[12].Z=$POS_ACT.Z+UP_Z
    ;********NO_MODIFY*************
    
    
    ;************************************************************
    ;UP_Z_LEAVE_disK_Base_12
    WAIT Time=.3 sec
    LIN P82 CONT Vel=.5 m/s CPDAT49 Tool[1]:Gripper_1 Base[12]
    ;UP_Z_LEAVE_disk_Base_12
    ;************************************************************
    
    
    PTP P79 Vel=30 % PDAT38 Tool[1]:Gripper_1 Base[0]
    PTP P80 Vel=30 % PDAT39 Tool[1]:Gripper_1 Base[0]
    
    
    LEAVE=LEAVE+1
    
    
    ;****NUMBER THE DISK OF THE STACK*****
    UNTIL (TAKE==30) and (LEAVE==30)
    ;****NUMBER THE DISK OF THE STACK*****
    
    
    PTP HOME Vel=30 % DEFAULT
    END
    Display More

    just left configure I/O digitals ,sensors , activate magnetic tool, and add "Wait for" take / leave disk

    punching machine ready,disk taken TRUE, FALSE , etc

    was not possible to use the next:

    Code
    FOR Height = 10 TO 1 STEP -1
      LIN {X 100,Y 100, Z Height}
    ENDFOR

    LIN { X 100, Y 100 , Z HEIGHT}

    Was nos possible to use, i try many options to manipulate Z up/down

    ...

    Z=[I]

    Z=[HEIGTH]

    ....


    any advice for the code are accepted.


    Kind regards

  • panic mode
    Reactions Received
    1,280
    Trophies
    11
    Posts
    13,083
    • November 16, 2022 at 3:12 PM
    • #3

    of course not... aggregate is a collection of literals.

    aggregate is noted by use of curly braces.

    literal is an unnamed constant (also known as hardcoded value) and you were attempting to use "Height" which is a named value (either variable or named constant). those things don't mix, so one must use dot operator to manipulate specific element using something like this:

    Code
    DECL FRAME temp
    ;
    FOR Height = 10 TO 1 STEP -1
       temp = {X 100, Y 100, z 0, A 0, B 0, C 0}
       temp.Z = Height
       LIN temp
    ENDFOR

    or

    Code
    DECL FRAME temp
    ;
    FOR Height = 10 TO 1 STEP -1
       temp = $nullframe
       temp.X = 100
       temp.Y = 100
       temp.Z = Height   
       LIN temp
    ENDFOR

    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

  • jesusvaricap
    Reactions Received
    4
    Trophies
    4
    Posts
    259
    • November 16, 2022 at 6:50 PM
    • #4

    thanks for the info

    i ll try.

    the cicle FOR just work to decrease or increase no both , take or leave disk.

    the target is:


    take disk then (decrease Z)

    move to punt

    leave the disk punched then (increase Z)

    .......

    take disk then (decrease Z)

    move to punt

    leave the disk punched then (increase Z)

    .......


    so its neccessary drecrease Z an increase Z inside a loop

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

Tags

  • KRC2
  • For
  • stack
  • 5.2.14
  • punching
  • cicle
  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