Wednesday 30 December 2015

NiCr



NiCr (read as 'nicrome') is the name of my CNC Hot Wire Foam Cutter, an OpenSource/OpenHardware project that I'm making public with this post.

The github repository: https://github.com/JMG1/NiCr

 

Description:

As the name says, the machine cuts shapes from foam blocks, being the original intention to cut wing cores for lamination and molding.

I've composed a little video about it:


I'm opening this project in exchange of all the good things that the OpenSource world has given to me (I like to think about it as 'from the OpenSource to the OpenSource').

Details:

The NiCr project can be divided in three parts: Machine, Arduino and FreeCAD


-Machine:

The machine is the physical thing, and is being designed to be built from easy to find, easy to work with materials, like extruded aluminium tubes and simple bolted joints, taking into account a low budget and the DIY factor (only cut/drill/bend operations).

It features two CoreXY frames, easy-to-find Nema17 motors, and a spring tensor for the wire. The design is also very scalable and can, possibly, be applied to other type of machines.

The design has taken place between FreeCAD and the real world:

FreeCAD pictures:

Detail of the Nema17 stepper, X axis slider and belt pulleys

Machine assembled inside FreeCAD
Real world pictures:

Frame size

Slider on the X axis

First version of the cut-wire tensor




-Arduino:

The machine movement is done with an Arduino Mega 2560 board and a Ramps shield, that, together with four stepper drivers (A4988), some limit switches and a power source form all the electronics.
The firmware is being developed specifically for this machine, you can see some of its parts in this links:


-FreeCAD:

The shapes are created using FreeCAD existing tools and converted later to .nicr (similar to GCode) in a custom workbench.

This workbench features a parametric machine, a shape-to-path algorithm, trajectory planning and simulation tools.

Some pictures of the workbench:

Workbench and parametric machine

Cut path simulation result for three wings with different precision settings

Workbench demo video:



The result of the shape-to-path algorithm is a .nicr file that contains instructions similar to GCode and with this comes a question:
Why I have not used the path workbench (in development) and the existing GCode standard?
 Because this machine produces 2.5D shapes (could do '2.75D' with the addition of a fifth axis, to be studied) and the movement is very different to the movement of a 3D printer or mill, and by using 4 axis, someone can be mistaken and use the code for the wrong machine.
Anyway, it is going to be a documented language so export-import tools can be created if needed.


Conclusion:

NiCr is in active development, at the moment I'm trying to achieve a basic stability and usability of the software before releasing (and some documentation too, maybe the hardest thing!).
Once I achieve that, the code and machine 3d parts will be uploaded to github (I have not decided the particular license yet) After a complete day of reading about licenses, I have chosen the GNU GPL.

I'll be updating this post with any news I have.
-> January 1, code uploaded to github: https://github.com/JMG1/NiCr








By the way, have a happy 2016!

Javier.


Tuesday 3 November 2015

Arduino: Live Instruction Feed To CNC

This is the conclusion of the posts reading instruction from serial and stepper sync:


While the video itself is not very exciting, it shows a machine moving using custom code (of course, I'm excluding the bootloader and stepper firmware, not to mention the complete Linux core running on the pc...).

You can find the code used in the video (Arduino and Python) in this github repository The code is as is (being it a test I have not taken the time to clean it).

The next step is to achieve a continuous movement (currently, it stops completely between instructions) using some kind of instruction buffer.

The machine of the video is not the target machine (see here another video about this mini CNC)

EXTRA (because 200 youtube subscribers :) )

This is the frame of the target machine:



Full aluminium.

More to come in a few weeks its here!

Thursday 29 October 2015

Arduino: Move 4 Stepper Motors Synchronously

...but, theoretically, it would work for an n number of motors.

Part of the machine inside FreeCAD
This is the algorithm that plans the trajectory and syncs the movements of the stepper motors, in the new CNC machine that I'm designing (and building!)

The input is an int array { MA, MB, MC, MD } where each int means the number of steps (positive or negative).

The stepper movement logic is stored into a boolean[8] array { SA, DA, SB, DB.... } where SA means step for motor A and DA is the direction bit of the motor A (for a 2 wire stepper driver, like the a4988). This array is erased and re-computed every loop cycle with the next movement, so real motor stepping has to take place inside this loop.

The image below (created with FreeCAD) shows a representation of the algorithm output for a requested movement of ( 5, 15, 25, 40 ) steps.

Input ( 5, 15, 25, 40 ), step bit only

It would be possible to do some kind of buffer by translating that boolean array into an int inside an int array. This should be a more-less memory efficient way of decoupling motion logic and motion execution, something to try in a future.

The code:

/*
 * JMG October 2015
 * NiCr Stepper Sync Algorithm V1
 * Tested on Arduino Nano (Ide 1:635)
 * 
 */

// stepper_instruction { Step1A, Dir1A, Step1B, Dir1B, Step2A, Dir2A, Step2B, Dir2B }
bool stepper_instruction[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };

void moveAB( int Adx, int Ady, int Bdx, int Bdy )
{
  int delta[4] = { Adx, Ady, Bdx, Bdy };
  int aux = 0;
  for( int i = 0; i < 4; i++ )
  {
    if( abs(delta[i]) > aux )
    {
      aux = abs(delta[i]);
    }
  }
  float R[4] = { 0, 0, 0, 0 };
  for( int i = 0; i < 4; i++ )
  {
    R[i] = (float)delta[i] / (float)aux;
  }
  int inc[4] = { 0, 0, 0, 0 };
  int acc[4] = { 0, 0, 0, 0 };
  int j = 0;
  while( ( acc[0] != Adx )||( acc[1] != Ady )||( acc[2] != Bdx )||( acc[3] != Bdy ) )
  {
    j++;
    for( int i = 0; i < 4; i++ )
    {
      inc[i] = round( R[i]*j - acc[i] );
      acc[i] = acc[i] + inc[i];
      stepper_instruction[2*i] = abs( inc[i] );
      if( inc[i] < 0 ) { stepper_instruction[2*i+1] = 1; }
      else { stepper_instruction[2*i+1] = 0; }
    }
    for( int i = 0; i < 7; i++ )
    {
      Serial.print( stepper_instruction[i] );
    }
    Serial.println( stepper_instruction[7] );
    for( int i = 0; i < 8; i++ )
    {
      stepper_instruction[i] = 0;
    }
  }
  for( int i = 0; i < 4; i++ )
  {
    Serial.print( acc[i] );
  }
  Serial.println();
  for( int i = 0; i < 4; i++ )
  {
    Serial.print( delta[i] );
  }
}
void setup()
{
  Serial.begin( 115200 );
  delay( 500 );
  moveAB( 100, -5000, 780, 25 );
}
void loop()
{
}

It prints by serial (115200 baud) the values of stepper_instruction at each loop cycle, and the counted steps vs the requested steps at the end of the loop.
I'm sure this is not the optimal way of doing it, but it works.

Update: the algorithm in action

PS:
I will reveal more info about the machine soon. NiCr

Friday 23 October 2015

Arduino: Read Instruction From Serial

When using Arduino, parsing serial data and converting it to something usable is way harder than it seems.


While this functionality is specially useful as it allows your computer to talk with the Arduino easily, a quick search on google will give you thousands of very different solutions. The one exposed here is just another one that is working perfectly for me.

The instruction:

The idea is to set the position of three servos by serial and also be able to change other parameters.
The instruction, then, must be composed from an instruction name and the parameters, for example, to move the three servos:

MOVE 120 23 90

And, if we also want to switch on a light, the instruction could be:

LIGHT ON

How do we get the Arduino to know that we want the servos to move and then switch on a light?

 

Arduino Read Instruction:

Code:
/*
JMG OCTOBER 2015
This script is made up from snippets found in stackoverflow and other
google results
*/

void setup()
{
  // open serial port at 115200 baud
  Serial.begin(115200);
}

String complete_instruction[4];  // will contain the decoded instruction (4 fields)
void loop()
{
  
  while(!Serial.available()) {}  // if there is nothing on serial, do nothing
  int  i = 0;
  char raw_instruction[25];
  while (Serial.available())
  {  // if something comes from serial, read it and store it in raw_instruction char array
    delay(10); // delay to allow buffer to fill
    if (Serial.available() > 0)
    {
      raw_instruction[i] = Serial.read();
      i++;
    }
  }
  if( strlen( raw_instruction ) > 0 )  // if a new raw_instruction has been read
  {
    // clean raw_instruction before decoding (overwrite non filled array positions with empty spaces)
    for( int n = i; n < 25; n++ ) { raw_instruction[n] = ' '; }
    // decode the instruction (4 fields) (iterator n = field, iterator j = character)
    int j = 0;
    for( int n = 0; n < 4; n++ )
    { 
      while( j < 25 )
      {
        if( raw_instruction[j] == ' ' )
        {
          j++;
          break;
        }
        else
        {
          complete_instruction[n] += raw_instruction[j];
        }
        j++;
      }
    }
    // print decoded instruction by serial
    for( int n = 0; n<4; n++ )
    {
      Serial.println( complete_instruction[n] );
      // clear field after using it
      complete_instruction[n]="";
    }
  }
  delay(50);
}

The summary is that you can send by serial something like "A B C D" (using space as delimiter) and the variable complete_instruction will contain {A, B, C, D}. A,B,C,D can be any kind of data of any length you want, for the instruction MOVE 120 23 90, it will return {"MOVE", "120", "23", "90"}. For the second instruction LIGHT ON, it will return {"LIGHT", "ON", "", "" }.

This way, now you just need to set several if conditions to check if the instruction says "MOVE", "LIGHT", "KILL" or whatever, and if it does, check the remaining parameters (you can use toInt() or toFloat() for numeric values).

My experience with this script is that it works as intended and does not cause memory problems. But I do not have enough knowledge about C to assure that it will not crash your script (from what I've read, String variables together with low RAM space seem to give problems.) Just take it into account if something very weird is happening. (code updated, memory problem solved?)


Bye!

Thursday 10 September 2015

FreeCAD: Intersection Between Shapes

Hi!

This is a small script that will find intersection volumes between the selected shapes, for example, given two cubes and a sphere, this is the result:


It gives some transparency to the original shapes and also displays intersection volume at the report view.

The code is:

# JMG 2015
object_list = []
for obj in FreeCAD.Gui.Selection.getSelectionEx():
  obj = obj.Object
  object_list.append( obj )

for n in range( len(object_list) ):
  object_A = object_list[n]
  for i in range( len(object_list) ):
    if i <= n:
      pass
    
    else:
      object_B = object_list[i]
      common = object_A.Shape.common( object_B.Shape )
      if common.Volume > 0.0:
        FreeCAD.Console.PrintMessage( '-Intersection- ' + object_A.Name + ' with ' + object_B.Name + '\n')
        FreeCAD.Console.PrintMessage( 'Common volume: ' + str( common.Volume ) + '\n' + '\n' )
        
        intersection_object = FreeCAD.ActiveDocument.addObject( 'Part::Feature', 'Intersection_Volume' )
        intersection_object.Shape = common
        intersection_object.ViewObject.ShapeColor = ( 1.0,0.0,0.0,1.0 )
        object_A.ViewObject.Transparency = 80
        object_B.ViewObject.Transparency = 80

Thursday 6 August 2015

FreeCAD: Double Slider Mechanism Animation

Since few days ago, this blog is two years old, and, also, last month it crossed the 4000 views/month barrier.
I was thinking about a way of celebrating this events, and last night I saw a .gif image about a flat mechanism at which I could be staring the whole day:


I don't know its exact name, but "double slider mechanism" seems appropriate. It belongs to the family of flat, four bar linkage mechanisms, and, possibly, there is no real use for this one. But it moves very smoothly, with the outer end of the rotating arm drawing some kind of ellipse.



The kinematics of this one are not too difficult (none of the family of four bar linkage mechanism are), and for the animation I have solved it in an analytical way.

The code:


# Javier Martinez Garcia    August 2015   GPL V2.0

from PySide import QtCore
from math import sin, cos, radians

# retrieve the objects from the document
slider_x = FreeCAD.ActiveDocument.getObject("Pad003002")
slider_y = FreeCAD.ActiveDocument.getObject("Pad003001")
arm = FreeCAD.ActiveDocument.getObject("Pad002001")


# store initial placement (needed to restore initial position)
slider_x_placement = slider_x.Placement
slider_y_placement = slider_y.Placement
arm_placement = arm.Placement

# store object placements in a new variable
r_slider_x_pl = slider_x.Placement
r_slider_y_pl = slider_y.Placement
r_arm_pl = arm.Placement


def reset():
  # function to restore initial position of the objects
  slider_x.Placement = r_slider_x_pl
  slider_y.Placement = r_slider_y_pl
  arm.Placement = r_arm_pl


# In this mechanism, "i" represents the angle of the rod in degrees
i = 0

# update function calculates object position as f(i) and increases i
def update():
  global i
  alpha = radians( i )
  x = 150.0*cos( alpha )
  y = 150.0*sin( alpha )
  slider_x.Placement = FreeCAD.Placement( slider_x_placement.Base + FreeCAD.Vector( 150-x, 0, 0 ),
                                          slider_x_placement.Rotation )
  
  slider_y.Placement = FreeCAD.Placement( slider_y_placement.Base + FreeCAD.Vector( 0, y, 0 ),
                                          slider_y_placement.Rotation )
  
  arm.Placement = FreeCAD.Placement( arm_placement.Base + FreeCAD.Vector( 0, y, 0 ),
                                     FreeCAD.Rotation( FreeCAD.Vector( 0,0,1), i))
  # update the scene
  FreeCAD.Gui.updateGui()
  # increase mechanism input position
  i += 1


# create a timer object
timer = QtCore.QTimer()
# connect timer event to function "update"
timer.timeout.connect( update )
# start the timer to trigger "update" every 10 ms
timer.start( 10 )



Download the .fcstd model and animation script here, on github.


Have fun!

Saturday 18 July 2015

FreeCAD: Drill macro

I am working on a project that has a lot of drill operations. Being an "assembly", it can get quite tedious to create an sketch or part cylinder, place it and then do a boolean cut to make the drill. To speed it up, I have written a short macro that drills existing holes into the selected shapes:

 

Selection:


 

Script:

"""
Drill Macro
JMG 2015 GPL

Select a set of circles and then the shapes that you want to drill
"""

#get user selection of edges
SelEdges = Gui.Selection.getSelectionEx()[0].SubObjects  

# get user selection for shapes
SelectedShapes = Gui.Selection.getSelectionEx() 

# create the faces that will be extruded to create the drill
cutFaces = []
for edge in SelEdges:
  cutFace = Part.Face(Part.Wire(edge)) # create face from edge
  cutFaces.append( cutFace ) 

# drill all selected shapes minus first one (selected edges)
for i in range(len(SelectedShapes)-1): 
  #retrieve object from selection list
  SelShape = SelectedShapes[i+1].Object 

  #create an empty part object in the document
  drilledShape=FreeCAD.ActiveDocument.addObject("Part::Feature",'Drilled'+SelShape.Name)
  drilledShape.Shape = SelShape.Shape
  #cut selected shape and assign shape to "drilledShape"
  for f in cutFaces:
    drilledShape.Shape=drilledShape.Shape.cut(f.extrude(f.normalAt(0,0)*1000000))
    drilledShape.Shape=drilledShape.Shape.cut(f.extrude(f.normalAt(0,0)*-1000000))
  
  #turn off visibility of the selected shape and set same color for the new object
  SelShape.ViewObject.Visibility = False
  drilledShape.ViewObject.ShapeColor = SelShape.ViewObject.ShapeColor

Output:



Also, if you want to drill something more complex, like a slot, a variation of the script can do it:

Selection:

Script:
"""
Drill Edges Macro
JMG 2015 GPL

Select a set of edges that form a closed wire and then the shapes
that you want to drill
"""

#get user selection of edges
SelEdges = Gui.Selection.getSelectionEx()[0].SubObjects  

# get user selection for shapes
SelectedShapes = Gui.Selection.getSelectionEx() 

# create the face that will be extruded to create the drill
cutFace = Part.Face(Part.Wire( SelEdges )) 

# drill all selected shapes minus first one (selected edges)
for i in range(len(SelectedShapes)-1): 
    #retrieve object from selection list
    SelShape = SelectedShapes[i+1].Object 
    
    #create an empty part object in the document
    drilledShape=FreeCAD.ActiveDocument.addObject("Part::Feature",'Drilled'+SelShape.Name)
    
    #cut selected shape and assign shape to "drilledShape"
    drilledShape.Shape=SelShape.Shape.cut(cutFace.extrude(cutFace.normalAt(0,0)*1000000))
    drilledShape.Shape=drilledShape.Shape.cut(cutFace.extrude(cutFace.normalAt(0,0)*-1000000))
    
    #turn off visibility of the selected shape and set same color for the new object
    SelShape.ViewObject.Visibility = False
    drilledShape.ViewObject.ShapeColor = SelShape.ViewObject.ShapeColor

Result:




I have them in a custom toolbar and they have helped me to do things faster.

Maybe it helps you too :)

Bye!

Monday 13 July 2015

What's going on this summer?

Hello!

I write this brief post to explain, among other things, what is currently happening with the sheet metal workbench:

The workbench at the moment is at 30%: Document structure is almost done, simple unfold is working and there are tools, like this one, to create even more complex and powerful features.


Also, I talked about some crowdfounding campaign or paid development for this workbench: all it is stopped because I've found a powerful sponsor (to be revealed in a future).

 

Am I working at sheet metal?

No. I'm going to be studying from now until I finish my degree, somewhere around December. But this does not mean a complete shutoff, there are things and important works on the way.

For example, for  the "maker" community, I am developing a new machine that is being born by the end of this year (and is part of my degree project). An open source machine with stepper motors, completely designed with FreeCAD, that works using Arduino and Python and is not a 3D printer.




Also, I've been working in improvements at the "Exploded Assembly Animation workbench" and additions to the macro "WorkFeatures"


In conclusion, things are going to freeze a bit, but no project is going to disappear.


Have a nice summer!!


Javier.

Friday 5 June 2015

FreeCAD: Sheet Metal Update 2

Some screenshots of the current state of the workbench:

My goal sheet metal part and what can be currently done with the workbench:


It took me less than 5 minutes to draw it (I cheated a bit and did not put any real measurements). It sums up the current capabilities.

The object in the tree view:


You can also see the two orange icons, the only ones by now: "base fold" and "fold on edge".

The properties of the main feature, the fold:


It seems not too different from Update 1, but there has been a lot of work under the hood. Topological naming is a headache (every time a shape is modified, freecad sorts its edges, faces and vertexes randomly), and for the unfold, currently I have two approaches, the one that is currently working, produces this:


The other method, when finished, will allow to unfold partially and set different bend radius and k factors for each fold.

Thought priority is to finish Fold part class and unfold methods, to take a rest from it I code other tools, for example, hem along edges:


Or tear drop fold (a simplified fold object):


Slowly, this is starting to feel mature enough to use it in for real world. Once I solve some key problems, I will launch the crowdfunding campaing.

Any comment is greatly appreciated!

Thursday 14 May 2015

FreeCAD: Sheet Metal Update 1

After some time without touching FreeCAD, I have managed to go a bit further at the development of the sheet metal workbench. Although is not really a "workbench", but a set of scripts at the moment, most of the critical part is done: workflow, document structure, data tree...

A screenshot:



This video sums up the current possibilities:


Objects are totally parametric and unfold algorithm is easier then ever. Next things to do are folds created from sketches (almost completed), get the unfold algorithm to work correctly with the k factor and other bend methods, set up the workbench with icons, and a lot of small utilities like reliefs, slots, punching...


The idea for this workbench is to be open source, but in a special way, because once completed and tested, I will start some kind of "crowdfunding" campaign so I can get some economic feedback. Once a specified amount is reached, I will upload the complete code to GitHub and start to work at documentation and further integration with FreeCAD (if it is considered good enough by the main devs).

With this method I hope to prove that open source software and economic benefit are not antagonist concepts.

What do you think?

EDITED: The development of this workbench (including funding campaign) is stopped until the first release of the project NiCr.

Monday 20 April 2015

FreeCAD: Sticker Sketch and Text

Sometimes you need to model a special part like a shift drum for a motorcycle gearbox or something more simple like putting text on your perfectly modelled cup of coffee. While the content of this post does not completely solve any of this problems, it shows an important step forward. I'm doing this because of its similarity with some parts of the sheet metal workbench core.

What it does is to roll around a cylindrical surface a sketch or a text string. Code at the end of the post.

Sketch sticker:

This is a plain sketch tangent to a cylinder, with a random polygon inside:

 

The script rolls the sketch along the cylinder surface. Only straight lines at the moment.

 

Text sticker:

Equal to the previous one but with strings. The font must must be made only of straight lines.



It works for any face orientation (but not character length, this will be improved )


Text Sticker Code:


"""
Javier Martinez Garcia  2015  GPL
"Text sticker" script
"""

import Draft
from math import sin, cos, pi

BaseCylinder = Gui.Selection.getSelectionEx()[0].SubObjects[0]

# Cylinder axis:
for edge in BaseCylinder.Edges:
  if str(edge.Curve)[0] == "C":
    AxisPoint = edge.Curve.Center
    AxisDirection = edge.Curve.Axis
    CylinderRadius = edge.Curve.Radius
    break

# For text string:
FaceList = []
SelStrings = Gui.Selection.getSelection()[1].Shape.Wires
wire0 = SelStrings[0]
p1 = wire0.Edges[0].Curve.StartPoint
p2 = wire0.Edges[0].Curve.EndPoint
p3 = wire0.Edges[1].Curve.EndPoint
va = p1 - p2
vb = p3 - p2
SketchNormal = ( va.cross( vb ) ).normalize()
TangencyPoint = AxisPoint + SketchNormal*CylinderRadius
CylRevPlane = ( SketchNormal.cross( AxisDirection ) ).normalize() # perpendicular

for wire in SelStrings:
  def H( n, m ):
    #Hamilton product
    w = n[0]*m[0] - n[1]*m[1] - n[2]*m[2] - n[3]*m[3]
    i = n[0]*m[1] + n[1]*m[0] + n[2]*m[3] - n[3]*m[2]
    j = n[0]*m[2] - n[1]*m[3] + n[2]*m[0] + n[3]*m[1]
    k = n[0]*m[3] + n[1]*m[2] - n[2]*m[1] + n[3]*m[0]
    return ( w, i, j, k )

  def RotateVector( V, Axis, alpha ):
    #Rotate 3d vector with axis and angle using quaternions
    csa2 = cos( alpha / 2.0 )
    ssa2 = sin( alpha / 2.0 )
    R = ( csa2, ssa2*Axis[0], ssa2*Axis[1], ssa2*Axis[2] )
    RT = ( csa2, -ssa2*Axis[0], -ssa2*Axis[1], -ssa2*Axis[2] )
    V = ( 0, V[0], V[1], V[2] )
    RV = H( H( R, V ), RT )
    return ( RV[1], RV[2], RV[3] )

  #projectpointocylinder
  def point2Cyl(p):
    # input p = FreeCAD.Vector( x, y, z )
    L0 = FreeCAD.Vector(p)
    L1 = FreeCAD.Vector(p)
    E_TGL_P0A = L0.projectToPlane( TangencyPoint, CylRevPlane )
    E_TGL_P0B = L1.projectToPlane( TangencyPoint, CylRevPlane ).projectToPlane( AxisPoint, SketchNormal )
    VBA = E_TGL_P0A - E_TGL_P0B 
    VBA_N = (E_TGL_P0A - E_TGL_P0B  ).normalize()
    ARC_RAD = ( p - E_TGL_P0A ).Length / CylinderRadius
    # Turn direction
    Aux_VRotA = FreeCAD.Vector( RotateVector( VBA_N, AxisDirection, ARC_RAD ) )
    Aux_VRotB = FreeCAD.Vector( RotateVector( VBA_N, AxisDirection*-1, ARC_RAD ) )
    if (Aux_VRotA - p ).Length > ( Aux_VRotB - p ).Length:
      VRot =  Aux_VRotB

    else:
      VRot = Aux_VRotA

    RP0 = FreeCAD.Vector(VRot).multiply( CylinderRadius ) + E_TGL_P0B
    return RP0
  
  
  WireBS = []
  for edge in wire.Edges:
    points = []
    for i in range(100):
      p = edge.valueAt( edge.Length*i / 100.0 )
      rp = point2Cyl(p)
      points.append( rp )

    rp = point2Cyl( edge.Curve.EndPoint )
    points.append( rp )

    SPL = Part.BSplineCurve()
    SPL.interpolate( points )
    SPL = SPL.toShape()
    WireBS.append( SPL )
  
  Face = Part.makeFilledFace( WireBS )
  FaceList.append( Face )


Compound = Part.Compound( FaceList )
Part.show( Compound )


To use it,  create a cylinder, place a string tangent to it; select the cylindrical surface and the text; run the script. Is very important that the font type of the text is made from straight lines, otherwise it will fail. The font I've used for testing is "UASquare".

Next step is to get it to work with circular edges.

UPDATE 1


The script for sketches is almost working, some screenshots:


Top view of the generated frame:


Generated frame:



This is the step that I'm trying to automatize:


Create faces from edges, create shell from faces, create solid from shell.


Bye!!

Tuesday 17 March 2015

FreeCAD: Shell Ecomarathon Prototype Cover

 ... or FreeCAD to the real world without 3d printing, but a 3 meters CNC mill:

 

Updated ( because we won!! :D )


Prototype Dátil 15 wins the European SEM on Ethanol



 

UPDATED: 


The result: 





On the news

 The story:

I am member of the UMH Team, a group of students that build a prototype car to race at the Shell Ecomarathon, an event that this year takes place at Rotterdam. Currently, we are in the first position of the spanish championship, leading it in the combustion category, with a fuel consumption of 1223 kilometers / litre of ethanol. In the European competition, we have been at the top ten, but past edition we finished 13th at combustion category and 3rd on ethanol.

This year we are building a completely new car that we hope bring us to the podium.


What I am showing here is the cover of the new prototype, that I designed using FreeCAD, simulated using SolidWorks, and later converted to CNC code using Hypermill. Special thanks go to Volund Group for their help and support.

The FreeCAD part:

The cover is designed using already existing tools, basically is a loft going through several sketches that I placed using a simple script.

This is the first one I did, just to test if FreeCAD was able to acomplish this work.



The car frame was made with Autodesk Inventor and imported as IGES, then I started to create the sketch-ribs and finally a loft through all them. I adjusted the sketches to obtain the desired shape. Once happy with it, I made the windows and a basic visibility test to ensure we are compliance with the rules of the race.

The rules specify that a pilot must be able to see a polar array of cylinders that are around the car with an angle of 30 degrees between each one.



Thanks to FreeCADs perspective view, I could check window sizes and do some optimization.

This is the pilot's point of view


Simulation:

The covering was simulated using SolidWorks, resulting in a Cx of 0.33.



Milling:

Once we performed another tests and confirmed that everything was ready, we started to machine a foam block to create a positive mould. We have used a medium-sized CNC milling center (Volund Group) that can handle the 3000 mm of length of this car:


Raw block:



Rough pass:



Smoothing pass:

 

The smoothing pass is finishing as I write this. What we are doing next is to epoxy and fiberglass it to create the negative mould and then, do the carboon fiber cover. I will edit this post to upload finished pictures.


I hope this serves an example of real world usage of FreeCAD, beyond 3D printing.

Maybe I do a tutorial to show how to model surfaces like this prototype cover, stay tuned. 

Bye!