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. Fanuc 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

Modifying/changing Get_Home prog

  • AlejandroOrtiz
  • December 9, 2024 at 8:21 AM
  • Thread is Unresolved
  • AlejandroOrtiz
    Reactions Received
    1
    Trophies
    1
    Posts
    31
    • December 9, 2024 at 8:21 AM
    • #1

    Hey everybody,


    I had a quick question that I think I’ve got an answer for but has been giving me trouble. I’m working on a scanning application, it sits on an integrated 7th axis and has five bays it can go between. We have FIFO handling in there so the robot could go from bay 1 to bay 5 to bay 2 all depending on which bay is loaded first.

    The same styles are ran in all five bays, so I have the exact same scanning program path wise, my problem is the Get_Home program. I’ll type an example of the Macro as well as the TP path


    Macro:

    PR[1,7]=0.

    PR[2,7]=0.
    PR[99,7]=0.
    R[5]=0

    R[5]=GI[4]
    SELECT R[5]= 0, JMP LBL [1]
    1, JMP LBL [2]
    LBL[1]

    PR[1,7]=1000.
    PR[2,7]=1000.
    PR[99,7]=1000.

    END

    LBL[2]

    PR[1,7]=2000.
    PR[2,7]=2000.
    PR[99,7]=2000.

    TP:

    OFFSET CONDITION PR[99]
    L 500/mm CNT 50

    L 500/mm CNT 50


    So in my scan programs I set all the 7th axis values in the positional data and when I set everything under the offset condition it works fine. My problem though is the home program, since I need the reference position to run in AUTO I have to set the reference position position which automatically repopulates PR[1] with the same value everytime. I was wondering if there’s a simpler solution or if maybe I could manipulate a variable to populate PR[1] based on the Group Input from the PLC because I’m going to have to call MOVE_HOME at the top of every program so it slides down the rail.

  • gpunkt
    Reactions Received
    137
    Trophies
    6
    Posts
    492
    • December 9, 2024 at 1:32 PM
    • #2

    Hi,
    Not really sure what you mean with your description after your example code...
    Do you want the robot to MOVE to a HOME position? Then why do it with a macro program?

    I would suspect the work-flow to be something like this:

    Wait for order from PLC (which bay should the robot go to?) -> move to correct bay -> perform scanning program at the correct bay -> move back to HOME ->Eat, sleep, repeat.

    Am I correct?


    Depending on how it looks, you could make a program that moves the robot to the Home position in a safe manner, regardless of which bay it was working on.


    Also, in your example code, the first 4 instructions are redundant. No matter what value GI[4] has, it will always be written to R[5] (so no need to reset it to 0 before). Also, the 7th element of PR[1], PR[2] and PR[99] will be either 1000 or 2000 (either GI[4] is 2, and then the 7th elemtent will be 2000, or GI[4] is something else and the 7th element will be 1000).

    Also, you specify an offset condition, but don't use the offset command in the motion instruction?

  • AlejandroOrtiz
    Reactions Received
    1
    Trophies
    1
    Posts
    31
    • December 9, 2024 at 5:03 PM
    • #3

    Youre right, explicitly setting R[5] to 0 was redundant.

    Here are my two programs.

    The offset condition works fine, I can run the same scan/inspection program through all 5 bays.

    So hypothetically let’s start from the top, I have 5 enclosed bays that can each run five of the same styles. If I’m running in bay 1, I do my scan and everything and have to go home at the end of the project like any other path. Now due to FIFO handling I have to slide down the rail to Bay 1 but I have the exact same part so it’s still the same style call, this means I have to call AXISOFFSET & MOVE_HOME at the top so that I know all my 7th axis values have been updated to the right one.

    You’re right, I guess I could just have the PLC throw me the actual 7th axis data instead of using Logic/SELECT statements to handle.

    I’m going to post the style below so you can see I just didn’t have enough attachement data left.

    Images

    • IMG_4537.jpg
      • 948.91 kB
      • 1,200 × 1,600
      • 0
    • IMG_4538.jpg
      • 835.37 kB
      • 1,200 × 1,600
      • 1
  • AlejandroOrtiz
    Reactions Received
    1
    Trophies
    1
    Posts
    31
    • December 9, 2024 at 5:04 PM
    • #4
    Quote from gpunkt

    Hi,
    Not really sure what you mean with your description after your example code...
    Do you want the robot to MOVE to a HOME position? Then why do it with a macro program?

    I would suspect the work-flow to be something like this:

    Wait for order from PLC (which bay should the robot go to?) -> move to correct bay -> perform scanning program at the correct bay -> move back to HOME ->Eat, sleep, repeat.

    Am I correct?


    Depending on how it looks, you could make a program that moves the robot to the Home position in a safe manner, regardless of which bay it was working on.


    Also, in your example code, the first 4 instructions are redundant. No matter what value GI[4] has, it will always be written to R[5] (so no need to reset it to 0 before). Also, the 7th element of PR[1], PR[2] and PR[99] will be either 1000 or 2000 (either GI[4] is 2, and then the 7th elemtent will be 2000, or GI[4] is something else and the 7th element will be 1000).

    Also, you specify an offset condition, but don't use the offset command in the motion instruction?

    Display More

    Here’s the style call as well, I forgot to quote you in my first reply but that’s above this one.

    Images

    • IMG_4539.jpg
      • 975.55 kB
      • 1,200 × 1,600
      • 2
  • AlejandroOrtiz
    Reactions Received
    1
    Trophies
    1
    Posts
    31
    • December 9, 2024 at 5:09 PM
    • #5
    Quote from gpunkt

    Hi,
    Not really sure what you mean with your description after your example code...
    Do you want the robot to MOVE to a HOME position? Then why do it with a macro program?

    I would suspect the work-flow to be something like this:

    Wait for order from PLC (which bay should the robot go to?) -> move to correct bay -> perform scanning program at the correct bay -> move back to HOME ->Eat, sleep, repeat.

    Am I correct?


    Depending on how it looks, you could make a program that moves the robot to the Home position in a safe manner, regardless of which bay it was working on.


    Also, in your example code, the first 4 instructions are redundant. No matter what value GI[4] has, it will always be written to R[5] (so no need to reset it to 0 before). Also, the 7th element of PR[1], PR[2] and PR[99] will be either 1000 or 2000 (either GI[4] is 2, and then the 7th elemtent will be 2000, or GI[4] is something else and the 7th element will be 1000).

    Also, you specify an offset condition, but don't use the offset command in the motion instruction?

    Display More

    Sorry, I keep thinking of things to say after I send my initial reply.

    The issue with the style program is inside of MOVE_HOME is the GET_HOME Karel file which automatically repopulates my PR[1] with the reference position; I have 5 reference positions all relative to the individual bays, I’d like GET_HOME to repopulate PR[1] with the reference position called based on a GI from PLC.

  • AlejandroOrtiz
    Reactions Received
    1
    Trophies
    1
    Posts
    31
    • December 9, 2024 at 6:33 PM
    • #6
    Quote from gpunkt

    Hi,
    Not really sure what you mean with your description after your example code...
    Do you want the robot to MOVE to a HOME position? Then why do it with a macro program?

    I would suspect the work-flow to be something like this:

    Wait for order from PLC (which bay should the robot go to?) -> move to correct bay -> perform scanning program at the correct bay -> move back to HOME ->Eat, sleep, repeat.

    Am I correct?


    Depending on how it looks, you could make a program that moves the robot to the Home position in a safe manner, regardless of which bay it was working on.


    Also, in your example code, the first 4 instructions are redundant. No matter what value GI[4] has, it will always be written to R[5] (so no need to reset it to 0 before). Also, the 7th element of PR[1], PR[2] and PR[99] will be either 1000 or 2000 (either GI[4] is 2, and then the 7th elemtent will be 2000, or GI[4] is something else and the 7th element will be 1000).

    Also, you specify an offset condition, but don't use the offset command in the motion instruction?

    Display More

    Hey dude,


    Sorry, don’t mean to bombard you with replies but I think I have an answer. In the program below I made some changes mainly I explicitly right the 7th axis value to the $REFPOS1[1].$PERCHPOS[7] variable in the AxisOffset program which is called at the beginning of the style.

    I’m going to make additional changes after lunch by like the PR’s and the variable to R[490] because I couldn’t make the variable relative to the Group input but I can make it relative to a register.

    The program I’m posting is just a rough sketch, as I mentioned I’m going to link everything to R[490] which itself is relative to the group input so I don’t have to explicitly 0 out my PR’s as you mentioned.


    Thanks for the help!

    Images

    • IMG_4543.jpg
      • 659.61 kB
      • 1,200 × 1,600
      • 1

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