pcb_finalization #1

Merged
gdorn merged 26 commits from pcb_finalization into main 2024-01-24 23:02:33 +00:00
Showing only changes of commit d40f7ca1ca - Show all commits

View file

@ -39,7 +39,7 @@ printer_z_fix = 0.2; // this gets added to the base panel's thickness to accoun
label_inset_height = thickness-1;
// Width of module (HP)
width = 17; // [1:1:84]
width = 36; // [1:1:84]
/* [Holes] */
// Four hole threshold (HP)
@ -57,87 +57,104 @@ rail_clearance = 9; // mm from very top/bottom edge and where it is safe to put
// margins from edges
h_margin = hole_dist_side + thickness;
v_margin = hole_dist_top*2;
v_margin = hole_dist_top*2 + thickness;
width_mm = hp_mm(width); // where to put the output jacks
output_column = width_mm - h_margin;
input_column = h_margin;
working_height = height - v_margin*2 - title_font_size;
working_increment = working_height / 7;
// rows up from bottom; these are for steps only
row_1 = v_margin+12;
row_2 = working_increment*1 + row_1;
row_3 = working_increment*2 + row_1;
row_4 = working_increment*3 + row_1;
row_5 = working_increment*4 + row_1;
working_increment = working_height / 6; // generally-useful spacing amount for vertical columns of stuff
col_left = h_margin;
col_middle = col_left + (15.6 + 1.5 + 7 + 8); // pot + led + switch?
col_right = width_mm - h_margin;
// special: the right-hand side tries to squeeze 6 rows into the space of 5
out_working_increment = working_increment * 4 / 5;
out_row_1 = v_margin+12;
out_row_2 = out_working_increment*1 + out_row_1;
out_row_3 = out_working_increment*2 + out_row_1;
out_row_4 = out_working_increment*3 + out_row_1;
out_row_5 = out_working_increment*4 + out_row_1;
out_row_6 = out_working_increment*5 + out_row_1;
out_row_2 = working_increment*1 + out_row_1;
out_row_3 = working_increment*2 + out_row_1;
out_row_4 = working_increment*3 + out_row_1;
out_row_5 = working_increment*4 + out_row_1;
out_row_6 = working_increment*5 + out_row_1;
out_row_7 = working_increment*6 + out_row_1;
//special-case the knob spacing on the right sub-panel
top_row = height - rail_clearance - thickness*2 - 16.5/2; // 16.5 is the diameter of the round part of a pot
rotary_knob_row = top_row - 30;
//special-case the top knobs
top_row = height - v_margin - title_font_size*2;
working_width = width_mm - h_margin;
left_rib_x = thickness * 1;
right_rib_x = width_mm - thickness*2;
// How much horizontal space needed for left-hand and right-hand sub-panels
left_panel_width = 40; // widest element is rotary, at 30mm
right_panel_width = 12; // overkill; currently three 3.5mm jacks needing 8mm
slider_spacing = 12.5; // space between centers of each sliding pot; these are actually 8.8mm but require more on the circuit board for a single through-hole on one side
//calculated x value of exact middle of slider panel (between steps 5 and 6); middle of panel after deducting left/right sub-panels
slider_center = (width_mm - left_panel_width - right_panel_width)/2 + left_panel_width;
slider_bottom = v_margin+12;
// draw panel, subtract holes
union() {
difference(){
color([.1,.1,.1])
panel(width);
// top stuff
// step rotary switch? Special: this needs measuring, and leaving space for a label
translate([col_left+h_margin, top_row, 0]) pot_p160();
// internal clock rate
translate([col_right-h_margin, top_row, 0]) pot_p160();
translate([col_left, row_5, 0]) make_step();
translate([col_left, row_4, 0]) make_step();
translate([col_left, row_3, 0]) make_step();
translate([col_left, row_2, 0]) make_step();
translate([col_left, row_1, 0]) make_step();
translate([col_middle, row_5, 0]) make_step();
translate([col_middle, row_4, 0]) make_step();
translate([col_middle, row_3, 0]) make_step();
translate([col_middle, row_2, 0]) make_step();
translate([col_middle, row_1, 0]) make_step();
// Top left: clock in, speed
// clock in
translate([col_right, out_row_6, 0]) audio_jack_3_5mm();
translate([col_left, top_row, 0]) audio_jack_3_5mm();
//clock rate
translate([col_left+20, top_row, 0])
rotate([0, 0, 180])
pot_p160();
// Left side: meta-step controls
// step rotary switch - this needs a _big_ knob, these are not easy to actuate, plus space for well-aligned, well-printed numbers
translate([col_left+15, rotary_knob_row, 0]) rotary_switch();
// step (manual) -- this is actually a pushbutton momentary, but roughly same dimensions as toggle switch
translate([col_left+5, out_row_3, 0]) toggle_switch_6mm();
// reset (manual) -- this is actually a pushbutton momentary, but roughly same dimensions as toggle switch
translate([col_left+20, out_row_3, 0]) toggle_switch_6mm();
// run/stop (switch)
translate([col_left+5, out_row_2, 0]) toggle_switch_6mm();
// once/continuous (switch)
translate([col_left+20, out_row_2, 0]) toggle_switch_6mm();
// cv range (switch between 2.5v and 5v max)
translate([col_left+15, out_row_1, 0]) toggle_switch_6mm();
// clock out
translate([col_right, out_row_5, 0]) audio_jack_3_5mm();
// reset
translate([col_right, out_row_4, 0]) audio_jack_3_5mm();
// gate out
translate([col_right, out_row_3, 0]) audio_jack_3_5mm();
// cv out
// gate out
translate([col_right, out_row_2, 0]) audio_jack_3_5mm();
// cv switch
// cv out
translate([col_right, out_row_1, 0]) audio_jack_3_5mm();
// steps: slider, led, switch
// Note: don't mess with the multipliers here, tweak the variables themselves
translate([slider_center-slider_spacing*.5, slider_bottom, 0]) make_step();
translate([slider_center-slider_spacing*1.5, slider_bottom, 0]) make_step();
translate([slider_center-slider_spacing*2.5, slider_bottom, 0]) make_step();
translate([slider_center-slider_spacing*3.5, slider_bottom, 0]) make_step();
translate([slider_center-slider_spacing*4.5, slider_bottom, 0]) make_step();
translate([slider_center+slider_spacing*.5, slider_bottom, 0]) make_step();
translate([slider_center+slider_spacing*1.5, slider_bottom, 0]) make_step();
translate([slider_center+slider_spacing*2.5, slider_bottom, 0]) make_step();
translate([slider_center+slider_spacing*3.5, slider_bottom, 0]) make_step();
translate([slider_center+slider_spacing*4.5, slider_bottom, 0]) make_step();
}
// label the whole thing?
// translate([width_mm/2, height-hole_dist_top-10, 0]) label("Fireball VCO", size=10);
// ribs
// ribs - reinforcements and barriers against shorts on the rails
translate([left_rib_x, rail_clearance, 0])
v_wall(h=4, l=height-rail_clearance*2-thickness);
translate([right_rib_x, rail_clearance, 0])
@ -146,30 +163,10 @@ union() {
// top horizontal rib
translate([left_rib_x, height-rail_clearance-thickness, 0])
h_wall(h=4, l=right_rib_x);
// middle horizontal rib
translate([left_rib_x, top_row-rail_clearance-thickness, 0])
h_wall(h=1.6, l=right_rib_x);
// middle-bottom h rib
translate([left_rib_x, rail_clearance+15+thickness, 0])
h_wall(h=1.6, l=right_rib_x);
// bottom horizontal rib
translate([left_rib_x, rail_clearance, 0])
h_wall(h=4, l=right_rib_x);
// one more vertical to mount the circuit board to, dead center
translate([width_mm/2-thickness/2, rail_clearance+15+thickness, 0])
v_wall(h=4, l=top_row-rail_clearance*2-thickness-15);
// PCB holder
translate([width_mm/2-thickness/2+1.15/2, rail_clearance+15+thickness, 0])
pcb_holder(h=10, l=top_row-rail_clearance*2-15-thickness, th=1.15, wall_thickness=1);
// lower h-rib reinforcer
}
module make_surface(filename, h) {
@ -234,23 +231,46 @@ module nys325_midi_socket() {
cylinder(r=1.6, h=thickness*2+1);
}
module audio_jack_3_5mm() {
module audio_jack_3_5mm(vertical=true) {
translate([0, 0, -1]) cylinder(r=3, h=thickness*2+1);
if (vertical) {
translate([-9/2, -10.5/2, 0]) cube([9, 10.5, .0001]);
} else {
translate([-10.5/2, -9/2, 0]) cube([10.5, 9, .0001]);
}
}
module toggle_switch_6mm() {
translate([0, 0, -1]) cylinder(r=3, h=thickness*2+1);
translate([-8/2, -13/2, 0]) cube([8, 13, .0001]);
}
module toggle_switch_6_8mm() {
translate([0, 0, -1]) cylinder(r=3.4, h=thickness*2+1);
}
// http://www.mouser.com/ds/2/414/Datasheet_RotaryPanelPot_P160series-1133272.pdf
module rotary_switch(){
translate([0, 0, -1]) cylinder(r=5, h=thickness*2);
//hole for anchor
translate([17.36/2 + 3/2, 0, -1]) cylinder(r=1.5, h=thickness);
// visual indicator of space switch takes up
translate([0, 0, 0]) cylinder(r=14, h=.0001);
}
//
module pot_p160(anchor_hole="left") {
translate([0, 0, -1]) cylinder(r=3.75, h=thickness*2);
// hole for anchor; with translate() ends up being h-1 deep
if (anchor_hole=="left" || anchor_hole=="both") {
translate([7.8, 0, -1]) cylinder(r=1.5, h=thickness);
translate([0, 13/2, 0]) cube([17, 13, .0001], center=true);
}
if (anchor_hole=="right" || anchor_hole=="both") {
translate([-7.8, 0, -1]) cylinder(r=1.5, h=thickness);
translate([0, 0, 0]) cube([17, 13, .0001], center=true);
}
// visual indicator of space pot body takes up
translate([0, 0, 0]) cylinder(r=16.5/2, h=.0001);
}
module pot_wh148() {
@ -259,16 +279,31 @@ module pot_wh148() {
translate([7.8, 0, -1]) cylinder(r=1.3, h=thickness);
}
module pot_0547() {
// slider pot slit
translate([-1.25, 0, -1]) cube([2.5, 52, thickness*2]);
// visual indicator
translate([-8.8/2, -4, 0]) cube([8.8, 60.25, .0001]);
}
module led_5mm() {
// make a hole for a 5mm led, with a hair of margin
translate([0, 0, -1]) cylinder(r=2.575, h=thickness*2+2);
}
module make_step() {
module make_step(bottom_element="switch") {
// generate holes for a pot, an LED, and a switch
pot_p160();
translate([8, 0, 0]) led_5mm();
translate([8+7, 0, 0]) toggle_switch_6_8mm();
if (bottom_element=="pot"){
pot_0547();
translate([0, 55+8, 0]) led_5mm();
translate([0, 55+24, 0]) toggle_switch_6mm();
} else if (bottom_element=="switch") {
toggle_switch_6mm();
translate([0, 16, 0]) pot_0547();
translate([0, 55+24, 0]) led_5mm();
}
}