diff --git a/Firmware/20240421.V1/README.md b/Firmware/20240421.V1/README.md deleted file mode 100644 index 42295ce..0000000 --- a/Firmware/20240421.V1/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# Description of Files in this Directory - -Firmware/20240421.V1 : -- Exercises the machinery of the Krake (custom machinery integration). -- Connects to WiFi and sets up a server for client communication. -- Initializes the LCD and controls its display. -- Sets up pins for controlling multiple lamps. -- Continuously loops to handle incoming and outgoing WiFi commands. -- Initializes the DFPlayer and plays emergency sounds. -- Allows muting of emergency sounds for ten minutes using a button. -- Reads sensor data and sends it to an HTTP server. -- Fetches emergency levels over WiFi and adjusts lamp blinking speeds accordingly. -- Provides a menu interface for interacting with the DFPlayer via the serial monitor. - - - - diff --git a/enclosure/U_Box_V105_Krake_RevB.scad b/enclosure/U_Box_V105_Krake_RevB.scad index 3b263d8..eab9a4f 100644 --- a/enclosure/U_Box_V105_Krake_RevB.scad +++ b/enclosure/U_Box_V105_Krake_RevB.scad @@ -22,38 +22,58 @@ include KrakeEnclosureVersion = 0.1; // change this with each rev /* Project Selector */ -Krake = 1; // [0:Off, 1:On] +Krake = 0; // [0:Off, 1:On] //on GPAD = 0; // [0:Off, 1:On] - +Krake_rev2 = 1; // turn on for the enralged enclosure //////////////////////////////////////////////////////////////////// // Export Options //////////////////////////////////////////////////////////////////// +// + GPAD_TShell = 0; -GPAD_TShellWithVESA = 1; -GPAD_BShell = 0; -GPAD_FPanL = 0; -GPAD_BPanL = 0; +GPAD_TShellWithVESA = 1; //1 back of unit +GPAD_BShell = 1; //2 w/LCD +GPAD_FPanL = 1;//3 bottom +GPAD_BPanL = 1; //4 top BButton = 0 ; RotaryEncoder = 0; // change to a real rotary encoder T_BShellScrew = 0; BOSSScrew = 0; PCB_SIMPLE = 0; PWA_GPAD = 0; -PWA_KRAKE = 0; +PWA_KRAKE = 1;//pcb LED_Standoff = 0; LED_Standoff_Single = 0; PWA = 0; SPK = 0; HEAT_SET_INSERTS = 0; +SPKLid = 0; + +///////////////// speakers ////////// +// SoundLabSPK = 1; + //////////////////////////////////////////////////////////////////// // Common Parameters - Base settings shared by all configurations //////////////////////////////////////////////////////////////////// +// speaker parameters + +SpeakerDiameter_mm=78; +SpeakerRadius_mm=SpeakerDiameter_mm/2; + +SpeakerHeight_mm = Krake_rev2 ? 40 : 0; + + + + + +translationVariable = 4 * SpeakerHeight_mm -5; +//////////////////////////////////////////////////////////////////// -Length = 83.82 + 13; -Width = 138 + 13; -Height = 40; +Length = 83.82 + 13 +translationVariable; //x axis +Width = 138 + 13; //y axis axis +Height = 40 + SpeakerHeight_mm/2; //z axis was 40 Thick = 2; // Wall thickness Filet = 2; // Corner rounding Resolution = 50; // Filet smoothness @@ -62,11 +82,12 @@ PCBFeet = 1; // Enable PCB feet Vent = 1; // Enable vents Vent_width = 1.5; + //////////////////////////////////////////////////////////////////// // PCB Parameters - Common //////////////////////////////////////////////////////////////////// -PCBPosX = 0; +PCBPosX = 0 + translationVariable; PCBPosY = 0; PCBLength = 83.82; PCBWidth = 137.16; @@ -93,53 +114,85 @@ Couleur3 = "Green"; Dec_Thick = Vent ? Thick * 2 : Thick; Dec_size = Vent ? Thick * 2 : 0.8; +//////////////////////////////////////////////////////////////////// +// Speaker location parameters +//////////////////////////////////////////////////////////////////// +SpeakerPositionX = Length/4; +SpeakerPositionY =Width/2; +SpeakerPositionZ = 0-Thick; +SpeakerHolePosX =Thick+m/2 -FootHeight; +SpeakerHolePosY = SpeakerPositionY; +SpeakerHolePosZ = SpeakerPositionZ+ SpeakerDiameter_mm/2; +Angle_deg =90; //Modifications for Display -DisplayXpos = PCBLength-50.8; +DisplayXpos = PCBLength-50.8 + translationVariable; DisplayYpos = 71.12; DisplayLenght = 26; DisplayWidth = 76; DisplayFilet = 0; -//Modificationd for muteButton -muteButtonXpos = PCBLength-10; +//Modifications for muteButton +muteButtonXpos = PCBLength-10 + translationVariable; muteButtonYpos = 31.75; muteButtonDiameter = 15; //Modifications for SpeakerHole SpeakerHoleY = Krake ? PCBWidth*.769 : 15.24; -SpeakerHoleX = Krake ? PCBLength*.815 :PCBLength - 15.24; +SpeakerHoleX = translationVariable + ( Krake ? PCBLength*.815 :PCBLength - 15.24 ); //Parameters for LEDHole LEDspacing = 12.7 ; -LEDYposOffset = 15.24 ; // offset from the Encoder edge of PCB -LEDXposOffset = 27.94 ; // offset from the connector edge of PCB +LEDYposOffset = 15.24 ; // offset from the Encoder edge of PCB +LEDXposOffset = 27.94 ; // offset from the connector edge of PCB // Krake Modifications for RotaryEncodeHole i=-1; // Encoder is one LEd spacing below LEDs -RotaryEncoderXpos = Krake ? PCBLength-(LEDXposOffset+LEDspacing*i) : 0; +RotaryEncoderXpos = translationVariable +( Krake ? PCBLength-(LEDXposOffset+LEDspacing*i) : 0 ); RotaryEncoderYpos = Krake ? 15.24 : 0; RotaryEncoderDiameter = Krake ? 16 : 0; // Connectors Modifications specific port logic +//if krake true x: y; i.e if krake on, usbbon =0, aka off USBbOn = Krake ? 0 : 1; USBcOn = Krake ? 1 : 0; DE9On = Krake ? 1 : 0; I2COn = Krake ? 0 : 1; RJ12On = Krake ? 1 : 1; DCOn = Krake ? 1 : 1; +speaker_clamp = Krake ? 0 : 1; +grill_pattern = Krake ? 0 : 1; +SpeakerEnclosure = Krake ? 0 : 1; +SpeakerCutOut = Krake ? 0 : 1; + SPKBOSS62 = Krake ? 0 : 0; +SPKBOSSpunch62 = Krake ? 0 : 0; + +USBbOn = Krake_rev2 ? 0 : 1; +USBcOn = Krake_rev2 ? 1 : 0; +DE9On = Krake_rev2 ? 1 : 0; +I2COn = Krake_rev2 ? 0 : 1; +RJ12On = Krake_rev2 ? 1 : 1; +DCOn = Krake_rev2 ? 1 : 1; +speaker_clamp = Krake_rev2 ? 1 : 0; +grill_pattern = Krake_rev2 ? 1 : 0; +SpeakerEnclosure = Krake_rev2 ? 1 : 0; +SpeakerCutOut = Krake_rev2 ? 1 : 0; + SPKBOSS62 = Krake_rev2 ? 1 : 0; +SPKBOSSpunch62 = Krake_rev2 ? 1 : 0; //DE9SquareHole = Krake ? 1 : 0; if (Krake + GPAD > 1) echo("WARNING: More than one project mode active!!!"); + + //For instructions on mute Button inscription go to line 594. // Import 3mm Plastite Screw if(BOSSScrew ==1){ - translate ([PCBLength-70.74,12.24,25]) + translate ([PCBLength-70.74,12.24,25]) //is this just to reposition the screw to the correct place?, where are these numbers from? //translate ([0,0,FootHeight+ScrewLenght+1]) import("MCMaster_Carr_Pan_Head_Screw_99461a941.stl"); } @@ -165,6 +218,8 @@ module RoundBox($a=Length, $b=Width, $c=Height){// Cube bords arrondis } } }// End of RoundBox Module +//strange cube sizing to mitigate the fact after minkowski the box would get larger as addition of cylinder size plus cube size thus desired length/2, desired width - 2 times the extra added because of the cylinder +//confused on the translate and rotate requirements , when you rotate it it drops below the line so you need to translate it up to keep it on the right plane, the rotate means the cylinder is on the longest edge off the cube ////////////////////////////////// - Module Coque/Shell - ////////////////////////////////// @@ -175,6 +230,7 @@ module Coque(){//Coque - Shell difference(){//sides decoration union(){ difference() {//soustraction de la forme centrale - Substraction Fileted box + //??unsure why subtracting a fileted box after subtracting a cube difference(){//soustraction cube median - Median cube slicer union() {//union difference(){//Coque @@ -293,12 +349,50 @@ if(SPK==1){ import("Speaker2W-SpeakerOutline.stl"); } +module grill_pattern() { +translate ([SpeakerPositionX,SpeakerPositionY,SpeakerPositionZ]){ +wall_thickness = 2; +grill_bar_width = 1; + // The pattern consists of intersecting cubes (bars) + scale (1.2){ + union() { + // Horizontal bars (along X-axis) + for (i = [-SpeakerDiameter_mm/2 : (grill_bar_width + wall_thickness) : SpeakerDiameter_mm/2]) { + translate([i, 0, 0]) + cube([grill_bar_width, SpeakerDiameter_mm, Thick + 1], center=true); + } + // Vertical bars (along Y-axis) + for (j = [-SpeakerDiameter_mm/2 : (grill_bar_width + wall_thickness) : SpeakerDiameter_mm/2]) { + translate([0, j, 0]) + cube([SpeakerDiameter_mm, grill_bar_width, Thick + 1], center=true); + } + } +} +} +} -module SpeakerHole(OnOff,Cx,Cy,Cdia,Ccenter=false){ +module SpeakerHexGrill(Krake_rev2, Cx, Cy, Cdia=SpeakerDiameter_mm*1.5, h=Thick, cell=6, wall=1){ + + if (Krake_rev2 == 1) + translate([Cx, Cy, 0]) + intersection(){ + cylinder(d=Cdia*0.95, h=h, $fn=100); + + for (x=[-Cdia/2:cell:Cdia/2]) + for (y=[-Cdia/2:cell:Cdia/2]) + translate([x + (y%2)*cell/2, y*0.866, 0]) + difference(){ + cylinder(r=cell/2, h=h, $fn=6); + cylinder(r=(cell/2)-wall, h=h+0.2, $fn=6); + } + } +} + + +module SpeakerHole(Krake_rev2,Cx,Cy,Cdia,Ccenter=false){ //difference(){ - if(OnOff==1) - - translate([Cx ,Cy ,-1]){ + if(Krake_rev2==1) + translate([Cx ,Cy ,-1]){ for(j = [1 : 3]){ rotate(a = 360*j/3,v = [0,0,1]) @@ -308,11 +402,13 @@ module SpeakerHole(OnOff,Cx,Cy,Cdia,Ccenter=false){ cylinder(d=i*.65,h = 10, $fn=100,center=Ccenter); //echo(i); - - - } + } } - }} + } + } + + + {// Parameters speaker_diameter = 25.5; // mm speaker_thickness = 5; // mm (adjust if needed) @@ -747,6 +843,7 @@ module VESApunch75(stud_height_mm,h_offset_mm) { cylinder(h=sh,r=radius,center = false); } } + module TShellWithVESA() { stud_height_mm = 7.8; @@ -796,6 +893,7 @@ module centeredHeatSetInsert() { import( "flanged insert M4 D7.1 H9.11.stl",convexity=1); } + if(HEAT_SET_INSERTS==1){ stud_distance_mm = 75; @@ -823,17 +921,76 @@ if(HEAT_SET_INSERTS==1){ } } -if(GPAD_BShell==1){ - // Coque bas - Bottom shell - i=0; + + +module SPKBOSS62(stud_height_mm,h_offset_mm) { + // A VESA mount for D 75mm + // from Wikipedia https://en.wikipedia.org/wiki/Flat_Display_Mounting_Interface + // D 75mm MIS-D, 75, C 75 75 - speaker_clamp(); + // First, I will create the 4 studs in the correct + // (square) pattern + stud_distance_mm = 62; + sd = stud_distance_mm; + half_stud_distance_mm = sd/2; + hsd = half_stud_distance_mm; + + sh = stud_height_mm; + translate([0,0,sh-h_offset_mm]) + union() { + rotate([180,0,0]) + translate([hsd,hsd,0]) + m4_stud(0,0,sh,0); + rotate([180,0,0]) + translate([hsd,-hsd,0]) + m4_stud(0,0,sh,0); + rotate([180,0,0]) + translate([-hsd,hsd,0]) + m4_stud(0,0,sh,0); + rotate([180,0,0]) + translate([-hsd,-hsd,0]) + m4_stud(0,0,sh,0); + } +} +module SPKBOSSpunch62(stud_height_mm,h_offset_mm) { +// sh = stud_height_mm +2; // addin length for cutting + sh = stud_height_mm + -2; // addin length for cutting + radius = 4.5; // just a guess! + stud_distance_mm = 60; + sd = stud_distance_mm; + half_stud_distance_mm = sd/2; + hsd = half_stud_distance_mm; + translate([0,0,sh-h_offset_mm]) + union() { + rotate([180,0,0]) + translate([hsd,hsd,0]) + cylinder(h=sh,r=radius,center = false); + rotate([180,0,0]) + translate([hsd,-hsd,0]) + cylinder(h=sh,r=radius,center = false); + rotate([180,0,0]) + translate([-hsd,hsd,0]) + cylinder(h=sh,r=radius,center = false); + rotate([180,0,0]) + translate([-hsd,-hsd,0]) + cylinder(h=sh,r=radius,center = false); + } +} + module GPAD_BShell () { + // Coque bas - Bottom shell + i=0; + difference(){ + difference (){ + union () { + + union(){ + // speaker_clamp(); difference(){ color(Couleur1,1){ union(){ Coque(); - translate( [3*Thick+2,Thick+5,5])SpeakerHolder(0,SpeakerHoleX,PCBWidth-FootPosX,11,Ccenter=true); //Speaker holder + translate( [3*Thick+2,Thick+5,5])SpeakerHolder(0,SpeakerHoleX,PCBWidth-FootPosX,11,Ccenter=true); //Speaker holder // Pied support PCB - PCB feet if (PCBFeet==1){// Feet @@ -851,10 +1008,10 @@ if(GPAD_BShell==1){ //(On/Off, Xpos, Ypos, Diameter) - for ( i = [0 : 4] ){ - CylinderHole(1,PCBLength-(LEDXposOffset+LEDspacing*i),LEDYposOffset,5); //LED1 + for ( i = [-12.25:-8.25] ){ + CylinderHole(1,PCBLength-(LEDXposOffset+LEDspacing*i),LEDYposOffset,5); //LED1 , switch signs to move downwards ??Question } - CylinderHole(1,PCBLength-46.99,PCBWidth-FootPosX,5); //LED6 power + //CylinderHole(1,PCBLength-46.99,PCBWidth-FootPosX,5); //LED6 power //??Question extra? //(On/Off, Xpos,Ypos,Length,Width,Filet) SquareHole(1,DisplayXpos,DisplayYpos,DisplayLenght,DisplayWidth,DisplayFilet,Ccenter=true); //Display @@ -868,13 +1025,17 @@ if(GPAD_BShell==1){ }} color( Couleur1,1){ translate( [3*Thick+2,Thick+5,0]){ //([-.5,0,0]){ - //(On/Off, Xpos, Ypos, Diameter) - SpeakerHole(1,SpeakerHoleX,SpeakerHoleY,11,Ccenter=true); //Buzzer - for ( i = [0 : 4] ){ - - CylinderHole(1,PCBLength-(27.94+12.7*i),15.24,5); //LED1 - } - CylinderHole(1,PCBLength-46.99,PCBWidth-FootPosX,5); //LED6 power + // (On/Off, Xpos, Ypos, Diameter) + + SpeakerHole(1,SpeakerPositionX,SpeakerPositionY,SpeakerDiameter_mm/2.5,Ccenter=true); //Buzzer + + + + + //LED hole generator unsure why this works ??Question repeated commented to avoid confusion + //for ( i = [0 : 0] ){ //CylinderHole(1,PCBLength-(27.94+12.7*i),15.24,5); //LED1-5 + // } + CylinderHole(1,PCBLength-46.99+translationVariable,PCBWidth-FootPosX,5); //LED6 power light ??Question delete extra //(On/Off, Xpos,Ypos,Length,Width,Filet) SquareHole(1,DisplayXpos,DisplayYpos,DisplayLenght,DisplayWidth,DisplayFilet,Ccenter=true); //Display @@ -890,9 +1051,33 @@ if(GPAD_BShell==1){ // // SquareHole(1,PCBLength-63.87,33.12,1,1,0,Ccenter=true); //testing } } - +//SpeakerCutOut(); + } + translate ([-5,0,0]) + SpeakerHexGrill(1,SpeakerPositionX, SpeakerPositionY); + } + +SpeakerEnclosure(); +} + CableHole(); + } + AllScrewPockets (); +} } + + +/// SPKBOSS62 and SPKBOSSpunch62 integration w Speaker 62mm hole to hole +if(GPAD_BShell==1){ +difference (){ +GPAD_BShell(); +translate ([SpeakerPositionX+5,SpeakerPositionY+8,Thick+7.8+.1]) +SPKBOSSpunch62 (7.8,7.8); + +} +translate ([SpeakerPositionX+5,SpeakerPositionY+8,Thick+7.8+.1]) +SPKBOSS62 (7.8,7.8); } + if(RotaryEncoder ==1){ //RotaryEncoder translate( [3*Thick+2,Thick+5,0]) @@ -903,9 +1088,6 @@ if(BButton ==1){ translate( [3*Thick+2,Thick+5,0]) ButtonSwitch(1,muteButtonXpos,muteButtonYpos,muteButtonDiameter); //Mute Button } - - - if(LED_Standoff == 1){ //(OnOff,Cx,Cy,Cdia,Cpitch,Cheight,Ccenter=false){ translate( [3*Thick+2,Thick+5,5]){//([-.5,0,0]){ @@ -917,7 +1099,6 @@ if(LED_Standoff == 1){ LedSpacer(1,PCBLength-46.99,PCBWidth-FootPosX,5,2.54,Thick+FootHeight+PCBThick/2+.1-6,false); //LED6 power } } - if(PCB_SIMPLE==1){ //////////////////// - PCB only visible in the preview mode - ///////////////////// translate([3*Thick+2,Thick+5,Thick+FootHeight+PCBThick/2+.1]){ @@ -944,10 +1125,9 @@ if(PWA_GPAD==1){ } } // Fin PCB } - if(PWA_KRAKE==1){ //////////////////// - PCB only visible in the preview mode - ///////////////////// - translate([3*Thick+2,Thick+5,Thick+FootHeight+PCBThick/2-.1]){ + translate([3*Thick+2 + translationVariable,Thick+5,Thick+FootHeight+PCBThick/2-.1]){ rotate([0,0,90])translate([0,0,PCBThick-0.2]); rotate([0,0,90])translate([-55.88,17.78,0]) color(Couleur3) @@ -984,8 +1164,6 @@ if(GPAD_BPanL==1){ Panel(Length,Width,Thick,Filet); } - - // Module Section // RoundBox(length = 100, width = 50, height = 30, radius = 10, resolution = 50); module frontPanel(){ @@ -1031,3 +1209,96 @@ if (T_BShellScrew==1){ }//fin de sides holes +////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////// +/////////// speaker expansion Courtney //////////// +//consider port location and access holes + +module SpeakerEnclosure (){ + + +module SpeakerBoxKnife(){ +translate ([SpeakerPositionX+4+Thick*5, SpeakerPositionY,Height/4-Thick]){ + cube ([1.6*SpeakerDiameter_mm-10,SpeakerDiameter_mm*1.5-10, Height*2], center=true); + }} + + module SpeakerBoxOuter (){ +difference (){ + translate ([SpeakerPositionX+Thick*5+5, SpeakerPositionY,Height/4+Thick+10]){ + cube ([1.6*SpeakerDiameter_mm,SpeakerDiameter_mm*1.5+10, SpeakerHeight_mm+5], center=true); + } + SpeakerBoxKnife(); + } + } + + module SpeakerShelf (){ + translate ([SpeakerPositionX +SpeakerHeight_mm + 10, SpeakerPositionY,SpeakerHeight_mm/2-Thick]){ + cube ([5,SpeakerDiameter_mm*1.5, 3*SpeakerHeight_mm/4], center=true); + } + } + union (){ + SpeakerShelf(); + SpeakerBoxOuter(); + } + + +module SpeakerCutOut () { +translate ([SpeakerPositionX+Thick*5+45, SpeakerPositionY-52.5,-10]){ +cube ([15,SpeakerDiameter_mm*1.25+5,Height]); + } + } + + ///////////////screw parameters/////////////////// + ScrewDiameter=2.2; + ScrewLength=5+Thick; + Spacing=100; + module ScrewPocket(){ +cylinder (d=ScrewDiameter,h=ScrewLength+Thick,center=true); +} + +module AllScrewPockets (){ +translate([SpeakerPositionX + Thick*5 + 5, + SpeakerPositionY, + Height/4 + Thick + 10 - (Height-10)/2]) { + + part_x = 1.6*SpeakerDiameter_mm; + part_y = SpeakerDiameter_mm*1.5 + 10; + part_z = Height - 10; + + edge_offset = 4; // distance from edges to hole center (mm) + + x = part_x/2 - edge_offset; + y = part_y/2 - edge_offset; + + // 4 corner holes + translate([ x, y, Height-ScrewLength-Thick]) + ScrewPocket(); + translate([-x, y, Height-ScrewLength-Thick]) + ScrewPocket(); + translate([ x, -y, Height-ScrewLength-Thick]) + ScrewPocket(); + translate([-x, -y, Height-ScrewLength-Thick]) + ScrewPocket(); + } +} + +module SpeakerBoxLid(){ +difference (){ + translate ([SpeakerPositionX+Thick*5+5, SpeakerPositionY,SpeakerHeight_mm-ScrewLength]){ + cube ([1.6*SpeakerDiameter_mm, SpeakerDiameter_mm*1.5+10, Thick], center=true); + } + AllScrewPockets(); + } +} + +if (SPKLid==1){ +SpeakerBoxLid(); +} + +module CableHole() { + translate ([1.8*SpeakerDiameter_mm,SpeakerDiameter_mm,3*SpeakerHeight_mm/4]){ + rotate ([0,90,0]){ + cylinder (d=10,h=Thick*5,center=true); + } + } + }} \ No newline at end of file diff --git a/enclosure/U_Box_V105_Krake_RevB_PRINT_READY.3mf b/enclosure/U_Box_V105_Krake_RevB_PRINT_READY.3mf new file mode 100644 index 0000000..1ccb2cf Binary files /dev/null and b/enclosure/U_Box_V105_Krake_RevB_PRINT_READY.3mf differ