@Sebastien Here is how I go through something similar when we are removing parts from a tray. We will actually keep track of a status of the tray using a list and by changing a list value as the tray is emptied or filled (not in the example below)
To keep from having to program each individual way point you will need to set the number of rows, columns, the row spacing and the column spacing, you can then dynamically move to each location as you are filling the tray.
Program
BeforeStart
numRows≔3
numCols≔3
colSpacing≔150/1000
rowSpacing≔35/1000
i≔0
j≔0
k≔0
numSpots≔numCols*numRows
initialPoint≔Tool
MoveJ
initialPoint
Robot Program
Loop i<numSpots
Pick Part
MoveJ
Waypoint_1
Waypoint_2
Waypoint_1
Calculate Next Place Point
x≔j*colSpacing
y≔k*rowSpacing
clearPoint≔pose_trans(PalletCorner,p[x,y,-100/1000,0,0,0])
pickPoint≔pose_trans(PalletCorner,p[x,y,0,0,0,0])
i≔i+1
If k<numRows
If j<numCols
j≔j+1
Else
j≔0
k≔k+1
Place Point
MoveJ
clearPoint
pickPoint
clearPoint
i≔0
j≔0
k≔0
I have been testing an application where the robot would pick parts from a table top and insert it in the proper position of a tray. The client does not want to have a jig that would locate the tray each time. The operator would put the tray on the table, turning on a switch saying to the robot that a new tray has been inserted. The robot would then start picking parts from the table (also using vision) and place parts in the tray.
I think there are many ways this application can be programmed and I wanted to share mine to get some thoughts on this. My idea is to use a counter variable that would keep track of the parts ID to be inserted in the tray. So under the camera locate, depending where I am at with this counter variable, the robot will move to a certain location to place the part in the tray. Below is the code programmed for the first two positions in the tray. Note that the first camera locate is to locate the part to be picked and the second is the one to locate the tray.
I find that this setup works fine but is a bit time consuming to program if you have a large tray. Any way we can use the Pallet Tool under the vision locate? Any other way you would go around to program this?