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

Writing my own home check (instead of P00 CHK_HOME)

  • JonHopper
  • July 23, 2013 at 1:44 PM
  • Thread is Resolved
  • JonHopper
    Reactions Received
    2
    Trophies
    3
    Posts
    150
    • July 23, 2013 at 1:44 PM
    • #1
    Quote


    $H_POS=XHOME
    IF CHECK_HOME==TRUE THEN
    P00 (#CHK_HOME,#PGNO_GET,DMY[],0 ) ;Testing Home-Position
    ENDIF


    This is the original snippet from the basic cell.src template.

    Is the $H_POS=XHOME line necessary? Aside from that I am going to be writing my own home check..

    I basically have three home positions from which I would like the robot to be able to start. XHOME, XHOME1 and XHOME2. I was planning on writing a fairly basic if statement to check for one of three positions. Has anyone done this? I am just wondering if I will run into any unexpected issues from doing this. Thanks.

  • eusty
    Reactions Received
    6
    Trophies
    4
    Posts
    721
    • July 23, 2013 at 2:29 PM
    • #2

    Basically $h_pos is what it looks for for the home position, you are just making it to be the same position as XHOME.

    I think this is to make it backward compatible with older versions of KSS, I've never used multiple home positions but there was a thread about in the other week or two.

  • JonHopper
    Reactions Received
    2
    Trophies
    3
    Posts
    150
    • July 23, 2013 at 9:12 PM
    • #3

    Can't seem to find anything relevant.

    I'm not really too worried about it. A simple if statement check should do the trick...

  • eusty
    Reactions Received
    6
    Trophies
    4
    Posts
    721
    • July 23, 2013 at 9:50 PM
    • #4

    https://www.robot-forum.com/robotforum/ind…38534.msg#38534

    Sent using Tapatalk 4.

  • JonHopper
    Reactions Received
    2
    Trophies
    3
    Posts
    150
    • July 23, 2013 at 10:03 PM
    • #5

    I know already that I can assign up to 6 home positions... my question is more specifically regarding the home check in cell.src. Will any one of the home positions create a chk_home=true condition?

    I need to be able to completely abort all programs and start back up from cell.src in any of the home positions :smiling_face:

  • eusty
    Reactions Received
    6
    Trophies
    4
    Posts
    721
    • July 23, 2013 at 10:36 PM
    • #6

    It depends on what sets CHECK_HOME true.

    We don't use the standard cell.src but create our own main program so without checking the whole program I couldn't say :frowning_face:

  • JonHopper
    Reactions Received
    2
    Trophies
    3
    Posts
    150
    • July 24, 2013 at 5:55 PM
    • #7

    It appears P00 home check only looks at $IN_HOME which is xHOME, not any others... so P00 calls an If statement. I'm just going to skip all the nonsense and put my own check in..

    Thanks for the help anyway. I'm 97.5% sure my own check will work without any issues. I'd really like to not use any p00 functions if I can help it.

  • Online
    SkyeFire
    Reactions Received
    1,061
    Trophies
    12
    Posts
    9,463
    • July 24, 2013 at 7:29 PM
    • #8

    It's not hard to do. You can simply compare the values of $AXIS_ACT to your "home" position, using a tolerance band, like so:

    Code
    DECL BOOL CheckPassed
    CheckPassed = (ABS($AXIS_ACT.A1 - MyHomePos.A1) < Tolerance.A1)
    CheckPassed = (CheckPassed AND (ABS($AXIS_ACT.A2 - MyHomePos.A2) < Tolerance.A2) )
    .
    .
    .
    CheckPassed = (CheckPassed AND (ABS($AXIS_ACT.A6 - MyHomePos.A6) < Tolerance.A6) )
  • JonHopper
    Reactions Received
    2
    Trophies
    3
    Posts
    150
    • July 24, 2013 at 7:58 PM
    • #9

    I was thinking of something even simpler...


    Code
    IF (($AT_HOME=1) AND ($AT_HOME1=0) AND ($AT_HOME2=0))
         HOMECHECK=TRUE
    ELSE
    IF (($AT_HOME=0) AND ($AT_HOME1=1) AND ($AT_HOME2=0))
         HOMECHECK=TRUE
    ELSE
    IF (($AT_HOME=0) AND ($AT_HOME1=0) AND ($AT_HOME2=1))
         HOMECHECK=TRUE
    ELSE
    HOMECHECK=FALSE
    ENDIF
    ENDIF
    ENDIF
    Display More

    Would this not work?...

  • Online
    SkyeFire
    Reactions Received
    1,061
    Trophies
    12
    Posts
    9,463
    • July 24, 2013 at 8:27 PM
    • #10

    Ah, well, if you have all the various HOMEx positional variables set, then yes, that'll work. Although this might be simpler:

    Code
    HomeCheck = (($IN_HOME1 EXOR $IN_HOME2) EXOR $IN_HOME3)


    Reduces it down to one line.

  • JonHopper
    Reactions Received
    2
    Trophies
    3
    Posts
    150
    • July 24, 2013 at 8:37 PM
    • #11

    Hah, yeah didn't think of that. Doh :stupid: basic logic anyone ...

    Thanks :grinning_squinting_face:

  • JonHopper
    Reactions Received
    2
    Trophies
    3
    Posts
    150
    • July 25, 2013 at 2:30 PM
    • #12

    Here's another way to do it: (for reference)

    Code
    CHECK HOME
      IF ($OUT[59]==TRUE) THEN
      $H_POS=XHOME1
      ENDIF
    
    
      IF ($OUT[60]==TRUE) THEN
      $H_POS=XHOME2
      ENDIF
    
    
      IF CHECK_HOME==TRUE THEN
        P00 (#CHK_HOME,#PGNO_GET,DMY[],0 ) ;Testing Home-Position 
      ENDIF
    Display More

    This is under the assumption that 59 and 60 are already configured for home 1 and home 2. This way is not really that great as all you are doing is modifying home0 (as I call it) to reflect home1 and home2 so you can pass the silly p00 homecheck which only checks H_POS.

    It is also possible to add a few lines in P00 to check for the other home positions but to me this seem the longwinded way of doing it...

  • Online
    SkyeFire
    Reactions Received
    1,061
    Trophies
    12
    Posts
    9,463
    • July 25, 2013 at 4:02 PM
    • #13

    Yeah, since the Signal assignments can change, the better way is to simply access the $IN_HOMEx variables directly.

    P00 isn't holy writ -- it's intended as much as a template as an actual ready-to-use program. There's no reason you can modify the Home Check section of P00 for your own application.

  • JonHopper
    Reactions Received
    2
    Trophies
    3
    Posts
    150
    • July 26, 2013 at 3:05 PM
    • #14

    The reason I'm trying to stay away from it is to make the program easier to understand for operators and on the floor techs. There are a lot of people that get confused when variables are passed back and forth between routines and/or when the operation of the code isn't extremely obvious...

    This is my new cell.src:

    Code
    DEF  CELL ( )
    
      ;FOLD INIT
      DECL CHAR DMY[3]
    
    
      DECL BOOL HOME_CHECK
      HOME_CHECK=FALSE
    
    
      DMY[]="---"
      ;ENDFOLD (INIT)
      ;FOLD BASISTECH INI
      GLOBAL INTERRUPT DECL 3 WHEN $STOPMESS==TRUE DO IR_STOPM ( )
      INTERRUPT ON 3 
      BAS (#INITMOV,0 )
      ;ENDFOLD (BASISTECH INI)
      ;FOLD CHECK HOME
    
    
    HOME_CHECK:
    
    
    HOME_CHECK=(($IN_HOME EXOR $IN_HOME1) EXOR $IN_HOME2)
    
    
    IF (HOME_CHECK == TRUE) THEN 
    	DO38_AT_HOME=TRUE
    ELSE
    	DO38_AT_HOME=FALSE
    	;WRITE MESSAGE
    	GOTO HOME_CHECK
    ENDIF
    
    
      ;ENDFOLD (CHECK HOME)
    
    
    $OUT[18]=FALSE
    
    
      LOOP
        SWITCH  GI_JOB_SELECT
    
    
        CASE 1
          JOB001() ; Call User-Program
    
    
        
    
    
        DEFAULT
          ;MESSAGE
        ENDSWITCH
      ENDLOOP
    END
    Display More
  • eusty
    Reactions Received
    6
    Trophies
    4
    Posts
    721
    • July 26, 2013 at 4:32 PM
    • #15

    Another way to make things easier to understand.....why not use SIGNAL declarations?

    SIGNAL name $OUT[18]

    The you could use name=FALSE in your program, which would be easier for others to work out what is being set false.

  • JonHopper
    Reactions Received
    2
    Trophies
    3
    Posts
    150
    • July 26, 2013 at 5:34 PM
    • #16

    Yes, I realized that yesterday and drew up the IO declarations for each robot. It will help big time, the way I was doing it before I had to add comments everywhere there was IO...

    My question is though, where and when do the signal variables get updated? Do they get updated at the exact same time as the IO table or do they have to run through a scan first?

  • eusty
    Reactions Received
    6
    Trophies
    4
    Posts
    721
    • July 26, 2013 at 6:52 PM
    • #17

    As far as I'm aware it's just a tag for the I/O so gets updated as the I/O does.

    Sent using Tapatalk 4.

  • Online
    SkyeFire
    Reactions Received
    1,061
    Trophies
    12
    Posts
    9,463
    • July 26, 2013 at 8:39 PM
    • #18

    Eusty is correct -- from the system perspective, $IN[1] is no more, or less, valid a "handle" to a given bus signal than any SIGNAL declaration you make yourself. The only difference is that $IN and $OUT are "baked in" at the factory. But input updates are all simultaneous, and all outputs are effectively instantaneous (interrupt-driven).

  • JonHopper
    Reactions Received
    2
    Trophies
    3
    Posts
    150
    • July 26, 2013 at 9:59 PM
    • #19

    Awesome. Thanks for the info, guys.

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