UR3e, Inspection program, Jump position

Hello,

I’m currently working on my first program and facing some difficulties. Here’s a brief description of the problem:

I’m developing an inspection program for a robot that picks up a plug and moves it to a position to check for an O-ring. If the O-ring is detected, the program continues to the next steps. If the O-ring is not detected, the robot moves the plug to another position and drops it into a container.

My question is: How can I program the robot to return to the starting position, where it picks up the plug, after dropping the rejected plug into the container, so it can resume the inspection process? Additionally, the inspection process is part of a subprogram, and there are two more subprograms for inspecting plugs for two different parts.

I appreciate any feedback. Thank you in advance.

laska,

I believe it’s the default mode that the program will loop forever . . . until you stop it.
This is controlled by the “Program Loops Forever” checkbox when you’re editing the Robot Program node:

Typically you’ll want to move the robot to a safe home position at the end of the cycle, which becomes the start position for the next cycle.

1 Like

I’ll just add a bit to dpeva’s reply. :slight_smile:

The easiest way to achieve what you’re looking for is to loop the program, as dpeva is mentioning.
Then you need a Switch or If commands to play the desired program part at the right time. Here’s an example:

With this method, you can jump between different sequences as you like. You just set the variable ProgramState at the end of a sequence to whatever sequence comes next. Or have an expression switch between two (or more) different cases with an If command.

3 Likes

Hello, I appreciate the feedback, thank you. My program does not use a camera or any other input device; it only relies on a contact tool and distance measurements. I should have clarified this when I mentioned inspection. We detect the presence of an O-ring using a contact tool: if the tool detects contact, it moves on; if not, it measures the distance to 49.5. If the distance is 49.5, it indicates that there is no O-ring, and the process moves to the next step, dropping the plug without the O-ring. From this point, the cycle restarts with the plug being picked up for another inspection, and so on.
So how do I transition from the drop point back to the pick-up move so the program can resume by picking up the part again?

No one mentioned a camera, your original explanation was sufficient. You’ll want to look at @efn 's posted program. This is some really nice standard practice for robot programming. You need to treat the entire operation like a state machine, and let your program operate in small, bite-sized chunks. Break your process down into small tasks, assign each task a numerical state, and then let the main robot program consist of Switch/Case or Ifs that just ask “if the robot state = 1, go to task 1.” Then you can simply assign the robotState variable to whatever you need it to be.

So for your exact example. you’re asking: “how do I transition from the drop point back to the pick-up move so the program can resume by picking up the part again?”

This translates to: How to I transition from [TASK X to TASK Y]? Which you do exactly how @efn shows. You may need to re-write some of your code to break it into smaller, more manageable pieces.

2 Likes

Thank you, @dpeva , @efn , and @eric.feldmann , for all your feedback. I truly appreciate your help!