Universal Robots Forum

UR10 Robot must operate 2 working zones

Hi every one

I’m new to this, have tried to search for it, but do not quite know what it’s called, is there anyone who could tell which direction I should seek some information about it.

the robot has 2 work areas, the user must be able to press a button to tell the robot that work area 2 is ready, the robot must be able to remember it, even if it is paused.
the push button is connected to an input (hardware)

You use flags or variables to store the desired state and you only reset them once the action is completed. So for instance, while robot is working in zone 1 operator presses zone 2 button a flag would be set. This would be monitored through a thread or event so that it does not rely on the main program. Then once the robot is done with zone 1 it would see zone 2 is ready and enter that portion of the program at the end it would reset the ready flag.

Now if you’re asking is there a way that even when the robot is paused for the operator to press a button and the robot see it the short answer is no, the program is paused. The longer answer is there’s always a way. You could use a latching input that the robot has to clear, this could be a latching relay with the ability to be reset through an output from the robot, a PLC which is monitoring the input and using fieldbus to communicate, etc

Thanks for your answer, maybe paused is an incorrect term, we need to have the possibility to force the robot (with a push bottom) to go 200 mm away from the work area, an stand Stil, until we pres start again, and then it start from the point it were “paused”

So the only way I am aware of doing that is you will need to run your program as a thread and then have you main program monitoring that button, when the button is pressed the main program can kill the thread that is executing and then have the robot perform another thread which is the standoff routine. The tricky part is having the ability to do this from any portion of the activity as you will need a way of tracking where you were in the activity. Are you able to chunk up the activity and have the robot complete an activity before standing off? If so, you could then have your main program run through a list of steps and keep track of which step was next. After the robot is done standing off you could return to the last known position (simply record it to a variable before commanding the robot to stand off) and then resume from the next step, something like this

Before Start
  local step = 0
Main
  if step == 0:
    thrdID = run step0()
  elif step ==1:
    thrdID == run step1()
 end
 if (buttonPressed):
  local lastPosition = get_actual_tcp_pose()
  thrdID = run standoff()
  while (not otherButtonPressed):
    sleep(0.1)
  end
  movej(lastPosition)
  step = step + 1
  if step > 1:
    step = 0
  end


thread step0():
  #perform something here
end

thread step1():
  #perform something else here
end

thread standoff():
  #move to safe position
end

Hi Mbush

Thanks a lot, it very helpful :slight_smile:

/Allan