Robotic manufacturing course: Part 2 - Robot Arm Setup for Cutting ( Rhino + Grasshopper )

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hello hello hello welcome to part two of our series well actually it's part 2.5 because i did such a bad job recording part 2 that i just decided to do it again and re-upload it right so this is something that i'm doing the second time hopefully it's going to be better so in this part uh we are going to focus on the robot and focus on um basically creating set of instructions for the robot arm to move right and we will do so by using a plug-in that's called robots right grasshopper plug-in called robots the way you can get it is by just googling for grasshopper robots there we go and the first output that or not output but the first search result that you get is the one that you want you open it up it will open up this github page you scroll down download the binary from the latest release you click on that and here you have the zip file that you can download right you download it you extract it and you're good to go why is this so dark be less dark no this is even darker instead let me make this lamp brighter okay so that's that's that now once you have this downloaded and extracted into file special folders components folder into into this folder once you have that done um you will still not be able to use it and the reason for that is that the plugin is basically like the brain um but it needs like a library of robots for it to actually implement the logic onto right and right now since you have just downloaded the zip file you don't have that library of robots so you need to get one how do you do that well the github page actually does have somewhere here i don't remember ah there we go robot library it does have the robot library here which you can get you know the bartlett library the aaa and here they are just listing what kind of robots they have so you might be lucky and just get one from this list in our case um i i believe we have a a robot from penn state let me see yes penn state irb 2400 so this is like a a robot that we need and the way you get it is by just downloading it from the video description because i'm gonna put a link there in in the video description so that you can get this um get this precise robot so basically once you download it it's going to be a zip file right that that you get once you have that downloaded you need to extract that zip file into your documents folder this is for windows users by the way i don't even think that the robots plug-in works on mac so your documents folder you need to create a new folder called robots in your documents folder open open it up and extract it and oops don't need that and at that point you will get your your your files here uh so meaning that that your library is basically placed right and now the robots plug-in has access to well in my case it has access to uh all robots that innsbruck uses all robots that penn state university uses and all robots that uem i don't sorry i don't know which ones which school it is but we also have their robots i guess once you restart rhino and grasshopper everything is you'll be ready to go right but but before we begin in the video description again you will see another file a rhino file and that file will contain um one very important thing that you will not be able to do by yourselves because the the way we created that thing was through measurements that we had to do in real life right and that thing is this tool together with the tool holder right so let me actually hide this robot so that it's not in the way and just show you [Music] oh where are you hiding hello selected there we go [Music] this little guy right here this tool holder right so this is going to be um added i guess to your um to the file that you can download from the video description um and also uh i will be adding a box here so that you know the placement where the robot expects your uh material to be because that is also kind of measured in real life where we will be placing the stock material to cut out so those two like there's going to be a box here and there's going to be a tool here right or or kind of multiple geometries here okay and now we can begin right so let me actually disable everything here or disable preview of everything here and let's just take a look at i don't think we need this no we don't uh let's just take a look at this [Music] oreo is just yeah that's fine uh let's take a look at the setup that i have right i have my my element here ready to go and my element is separated into two parts i really don't care about the bottom half of it i only care about the top half right because th this is the surface that is going to be actually cut by the robot while the sides are we don't care actually to visualize it even better um bounding box scale 1d just give me a second 100 millimeters silhouette and lock like th see these green lines of greens and gray see these gray lines they are the boundary of the stock material that we will be that we will be using right so these are very important these boundaries are very important to to have because um you will see if your design actually fits in in the in the geometry in in the stock right if the stock is not too small for your design okay enough blabbing also i noticed that i made a little bit of them of a mistake uh this whole stock needs to be moved down uh so that it meets you know the top ridge here the reason why i'm doing that the reason why i just moved down the stock so that it reaches the top ridge is because i want to remove least amount of material possible right because less material you remove less cuts you need to make less cuts you need to make the faster it goes so that's my stock i'll do the silhouette again select and lock delete just so that you can see better now we can see that we will have like a thickened bottom but that's that's fine for me for me that's okay okay sorry need some coffee so to begin with grasshopper the first thing that i'm going to do is i am going to create the brain for the plugin for for the whole simulation i'm i'm going to use this as my node notepad right so if i forget anything i can kind of come back here and check it out right so the brain for the simulation the brain is called program and actually let me show it to you through the top menu right so robots plugin components uh create program oh come on is it not there i'm sorry wait load robot system create speed create program yeah yeah great program we're using this bad boy right here and for it actually me just do that you don't need to do this this is just for me to show you the the names of it okay so this is the brain the main thing that will simulate how the robot will move while cutting this piece right for it to work it needs multiple inputs right and also it has multiple outputs let's go through the inputs the first input is the name the name is literally just text so we can just create a panel and i can so the shortcut for creating a panel this slash slash and i can also write its name so slash slash [Music] tutorial 2 enter and then connect it to the name input here so that's done next one is robot system so what kind of robot are we dealing with this is you know the library part so i'll go to components and i'll find load robot system click that plug it in and here i'm just going to choose the robot that we're actually going to be using so in our case it's penn state irb 2400 this beauty right here um there's also like a origin plane but we are using our base x y as the origin so don't mess around with that this is just basically to move the robot okay now it's asking us for targets so how do we want the robot to know towards where do we want the robot to move and also what kind of alignment should the robot arm have as it's moving to that point so a point with alignment is literally a plane so it's asking us well a little bit more than asking us to give it a little bit more than just a plane but it's basically plane and also how fast do you want to move to the to that plane right and with what tool so we need to create targets okay we can do that uh create oh sorry i'm writing i i said that i'm gonna show you on the screen components create target bam like that a very simple one just asks for planes we will need more than that so first of all let's let's connect it to targ as target one right and here i'm just going to show you different ways of how you can create targets so instead of planes instead of using planes i'm going to say i want my my target for the robot to be described through the rotation angles of all of its joints so it has six joints in total joint one joint two joint three uh joint four joint five and then this little doohickey is joint six right i believe i i listed them correctly i think i did so basically six joins right so for this target i'm going to use that how do we do that i right click on the node right click and i choose instead of [Music] like the the regular input i'm going to choose joint target joint target right and here it's asking me now for joint rotations and radians so as i said we we will have like six numbers right for every joint and let me just double check how i did it here because i i did it in a uh this is so ew that that so all of that needs to be after the comma that's fine then tool speed zone okay sure sorry about that needed to double check so joins it needs six numbers right we can give it six numbers so let me just create a slider between uh let's say minus 180 dot dot 180 i believe that's how we do it right yeah yeah minus 180 dot dot 180 will create a slider with those bounds right and i will do six of them two copy paste or six one for every joint right and now i am going to add them all into one list by using merge [Music] oops that's d1 d2 d3 d4 d5 d6 and we don't need d7 so i oops you don't see it we don't need d7 so i zoom in and i minimize it collapse it when you zoom in you can collapse things by the way in in certain nodes so we have six nodes or not six nodes but six values right and now they are in one list right here and the reason why i checked was because i wanted to see how does this target joint target how does it want the values to come in and apparently it wants the values to come in separated by comma so instead of as having text listed like so right we want the text to be 180 minus 180 comma minus 180 comma minus 180 comma in one line right so how do we do that we use text join command text join or note text join we join up our list like that and we use for fragment separator i will use dash dash comma this is not a dot this is a comma by the way that i wrote i know that it's it looks like a dot it's not it's a comma very important and then click anywhere no don't click anywhere i'm stupid slash slash comma enter all right there's it's a comma okay and now we just connect it to the join the joining the fragment separator sorry and now the output of this is going to be one line that says minus eighty comma the city blah blah blah right if i start moving this around you will see the numbers change right okay so now this can be attached to create target perfect easy easy this is red now it's freaking out why is it freaking out it's gonna say warnings in program errors in program right it's basically giving me warnings and errors warnings and errors are spewed out here in these two outputs so let's check them with the panel this panel for the warnings and this panel oops copy paste in this panel for the errors so warnings will still basically warnings with warnings we still can simulate it's fine it's just giving you a warning that something is a little bit off but it still can work with errors it just collapses it doesn't simulate anything right so it says errors in target 0 out of zero uh out in target zero of robot zero so target zero is literally our you know first target this one so errors axis one is outside of permitted range axis two three four all of the axes are outside of permitted range because we are doing minus 180. um i believe we can do we can play around with this so let's first move this this this slider until axis one is satisfied right [Music] see here it was happy so for now let's just do zero degrees because now with zero degrees i can see that axis one is happy x is two also zero degrees makes it happy i guess we can just do all of them zero right yeah and with all of them being zero the robot is indeed happy well except for one tyrants have their tools set to default uh so basically a warning that says that the tool is actually not hasn't hasn't been attached right and we do have the tool here time to actually attach the tool okay how do we do that well first of all where do do we attach the tool you will notice that here in my in my example i have more than one input i have four inputs move speed zone and one input that's called tool how do you get those well for create target if you right click on it here you can tick mo you don't see it [Music] here you can tick mark any tool that you not tool any input that that you want to have so in this case i want my tool input right click i want my speed input right click on the node i want my zone input these four or these 3 plus the initial one right so now like that so now for the tool input let's create a tool components create tool like that i will take the tool output and connect it to here like this and now we can start messing around with it so there is one thing that now when i say say there's one thing that i still need to kind of do but that that's fine you will receive it together with the file uh so don't worry about it let me actually just do this real quickly so that you don't need to come on plane there we go how does it bake out yeah that's perfect okay that's it uh don't worry about it you will receive the file together with this little rectangle here this rectangle is going to be important so let's start first tool name slash slash hot knife hot knife connect easy second input tcp plane tcp plane is basically imagine that your tool is a needle right so the tcp plane is where is that needle pointing at if um if it's if your whole tool is resting flat on x y plane that so there is like the xy plane there's the holder number number one there's the in between like thing and the holder number two and the handle for the tool and also the sorry handle for the wire cutter hot knife not wire cutter handle for the hot knife the hot knife blade and then the tcp plane is basically where is the blade pointing at if it's resting in that position very a very important little plane to have right because it gives you the orientation of the tool as well as the positioning of the where the tool is pointing so how do you get it you zoom into your files to your tool you select the surface and you reference it in as a surface surface right click set one surface this bad boy right so now this is referenced in into rhino and we will extract a plane from the surface because this is super flat right so it's easy to get a plane from it i believe if i just do plane let's see no we don't do that you can see that the plane gets oriented here we want it right in the middle so we don't do that instead we do is planner yeah is planner that this one right here test that whether a surfaces planar we connect it we get the plane yay and then we connect the plane output to our plane input right here that's it we we have it going so this is our tcp plane i have no idea how it's actually translating like what what tcp means but at least i i think i did a fine an okay job explaining it now we have more inputs calibration 4slist we no we don't do that here we do that with the robot not with grasshopper so we don't care at all we do that with the robot very important next one weight how heavy is the tool i don't know like two kilograms i guess is this in kilograms yes in kilograms so i'll just give it two probably less probably like a kilo but let's just do two kilograms just to be safe then centroid optional tool center of mass we don't care because it's only two kilograms like this machine can handle much more than that right so centroid is whatever and last one is tool geometry as mesh so we need to reference in our tool without the surface by the way without this little surface so you select all of it in right in grasshopper you create geometry node you set multiple geometries bam and you reference in all of those geometries except for the little guy there right so now they live in or they are linked to your grasshopper file and we want them to be one single mesh right now they're like all over the place three b wraps two meshes one mesh pretty heavy so let's actually mesh everything mesh v-wrap um that's shitty let's just do mesh like that so now all of them were converted into a mesh and now i'm going to join mesh join sorry i'm going to use mesh join like that and by the end of it we have a single mesh which we connect to the mesh input here let's hide let's actually hide everything like that and congratulations let's select this group it so you select all of the notes here you click your scroll wheel and you select the fidget spinner the green fidget spinner select it you made a group you right click on it you choose color and you come on camera is in the way actually camera gets in the way too much let me do this okay um where was i right click color let's make it white right click on the group and now here you can rename it and let's just call it tool good band by the way really good band anyway we have our tools set up it's going to be used for everything that we do um from now on uh so next two inputs speed how fast it moves and zone how um how accurate it is so a zone is basically you telling the robot how far away can it be from the target to still register as have success have been succeeded in touching the target in reaching the target if you have a zone of two centimeters and the room robot kind of places its knife two centimeters away from your wherever you want it to be it's going to still think that it's okay if you want it more precise you change the target to two millimeters for instance right so for the zone here i believe we can use uh what's here zone is two millimeters let's do zone of two centimeters probably a bad idea actually a really bad idea oops you don't connect it there i'm stupid sorry you don't connect it there you connect it here to zone actually like that and let's not use 20 20 is we want this to be pretty accurate so let's use two millimeters yeah the last one is speed so how fast does the robot move as it's doing the action uh anything above 250 millimeters per second is dangerous so let's do 150 or let's do 250 no let's do 150. connect that to speed input and that is basically and and and the tool needs to be a little bit away from the rest of the group because we will be we'll keep using this so we need it kind of separated from from the the pack and that's it that this is our initial like first target being created which we described through the movement of or the rotation of joints shall we play around well i guess before we play around we need to actually visualize it because the program itself doesn't visualize it so i'm going to go to components and i'll choose program simulation like that i'll connect program to program like that and you can already see it and i will connect time okay time time time so time is basically if you have the overall length of the program right that that that's going to be running on the robot uh the time goes between 0 and 1 right so 0.5 you'll be right in the middle of it so i'm just going to create a slider 0.5 0.500 [Music] and connect it as my time input so here as i'm moving it you can see nothing changes and that's the reason for it is because i only have one target so there's nothing to go through right it's just okay this is my target that's done right there's no time when you just have a single position that it needs to be at it just it just stays at that position that's fine um and now last one is actually making this prettier so i'm going to create a swatch color swatch and preview custom preview so i'm going to take the mesh meshes and i'm going to give them a custom preview with the color swatch just like that okay there we go actually i'm leaving this not disabled and let's not do white let's do like something less boring yeah blue so and now my actually my webcam needs to go here because you need to see the whole thing so now the reason why i'm not hiding the original robot from here or not the original robot but the initialized robot from here is because th this robot is this is showing the resting position of this particular arm setup and mine is definitely not a resting position so with these sliders i will i will force it into a resting position so we'll start from d1 right oh wait why is this go why is this ripping so so fast there's something off if there's something off you always go into your your your great target node and you start reading what it says what the input asks you so if i read this joint rotations in radians not in degrees so here i'm describing it in degrees and here it's asking me of it in radians doesn't work i need to create degrees to radians tool wait this is stupid let's just write radians yeah yeah there we go radiance this node right here and i connect a merge like the merged degrees to this tool or this node and it's it will spit out radians that i can connect to text join right so it just goes in between and now this little guy needs to be a part of the group so to attach it i just select it make it green right click on the group and choose add to group and now if i move it you can see that the group adjusts just a little visual thing okay now this should work if i rotate this or if i move this it doesn't rotate fast it rotates much slower right and it actually follows the the degrees that i'm giving it so actually joint one is fine joint two let's see joint two yeah this one needs to be 90 degrees up like that i think all of the rest are gonna be okay what did we use here 90 oh yeah that this this needs to be fixed huh okay i'm sure sure sure sure sure let's see minus 30. all right right so sorry so penn state uh did this robot in penn state this is indeed the resting position of of this robot but what we want for our tool is we want the tool to kind of rest a little bit down so that's easier to to access it so we're doing -30 degrees here we're just basically just moving the tool a little bit down to get access to to the stuff here and also there's a lot of wires dangling so we don't want to put too much strain on the wires and also this gets upside down i believe 180 right yes 180. so this is the the resting position that we are after okay because we are going to be cutting with the long boy with the long edge here right so what we initially did right now is we created the first target that the robot will always need to reach before beginning a program right so before it starts to cut it reaches the this is like the homing position it reaches its resting position which is like so by the way the the whole script is going to be available for you to download the description just just so that you know moving forward we we need more we need more uh targets right because now we we need to start cutting the way we start cutting is actually uh pretty simple in in its in its initial idea right because we have um we have this surface that this tool needs to somehow interact with right so we definitely need to reference in this surface and for you it's going to be something else some sort of a different surface but it it's the surface that you cut or in my case polysurface i will reference it in as geometry geometry node right click set one geometry done then i will create a bunch of points on it just like we did in the simulation of how it would look like when it's cut so i'll make a bunch of points populate geometry and you can see how how much of a space i'm giving it that's because i just remember how much of a definition it's gonna need so geometry i'm gonna populate a bunch of points on it and by a bunch of points right now i'm just gonna do like three just three points we will increase the amount of points later because right now we it doesn't matter if it's three or if it's 300 right if something works with three points it's going to work with 300 points other inputs we don't care about now these three points will basically be where we will touch with the knife where we will touch the surface right the question is how do we touch the surface does it just go um wait does it just go in and just right that's not good right so instead we're going to do an arc that goes in and out and also it goes in at an angle and out and then comes in from another side at the same angle only negative and also does the same arc so that's this kind of a by the end of it a moon shaped element will fall out right or or a ship hull shaped element will fall out at least that's the that's the dream um so we need arcs how we how do we do an arc well well first of all let's hide the the tool for now we don't need it we don't need to see it so i'm just going to disable preview of it and let's uh hide everything that we have here for a bit and let's actually draw an arc which will need to be aligned sorry i'm i'm thinking out loud i shouldn't think out loud i should just check my notes so it gets aligned with y direction why is that it shouldn't be it should get aligned with x direction okay so we are going to create an arc that follows the x direction right i'm going to actually use points for this i'll start i'll create a point at zero then holding down the so you just create a point tool or click the point tool create a point uh type in zero hit enter it's gonna make a point at exactly at zero it needs to be exactly at zero i'm going to hold the alt key this is weird go away i'm going to hold the alt key and i'm going to click on the x axis arrow and i'll type in let's start with 50. 50 millimeters 50 millimeters to the left and 50 millimeters up left up right so we have uh kind of we have our second point right and actually let's get it on the other side as well so that we have like point of uh the point that begins or i know that i'm all over the place bear with me let's move it up 50 millimeters more i'll explain why in just a second but it's basically a hundred millimeters up and 50 to the along the x-axis and now let's holding down the alt key let's copy it backwards hold the alt key click on the gumball x arrow and copy it backwards by minus a hundred so that it's basically mirrored right then then we will go in here into the curve tool thingy and click on the small arrow where it says curve interpolate points we select that curve interpolate points or interp crv if you want to be fancy about it and we just click on the this point right here as the first one second one third one enter interpolates a curve through these three points we don't need the points anymore we delete them we have our path the way it's going to work the knife is going to come at this point right here and it's going to slide along the curve until it touches the the bottom of it and then it's going to move up again right and it's it's going to do that at an angle here and then at the negative angle from the other side right so the idea is that i can show you and like that loft you don't need to do this by the way this is just me showing you so the idea is that this is going to be how the cut cutting geometry looks like right okay we only care about this so now i'm going to take this curve and i'm going to reference it in [Music] crv as a curve let's get it a little bit closer right click set one curve bam that's that's done that's that was fast um now we will how do we deal with this so now we need this path curve to be moved from here on to these three points that we have generated the point here the point here and the point here how do we do that we create orient node an orient node and we're going to orient the curve from the world x y because that's where we created it right so we don't need to input anything into our source plane but our target plane is going to be these points but points are not planes we need to create ones and i'm just going to be lazy i'm just going to create an x y plane for every point you can see these little things you can actually make them a little bit bigger let's do 24 pixels there we go you can see these planes here right and now if i orient to those planes you can see the curves being created yay sweet um i want a little bit more of an input here so i'm going to before i connect it holding down the ctrl key i'm going to disconnect before i connect the planes i'm going to rotate them rotate plane so wait that's the wrong one rotate plane there we go that's the second one right rotate plane we connect the plane to the p input and the a input is our rotation angle uh so let's say somewhere between minus 180.180 something like that and now as i rotate them let's zoom into this one as i rotate it you can see that it's spinning real fast we know what that means that means that this is it asks us for radians and we're giving it degrees so i'm going to right click on the a input and i'll choose degrees here and now it's spinning properly right so now i can control the alignment of the planes and let's disable the preview of the previous one so that it's not in the way anymore right and i'm going to use it to orient the path curves like so as and now as i change the angle you can see that i can adjust the path curves the angle of the path curves this is important because this will dictate the pattern that we will get right so i will for this one i will do like 135 something like this because i think this will give a pretty nice pattern and also you can have more you can have less i would create the definition with three and then increase the slider dramatically later okay next let's disable preview of everything and continue working on this we have our curves the problem is that as we as i already told you targets for the robot doesn't want curves it doesn't care about curves it wants planes we can't give it curves so i i need to somehow create a bunch of planes on these curves for this to work let's let's begin i'm going to take these curves that that we oriented that we got by orienting and i'm going to divide them the white curve i'm dividing them and i'm going to divide them by count of let's do 15. actually it can be any number but i don't think we need like this insane amount right i think 15 is reasonable maybe even less is fine but 15 seems to be reasonable so that's our divided up curves and what it gives us it gives us points so uh actually it gives us 16 points so this is like a weird thing where here it says 15 here it says 16. uh the reason here it gives us 16 points per curve the reason for that is um let me just quickly explain imagine you have a line right and here you say i want to divide it into two segments right and the line has the start and the end right and then you divide it into two segments right so you put a point here how many points does the line have not two it has three right so let's say you want to divide it into four segments right so you put two points two more points here the line then has five points with four segments it will always have one more point than it has segments this count is how many segments the line has meaning that the output of points is going to be plus one always important to to know okay moving on we don't care well we do care about the points but we much more care about the tangents and the way we will work with the tangents is how do i explain this so the tangents are going to okay let's do it this way forget about this just for a second i'm going to show you one um i'm going to show you how the robot reads a plane and how it orients itself to a plane and for that for this example i will need to create a rectangle or i'll just create a plane here in rhino just a surface um just this little surface here because it's very easy to extract a plane from a surface that's why i'm doing it this way i'm going to reference by the way you don't need to do this this is just me explaining surface surface so i'm going to go fast is planner like that set one surface bam we get the plane in the middle target create target and that's our oops that's the wrong one that's our target plane and and end and and right click speed input i do want speed and i do want the tool here just bear with me for a second that is not where this needs to go this needs to go here and for the speed uh 115 let's just do a fast boy 150 and now uh first this target then this target so i merge these two first this then this then these come in okay so now technically the robot should be able to touch this rectangle right this exact plane and it doesn't matter where i place this plane well okay it matters if the robot can't reach it it matters right but the the robot will always try try its best to touch touch the plane right and how does it touch it for that we need to zoom in and we actually need to investigate or check out the plane itself and you can see here that the blade is aligned with the x axis of the plane that's very important to note right and we want to move in negative x direction with the blade because this is like the cutting edge so we want to constantly be moving in the negative x direction right so this is how the robot interacts with the plane show or sorry show selected this bad boy delete it and i'm going to delete this real quick just because we're not at that stage yet i'm going to show you how to create that this was just me for me to explain so on these we need those axes and we need the and the planes also describe how the robot will attack the element so i want to get rid of the unnecessary bits so i want to my planes to be flat flat meaning horizontal completely horizontal but they need to be aligned to follow the curve how do we do that well we have this thing called tangents right and we can use it to create a plane so for instance i can show you an example a construct plane construct plane origin tangent goes into x right constructs planes that follow the curve but in a very crappy way because just imagine the robot trying to kind of reach this and it kind of makes this whole weird bend like whipping we don't want that we want the robot to always look down as it's cutting right so this doesn't work we need to somehow readjust it and the way we readjust it is by changing the tangent by the way the tangent is basically um i can show you [Music] like that just a second i'm showing you what the tangent is visually much easier than explaining so a curve from every point has a direction and the tangent is that direction right along the curve so it's aligned with the the curve at that particular point that's the tangent right and here i'm just increasing the length of the the curve sorry of the arrow nothing more than that right so that's the tangent and i can use it to construct a plane right because we have the start of the plane the origin and we can use this to create an x-axis but as you can see as you saw the x-axis then tilts and we don't want it we want the x-axis to stay horizontal how do we fix that well we actually very easy we deconstruct a vector [Music] we construct vector because a tangent is a vector we deconstruct it we get our x y z components and all we need to do is instead of its z component we need to write zero so we construct it again uh vector by the way construct vector construct construct oh come on back thor cons truck is it just a vector x y z yes i'm yeah vector x y z so it is and here we just feed in x is fine y is fine that is not fine so for that we feed in zero this is just a like a panel zero or you can do a slider zero doesn't matter you just feed it into z like that you get a new vector let me show it to you [Music] like that like that this is the new vector right the the old vector is that right so the change in their x uh alignment right and the new vector or sorry in the reset alignment and the new vector doesn't change in the z it only changes in x and y perfect now we can use this this vector to create a plane construct plane like that origin goes in here x vector x goes in here vector y for vector y we actually need to uh how do we do this we need to rotate the vector right so we need to uh let let's just say even though rhino can guess what we want to do right because we are giving it the um we're creating a a plane by giving it the center point and we're giving it the vector x right so it kind can kinda guess where that vector y is going to probably be here but sometimes it's going to if we leave it to be automatic sometimes it's going to give us vector y in the wrong direction right so it's going to flip it and we don't want that to happen so i'm going to take this vector and i'm going to rotate it rotate uh the one that shows an arrow being rotated important that you choose this one rotate that vector and i'm going to rotate it around an axis that is said to be that axis like that and the angle of rotation oh at this point you should know right click choose degrees and the angle of rotation is going to be 90 degrees or minus 90 i don't remember we will fix it if it's wrong and that becomes our y you can see that nothing changed but trust me you want this little [Music] let's say insurance this little insurance you you want it to be there because if you don't have it stuff might start stop working okay so now we have a bunch of planes right and the planes by the way the plane x-axis is aligned with the curve which is great that means the the blade is going to be running through it but the problem with it is how do i well it depends it depends if this is the start of the curve then it's fine because we remember when i when i said that the movement needs to be towards negative x like towards here not towards towards positive x the movement of the of the blade so if it starts here we're fine if it starts here we will need to work a little bit more on it or just flip the curves but i think i think it's gonna be fine um for now i'm gonna keep it the way it is we have ourselves a bunch of planes let me check what else did i do oh right right remember where i showed you that we need two cuts this is only one right this is where it gets a little bit more tricky a little bit more advanced here we have three uh curves you can see they're like zero zero zero zero zero one zero 0 2 those are curves and in those curves we have 16 planes attached to those curves let's see it like that right that's the n16 part those 16 planes need to be rotated to the left and rotate it to the to the right so that we have that kind of a nice cut from both sides so we will we will need to do rotate 3d on those planes and i'm going to i think rotate 3d right yes yes and the geometry that we're going to be rotating are going to be the planes like that the angle and also we're going to be rotating them to the um to the left and copy paste to the right so we will have two rotations the angle is going to be in degrees not in radians so i'm right clicking on the angle choosing degrees here angle degrees here and here i'm going to say okay 15. we rotate them by 15 degrees like that right but that means here it needs to be minus 15 right opposite side so i'm going to say negative connect the 15 to the negative input here and connect that to the angle so every time this changes this number changes this will by the way don't worry what's happening on the screen that's not the problem um every time this number changes uh this input changes and this input changes in like a with a minus right so you get the same number only that's a negative number okay now we have two more inputs on both of these center of rotation so the center of the rotation is actually the center of the plane because all we want to do is we want to take this plane if you have a that's not how you draw if you have a plane right mouse drawings okay you have a plane like that and you want to rotate it right and you want to rotate you want to rotate it around this point around this axis anchored to that point so that this vector right here moves by 15 degrees to the right and then by 15 degrees to the left or in this case up and down uh whatever right orientation is whatever um so how do you how do you get that well whenever it asks you of the center of rotation which just use the same plane that we are rotating it needs to rotate around its own center right so we just connect it like so and then you can see here that it rotates in a weird way let me hide the plane so that you can see a little bit better right so the way they are rotating right now is they are rotating around the correct center point but they're rotating around the incorrect axis because the axis right now is such to be z up we don't want that we want them to rotate around the x axis right so that the blade gets tilted as it cuts so how do you get the x-axis of each of these planes you use deconstruct plane [Music] bam connect that connect the x axis to the x input here and x axis to the x input here and now moment of truth this thing should flap it does right so we have successfully rotated both roti rotating both of the planes right so i'm just going to keep it a little bit um like less aggressive 15 degrees should be good enough right for for for that and one last thing or not the last thing is it the last thing no it's not the last thing um the question is how the robot is going to move through through these planes right because now we have two separate outputs we need to somehow get them back into one list well we will just use merge merge tool that will force them back into one list like that and like that minimize and now they are back to being happy in in one in one list okay so now next up um the logic is like so or actually before the logic before before this portion right here before this portion let us create a target i'm going to create a target and i'm actually going to show you how the robot moves through these right so create target or i promise that i'm going to show it here components create target there we go right click we want we want we want we want uh what do we want [Laughter] yeah this does need to be linear motion right yeah so we do want linear motion uh okay i i think i know it great target right click on this tool input speed input zone input should be good enough these four first input is planes right because we're not using joint movement we we're using plane movement planes bam oh yeah one one more sorry one more uh motion input joint uh joint is basically you forcing the robot to move from one place to another by in in a linear motion so it just moves no wait sorry linear is when the robot moves from one place to another the end of the tool moves straight joint means that the robot might it will always take the shortest path with six axes the shortest path is never straight it's always like a you know kung fu style so for this we definitely want linear motion not joint motion okay tool we have a tool sorry i'm getting a little bit tired we have a tool we connect a tool to the tool input thus the tool will work speed for now we will use speed of 150. this is definitely not the speed that we will be using during the cutting it's going to be a little bit less than 150. zone in millimeters i believe we use two millimeter zone yeah so it's gonna be the same zone as what we used here two millimeters slash slash two enter this will not change that thus i am just using a panel and those are our targets so now the logic first the robot needs to access its homing position which is this right then it needs to go through all of the targets all of the planes in a linear motion right so a homing position and then the planes merge we use merge one little thing here that we will need to fix is the dashed line the dashed line means that a data tree arrives at the create target input so i right click on the p input here and i choose flatten to make sure that all of the targets are in one list rather than separate lists this this is all it does the flatten that's all it does it just takes a more complex data structure and just flattens it out into a single list you know first move here then move here then move here then up here okay we have our target here our target here this is the first target so it goes first into the merge and this is the second target list which goes second into the merge and then we minimize this and then it just straight up connects as t1 by the way there's like t2 we don't care about t2 we only care about t1 in the create program input okay shall we shall we investigate oh by the way no errors that's a very good sign let's start going through the time [Music] and then see how it changes but also is this fine no it's not fine so uh that's that's the first thing that i noticed is that while the alignment of it is correct right this is exactly how i want it to be aligned right the knife does follow the curve with its sharp edge the problem is that i want it to start here and to end here not other way around so we will need to we'll need to fix that how do we fix that because right now it's it's as it's cutting in it's cutting with the other other side right well one way to do it probably is to select the curve and and type in flip in rhino i don't think it's gonna it's the same thing right never mind it just works no it doesn't work it just flipped around the whole damn robot okay sure so we don't flip the curve that was a bad idea how do we how do we fix it let's come go back and let's investigate the planes oh now with the planes by the way you can since we can change the orientation and so on since there are so many values that we can change you can see how you know that the robot adjusts itself to whatever value you you give it we keep it as 15 here we don't care about this for now um we do want the plane to be flipped so this vector this vector right here this little guy right here needs to be reversed i will just use reverse tool right here reverse and connect it like so connect that to x and to basically just replacing it so now it's reversed did it make any difference whatsoever where is my simulation it feels like it did but i might be wrong about it yes it did okay great so now again from the start since i reversed the x axis now as the robot where is it there it is now as the robot approaches my curve you can see that this is the long edge right and it approaches the curve at an angle and it starts cutting it's going to cut with the long edge so all we needed to do was that tangent vector that we had we just reversed it so x got reversed in into another direction into opposite direction and now it works [Music] okay got scared there for a second so now we we know that this whole thing works and everything is in under control uh there are a few things that i don't that i want to implement thing number one is in between uh these curves as it's moving i don't want it to take the shortest path you know let's see it finishes cutting this curve and it moves to this one and then it takes like the shortest path to reach this curve i don't want that that's bad bad bad thing bad things will happen if we do that uh so i have created this rectangle right here or you can do let's do it ourselves so you just grab a rectangle tool you draw it on top of your stock material you lift it up i'm gonna lift it up like 50 millimeters like five centimeters above and i'll just scale it down to have it a little bit smaller and just so that it's not in the way so we have this little rectangle here and i'm going to create a plane in the center of it right uh let's let's work with it somewhere here between the target and the merge curve reference it in set one curve then is planner [Music] is planner to get the plane right in the middle and that is going to be where i want my robot to move after each cut how do we do that well glad you asked it's going to be actually a little bit more tricky than what we are uh what we're used to so i need to how do i explain this if i showed if i show the planes to you through the panel this is how it looks like right uh we have too many i can't show it like that let me show it through param viewer it's gonna be a little bit easier to see right now the merge all of the planes that we have on this curse are separated into three branches that's because we have three curves and in each branch we have 32 planes right so what i want to do is right at the start of each branch i uh sorry so you can read this as three separate lists if i here at the start if i create four then here it's gonna see data with four branches right so branch is you can just put an equal sign that it's the same thing as list right so data with four lists i want to add this middle plane the safety plan i'll call it the safety plan i want to add the safety plan to the start of each list so that i'm i know for a fact that before it starts cutting it will move to that plane and will move from that plane to that first um first curve right or our first point on the curve so i'm making sure that it's not going to scrape the the surface of my element how do we do that well we need to right now we have only one plane and here we have four paths we need to add um we need to have one plane for each path so i'm going to repeat repeat data i'm going to repeat the data i'm going to repeat the these planes or display in the safety plane four times because i have four branches and i could just write four here and connect it and call it a day but the problem is that if i then change this slider this i'll need to change this slider and also i could connect from the slider sorry from the slider right here which would kind of work but it makes a long wire i hate long wires so instead we are just going to ask yo how many branches do you have right and we can ask by using three statistics tool three statistics connect the merge to the tree input here and then for the output wherever it says count it's going to give us the correct output that we connect to the l to the length input so it doesn't matter what kind of a number i'm using this will always going to update and it's always going to kind of uh multiply how many planes i have the same plane it it's basically multiplying the safety plane four times right now great now next up is i need to somehow take this and add it to the to these lists i believe i did it in a very straightforward way that is not a straightforward way a much more straightforward way is if i just take this list i right click on it and i graphed it right so now each of the copies of the plane is is it is in its own list and the reason why i did that is if i do [Music] every time when i when i start talking about data structures it's tricky by the way on my channel there is data tree structures explained with ducks i believe it's ducks wait let me let me see just a second because if if you're interested in what the hell is going on with the data tree that's the video that i would suggest you watch because i really tried explaining explaining it through that video which i am currently trying to find um data trees raptures explained dax [Music] nope grasshopper data let's try this yeah sure that this is like a one hour 11 minute video of me talking about the the pram viewer and explaining everything through like visuals 2020-40 lth tutorials data trees for beginners rhinoplast grasshopper check that out where were we data trees we have four branches here that the data tree looks like that it's a pretty ugly data tree to make it less ugly you can right click and choose simplify and then it's going to become this i'm not going to explain why just trust me bro and then this one also pretty ugly this comes from merge i'm going to right click on it and choose simplify as well so now we can see that both data trees have four branches so there are four lists only that this one there's only one plane in each list the middle plane the safety plane and in here you have 32 planes in each list you know because those are on the curves i want to add the safety plane at the start of each of these lists so i'm going to use merge again so for d1 repeat data comes in for d2 because that's the you know i want it at the start of each list and then for d2 the rest of the planes come in like that zoom in minimize we're good to go now if i instead of using this merge if i connect the new one to the create target and go through it with the simulation what what what what and see how it's so it finishes up wait let me go back and now it goes through once it goes through twice at the different angles then it finishes up goes to the middle and continues on to the next curve always perfection okay we are done with this last thing that we will do is create is make sure that the movement that the robot arm does is fast when it needs to be fast right so when can the robot arm movement be fast it can be fast right when the right when it goes from one path to the middle right so it finishes up and goes to the middle to the safety plane and then moves from the safety plane to the uh to the first cutting plane here so the question is how do we um how do we implement that i will need to have two different targets that will play together nicely and i believe we used merch for that yes we used merge for that and let's say um let's let's think about this for for just for a second and while we think about this let's create that second target since i'm lazy i'm just going to take this and i'm just going to copy paste to get the second target and this this is going to be let let me just call this the uh cut slow targets that's not how you write targets but that's fine and i'm gonna color it color code it um [Music] let's go for this pretty peachy color and this one is gonna be color coded green and i'm going to call it move gotta go fast dash sonic tm trademarked okay gotta go fast so this one the the cuts low is going to be like 30 speed of 30 uh millimeters per second maybe let's do 50 because we can't wait that long 50 millimeters per second gotta go fast we'll be uh let's keep it at 150. what do we change with the gotta go fast uh with the motion of just not cutting but just moving first of all we change from linear motion to joint motion important why do we do that because when it needs to go through far distances from one cut to another it's much better to let the arm decide by itself how it rotates and sometimes find a better movement solution than to force it into a straight path the reason why we're not doing it here with cutting is because it might choose a path that is not the prettiest and it's going to just mess up our element while it's moving within the tolerance it's it should be fine and then the other thing that we change is the zone instead of two millimeters we don't need it to be that precise we do we use 20 millimeters two centimeters off of error we just needed to move to the approximate area and then start cutting so right as it moves to that approximate area is going to sorry right as it begins cutting it's going to become much more precise immediately and it's going to kind of snap in place okay so now now now now we will need to deal with these two and then merge them together but before we do that uh we need to decide which planes from here which planes from here are cutting planes and which planes from here are moving planes right just from this list uh the way i kind of the way i'm thinking of doing it is by actually just looking at the simulation and let's make it even more simple let's do count two only two curves okay let's see the let's see the behavior of it expand this so i'm going to move it very slowly in time okay so this is movement right this is movement and this is bam it touches target one meaning that the first plane should be regarded as movement plane right the question is what about the second plane right so it touched the target that's the first plane in every list remember we added it and now it's moving here bam was that a movement or a cut that is still a movement so the second plane in in every list is also movement so that one is also going to go fast and now every remaining plane in the list this one as well as this one these ones as well as these ones are uh cutting and now like this is the last plane of the list of the data tree uh sorry of the data branch and now it's going to start moving again right so again moves to the first plane here oh by the way jesus the the angle okay so it moves here that's the first plane again that's the second plane again and then it cuts so two planes first two planes need to be movement we need to extract them the way we do that is with list item list item so this merge we connect that to the list item and for index that we are extracting we get how do we do that let's do dash dash zero hit enter so this is the first plane double click on it hit enter to create a new line and type in one zero and one so in in grasshopper we count from zero meaning that uh if we plug in zero and one here it's going into the list item it's going to give us the first two items of the list and it's red the reason why it's red is because this it reads this as multiple lines of data so like a poem basically and it says yo i want numbers not a poem how do we i keep saying how do we fix that but how do we fix that well we right click on it and we choose multi-line data we and unselect that right we click on it so now every number gets placed in its own little list as as its own little list item and thus we create list item with first two planes here and those go in and connect to crate target [Music] okay what about these guys cutting slow so these guys are basically um an inverse of what we just plugged in right we plugged in these planes so the the cutting targets are should be everything else everything else except for these these planes so we can just use call index call index and call from the same list from the merge list call out these index indices like that and connect those to the cut slow just like that um oh yeah color is remove right color remove same same same logic okay okay i think we are we are kind of done right because we have our planes we have our targets oh we need to actually make them kiss again right so i'm going to merge first comes the movement then comes the cutting slow like that oh we i made a mistake i almost said we made a mistake no it's me who made a mistake here you can see that here it says flatten right i flattened it before we don't do that right now because we are going to be merging and it really messes up our data uh like yeah it messes up our data because we are still working with multiple paths so i'm going to right click and untick the flatten here and also also right here flatten off okay the hell is going on two robots yeah don't don't worry about that we're gonna fix it in just a second um by the way that's what happens when you don't flatten it's not even two it's like three robots um so unflattened data like the grafted data gets merged and then it gets flattened here at the output goddammit i just can't finish this tutorial notice how when i hover my mouse over the output it's a little bit funky right it looks a little bit weird and the reason for that is because the address is the address for the data streams is incorrect and why is it incorrect well that's because mcneil doesn't know how to code their freaking plugins no i'm joking i'm kind of half joking though because technically zero and zero zero are the same thing right it's it's the same thing one and one comma zero this is also it should be the same address it's not the same address because it this comma zero comma zero is trash that just got attached by i don't remember i don't know which i don't know why yeah call index just straight up attached some trash to the address while list item didn't attach attach any trash and now they don't work together anymore and we need to fix it thankfully the fix of it is pretty simple create target the t output you just choose to simplify so simplify gets rid of the trash t target here simplify gets rid of the trash now this works and now we have two paths we have two branches we right click on the r output and we choose flatten to get um those all of those planes into one list finally and we connect that to d2 here before it moves into the target collection for the main like create program node all right investigation time so i'm going to try and move this uh in a consistent manner so that you can see the speed the speed change right so one two three let's go [Music] and now it's slow now it's going to be fast now it's slow again there we go perfect okay so that works what's next next is well actually we're almost there because i'm not going to to show you this part this part is there's a python script and so on is very custom for the uh for what me and anton were doing um with with the robot so we're not dealing with this this is going to be on the on the teacher's side uh what what we care about is you checking out if the robot can actually reach in the nooks and crannies of your design right so this should be enough uh so there's only one last thing that i will teach you and that's checking how long it's going going to take so here t output of the program simulation is time in current time in seconds how long does the program going to take in seconds and i can just it's a number right so i can divide it i can take that number and divide it by 60 or by the way shortcut for dividing it by 60 is just divide divide like the i button symbol symbol for divide and type in 60 divide 60 enter and now by default whatever you input into a is going to be divided by 60. and we just grab a panel enter bada bing badaboom we got ourselves uh 0.43 minutes right so not even a minute okay but that's only two touches right it's it's only going to touch the the the styrofoam uh only here and here everything else is not going to be cut uh let me actually hide this not delete delete is a i hide hide this so you have a block and that's only the two parts where it touches the the block we need more we need at least i i don't think a hundred will do but let's say a hundred right a hundred this is how it looks like it's definitely not going to be uh looking like that let me disable that these are the paths so with 100 you can kind of start seeing you know that yeah yeah it's it's going to cut away something you know it's going to carve out something it's it should create a pattern but to be safe i will probably do like 200 and also with 100 it became 20 minutes that's that's the that's the tricky bit isn't it right at that point we change this up to 250 because that's the maximum maximum speed that we can get we change this up to let's say let's do 75 millimeters per second this is very fast but maybe we will manage it and let's do 250 here let's see how how much of time we have actually saved six minutes we've cut away six minutes so that means here we can do 200 because the reason why i'm talking about time is we are going to do a wall that is uh three panels by six panels by two panels right so let me grab my trusted calculator three times six times two thirty six uh let's say so with 200 cuts per panel we are at 28 minutes let's say to change the material and so on it takes two minutes right it's not gonna take two minutes but let's say it takes two minutes so 30 minutes in total 36 times 0.5 hours right half an hour 0.5 hours 18 hours divided by eight [Music] two and a quarter of full days of cutting we have four groups in total times four nine total days of cutting we can do we can cut two days per week maximum right oops four and a half weeks so that's going to be uh a little bit more than the month of of cutting if we do 30 um 30 minutes per panel this is why i'm showing you that the time calculation very important to keep it as low as possible all right i think we're oh by the way if you see rotation speed limit reached that's don't worry about it uh it's it's basically going to uh rotating a little bit slower than uh than what's described here but that's that's fine so this is our current definition that i am going to of course share with you um and you will be able to use it so please do okay i think this this is a better one i think this is a better version of of the tutorial i hope you've learned something with it if you haven't well too bad [Music]
Info
Channel: Gediminas Kirdeikis
Views: 886
Rating: 5 out of 5
Keywords: kuka, abb, robotic wire cutting, wirecutting, rhino, tutorial, grasshopper, gh, robot, lecture, free, hot, knife
Id: 6pJKKV-aWgc
Channel Id: undefined
Length: 108min 6sec (6486 seconds)
Published: Sun Sep 19 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.