Home Programming


Left ArrowBack to discussions page
rstuartrstuart Posts: 5 Apprentice
edited April 2019 in Programming
I am working on my first UR project. I need the ability to read joint positions and have the robot use thise positions to move to a safe start point as to not collide with anything. Can someone help me with the best way of doing this? Thanks!


  • mhowemhowe Partner, Wrist Camera URCap 1.3.0 Posts: 41 Handy
    1. Read current position, save in variable
    2. Define new pose variable
    The example is having the robot only change in the Z direction.


         cp = get_actual_tcp_pose()

         z = cp[2]

         safe_pos = p[cp[0], cp[1], 0.4, cp[3], cp[4], cp[5]]

         Wait 1



    Robot Program


  • JopsonLJopsonL Posts: 12 Apprentice
    edited April 2019
    The way i created a homing program was by setting a variable to every way point and then setting the variable to one when the robot moves to that certain way point, off this i could write a subprogram which would move the robot home using way points. Don't forget to set the variable back to zero after each way point. 

    If you have your home position in before start then change it to a relative position instead of fixed position. The robot would not home unless this was set, unsure why. 

    Set these as installation variables. 

    Below is a portion of the program which is relevant to the homing of the robot. 

         Home_Tracker≔'Is the robot at home?'
         If Home_Tracker ≟  True 
           Home_position                         //this is the way point which is set to fixed position 

     Robot Program
         If currentSubProg ≟ 1
           Call part_pick
           Call move_to_tool
           Call Load_unload_part
           Call move_to_conveyor
           Call deposit_on_conveyor
           If Stop_request≥1 and ppcount≟0
             Set Conveyor_Forwd=Off
         ElseIf currentSubProg ≟ 2
           Call Homing_Function
       Event Home_Button ≟  True  
         Wait: 5.0

         'Homing from Part Pick'
         If RobotTracker≟1
         'Homing from Move To Tool'
         If RobotTracker≟2
         ElseIf RobotTracker≟3
    If StopVar≟1

    Hope this makes sense. 
Sign In or Register to comment.
Left ArrowBack to discussions page