Commit 684e385c authored by Richard Bowman's avatar Richard Bowman 🔬

Merged in thumbwheels branch

parents e858cdb5 52e94d4e
Pipeline #82483436 failed with stage
in 2 minutes and 32 seconds
This diff is collapsed.
......@@ -11,9 +11,14 @@ the repository and is versioned, so most people never need to run this script.
"""
body_versions = [size + motors + brim for size in ["LS65", "LS75"]
for motors in ["-M", ""]
for motors in ["-M"] # NB we only want versions with motor lugs!
for brim in ["", "_brim"]]
match_body_versions = [size + motors + brim for size in ["LS65", "LS75"]
for motors in ["-M", ""] # Non-lugged versions are needed for optics modules
for brim in ["", "_brim"]]
# NB the above ugly hack restores the non-motorised bodies, for the purposes of the optics modules
# (optics modules are named LS65 etc. which will only match the now-obsolete versions without
# motor lugs. This will all be fixed in the new build system much more nicely!)
cameras = ["picamera_2", "logitech_c270", "m12"]
lenses = ["pilens", "c270_lens", "m12_lens", "rms_f40d16", "rms_f50d13", "rms_infinity_f50d13"]
optics_versions_LS65 = ["picamera_2_pilens", "logitech_c270_c270_lens"]
......@@ -27,7 +32,7 @@ def body_parameters(version):
"""Retrieve the parameters we pass to OpenSCAD to generate the given body version."""
p = {"motor_lugs": False, "sample_z":-1, "big_stage":None}
matching_version = ""
for v in body_versions: # first, pick the longest matching version string.
for v in match_body_versions: # first, pick the longest matching version string.
if v in version and len(v) > len(matching_version):
matching_version = v
m = re.match("(LS|SS)([\d]{2})((-M){0,1})((_brim){0,1})", matching_version)
......@@ -42,7 +47,7 @@ def optics_module_parameters(version):
m = re.search("({cam})_({lens})_({body})".format(
cam="|".join(cameras),
lens="|".join(lenses),
body="|".join(body_versions)),
body="|".join(match_body_versions)),
version)
if m is None:
raise ValueError("Error finding optics module parameters from version string '{}'".format(version))
......@@ -51,7 +56,7 @@ def optics_module_parameters(version):
return p
def stand_parameters(version):
m = re.match("({body})-([\d]+)$".format(body="|".join(body_versions)), version)
m = re.match("({body})-([\d]+)$".format(body="|".join(match_body_versions)), version)
p = body_parameters(m.group(1))
p["h"] = int(m.group(2))
return p
......@@ -117,7 +122,7 @@ if __name__ == "__main__":
M("TOOLS := actuator_assembly_tools lens_tool")
M("TOOLS := $(TOOLS) picamera_2_cover picamera_2_gripper picamera_2_lens_gripper actuator_drilling_jig")
M("ACCESSORIES := picamera_2_cover $(sample_riser_versions:%=sample_riser_%) $(slide_riser_versions:%=slide_riser_%) microscope_stand microscope_stand_no_pi motor_driver_case back_foot")
M("COMMONPARTS := feet feet_tall gears sample_clips small_gears")
M("COMMONPARTS := feet feet_tall gears sample_clips small_gears thumbwheels")
M("BODIES := $(body_versions:%=main_body_%)")
M("OPTICS := $(optics_versions:%=optics_%) camera_platform_picamera_2_LS65 camera_platform_6led_LS65 lens_spacer_picamera_2_pilens_LS65 lens_spacer_picamera_2_pilens_LS75")
M("ILLUMINATIONS := illumination_dovetail condenser")
......@@ -142,7 +147,7 @@ if __name__ == "__main__":
M("$(OUTPUT)/main_body_" + version + ".stl: $(SOURCE)/main_body.scad $(main_body_deps)")
M(openscad_recipe_baked(**body_parameters(version)))
M("")
for version in body_versions:
for version in match_body_versions:
M("$(OUTPUT)/illumination_dovetail_" + version + ".stl: $(SOURCE)/illumination_dovetail.scad $(main_body_deps) $(SOURCE)/illumination.scad")
M(openscad_recipe_baked(**body_parameters(version)))
M("$(OUTPUT)/condenser_" + version + ".stl: $(SOURCE)/condenser.scad $(main_body_deps) $(SOURCE)/illumination.scad")
......
......@@ -31,6 +31,7 @@ function gear_c2c_distance() = c2c_distance;
function gear_ratio() = ratio;
function small_gear_spacing() = c2c_distance/(ratio + 1)*2 + 4;
function large_gear_spacing() = c2c_distance/(1/ratio + 1)*2 + 4;
function thumbwheel_spacing() = 44;
//pitch radius = Nteeth * circular_pitch / 360
//pitch radius is centre of gear to meshing point
......@@ -94,21 +95,32 @@ module small_gear(){
module thumbwheel(r=10,h=5,knobble_r=1,knobble_angle=45,chamfer=0.5){
knobble_length=knobble_r * sin(knobble_angle) * 2;
n_knobbles = floor(2*3.141*r/knobble_length);
difference(){
intersection(){
union(){
for(i=[1:n_knobbles]) rotate(i/n_knobbles*360){
translate([0,r-knobble_r,0]) cylinder(r=knobble_r,h=h,$fn=16);
}
cylinder(r=r-knobble_r,h=h,$fn=n_knobbles);
lobe_r = 10;
lobe_h = 5;
base_low_r = 10;
base_up_r = 12;
base_h = 12.5;
n_lobe = 6;
difference()
{
union()
{
cylinder(r1=base_low_r,r2=base_up_r,h=base_h);
for( n = [0 : n_lobe-1] )
{
deg = 360*n/n_lobe;
translate([lobe_r*sin(deg),lobe_r*cos(deg),base_h]){cone_cyl(r=lobe_r,lobe_h=5);}
}
cylinder(r1=r-knobble_r-chamfer, r2=r-knobble_r-chamfer+999,h=999,$fn=n_knobbles);
translate([0,0,h-999])cylinder(r2=r-knobble_r, r1=r-knobble_r+999,h=999,$fn=n_knobbles);
}
translate([0,0,1.5]) nut(3,shaft=true,fudge=1.2,h=999);
}
module cone_cyl(r=5,h=5)
{
cylinder(r=r,h=h);
translate([0,0,-h]){cylinder(r1=.1,r2=r,h=h);}
}
}
module motor_clearance(h=15){
......@@ -139,4 +151,5 @@ module motor_and_gear_clearance(gear_h=10, h=999){
//translate([c2c_distance*2,00]) small_gear();
//thumbwheel();
//motor_and_gear_clearance();
repeat([0,large_gear_spacing(),0],3,center=true) large_gear();
\ No newline at end of file
repeat([0,large_gear_spacing(),0],3,center=true) large_gear();
//repeat([0,thumbwheel_spacing(),0],3,center=true) thumbwheel();
\ No newline at end of file
// This generates the thumbwheels, more finger-friendly alternatives to the gears
use <gears.scad>;
use <utilities.scad>;
repeat([0,thumbwheel_spacing(),0],3,center=true) thumbwheel();
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment