Commits

iorodeo committed 2996d3c

Finished arrayed version of design. Design spring based capillary clamp
mechanism. Adjusted capillary offset. Increased capillary hole size to improve
clearance.

Comments (0)

Files changed (4)

arrayed_enclosure.py

     def make(self):
         super(Arrayed_Enclosure,self).make()
         self.make_array_bottom()
+        self.make_bottom_mount_holes()
 
     def make_array_bottom(self):
         number_of_sensors = self.params['number_of_sensors']
         bottom_x_overhang = self.params['bottom_x_overhang']
         bottom_y_overhang = self.params['bottom_y_overhang']
 
-        # Get list of current bottom parts - shifted into position
-        shifted_bottoms = []
-        pos_values = self.get_array_positions()
-        for pos in pos_values:
-            shifted_bottoms.append(Translate(self.bottom,v=(0,pos,0)))
-
-        # Get intersection plate
+        # Create larger bottom plate for arrayed sensor
         plate_x = self.bottom_x
         plate_y = self.bottom_y + sensor_spacing*number_of_sensors + 2*overhang
-        plate =  rounded_box(plate_x,plate_y,thickness,radius=lid_radius,round_z=False)
+        self.array_bottom_size = plate_x, plate_y
+        self.array_bottom =  rounded_box(plate_x,plate_y,thickness,radius=lid_radius,round_z=False)
 
-        # Remove holes in plate for arrayed bottoms 
-        cut_block_list = []
-        for pos in pos_values:
-            cut_block = rounded_box(
-                    self.bottom_x-bottom_x_overhang,
-                    self.bottom_y-bottom_y_overhang,
-                    2*thickness,
-                    lid_radius,
-                    round_z=False
-                    )
-            cut_block = Translate(cut_block,v=(0,pos,0))
-            cut_block_list.append(cut_block)
-        diff_list = [plate] + cut_block_list
-        plate = Difference(diff_list)
+        # Get list of holes in single capillary sensor
+        hole_list = self.params['hole_list'] + self.tab_hole_list + self.standoff_hole_list
+        bottom_holes = [hole for hole in hole_list if hole['panel'] == 'bottom']
 
-        # Add in arrayed bottoms
-        union_list = [plate] + shifted_bottoms
-        self.array_bottom = Union(union_list) 
+        # Create list of bottom holes for arrayed sensor
+        array_bottom_holes = []
+        array_y_values = self.get_array_y_values()
+        for hole in bottom_holes:
+            for pos_y in array_y_values:
+                hole_new = dict(hole)
+                hole_x, hole_y = hole['location']
+                hole_new['location'] = hole_x, hole_y + pos_y
+                hole_new['panel'] = 'array_bottom'
+                array_bottom_holes.append(hole_new)
 
+        self.add_holes(array_bottom_holes)
 
+    def make_bottom_mount_holes(self):
+        hole_diam = self.params['bottom_mount_hole_diam'] 
+        hole_spacing = self.params['bottom_mount_hole_spacing'] 
+        hole_inset = self.params['bottom_mount_hole_inset'] 
+        bottom_x, bottom_y = self.array_bottom_size
+
+        hole_list = []
+        for i in (-1,1):
+            for j in (-1,1):
+                x_pos = i*0.5*hole_spacing
+                y_pos = j*(0.5*bottom_y - hole_inset)
+                hole = {
+                        'panel'     : 'array_bottom',
+                        'type'      : 'round',
+                        'location'  : (x_pos,y_pos),
+                        'size'      : hole_diam,
+                        }
+                hole_list.append(hole)
+        self.add_holes(hole_list)
 
     def get_assembly(self,**kwargs):
         show_bottom = kwargs['show_bottom']
         parts_list = []
 
         # Array top parts
-        pos_values = self.get_array_positions()
+        pos_values = self.get_array_y_values()
         for pos in pos_values:
             parts_list.append(Translate(top_parts,v=(0,pos,0)))
 
 
         return parts_list
 
+    def get_box_projection(self,show_ref_cube=True,spacing_factor=4,project=True):
+        inner_x, inner_y, inner_z = self.params['inner_dimensions']
+        wall_thickness = self.params['wall_thickness']
+        top_x_overhang = self.params['top_x_overhang']
+        top_y_overhang = self.params['top_y_overhang']
+        bottom_x_overhang = self.params['bottom_x_overhang']
+        bottom_y_overhang = self.params['bottom_y_overhang']
+        spacing = spacing_factor*wall_thickness
+        bottom = self.bottom
 
-    def get_array_positions(self):
+        # Translate front panel
+        y_shift = -(0.5*self.bottom_y + 0.5*inner_z + wall_thickness + spacing)
+        front = Translate(self.front, v=(0,y_shift,0))
+
+        # Translate back panel
+        y_shift = 0.5*self.bottom_y + 0.5*inner_z + wall_thickness + spacing
+        back = Rotate(self.back,a=180,v=(1,0,0)) # Rotate part so that outside face is up in projection
+        back = Translate(back, v=(0,y_shift,0))
+
+        # Rotate and Translate left panel
+        left = Rotate(self.left,a=90,v=(0,0,1))
+        left = Rotate(left,a=180,v=(0,1,0)) # Rotate part so that outside face is up in projection
+        x_shift = -(0.5*self.bottom_x + 0.5*inner_z + wall_thickness + spacing)
+        left = Translate(left, v=(x_shift,0,0))
+
+        # Rotate and translate right panel
+        right = Rotate(self.right,a=90,v=(0,0,1))
+        x_shift = 0.5*self.bottom_x + 0.5*inner_z + wall_thickness + spacing
+        right = Translate(right,v=(x_shift,0,0))
+
+        # Create reference cube
+        ref_cube = Cube(size=(INCH2MM,INCH2MM,INCH2MM))
+        y_shift = 0.5*self.bottom_y + 0.5*INCH2MM + inner_z + 2*wall_thickness + 2*spacing
+        ref_cube = Translate(ref_cube,v=(0,y_shift,0))
+
+        # Add capillary clamp
+        thickness = self.params['wall_thickness']
+        clamp_x, clamp_y, clamp_z = self.clamp_size
+        x_shift = 0.5*self.top_x + 0.5*clamp_x + spacing_factor*thickness
+        y_shift = 0.5*self.top_y + 0.5*clamp_y + spacing_factor*thickness
+        clamp = Translate(self.capillary_clamp,v=(x_shift,y_shift,0))
+
+        # Create part list
+        part_list = [self.top, front, back, left, right, clamp]
+        if show_ref_cube == True:
+            part_list.append(ref_cube)
+
+        # Project parts
+        part_list_proj = []
+        for part in part_list:
+            if project:
+                part_list_proj.append(Projection(part))
+            else:
+                part_list_proj.append(part)
+
+        return part_list_proj
+
+    def get_bottom_projection(self,show_ref_cube=True,spacing_factor=4):
+        thickness = self.params['wall_thickness']
+        ref_cube = Cube(size=(INCH2MM,INCH2MM,INCH2MM))
+        x_shift = 0.5*self.bottom_x + 0.5*INCH2MM + spacing_factor*thickness
+        ref_cube = Translate(ref_cube,v=(x_shift,0,0))
+
+        bottom = Projection(self.array_bottom)
+        parts_list = [bottom]
+        if show_ref_cube:
+            parts_list.append(Projection(ref_cube))
+
+        return parts_list
+
+
+    def get_array_y_values(self):
         number_of_sensors = self.params['number_of_sensors']
         sensor_spacing = self.params['sensor_spacing']
         array_length = sensor_spacing*number_of_sensors

capillary_enclosure.py

         self.make_led_pcb()
         self.make_diffuser()
         self.make_led_standoffs()
+        self.make_capillary_clamp_thru_holes()
+        self.make_capillary_clamp()
 
     def get_assembly(self,**kwargs):
         """
         except KeyError:
             show_guide_plates = True
         try:
+            show_guide_top = kwargs['show_guide_top']
+        except KeyError:
+            show_guide_top = True
+        try:
             show_led_pcb = kwargs['show_led_pcb']
         except KeyError:
             show_led_pcb = True
             explode = kwargs['explode']
         except KeyError:
             explode = (0,0,0)
+        try:
+            show_clamp = kwargs['show_clamp']
+        except KeyError:
+            show_clamp = True
 
         explode_x, explode_y, explode_z = explode
 
         z_shift = -0.5*z + 1.5*guide_z 
         guide_plate_top = Translate(self.guide_plate_top,v=[0,y_shift,z_shift])
         if show_guide_plates:
-           parts_list.extend([guide_plate_pos,guide_plate_neg,guide_plate_top])
+           parts_list.extend([guide_plate_pos,guide_plate_neg])
+        if show_guide_top:
+           parts_list.extend([guide_plate_top])
+
 
         # Add led pcb
         pcb_x, pcb_y, pcb_z = self.params['led_pcb_dimensions']
             if show_diffuser_standoffs:
                 parts_list.append(standoff)
 
+        # Add capillary clamp
+        bottom_x_overhang = self.params['bottom_x_overhang']
+        clamp_x, clamp_y, clamp_z = self.clamp_size
+        x_shift = 0.5*self.bottom_x - 0.5*bottom_x_overhang
+        z_shift = -0.5*z + 0.5*wall_thickness + cap_hole_diam
+        capillary_clamp = Translate(self.capillary_clamp,v=(x_shift,0,z_shift))
+        if show_clamp:
+            parts_list.append(capillary_clamp)
+
         return parts_list
 
 
         Get 2D projected layout of parts for laser cutting.
         """
         parts_list = super(Capillary_Enclosure,self).get_projection(show_ref_cube,spacing_factor)
+
+        # Add capillary clamp
+        thickness = self.params['wall_thickness']
+        clamp_x, clamp_y, clamp_z = self.clamp_size
+        x_shift = 0.5*self.bottom_x + 0.5*clamp_x + spacing_factor*thickness
+        y_shift = 0.5*self.bottom_y + 0.5*clamp_y + spacing_factor*thickness
+        clamp = Translate(self.capillary_clamp,v=(x_shift,y_shift,0))
+        parts_list.append(Projection(clamp))
         return parts_list
 
 
         hole_list.append(hole)
         self.params['hole_list'].extend(hole_list)
 
-    def add_capillary_clamp_holes(self):
-        """
-        Add holes for clamping capillary in place
-        """
-        hole_list = []
-        hole_diam = self.params['capillary_clamp_hole_diam']
-        sensor_hole_space = self.params['sensor_mount_hole_space']
-        clamp_hole_space = self.params['capillary_clamp_hole_space']
-        self.capillary_clamp_holes_xy = []
-        for i in (-1,1):
-            for j in (-1,1):
-                x_pos = 0.5*i*sensor_hole_space
-                y_pos = 0.5*j*clamp_hole_space
-                self.capillary_clamp_holes_xy.append((x_pos,y_pos))
-                hole = {
-                        'panel'    : 'bottom',
-                        'type'     : 'round',
-                        'location' : (x_pos,y_pos),
-                        'size'     : hole_diam,
-                        }
-                hole_list.append(hole)
-        self.params['hole_list'].extend(hole_list)
-
-
     def add_sensor_cable_hole(self):
         """
         Add cable hole for sensor.
 
         self.params['hole_list'].extend(hole_list)
 
-    #def add_led_cable_hole(self):
-    #    hole_list = []
-    #    hole_width = self.params['led_cable_hole_width']
-    #    x,y,z = self.params['inner_dimensions']
-
-    #    x_pos = 0
-    #    y_pos = 0.5*z - 0.5*hole_width 
-    #    hole = {
-    #            'panel'    : 'front',
-    #            'type'     : 'round',
-    #            'location' : (x_pos,y_pos),
-    #            'size'     : hole_width,
-    #            }
-    #    hole_list.append(hole)
-
-    #    x_pos = 0
-    #    y_pos = 0.5*z
-    #    hole = {
-    #            'panel'    : 'front', 
-    #            'type'     : 'square', 
-    #            'location' : (x_pos, y_pos), 
-    #            'size'     : (hole_width, hole_width),
-    #            }
-    #    hole_list.append(hole)
-    #    self.params['hole_list'].extend(hole_list)
-
-    def make_rubber_band_notch(self):
-        hole_list = []
-        hole_width = self.params['rubber_band_notch_width']
-        sensor_space = self.params['sensor_mount_hole_space']
-        x,y,z = self.params['inner_dimensions']
-
-        # Create holes for bottom panel
-        for i in (-1,1):
-            for j in (-1,1):
-
-                # Round portion of hole
-                x_pos = i*0.5*sensor_space
-                y_pos = j*(0.5*self.bottom_y - 0.5*hole_width)
-                hole = {
-                        'panel'    : 'bottom',
-                        'type'     : 'round', 
-                        'location' : (x_pos, y_pos),
-                        'size'     : hole_width,
-                        }
-                hole_list.append(hole)
-
-                # Rectangular portion of hole
-                y_pos = j*0.5*self.bottom_y
-                hole = {
-                        'panel'    : 'bottom',
-                        'type'     : 'square', 
-                        'location' : (x_pos, y_pos), 
-                        'size'     : (hole_width, hole_width),
-                        }
-                hole_list.append(hole)
-
-        #Create holes for front and back panels
-        panel_list = ('front' , 'back')
-        for panel in panel_list:
-            for i in (-1,1): 
-                # Round portion of hole
-                x_pos = i*0.5*sensor_space
-                y_pos = -(0.5*z - 0.5*hole_width)
-                hole = {
-                        'panel'    : panel,
-                        'type'     : 'round',
-                        'location' : (x_pos, y_pos),
-                        'size'     : hole_width,
-                        }
-                hole_list.append(hole)
-
-                # Square portion of hole
-                y_pos = -0.5*z
-                hole = {
-                        'panel'    : panel,
-                        'type'     : 'square', 
-                        'location' : (x_pos, y_pos),
-                        'size'     : (hole_width, hole_width),
-                        }
-                hole_list.append(hole)
-
-        self.add_holes(hole_list)
-
     def make_sensor(self):
         sensor_x, sensor_y, sensor_z = self.params['sensor_dimensions']
         hole_offset = self.params['sensor_hole_offset']
                 }
         self.params['hole_list'].append(hole)
 
+    def make_capillary_clamp_thru_holes(self):
+        inner_x, inner_y, inner_z = self.params['inner_dimensions']
+        wall_thickness = self.params['wall_thickness']
+        bottom_x_overhang = self.params['bottom_x_overhang']
+        hole_diam = self.params['capillary_clamp_thru_hole_diam']
+        hole_offset = self.params['capillary_clamp_hole_offset']
 
+        hole_list = []
+        for i in (-1,1):
+            x_pos = i*(0.5*self.bottom_x - 0.5*bottom_x_overhang)
+            y_pos = hole_offset 
+            hole = {
+                    'panel'    : 'bottom',
+                    'type'     : 'round',
+                    'location' : (x_pos, y_pos),
+                    'size'     : hole_diam,
+                    }
+            hole_list.append(hole)
 
+        self.params['hole_list'].extend(hole_list)
+        self.add_holes(hole_list)
 
+    def make_capillary_clamp(self):
+        bottom_x_overhang = self.params['bottom_x_overhang']
+        wall_thickness = self.params['wall_thickness']
+        clamp_length = self.params['capillary_clamp_length']
+        clamp_tolerance = self.params['capillary_clamp_tolerance']
+        clamp_radius = self.params['capillary_clamp_radius']
+        hole_offset = self.params['capillary_clamp_hole_offset']
+        hole_diam = self.params['capillary_clamp_tap_hole_diam']
 
+        clamp_x = bottom_x_overhang - 2*clamp_tolerance
+        clamp_y = clamp_length
+        clamp_z = wall_thickness 
+        self.clamp_size = clamp_x, clamp_y, clamp_z
 
+        hole_list = [(0,hole_offset,hole_diam)]
+
+        clamp = plate_w_holes(clamp_x,clamp_y,clamp_z,hole_list,radius=clamp_radius)
+        self.capillary_clamp = clamp
+
+
+
+
+
+

make_arrayed_enclosure.py

 from arrayed_enclosure import Arrayed_Enclosure
 from make_enclosure import params
 
-params['number_of_sensors'] = 4
+params['number_of_sensors'] = 5
 params['sensor_spacing'] = INCH2MM*2.0
 params['array_bottom_overhang'] = 1.0*INCH2MM
+params['bottom_mount_hole_diam'] = 0.2010*INCH2MM 
+params['bottom_mount_hole_spacing'] = INCH2MM 
+params['bottom_mount_hole_inset'] = 0.5*INCH2MM
 
 # -----------------------------------------------------------------------------
 if __name__ == '__main__':
     enclosure.make()
 
     part_assembly = enclosure.get_assembly(
-            show_top=True,
+            show_top=False,
             show_bottom=True, 
-            show_front=True,
-            show_back=True,
-            show_left=True,
-            show_right=True,
-            show_standoffs=True,
-            show_capillary=True,
-            show_sensor=True,
-            show_diffuser=True,
-            show_led_pcb=True,
-            show_guide_plates=True,
+            show_front=False,
+            show_back=False,
+            show_left=False,
+            show_right=False,
+            show_standoffs=False,
+            show_capillary=False,
+            show_sensor=False,
+            show_diffuser=False,
+            show_diffuser_standoffs=False,
+            show_led_pcb=False,
+            show_guide_plates=False,
+            show_guide_top=False,
+            show_clamp=False,
             explode=(0,0,0),
             )
     prog_assembly = SCAD_Prog()
     prog_assembly.add(part_assembly)
     prog_assembly.write('arrayed_assembly.scad')
 
+    box_projection = enclosure.get_box_projection()
+    bottom_projection = enclosure.get_bottom_projection()
+    diffuser_projection = enclosure.get_diffuser_projection()
+    top_guide_projection = enclosure.get_guide_top_projection()
+    side_guide_projection = enclosure.get_guide_side_projection()
 
+    prog_box_projection = SCAD_Prog()
+    prog_box_projection.fn = 50
+    prog_box_projection.add(box_projection)
+    prog_box_projection.write('arrayed_box_projection.scad')
 
+    prog_diffuser_projection = SCAD_Prog()
+    prog_diffuser_projection.fn = 50
+    prog_diffuser_projection.add(diffuser_projection)
+    prog_diffuser_projection.write('diffuser_projection.scad')
+    
+    prog_top_guide_projection = SCAD_Prog()
+    prog_top_guide_projection.fn = 50
+    prog_top_guide_projection.add(top_guide_projection)
+    prog_top_guide_projection.write('top_guide_projection.scad')
+    
+    prog_side_guide_projection = SCAD_Prog()
+    prog_side_guide_projection.fn = 50
+    prog_side_guide_projection.add(side_guide_projection)
+    prog_side_guide_projection.write('side_guide_projection.scad')
 
+    prog_bottom_projection = SCAD_Prog()
+    prog_bottom_projection.fn = 50
+    prog_bottom_projection.add(bottom_projection)
+    prog_bottom_projection.write('arrayed_bottom_projection.scad')

make_enclosure.py

         'standoff_offset'                  : 0.05*INCH2MM,
         'standoff_hole_diameter'           : 0.089*INCH2MM, 
         'capillary_diam'                   : 1.0,
-        'capillary_hole_size'              : (1.1,1.1,0.1),  
-        'capillary_hole_offset'            : 0.25,
+        #'capillary_hole_size'              : (1.1,1.1,0.1),  
+        #'capillary_hole_offset'            : 0.25,
+        'capillary_hole_size'              : (1.4,1.4,0.2),  
+        'capillary_hole_offset'            : 0.75,
         'capillary_length'                 : 5*INCH2MM,
+        'capillary_clamp_thru_hole_diam'   : 0.12*INCH2MM,
+        'capillary_clamp_tap_hole_diam'    : 0.089*INCH2MM,
+        'capillary_clamp_hole_offset'      : -3.0,
+        'capillary_clamp_length'           : 18.0,
+        'capillary_clamp_tolerance'        : 0.25,
+        'capillary_clamp_radius'           : 1.5,
         'sensor_width'                     : 12.95,
         'sensor_length'                    : 61.33,
         'sensor_dimensions'                : (61.33,12.95,3.3),
     
     part_assembly = enclosure.get_assembly(
             show_top=False,
-            show_bottom=True, 
-            show_front=False,
-            show_back=False,
-            show_left=False,
-            show_right=False,
+            show_bottom=False, 
+            show_front=True,
+            show_back=True,
+            show_left=True,
+            show_right=True,
             show_standoffs=True,
             show_capillary=True,
-            show_sensor=False,
-            show_diffuser=True,
-            show_led_pcb=True,
+            show_sensor=True,
+            show_diffuser=False,
+            show_diffuser_standoffs=False,
+            show_led_pcb=False,
             show_guide_plates=True,
+            show_guide_top=False,
+            show_clamp=True,
             explode=(0,0,0),
             )