FreeCAD Electronic Enclosure Using Simple Parametric Design Techniques

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] in this video we're going to go through how to do an electronic enclosure this is something i've made before again designed infusion but i want to have one that's uh parametric so i can just go in and change it move it around and make it to whatever size i need i've done several of them for the my mpc and c for enclosures to put electronic stuff in so that's basically what it's for if you make this one you'll be able to um just change the sizes to where you want it to be and the box should be good ready for 3d printing so i've created a sketch of where i want the dimensions to be for this box we're going to create it using a spreadsheet we're going to put the dimensions directly in the spreadsheet so that we'll have a fully parametric box to start with then we're in the part design workbench and i'm just going to show you somebody else that i show what version of freecad i'm using so it's uh 0.19 this is one of the latest builds i just downloaded it just to see what was new in there if you're not using 0.19 you're still using 0.18 i thoroughly recommend downloading 0.19 and getting the latest version because there's some great new features and some fixes in there too okay so as usual i'm gonna run this macro this is my macro for starting up what it'll do is it just fires up creates a new job and it puts in a new part a new body creates a sketch on the xy plane and then it asks me to save that sketch i'm going to save it as electronics box and save that now i want to just let you know that i'm using this new thing here that shows you what i'm typing over on the left here also highlights my mouse and if i click you'll see that it highlights which button i'm pressing so that's my left button that's my right button and that's my scroll wheel and that's what happens when i move my scroll well so um i am going to move my scroll right now because i want to zoom out a little bit so what we're going to do is we're going to create the box we know the rough box shape so we're going to select a box and we're going to create that shape and we know that that box should have some radii so we're going to put the radii on the corners and that's basically the outside shape of the box so it has a radius in each corner and we know that we have um we want it to be symmetrical around this center point so we're going to do that next so i'm going to select that point and that point the center point it did not kill the center point hold on one second that point that point and center point okay and i'm going to tell it that it's symmetrical around there now what i'm going to do is select holding the control i'm going to select that radius that radius that radius and that radius and tell them they're all equal because that's the way our box is going to look and then finally we need to put some dimensions on so we want to dimension for this radius and i'm just going to let it be whatever it says it is right now and then we're going to create a spreadsheet after this so let's just go ahead the outside dimension it's important that we go to this point and not this point because we want to be the outside dimensions that's our that's our length um just didn't get the point there we go we're on the point on the point say okay and then we're going to do a horizontal or a vertical dimension and grab the wrong point so i'm going to cancel that one i'll send it to the wrong point that point and that point say okay pull those dimensions out and like i said i'm just going to let those dimensions just be all i wanted to do was constrain the shape i'm going to close that i'm going to create a pad out of that i'm going to hit that guy so it's in the middle and i'm going to make my pad 15 for now that's because and there we have the basic shape so you can see the basic shape of the box and what we want to do now is to create some cons some dimensions in a spreadsheet so that we can start setting up the box the way that we want it so to do a spreadsheet we just go into the spreadsheet workbench and we create a new spreadsheet and we can tile that spreadsheet so that we can see alongside here and then from the sketch that i showed you before we know roughly what dimensions we want to put in here and how we're going to get to them so the first one that we have is the box length then we have the box width then we have the box height then we have the outside radius there's going to be an inside radius there's going to be a box wall thickness and i'll just move that across there and there's going to be hole diameter and lug height spell and the lug radius and there's going to be the whole center across the length the whole center across the width and there's gonna be there's gonna be a box inside length which we can calculate and a box inside width and we can calculate some of those so the first things we're going to do is we're going to just have some arbitrary numbers so we're going to say that box is going to be 200 long there's going to be 150 wide and we're gonna say the height of the box will be 75 and the wall thickness we'll say it'll be four and that hole diameter we're gonna say is six and everything else we can calculate yeah all the rest of these we're going to calculate so the outside radius is going to be equal to so it's going to equal the wall thickness which is b7 plus 2. and then the inside radius is going to equal the outside radius which is b5 minus the box wall thickness which is b7 and the lug height so the lug is that piece in the corner that has a screw in it and that lug height is going to be the box height which is b4 minus the box wall thickness which is b7 times two that and then the lug radius is gonna be the whole diameter which is b8 times 2.5 the whole center length is going to be the inside length which is uh we need to calculate that first so the inside length is going to be the box length says b2 minus 2 times the wall thickness that's b7 times 2 and then the box inside width is going to be the box width which is b3 minus two times the wall thickness which is b7 times two and then the whole center length is going to be the inside length divided by 2 so that's going to be b 13 divided by 2. minus the whole diameter which is b eight and then the whole center width is going to be the inside width which is b14 minus b8 so that should give us some sensible dimensions now what we're going to do is select all these and run that macro that i've showed you before so this macro is called easy alias and you can download it from um here i'm going to show you where you can download it from the add-ons so if you go into the add-ons and then you can download macros and you'll see it listed as easy area so it's down mine's downloading it right now but i'm not going to do all that on this video but just to show you where you're getting from so um i'm going to close that and i'm going to run this macro i have it in my recents because i just ran it and when i do that it makes these aliases so if i click on here you can see whatever's in this left is now the alias for this amount okay great so we have the spreadsheet all set up and we're going to leave the spreadsheet open because we can continue to add or remove or change things as we go along okay going back to the part design workbench let's go back to our model list go back to our sketch now we can modify this sketch so i'm going to double click on this guy click on that little guy there and i'm going to tell it that it is spreadsheet which is what our spreadsheet is called and it's box underscore length so there we have it and you can see it's that dimension so the 200 there's 200 there when i click ok it's going to change that to 200 and notice how this dimension now turns orange that just shows you that it's set up to be referenced in something i'm going to edit this one so that's a double click i'm going to click that guy i'm going to bring this guy over here spreadsheet dot box width box width there we go and say okay so now you can see i've got that height that width and then this radius which is my outside radius here again spreadsheet outside radius same okay okay and now i have everything per this guy here so i'll close that and we can quickly see that if i change this to 250 we're already um parametric so the other one we want to do is set this box height so that box height when we go into the pad the pad length is going to be spreadsheet box height and say okay so now my box is that height that width that length whatever i put in there is what will change it also has this outside radius of whatever i change for that now one thing i do like to do is we're going to put a third column in here so wherever i've calculated an amount i don't want to manually change that so i'm going to type calculated and i'm going to copy that and so this one if i click on it i can see there's a calculation there so i know that that's calculated the wall thickness is not calculated the whole diameter is not calculated the lug height is calculated the lug radius is calculated the whole centers are calculated and the inside length is calculated and the inside width is calculated okay so now i can see which fields i can modify or i should modify um and that will tell me uh or will remind me not to change the ones i've already calculated so what do we want to do now we got we got a cube with some radiuses on it but we need to have hollow inside so how do we do that we're going to do is we're going to create a new sketch and again we're going to create it on the xy plane i'll say okay and on this one i'm going to use this guy here which which says um show me a sectional view of my block so when i do that i'll be able to see the sketch superimposed here so if i draw the sketch now if i draw this guy here you can't see it but if i press that you'll be able to see it because now i'm looking at a sectional view so if i rotate that i'm only looking at a tiny piece of that cube okay so this is basically the same sketch so we're going to do the same thing we're going to put the radii on here it's all the same kind of constraints so we should just be able to do our symmetry constraint you have to make sure that it gets that inside so i'm gonna just zoom in a little bit so you can see so you gotta get those points that point and that point at that point i don't want to get this line i want to get that point and then hit symmetry and that means it's symmetrical this way and that way so everything looks good and then again we're going to select a lot of radii i don't know why they come out of all different sizes either i think it's where you select on the line but it doesn't really matter because we're going to fix them all so they're all even we're going to dimension a radii and this one we can actually dimension it because we already know it's called inside radius so we're going to call it spreadsheet dot inside radius say okay boom and now we have to be just a little bit careful that we select the right point so we're going to select this point and select this point and this is going to be our inside length so we're going to say spreadsheet inside when it says box inside length okay and you can see that box inside length is 242 and that's what that is there so okay and now we're going to do the same thing but we're going to do it on the outside end so this is a vertical dimension that guy and that guy yeah spreadsheet i'd start typing inside and it'll pop this up so box inside width say okay and there we go so now if we look carefully we have our box dimensioned and it's constrained and all our dimensions are per our spreadsheet and these are all calculated dimensions okay so now we say close now we turn that into a pocket and puck didn't do anything but we're going to say go through all and reversed and then we're going to say okay all right now we have a block with a big hole in it now remember what happened was i started my dimensions on the same x y plane so if i do that and i create a pocket it's going to go all the way through so to fix that what we're going to do is we go back to our original sketch and we just change our attachment and so we go so we're on the sketch we go to attachment we say position and we're going to make this position we're going to we're going to make it spreadsheet dot wall dot box wall thickness but we're gonna have it be minus when we say okay and we tap off there now it puts our button back in so now we have the bottom of the box and one thing a couple of people reminded me in comments is save your work so let's save it again make sure we saved everything i'm going to save the spreadsheet make sure everything is saved okay so now we have a box the box should be parametric so i should be able to change the wall thickness simply and that will change everything to suit and we have a constant wall thickness so our base is the same thickness as our walls on this guy and now we need to do is to create our lugs in the corners for each uh corner we want the exact same lug so let's do that and we're going to create a new sketch once again this sketch is going to be on the xy plane okay and we're going to put it in that same view that we had before and we are just going to rough out the shape so the shape is going to be something like that and something like that and then where the radius starts there goes to that point goes around to that point and then we have a hole in the middle it's going to be something like that okay then we can start dimensioning so one thing we know is that we can constrain a diameter so we're going to constrain this diameter and we have that over here so it's the whole diameter so that's going to be spreadsheet whole diameter and we're going to zoom in there a little bit and then we can pull that out a little bit so we can see that and then we're going to go back to our radius constraint we're going to constrain this one and we know this is the lug radius so we're going to go spreadsheet dot log radius say okay and so that gives us the lug radius is somewhere um proportional to our diameter there now i want to do a dimension that goes from let's see so you can see from the center of that to the top of that and that is going to be spreadsheet hole diameter so we're just going to make it the same hole diameter dimension and then the same from horizontal dimension from there back to that point and we're going to call that spreadsheet the whole diameter what that does is it positions this whole relative to that point so it's always in the same place so now we have the lug dimension but we need to position it and to do that what we're going to do i'm just going to bring that so you can see the whole thing we're going to dimension from this point to the center of the hole because that's the important point that goes here we can also use that dimension when we're creating a lid if you want to create a lid let me just tidy up my dimensions here so they're out the way this is just purely for visual so we can see what we're doing all right now we're going to do a horizontal dimension it's going to go from that center point and it's going to go to that center point there and that is going to be our whole center length so spreadsheet dot hole center length say okay and notice that it moves the whole thing because we we dimensioned everything relatively from this center of this hole out to these edges so when we move the center of the hole over that edge has to move over because there's a dimension that pushes it over that way too so let's move that dimension up there so it's our way now we're gonna do the vertical one again from that center point over to this center point and we're going to call that the whole center width spreadsheet the whole center width and now if we look oh well and now we must have made a mistake on our whole center width so let's have a look at what we've done here i go here our whole center width should be the inside width box inside width minus b 8. let's see what we've done it can't be right because that one now i'll center it divided by two minus b and now if we go over here there we go so i just had to click on that dimension to make it update and there it is so you can see our lug is right in the corner of that and it is in there no matter what size that box is so we're going to close that and now we want to pad that guy and we are going to pad it by the lug height we remember that it's calculated as well so let's go ahead and make pad we're going to say spreadsheet dot log height say okay okay so the way i designed it is that's always one wall thickness down from that surface so when we do a lid we can do a lid with a an embossment that centralizes the lid and comes down to the top of those lugs that's the uh the design i'll show you that at the end i've actually done the lid um so you'll be able to see it but i'm not going to do in this video what i'm going to do is i'm going to leave you to do it and then you can show me what you've done we'll take a look at how you get to where you you get to with a lid um one thing i will tell you with the lid is you want to put on obviously a clearance hole and a chamfer on that hole so we can add those to the spreadsheet later on so now let's see we only have one lug so we could go in and create the same sketch on this side and the same sketch on this side and the same sketch on this side to create that but there is a better way so i can select that lug and i can do this and this may be something that is only in version 0.19 so if you have 0.18 you may not have to create a multi-transform feature so i'm not 100 sure i don't remember seeing it in one eight but i haven't used one eight for a while so what you do is basically i selected the front of that pad so the pad is in then i right click here and i'm going to add a mirrored transformation and i'm going to tell it where that mirror transformation is and i'm going to say okay and now you can see i have two pads i don't have four pads yet so i only have two well i'm gonna go back in here this time i do a mirror transformation but i'm gonna do it on the horizontal sketch axis and say okay and okay and now if you look boom we have four beautiful lugs and those logs are parametric so what's going to happen is when we change the size of this box change our length now to 120 and change our box width to 80 you can see that my lugs all stay the same and i can change my wall thickness to say six and you'll see that my lugs change there and let's just do something a bit different with this make it a square box so there and then i can also change this whole diameter so if i made that whole diameter uh four you'll see the lugs get smaller because you don't need as much material on there and else we can do here so i can change um my box height and everything changes so you can see the box is completely parametric these are quite useful for if you're doing if you want a 3d print box and use it as an enclosure for some electronics so i've been doing some some things with arduinos and various raspberry pi's etc and you can take this as the basic box and then cut the holes in that you need so that you can house the electronics and here's the final version with the lid on it and i made the lid so that is also parametric now the holes all lining up and it has a little detent in the bottom that lines up into the hole and makes for a lid that closes on the box you enjoyed the video give us a like and if you haven't already please subscribe to the channel i'll be making more of these videos thanks for watching
Info
Channel: Adventures in creation
Views: 148,532
Rating: undefined out of 5
Keywords: #FreeCAD, CAD/CAM, CAD, Parametric Design, 3D printing, Electronics, Enclosure, Design, Maker, DIY
Id: cJfbINgyz-k
Channel Id: undefined
Length: 32min 56sec (1976 seconds)
Published: Thu Nov 26 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.