Pepperoni Bot

From Industrial Robotics & Automation - Fanuc Teach Pendant Programming
Revision as of 21:55, 1 July 2019 by Mike138 (talk | contribs) (Created page with "This example details an automated placement of pepperoni on a pizza. Planning Your Cell Motion Requirements Program Name The robot will need to pick up a pepperoni piece from...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This example details an automated placement of pepperoni on a pizza. Planning Your Cell Motion Requirements Program Name The robot will need to pick up a pepperoni piece from the pepperoni stack Pick_Pepperoni The robot will need to place the pepperoni at the next available space on the pizza. Place_Pepperoni The robot will need to reconfigure the position registers so the offsets reflect the reducing height of the pepperoni stack, as well as the next location for placement on the pizza. Pepperoni_Bot We have determined the main motion tasks required for the robot’s function. This is picking up the pepperoni, and then placing the pepperoni. These will be separate programs, to make our process easier to manage and understand. We have added a main program as well that will do all the math and set up all the registers for us, before calling each of the motion programs.

Frames: Requirement Frame Type Name The robot will need to know where the center of the vacuum gripper tool is, relative to TCP. Tool VacuumTool The robot will need to know where the pizza is placed to properly determine rows and columns for the intended pepperoni. User PizzaFrame Since we will be using a tool on the robot, we will need to tell the robot exactly where the tool’s effective end is. Since we will be working entirely within X, Y, and Z (no rotations needed) the tool frame 3-point method will suffice. Set up your tool frame with the 3-point method, name it VacuumTool, then change your selected frame to the number of the frame you made. The pizza could be placed anywhere within the robot’s work envelope. We need to create a user frame that is aligned with the first pizza we will be teaching, so any new ones can simply be adjusted later. Again, since we will just be working in X,Y,Z with no need of precision, you can use the 3 point method for the user frame you create. Use the name PizzaFrame. Make the Y axis align with pepperoni rows and the X axis align with pepperoni columns. Before you begin programming, change your coordinate system to user frame.


Motion Program: Pick_Pepperoni Point Description P[1:Above_Stack] A point above the stack, allowing for XY travel without interacting with the stack. P[2:At_Piece] A point touching the topmost piece. Our first motion program will be Pick_Pepperoni. It includes the instructions needed to go to the pepperoni stack and grab a piece. While there only actually needs to be one point taught, as the “Above_Stack” height could just be an offset of the “At_Piece” position, it’s just simpler to use the two. We will have to organize our motion and IO instructions to move above the stack, then move down to the current height of the top pepperoni, turn the vacuum on, then move back above the stack. J P[1:Above_Stack] 100% FINE L P[2:At_Piece] 100mm/s FINE Offset PR[17:Stack_Height] RO[1:Vacuum] = ON L P[1:Above_Stack] 100mm/s FINE Note: The choice of motion types is important. The Joint motion to get to the stack will ensure the robot can get from the stack to the pizza, regardless of position. The linear moves down to/up from the stack ensure the stack won’t be disturbed in the XY directions. Motion Program: Place_Pepperoni Point Description P[1:Above_Pizza] This point is above, but not touching the pizza. This allows XY motion without crashing into the existing pepperoni pieces. Figure 15 mm above. P[2:At_Pizza] This point is at the placement height. Our other motion program is Place_Pepperoni. This will include all the instructions required to deposit the pepperoni the robot is currently holding (from the Pick_Pepperoni program) at the desired position on the pizza. We will be using the position register PR[18:Pizza] to offset our destination positions. The contents of PR[18:Pizza] will be written ahead of time in the Pepperoni_Bot program. J P[1:Above_Pizza] 100% FINE OFFSET PR[18:Pizza] J P[2:At_Pizza] 100mm/s FINE OFFSET PR[18:Pizza] RO[1:Vacuum] = OFF J P[1:Above_Pizza] 100% FINE OFFSET PR[18:Pizza]


Main Program: Pepperoni_Bot - Setup PR[17:Stack_Height] Keeps track of pepperoni stack height. PR[18:Pizza] Keeps track of where to place the next pepperoni piece on the pizza. R[70:Row_Pieces] Keeps track of how many pieces have been placed in our current row. R[71:Row_Select] Keeps track of how many rows we have placed on the pizza so far. The beginning of your Pepperoni_Bot program should set registers and IO you use to known values. Typically, this means setting them to zero, but you can start at any number that makes sense to your program. In this program, we will set everything up as zero and OFF. PR[17:Stack_Height] = PR[17:Stack_Height] - PR[17:Stack_Height] PR[18:Pizza] = PR[18:Pizza] - PR[18:Pizza] RO[1:Vacuum] = OFF Note: You may not know all the registers and position registers you will use in programs you create before you start writing them. This is fine, as you can always add more to your setup section later. Keep track of them on paper as you use new ones. Additionally: The robot could be in any position when the program first starts. Many of these positions could cause issue if care is not taken before running. To ensure the trajectory of the first motion is always consistent, we add an instruction to go home at the start: J PR[1:Home] 100% FINE These instructions won’t be part of our main loop, so it will only run through them once, when the program is first started. Everything we want as part of the main loop will have to be below the label chosen to mark the main loop’s beginning: LBL [1:Loop]


Main Program: Pepperoni_Bot – Loop Requirement Action Pick Up a Pepperoni Call Pick_Pepperoni Consider the stack is now lower Reduce Z in PR[17:Stack_Height] by 1.8mm Place a Pepperoni Call Place_Pepperoni Consider the next row position. Add 35mm to the Y element of PR[18:Pizza] Check to see if the row is done IF conditional to see if the Y element of PR[18:Pizza] is now outside our pizza Check to see if the pizza is done (repeat if not) IF conditional to see if the X element of PR[18:Pizza] is now outside our pizza This program exists to run the motion programs and configure the offsets for each loop. Since we taught the points for Pick_Pepperoni at the first location, we will run it with nothing in the offset register: CALL Pick_Pepperoni Every time this is called, we need to reconfigure the offset register to reflect that the stack is a bit lower now. We’ve chosen 1.8mm as the height of the pepperoni, so the stack is reduced in height by 1.8mm each time: PR[17,3: Stack_Height] = PR[17,3: Stack_Height] – 1.8 Now it is time to place the pepperoni. Since nothing has yet been written to PR[18:Pizza], nothing will be added to the placement position and it will place it at our originally taught first position. Call Place_Pepperoni Every time this is called, we need to reconfigure the offset register to reflect the next desired placement position. This is +35mm in the Y axis. PR[18,2: Pizza] = PR[18,2: Pizza] + 35 After it has placed 5 pepperonis, we don’t want it to place another in that row or it will be outside the pizza crust, so we’ll add a conditional to check the position and alternatively start a new row entirely. This means starting from the original 0mm Y position but 35mm further in the X axis IF PR[18,2: Pizza] < 140 JMP LBL [2: SKIP] PR[18,2: Pizza] = 0 PR[18,1: Pizza] = PR[18,1: Pizza] + 35 LBL [2: SKIP] Now we have it making new rows every time one is finished, but there’s nothing yet stopping it after it makes all 5 rows. We add another conditional to check if it has occurred and END. If it hasn’t, keep looping. IF PR[18,1: Pizza] < 140 JMP LBL [1:Loop] END