Want to set digital out high anytime robot is in motion

Hello,

I’d like to set a digital out on high (green light on) any time the robot is in motion. Is there a way for me to do this in polyscope? I thought I’d be able to use a configurable output but none of the “action in program” setting seem to be right for what I need. I also thought about having an if statement checking the robot’s current TCP speed but I’m not sure if this will work.

Yeah none of the default options pick up “robot in motion” but your idea of capturing the TCP speed should be fine. Just set your programs to use a Thread that says something like the following:

image

Obviously using 0 is probably a bad choice here, as there’s likely always very slight movement. But you get the idea. Just set a higher threshold until it only comes on when you would deem it “moving.” I also didn’t use the actual command because I was lazy. I think it’s something like “get_actual_tcp_speed()”

2 Likes

you could also use the script function “is_steady()” instead which might be more accurate, similarly in a Thread instead of tcpSpeed.

4 Likes

Got it, these were both helpful responses so thank you. Is there a way to turn a digital_out on every time a pop up is present? I’m trying to turn a light on whenever a pop up is showing for an operator but I’m not sure how i’d evaulate whether there is a popup or not

As far as I know, there is no “easy” way around evaluating if a popup is present or not.
But if it’s a regular popup created in the robot program, you could set the digital output along with the popup. Definitely the simplest way to achieve it. :slight_smile:

Well I think, that is semi-optimal.
Consider what happens to your DO[3], when the movement is suspended due to SafeGuard or E-Stop.
In this case the programm will be paused immediately and your thread comes to a stop.

regards Sven