Mittwoch, 27. November 2013

Constructing and building a Hexacopter with Openscad

Hi, this is my first x-copter post and also my first blog post in english. (Wenn Sie den Blog lieber in deutsch lesen wollen, so lassen Sie es mich wissen - Danke.)

In this post I will show you how one can construct a multicopter (hexacopter) with Openscad. Openscad is a free software, available for Linux, Windows and Mac OS X, which can be used to create solid 3D CAD models. Despite other software, such as Blender, it's focus is on construction aspects and not on artistic design aspects. In this way it is comparable to Catia, Solidworks, AutoCad, etc. However, the difference to the aforementioned modelling tools is that Openscad is less interactive, that means your 3D models are created more like computer programs and are rendered by a compiler. At first hand, this sounds weird and difficult, but after time one learns to love the new flexibility. Another important aspect of Openscad is it's ability to export to various file formats, e.g., DXF and STL. This way, one can easily create models for 3D printers or cnc routers.

The idea behind this tutorial is to help others to get started doing something useful with Openscad. For me it seemed a littlebit difficult to construct nice looking shapes and to fully utilize the tool chain (3D printing and CNC routing). Please feel free to improve my approach to Openscad! Please read the offical Openscad tutorials before following my tutorial.

Okay, so let's get started. First, I want to explain what I want to build. My goal is to build a hexacopter which will be my experimental platform for testing equipment etc. It should be capable of carrying neat stuff like FPV equipment (osd, cam, transmitter), GPS, larger batteries, gimbals, etc.

So how do we get started, well, we first need a center plate. So lets create one... First we need something where we can mount the six beams. I will call that area beam support.

1: beamsupport = 30;
2: square([beamsupport,beamsupport],center=true);


Next, let's duplicate and rotate that area to create six support areas for the six beams.
 
1:  baseplatedia = 140;
2:  beamsupport = 30;
3:  for(i=[0:5]) {
4:   rotate([0,0,360/6*i])
5:   translate([baseplatedia/2-beamsupport/2,0,0])
6:    square([beamsupport,beamsupport],center=true);
7:  }
 

On line 1 and 2 we have introduced some variables, baseplatedia which is the maximum dia of the base plate and beamsupport which is the above mentioned support area. Then we have created a loop (line 3) that will rotate (line 4) our axes by multiples of 60 degrees (at most 6 times). This way it is possible to place the beam support areas. We have also added a translation to move the support areas to the outer diameters of our base plate (line 5). On line 6 the actual support area has been drawn. Now we have 6 independent and unconnected regions. In the next step we will connect these regions to the base plate by using the hull() function (see below line 3).
 
1:  baseplatedia = 140;
2:  beamsupport = 30;
3:  hull() {
4:   for(i=[0:5]) {
5:    rotate([0,0,360/6*i])
6:    translate([baseplatedia/2-beamsupport/2,0,0])
7:     square([beamsupport,beamsupport],center=true);
8:   }
9:  }


Now, we already have a simple base plate. Next we will round the corners. To round the corners the minkowski() function will be exploited. With minkowski it is possible to trace one object around the shape of another. That means if we trace a circle around a square, then the result will be a (larger) square with rounded corners. So let's do this.
 
1:  baseplatedia = 140;
2:  beamsupport = 30;
3:  corners = 5;
4:  hull() {
5:   for(i=[0:5]) {
6:    rotate([0,0,360/6*i])
7:    translate([baseplatedia/2-beamsupport/2-corners,0,0])
8:     minkowski() {
9:      circle(corners);
10:     square([beamsupport,beamsupport],center=true);
11:    }
12:  }
13: }


We have added the minkowski function (line 8) which traces a circle with radius corners (line 9) around the square (line 10). We have removed the size of the circle object from the desired translation of the support areas to get the requested overall diameter. Now we already have a nice looking basis for a center plate. So far, the complete object is a 2D object. In the next step we will extrude this object to a 3D object to get advantage of full 3D modelling. So let's do this.

1:  baseplatedia = 140;
2:  beamsupport = 30;
3:  corners = 5;
4:  linear_extrude(height=5){
5:   hull() {
6:    for(i=[0:5]) {
7:     rotate([0,0,360/6*i])
8:     translate([baseplatedia/2-beamsupport/2-corners,0,0])
9:      minkowski() {
10:      circle(corners);
11:      square([beamsupport,beamsupport],center=true);
12:     }
13:   }
14:  }
15: }



Now, we have a full 3D model and can start to add/place the beams, mounting holes etc. to finally arrive at my (not yet finished) final version.


Resources:

Kommentare:

  1. Es gibt keine Grenzen für den Fortschritt. Wie Steve Jobs gesagt hat "Innovation ist das, was macht den Unterschied zwischen Führer aus Anhänger."

    AntwortenLöschen
  2. Sie sind echt begabt! Sieht schön aus. Sie können Ihre Skizzen einem Business, dass auf Helicopterbau spezialisiert, verkaufen. Für Ihre Sicherheit, machen Sie dass lieber durch Datenraum anbieter

    AntwortenLöschen