From 4f03e642ef36d24f14ac5769200cb520604b9cb0 Mon Sep 17 00:00:00 2001 From: "Schoenberger, Philipp" Date: Fri, 15 Feb 2019 12:38:04 +0100 Subject: [PATCH] add usb connector at better position for current remote top case since its already printed with incorrect position add gears lib --- 3d/lib/gear_v1.1.scad | 174 ++++++++++++++++++++++++++++++++++++++++++ 3d/remote.scad | 125 ++++++++++++++++++++++++++---- 2 files changed, 283 insertions(+), 16 deletions(-) create mode 100644 3d/lib/gear_v1.1.scad diff --git a/3d/lib/gear_v1.1.scad b/3d/lib/gear_v1.1.scad new file mode 100644 index 0000000..a76c607 --- /dev/null +++ b/3d/lib/gear_v1.1.scad @@ -0,0 +1,174 @@ +////////////////////////////////////////////////////////////////////////////////////////////// +// Public Domain Parametric Involute Spur Gear (and involute helical gear and involute rack) +// version 1.1 +// by Leemon Baird, 2011, Leemon@Leemon.com +//http://www.thingiverse.com/thing:5505 +// +// This file is public domain. Use it for any purpose, including commercial +// applications. Attribution would be nice, but is not required. There is +// no warranty of any kind, including its correctness, usefulness, or safety. +// +// This is parameterized involute spur (or helical) gear. It is much simpler and less powerful than +// others on Thingiverse. But it is public domain. I implemented it from scratch from the +// descriptions and equations on Wikipedia and the web, using Mathematica for calculations and testing, +// and I now release it into the public domain. +// +// http://en.wikipedia.org/wiki/Involute_gear +// http://en.wikipedia.org/wiki/Gear +// http://en.wikipedia.org/wiki/List_of_gear_nomenclature +// http://gtrebaol.free.fr/doc/catia/spur_gear.html +// http://www.cs.cmu.edu/~rapidproto/mechanisms/chpt7.html +// +// The module gear() gives an involute spur gear, with reasonable defaults for all the parameters. +// Normally, you should just choose the first 4 parameters, and let the rest be default values. +// The module gear() gives a gear in the XY plane, centered on the origin, with one tooth centered on +// the positive Y axis. The various functions below it take the same parameters, and return various +// measurements for the gear. The most important is pitch_radius, which tells how far apart to space +// gears that are meshing, and adendum_radius, which gives the size of the region filled by the gear. +// A gear has a "pitch circle", which is an invisible circle that cuts through the middle of each +// tooth (though not the exact center). In order for two gears to mesh, their pitch circles should +// just touch. So the distance between their centers should be pitch_radius() for one, plus pitch_radius() +// for the other, which gives the radii of their pitch circles. +// +// In order for two gears to mesh, they must have the same mm_per_tooth and pressure_angle parameters. +// mm_per_tooth gives the number of millimeters of arc around the pitch circle covered by one tooth and one +// space between teeth. The pitch angle controls how flat or bulged the sides of the teeth are. Common +// values include 14.5 degrees and 20 degrees, and occasionally 25. Though I've seen 28 recommended for +// plastic gears. Larger numbers bulge out more, giving stronger teeth, so 28 degrees is the default here. +// +// The ratio of number_of_teeth for two meshing gears gives how many times one will make a full +// revolution when the the other makes one full revolution. If the two numbers are coprime (i.e. +// are not both divisible by the same number greater than 1), then every tooth on one gear +// will meet every tooth on the other, for more even wear. So coprime numbers of teeth are good. +// +// The module rack() gives a rack, which is a bar with teeth. A rack can mesh with any +// gear that has the same mm_per_tooth and pressure_angle. +// +// Some terminology: +// The outline of a gear is a smooth circle (the "pitch circle") which has mountains and valleys +// added so it is toothed. So there is an inner circle (the "root circle") that touches the +// base of all the teeth, an outer circle that touches the tips of all the teeth, +// and the invisible pitch circle in between them. There is also a "base circle", which can be smaller than +// all three of the others, which controls the shape of the teeth. The side of each tooth lies on the path +// that the end of a string would follow if it were wrapped tightly around the base circle, then slowly unwound. +// That shape is an "involute", which gives this type of gear its name. +// +////////////////////////////////////////////////////////////////////////////////////////////// + +//An involute spur gear, with reasonable defaults for all the parameters. +//Normally, you should just choose the first 4 parameters, and let the rest be default values. +//Meshing gears must match in mm_per_tooth, pressure_angle, and twist, +//and be separated by the sum of their pitch radii, which can be found with pitch_radius(). +module gear ( + mm_per_tooth = 3, //this is the "circular pitch", the circumference of the pitch circle divided by the number of teeth + number_of_teeth = 11, //total number of teeth around the entire perimeter + thickness = 6, //thickness of gear in mm + hole_diameter = 3, //diameter of the hole in the center, in mm + twist = 0, //teeth rotate this many degrees from bottom of gear to top. 360 makes the gear a screw with each thread going around once + teeth_to_hide = 0, //number of teeth to delete to make this only a fraction of a circle + pressure_angle = 28, //Controls how straight or bulged the tooth sides are. In degrees. + clearance = 0.0, //gap between top of a tooth on one gear and bottom of valley on a meshing gear (in millimeters) + backlash = 0.0 //gap between two meshing teeth, in the direction along the circumference of the pitch circle +) { + assign(pi = 3.1415926) + assign(p = mm_per_tooth * number_of_teeth / pi / 2) //radius of pitch circle + assign(c = p + mm_per_tooth / pi - clearance) //radius of outer circle + assign(b = p*cos(pressure_angle)) //radius of base circle + assign(r = p-(c-p)-clearance) //radius of root circle + assign(t = mm_per_tooth/2-backlash/2) //tooth thickness at pitch circle + assign(k = -iang(b, p) - t/2/p/pi*180) { //angle to where involute meets base circle on each side of tooth + difference() { + for (i = [0:number_of_teeth-teeth_to_hide-1] ) + rotate([0,0,i*360/number_of_teeth]) + linear_extrude(height = thickness, center = true, convexity = 10, twist = twist) + polygon( + points=[ + [0, -hole_diameter/10], + polar(r, -181/number_of_teeth), + polar(r, r; use ; $fn=64; -show_top =1; -show_bottom =1; -show_strapholder =1; -show_joysticks =1; +show_top =0; +show_bottom =0; +show_strapholder =0; +show_joysticks =0; show_grip =1; -show_electronics =1; enable_text_engrave =0; -show_switch =1; -show_lcd =1; -show_sticks =1; -show_stm32 =1; -show_antenna =1; -show_cc2500 =1; -show_batery_charger =1; -show_batery =1; -show_joysticks_pcb =1; +show_switch =0; +show_lcd =0; +show_sticks =0; +show_stm32 =0; +show_antenna =0; +show_cc2500 =0; +show_batery_charger =0; +show_batery =0; +show_joysticks_pcb =0; +show_usb_connector =0; show_stands=0; @@ -79,6 +79,10 @@ rot_batery_charger=[0,0,90]; pos_batery=[-40,-10.25,-16]; rot_batery=[0,0,90]; pos_strap_holder=[0,10,3]; + +pos_usb_connector=[30,-65,-20]; +rot_usb_connector=[0,0,90]; + strap_screw_dist=13.5; remote_top_plate_1=[140,110,0]; @@ -160,6 +164,11 @@ module remote() { } } + if(show_usb_connector) { + translate(pos_usb_connector) + rotate(rot_usb_connector) + usb_connector_pcb(); + } // stands if(show_stands) @@ -185,6 +194,7 @@ module remote() { if(show_strapholder) strapholder(); + } module strapholder() { eps=0.1; @@ -465,6 +475,8 @@ module top_case() { } } + + // stick cutouts color("orange") for(i=[1,-1]) { @@ -650,6 +662,20 @@ module bottom_case() { aligned_cube([8,7,3], [1,1,1]); } } + + // usb connector cutout + color("red") { + w=1.5; + translate(pos_usb_connector) + rotate(rot_usb_connector) + rotate([0,0,180]) { + translate([4+w, 0,-1]) { + aligned_rounded_cube([8,12,8], 3, [0,1,1]); + translate([-w-eps, 0,4]) // undo moveing + aligned_cube([8,7,3.75], [1,1,1]); + } + } + } } //bot_screw holes @@ -786,12 +812,12 @@ module stm32_bluepill() { } } -module usb_micro() { +module usb_micro(aligned=[2,1,0]) { color("Silver") difference() { size= [7.45, 6, 2.5]; - aligned_cube(size,[2,1,0]); + aligned_cube(size,aligned); } } @@ -1079,6 +1105,73 @@ module top_bottom_case_srews(l=26+2.5,head=50, h=2.1) { //cylinder(d=screw_head_d, h=h_screw2); cylinder($fn=6, r=w / 2 / cos(180 / 6) + 0.05, h=h_female_screw); } +} +module usb_connector_pcb() { + eps=0.01; + usb_pcb_size=[15.6,13.3,1.6]; + + difference() { + union() { + color("lightblue") { + aligned_cube(usb_pcb_size, [0,1,0]); + } + + + //screw connectors plates + color("silver") { + for(i=[1,-1]) { + translate([9.3, i*4.5, -eps]) + cylinder(d=3.5,h=usb_pcb_size[2]+eps*2); + } + } + + // pin connectors plates + { + names= [ "GND", "ID", "D+", "D-", "5V"]; + for(i=[0,1,2,3,4]) { + translate([9.3+4.81, (i-2)*2.54, -eps]) { + color("silver") + cylinder(d=1.5,h=usb_pcb_size[2]+eps*2); + + color("black") + translate([-1.5,0,usb_pcb_size[2]]) + linear_extrude(height = 2*eps) + rotate([0,0,90]) + text( + halign="center", + valign="center", + size=0.75, + font=font, + names[i] + ); + } + } + } + // usb micro + translate([0,0,usb_pcb_size[2]]) + usb_micro([0,1,0]); + + } + + //screw holes + color("silver") { + for(i=[1,-1]) { + translate([9.3, i*4.5, -2*eps]) + cylinder(d=3,h=usb_pcb_size[2]+eps*4); + } + } + + // pin connectors + color("silver") { + for(i=[-2,-1,0,1,2]) { + translate([9.3+4.81, i*2.54, -2*eps]) + cylinder(d=1,h=usb_pcb_size[2]+eps*4); + } + } + } + + + } remote(); ///left_right_grip_srews();