Engine Block Tutorial

From FreeCAD Documentation
Revision as of 21:55, 2 December 2014 by Renatorivo (talk | contribs) (Created page with "Ahora que ambos cilindros están en su ubicación los utilizaremos para tallar el bloque. Para ello utilizaremos ''operaciones booleanas'' en nuestras 3 primitivas. Comenzarem...")

Este es un tutorial de introducción al modelado en FreeCAD. El propósito del tutorial es introducirte a los tipos de datos primitivos para los objetos paramétricos, operaciones booleanas, croquizado 2D, y el proceso de convertir croquis 2D en modelos 3D. purposes of the tutorial are to introduce you to the primitive data types for parametric objects, boolean operations, 2D drafting, and the process of converting 2D drafts into 3D models. Como ejemplo de trabajo modelaremos el bloque de un motor simple y el cárter visto a la derecha.

Empezando

Para empezar, abre FreeCAD, ve a Archivo -> Nuevo para crear un nuevo documento, y luego a Archivo -> Guardar para guardarlo en tu equipo, he llamado a mi proyecto 'Engine'. Habrás notado que después de guardar el proyecto, la vista en árbol a la izquierda de la pantalla mostrará el nombre del proyecto en el que estas trabajando. Puedes tener más de un proyecto abierto a la vez y cada proyecto se mostrará como la raíz de un árbol en la vista en árbol.

Definiendo el bloque

Ahora empezaremos a trabajar en el modelo actual. Comenzaremos añadiendo un cubo para el contorno del bloque motor. Para ello necesitamos añadir una pieza al modelo, ve a Vista->Entorno->Pieza para seleccionar el Módulo de Pieza. Observaras que después de seleccionar el entorno, tienes una configuración de barras de botones diferente en las barras de herramientas de arriba. Cambia a algunos de los otros entornos para familiarizarte con el sistema de entornos y luego vuelve al módulo de pieza.

El alojamiento

En el módulo de pieza verás un puñado de iconos para crear objetos primitivos como cubos, esferas, conos, etc. Pulsa el icono del cubo () para añadir un cubo a la escena. Cada una de las primitivas listada tiene un conjunto de parámetros que son definidos cuando se añade la primitiva. Si quieres puedes añadir un tipo de cada primitiva para ver como son. Las primitivas se pueden eliminar de la escena seleccionándolas y pulsando la tecla de suprimir. Existen dos modos de seleccionar objetos, puedes pulsar con el botón izquierdo del ratón en la vista 3D, o hacer clic sobre ellos en la vista en árbol. En ambos casos, manteniendo la tecla CTRL pulsada te permitirá seleccionar múltiples elementos. Puedes hacer un zoom en la vista 3D moviendo la rueda de tu ratón. Para encuadrar la vista pulsar el botón del medio y mover el ratón. Para girar la vista mantén presionado el botón central del ratón y sin soltarlo presiona el botón izquierdo y mueve el ratón. Tambien puedes hacer clic con el botón del medio en alguna parte de tu modelo 3D para hacer que la vista gire alrededor de dicho punto. También, los números 1-6 y el 0 te mostrarán carias vistas de la escena (planta, alzado, axonométrica, etc.). Dedica un minuto o dos habituándote con la manipulación de las vistas 3D.

Lectura adicional: Navegando en el espacio 3D

Una vez que tengas el cubo y estés habituado al funcionamiento del ratón, comenzaremos definiendo las dimensiones del modelo CAD. Selecciona el cubo haciendo clic en la vista en árbol y pulsa en la pestaña 'Datos' en la Vista de Propiedades ubicada debajo de la vista en árbol (ve a Vista -> Vistas -> Vista de Propiedades di la has cerrado). En la pestaña Datos puedes modificar las propiedades del objeto que has seleccionado. Dependiendo del tipo de objeto seleccionado habrá diferentes parámetros para establecer en la pestaña de Datos. Para un cubo necesitamos 3 vectores, uno para su ubicación en el espacio 3D, otro para su orientación, y el tercero para especificar sus dimensiones. Para una esfera podrías especificar el centro, y el radio; Los conos tienen un radio,a altura y posición; etc. Estamos construyendo un pequeño bloque motor de 2 cilindros de modo que establece el tamaño y posición del cubo a los valores siguientes (asegúrate de que pones los XYZ en la 'Posición', los de 'Eje' establecen el eje de rotación y los valores por defecto están como queremos):

X: 0.0 mm Altura: 110.0 mm
Y: -40.0 mm Largo: 140.0 mm
Z: 0.0 mm Ancho: 80.0 mm

Ahora que tienes el bloque motor dimensionado adecuadamente deberíamos darle un nombre de descripción. Selecciónalo en la vista en árbol y pulsa en el botón derecho para renombrarlo o presiona la tecla F2. Llámalo "Alojamiento'.

El primer cilindro

Después tallaremos el primer cilindro a través de todo el bloque motor. Para ello añadiremos un cilindro al modelo con el tamaño que queramos abrir y haremos una operación booleana para "restar" el material del bloque. Pulsa el icono para añadir un cilindro () y luego selecciónalo y establece sus propiedades a las siguientes:

X: 40.0 mm Altura: 110.0 mm
Y: 0.0 mm Radio: 25.0 mm
Z: 0.0 mm

Una vez que las propiedades estén establecidas correctamente deberías ver las caras circulares del cilindro en las partes superior e inferior del bloque motor. Llámalo Cilindro 1 seleccionándolo en la vista en árbol.

El segundo cilindro

Podríamos hacer el segundo cilindro del mismo modo, sin embargo es mucho más sencillo copiar el primer cilindro y cambiar la coordenada X de su ubicación. Para ello, selecciona el Cilindro 1 y ve a Editar -> Duplicar selección. Verás que el segundo cilindro aparece en la vista en árbol (llámalo Cilindro 2), pero no lo verás en la vista 3D ya que está ubicado en la misma posición que el primer cilindro. Ahora selecciona el Cilindro 2 en la vista en árbol y cambia su coordenada X por 100 mm. Observarás que como se ha movido el cilindro en la vista 3D. Una vez que el segundo cilindro esté debidamente ubicado puedes verlo seleccionando el Alojamiento y pulsando la barra espaciadora para ocultarlo (Observa que los objetos ocultos están difuminados en la vista en árbol). Oculta los tres objetos uno a uno y luego vuelve a mostrarlos pulsando de nuevo la barra espaciadora al seleccionarlos en la vista en árbol.

Tallando los cilindros

Ahora que ambos cilindros están en su ubicación los utilizaremos para tallar el bloque. Para ello utilizaremos operaciones booleanas en nuestras 3 primitivas. Comenzaremos haciendo una unión de los dos cilindros. Selecciona el Cilindro 1 y pulsa CTRL para seleccionar también el Cilindro 2. Ahora pulsa el icono de Unión () para fusionar los objetos. Observarás que en la vista en árbol, ahora hay un objeto llamado Fusion. Si pulsas el icono de la flecha a la izquierda de su nombre en la vista en árbol verás los dos cilindros, pero su nombre se ha difuminado. En lugar de Fusion, lo renombraremos como Cilindros. Ahora tallaremos el bloque motor. Selecciona el Alojamiento y luego los Cilindros y presiona el icono de Cortar (). Los dos objetos seleccionados se combinaran de nuevo y el resultado se llamará Cut (que podrías renombrar a Bloque tallado). Presiona la tecla 2 para ver la vista en planta, deberías ver a través de los agujeros de los cilindros en el bloque motor. A la derecha puedes ver como debería quedar.

The Key Advantage of Parametric Modeling

Now that we have our cylinders bored out we will take a second to see one of the advantages of this system. Suppose at some point in the development, we find out that we want the cylinders to be a bit bigger. Since the union and intersection operations we performed were recorded as groupings in the tree view, we can change the cylinder size and FreeCAD will just re-run the union and intersection process and arrive at the new engine size. Play around with the radius and position of the two cylinders a bit and then return them to the parameters quoted above, before continuing the tutorial.

The Crankcase

Billet and Bearing Caps

Next we will work on a crankcase under the engine block. Add a new box, rename it to Crankcase Billet, and give it the following properties:

X: 0.0 mm Height: 85.0 mm
Y: -50.0 mm Length: 140.0 mm
Z: -85.0 mm Width: 100.0 mm

In order to tell the crankcase apart from the let's give one of them a different color. You can change color by right clicking on the object to change in the tree view. You can assign a color yourself or give the object a random color (choose random again if you don't like the color). Add another box called Bearing carve, give it the following properties, and then cut the Bearing carve away from the Crankcase Billet (i.e. select the billet first):

X: 0.0 mm Height: 30.0 mm
Y: -40.0 mm Length: 140.0 mm
Z: -85.0 mm Width: 80.0 mm

Rename the resulting Cut object to Carved crankcase.

Carving out the journals

Next we will cut out a semi-circular place for the crankshaft to sit and a space in the crankcase for it to spin. We will start with a cylinder, but the orientation of the default cylinder is vertical, whereas we need a horizontal one. This means we need to figure out how to rotate the cylinder to align it properly with our engine. If you look at the guide axis in the bottom right corner of the 3D window you will see we want the crankshaft to lie along the positive x-axis. This means that from its starting location we need to rotate 90 degrees around an axis parallel to the y-axis of the scene. This tells us what we need to enter the parameters for the cylinder. Create a cylinder called Cranshaft carve and give it these properties (notice that now we have to specify the orientation parameters, as well as the regular dimensions we did for the cylinder bores):

Axis X: 0.0 mm Angle: 90.0 degrees
Axis Y: 1.0 mm
Axis Z: 0.0 mm
Position X: 0.0 mm Height: 140.0 mm
Position Y: 0.0 mm Radius: 20.0 mm
Position Z: -55.0 mm

Cut the crankshaft carve object away from the Carved crankcase and rename the resulting object Crankcase with journals.

Finishing out the Crankcase

Lastly we will cut out 2 final boxes so that the piston rods can reach from the crankcase up into the engine block. Make two objects called Box carve 1 and Box carve 2 with the following properties, union them into an object called Box carvers, and cut this object away from the Crankcase with journals, calling the final result Crankcase. Remember, you can hide the Bored block by selecting it and pushing spacebar so you can see what you are doing; also, you can duplicate Box carve 1 and just change the X coordinate to get the second carver.

X: 15.0 mm Height: 55.0 mm
Y: -25.0 mm Length: 50.0 mm
Z: -55.0 mm Width: 50.0 mm
X: 75.0 mm Height: 55.0 mm
Y: -25.0 mm Length: 50.0 mm
Z: -55.0 mm Width: 50.0 mm

On the right you can see what the final result should look like. I have fully expanded the tree view so you can see the hierarchy of the boolean operations used to build the device. Remember that you can still dig down into this tree and change cylinder diameters, change the size or position of the crankshaft, etc, without having to rebuild the whole model from scratch. We could continue to carve out the crankcase further but this will be enough for now. Next we will look at using the 2D drafting mode to design the headbolt pattern and cut down on the weight of the engine block by removing much of the unnecessary steel billet that remains around the outside of the cylinders.

2D Drafting the Head Gasket Design

For the head bolts and the shape of the engine block we will be using more boolean operations to "carve" away the parts of the block we don't want. However, if we stop to think about it, every head bolt is going to look the same, it will cut all the way down into the crankcase, the only thing different will be where on the top of the head it is located. This means we can simply "draw" the shape of the head gasket on the top of the engine, and then use that like a pattern to do the carving we want done.

Entering 2D Drafting Mode

First we need to switch to the 2D Drafting workbench, to do this from part mode you can select 2D Drafting from the dropdown box at the top that currently says Part. If you cannot find the dropdown box (not all workbenches show the dropdown) you can also select a workbench from the View->Workbench menu entry. Even though we are doing 2d drawing, we will draw them in the 3D window by telling FreeCAD what plane we want the drawings projected into. After you have selected the 2D Drafting workbench just above the top-right corner of the 3D view and click on the leftmost button which will say one of the following {none, top, front, size, or d(..., ..., ...)}. Once you click that, the left side of the bar will have a text box for you to enter a plane offset, and 5 buttons: XY, XZ, YZ, View, and None. The first three are the standard top, front, and side views, the View entry will use the plane perpendicular to the direction the camera is looking (the camera's viewplane), and the last will not project into a plane and let you fully define the XYZ coordinates for every point you draw. We want to set a plane offset of 110 (type it in and press enter) and then click the XY button to project the drawing onto the XY plane, located 110 mm up the Z axis which corresponds to the top of the engine block. Now that we have told FreeCAD what plane to draw in we are ready to start designing the head gasket.

The last thing to do is set up the 3D view. Even though all the drawings we produce will be projected into our defined 2D plane, we can look at the plane we are drawing on from any angle (including the other side of the plane so we draw "backwards"). Since we have told it the plane is the one co-planar to the top of the engine block, we should probably have the 3D view looking at that, or at least roughly in that direction. Press the 2 key on the number pad to look at the top view (notice that on the num pad, adjacent keys are opposite views so 1 and 4 are front-back, 2 and 5 are top-bottom, and 3 and 6 are front-back). Once you are looking at the engine from the top down, you can center it by dragging the middle mouse button to pan the view. Finally, the 2D drafting mode will allow us to snap parts of the drawing to the corners of the engine block, the center of the cylinders, etc, in order to make this work best we should hide the crankcase so the drawings snap only to the part we are working on (press spacebar to show/hide the selected object).

Laying Out the Head Bolts

Now that the proper plane projection and view is set up we add 2d drawing elements in the same way we added primitives. Click the Add Circle button () and move your mouse around in the 3D view. You then need to tell FreeCAD the XY location for the center of the circle, and the radius, for both of these measurements you can either enter them with the mouse (following the instructions in the bottom left status bar), or you can type in the values in the text entry boxes that appear above the tree view. Go ahead and add a couple random circles on the top of the engine, as well as a few not on the engine, i.e. just out in the empty space surrounding your view of the engine. After you have done this, rotate the camera around the top of the engine block and look at the circles you drew, notice how they are "flat" in the plane we projected them into and this plane lines up with the top of the engine block; this will be important when we extrude the drawing to shape the engine. Now that you see how to add 2D elements you can delete the test circles you added and we will start entering the actual head layout. Note that if your circle disappears inside the engine block, your drawing projection plane is not properly set to XY mode, offset 110 mm.

Adding drafting elements with the mouse is fast and easy, but it is not very precise. For the actual bolt pattern we use the fact that moving the mouse will update the numbers in the text boxes just above the 3D view so we can see roughly the coordinates of where we want to place things. Once we have these rough coordinates we can type in the real values we want for precise positioning. Reset to the top view of the engine, click the Add circle button, and move your mouse around the top left corner of the engine block taking not of a good location for the head bolt. It looks like X=10, Y=30, would be a good place for the circle (note the Z coordinate should be grayed out, if it is not you need to set the plane properly like in the previous section, pressing escape will cancel drawing the circle).

Now that you see how to easily determine the coordinates of drawing elements you can easily design a bolt pattern or other 2 dimensional layout for a part such as fluid channels, circuit-board traces, etc. For our 3 head bolts let's on this side of the engine, let's use the following coordinates. Note that when you are typing in values to the boxes you can press enter to move on to the next box, and it is also a good idea to move your mouse out of the 3D view before you start typing in the coordinates as too much mouse movement will overwrite the numbers you have already entered in the text entry fields. Also, on my system I had trouble with the typed in circles having their Z coordinates set to 12.5 for some reason, if this is a problem for you, you can set the drawing projection plane to None and then manually enter the Z coordinates for the circles to be 110. Finally, when creating the circles, make sure to check the box labeled Filled otherwise when we extrude them later they will just create tubes like a toilet paper tube instead of a solid cylinder.

X1: 10 Y1: 25 Radius: 2.5 mm
X2: 70 Y2: 25 Radius: 2.5 mm
X3: 130 Y3: 25 Radius: 2.5 mm

Name these circles Bolt 1 through Bolt 3.

The Other Side of the Block

Now that the first three head bolts are in place down one side of the engine we need three more mirrored on the other side, there are three ways we could do this:

  • We could just continue adding circles like we did for the first three and just negate the Y coordinates to put the bolts on the other side of the engine.
  • We could select the three we have added, go to Edit->Duplicate Selection and then negate the Y coordinates of the three new circles.
  • We could use the mirror functionality in the Part module.

Since you should already know how to do the first and second way, we will choose the third way for this example model. Each of the three methods has its own advantages and disadvantages, but a good operating rule is that simple models (like this one) probably should use the first or second methods, whereas models with lots of duplication and/or duplication of very complicated shapes/objects should probably use the third method.

So even though it is a bit of overkill we will mirror these bolts as a demonstration. Switch back to the part workbench (note that you can always switch to the Complete workbench to see all the tools at once if you would rather not switch back and forth) by going to View->Workbench. Select the three bolt circles in the tree view, and then press the mirror button (). Once you press the mirror button you should notice a new display called the Combo view pop up on in the pane underneath the Tree view. Many of the tools need additional input before they can run and the Combo view lets you enter these parameters. You can make the Combo view larger by dragging the divider line separating it from the Property view up or down. Select Bolt 1 from the list on the Combo view and set the mirror plane to XZ, then press OK (do the same for bolts 2 and 3).

At this point you should have a basic engine block with the cylinders bored out and the headbolt locations marked.

Cutting Down the Excess Billet Material from the Block

Now that we have holes marked out for headbolts (we could do the same thing for oil channels, water jackets, etc) we will want to "trim" the outside of the block billet down to a more suitable shape. This will make the engine lighter, allow it to cool more easily, mean less steel must be used to cast the block. Like the bolt pattern we will be laying out a 2 dimensional drawing outlining the shape we want on the finished product. We could draw the spline curve directly with the mouse, or use the hybrid approach like we used for the circles where we used the mouse to find approximate coordinates and then typed in the true values we wanted. A more interesting approach is to use the 2D drafting's construction mode to plot a few guide shapes to help us trace out a nice, symmetric, spline curve by snapping to our constructed guide shapes.

As a guide we will draw two regular polygons for each cylinder, with the polygons concentric with the cylinder. To begin, switch to the top view of the engine block, hide the crankcase, switch back to the 2D drafting workbench, select the reference plane offset to 110 mm and the XY plane mode (or the None mode if you prefer), and click the Construction mode button in the command bar (the construction mode button looks like a trowel and is located just above the top right corner of the 3D view). Construction mode works just like the normal mode except any 2D drawing objects created while in construction mode get drawn in a different color and are automatically put into a separate group in the Tree view, this allows you to hide you guide drawings and leave behind only the real things like bolt hole markings by hiding the construction group, or to delete all of the guide objects by just deleting the group.

Further reading: Construction Mode

Now that your drawing plane is properly set up and you are in construction mode, click the Regular Polygon button () and move your mouse along the edge of the left cylinder while holding down the CTRL button. You should see that it is snapping a small black dot either to the edge of the cylinder, or to the center of the cylinder, depending on where your mouse is along the circumference. Move so that the black dot snaps to the center of the cylinder and click the left mouse button. This places the center of the polygon at the center of the cylinder, the program prompts us for the number of edges on the polygon and the radius it is inscribed in. Investigating with the mouse a little bit looks like a radius of 30 is good (so type that in) and enter 14 for the number of side, but leave the Filled box unchecked this time. If you can't get the snap to lock onto the center of the cylinder (I had trouble with mine) you can always enter the coordinates manually (X=40, Y=0, Z=110). Add a second polygon, also centered on the left cylinder but this one should have 22 side and 45 mm radius. Finally add the same two polygons over the right cylinder (centered at X=100, Y=0, Z=110). When you are finished you should have two "figure-8's" surrounding the cylinders and head bolts. (Note that currently the program does not actually prompt you for the number of edges so you will just have to set the center and radius and then change the number of faces in the Property view).

Now that we have our guide polygons in place we are ready to draw in the spline curve defining the outside shape of the engine block. Since this curve will be part of the final object you can turn off construction mode by clicking the same button you pressed to turn it on. Now click the Add BSpline button () and start drawing the BSpline by CTRL+left clicking on each place you want to add a control point for the spline curve. You will want your first control point to be on the leftmost point of the inner guide polygon for the left cylinder. Continue adding control points all along the spline curve until you click on the last point before the one you started drawing, then click the Close button up where you typed in the position and radius for the 2D circles we drew for the headbolts. Clicking this close button finished drawing control points for the spline curve and joins the ends together to form a closed loop. It is very important that you properly close loops like this if you plan to extrude them into solid objects like we will be with this one. For open spline curves you can just click the Finish button instead of the Close button when you are finished drawing. To the right you can see what you finished spline curve should look like just before you press the close button (notice I have drawn all but the last line segment and my mouse pointer is just about to click the Close button to finish the spline curve). Also notice that I have checked the Filled box so the resulting spline curve will form a solid sheet, rather than just an empty ring, this must be done to extrude it into a solid shape that is capped on the ends.

The control points are not shown in that picture so I have added a second screenshot showing the finished spline in edit mode (click the Edit mode button to turn editing on or off for the selected object, make sure to turn it off when you are done editing it or just skip over this step if you are satisfied with your engine block shape). Also, note that there is a discontinuity on the leftmost edge of the spline curve, even though it is closed properly, this is a bug in the program behavior and is currently being fixed, as a result your spline curve may look slightly different if you are running a newer version of the software than is available at this time.

Extruding the 2D Head Design into our 3D Model to Finish the Design

Now we are closing in on the final design of the engine. Return to the Part workbench and click the Extrude sketch button (). In the combo box that pops up, use CTRL+LeftClick to select the 6 head bolts and the spline curve for extrusion. The default direction is the positive Z axis, we want the negative Z axis to extrude the head design "down" and into the engine block so set the direction to X=0, Y=0 and Z=-1, then type in 110 for the length (the height of the engine block). After you get all the values entered and click OK the circles for the bolts will be extruded downward to for cylinders and the spline will be extruded downward to produce a sort of cylinder with "rippled" edges. Select and hide the Bored block so you can see the extruded spline, then hide that object so you can see the 6 head bolt cylinders. You see that very sophisticated 3D shapes can be made by starting with a 2D drawing and extruding parts of it downward. We could even extrude different parts of the drawing by different amounts to do things like bore in bolt holes that just go part way through the block, but cut separate water jackets that go all the way through. At this point all your extruded objects are just named "Extrude001..." so you will want to go through and name each of them so you can identify them in the next section (I will name mine Head bolt bore 1 though 6 and name the spline Extruded spline, I suggest using the same names in your model as well). Now that you have your extruded shapes it is just a few boolean operations now to produce the final block design. Go through and show the major components (the Bored block and the Crankcase), and all your newly created extruded objects.

Now that we have 3D objects for the bore holes and the outer shape, we can use a few boolean operations to stitch the whole thing together. Select your 6 extruded head bolts in the tree view and join them into a union (name the resulting object Head bolt boreholes). Then select the Bored block and the Head bolt boreholes in that order and perform a cut (like you did when you bored out the cylinders), name the resulting Cut object Block with headbolts. Finally, select the Block with headbolts and the Extruded spline and press the Make intersection button (), and name the resulting object Engine block. Your final object should look like the picture on the right.