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

Homing filosophy with Fanuc

  • PetrBroza
  • November 25, 2020 at 10:00 AM
  • Thread is Unresolved
  • PetrBroza
    Trophies
    2
    Posts
    49
    • November 25, 2020 at 10:00 AM
    • #1

    Hello,

    how do you guys handle going to home pos from any location? I got pretty complex motion to insert part into the machine, so simple offset won't do the job. I'm thinking about setting up flags on the way, so when home program is called, execute motion based on these flags (not sure if variables are permanent, in case of power failure/shutdown).

    Or I could read current LPOS and based on TCP, execute correct motions.

    I have no Fanuc software, so I'm looking for simplest way to do it. I don't want to brake my fingers, punching complex code on TP.

    Thanks

    Petr

    Edited once, last by PetrBroza (November 25, 2020 at 10:13 AM).

  • Go to Best Answer
  • hermann
    Reactions Received
    412
    Trophies
    9
    Posts
    2,624
    • November 25, 2020 at 10:16 AM
    • #2

    There are no variables on TP programs, but data registers are permanent.

    You have to be careful with setting registers in between movements, in respect of the lookahead pointer. The robot will do the logic statements before he reached the position physically.

    So you have to use the DB statements to set the position flags/data.

    Bad news: you will break your fingers while punching those programs into the TP:smiling_face::loudly_crying_face:.

  • PetrBroza
    Trophies
    2
    Posts
    49
    • November 25, 2020 at 10:33 AM
    • #3

    Is there any manual describing behavior of the pointer? How far and when it jumps.

    What is DB statement? Not mention anywhere else on the forum.

    It's starting to make sense to pay couple of thousand for software, unfortunately not for my boss.

  • TomTom
    Reactions Received
    9
    Trophies
    3
    Posts
    49
    • November 25, 2020 at 11:17 AM
    • #4
    Quote from hermann

    There are no variables on TP programs, but data registers are permanent.

    You have to be careful with setting registers in between movements, in respect of the lookahead pointer. The robot will do the logic statements before he reached the position physically.

    So you have to use the DB statements to set the position flags/data.

    Bad news: you will break your fingers while punching those programs into the TP:smiling_face::loudly_crying_face:.

    Holy moly I think using the DB statement for this is what I've been missing :guru:


    From the top of my head my code looks something like this for example:

    Code
    L P[1] 100mm/s FINE;
    R[10]=1;
    
    
    L P[2] 100mm/s FINE;
    R[10]=2;

    R[10] is supposed to remember the last point that has been reached by your program. This is used by the homing program. The homing program now needs to traverse the position sequence backwards. So during the work process I go Home -> P[1] -> P[2] now in homing I go P[2] -> P[1] -> Home. The problem is R[10]=1 for example gets executed slightly before the movement one line above has actually finished(this is the lookahead). If a sudden stop happens right then the robot remembers having reached a position it actually hasn't. Normaly your homing program returns to the last reached position first which now creates problems.

    DB stands for "Distance before". It allows you to do this:

    Code
    L P[1] 100mm/s FINE DB 0.1mm, R[10]=1;
    
    L P[2] 100mm/s FINE DB 0.1mm, R[10]=2;

    Same principle as before but R[10] is written 0.1mm before the target of the specific movement instruction has been reached. While lookahead is pretty wonky this gives you actual tolerances. You can even set it to 0.0.

    Correction:

    For some reason you can't directly set R[] values in the DB instruction :face_with_rolling_eyes:. Only outputs can be set directly there. Use one of these instead:

    Code
    DB 0.1mm, POINT_LOGIC;
    
    DB 0.1mm, CALL SETPOSREG(2); // SETPOSREG is just a simple helper program that you'll have to make

    Edited 2 times, last by TomTom (November 25, 2020 at 11:50 AM).

  • hermann
    Reactions Received
    412
    Trophies
    9
    Posts
    2,624
    • November 25, 2020 at 12:56 PM
    • #5

    May be you can set a dummy GO, that is configured to an unused flag range.

    But may be that will not be permanent after a boot up.

  • PetrBroza
    Trophies
    2
    Posts
    49
    • November 25, 2020 at 3:50 PM
    • #6

    Thanks. Point logic is working fine.

    SetReg program is giving me error INTP-129, any idea why?

    setReg.png

  • HawkME
    Reactions Received
    570
    Trophies
    11
    Posts
    3,269
    • November 25, 2020 at 4:12 PM
    • #7

    On the Select Menu, highlight your SET_REG1 program, press Detail, and set group mask to all asterisks (*,*,*,*,*).

  • jmd2777
    Reactions Received
    34
    Trophies
    4
    Posts
    193
    • November 25, 2020 at 6:03 PM
    • #8

    I always imagine that someone could come in and jog the robot to a different position. Then next time the robot starts you could have a crash since the actual position does not match the data register that you are using to keep track of the position.

    The Ref Position feature will turn on a Digital Output when the robot is in a certain position.

  • HawkME
    Reactions Received
    570
    Trophies
    11
    Posts
    3,269
    • November 25, 2020 at 6:15 PM
    • #9

    Agreed. I do not like the Register only method. Instead I prefer to examine the current position and state, then make a decision.

    Several options for the robots current position in order of my preference: DCS Zones, Ref Positions, LPOS, JPOS

    Then in your homing program you examine the current position (could be in combination with IO state) and then select the correct path to move to home. IO or Registers would be used for secondary information only, such as if there is a part in the gripper, etc.

    The benefit of this is that it is completely independent of the program logic. You don't have to worry about forgetting to change a register if the program is modified and you don't have to worry about someone jogging the robot. In my opinion, coupling homing logic or safety logic to process logic is always a mistake. Inevitably it will get into a different state than you anticipated and you will end up crashing the robot if you only rely on the process logic setting the correct register at the right time.

  • hermann
    Reactions Received
    412
    Trophies
    9
    Posts
    2,624
    • November 25, 2020 at 6:17 PM
    • #10

    This is a problem, and only can be solved by education of the staff.

    And if the homing procedure works in every situation, normally nobody moves the robot manually. So you will not get a problem. It is absolutely essential that the homing procedure works in every situation, otherwise you will run into problems! And it's essential to have a postition check at the beginning of homing. If robot already is in home --> abort homing and begin normal work.

    This is my experience in many years of programming cells for different customers.

  • Mikael
    Reactions Received
    5
    Trophies
    3
    Posts
    49
    • November 25, 2020 at 6:25 PM
    • #11

    I have solved it in another way in some installations.

    I save a few strategically positioned PRs and based on LPOS and some logic I try to move to one of them that are close by.

    From the PRs I have trajectories set up to go to HOME.

    If the robot is too close to something delicate, the program gives up and signals that manual intervention is needed.

    This is not a good solution for all installations.

  • PetrBroza
    Trophies
    2
    Posts
    49
    • November 26, 2020 at 8:23 AM
    • #12

    Thanks for all ideas.

    I'm aware that using register method is tricky. Jogging is not an issue, if someone enable TP, I will erase register in BG task(based on SOP signal) and robot will have to be jog to home manually.

    Ref position are fine, if robot is not stopped during motion (e-stop for example). LPOS, JPOS for simple offseting postion.

    My problem is, that I have to make couple of motion with rotations between them, to get inside machine. So I can't use zones, or they would have to be very small to detect in which part of motion robot is and how to get back to home (rotate around z, move up, move sideways, rotate again...).

    I will use register plus zone detection only for this tricky part, other then that it will be zones and Ref positions.

  • PetrBroza
    Trophies
    2
    Posts
    49
    • November 26, 2020 at 8:41 AM
    • #13

    I changed group mask to all *, it worked once, but then I'm getting this error:

  • Famous_Fella
    Reactions Received
    25
    Trophies
    4
    Posts
    131
    • November 26, 2020 at 9:49 AM
    • #14

    This is what I use, it is a MACRO bound to both a DI signal coming from the PLC and a user button as a shortcut.

    UTOOL_NUM=1 ;

    UFRAME_NUM=0 ;


    IF (DO[36:OFF:R_HOME]=OFF) THEN ; //DO36 is the reference home position

    IF (DI[20:OFF:Home Robot]=ON) THEN ; //DI20 is the PLC trigger for the robot to go home


    OVERRIDE=25%

    CALL PINZA_AP //release the grippers


    //dicision logic to plan the path home

    PR[31:Home robot]=LPOS //save current position to a PR

    IF (DO[4:OFF:out of space wheelstabl]=OFF) THEN //DO4 is controlled by BGLOGIC

    PR[31,1:Home robot]=PR[31,1:Home robot]-500 //if robot is near the wheels table substract 500mm from X current pos

    ENDIF


    IF (DO[35:ON :out of space bench]=OFF) THEN //DO35 is controlled by BGLOGIC

    PR[31,3:Home robot]=PR[31,3:Home robot]+250 //if robot is near the table increase 250mm from Z current pos

    ENDIF  

    IF (DO[3:ON :out of space barrel]=OFF) THEN //DO3 is controlled by BGLOGIC

    PR[31,1:Home robot]=PR[31,1:Home robot]+250 //if robot is near the barrel increase Z by 250 and Y 250   

    PR[31,2:Home robot]=PR[31,2:Home robot]+250

    ENDIF ;


    L PR[31:Home robot] 400mm/sec FINE //after calculatins are done move away from fixture with Linear move
    JMP LBL[1]

    ELSE

    LBL[1]

    J P[1] 100% CNT100


    ENDIF

    ENDIF

    if the robot is not already at home, and it is not commanded from the PLC to go Home go straight to P[1] without any calculations. If it is commanded from the PLC to go home, drop the total speed to 25%, release the grippers, check where you currently are, safely step away using the calculated PR and after, move to P[1] which is the Home position.

    Here is the Background logic.

    IF ($DIAG_GRP[1].$CUR_TCP_X<1050) THEN

    DO[4:ON :out of space wheelstabl]=ON

    ELSE

    DO[4:ON :out of space wheelstabl]=OFF

    ENDIF

    IF ($DIAG_GRP[1].$CUR_TCP_Y<700) THEN

    DO[35:ON :out of space bench]=ON

    ELSE

    DO[35:ON :out of space bench]=OFF

    ENDIF

    IF ($DIAG_GRP[1].$CUR_TCP_X<(-90) AND $DIAG_GRP[1].$CUR_TCP_Y<(-700)) THEN
    DO[3:ON :out of space barrel]=OFF
    ELSE

    DO[3:ON :out of space barrel]=ON

    ENDIF

    I would refrain from using Registers and Flags just to keep track of the robot's position, I find it really cumbersome and unproductive way of programming, especially when you constantly create new jobs and tasks for your robot. If you save your current position to an LPOS format and your clearence move is Linear, you dont need to worry about crashes provided you have declared some solid and accurate danger zones.

    Edited 2 times, last by Famous_Fella (November 26, 2020 at 10:47 AM).

  • HawkME
    Reactions Received
    570
    Trophies
    11
    Posts
    3,269
    • November 26, 2020 at 2:42 PM
    • #15
    Quote from PetrBroza

    I changed group mask to all *, it worked once, but then I'm getting this error:

    Did you forget to set a value for the argument?

  • PetrBroza
    Trophies
    2
    Posts
    49
    • November 26, 2020 at 3:03 PM
    • #16

    No, program call is still the same. When I change value in bracket, it works only once, then I'm getting an error. I'm running the code in Olcpro though.

    Code
    CALL SET_REG1(5)
  • HawkME
    Reactions Received
    570
    Trophies
    11
    Posts
    3,269
    • November 26, 2020 at 3:24 PM
    • #17

    If you set the register after a Fine movement, you don't need to use DB, you can just set it directly in the program. The look ahead only takes effect on CNT movements.

    Post your programs.

  • PetrBroza
    Trophies
    2
    Posts
    49
    • November 30, 2020 at 7:46 AM
    • #18

    Never mind, rebooting PC fixed the issue.

    Working code for setting R register with Distance before:

    Code
    /PROG  T12_BANK1_HOME
       1:  R[1]=0    ;
       2:L PR[44:BANK1-T12-AP] 400mm/sec CNT100 DB    0.0mm,CALL SET_REG1(1)    ;
       3:J PR[90:T12_Home] 20% CNT100 DB    0.0mm,CALL SET_REG1(2)    ;
    /END
    
    /PROG  SET_REG1
    /ATTR
    OWNER        = MNEDITOR;
    COMMENT        = "";
    PROG_SIZE    = 148;
    CREATE        = DATE 20-11-25  TIME 15:28:30;
    MODIFIED    = DATE 20-11-26  TIME 08:28:32;
    FILE_NAME    = ;
    VERSION        = 0;
    LINE_COUNT    = 1;
    MEMORY_SIZE    = 516;
    PROTECT        = READ_WRITE;
    TCD:  STACK_SIZE    = 0,
          TASK_PRIORITY    = 50,
          TIME_SLICE    = 0,
          BUSY_LAMP_OFF    = 0,
          ABORT_REQUEST    = 0,
          PAUSE_REQUEST    = 0;
    DEFAULT_GROUP    = *,*,*,*,*;
    CONTROL_CODE    = 00000000 00000000;
    /MN
       1:  R[1]=AR[1]    ;
    /POS
    /END
    Display More
  • TomFoolious
    Reactions Received
    11
    Trophies
    3
    Posts
    130
    • November 30, 2020 at 12:55 PM
    • #19
    Quote from HawkME

    Agreed. I do not like the Register only method. Instead I prefer to examine the current position and state, then make a decision.

    Several options for the robots current position in order of my preference: DCS Zones, Ref Positions, LPOS, JPOS

    Then in your homing program you examine the current position (could be in combination with IO state) and then select the correct path to move to home. IO or Registers would be used for secondary information only, such as if there is a part in the gripper, etc.

    The benefit of this is that it is completely independent of the program logic. You don't have to worry about forgetting to change a register if the program is modified and you don't have to worry about someone jogging the robot. In my opinion, coupling homing logic or safety logic to process logic is always a mistake. Inevitably it will get into a different state than you anticipated and you will end up crashing the robot if you only rely on the process logic setting the correct register at the right time.

    This is good information, but I'm curious about a couple things: I get using DCS Zones to see if robot is here or there, but once you've determined you are inside that DCS zone are you then using LPOS to see where the robot is inside that Zone? How are you determining then where the robot is compared to the programmed position(s) to bring it home? Do you query each point of the program and see how close LPOS is to each point? Saying that out loud to myself sounds silly, so I know I'm missing something very obvious...Thanks for any input you can/may provide. I'd love to replace my lazy use of the breadcrumb trail (i.e. register setting). I definitely have seen where it can fail to do its job.

  • PetrBroza
    Trophies
    2
    Posts
    49
    • November 30, 2020 at 1:06 PM
    • #20

    I generally create boxes defined by two points, then I check if TCP is inside.

    Code
    UFRAME_NUM=1
    UTOOL_NUM=1
    DO[1]=OFF
    PR[100]=LPOS
    IF (PR[100,1]>100 AND PR[100,2]>500 AND PR[100,3]>0 AND PR[100,1]<600 AND22 PR[100,2]<1000 AND PR[100,3]<2500) THEN
    DO[1]=ON
    ENDIF

    Edited once, last by PetrBroza (November 30, 2020 at 1:19 PM).

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