Skip to content

Commit

Permalink
Servo nut / screw + Arduino
Browse files Browse the repository at this point in the history
  • Loading branch information
hugokernel committed Aug 1, 2012
1 parent b0eee64 commit fc432ef
Show file tree
Hide file tree
Showing 8 changed files with 305 additions and 15 deletions.
47 changes: 36 additions & 11 deletions cad/body.scad
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

use <servos.scad>
use <lib/servos.scad>
use <lib/arduino.scad>

$fn = 50;

Expand All @@ -11,6 +12,10 @@ BODY_SERVO_HOLE_DIAMETER = 6;
BODY_SERVO_HOLE_HEAD_SCREW_HEIGHT = 2;
BODY_SERVO_HOLE_HEAD_SCREW_DIAMETER = 10;

SERVO_HOLDER_SCREW_DIAMETER = 2;
SERVO_HOLDER_NUT_DIAMETER = 5;
SERVO_HOLDER_NUT_HEIGHT = 1.5;

SUPPORT_SPACE = 65.0;

RADIUS = 7;
Expand Down Expand Up @@ -118,8 +123,22 @@ module threaded_rod_holder(position, substract = false) {
}

module servo() {
rotate([0, 0, 90])
futabas3003(0, 0, 1);
rotate([0, 0, 90]) {
futabas3003() {
translate([0, 0, - BODY_THICKNESS - 1]) cylinder(h = BODY_THICKNESS + 2, r = SERVO_HOLDER_SCREW_DIAMETER / 2);
translate([0, 0, - BODY_THICKNESS - SERVO_HOLDER_NUT_HEIGHT]) {
cylinder(r = SERVO_HOLDER_NUT_DIAMETER / 2, h = SERVO_HOLDER_NUT_HEIGHT, $fn = 6);
}
}
}
}

module arduino(hole = 1) {
translate([35, -18, BODY_THICKNESS / 2 + 2]) {
rotate([0, 0, 90]) {
Arduino(hole);
}
}
}

module body() {
Expand All @@ -132,8 +151,8 @@ module body() {
rbox(length, width, thickness, RADIUS);

// Threaded rod
threaded_rod_holder([0, width / 2 - 11, THREADED_ROD_Z_POSITION], true);
threaded_rod_holder([0, - width / 2 + 11, THREADED_ROD_Z_POSITION], true);
threaded_rod_holder([0, width / 2 - 11, - THREADED_ROD_Z_POSITION], true);
threaded_rod_holder([0, - width / 2 + 11, - THREADED_ROD_Z_POSITION], true);

// Servo hole
translate([length / 2 - 20, 10, -23]) {
Expand All @@ -159,6 +178,9 @@ module body() {
translate([20, -30, -23]) {
servo();
}

// Arduino
arduino(1);
}

// Leg support
Expand Down Expand Up @@ -193,8 +215,8 @@ module body() {
}

// Threaded rod
threaded_rod_holder([0, width / 2 - 11, THREADED_ROD_Z_POSITION]);
threaded_rod_holder([0, - width / 2 + 11, THREADED_ROD_Z_POSITION]);
threaded_rod_holder([0, width / 2 - 11, - THREADED_ROD_Z_POSITION]);
threaded_rod_holder([0, - width / 2 + 11, - THREADED_ROD_Z_POSITION]);
}

module body_support() {
Expand All @@ -209,8 +231,8 @@ module body_support() {
rbox(length, width, thickness, RADIUS);

// Threaded rod
threaded_rod_holder([0, width / 2 - 11, - THREADED_ROD_Z_POSITION], true);
threaded_rod_holder([0, - width / 2 + 11, - THREADED_ROD_Z_POSITION], true);
threaded_rod_holder([0, width / 2 - 11, THREADED_ROD_Z_POSITION], true);
threaded_rod_holder([0, - width / 2 + 11, THREADED_ROD_Z_POSITION], true);
}

// Leg support
Expand Down Expand Up @@ -244,13 +266,16 @@ module body_support() {
}
}

threaded_rod_holder([0, width / 2 - 11, - THREADED_ROD_Z_POSITION]);
threaded_rod_holder([0, - width / 2 + 11, - THREADED_ROD_Z_POSITION]);
threaded_rod_holder([0, width / 2 - 11, THREADED_ROD_Z_POSITION]);
threaded_rod_holder([0, - width / 2 + 11, THREADED_ROD_Z_POSITION]);
}

if (1) {

body();

arduino(0);

translate([0, 0, SUPPORT_SPACE]) {
body_support();
}
Expand Down
2 changes: 1 addition & 1 deletion cad/body_cutted.scad
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

use <body.scad>;
use <dovetail.scad>;
use <lib/dovetail.scad>;

PART = 0;
SUPPORT = false;
Expand Down
2 changes: 1 addition & 1 deletion cad/demo.scad
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

use <servos.scad>
use <lib/servos.scad>
use <body.scad>
use <leg_holder.scad>
use <leg.scad>
Expand Down
2 changes: 1 addition & 1 deletion cad/demo_leg.scad
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

use <servos.scad>
use <lib/servos.scad>
use <leg_holder.scad>
use <leg.scad>

Expand Down
2 changes: 1 addition & 1 deletion cad/leg_holder.scad
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

include <servos.scad>
include <lib/servos.scad>

$fn = 25;

Expand Down
206 changes: 206 additions & 0 deletions cad/lib/arduino.scad
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
/* arduino.scad
*
* Copyright (C) Jestin Stoffel 2012
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

// Throughout this entire model, (0,0) is the top left mounting hole (nearest the USB port)

// thickness of the PCB
board_height = 1.8;

// solid_holes - specifies if mounting holes should be added to or subtracted from the model
// combined_headers - specifies if space should be left between adjacent female headers, or if they should be rendered as a single header
// extend_ports - extends the USB and power ports by a centimeter, so that holes are more easily made when a model is used as a negative
module Arduino(solid_holes, combined_headers, extend_ports)
{
echo(str("solid_holes: ", solid_holes));
echo(str("combined_headers: ", combined_headers));
echo(str("extend_ports: ", extend_ports));

if (solid_holes == 1)
{
echo("solid holes");
union()
{
Board();
USB(extend_ports);
PowerPlug(extend_ports);
FemaleHeaders(combined_headers);
MaleHeaders();
ResetButton();
ATMega();
MountingHoles();
}
}
else
{
echo("regular holes");
difference()
{
union()
{
Board();
USB(extend_ports);
PowerPlug(extend_ports);
FemaleHeaders(combined_headers);
MaleHeaders();
ResetButton();
ATMega();
}
MountingHoles();
}
}
}

module ResetButton()
{
translate([39, -26, board_height])
{
color([0.8, 0.8, 0.8])
cube([6, 6, 2.2]);

color([0.6, 0.4, 0.2])
translate([3, 3, 0]) cylinder(r=1.4, h=3.5, $fn=25);
}
}

module MaleHeaders()
{
color([0.6, 0.6, 0.6])
translate([0, 0, board_height])
{
translate([0, -7, 0]) cube([7, 5, 9.2]);
translate([47.5, -26, 0]) cube([5, 7, 9.2]);
}
}

module ATMega()
{
color([0.3, 0.3, 0.3])
translate([14, -39, board_height])
{
cube([35.5, 10, 7.5]);
}
}

module FemaleHeaders(combined)
{
color([0.3, 0.3, 0.3])
translate([0, 0, board_height])
{
translate([0, -1, 0])
{
translate([7, 0, 0])
{
if(combined == 1)
{
cube([43, 2, 8.2]);
}
else
{
cube([21, 2, 8.2]);
translate([22, 0, 0]) cube([21, 2, 8.2]);
}
}
}

translate([0, -50, 0])
{
translate([17, 0, 0])
{
if(combined == 1)
{
cube([33, 2, 8.2]);
}
else
{
cube([15.5, 2, 8.2]);
translate([17.5, 0, 0]) cube([15.5, 2, 8.2]);
}
}
}
}
}

module PowerPlug(extended)
{
if(extended == 1)
{
translate([-26.893, -47.4929962, board_height])
color([0.3, 0.3, 0.3])
cube([24, 9, 11]);
}
else
{
translate([-16.893, -47.4929962, board_height])
color([0.3, 0.3, 0.3])
cube([14, 9, 11]);
}
}

module USB(extended)
{
if(extended == 1)
{
translate([-31.465, -18.5623962, board_height])
color([0.8, 0.8, 0.8])
cube([26, 12, 11]);
}
else
{
translate([-21.465, -18.5623962, board_height])
color([0.8, 0.8, 0.8])
cube([16, 12, 11]);
}
}


module Board()
{
color([0, 0.6, 0.8])
linear_extrude(height = board_height, convexity = 10, twist = 0)
{
polygon( points = [ [-15.115, 2.545],
[49.4, 2.545],
[50.925, 1.021],
[50.925, -10.409],
[53.465, -12.949],
[53.465, -45.715],
[50.925, -48.255],
[50.925, -50.795],
[-15.115, -50.795] ],
paths = [[0, 1, 2, 3, 4, 5, 6, 7, 8]],
convexity = 10);
}
}

module MountingHoles()
{
translate([0, 0, -10])
{
ArduinoHole(25);
translate([-1.0929112, -48.4026972, 0]) ArduinoHole(25);
translate([51, -15.25, 0]) ArduinoHole(25);
translate([51, -43.25, 0]) ArduinoHole(25);
}
}

module ArduinoHole(length)
{
color([0.7, 0.7, 0.7])
cylinder(r=1, h=length, $fn=25);
}
File renamed without changes.
Loading

0 comments on commit fc432ef

Please sign in to comment.