I am new to this type of programming, I am using depalletizing for my project and I want to make two modifications (it is a UR5e).
I want to add a loop at the beginning but as you can see it is not merged with the following lines. Should I re-write the whole lines to make the upcoming lines included? I saw this comment but I am not sure if it is practical in this topic and if it is, how I can add “continue()” here.
The first movement of the robot is going to the dropping location without holding a part and in the last step, the robot holds the part and stops the task. I am not sure how should I modify the program to complete the task.
I added the full script code, I would appreciate it if you share your suggestions on this one.
Related to this code above, I also have a question.
Is it possible to pick up and handle the parts at different times? The task involves assembling six different parts to create a complete device, and the time required to finish each part varies due to their different shapes. The participants need to repeat the assembly process 10 times.
Do you have any suggestions for modifying the de-palletizing process to account for the varying times required to handle each part?
I would just use the Cut/Paste options to move all the lines you want under the Loop 2 times instruction.
Modify it by moving up all the instructions related to holding a part with the arrow on the menu.
(Optional): Please rename the waypoints and add some comments. It is hard to guess where the drop-piece part finishes and where the pick-piece starts when everything is just “Waypoint_X”. If you don’t know where one part starts or ends, just run the program and pause it when it goes to pick the part, and look which Waypoint is highlighted in blue.
Thank you so much for the help! It helped me with improving the code. I applied your suggestions.
After applying the irregular pattern, I have another question: How can I add different timing for each pick? For example, I want 2 seconds between parts 1 and 2 (between FirstRow1 and FirstRow2) in each row but 1 second between FirstRow2 and FirstRow3. Any suggestions for doing so?
first question I have is why? 2nd question is where do you want the robot to be waiting? that wouldn’t be that easy to do. you would probably need to incorporate an if or switch statement. You could use the variable that increments the palletizer to decide how long to wait. each switch case you add would be the wait between the next parts. It’s not very clean though.
Thank you for the response. The research purpose is to increase mental workload, so I want to keep the pace (robot speed) at the maximum and have pauses for the participants to do the assembly. Since the fixtures are different, the time taken for each is varied. I want it to wait for 2-3 seconds right before picking up the next part.
Let me try what you suggested, If it was not practical, then I should reduce the speed to a normal speed.
@Hannah can you just have the participant press a button when they are ready for the next part? That would be the easiest method. you can just wire in a 2 wire button to an input on the robot and have the robot wait until that input goes high. could be a foot pedal if the participants hands aren’t available.
while having some trial and error I came up with a new way of designing, I hope this is my last question. I cannot ask the participant to press the key, because it is a mental workload evaluation and I can not give them an additional task.
My pallet has 6 rows and 8 columns. I was thinking of having a wait time of about 10 seconds at the end of each row. Do you have any recommendations for that?
My first thought, and worst-case scenario, was having only one line and I re-fill the pallet manually after each row but manual.
Sorry if my questions are too simple, I am naive in this field.
Where total_1_layer is the amount of pieces per layer (rows*columns).
This works as long as you check the counter after the robot has picked and dropped a part. If you check it after picking BUT before the dropping, you might need to change the code to:
Just for future reference, I am explaining my modifications to what you suggested:
I needed to have it wait at the end of each row so I changed the total_1_layer = 6*1
Then, I wanted the robot to pick the first part in the next row and wait there for 10 seconds, so I changed the if command to Pallet_counter-2. The rest was the same as you mentioned.
To provide an update on this question, I asked a question regarding depalletizing with various pauses in picking up the parts. This is how I was able to do that.
Basically, I just added + and - to the pallet_counter for multiple times. There might be a more advanced way to do it, but it worked this way! So maybe it help someone in the future.