// Drawing for 3D-print objects to mount an arduino, stepper motor, and ultrasound sensor to form a scanning radar (or sonar). // Uses libraries for the arduino and sensor. // Daniel Sjöberg, 2017-12-29 include unoDimensions = boardDimensions(UNO); //translate([0, 0, 2*unoDimensions[2]]) arduino(); //translate([-30, 0, 30]) motor(); //$fn=1000; $fa=1; $fs=0.5; //$fn=100; union() { bumper(UNO); translate([-45, 33, 0]) bumperMotorDriver(); translate([-31, 11, 0]) motorHolder(); // Connecting structures for mechanical stability difference() { translate([-49, -5, 0]) cube([107, 78, 2]); translate([-49, -5, -0.1] + [5, 5, 0]) cube([107, 78, 2.2] - [10, 10, 0]); } translate([50, 65, 0]) cube([5, 5, 2]); translate([-1.5, 65, 0]) cube([15, 5, 2]); translate([-47, -1.4, 0]) cube([34, 5, 2]); translate([-18, 20, 0]) cube([5, 13, 2]); translate([-13, 45, 0]) cube([15, 5, 2]); translate([-13, 18, 0]) cube([15, 5, 2]); } module bumperMotorDriver() { bumperBaseHeight = 2; bumperHeight = bumperBaseHeight + pcbHeight + 0.5; dimensions = [31.75, 34.76, 1.5]; rimThickness = 1.4; union() { // Outer rim of bumper difference() { translate([-rimThickness, -rimThickness, 0]) cube([dimensions[0]+2*rimThickness, dimensions[1]+2*rimThickness, bumperHeight]); translate([0, 0, -bumperHeight]) cube(dimensions + [0, 0, 3*bumperHeight]); } // Base of bumper difference() { translate([-rimThickness, -rimThickness, 0]) cube([dimensions[0]+2*rimThickness, dimensions[1]+2*rimThickness, bumperBaseHeight]); translate([rimThickness, rimThickness, -bumperBaseHeight]) cube(dimensions + [-2*rimThickness, -2*rimThickness, 3*bumperBaseHeight]); } // Mounting holes translate([1.3+mountingHoleRadius, 1.3+mountingHoleRadius, 0]) difference() { cylinder(r = mountingHoleRadius + 1.5, h=bumperBaseHeight); translate([0, 0, -bumperBaseHeight]) cylinder(r = mountingHoleRadius, h=3*bumperBaseHeight); } translate([dimensions[0]-1.3-mountingHoleRadius, 1.3+mountingHoleRadius, 0]) difference() { cylinder(r = mountingHoleRadius + 1.5, h=bumperBaseHeight); translate([0, 0, -bumperBaseHeight]) cylinder(r = mountingHoleRadius, h=3*bumperBaseHeight); } translate([1.3+mountingHoleRadius, dimensions[1]-1.3-mountingHoleRadius, 0]) difference() { cylinder(r = mountingHoleRadius + 1.5, h=bumperBaseHeight); translate([0, 0, -bumperBaseHeight]) cylinder(r = mountingHoleRadius, h=3*bumperBaseHeight); } translate([dimensions[0]-1.3-mountingHoleRadius, dimensions[1]-1.3-mountingHoleRadius, 0]) difference() { cylinder(r = mountingHoleRadius + 1.5, h=bumperBaseHeight); translate([0, 0, -bumperBaseHeight]) cylinder(r = mountingHoleRadius, h=3*bumperBaseHeight); } } } module motor(){ radiusMotor = 28.0/2; heightMotor = 19.2; extraRadius = 31.0 - 28.0; extraWidth = 17.25; holeInner = 4.1/2; holeOuter = 7.0/2; plateThickness = 0.8; diameter = 41.9; color("Grey") union() { cylinder(r=radiusMotor, h=heightMotor); translate([radiusMotor-extraRadius, -extraWidth/2, 0]) cube([2*extraRadius, extraWidth, heightMotor]); difference() { union() { translate([-holeOuter, -diameter/2+holeOuter, heightMotor-plateThickness]) cube([2*holeOuter, diameter-2*holeOuter, plateThickness]); translate([0, diameter/2-holeOuter, heightMotor-plateThickness]) cylinder(r=holeOuter, h=plateThickness); translate([0, -diameter/2+holeOuter, heightMotor-plateThickness]) cylinder(r=holeOuter, h=plateThickness); } translate([0, diameter/2-holeOuter, heightMotor-plateThickness-0.1]) cylinder(r=holeInner, h=plateThickness+0.2); translate([0, -diameter/2+holeOuter, heightMotor-plateThickness-0.1]) cylinder(r=holeInner, h=plateThickness+0.2); } } } module motorHolder(){ bumperBaseHeight = 2.0; wallThickness = 1.0; wallHeight = 10.0; radiusMotor = 28.0/2; heightMotor = 19.2; extraRadius = 31.0 - 28.0; extraWidth = 17.25; holeInner = 4.1/2; holeOuter = 7.0/2; plateThickness = 0.8; diameter = 41.9; union() { difference() { union() { cylinder(r=radiusMotor+wallThickness, h=bumperBaseHeight); translate([radiusMotor-extraRadius, -extraWidth/2-wallThickness, 0]) cube([2*extraRadius+wallThickness, extraWidth+2*wallThickness, bumperBaseHeight]); } translate([0, 0, -0.1]) cylinder(r=radiusMotor-wallThickness, h=bumperBaseHeight+0.2); } translate([0, 0, bumperBaseHeight]) linear_extrude(height=wallHeight) { difference() { offset(delta=wallThickness) { union() { circle(r=radiusMotor); translate([radiusMotor-extraRadius, -extraWidth/2]) square([2*extraRadius, extraWidth]); } } union() { circle(r=radiusMotor); translate([radiusMotor-extraRadius, -extraWidth/2]) square([2*extraRadius, extraWidth]); } } } } }