Home Programming


Left ArrowBack to discussions page
SebastienSebastien Posts: 219 Handy
edited November 2016 in Programming
Hi Pros,
we have been working on a paint application where you need precise start and stop positions of a painting application. The paint gun is triggered using a pneumatic 24VDC valve. On Fanuc robot you are allowed to add a motion line that can trigger a digital IO within the motion line. So as the robot starts moving the gun would start. This option is not available on UR Robots. There are probably a couple ways of doing this. First I thought of triggering the IO for the gun just before the motion line but I was afraid it would create a little spill of paint at the beginning. So I tried to find a way to trigger the paint gun as the robot starts moving. So what I did, is that I used a thread that would monitor the value returned by the script function is_steady(). Then based on whether I am in the paint motion or not I would trigger the valve. Because of the infinite loop error that I had when I tried to run the program, I had to add a wait command in the thread but I kept it very slow. Since the thread is looping at 0.008s I believe that there will be some inconsistencies in the paint start and stop positions that will depend on the actual robot speed. This is the way I thought of doing it. Do you guys have any suggestions?
Here is the code and video. In the video you see a green light on the valve when it is being actuated. More tests on this to come!

     isMoving≔ False 
     isRobotRdy≔ False 
   Robot Program
       isRobotRdy≔ True 
       isRobotRdy≔ False 
     isMoving≔ not is_steady()
     If isRobotRdy and isMoving
       Set TO[0]=On
       Set TO[0]=Off
     Wait: 0.001


  • matthewd92matthewd92 Founding Pro, Tactile Sensor Beta Testers Posts: 1,264 Handy
    edited September 2016
    @Sebastien since turning an output on or off does not require any move time the system executes the command and blows right past it pretty dang fast, we actually have to add small amounts of sleep when using pneumatic grippers to give them the 50-70 ms they need to close before motion starts.  I would think that you would be perfectly fine with a TO[0]=ON right before the move starts and a TO[0]=OFF right after the move stops, especially the off, what I have found in using the is_steady() is it takes a moment after a move for the robot to return true, depending on how fast you are moving and decelerate.  

    If you think about it you set a flag after the moves, that same time slice which is setting the flag condition could just be used to set the valve on and off and with fewer calls to the API.

    Have you tried just putting the actions in-line with the moves?

    <b>Program BeforeStart isMoving≔ False isRobotRdy≔ False Robot Program MoveL Home_pos paint_start Set TO[0]=On MoveP paint_stop Set TO[0]=Off</b>



  • SebastienSebastien Posts: 219 Handy
    Thanks for the info. I have not tested yet with the actual paint gun since I am waiting for the equipment to arrive. Based on your input I will give your advice a try first! I will try to post some results and videos here!

  • SebastienSebastien Posts: 219 Handy
    one other question concerning programming this painting application. You have two points that would correspond to the start paint and stop paint positions. I am planning on using MoveP to ensure proper paint distribution between these two points. However, if I understand the MoveP correctly, I would need a point prior to the paint start point such that constant speed is achieved when reaching the paint start position and moving on toward the paint end position. However, if I trigger the paint gun just before the paint start point, that would eliminate the constant speed created by the MoveP command between the approach point, the paint start point and the paint end point. Am I correct to assume that? How would you make sure you have constant speed between the points? How would you then trigger the IO for the paint gun?
  • matthewd92matthewd92 Founding Pro, Tactile Sensor Beta Testers Posts: 1,264 Handy
    @Sebastien Here is how I would go about doing the moveP, you can start and stop the inputs inside the move and it does not appear to affect the speed trajectory since the robot does not need to stop to turn an output on or off, if the command required the robot to stop then it would be a problem.  Here is some information on how I/O is handled during a move (from the software manual)

    Basically, since the moves are blended then the Output is turned on as soon as you enter the blend radius of the first move.  You might even try turning it on prior to the first move inside the moveP which is a relative move with 0mm and 0degree offset from the previous move.  Not even sure that the waypoint is really required.

    Here is some information on how fast the output pins change state once you tell them to go high or low. 
  • ericeric Founding Pro, Partner Posts: 18 Handy
    You can try using a timer relay between the robot and solenoid:


    But it appears you can use one of the programming solutions listed above too.  You can always start by turning on the paint gun while it's off the surface and then moving through the path over the surface and past the end point before turning off as well.

    Also, are you going to use any positive pressure suit for the robot or is it not explosion proof required?

    Good luck!
  • SebastienSebastien Posts: 219 Handy
    It worked well. We simply programmed the DO to trigger the gun as a child of the MOVE node and it worked well!

    The paint was not requesting explosion proof equipment.
Sign In or Register to comment.
Left ArrowBack to discussions page