Home Applications


Left ArrowBack to discussions page
mhowemhowe Partner, Wrist Camera URCap 1.3.0 Posts: 41 Handy
I have an application where a UR10 is palletizing boxes. There is about 50 different sizes which means 50 different pallet layouts. Multiple box sizes a day so it is always changing.

 I am interested in seeing how others have accomplished this task, how you tell the UR what box is coming and if an external motion controller is used.

Best Answer


  • matthewd92matthewd92 Founding Pro, Tactile Sensor Beta Testers Posts: 1,266 Handy
    We did a small proof of concept about 18 months ago for a company where there were a lot of different configurations that they had to handle throughout the day.  Are the boxes coming down the line at random as far as size or is it package a pallet of this size box then switch to another size and package some of them?

    As far as how we planned to accomplish the task we were using a database that stored a set of arrays for each part number (pallet configuration) they were packaging.  This database would basically return a set of lists to the robot, one list for the x,y and rotation of each box on the pallet,  how many layers there were and the number of boxes on each layer as well as the center coordinates used by the robot to pick the box off of the pallet.  The system then used that information to determine how to loop through the list of coordinates and place each box onto the pallet oriented in the correct direction, we would use a dead-stop at the end of the conveyor that was feeding the robot and a cylinder to square up the box prior to being picked.  We were looking at using a camera potentially to ensure that the boxes were oriented correctly before being picked, less of a concern on that project as the boxes were flowing to the robot out of a taping machine so unless someone really messed up they were all oriented the correct direction.

    Hope that gives you some ideas to work with.
  • mhowemhowe Partner, Wrist Camera URCap 1.3.0 Posts: 41 Handy
    @matthewd92 As far as size the boxes each pallet is the same size box so maybe 15 pallets of 10 x 10 then 10 pallets of 4 x 6.

    Did you store the pallet configurations on a separate PC? 

  • mhowemhowe Partner, Wrist Camera URCap 1.3.0 Posts: 41 Handy
    @matthewd92  Was there a particular program that you used to help generate the pallet configurations?

  • matthewd92matthewd92 Founding Pro, Tactile Sensor Beta Testers Posts: 1,266 Handy
    No, our customer already had them all so it would have just been a matter of entering the data into the system, there were over 200 active configurations which is why we looked at this route. 
  • MarkEGuidaMarkEGuida Partner Posts: 4 Apprentice
    Mathew, how did you query the XMLRPC server?  Is it still done with the same socket send script?
  • matthewd92matthewd92 Founding Pro, Tactile Sensor Beta Testers Posts: 1,266 Handy
    You create an xmlrpc connection at the top of the before start section if the program and assign it to a variable. Then you simply use dot notation for the various methods that the server has so for instance if I create a server that has a method for getting the current time called getTime it would look something like this 

    myServer = create_xmlrpc(xxxxxx)(don't recall the exact method off the top of my head)
    var time=myServer.getTime()
    The script command for creating the server connection can be found in the URScript manual. 
  • CPhilCPhil Posts: 1 Recruit
    I was working on a similar problem in the 1990s.  The problem was to find the best arrangement of boxes of different sizes in a truck or train wagon.  The best arrangement means finding the arrangment that puts the maximum number of boxes in the storage location (truck storage or train wagon).  It's a geometric 3D problem (very complicated without the right method).  Furthermore, there were constraints on the boxes.  Some boxes were tagged as 'heavy' and could not be put on top of others, so they had to go to floor level.  Other boxes were tagged as 'weak' and could not accept other boxes being on top of it.  They were the last boxes to be put in the storage location.  Most boxes were neither 'heavy', neither 'weak'.   The solution we used was an evolutionary algorithm like a special Genetic Algorithm.  It works!  If all sizes, weights and categories are  known from the start, this problem can be resolved and your robot will execute the optimal arrangements directly.  It's too elaborate to get into on this blog.  I'm an independent software developer.  I have a bachelor in Math and I made a career as a programmer.  I can solve these types of problems effectively.  Contact me if you are interested.
  • ManeeshManeesh Posts: 2 Recruit
    Simple Common program can be made for different sizes of pallets, where you are getting the box id or box dimensions from either PC or a HMI. Program then take care of all the palletizing sequences. We are using below program where operator is entering value when ever they are changing the size. This can be further simplify using the box selection screen.
    Find the attached image of program. 

  • MarkEGuidaMarkEGuida Partner Posts: 4 Apprentice
    Ok, so I have a simple XMLRPC server running on my PC and I can communicate with it from  URSim.  The issue I'm having now is controlling the data types coming back to the robot.  I'm using the same basic URP scripting that UR has in their support section.
    pallet_server := rpc_factory("xml_rpc", "")
         get_next_pose := pallet_server.p_next_box(5)BEFORE START:

    On the server, this opens up a CSV file and strips out the 5th entry in the Box# column (using DictReader() class to read the CSV).  When I run the simple Python client below, I enter 5 and it's works fine.
    </code>import xmlrpc.client
    import csv
    s = xmlrpc.client.ServerProxy('')
    index = input("Box Number: ")
    </pre><div><br>When I run the UR program I get the following error:<br><img alt="" src="https://us.v-cdn.net/6027406/uploads/editor/di/17q7t3ar06vk.png" title="Image: https://us.v-cdn.net/6027406/uploads/editor/di/17q7t3ar06vk.png"><br><br>The "current_box" variable is nested inside an IF statement (not showing all my code, obviously):<br><pre class="CodeBlock">def get_next_box_location(index):
        with open('PalletDefinitionSheet.csv') as csvfile:
            reader = csv.DictReader(csvfile)
                for row in reader:
                    if row['Box#']==index:
        return (current_box)
    server.register_function(get_next_box_location, 'p_next_box')
    </pre><div>Like I said before, this code works fine when I run the plain Python client request, but I get the error when I run it in my URP. &nbsp;If I put the assignment of "current_box" before the IF, I always get that value returned. &nbsp;Any ideas as to why this is happening?<br><br><br><b>SECOND QUESTION:</b></div>If I monkey my code around so I get SOMETHING back that's usable, I get a data type mismatch. &nbsp;Polyscope tells me that I am sending string when it expects pose or list of joint positions. &nbsp;In the Python shell I see the output as:<br><pre class="CodeBlock"><code>[0.25,0.52,0.08,0,0,d2r(0)]
    However, it arrives in Polyscope as:
    Any idea how to handle this?

  • MarkEGuidaMarkEGuida Partner Posts: 4 Apprentice
    Well I had a breakthrough!  I started printing out as much data from the server responses as possible and that made me realize that I was dealing with mostly string types....but I was expecting integer or float....so a little data type massaging and VIOLA!  I can sending good data now.  Thanks for everyone who listened!
Sign In or Register to comment.
Left ArrowBack to discussions page