How to allow robot to move during a wait command? Thread?

I am running a CNC machine tending operation. Currently I am controlling the opening and closing of my machine vises with a digital output. When I open them, I turn a digital output on, wait for 6 seconds and then turn it off. This works fine, however my robot is sitting idle for those 6 seconds during the wait command.

While the vices are opening for the 6 seconds, I want to allow the robot to continue to move up to a certain point in the program and wait for the 6 seconds to finish passing to optimize my cycle times.

I want to do the same thing when closing my vices. After I place the part in the vise, I want to trigger the vises to close and the robot can continue to run up to a certain point before it must wait for the vises to finish closing before moving forward.

What is the best way to go about doing this? Is a thread the answer?

Well the first thing that comes to my mind would be to ditch the timer and read feedback. Does the CNC provide a signal for when the vise is open? Then you aren’t waiting for any fixed amount of time, you’re simply moving to whatever waypoint you want, and then wait for that feedback signal.

If there’s no actual feedback signal provided to you, I might be inclined to use the “Time” input on the Move instruction.

Just set your robot motion to use the same amount of time that you have your vise set to open. So the robot will move (probably slower than your normal speed) for 6 seconds and as soon as the vise is open, the robot can advance immediately.

1 Like