Home Programming

Discussion

Left ArrowBack to discussions page
BenthienBenthien Posts: 4 Apprentice

I am working on a program sequence for our UR5e robot. When the program is interrupted or stopped, or after digital input 1 (button for program stop) is activated, the robot should be driven to the safe home position upon activation of digital input 2 (button for home travel).

I have already tried it with URScript and the following code:

URScript program to drive to safe home position after program stop or digital input interruption Define the safe home position home_pose = p[0.1, -0.5, 0.3, -1.57, 0, 0]

Wait for program stop or activation of digital input 1 while True: if not is_program_running() or get_digital_in(1): break sleep(0.1)

Wait for activation of digital input 2 while True: if get_digital_in(2): break sleep(0.1)

Drive to the safe home position movej(home_pose, a=1.2, v=0.25)

However, there is always a syntax error...

Does anyone have any ideas or are there other possibilities?

Thank you very much!

Comments

  • bcastetsbcastets Vacuum Beta tester Posts: 674 Expert
    I don't think you can easily bring the robot to home position when the robot is not. You could probably do that by monitoring the robot from ousite and execute a program to move the robot at home position if the robot program is stopped.

    However you can move the robot to home position using a if continuous check statement and request the robot to move if the digital input is at True. You can use regular nodes to do that, you don't need to use scripting.

    Scripting open more possibility but it is not so easy to debug.

  • BenthienBenthien Posts: 4 Apprentice
    Geben Does it work even if the program has been stopped? And how do I program it to only move to the safe home position when the program has been stopped and then wait in the safe home position until the program is started again? Ihren Kommentar ein
  • bcastetsbcastets Vacuum Beta tester Posts: 674 Expert
    My suggestion for going to home position when analog signal is True work only if the program is running.

    If you want to do that when the program is stopped i think it needs to be done from outside. Something like a pc could monitor robot state via modbus for example and request program execution to go to home position via ur client interface.
  • BenthienBenthien Posts: 4 Apprentice
    edited March 9
    1. Würde diese Routine funktionieren?

    2. Stellen Sie die sichere Ausgangsposition zu Beginn des Programms ein, um sicherzustellen, dass sich das System in einem sicheren Zustand befindet, bevor Sie das Programm ausführen.

    3. Starten Sie das Programm mit Digitaleingang 2 und warten Sie, bis das Signal Digitaleingang 0 hoch ist, um fortzufahren.

    4. Wenn das Signal am Digitaleingang 0 erkannt wird, fahren Sie mit der Programmausführung fort.

    5. Wenn das Programm mit dem digitalen Eingang 0 beginnt und der digitale Eingang 2 niedrig ist, wird es nicht angehalten 

  • bcastetsbcastets Vacuum Beta tester Posts: 674 Expert
    Google translation:
    1. Would this routine work?
    2. Set the safe home position at the start of the program to ensure the system is in a safe state before running the program.
    3. Start the program with digital input 2 and wait until the digital input 0 signal is high to continue.
    4. If the signal on digital input 0 is detected, continue the program execution.
    5. If the program starts with digital input 0 and digital input 2 is low, it will not stop
    It sounds possible to process like this. You could give it a try !
Sign In or Register to comment.
Left ArrowBack to discussions page