1
0
mirror of https://github.com/nophead/Mendel90.git synced 2025-09-02 17:42:44 +02:00

New light and camera scheme.

Removed some assigns and child for new OpenScad.
Now renders the sheets for more responsive preview.
This commit is contained in:
Chris Palmer
2016-01-10 11:09:38 +00:00
parent 2459632962
commit 9daef0d573
25 changed files with 26512 additions and 41276 deletions

View File

@@ -1,9 +1,6 @@
light_strip_assembly: light_strip_assembly:
Vitamins: Vitamins:
2 M3 cap screw x 10mm 1 Rigid 5050 light strip x 290mm
2 Nyloc nut M3
1 Sanken SPS125 light strip
2 Washer M3 x 7mm x 0.5mm
Printed: Printed:
1 light_strip_bracket_left.stl 1 light_strip_bracket_left.stl

View File

@@ -1,19 +1,18 @@
raspberry_pi_camera_assembly: raspberry_pi_camera_assembly:
Vitamins: Vitamins:
2 M2 cap screw x 12mm 3 M2 cap screw x 12mm
2 M3 cap screw x 10mm 2 M3 cap screw x 16mm
7 M3 cap screw x 16mm 4 M3 hex screw x 12mm
2 Nyloc nut M2 3 Nyloc nut M2
9 Nyloc nut M3 6 Nyloc nut M3
1 Rigid 5050 light strip x 290mm
1 Raspberry PI camera 1 Raspberry PI camera
1 Sanken SPS125 light strip 3 Washer M2 x 5mm x 0.3mm
2 Washer M2 x 5mm x 0.3mm 6 Washer M3 x 7mm x 0.5mm
9 Washer M3 x 7mm x 0.5mm
Printed: Printed:
1 light_and_camera_brackets.stl
1 rear_light_brackets.stl
1 rpi_camera_back.stl 1 rpi_camera_back.stl
1 rpi_camera_bar.stl 1 rpi_camera_case.stl
1 rpi_camera_focus_ring.stl
1 rpi_camera_front.stl
2 rpi_light_clamp.stl

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

View File

@@ -78,6 +78,7 @@ include <../vitamins/bars.scad>
include <../vitamins/pullies.scad> include <../vitamins/pullies.scad>
include <../vitamins/extruders.scad> include <../vitamins/extruders.scad>
include <../vitamins/light_strips.scad> include <../vitamins/light_strips.scad>
include <../vitamins/raspberry_pi.scad>
module rod(d , l) { module rod(d , l) {
vitamin(str("RD", d, round(l), ": Smooth rod ", d, "mm x ", round(l), "mm")); vitamin(str("RD", d, round(l), ": Smooth rod ", d, "mm x ", round(l), "mm"));

View File

@@ -13,10 +13,13 @@ wall = 2;
width = 8; width = 8;
hinge = 5; hinge = 5;
rim = 1.2; rim = 1.2;
function frame_edge_clamp_pitch(length) = length - 2 * nut_flat_radius(M3_nut) - 2 * wall; min_length = 2 * nut_flat_radius(M3_nut) + 2 * wall;
function frame_edge_clamp_pitch(length) = length - min_length;
clamp_back_thickness = 2; clamp_back_thickness = 2;
clamp_thickness = 2 + M3_nut_trap_depth; nut_trap_depth = screw_head_height(M3_hex_screw);
clamp_thickness = 2 + nut_trap_depth;
clearance = 0.2; clearance = 0.2;
screw_d = 3; screw_d = 3;
@@ -28,88 +31,93 @@ pivot_h = 1.2;
function frame_edge_clamp_width() = total_width; function frame_edge_clamp_width() = total_width;
function frame_edge_clamp_thickness() = clamp_thickness; function frame_edge_clamp_thickness() = clamp_thickness;
function frame_edge_clamp_hinge() = total_width - width;
module frame_edge_clamp_front_stl(length = 20) { module frame_edge_clamp_front_stl(length = 20) {
l = length ? length : min_length;
w = total_width; w = total_width;
difference() { difference() {
union() { union() {
translate([0, 0, clamp_thickness / 2]) translate([-l / 2, -frame_edge_clamp_hinge(), 0])
cube([length, w, clamp_thickness], center = true); cube([l, w, clamp_thickness]);
if($children) if($children)
child(); children();
} }
for(side = [-1, 1]) for(side = [-1, 1])
translate([side * frame_edge_clamp_pitch(length) / 2, w / 2 - width - screw_d / 2, clamp_thickness]) translate([side * frame_edge_clamp_pitch(l) / 2, -screw_d / 2, clamp_thickness])
rotate([0, 0, 90]) rotate([0, 0, 90])
nut_trap(M3_clearance_radius, nut_radius(M3_nut), M3_nut_trap_depth); nut_trap(M3_clearance_radius, nut_radius(M3_nut), nut_trap_depth);
translate([0, - w / 2 + hinge / 2, 0]) translate([0, -frame_edge_clamp_hinge() + hinge / 2, 0])
cube([pivot_l(length) + 2 * clearance, pivot_w + 2 * clearance, pivot_h * 2], center = true); cube([pivot_l(l) + 2 * clearance, pivot_w + 2 * clearance, pivot_h * 2], center = true);
} }
} }
module frame_edge_clamp_back_stl(length = 20, gap = sheet_thickness(frame)) { module frame_edge_clamp_back_stl(length = 20, gap = sheet_thickness(frame)) {
l = length; l = length ? length : min_length;
w = total_width; w = total_width;
union() { union() {
difference() { difference() {
translate([-l / 2, -w / 2, 0]) translate([-l / 2, -frame_edge_clamp_hinge(), 0])
cube([l, w, clamp_back_thickness + gap - layer_height]); cube([l, w, clamp_back_thickness + gap - layer_height]);
translate([-l / 2 + wall, -w / 2 + hinge, clamp_back_thickness]) translate([-l / 2 + wall, -frame_edge_clamp_hinge() + hinge, clamp_back_thickness])
cube([l - 2 * wall, w, clamp_back_thickness + gap - layer_height]); cube([l - 2 * wall, w, clamp_back_thickness + gap - layer_height]);
translate([-l, w / 2 - width, clamp_back_thickness]) translate([-l, 0, clamp_back_thickness])
cube([2 * l, w, clamp_back_thickness + gap - layer_height]); cube([2 * l, w, clamp_back_thickness + gap - layer_height]);
for(side = [-1, 1]) for(side = [-1, 1])
translate([side * frame_edge_clamp_pitch(l) / 2, w / 2 - width - screw_d / 2, clamp_thickness]) translate([side * frame_edge_clamp_pitch(l) / 2, -screw_d / 2, clamp_thickness])
rotate([0, 0, 90]) rotate([0, 0, 90])
poly_cylinder(M3_clearance_radius, h = 100, center = true); poly_cylinder(M3_clearance_radius, h = 100, center = true);
} }
translate([0, - w / 2 + hinge / 2, clamp_back_thickness + gap]) translate([0, -frame_edge_clamp_hinge() + hinge / 2, clamp_back_thickness + gap])
cube([pivot_l(l), pivot_w, pivot_h * 2], center = true); cube([pivot_l(l), pivot_w, pivot_h * 2], center = true);
} }
} }
module frame_edge_clamp_assembly(length = 20, gap = sheet_thickness(frame), left = true) { module frame_edge_clamp_assembly(length = 20, gap = sheet_thickness(frame), hex_head = true, kids = false) {
kids = $children; l = length ? length : min_length;
screw_length = screw_longer_than(washer_thickness(M3_washer) screw_length = screw_longer_than(washer_thickness(M3_washer)
+ clamp_back_thickness + clamp_back_thickness
+ gap + gap
+ clamp_thickness + clamp_thickness
- M3_nut_trap_depth - nut_trap_depth
+ nut_thickness(M3_nut, true)); + nut_thickness(M3_nut, true));
color(left ? "lime" : "red") render() {
frame_edge_clamp_front_stl(length = length)
if(kids)
child();
}
translate([0, 0, -gap - clamp_back_thickness]) translate([0, 0, -gap - clamp_back_thickness])
color(left ? "red" : "lime") render() frame_edge_clamp_back_stl(length, gap); color("lime") render() frame_edge_clamp_back_stl(l, gap);
for(side = [-1, 1]) for(side = [-1, 1])
translate([side * frame_edge_clamp_pitch(length) / 2, total_width / 2 - width - screw_d / 2, -gap - clamp_back_thickness]) translate([side * frame_edge_clamp_pitch(l) / 2, -screw_d / 2, -gap - clamp_back_thickness])
rotate([0, 0, 90]) { rotate([0, 0, 90]) {
rotate([180, 0, 0]) rotate([180, 0, 0])
screw_and_washer(M3_cap_screw, max(screw_length, 16)); if(hex_head)
nut_and_washer(M3_nut, true);
else
screw_and_washer(M3_cap_screw, screw_length);
translate([0, 0, clamp_thickness + gap + clamp_back_thickness - M3_nut_trap_depth]) translate([0, 0, clamp_thickness + gap + clamp_back_thickness - nut_trap_depth])
nut(M3_nut, true); if(hex_head)
screw(M3_hex_screw, screw_length);
else
nut(M3_nut, true);
} }
color("red") render() {
frame_edge_clamp_front_stl(length = l)
if(kids)
children();
}
} }
module frame_edge_clamp_stl() { module frame_edge_clamp_stl() {

View File

@@ -5,29 +5,41 @@
// nop.head@gmail.com // nop.head@gmail.com
// hydraraptor.blogspot.com // hydraraptor.blogspot.com
// //
// Bracket to mount RPI // Bracket to mount an LED light strip behind the gantry
// //
include <conf/config.scad> include <conf/config.scad>
use <spool_holder.scad> use <spool_holder.scad>
use <fixing-block.scad> use <fixing-block.scad>
use <light_strip_clip.scad>
include <positions.scad> include <positions.scad>
light = light_strip ? light_strip : SPS125; wall = 2;
light = light_strip ? light_strip : RIGID5050_290;
use_screws = light_strip_has_holes(light);
use_clips = !use_screws;
z_offset = use_clips ? wall : 0;
y_offset = use_clips ? light_strip_clip_length(light) / 2 : light_strip_width(light) / 2;
x = (left_stay_x + right_stay_x) / 2; x = (left_stay_x + right_stay_x) / 2;
y = gantry_Y + sheet_thickness(frame) + spool_holder_gap(); y = gantry_Y + sheet_thickness(frame) + spool_holder_gap();
z = height - gantry_thickness + light_strip_set_back(light); z = height - gantry_thickness + light_strip_set_back(light);
angle = atan2(Y0 - y, z - bed_height); bracket_z = z + light_strip_thickness(light) + z_offset;
hypot = sqrt(sqr(bracket_z - bed_height) + sqr(Y0 - y));
angle = atan2(Y0 - y, bracket_z - bed_height) + asin(y_offset / hypot);
clearance = 0.5; clearance = 0.5;
boss_r = nut_radius(M3_nut) + 2; boss_r = nut_radius(M3_nut) + 2;
nut_trap_meat = 2; nut_trap_meat = 2;
bracket_thickness = 3; bracket_thickness = use_screws ? nut_trap_meat + nut_thickness(M3_nut, true) : 3;
bracket_width = spool_holder_gap() - clearance; bracket_width = min(spool_holder_gap() - clearance, light_strip_clip_length(light) * cos(angle));
bracket_length = (right_stay_x - left_stay_x - sheet_thickness(frame) - light_strip_hole_pitch(light)) / 2 + boss_r; bracket_length = use_screws ? (right_stay_x - left_stay_x - sheet_thickness(frame) - light_strip_hole_pitch(light)) / 2 + boss_r
bracket_height = height - z - light_strip_thickness(light); : (right_stay_x - left_stay_x - sheet_thickness(frame) - light_strip_length(light)) / 2 + light_strip_clip_depth(light);
bracket_height = height - z - light_strip_thickness(light) - (use_clips ? wall : 0);
bracket_stem = bracket_width - fixing_block_height(); bracket_stem = bracket_width - fixing_block_height();
stem_thickness = 3; stem_thickness = 3;
@@ -60,19 +72,10 @@ module light_strip_bracket() {
cube([stem_thickness, bracket_height, bracket_stem]); cube([stem_thickness, bracket_height, bracket_stem]);
translate([stem_thickness, bracket_thickness, 0]) translate([stem_thickness, bracket_thickness, 0])
right_triangle(width = bracket_length - bracket_thickness, height = bracket_width, h = bracket_thickness, center = false); right_triangle(width = bracket_length - stem_thickness, height = bracket_width, h = stem_thickness, center = false);
translate([-sheet_thickness(frame) - hook + hook_w / 2, bracket_height - hook_overlap + hook_h / 2, 0]) translate([-sheet_thickness(frame) - hook + hook_w / 2, bracket_height - hook_overlap + hook_h / 2, 0])
rounded_rectangle([hook_w, hook_h, bracket_stem], center = false, r = hook_r); rounded_rectangle([hook_w, hook_h, bracket_stem], center = false, r = hook_r);
hull() {
rotate([angle, 0, 0])
translate([bracket_length - boss_r, 0, light_strip_width(light) / 2])
rotate([-90, 0, 0])
cylinder(r = boss_r - eta, h = nut_trap_meat + nut_thickness(M3_nut, true));
translate([bracket_length - 2 * boss_r, bracket_thickness, 0])
cube([2 * (boss_r - eta), nut_trap_meat + nut_thickness(M3_nut, true) - bracket_thickness, 1]);
}
} }
translate([-slot, bracket_height - bracket_thickness - hook_overlap, -1]) translate([-slot, bracket_height - bracket_thickness - hook_overlap, -1])
cube([slot, bracket_thickness + hook_overlap, bracket_stem + 2]); cube([slot, bracket_thickness + hook_overlap, bracket_stem + 2]);
@@ -81,11 +84,13 @@ module light_strip_bracket() {
translate([0, -5, 0]) translate([0, -5, 0])
cube([100, 10, 100], center = true); cube([100, 10, 100], center = true);
translate([bracket_length - boss_r, nut_trap_meat + M3_nut_trap_depth, light_strip_width(light) / 2]) if(use_screws)
rotate([90, 0, 0]) translate([bracket_length - boss_r, nut_trap_meat + M3_nut_trap_depth,
nut_trap(M3_clearance_radius, M3_nut_radius, M3_nut_trap_depth, horizontal = true); light_strip_width(light) / 2 + light_strip_hole_pitch2(light) / 2])
rotate([90, 0, 0])
nut_trap(M3_clearance_radius, M3_nut_radius, M3_nut_trap_depth, horizontal = true);
translate([stem_thickness + wire_hole_r + layer_height, nut_trap_meat + M3_nut_trap_depth, light_strip_width(light) / 2]) translate([stem_thickness + wire_hole_r + layer_height, bracket_thickness + 1, light_strip_width(light) / 2])
rotate([90, 0, 0]) rotate([90, 0, 0])
teardrop_plus(r = wire_hole_r, h = 100); teardrop_plus(r = wire_hole_r, h = 100);
} }
@@ -106,39 +111,59 @@ module light_strip_brackets_stl() {
light_strip_bracket_left_stl(); light_strip_bracket_left_stl();
translate([-2 - 2 * (hook + sheet_thickness(frame)), 0, 0]) translate([-2 - 2 * (hook + sheet_thickness(frame)), 0, 0])
light_strip_bracket_right_stl(); light_strip_bracket_right_stl();
if(use_clips)
for(i = [0,1])
translate([-2, (i + 0.5) * (light_strip_clip_length(light) + 2), 0])
rotate([0, 0, 90])
light_strip_clip(light);
} }
module light_strip_assembly() { module light_strip_assembly() {
assembly("light_strip_assembly"); assembly("light_strip_assembly");
translate([x, y, z + light_strip_thickness(light)]) translate([x, y, bracket_z])
rotate([angle, 0, 0]) rotate([angle, 0, 0]) {
translate([0, -light_strip_width(light) / 2, - light_strip_thickness(light)]) translate([0, -y_offset, -z_offset])
light_strip(light); rotate([180, 0, 0])
light_strip(light);
translate([left_stay_x + sheet_thickness(frame) / 2, y, z + light_strip_thickness(light)]) if(use_clips)
for(side = [-1, 1])
translate([side * (light_strip_length(light) / 2), -y_offset, 0])
rotate([-90, 0, side * 90])
color(side < 0 ? "red": "lime") render() light_strip_clip(light);
}
translate([left_stay_x + sheet_thickness(frame) / 2, y, bracket_z])
rotate([90, 0, 0]) rotate([90, 0, 0])
color("lime") render() light_strip_bracket_left_stl(); color("lime") render() light_strip_bracket_left_stl();
translate([right_stay_x - sheet_thickness(frame) / 2, y, z + light_strip_thickness(light)]) translate([right_stay_x - sheet_thickness(frame) / 2, y, bracket_z])
rotate([90, 0, 0]) rotate([90, 0, 0])
color("red") render() light_strip_bracket_right_stl(); color("red") render() light_strip_bracket_right_stl();
for(side = [-1,1]) if(use_screws)
translate([x + side * light_strip_hole_pitch(light) / 2, y, z + light_strip_thickness(light)]) translate([x, y, bracket_z])
rotate([angle - 180, 0, 0]) rotate([angle - 180, 0, 0])
translate([0, light_strip_width(light) / 2, light_strip_thickness(light)]) { translate([0, light_strip_width(light) / 2, light_strip_thickness(light)])
screw_and_washer(M3_cap_screw, 10); light_strip_hole_positions(light) group() {
translate([0, 0, -nut_trap_meat - light_strip_thickness(light)]) screw_and_washer(M3_cap_screw, 10);
rotate([180, 0, 0])
nut(M3_nut, true);
}
*hull() { // light ray, should point at center of Y axis. translate([0, 0, -light_strip_thickness(light) - nut_trap_meat])
translate([x, y -light_strip_width(light) / 2, z]) rotate([180, 0, 0])
sphere(); nut(M3_nut, true);
translate([x, Y0, bed_height]) }
sphere();
} if(show_rays)
%hull() { // light ray, should point at center of Y axis.
translate([x, y, bracket_z])
rotate([angle, 0, 0])
translate([0, -y_offset, z - bracket_z])
sphere();
translate([x, Y0, bed_height])
sphere();
}
end("light_strip_assembly"); end("light_strip_assembly");
} }
@@ -146,7 +171,7 @@ module light_strip_assembly() {
if(1) if(1)
light_strip_assembly(); light_strip_assembly();
else else
if(1) if(0)
light_strip_bracket(); light_strip_bracket();
else else
light_strip_brackets_stl(); light_strip_brackets_stl();

View File

@@ -0,0 +1,33 @@
//
// Mendel90
//
// GNU GPL v2
// nop.head@gmail.com
// hydraraptor.blogspot.com
//
// Clip to fit around light strip profile
//
include <conf/config.scad>
wall = 2;
function light_strip_clip_depth(light) = 10;
function light_strip_clip_length(light) = light_strip_slot(light) + 2 * wall;
function light_strip_clip_width(light) = 2 + light_strip_thickness(light) + wall;
function light_strip_slot(light) = light_strip_width(light) + 0.2;
function light_strip_clip_gap(light) = light_strip_width(light) - 4;
module light_strip_clip(light) {
linear_extrude(height = light_strip_clip_depth(light), convexity = 2)
difference() {
translate([-light_strip_clip_length(light) / 2, 0])
square([light_strip_clip_length(light), light_strip_clip_width(light)]);
translate([-light_strip_slot(light) / 2, wall])
square([light_strip_slot(light), light_strip_thickness(light)]);
translate([-light_strip_clip_gap(light) / 2, wall])
square([light_strip_clip_gap(light),100]);
}
}
light_strip_clip(RIGID5050_290);

View File

@@ -247,7 +247,7 @@ module y_rail_holes() {
module y_carriage() { module y_carriage() {
difference() { difference() {
sheet(Y_carriage, Y_carriage_width, Y_carriage_depth, [3,3,3,3]); sheet(Y_carriage, Y_carriage_width, Y_carriage_depth, [Y_carriage_rad, Y_carriage_rad, Y_carriage_rad, Y_carriage_rad]);
translate([0, ribbon_clamp_y, 0]) translate([0, ribbon_clamp_y, 0])
rotate([180, 0, 0]) rotate([180, 0, 0])
@@ -490,52 +490,56 @@ module fixing_blocks(holes = false) {
h = fixing_block_height(); h = fixing_block_height();
t = sheet_thickness(frame); t = sheet_thickness(frame);
assign($upper = true) { // all screws into frame { // all screws into frame
$upper = true;
translate([left_stay_x + t / 2, gantry_Y + t, stay_height - base_clearance - h - w / 2]) // top translate([left_stay_x + t / 2, gantry_Y + t, stay_height - base_clearance - h - w / 2]) // top
rotate([0,-90,-90]) rotate([0,-90,-90])
child(); children();
translate([right_stay_x - t / 2, gantry_Y + t, stay_height - base_clearance - h - w / 2]) // top translate([right_stay_x - t / 2, gantry_Y + t, stay_height - base_clearance - h - w / 2]) // top
rotate([0,90, 90]) rotate([0,90, 90])
child(); children();
translate([left_stay_x + t / 2, gantry_Y + t, base_clearance + h + w / 2]) // front translate([left_stay_x + t / 2, gantry_Y + t, base_clearance + h + w / 2]) // front
rotate([0,-90,-90]) rotate([0,-90,-90])
child(); children();
translate([right_stay_x - t / 2, gantry_Y + t, base_clearance + h + w / 2]) // front translate([right_stay_x - t / 2, gantry_Y + t, base_clearance + h + w / 2]) // front
rotate([0,90, 90]) rotate([0,90, 90])
child(); children();
} }
assign($upper = false) { // one screw in the base { // one screw in the base
assign($rear = true) { $upper = true;
{
$rear = true;
translate([left_stay_x + t / 2, base_depth / 2 - base_clearance - w / 2, 0]) // back translate([left_stay_x + t / 2, base_depth / 2 - base_clearance - w / 2, 0]) // back
rotate([0, 0,-90]) rotate([0, 0,-90])
child(); children();
translate([right_stay_x - t / 2, base_depth / 2 - base_clearance - w / 2, 0]) // back translate([right_stay_x - t / 2, base_depth / 2 - base_clearance - w / 2, 0]) // back
rotate([0, 0, 90]) rotate([0, 0, 90])
child(); children();
} }
assign($rear = false) { {
$rear = false;
for(x = [-base_width/2 + base_clearance + w /2, for(x = [-base_width/2 + base_clearance + w /2,
base_width/2 - base_clearance - w /2, base_width/2 - base_clearance - w /2,
-base_width/2 - base_clearance - w /2 + left_w, -base_width/2 - base_clearance - w /2 + left_w,
right_stay_x + sheet_thickness(frame) / 2 + w / 2 + base_clearance]) right_stay_x + sheet_thickness(frame) / 2 + w / 2 + base_clearance])
translate([x, gantry_Y + t, 0]) translate([x, gantry_Y + t, 0])
child(); children();
// extra holes for bars // extra holes for bars
if(holes && base_nuts) { if(holes && base_nuts) {
translate([left_stay_x + t / 2, -base_depth / 2 + base_clearance + w / 2, 0]) // front translate([left_stay_x + t / 2, -base_depth / 2 + base_clearance + w / 2, 0]) // front
rotate([0, 0,-90]) rotate([0, 0,-90])
child(); children();
translate([right_stay_x - t / 2, -base_depth / 2 + base_clearance + w / 2, 0]) // front translate([right_stay_x - t / 2, -base_depth / 2 + base_clearance + w / 2, 0]) // front
rotate([0,0, 90]) rotate([0,0, 90])
child(); children();
} }
} }
@@ -702,12 +706,12 @@ module frame_gantry() {
} }
} }
module frame_stay(left, bodge = 0) { module frame_stay(left) {
x = left ? left_stay_x : right_stay_x; x = left ? left_stay_x : right_stay_x;
difference() { difference() {
translate([x, gantry_Y + sheet_thickness(frame) + stay_depth / 2, stay_height / 2]) translate([x, gantry_Y + sheet_thickness(frame) + stay_depth / 2, stay_height / 2])
rotate([90,0,90]) rotate([90, 0, 90])
sheet(frame, stay_depth, stay_height, [0, frame_corners, 0, 0]); sheet(frame, stay_depth, stay_height, [0, frame_corners, 0, 0]);
fixing_block_holes(); fixing_block_holes();
@@ -717,7 +721,7 @@ module frame_stay(left, bodge = 0) {
if(left) if(left)
translate([x + (sheet_thickness(frame) + fan_depth(case_fan)) / 2, fan_y, fan_z]) translate([x + (sheet_thickness(frame) + fan_depth(case_fan)) / 2, fan_y, fan_z])
rotate([0,90,0]) rotate([0,90,0])
scale([1 + bodge, 1 + bodge, 1]) fan_holes(case_fan); // scale prevents OpenCSG z buffer artifacts fan_holes(case_fan);
else { else {
// //
@@ -855,7 +859,8 @@ module frame_assembly(show_gantry = true) {
place_cable_clips(); place_cable_clips();
frame_base(); color(sheet_colour(base)) render() frame_base();
if(base_nuts) { if(base_nuts) {
for(side = [ left_stay_x + fixing_block_height() / 2 + sheet_thickness(frame) / 2, for(side = [ left_stay_x + fixing_block_height() / 2 + sheet_thickness(frame) / 2,
right_stay_x - fixing_block_height() / 2 - sheet_thickness(frame) / 2]) right_stay_x - fixing_block_height() / 2 - sheet_thickness(frame) / 2])
@@ -869,9 +874,9 @@ module frame_assembly(show_gantry = true) {
fixing_blocks() fixing_blocks()
fixing_block_assembly($upper, $rear); fixing_block_assembly($upper, $rear);
frame_stay(true, eta); color(sheet_colour(frame)) render() frame_stay(true);
frame_stay(false); color(sheet_colour(frame)) render() frame_stay(false);
frame_gantry(); color(sheet_colour(frame)) render() frame_gantry();
} }
end("frame_assembly"); end("frame_assembly");
@@ -890,7 +895,7 @@ module machine_assembly(show_bed = true, show_heatshield = true, show_spool = tr
raspberry_pi_assembly(); raspberry_pi_assembly();
if(raspberry_pi_camera) if(raspberry_pi_camera)
raspberry_pi_camera_assembly(light_strip); raspberry_pi_camera_assembly();
if(show_spool) { if(show_spool) {
spool_assembly(left_stay_x, right_stay_x); spool_assembly(left_stay_x, right_stay_x);

View File

@@ -11,23 +11,12 @@ include <conf/config.scad>
use <pcb_spacer.scad> use <pcb_spacer.scad>
include <positions.scad> include <positions.scad>
pi_width = 56;
pi_length = 85;
pi_clearance = 0.25;
pi_thickness = 1.6;
overlap = 1.5; overlap = 1.5;
pi_base_width = pi_width + 2 * pi_clearance + 2 * min_wall; pi_base_width = pi_width + 2 * pi_clearance + 2 * min_wall;
pi_base_length = pi_length+ 2 * pi_clearance + 2 * min_wall; pi_base_length = pi_length+ 2 * pi_clearance + 2 * min_wall;
rim_width = overlap + pi_clearance + min_wall; rim_width = overlap + pi_clearance + min_wall;
module pi_holes()
for(hole = [[25.5, 18], [pi_length-5, pi_width-12.5]])
translate([pi_width / 2 - hole[1], hole[0] - pi_length / 2, 0])
child();
pi_lift = 10; // space underneath for 12mm screw pi_lift = 10; // space underneath for 12mm screw
standoffs = 4; standoffs = 4;
@@ -35,9 +24,9 @@ pi_base = 2;
nut_depth = nut_thickness(M2p5_nut, true) + 0.5; nut_depth = nut_thickness(M2p5_nut, true) + 0.5;
rim_height = pi_lift + pi_thickness; rim_height = pi_lift + pi_thickness;
margin = 2; margin = 2;
x_offset = psu_height(psu) - raspberry_pi_width() / 2 - margin;
function raspberry_pi_width() = pi_width;
x_offset = psu_height(psu) - raspberry_pi_width() / 2 - margin;
back_height = controller_z - (psu_z + psu_length(psu) / 2); back_height = controller_z - (psu_z + psu_length(psu) / 2);
screw_z = back_height + controller_hole_inset(controller); screw_z = back_height + controller_hole_inset(controller);
@@ -46,18 +35,26 @@ slot_length = 2;
wall = 2.5; wall = 2.5;
card_width = 30.3;
card_thickness = 4;
card_offset = 11.5;
back_width = screw_pitch + 2 * (M3_clearance_radius + wall); back_width = screw_pitch + 2 * (M3_clearance_radius + wall);
module raspberry_pi() { module rpi_position() {
vitamin("RASPBERY: Raspberry PI model B"); rpi_x = pi_on_psu() ? psu_x + x_offset : right_stay_x + sheet_thickness(frame) / 2;
color("green") rpi_y = pi_on_psu() ? psu_y : gantry_Y + sheet_thickness(frame) + pi_card_clearance + pi_length / 2;
rotate([0, 0, 90]) rpi_z = pi_on_psu() ? psu_z + psu_length(psu) /2 : fixing_block_height() + pi_base_width / 2;
translate([-pi_length / 2, - pi_width / 2, 0])
import("../imported_stls/R-Pi.stl"); translate([rpi_x, rpi_y, rpi_z]) rotate([0, pi_on_psu() ? 0 : 90, 0])
children();
}
module rpi_bracket_holes() {
inset = overlap + (washer_diameter(M3_washer) + 1) / 2;
for(side = [-1,1], end = [-1, 1]) {
nudge = end > 0 && side < 0;
translate([side * (pi_width / 2 - inset),
end * (pi_length / 2 - inset) - (nudge ? 5 : 0), pi_base])
children();
}
} }
module rpi_bracket_stl() { module rpi_bracket_stl() {
@@ -84,20 +81,21 @@ module rpi_bracket_stl() {
cube([card_width + 2, rim_width * 2 + 1, card_thickness * 2], center = true); cube([card_width + 2, rim_width * 2 + 1, card_thickness * 2], center = true);
} }
translate([-x_offset, controller_y - psu_y + controller_width(controller) / 2 - back_width / 2, 0]) { if(pi_on_psu())
cube([x_offset - pi_width / 2 + eta, back_width, 4]); translate([-x_offset, controller_y - psu_y + controller_width(controller) / 2 - back_width / 2, 0]) {
cube([pcb_spacer_height(), back_width, back_height]); cube([x_offset - pi_width / 2 + eta, back_width, 4]);
cube([pcb_spacer_height(), back_width, back_height]);
for(side = [-1, 1]) for(side = [-1, 1])
translate([0, side * screw_pitch / 2 + back_width / 2, screw_z + slot_length / 2]) translate([0, side * screw_pitch / 2 + back_width / 2, screw_z + slot_length / 2])
hull() { hull() {
rotate([0, 90, 0]) rotate([0, 90, 0])
cylinder(r = M3_clearance_radius + wall, h = 2 * pcb_spacer_height()); cylinder(r = M3_clearance_radius + wall, h = 2 * pcb_spacer_height());
translate([0, -(M3_clearance_radius + wall), -screw_z]) translate([0, -(M3_clearance_radius + wall), -screw_z])
cube([2 * pcb_spacer_height(), 2 * (M3_clearance_radius + wall), 1]); cube([2 * pcb_spacer_height(), 2 * (M3_clearance_radius + wall), 1]);
} }
} }
pi_holes() union() { pi_holes() union() {
cylinder(r = corrected_radius(M2p5_clearance_radius) + 2, h = pi_lift); cylinder(r = corrected_radius(M2p5_clearance_radius) + 2, h = pi_lift);
@@ -107,10 +105,14 @@ module rpi_bracket_stl() {
pi_holes() pi_holes()
nut_trap(M2p5_clearance_radius, nut_radius(M2p5_nut), nut_depth, supported = true); nut_trap(M2p5_clearance_radius, nut_radius(M2p5_nut), nut_depth, supported = true);
for(side = [-1, 1]) if(pi_on_psu())
translate([-x_offset, controller_y - psu_y + controller_width(controller) / 2 + side * screw_pitch / 2, screw_z]) for(side = [-1, 1])
rotate([90, 0, 90]) translate([-x_offset, controller_y - psu_y + controller_width(controller) / 2 + side * screw_pitch / 2, screw_z])
vertical_tearslot(h = 4 * pcb_spacer_height() + 1, r = M3_clearance_radius, l = slot_length); rotate([90, 0, 90])
vertical_tearslot(h = 4 * pcb_spacer_height() + 1, r = M3_clearance_radius, l = slot_length);
else
rpi_bracket_holes()
poly_cylinder(r = M3_clearance_radius, h = 100, center = true);
} }
} }
@@ -118,7 +120,7 @@ module rpi_bracket_stl() {
module raspberry_pi_assembly() { module raspberry_pi_assembly() {
assembly("raspberry_pi_assembly"); assembly("raspberry_pi_assembly");
translate([psu_x + x_offset, psu_y, psu_z + psu_length(psu) /2]) { rpi_position() group() {
color("lime") render() rpi_bracket_stl(); color("lime") render() rpi_bracket_stl();
explode([80, 0, 0]) explode([80, 0, 0])
@@ -134,6 +136,17 @@ module raspberry_pi_assembly() {
explode([0, 0, 30]) explode([0, 0, 30])
translate([0, 0, pi_lift + pi_thickness]) translate([0, 0, pi_lift + pi_thickness])
screw_and_washer(M2p5_pan_screw, 12); screw_and_washer(M2p5_pan_screw, 12);
if(!pi_on_psu())
rpi_bracket_holes() group() {
screw_and_washer(M3_cap_screw,
screw_longer_than(2 * washer_thickness(M3_washer) + pi_base + sheet_thickness(frame) + nut_thickness(M3_nut,true)));
translate([0, 0, -pi_base - sheet_thickness(frame)])
rotate([180, 0, 0])
nut_and_washer(M3_nut, true);
}
} }
end("raspberry_pi_assembly"); end("raspberry_pi_assembly");

View File

@@ -9,11 +9,11 @@
// //
include <conf/config.scad> include <conf/config.scad>
include <positions.scad> include <positions.scad>
use <light_strip_clip.scad>
use <frame_edge_clamp.scad> use <frame_edge_clamp.scad>
light = light_strip ? light_strip : SPS125; light = light_strip ? light_strip : RIGID5050_290;
light2 = light_strip == RIGID5050_290 ? RIGID5050_208 : false;
show_rays = false;
wall = 2; wall = 2;
clearance = 0.2; clearance = 0.2;
@@ -44,71 +44,82 @@ pi_cam_back_length = pi_cam_hole_pitch + 2 * (nut_flat_radius(M2_nut) + min_wall
pi_cam_back_width = pi_cam_width + (pi_cam_back_length - pi_cam_length) / 2; pi_cam_back_width = pi_cam_width + (pi_cam_back_length - pi_cam_length) / 2;
pi_cam_centreline = -pi_cam_width / 2 + 9.5; pi_cam_centreline = -pi_cam_width / 2 + 9.5;
function round_to_layer(z) = ceil(z / layer_height) * layer_height;
pi_cam_front_clearance = 1.6; pi_cam_front_clearance = 1.6;
pi_cam_front_wall = 2; pi_cam_front_wall = 2;
pi_cam_front_depth = pi_cam_back_depth + pi_cam_thickness + pi_cam_front_clearance + wall; pi_cam_front_depth = pi_cam_back_depth + pi_cam_thickness + pi_cam_front_clearance + wall;
pi_cam_front_length = pi_cam_back_length + 2 * (pi_cam_front_wall + clearance); pi_cam_front_length = pi_cam_back_length + 2 * (pi_cam_front_wall + clearance);
pi_cam_front_width = pi_cam_back_width + 2 * (pi_cam_front_wall + clearance); pi_cam_front_width = pi_cam_back_width + 2 * (pi_cam_front_wall + clearance);
bar_dia = 12; left = left_stay_x + sheet_thickness(frame) / 2;
bar_gap = 2; right = right_stay_x - sheet_thickness(frame) / 2;
bar_wall = 3;
X_build = min(X_travel, bed_holes[0] - screw_head_radius(M3_cap_screw) * 2); // sturdy travel exceeds the bed so max object is smaller X_build = min(X_travel, bed_holes[0] - screw_head_radius(M3_cap_screw) * 2); // sturdy travel exceeds the bed so max object is smaller
Y_build = min(Y_travel, bed_holes[1] - screw_head_radius(M3_cap_screw) * 2); Y_build = min(Y_travel, bed_holes[1] - screw_head_radius(M3_cap_screw) * 2);
y_limit = Y0 + (Y_travel + Y_build) / 2 + 1; y_limit = Y0 + (Y_travel + Y_build) / 2 + 1;
bar_z = 240;
bar_y = y_limit + bar_dia / 2 + wall + 2;
cam_offset = pi_cam_front_width / 2 - pi_cam_width / 2 + pi_cam_back_width / 2 - pi_cam_centreline + bar_dia / 2; pivot_screw_length = 16;
cam_x = X_origin; end_cap_nut_boss_r = nut_trap_radius(M3_nut, horizontal = false) + 3 * filament_width;
cam_y = bar_y - bar_dia / 2 - pi_cam_front_wall; end_cap_nut_boss = pivot_screw_length - washer_thickness(M3_washer) - frame_edge_clamp_thickness() - 2;
cam_z = bar_z - cam_offset;
hypot = sqrt(sqr(bar_z - bed_height) + sqr(bar_y - Y0)); pivot_offset = frame_edge_clamp_hinge() + washer_diameter(M3_washer) / 2;
angle = atan2(bar_z - bed_height, bar_y - Y0) - asin(cam_offset / hypot); pivot_y = base_depth / 2 + pivot_offset;
left = left_stay_x + sheet_thickness(frame) / 2; light2_z_top = light_strip_clip_length(light) / 2 + (light2 ? light_strip_clip_length(light2) - wall : 0);
right = right_stay_x - sheet_thickness(frame) / 2; light2_distance = sqrt(sqr(Z_travel) + sqr(y_limit - Y0));
max_light_angle = atan2(Z_travel, y_limit - Y0) - asin(light2_z_top / light2_distance);
max_pivot_z = bed_height + tan(max_light_angle) * (pivot_y - Y0);
pivot_z = 240;
bar_length = right - left - 2; pivot_light2_distance = sqrt(sqr(bed_height + Z_travel - max_pivot_z) + sqr(y_limit - pivot_y));
bar_overlap = 2 * (cam_x -(right + left) / 2); pivot_max_distance = sqrt(sqr(max_pivot_z - bed_height) + sqr(pivot_y - Y0));
clamp_length = bar_dia - frame_edge_clamp_pitch(0) + 2 * nut_flat_radius(M3_nut) + clearance * 2;
band_width = 2 * (nut_trap_radius(M3_nut) + wall);
band_tab_h = 2 * (nut_trap_flat_radius(M3_nut) + wall);
band_ir = bar_dia / 2;
band_or = band_ir + pi_cam_front_wall;
band_y = pi_cam_front_width / 2 - pi_cam_width / 2 + pi_cam_back_width / 2 - pi_cam_front_wall + band_or + eta;
band_tab_t = M3_nut_trap_depth + wall;
band_slit = 1;
band_tab_d = max(2 * band_tab_t + band_slit, 16 - washer_thickness(M3_washer) - nut_thickness(M3_nut, true) + M3_nut_trap_depth - 0.5);
band_tab_height = band_tab_h + sqrt(sqr(band_or) - sqr(band_tab_d / 2));
light_x = (left + right) / 2; light_x = (left + right) / 2;
light_z = bar_z + bar_dia / 2 + light_strip_width(light) / 2 + pi_cam_front_wall + clearance; light_y = pivot_y - end_cap_nut_boss_r;
bar_z_offset = light_z - bar_z; light_angle = atan2(pivot_z - bed_height, pivot_y - Y0);
light_angle = atan2(bar_z - bed_height, bar_y - Y0) + asin(bar_z_offset / hypot); hinge_screw = M2_cap_screw;
hinge_nut = screw_nut(hinge_screw);
hinge_screw_length = 12;
light_incursion = max(0, y_limit + sin(light_angle) * (bar_z_offset + light_strip_width(light) / 2) - bar_y); hinge_r = nut_trap_radius(hinge_nut) + 3 * filament_width;
hinge_h = max(wall + nut_trap_depth(hinge_nut), light_strip_clip_depth(light) / 2);
cam_hinge_h = light_strip_clip_depth(light) - hinge_h;
bar_y_offset = (light_strip_thickness(light) + light_incursion) / cos(light_angle); light_hinge_offset = hinge_r + 0.5;
light_y = bar_y + bar_y_offset; light_hinge_z_offset = light_strip_clip_length(light) / 2 + light_hinge_offset * cos(light_angle);
light_hinge_y_offset = light_strip_clip_width(light) + light_hinge_offset * sin(light_angle);
light_band_tab_h = 2 * (nut_trap_radius(M3_nut) + wall); hinge_y = light_y + wall - light_hinge_y_offset;
light_band_tab_height = light_band_tab_h + sqrt(sqr(band_or) - sqr(band_tab_d / 2)); hinge_z = pivot_z - light_hinge_z_offset;
cam_hinge_z_offset = pi_cam_front_width / 2 + hinge_r - pi_cam_width / 2 + pi_cam_back_width / 2 - pi_cam_centreline + 0.5;
cam_hinge_y_offset = hinge_r;
cam_x = X_origin;
cam_y = hinge_y - cam_hinge_y_offset;
cam_z = hinge_z - cam_hinge_z_offset;
light2_z_offset = light2_z_top - light_strip_clip_length(light2) / 2;
light2_x_offset = cam_x - light_x;
dy = sqrt(sqr(pivot_light2_distance) - sqr(light2_z_top));
light2_y_offset = -(pivot_y - light_y) + wall - light_strip_clip_width(light2) + (light2_distance < pivot_max_distance ? dy : -dy);
clamp_length = 20;
hypot = sqrt(sqr(pivot_z - bed_height) + sqr(pivot_y - Y0));
adj = hypot - (pivot_y - hinge_y);
alpha = atan2(light_hinge_z_offset, adj);
hypot2 = sqrt(sqr(adj) + sqr(light_hinge_z_offset));
beta = asin(cam_hinge_z_offset / hypot2);
cam_angle = light_angle - alpha - beta;
module pi_cam_holes(mid_only = false) { module pi_cam_holes(mid_only = false) {
ypos = [pi_cam_centreline, pi_cam_width / 2 - 2]; ypos = [pi_cam_centreline, pi_cam_width / 2 - 2];
for(y = mid_only ? [ ypos[0] ] : ypos) for(y = mid_only ? [ ypos[0] ] : ypos)
for(x = [-pi_cam_length / 2 + 2, pi_cam_length / 2 - 2]) for(x = [-pi_cam_length / 2 + 2, pi_cam_length / 2 - 2])
translate([x, y, 0]) translate([x, y, 0])
child(); children();
} }
module raspberry_pi_camera() { module raspberry_pi_camera() {
@@ -138,6 +149,10 @@ module raspberry_pi_camera() {
color("red") color("red")
render() translate(pi_cam_led_pos) cube(center = true); render() translate(pi_cam_led_pos) cube(center = true);
if(show_rays)
translate([0, pi_cam_centreline, pi_cam_thickness])
%cylinder(r = 1, h = 100);
} }
module rpi_camera_focus_ring_stl() { module rpi_camera_focus_ring_stl() {
@@ -150,8 +165,6 @@ module rpi_camera_focus_ring_stl() {
x = rad / (sin(angle / 2) + cos(angle / 2)); x = rad / (sin(angle / 2) + cos(angle / 2));
r = x * sin(angle / 2); r = x * sin(angle / 2);
stl("rpi_camera_focus_ring");
difference() { difference() {
linear_extrude(height = thickness, convexity = 5) linear_extrude(height = thickness, convexity = 5)
difference() { difference() {
@@ -184,17 +197,8 @@ module rpi_camera_back_stl() {
stl("rpi_camera_back"); stl("rpi_camera_back");
translate([0, 0, pi_cam_back_depth]) rotate([0, 180, 0]) difference() { translate([0, 0, pi_cam_back_depth]) rotate([0, 180, 0]) difference() {
union() { translate([0, -pi_cam_width / 2 + pi_cam_back_width / 2, pi_cam_back_depth / 2])
translate([0, -pi_cam_width / 2 + pi_cam_back_width / 2, pi_cam_back_depth / 2]) cube([pi_cam_back_length, pi_cam_back_width, pi_cam_back_depth], center = true);
cube([pi_cam_back_length, pi_cam_back_width, pi_cam_back_depth], center = true);
*translate([0, pi_cam_centreline, pi_cam_back_depth + lug_height - lug_rad])
rotate([0, 90, 90])
cylinder(r = lug_rad, h = lug_width, center = true);
*translate([ - lug_rad, pi_cam_centreline - lug_width / 2, 0])
cube([lug_rad * 2, lug_width, lug_height - lug_rad + pi_cam_back_depth]);
}
translate([0, -pi_cam_back_overlap, 0]) translate([0, -pi_cam_back_overlap, 0])
cube([pi_cam_length - 2 * pi_cam_back_overlap, pi_cam_width, 2 * pi_cam_back_clearance], center = true); cube([pi_cam_length - 2 * pi_cam_back_overlap, pi_cam_width, 2 * pi_cam_back_clearance], center = true);
@@ -207,20 +211,11 @@ module rpi_camera_back_stl() {
rotate([180, 0, 90]) rotate([180, 0, 90])
nut_trap(M2_clearance_radius, nut_radius(M2_nut), M2_nut_trap_depth, supported = true); nut_trap(M2_clearance_radius, nut_radius(M2_nut), M2_nut_trap_depth, supported = true);
*translate([0, 0, pi_cam_back_clearance + layer_height])
rotate([0, 0, 90])
poly_cylinder(r = M2_clearance_radius, h = 100);
} }
*translate([0, pi_cam_centreline, pi_cam_back_depth + lug_height - lug_rad])
rotate([90, 0, 0])
teardrop_plus(r = lug_hole_r, h = lug_width + 1, center = true);
} }
} }
module rpi_camera_front_stl() { module rpi_camera_front_stl() {
stl("rpi_camera_front");
shelf = pi_cam_front_depth - pi_cam_back_depth; shelf = pi_cam_front_depth - pi_cam_back_depth;
connector_slot = pi_cam_connector_height + 2 * layer_height; connector_slot = pi_cam_connector_height + 2 * layer_height;
rad = pi_cam_front_wall; rad = pi_cam_front_wall;
@@ -243,24 +238,19 @@ module rpi_camera_front_stl() {
cylinder(r = rad * (sqrt(2) - 1), h = eta); cylinder(r = rad * (sqrt(2) - 1), h = eta);
} }
//
// bar clamp
//
hull() {
translate([0, band_y, band_or])
rotate([-90, 0, 90])
teardrop(r = band_or, h = band_width, center = true); // clamp band to go round bar
translate([-band_width / 2, pi_cam_front_length / 2 - rad, 0]) translate([-light_strip_clip_depth(light) / 2 + hinge_h, cam_hinge_z_offset + pi_cam_centreline, cam_hinge_y_offset])
cube([band_width, 1, 1]); hull() {
} rotate([-90, 0, -90])
teardrop(r = hinge_r, h = cam_hinge_h);
translate([0, band_y, band_or + band_tab_height / 2]) translate([0, -hinge_r - 10, - hinge_r])
cube([band_width, band_tab_d, band_tab_height], center = true); // tab for screw cube([cam_hinge_h, hinge_r + 10, 2 * hinge_r]);
}
} }
translate([0, band_y, band_or]) translate([0, cam_hinge_z_offset + pi_cam_centreline, cam_hinge_y_offset])
rotate([90, 0, 90]) rotate([90, 0, 90])
teardrop(r = band_ir, h = band_width + 1, center = true); teardrop_plus(r = screw_clearance_radius(hinge_screw), h = 100, center = true);
translate([0, -pi_cam_width / 2 + pi_cam_back_width / 2, pi_cam_front_depth / 2 + shelf - layer_height]) // recess for the back translate([0, -pi_cam_width / 2 + pi_cam_back_width / 2, pi_cam_front_depth / 2 + shelf - layer_height]) // recess for the back
cube([pi_cam_back_length + 2 * clearance, pi_cam_back_width + 2 * clearance, pi_cam_front_depth], center = true); cube([pi_cam_back_length + 2 * clearance, pi_cam_back_width + 2 * clearance, pi_cam_front_depth], center = true);
@@ -289,190 +279,218 @@ module rpi_camera_front_stl() {
cube(pi_cam_turret + 2 * clearance, center = true); // hole for lens cube(pi_cam_turret + 2 * clearance, center = true); // hole for lens
rotate([0, 180, 0]) translate(pi_cam_led_pos) cylinder(r = led_hole_r, h = 100, center = true); // hole for led rotate([0, 180, 0]) translate(pi_cam_led_pos) cylinder(r = led_hole_r, h = 100, center = true); // hole for led
//
// bar clamp
//
translate([-50, band_y - band_slit / 2, band_or + band_ir + 5 * layer_height / 4])
cube([100, band_slit, 100]);
translate([0, band_y + band_tab_d / 2, band_or + band_tab_height - band_tab_h / 2])
rotate([90, 0, 0])
nut_trap(M3_clearance_radius, nut_radius(M3_nut), M3_nut_trap_depth, horizontal = true);
} }
} }
module camera_bar(male = false) { module pivot_lug() {
length = bar_length / 2 + (male ? -bar_overlap / 2 : bar_overlap / 2); linear_extrude(height = frame_edge_clamp_thickness(), convexity = 2)
translate([0, base_depth / 2 - bar_y, 0])
difference() { difference() {
union() { hull() {
tube(or = bar_dia / 2, ir = bar_dia / 2 - bar_wall, h = length, center = false); translate([-clamp_length / 2, -frame_edge_clamp_hinge()])
if(male) square([clamp_length, eta]);
translate([0, 0, length - 6 * layer_height])
cylinder(r = bar_dia / 2 - wall - 0.1, h = bar_overlap + 6 * layer_height);
}
if(!male)
translate([0, 0, length])
cylinder(r = bar_dia / 2 - wall, h = 2 * bar_overlap + 2, center = true);
*translate([-100, 0, 0]) translate([0, -pivot_offset])
cube([200, 200, 200]); circle(washer_diameter(M3_washer)/ 2 + 1);
} }
translate([0, -pivot_offset])
poly_circle(M3_clearance_radius);
}
} }
module rpi_light_clamp_stl() { module light_strip_end_cap_stl() {
base_thickness = (right - left - 2 * frame_edge_clamp_thickness() - 1 - light_strip_length(light)) / 2;
thickness = 3;
overlap = 1;
length = light_strip_width(light) + 2 * wall;
gap = light_strip_width(light) + clearance;
stl("rpi_light_clamp");
difference() { difference() {
union() { union() {
translate([-length / 2, - bar_y_offset, 0]) linear_extrude(height = base_thickness, convexity = 2)
cube([length, thickness + bar_y_offset, band_width]); hull() {
translate([-light_strip_clip_length(light) / 2, end_cap_nut_boss_r - wall])
square([light_strip_clip_length(light), light_strip_clip_width(light)]);
translate([0, 0, band_width / 2 + eta]) circle(end_cap_nut_boss_r);
rotate([-90, 0, 0]) }
teardrop(r = nut_trap_radius(M3_nut) + wall, h = wall + M3_nut_trap_depth);
cylinder(r = end_cap_nut_boss_r, h = end_cap_nut_boss);
translate([bar_z_offset, -bar_y_offset, 0]) { translate([0, end_cap_nut_boss_r - wall, base_thickness - eta])
cylinder(r = band_or, h = band_width); light_strip_clip(light);
translate([light_band_tab_height / 2, 0, band_width / 2])
cube([light_band_tab_height, band_tab_d, band_width], center = true); // tab for screw
}
} }
translate([-gap / 2, - bar_y_offset * 2, -1]) translate([0, 0, end_cap_nut_boss])
cube([gap, bar_y_offset * 2, band_width + 2]); nut_trap(M3_clearance_radius, M3_nut_radius, M3_nut_trap_depth);
translate([-gap / 2 - wall - 1, -bar_y_offset -overlap, -1]) translate([-(light_strip_clip_gap(light) - eta) / 2, end_cap_nut_boss_r + eta, -1]) // extend the slot for wires
cube([wall + 2, bar_y_offset, band_width + 2]); cube([light_strip_clip_gap(light) - 2 * eta, 100, 100]);
translate([bar_z_offset, -bar_y_offset, 0]) translate([50, end_cap_nut_boss_r - wall - eta, end_cap_nut_boss + eta]) // truncate back to level of screw boss when is short
cylinder(r = band_ir, h = 100, center = true); rotate([0, 0, 180])
cube([100, 100, 100]);
}
translate([0, wall + M3_nut_trap_depth, band_width / 2])
rotate([90, 0, 0])
nut_trap(M3_clearance_radius, nut_radius(M3_nut), M3_nut_trap_depth, horizontal = true);
//
// bar clamp
//
translate([bar_z_offset, -bar_y_offset, 0]) {
translate([0, -band_slit / 2, -1])
cube([100, band_slit, band_width + 2]);
translate([light_band_tab_height - light_band_tab_h / 2, -band_tab_d / 2, band_width / 2])
rotate([90, 0, 0])
nut_trap(M3_clearance_radius, nut_radius(M3_nut), M3_nut_trap_depth, horizontal = true);
}
}
} }
module rpi_camera_bracket_stl(include_support = true) {
difference() {
union() {
light_strip_clip(light);
module raspberry_pi_camera_assembly(light_strip = true) { translate([light_hinge_z_offset, light_hinge_y_offset, 0]) union() {
assembly("raspberry_pi_camera_assembly"); cylinder(r = hinge_r, h = hinge_h);
translate([0, bar_y, bar_z]) { rotate([0, 0, 180 + light_angle])
rotate([angle, 0, 0]) translate([0, - wall / 2, 0])
translate([cam_x, cam_y - bar_y, cam_z - bar_z]) rotate([90, 0, 0]) translate([0, -pi_cam_centreline, 0]) { cube([light_hinge_offset + wall, wall, hinge_h]);
color("lime") render() }
translate([0, 0, - pi_cam_front_depth - 40 * exploded]) }
rpi_camera_back_stl(); translate([light_hinge_z_offset, light_hinge_y_offset, 0])
nut_trap(screw_clearance_radius(hinge_screw), nut_radius(hinge_nut), nut_trap_depth(hinge_nut), supported = include_support);
}
}
color("blue") render() module light_strip_piggy_back_clip() {
rotate([0, 180, 0]) union() {
rpi_camera_front_stl(); light_strip_clip(light);
translate([0, 0, pi_cam_back_depth - pi_cam_front_depth - 23 * exploded]) translate([light2_z_offset, light2_y_offset, 0]) {
raspberry_pi_camera(); difference() {
translate([-light_strip_clip_length(light2) / 2, 0, 0])
cube([light_strip_clip_length(light2), light_strip_clip_width(light2), wall]);
pi_cam_holes(mid_only = true) group() { translate([-(light_strip_clip_gap(light2) - eta) / 2, wall, -1]) // extend the slot for wires
screw_and_washer(M2_cap_screw, 12); cube([light_strip_clip_gap(light2) - 2 * eta, 100, 100]);
translate([0, 0, -pi_cam_front_depth + M2_nut_trap_depth - 40 * exploded])
rotate([0, 180, 90])
nut(M2_nut, true);
} }
translate([0, 0, wall - eta])
translate([0, (band_y - band_tab_d / 2), -(band_or + band_tab_height - band_tab_h / 2)]) { light_strip_clip(light2);
rotate([90, 0, 0])
screw_and_washer(M3_cap_screw, 16);
translate([0, band_tab_d - M3_nut_trap_depth, 0])
rotate([-90, 0, 0])
nut(M3_nut, true);
}
translate([0, pi_cam_centreline, 1.5 + 10 * exploded]) color("lime") render() rpi_camera_focus_ring_stl();
} }
if(light_strip) translate([light_strip_clip_length(light) / 2, 0, 0])
rotate([light_angle, 0, 0]) rotate([0, 0, 180])
translate([light_x, bar_y_offset, bar_z_offset]) { cube([wall, -light2_y_offset, light_strip_clip_depth(light2)]);
rotate([90, 0, 0]) }
light_strip(light); }
for(side = [-1, 1]) module light_strip_piggy_back_clips_stl() {
translate([side * light_strip_hole_pitch(light) / 2, 0, 0]) {
translate([-band_width / 2, 0, 0])
rotate([0, 90, 0])
color("blue") render() rpi_light_clamp_stl();
translate([0, -light_strip_thickness(light), 0]) offset = -(light_strip_clip_length(light) / 2 + light_strip_clip_length(light2) - wall);
rotate([90, 0, 0]) translate([offset, -light_strip_clip_width(light) - 1, 0])
screw_and_washer(M3_cap_screw, 10); light_strip_piggy_back_clip();
translate([0, wall, 0]) translate([offset, light_strip_clip_width(light) + 1, 0])
rotate([-90, 90, 0]) rotate([180, 0, 0])
nut(M3_nut, true); mirror([0, 0, 1])
light_strip_piggy_back_clip();
}
translate([0, -bar_y_offset, -bar_z_offset]) { module raspberry_pi_camera_assembly() {
translate([0, band_tab_d / 2, -light_band_tab_height + light_band_tab_h / 2]) assembly("raspberry_pi_camera_assembly");
rotate([-90, 0, 0])
screw_and_washer(M3_cap_screw, 16);
translate([0, -band_tab_d / 2 + M3_nut_trap_depth, stl("rpi_camera_case");
-light_band_tab_height + light_band_tab_h / 2]) translate([0, pivot_y, pivot_z]) {
rotate([90, 90, 0]) rotate([light_angle, 0, 0])
nut(M3_nut, true); translate([0, hinge_y - pivot_y, hinge_z - pivot_z])
} rotate([cam_angle - light_angle, 0, 0])
translate([cam_x, cam_y - hinge_y, cam_z - hinge_z - pi_cam_centreline]) rotate([90, 0, 0]) {
color("lime") render()
translate([0, 0, - pi_cam_front_depth - 40 * exploded])
rpi_camera_back_stl();
color("red") render()
rotate([0, 180, 0])
rpi_camera_front_stl();
translate([0, 0, pi_cam_back_depth - pi_cam_front_depth - 23 * exploded])
raspberry_pi_camera();
pi_cam_holes(mid_only = true) group() {
screw_and_washer(M2_cap_screw, 12);
translate([0, 0, -pi_cam_front_depth + M2_nut_trap_depth - 40 * exploded])
rotate([0, 180, 90])
nut(M2_nut, true);
} }
}
translate([0, pi_cam_centreline, 1.5 + 10 * exploded])
color("lime") render()
rpi_camera_focus_ring_stl();
}
} }
stl("rpi_camera_bar"); stl("light_and_camera_brackets");
stl("rear_light_brackets");
for(side = [-1, 1]) translate([0, pivot_y, pivot_z])
translate([side < 0 ? left : right, base_depth / 2, bar_z]) rotate([light_angle, 0, 0]) {
translate([light_x, light_y - pivot_y, 0]) {
rotate([90, 0, 0]) {
light_strip(light);
if(light2) {
translate([light2_x_offset, light2_z_offset, light2_y_offset])
light_strip(light2);
for(side = [-1, 1])
translate([light2_x_offset + side * (light_strip_length(light2) / 2 + wall), 0, -wall])
rotate([90, 0, 90])
mirror([0, 0, side > 0 ? 1 : 0])
color("lime") render()
light_strip_piggy_back_clip();
}
}
translate([cam_x - light_x + light_strip_clip_depth(light) / 2, wall, 0])
rotate([180, 90, 0]) {
color("lime") render()
rpi_camera_bracket_stl(false);
translate([light_hinge_z_offset, light_hinge_y_offset, 0]) {
translate([0, 0, hinge_h + cam_hinge_h])
screw_and_washer(hinge_screw, hinge_screw_length);
translate([0, 0, nut_trap_depth(hinge_nut)])
rotate([180, 0, 0])
nut(hinge_nut, true);
}
}
}
}
for(side = [-1, 1])
translate([side < 0 ? left : right, base_depth / 2, pivot_z])
explode([20 * side, 0, 0]) explode([20 * side, 0, 0])
rotate([0, side * 90, 180]) rotate([0, side * 90, 180]) {
frame_edge_clamp_assembly(length = clamp_length, left = side < 0) frame_edge_clamp_assembly(length = clamp_length, kids = true)
camera_bar(side > 0); pivot_lug();
translate([0, -pivot_offset, 0]) {
rotate([180, 0, 0])
screw_and_washer(M3_cap_screw, pivot_screw_length);
translate([0, 0, frame_edge_clamp_thickness() + end_cap_nut_boss - M3_nut_trap_depth])
rotate([0, 0, -side * light_angle])
nut(M3_nut, true);
}
translate([0, -pivot_offset, frame_edge_clamp_thickness()])
rotate([0, 0, -side * light_angle])
color("lime") render()
light_strip_end_cap_stl();
}
if(show_rays) { if(show_rays) {
%hull() { // light ray, should point at centre of Y axis. %hull() { // light ray, should point at centre of Y axis.
translate([0, bar_y, bar_z]) translate([0, pivot_y, pivot_z])
rotate([angle, 0, 0]) rotate([light_angle, 0, 0])
translate([cam_x, cam_y - bar_y, cam_z - bar_z]) translate([0, hinge_y - pivot_y, hinge_z - pivot_z])
sphere(); rotate([cam_angle - light_angle, 0, 0])
translate([cam_x, cam_y - hinge_y, cam_z - hinge_z])
sphere();
translate([X_origin, Y0, bed_height]) translate([X_origin, Y0, bed_height])
sphere(); sphere();
} }
%hull() { // light ray, should point at centre of Y axis. %hull() { // light ray, should point at centre of Y axis.
translate([0, bar_y, bar_z]) translate([0, pivot_y, pivot_z])
rotate([light_angle, 0, 0]) rotate([light_angle, 0, 0])
translate([X_origin, bar_y_offset - light_strip_thickness(light), bar_z_offset]) translate([X_origin, -(pivot_y - light_y) - light_strip_thickness(light), 0])
sphere(); sphere();
translate([X_origin, Y0, bed_height]) translate([X_origin, Y0, bed_height])
@@ -486,16 +504,31 @@ module raspberry_pi_camera_assembly(light_strip = true) {
end("raspberry_pi_camera_assembly"); end("raspberry_pi_camera_assembly");
} }
module rpi_camera_bar_stl() { module rear_light_brackets_stl() {
for(side = [-1, 1]) {
for(side = [-1, 1])
translate([side * (clamp_length / 2 + 1), 0, 0]) { translate([side * (clamp_length / 2 + 1), 0, 0]) {
frame_edge_clamp_front_stl(length = clamp_length) translate([0, -frame_edge_clamp_width() + frame_edge_clamp_hinge() - 2, 0])
camera_bar(side > 0); frame_edge_clamp_front_stl(length = clamp_length)
pivot_lug();
translate([0, frame_edge_clamp_width() + 2, 0]) translate([0, frame_edge_clamp_hinge(), 0])
frame_edge_clamp_back_stl(length = clamp_length); frame_edge_clamp_back_stl(length = clamp_length);
} }
}
}
module light_and_camera_brackets_stl() {
for(side = [-1, 1])
translate([side * (light_strip_clip_length(light) / 2 + 1), end_cap_nut_boss_r + 2, 0])
light_strip_end_cap_stl();
rotate([0, 0, 180])
rpi_camera_bracket_stl();
if(light2)
translate([0, light_strip_clip_width(light) + 2 * end_cap_nut_boss_r - wall + 4, 0])
rotate([0, 0, -90])
light_strip_piggy_back_clips_stl();
} }
module rpi_camera_case_stl() { module rpi_camera_case_stl() {
@@ -503,12 +536,16 @@ module rpi_camera_case_stl() {
translate([pi_cam_front_length, 0, 0]) translate([pi_cam_front_length, 0, 0])
rpi_camera_back_stl(); rpi_camera_back_stl();
translate([0, -pi_cam_front_width / 2 - 9, 0])
rpi_camera_focus_ring_stl();
} }
if(1) if(1)
raspberry_pi_camera_assembly(); raspberry_pi_camera_assembly();
else if(1)
light_and_camera_brackets_stl();
else if(0)
rpi_camera_case_stl();
else else
if(1) rear_light_brackets_stl();
rpi_camera_case_stl();
else
rpi_camera_bar_stl();

View File

@@ -7,14 +7,35 @@
// //
// LED light strips // LED light strips
// //
SPS125 = ["SPS125: Sanken SPS125 light strip", 300, 20, 0, 1.6, 260, 3.5]; SPS125 = ["SPS125: Sanken SPS125 light strip" , 300, 20.0, 2.8, 1.6, 260, 0, 3.5];
Rigid5050_290 = ["RDG5050: Rigid 5050 light strip x 290mm", 290, 14.4, 0, 7, 0, 0, 0];
Rigid5050_208 = ["RDG5050: Rigid 5050 light strip x 208mm", 208, 14.4, 0, 7, 0, 0, 0];
RIGID5050_290 = ["RDG5050: Rigid 5050 light strip x 290mm", 290, 14.4, 0, 8.6, 0, 0, 0];
RIGID5050_208 = ["RDG5050: Rigid 5050 light strip x 208mm", 208, 14.4, 0, 8.6, 0, 0, 0];
FSRP3W = ["FSRP3W: F-SRP-3W-250LM-CW-ND-300MM" , 278, 20.0, 5.4, 3.0, 295, 15, 3.0];
function light_strip_length(type) = type[1]; function light_strip_length(type) = type[1];
function light_strip_width(type) = type[2]; function light_strip_width(type) = type[2];
function light_strip_set_back(type) = type[3]; function light_strip_set_back(type) = type[3];
function light_strip_thickness(type) = type[4]; function light_strip_thickness(type) = type[4];
function light_strip_hole_pitch(type) = type[5]; function light_strip_hole_pitch(type) = type[5];
function light_strip_hole_dia(type) = type[6]; function light_strip_hole_pitch2(type)= type[6];
function light_strip_hole_dia(type) = type[7];
function light_strip_has_holes(type) = light_strip_hole_pitch(type) > 0;
module light_strip_hole_positions(type, all = false) {
if(light_strip_has_holes(type))
for(end = [-1, 1])
if(light_strip_hole_pitch2(type)) {
for(side = [-1, 1])
if(all || side > 0)
translate([end * light_strip_hole_pitch(type) / 2, side * light_strip_hole_pitch2(type) / 2 - wall, 0])
children();
}
else
translate([end * light_strip_hole_pitch(type) / 2, 0, 0])
children();
}
module light_strip(type) { module light_strip(type) {
vitamin(type[0]); vitamin(type[0]);
@@ -22,8 +43,13 @@ module light_strip(type) {
translate([0, 0, light_strip_thickness(type) / 2]) translate([0, 0, light_strip_thickness(type) / 2])
cube([light_strip_length(type), light_strip_width(type), light_strip_thickness(type)], center = true); cube([light_strip_length(type), light_strip_width(type), light_strip_thickness(type)], center = true);
for(side = [-1, 1]) light_strip_hole_positions(type, true)
translate([side * light_strip_hole_pitch(type) / 2, 0, 0]) cylinder(r = light_strip_hole_dia(type) / 2, h = 100, center = true);
cylinder(r = light_strip_hole_dia(type) / 2, h = 100, center = true);
} }
if(show_rays)
%cylinder(r = 1, h = 150);
translate([0, 0, light_strip_thickness(type) + light_strip_set_back(type) / 2])
%cube([light_strip_length(type), light_strip_width(type), light_strip_set_back(type)], center = true);
} }

View File

@@ -0,0 +1,34 @@
//
// Mendel90
//
// GNU GPL v2
// nop.head@gmail.com
// hydraraptor.blogspot.com
//
// Raspberry PI model
//
pi_width = 56;
pi_length = 85;
pi_clearance = 0.25;
pi_thickness = 1.6;
module pi_holes()
for(hole = [[25.5, 18], [pi_length-5, pi_width-12.5]])
translate([pi_width / 2 - hole[1], hole[0] - pi_length / 2, 0])
children();
function raspberry_pi_width() = pi_width;
function pi_on_psu() = atx_psu(psu);
card_width = 30.3;
card_thickness = 4;
card_offset = 11.5;
pi_card_clearance = 20;
module raspberry_pi() {
vitamin("RASPBERY: Raspberry PI model B");
color("green")
rotate([0, 0, 90])
translate([-pi_length / 2, - pi_width / 2, 0])
import("../imported_stls/R-Pi.stl");
}

24
views/rpi_assembly.scad Normal file
View File

@@ -0,0 +1,24 @@
//
// Mendel90
//
// GNU GPL v2
// nop.head@gmail.com
// hydraraptor.blogspot.com
//
// Raspberry PI assembly view
//
// assembly 1071 765 35 23 150 60 0 127 1003
//
use <../scad/main.scad>
use <../scad/raspberry_pi.scad>
include <../scad/conf/config.scad>
electronics_assembly();
*psu_assembly();
raspberry_pi_assembly();
color(sheet_colour(frame)) render() frame_stay(false);
color(sheet_colour(frame)) render() frame_gantry();
color(sheet_colour(frame)) render() frame_base();
$exploded = 0;

View File

@@ -0,0 +1,16 @@
//
// Mendel90
//
// GNU GPL v2
// nop.head@gmail.com
// hydraraptor.blogspot.com
//
// RPi camera assembly view
//
// assembly 1100 600 -8 167 200 68 0 135 463
// assembled 1100 600 -8 167 200 68 0 135 463
//
use <../scad/raspberry_pi_camera.scad>
raspberry_pi_camera_assembly();
$exploded = 1;