Home Programming

Discussion

Left ArrowBack to discussions page
abeachy_HG24abeachy_HG24 Posts: 79 Handy
edited June 2017 in Programming
When the UR is in run mode, does the program speed slider default to 100%? Also, is there a way to use a script function of some sort to verify or set the speed slider to 100%? I am using the UR in a sealant dispensing application where the UR picks the part and moves it underneath a stationary needle. We had one cycle where it dispensed too much sealant because the UR was going slower than normal but I believe the UR was running in the program tab and the speed slider may have been lowered by accident.

Comments

  • matthewd92matthewd92 Founding Pro, Tactile Sensor Beta Testers Posts: 1,157 Handy
    There is a way to do that, you open a TCP connection to port 30003 and can then send the command. Ill post up here when I get back to my laptop the function that we created to set the speed slider.  We just call it at the top of the program to set it wherever we want, so if I'm debugging I may set it slow and then I can speed up the robot manually. If I have a long program but there's a particular spot I want to go slow I can automatically slow it down so I can see what's happening in a small section for instance. 
  • matthewd92matthewd92 Founding Pro, Tactile Sensor Beta Testers Posts: 1,157 Handy
    @abeachy_HG24 here is the script function that we use:

    def runSlow(speed):
    
    socket_open("127.0.0.1",30003)
    socket_send_string("set speed")
    socket_send_string(speed)
    socket_send_byte(10)
    socket_close()
    
    end
    To use this in your program you would just call runSlow(1) to set the speed slider to 100% or runSlow(0.25) to set it to 25%.  I have put this in a background thread before when I wanted to enforce a given speed slider ratio for a program, that way if someone moved the slider in production it automatically moved it back.  You can also choose whether to show the speed slider on the run screen or not.
  • johan92leejohan92lee Partner Posts: 1 Recruit
    Hi @matthewd92, thanks a lot, this is very helpful!

    One question here though, is the "set speed" a special kind of command that can only be used to send through port 30003? Because I don't find it from the URScript manual. Was wondering if you have a list of these commands that you can share?
  • matthewd92matthewd92 Founding Pro, Tactile Sensor Beta Testers Posts: 1,157 Handy
    @johan92lee it is and it isn't, it's special in that it is not a URScript command that can just run as part of a program but it's not special in that it is basically just the command that is sent to the controller when you move the speed slide, here is more information.  I have picked up these little tidbits just reading through the UR support site over several years and gaining a really good understanding of what is happening behind the scenes with the robot and the touch pendant.  Another thing that we use are the dashboard commands, both within the program and as remote tools.  For instance, if I want to have a customer test a new program we will load it onto the robot's memory remotely and then we can use a dashboard command to not only load the program but then tell the program to play for instance.  This is all done across port 29999 and there is a list of commands that are available to use here.  Another example where we use the dashboard server is to have popup messages that are non-blocking and only display an OK button, so purely informational.  An example is, on long loading programs where there is a lot happening in the Before Start portion of the program such as an intricate homing routine we might pop up a message saying something like, "Please wait while the program prepares to start" so that the operator knows that something is happening and doesn't keep pressing the play button.  We will then at the end of the Before Start dismiss the popup so to ensure that it is not still there.

    My best recommendation for learning all the great little things that can be done is to read through all of the FAQ's and How-To's on the UR Support site which can be found at https://www.universal-robots.com/support/

    I will start a thread where maybe everyone can post up any little functions that they have written that help simplifies using the robot such as the runSlow function above.
  • bchemellibchemelli Posts: 7 Apprentice
    Matthew,  I know this thread is old.  I hope I'm interpreting this correctly. You suggest that the speed slider can set to display on the move tab when a program is in run mode.  I don't see anything in RTDE or Dashboard Server that would do this.  How is this accomplished? Thanks.
  • matthewd92matthewd92 Founding Pro, Tactile Sensor Beta Testers Posts: 1,157 Handy
    You have to enable it on the installation page by opening up the hidden advanced options. I know on CB series you swipe across the screen right below the features tab. You will see a new tab up at the top when it is un-hidden. On the e-Series I’m not sure but it should be in the manual. 
  • bchemellibchemelli Posts: 7 Apprentice
    Matthew,  I have worn through the touch screen swiping on the features tab. See Pic.  What am I missing?  I know the pic is a simulator, it's easier than getting a screen capture.  Thanks for the help.


  • matthewd92matthewd92 Founding Pro, Tactile Sensor Beta Testers Posts: 1,157 Handy
    Swipe left to right like the arrow shows, it's somewhere around where I am showing, unfortunately with the virus containment I am working from home and do not have access to a robot nor the simulator.  I tried doing a quick search online but cannot seem to find it there either.


  • bchemellibchemelli Posts: 7 Apprentice
    Got it.  Thanks for your patience.
  • matthewd92matthewd92 Founding Pro, Tactile Sensor Beta Testers Posts: 1,157 Handy
    No worries, glad you got it working. I’ve never understood why they hide that like they do. 
  • jhilljhill Posts: 3 Apprentice
    matthewd92 
    Do you know of any way to lock in the speed slider when the robot is being moved manually from the move screen? My goal would be to only allow operators to move the robot at a reduced speed.
  • matthewd92matthewd92 Founding Pro, Tactile Sensor Beta Testers Posts: 1,157 Handy
    You’d have to have a background process like a PLC that is monitoring the actual value and then setting it back to a value behind the scenes. We do something like this with our robots in the field where you can’t adjust the speed slider during execution. 

    So one question, why do you want to reduce the speed which they can move the robot. It’s already relatively slow. 
  • jhilljhill Posts: 3 Apprentice
    edited July 28
    In a fault condition the PLC puts the machine in a complete cycle stop. The robot on the other hand stops in its current position when the fault occurs. The operator must manually take the robot home from the controller. On occasion they crash the robot during this process. My long term goal would be to create a safe homing routine. In the short term I was looking for a way to protect the robot. In my PLC tags I noticed that they previous integrator was monitoring the speed slider fraction. Any help would be great!
  • matthewd92matthewd92 Founding Pro, Tactile Sensor Beta Testers Posts: 1,157 Handy
    So one way you could do it is use reduced mode on the robot. You could hardwire two outputs to a pair of safety inputs. Set the outputs to be “high when running, low when stopped”. This would cause the robot to go into reduced mode unless the program is playing. This is different than chopping the speed slider in that it will move slowly but if they try to move it with freedrive too fast it will throw a safety fault. 

    If the outputs don’t stay low when you are using the move screen, quite possible since it is playing a program but can’t recall if they are affected or not, then you could use the PLC to trigger the outputs. Have the program set a Boolean register to true at the top of the program, set that register to be low when not running. Then from the PLC when that register goes high set the outputs high. You will need to mask the outputs to control them using the mask byte. Then you simply set the outputs to be low when not running. That way the only thing that makes them go high is the program. You could also simply do this from the top of the program without the PLC’s help. Depends on how much you want to safeguard the system from people being able to edit the condition. 
  • jhilljhill Posts: 3 Apprentice
    matthewd92 Do you have an example of how the code would look to make this happen within the UR program at the top?
  • matthewd92matthewd92 Founding Pro, Tactile Sensor Beta Testers Posts: 1,157 Handy
    You’re simply setting the two outputs that are ties to the safety inputs to on. When the program plays reduced mode will exit. When the program stops the outputs will turn off automatically enabling reduced mode. 
Sign In or Register to comment.
Left ArrowBack to discussions page