Exemplo n.º 1
0
 def connect_one_side(Left):
     x_offset_mult = (-1 if Left else 1)
     
     height_offset = 1.5
     meander_front_y = -41 # 2015.02.03 - switched from -45, -40 was too close
     meander_front_y = -44.5 # for new Octobot molds used in D-90, 2015.04.21
     meander_back_y = -45 # 2015.02.03 - switched from -50
     meander_back_y = -47.5 # for new Octobot molds used in D-90, 2015.04.21
     ##meander_inner_x_offset = 3 # was originally 0.75 in Dan's code
     meander_inner_x_offset = 1.5 #added for D-80
     connection_overlap = 0.0   # what is this? it was originally in Dan's code as 0.5 originally
     meander_print_speed = 0.5 # switched from 0.6 on 2014.02.06
     meander_connection_dwell_time = 1
     ramp_height = 0.0
     small_diameter_filament_speed = 3
     
     # 2015.05.19: Now, connect the oscillator inlets to the vents downstream
     # of actuators L1 and R1. Move above inlet hole and connect:
     hole_pos = (LogicModule.back_left_hole_pos if Left else LogicModule.back_right_hole_pos)
     e3DPGlobals.g.abs_move(x = hole_pos[0], y = hole_pos[1])
     e3DMatrixPrinting.print_mode(LogicModule.module_top_print_height, print_speed = e3DMatrixPrinting.default_print_speed)
     e3DMatrixPrinting.move_z_abs(FancyOctobot2.control_line_height_abs + 2)
     e3DPGlobals.g.feed(small_diameter_filament_speed)
     e3DPGlobals.g.abs_move(x = FancyOctobot2.mold_center_x + x_offset_mult * meander_inner_x_offset * 4)
     to_y_downstream_of_actuator = FancyOctobot2.routing_front_y + FancyOctobot2.to_osc_vent_offset
     control_line_x = FancyOctobot2.mold_center_x + x_offset_mult*FancyOctobot2.control_line_connector_x_dist_from_center_line
     e3DPGlobals.g.abs_move(x=control_line_x, y = to_y_downstream_of_actuator)
     e3DMatrixPrinting.travel_mode()
Exemplo n.º 2
0
 def print_bladder_bus_line():
     e3DMatrixPrinting.move_x(-1 * bladder_spacing * (num_bladders))
     e3DMatrixPrinting.print_mode(print_height_abs=bus_line_print_height,
                                  print_speed=20)
     e3DPGlobals.g.feed(bus_line_print_speed)
     e3DMatrixPrinting.move_x(bladder_spacing * (num_bladders - 0.5))
     e3DMatrixPrinting.travel_mode()
Exemplo n.º 3
0
 def print_sensor():
    sensor_width = 4
    sensor_height_offset = 0.5
    sensor_length_offset = 2
    e3DMatrixPrinting.move_y(sensor_width/2)
    e3DMatrixPrinting.print_mode(print_height_abs = bus_line_print_height+sensor_height_offset, print_speed = 20)
    e3DPGlobals.g.feed(sensor_print_speed)
    e3DMatrixPrinting.move_x(-1*bladder_spacing*(num_bladders-0.5)-sensor_length_offset)
    e3DMatrixPrinting.move_y(-1*sensor_width)
    e3DMatrixPrinting.move_x(bladder_spacing*(num_bladders-0.5)+sensor_length_offset)
    e3DMatrixPrinting.travel_mode()
Exemplo n.º 4
0
 def print_bladders():
     e3DMatrixPrinting.move_x(-1 * spacer_spacing * (num_spacers - 1) -
                              1 * bladder_spacing / 2.0)
     for bladder in range(num_bladders):
         e3DMatrixPrinting.print_mode(print_height_abs=bladder_print_height,
                                      print_speed=20)
         e3DPGlobals.g.feed(bladder_print_speed)
         for layer in range(bladder_layers):
             print_void_layer(length=bladder_length, width=bladder_width)
             e3DPGlobals.g.move(z=bladder_layer_increment)
         e3DMatrixPrinting.travel_mode()
         e3DMatrixPrinting.move_x(bladder_spacing)
Exemplo n.º 5
0
 def print_bladders():
     e3DMatrixPrinting.move_x(-1*spacer_spacing*(num_spacers-1))
     e3DMatrixPrinting.move_x(-1*bladder_spacing/2.0)
     #bladder_print_height = (((spacer_layers + 2) * spacer_layer_increment/2) + substrate_zero)
     for bladder in range(num_bladders):    
         e3DMatrixPrinting.print_mode(print_height_abs = bladder_print_height, print_speed = 20)
         e3DPGlobals.g.feed(bladder_print_speed)
         for layer in range(bladder_layers):
             print_void_layer(length = bladder_length, width = bladder_width)
             e3DPGlobals.g.move(z = bladder_layer_increment)
         e3DMatrixPrinting.travel_mode()
         e3DMatrixPrinting.move_x(bladder_spacing)
Exemplo n.º 6
0
 def print_bladder_spacers():
     e3DMatrixPrinting.travel_mode()
     e3DPGlobals.g.write("\n; Print pneunet bladders.")
     for spacer in range(num_spacers):
         e3DMatrixPrinting.move_x(spacer_spacing)
         spacer_print_height = substrate_zero + spacer_layer_increment
         e3DMatrixPrinting.print_mode(print_height_abs = spacer_print_height, print_speed = 20)
         e3DPGlobals.g.feed(spacer_print_speed)
         for layer in range(spacer_layers):
             print_void_layer(length = spacer_length, width = spacer_width)
             e3DPGlobals.g.move(z = spacer_layer_increment)
         e3DMatrixPrinting.travel_mode()
Exemplo n.º 7
0
 def print_bladder_spacers():
     e3DMatrixPrinting.travel_mode()
     e3DPGlobals.g.write("\n; Print pneunet bladders.")
     for spacer in range(num_spacers):
         e3DMatrixPrinting.move_x(spacer_spacing)
         spacer_print_height = substrate_zero + spacer_layer_increment
         e3DMatrixPrinting.print_mode(print_height_abs=spacer_print_height,
                                      print_speed=20)
         e3DPGlobals.g.feed(spacer_print_speed)
         for layer in range(spacer_layers):
             print_void_layer(length=spacer_length, width=spacer_width)
             e3DPGlobals.g.move(z=spacer_layer_increment)
         e3DMatrixPrinting.travel_mode()
Exemplo n.º 8
0
def print_pressureChamber_for_test_octobot(Left, fuel_line, needle_insertion,
                                           spacer):
    x_offset_mult = (-1 if Left else 1)

    print "Printing module output to robot channels input via pressure chamber."

    # ramp down down to channel (if needed) will determine min pressure channel back end y
    pressure_channel_back_y = get_pressure_channel_back_y()

    # Print a pressure chamber/connection from cliff base to the flow channel ends
    e3DPGlobals.g.write("\n; PRINT PRESSURE CHAMBER FOR " +
                        ("LEFT" if Left else "RIGHT") + " SIDE")
    MultiMaterial.change_tool(1)  # switch to platinum
    e3DPGlobals.g.abs_move(
        x=FancyOctobot2.mold_center_x + x_offset_mult *
        FancyOctobot2.control_line_connector_x_dist_from_center_line,
        y=pressure_channel_back_y
    )  # move over front of the front edge of the module ("cliff")
    e3DMatrixPrinting.print_mode(
        print_height_abs=FancyOctobot2.control_line_height_abs)
    e3DPGlobals.g.dwell(pressure_chamber_connection_dwell_time)
    e3DPGlobals.g.feed(pressure_chamber_speed)
    e3DPGlobals.g.abs_move(
        x=FancyOctobot2.mold_center_x + x_offset_mult *
        FancyOctobot2.control_line_connector_x_dist_from_center_line,
        y=pressure_channel_back_y + pressure_chamber_total_length
    )  # print up to the channel line back end # FancyOctobot2.control_line_back_y + pressure_channel_overlap
    e3DPGlobals.g.dwell(pressure_chamber_connection_dwell_time)
    e3DMatrixPrinting.travel_mode()
    MultiMaterial.change_tool(0)  # switch to Pluronic
    # move back to upstream end of reaction chamber
    e3DPGlobals.g.abs_move(
        x=FancyOctobot2.mold_center_x + x_offset_mult *
        FancyOctobot2.control_line_connector_x_dist_from_center_line,
        y=pressure_channel_back_y)
    e3DMatrixPrinting.print_mode(
        print_height_abs=FancyOctobot2.control_line_height_abs)
    e3DPGlobals.g.dwell(pressure_chamber_connection_dwell_time)
    e3DPGlobals.g.feed(e3DMatrixPrinting.default_print_speed)
    e3DPGlobals.g.abs_move(
        x=FancyOctobot2.mold_center_x + x_offset_mult *
        FancyOctobot2.control_line_connector_x_dist_from_center_line +
        x_offset_mult * spacer,
        y=pressure_channel_back_y - fuel_line)
    e3DPGlobals.g.feed(e3DMatrixPrinting.default_print_speed / 4)
    e3DPGlobals.g.abs_move(y=pressure_channel_back_y - fuel_line -
                           needle_insertion)
    e3DPGlobals.g.dwell(20)
    e3DMatrixPrinting.travel_mode()
Exemplo n.º 9
0
 def print_sensor():
     sensor_width = 4
     sensor_height_offset = 0.5
     sensor_length_offset = 3
     e3DMatrixPrinting.move_y(sensor_width / 2)
     e3DMatrixPrinting.print_mode(print_height_abs=bus_line_print_height +
                                  sensor_height_offset,
                                  print_speed=20)
     e3DPGlobals.g.feed(sensor_print_speed)
     e3DMatrixPrinting.move_x(-1 * bladder_spacing * (num_bladders - 0.5) -
                              sensor_length_offset)
     e3DMatrixPrinting.move_y(-1 * sensor_width)
     e3DMatrixPrinting.move_x(bladder_spacing * (num_bladders - 0.5) +
                              sensor_length_offset)
     e3DMatrixPrinting.travel_mode()
Exemplo n.º 10
0
 def print_plenum_meander(Left):
     x_offset_mult = (-1 if Left else 1)
     
     height_offset = 1.5
     meander_front_y = -41 # 2015.02.03 - switched from -45, -40 was too close
     meander_front_y = -44.5 # for new Octobot molds used in D-90, 2015.04.21
     meander_back_y = -45 # 2015.02.03 - switched from -50
     meander_back_y = -47.5 # for new Octobot molds used in D-90, 2015.04.21
     ##meander_inner_x_offset = 3 # was originally 0.75 in Dan's code
     meander_inner_x_offset = 1.5 #added for D-80
     connection_overlap = 0.0   # what is this? it was originally in Dan's code as 0.5 originally
     meander_print_speed = 0.5 # switched from 0.6 on 2014.02.06
     meander_connection_dwell_time = 1
     ramp_height = 0.0
     
     # Print the fuel reservoirs, starting at the check valves. This code was changed for D-90.
     # 2015.05.15: First create an interface with the original logic inlets.
     # 2015.05.15: These inlets will later connect with poitns downstream of all the actuators.
     LogicModule.interface_with_hole(Left = Left, Front = False, to_cliff = False, Valve = False)
     e3DMatrixPrinting.travel_mode()
     #2015.05.15: Now interface with the check valve inlets. These will lead to fuel reservoir and onto the reaction chambers.
     LogicModule.interface_with_hole(Left = Left, Front = False, to_cliff = False, Valve = True)
     e3DMatrixPrinting.move_z_abs(module_print_height_back - height_offset, vertical_travel_speed = e3DMatrixPrinting.default_z_drag_speed)
     # 2015.05.15: Move out of the way for connecting up to the reaction chamber:
     e3DPGlobals.g.abs_move(x = centerline_x + x_offset_mult * meander_inner_x_offset * 2)
     e3DMatrixPrinting.travel_mode()
     e3DPGlobals.g.abs_move(y=meander_back_y-connection_overlap)
     e3DMatrixPrinting.print_mode(print_height_abs = plenum_meander_print_height, print_speed = meander_print_speed)
     e3DPGlobals.g.abs_move(y=meander_front_y)
     e3DMatrixPrinting.move_z_abs(module_print_height_back - height_offset)
     hole_pos = (LogicModule.check_valve_left_hole_pos if Left else LogicModule.check_valve_right_hole_pos)
     e3DPGlobals.g.abs_move(x = centerline_x + x_offset_mult * meander_inner_x_offset * 2, y = hole_pos[1])
     # 2015.05.15: Connect with the channel out of the way and connected to the check valve.
     e3DPGlobals.g.dwell(meander_connection_dwell_time)
     e3DMatrixPrinting.travel_mode() 
     
     e3DPGlobals.g.abs_move(x = centerline_x + x_offset_mult * meander_inner_x_offset * 2, y = meander_back_y - connection_overlap)
     e3DMatrixPrinting.print_mode(plenum_meander_print_height, print_speed = meander_print_speed)
     e3DPGlobals.g.abs_move(x = centerline_x + x_offset_mult * meander_inner_x_offset * 0.5)
     e3DMatrixPrinting.move_z_abs(module_print_height_back) 
     
     # 2015.05.19: Now, it's ime to connect the reaction chamber with the 
     # fuel reservoir. First print at normal speed, and then create a region 
     # in the line of very small diameter. Connect with the reaction chamber.
     small_diameter_filament_length = 5
     small_diameter_filament_speed = 3
     e3DPGlobals.g.abs_move(y = hole_pos[1])
     #2015.05.19: Speed up and move to hiehgt of reaction chamber junction
     e3DMatrixPrinting.move_z_abs(LogicModule.module_top_print_height+ramp_height)
     e3DPGlobals.g.feed(small_diameter_filament_speed)
     e3DPGlobals.g.abs_move(y = hole_pos[1] + small_diameter_filament_length)
     # 2015.05.19: Slow down
     e3DPGlobals.g.feed(e3DMatrixPrinting.default_print_speed)     
     # 2015.05.19: Print up to reaction chamber
     pressure_channel_back_y = OctobotLogicModule.get_pressure_channel_back_y()
     e3DPGlobals.g.abs_move(x=FancyOctobot2.mold_center_x+x_offset_mult*FancyOctobot2.control_line_connector_x_dist_from_center_line, y = pressure_channel_back_y)
     e3DPGlobals.g.dwell(meander_connection_dwell_time)
     e3DMatrixPrinting.travel_mode()
Exemplo n.º 11
0
 def print_plenum_meander(Left):
     x_offset_mult = (-1 if Left else 1)
     
     height_offset = 1.5
     
     # Print the fuel reservoirs, starting at the check valves. This code was changed for D-90.
     LogicModule.interface_with_hole(Left = Left, Front = False, to_cliff = False, Valve = False)
     e3DMatrixPrinting.travel_mode()
     LogicModule.interface_with_hole(Left = Left, Front = False, to_cliff = False, Valve = True)
     e3DMatrixPrinting.move_z_abs(module_print_height_back - height_offset, vertical_travel_speed = e3DMatrixPrinting.default_z_drag_speed)
     e3DMatrixPrinting.travel_mode()
     
     meander_front_y = -41 # 2015.02.03 - switched from -45, -40 was too close
     meander_front_y = -44.5 # for new Octobot molds used in D-90, 2015.04.21
     meander_back_y = -45 # 2015.02.03 - switched from -50
     meander_back_y = -47.5 # for new Octobot molds used in D-90, 2015.04.21
     ##meander_inner_x_offset = 3 # was originally 0.75 in Dan's code
     meander_inner_x_offset = 1.5 #added for D-80
     connection_overlap = 0.0   # what is this? it was originally in Dan's code as 0.5 originally
     meander_print_speed = 0.5 # switched from 0.6 on 2014.02.06
     meander_connection_dwell_time = 1
     
     e3DPGlobals.g.abs_move(x=centerline_x+x_offset_mult*meander_inner_x_offset, y=meander_back_y-connection_overlap)
     e3DMatrixPrinting.print_mode(print_height_abs = plenum_meander_print_height, print_speed = meander_print_speed)
     safe_hole_connection_x_offset = meander_inner_x_offset
     ##e3DMatrixPrinting.move_z_abs(height = plenum_meander_print_height) # redundant?
     e3DPGlobals.g.feed(e3DMatrixPrinting.default_print_speed)
     e3DPGlobals.g.abs_move(y = meander_front_y)
     e3DPGlobals.g.abs_move(x = centerline_x+x_offset_mult*meander_inner_x_offset)
     e3DMatrixPrinting.move_z_abs(height = module_print_height_back - height_offset)
     e3DPGlobals.g.feed(e3DMatrixPrinting.default_print_speed)
     
     hole_pos = (LogicModule.check_valve_left_hole_pos if Left else LogicModule.check_valve_right_hole_pos)
     e3DPGlobals.g.abs_move(x=hole_pos[0], y=hole_pos[1]) # move above the hole
     e3DPGlobals.g.dwell(meander_connection_dwell_time)
     e3DMatrixPrinting.travel_mode() 
       
     # Now, connect the fule line to the inlets to the oscillator:
     e3DPGlobals.g.abs_move(x=centerline_x+x_offset_mult*meander_inner_x_offset, y=meander_back_y-connection_overlap)
     e3DMatrixPrinting.print_mode(print_height_abs = plenum_meander_print_height, print_speed = meander_print_speed)
     e3DPGlobals.g.feed(e3DMatrixPrinting.default_print_speed)
     e3DPGlobals.g.abs_move(x = centerline_x + x_offset_mult * meander_inner_x_offset * 2)
     e3DPGlobals.g.abs_move(y = meander_front_y)
     e3DMatrixPrinting.move_z_abs(height = module_print_height_back)
     e3DPGlobals.g.feed(e3DMatrixPrinting.default_print_speed)
     ##e3DPGlobals.g.abs_move(y = LogicModule.module_back_edge_y)
     
     hole_pos = (LogicModule.back_left_hole_pos if Left else LogicModule.back_right_hole_pos)
     e3DPGlobals.g.abs_move(x = hole_pos[0], y = hole_pos[1])
     e3DPGlobals.g.dwell(meander_connection_dwell_time)
     e3DMatrixPrinting.travel_mode()
Exemplo n.º 12
0
 def print_plenum_meander(Left):
     x_offset_mult = (-1 if Left else 1)
     
     height_offset = 1.5
     
     # Print the fuel reservoirs, starting at the check valves. This code was changed for D-90.
     LogicModule.interface_with_hole(Left = Left, Front = False, to_cliff = False, Valve = False)
     e3DMatrixPrinting.travel_mode()
     LogicModule.interface_with_hole(Left = Left, Front = False, to_cliff = False, Valve = True)
     e3DMatrixPrinting.move_z_abs(module_print_height_back - height_offset, vertical_travel_speed = e3DMatrixPrinting.default_z_drag_speed)
     e3DMatrixPrinting.travel_mode()
     
     meander_front_y = -41 # 2015.02.03 - switched from -45, -40 was too close
     meander_front_y = -44.5 # for new Octobot molds used in D-90, 2015.04.21
     meander_back_y = -45 # 2015.02.03 - switched from -50
     meander_back_y = -47.5 # for new Octobot molds used in D-90, 2015.04.21
     ##meander_inner_x_offset = 3 # was originally 0.75 in Dan's code
     meander_inner_x_offset = 1.5 #added for D-80
     connection_overlap = 0.0   # what is this? it was originally in Dan's code as 0.5 originally
     meander_print_speed = 0.5 # switched from 0.6 on 2014.02.06
     meander_connection_dwell_time = 1
     
     e3DPGlobals.g.abs_move(x=centerline_x+x_offset_mult*meander_inner_x_offset, y=meander_back_y-connection_overlap)
     e3DMatrixPrinting.print_mode(print_height_abs = plenum_meander_print_height, print_speed = meander_print_speed)
     safe_hole_connection_x_offset = meander_inner_x_offset
     ##e3DMatrixPrinting.move_z_abs(height = plenum_meander_print_height) # redundant?
     e3DPGlobals.g.feed(e3DMatrixPrinting.default_print_speed)
     e3DPGlobals.g.abs_move(y = meander_front_y)
     e3DPGlobals.g.abs_move(x = centerline_x+x_offset_mult*meander_inner_x_offset)
     e3DMatrixPrinting.move_z_abs(height = module_print_height_back - height_offset)
     e3DPGlobals.g.feed(e3DMatrixPrinting.default_print_speed)
     
     hole_pos = (LogicModule.check_valve_left_hole_pos if Left else LogicModule.check_valve_right_hole_pos)
     e3DPGlobals.g.abs_move(x=hole_pos[0], y=hole_pos[1]) # move above the hole
     e3DPGlobals.g.dwell(meander_connection_dwell_time)
     e3DMatrixPrinting.travel_mode() 
       
     # Now, connect the fule line to the inlets to the oscillator:
     e3DPGlobals.g.abs_move(x=centerline_x+x_offset_mult*meander_inner_x_offset, y=meander_back_y-connection_overlap)
     e3DMatrixPrinting.print_mode(print_height_abs = plenum_meander_print_height, print_speed = meander_print_speed)
     e3DPGlobals.g.feed(e3DMatrixPrinting.default_print_speed)
     e3DPGlobals.g.abs_move(x = centerline_x + x_offset_mult * meander_inner_x_offset * 2)
     e3DPGlobals.g.abs_move(y = meander_front_y)
     e3DMatrixPrinting.move_z_abs(height = module_print_height_back)
     e3DPGlobals.g.feed(e3DMatrixPrinting.default_print_speed)
     ##e3DPGlobals.g.abs_move(y = LogicModule.module_back_edge_y)
     
     hole_pos = (LogicModule.back_left_hole_pos if Left else LogicModule.back_right_hole_pos)
     e3DPGlobals.g.abs_move(x = hole_pos[0], y = hole_pos[1])
     e3DPGlobals.g.dwell(meander_connection_dwell_time)
     e3DMatrixPrinting.travel_mode()
Exemplo n.º 13
0
            e3DMatrixPrinting.move_xy(x_distance = edge/2, y_distance = -1*h, theta = angle_converted)

    def trace_to_next_level(num_edges):
        e3DMatrixPrinting.move_x(distance = -1*num_edges*edge, theta = angle_converted)
    
    def trace_outer_edges(num_edges):
        #e3DMatrixPrinting.move_xy(x_distance = edge/2, y_distance = h, theta = pi/3+angle_converted)
        e3DMatrixPrinting.move_xy(x_distance = num_edges*edge/2, y_distance = -1*num_edges*h, theta = angle_converted)
        e3DMatrixPrinting.move_xy(x_distance = -1*num_edges*edge, y_distance = 0, theta = angle_converted)
    
    while (n != 0.0):
        trace_inner_units(repeats = n)
        e3DMatrixPrinting.move_x(distance = edge, theta = pi/3+angle_converted)
        trace_to_next_level(num_edges = n)
        n = n - 1
    e3DMatrixPrinting.move_xy(x_distance = edge/2, y_distance = h, theta = angle_converted)
    trace_outer_edges(num_edges = m)

number_of_edge_triangles = 5
print_triangular_meander(-79.7, np.power(number_of_edge_triangles, 2), 8.0, 0.0)
e3DMatrixPrinting.travel_mode()
h = 15.0*(np.sqrt(3.0)/2)
e3DMatrixPrinting.move_y(h*number_of_edge_triangles/3)
number_of_edge_triangles = 8
print_triangular_meander(-77.7, np.power(number_of_edge_triangles, 2), 5.0, -60.0)
e3DMatrixPrinting.travel_mode()

e3DPGlobals.g.view('mayavi')
#e3DPGlobals.g.view()
e3DPGlobals.g.teardown()
Exemplo n.º 14
0
 def print_bladder_bus_line():
     e3DMatrixPrinting.move_x(-1*bladder_spacing*(num_bladders))
     e3DMatrixPrinting.print_mode(print_height_abs = bus_line_print_height, print_speed = 20)
     e3DPGlobals.g.feed(bus_line_print_speed)
     e3DMatrixPrinting.move_x(bladder_spacing*(num_bladders-0.5))
     e3DMatrixPrinting.travel_mode()
Exemplo n.º 15
0
                                  theta=angle_converted)
        e3DMatrixPrinting.move_xy(x_distance=-1 * num_edges * edge,
                                  y_distance=0,
                                  theta=angle_converted)

    while (n != 0.0):
        trace_inner_units(repeats=n)
        e3DMatrixPrinting.move_x(distance=edge, theta=pi / 3 + angle_converted)
        trace_to_next_level(num_edges=n)
        n = n - 1
    e3DMatrixPrinting.move_xy(x_distance=edge / 2,
                              y_distance=h,
                              theta=angle_converted)
    trace_outer_edges(num_edges=m)


number_of_edge_triangles = 5
print_triangular_meander(-79.7, np.power(number_of_edge_triangles, 2), 8.0,
                         0.0)
e3DMatrixPrinting.travel_mode()
h = 15.0 * (np.sqrt(3.0) / 2)
e3DMatrixPrinting.move_y(h * number_of_edge_triangles / 3)
number_of_edge_triangles = 8
print_triangular_meander(-77.7, np.power(number_of_edge_triangles, 2), 5.0,
                         -60.0)
e3DMatrixPrinting.travel_mode()

e3DPGlobals.g.view('mayavi')
#e3DPGlobals.g.view()
e3DPGlobals.g.teardown()
Exemplo n.º 16
0
def print_robot(ecoflex_zero_left, ecoflex_zero_right, func_print_internal_soft_logic):
    """"Print a fancy robot in the mold. Assume we start at the front left corner of the mold"""

    # PRINT_SPECIFIC PARAMETERS
    #MACHINE_ZERO = ecoflex_zero_left # zero on the top of the left ecoflex layer
    MACHINE_ZERO = ecoflex_zero_left[2] # choose actuator L3 as reference, added 20150409
    #MACHINE_ZERO_RIGHT = ecoflex_zero_right # the top of the left ecoflex layer
    MACHINE_ZERO_RIGHT = ecoflex_zero_right[2] # choose actuator L4 as reference, added 20150409
    global right_side_offset
    right_side_offset = MACHINE_ZERO_RIGHT-MACHINE_ZERO # added to the print height of the right actuators
    
    '''
    Note from RTruby:
        On Jan 19, 2015, I went through all of Dan Fitzgerald's code, and made
        sure I understood anything up until this comment.
        
        GO BACK AND REVIEW THE CODE BELOW AND WHAT IT'S DOING.
    '''     
                                                   
    ################ START PRINTING ################
    
    # set the current X and Y as the origin of the current work coordinates
    e3DPGlobals.g.absolute()     
        
    # go to our absolute work zero (mold top left corner)
    e3DPGlobals.g.write("POSOFFSET CLEAR X Y U A B; clear all position offsets and work coordinates.") #We should start in machine coordinates because the homing routine clears all position offsets, but clear them again anyway just incase
    e3DPGlobals.g.write("; Moving to travel height " + str(e3DMatrixPrinting.default_travel_height_abs) + " above left zero " + str(MACHINE_ZERO) + ".")
    e3DMatrixPrinting.move_z_abs(MACHINE_ZERO + e3DMatrixPrinting.default_travel_height_abs, vertical_travel_speed=e3DMatrixPrinting.default_air_travel_speed) # calculate the absolute default_travel_height relative to our zero and go to it
    
    #MultiMaterial.change_tool(1)
    e3DPGlobals.g.write("; Moving B to Travel Height")
    #e3DPGlobals.g.relative()
    #e3DPGlobals.g.move(x=0.1, y=0.1) # appease the normals
    #e3DPGlobals.g.absolute()
    #B_Height = e3DMatrixPrinting.default_travel_height_abs+0.1
    #e3DMatrixPrinting.move_z_abs(ecoflex_zero_left + B_Height, vertical_travel_speed=e3DMatrixPrinting.default_air_travel_speed) # calculate the absolute default_travel_height relative to our zero and go to it
    #NOTE: Do NOT change tools for this. Then the Nozzle z offsets will be applied twice. (Once with (92, one more with the tool change fixture offet)
    #: TODO: the downside of this is that the nozzles will travel at their unoffset heights (B will be above or below A and may crash if the discrepency is larger than the print travel height)
    e3DPGlobals.g.write("G1 B"+str(MACHINE_ZERO + e3DMatrixPrinting.default_travel_height_abs))
    #MultiMaterial.change_tool(0)

    
    # set this current mold zero as the work zero (set clearany current position offsets
    e3DPGlobals.g.write("\nG92 X0 Y0 "+MultiMaterial.cur_tool+str(e3DMatrixPrinting.default_travel_height_abs)+" " + MultiMaterial.tool_axis[1]+str(e3DMatrixPrinting.default_travel_height_abs)+" ; set the current position as <default_travel_height_abs> above the the absolute work coordinate zero origin")
    e3DPGlobals.g.feed(e3DMatrixPrinting.default_air_travel_speed)
    MultiMaterial.set_cur_tool()
    e3DPGlobals.g.write(" ; READY TO PRINT")

    # Print the soft logic minus the final 'glue' flow lines to the rest of the robot
    # VISITOR PATTERN - Call the logic printing function we were given as an argument. Give it parameters it needs specific to this robot's morphology
    func_print_internal_soft_logic(flow_connector_height_abs = control_line_height_abs, centerline_x = mold_center_x, flow_connectors_centerline_offset = control_line_connector_x_dist_from_center_line, flow_connectors_back_y = control_line_back_y)
    
    
    ################ Control Lines and Actuators ###############   
                                                                 
    #print control line A
    cur_arm_row = 0
    if (e3DPGlobals.g.position_history[-1][0] != control_line_A_connection_x and e3DPGlobals.g.position_history[-1][0] != control_line_back_y):
        e3DPGlobals.g.abs_move(x=control_line_A_connection_x, y = control_line_back_y)
    e3DMatrixPrinting.print_mode(print_height_abs = control_line_height_abs, print_speed = e3DMatrixPrinting.default_inlet_print_speed)
    e3DPGlobals.g.abs_move(y = control_line_back_y+OctobotLogicModule.pressure_channel_overlap)#control_line_connector_length)
    e3DPGlobals.g.feed(e3DMatrixPrinting.default_print_speed)
    if (control_line_A_x != control_line_A_connection_x or routing_back_y != control_line_back_y+control_line_connector_length):
        e3DPGlobals.g.abs_move(x=control_line_A_x, y = routing_back_y)
    # Line below added 2015.05.15 when coding up a Fuel Octobot with oscillatory venting:
    e3DPGlobals.g.abs_move(x=control_line_A_x, y = routing_front_y + to_osc_vent_offset)
    e3DMatrixPrinting.move_z_abs(control_line_height_abs + 2)
    e3DMatrixPrinting.travel_mode()
    e3DPGlobals.g.abs_move(x=control_line_A_x, y = routing_front_y)
    
            
    # print top right actuator A1 directly from end of control line A
    e3DMatrixPrinting.print_mode(print_height_abs = control_line_bridge_height_abs, print_speed = e3DMatrixPrinting.default_print_speed)
    e3DPGlobals.g.abs_move(x=control_line_A_x - routing_turnpoint_from_lines_x, y=routing_leg_offshoot_points[0])
    e3DPGlobals.g.abs_move(x=mold_center_x-arm_rows_shouder_x_centerline_offsets[cur_arm_row], y=arm_rows_shoulder_y_abs[cur_arm_row])
    print_left_actuator(row=cur_arm_row, arm_forarm_preActuator_length=arm_forarm_preActuator_length_arm1, num_pads = 1, zero_reference_diff = ecoflex_zero_left[cur_arm_row]-MACHINE_ZERO)

    #print control line B
    e3DPGlobals.g.abs_move(x=control_line_B_connection_x, y = control_line_back_y)
    e3DMatrixPrinting.print_mode(print_height_abs = control_line_height_abs, print_speed = e3DMatrixPrinting.default_inlet_print_speed)
    e3DPGlobals.g.abs_move(x=control_line_B_connection_x, y = control_line_back_y+control_line_connector_length)
    e3DPGlobals.g.feed(e3DMatrixPrinting.default_print_speed)
    if (control_line_B_x != control_line_B_connection_x or routing_back_y != control_line_back_y+control_line_connector_length):
        e3DPGlobals.g.abs_move(x=control_line_B_x, y = routing_back_y)
    # Line below added 2015.05.15 when coding up a Fuel Octobot with oscillatory venting:
    e3DPGlobals.g.abs_move(x=control_line_B_x, y = routing_front_y + to_osc_vent_offset)
    e3DMatrixPrinting.move_z_abs(control_line_height_abs + 2)
    e3DMatrixPrinting.travel_mode()
    e3DPGlobals.g.abs_move(x=control_line_B_x, y = routing_front_y) # arm_rows_shoulder_y_abs[cur_arm_row]

    
    # print top right actuator B1 directly from end of control line B
    e3DMatrixPrinting.print_mode(print_height_abs = control_line_bridge_height_abs, print_speed = e3DMatrixPrinting.default_print_speed)
    e3DPGlobals.g.abs_move(x=control_line_B_x + routing_turnpoint_from_lines_x, y=routing_leg_offshoot_points[0])
    e3DPGlobals.g.abs_move(x=mold_center_x+arm_rows_shouder_x_centerline_offsets[cur_arm_row], y=arm_rows_shoulder_y_abs[cur_arm_row])
    print_right_actuator(row=cur_arm_row, arm_forarm_preActuator_length=arm_forarm_preActuator_length_arm1, num_pads = 1, zero_reference_diff = ecoflex_zero_right[cur_arm_row]-MACHINE_ZERO)
            
    # print actuator A3 (second from top (row 1), right) bridging straight over control line B
    cur_arm_row = 1
    e3DPGlobals.g.abs_move(x=control_line_A_x, y=routing_branchpoints_y[1]) # y=arm_rows_shoulder_y_abs[cur_arm_row]
    e3DMatrixPrinting.print_mode(print_height_abs = control_line_height_abs)
    e3DMatrixPrinting.move_z_abs(control_line_bridge_height_abs)
    e3DPGlobals.g.feed(e3DMatrixPrinting.default_print_speed)
    e3DPGlobals.g.abs_move(x=control_line_B_x)
    e3DPGlobals.g.abs_move(x=control_line_B_x + routing_turnpoint_from_lines_x, y=routing_leg_offshoot_points[1])
    e3DPGlobals.g.abs_move(x=mold_center_x+arm_rows_shouder_x_centerline_offsets[cur_arm_row], y=arm_rows_shoulder_y_abs[cur_arm_row])
    print_right_actuator(row=cur_arm_row, arm_forarm_preActuator_length=arm_forarm_preActuator_length, num_pads = 2, zero_reference_diff = ecoflex_zero_right[cur_arm_row]-MACHINE_ZERO)
    
    #print actuator B3 (second from top (row 1), left) going around the control line of A3
    e3DPGlobals.g.abs_move(x=control_line_B_x, y=routing_branchpoints_y[2]) # connect to the control line midway between arm rows 1 and 2
    e3DMatrixPrinting.print_mode(print_height_abs = control_line_height_abs)
    e3DMatrixPrinting.move_z_abs(control_line_bridge_height_abs)
    e3DPGlobals.g.feed(e3DMatrixPrinting.default_print_speed)
    e3DPGlobals.g.abs_move(x=control_line_A_x)
    e3DPGlobals.g.abs_move(x=control_line_A_x - routing_turnpoint_from_lines_x, y=routing_leg_offshoot_points[1])
    e3DPGlobals.g.abs_move(x=mold_center_x-arm_rows_shouder_x_centerline_offsets[cur_arm_row], y=arm_rows_shoulder_y_abs[cur_arm_row])
    print_left_actuator(cur_arm_row, arm_forarm_preActuator_length, num_pads = 2, zero_reference_diff = ecoflex_zero_left[cur_arm_row]-MACHINE_ZERO)
    
    ##print actuator A2 (second from bottom (row 3), left)
    cur_arm_row = 2
    e3DPGlobals.g.abs_move(x=control_line_A_x, y = routing_branchpoints_y[3]) # arm_rows_shoulder_y_abs[cur_arm_row]
    e3DMatrixPrinting.print_mode(print_height_abs = control_line_height_abs)
    e3DMatrixPrinting.move_z_abs(control_line_bridge_height_abs)
    e3DPGlobals.g.feed(e3DMatrixPrinting.default_print_speed)
    e3DPGlobals.g.abs_move(x=control_line_A_x - routing_turnpoint_from_lines_x, y=routing_leg_offshoot_points[2])
    e3DPGlobals.g.abs_move(x=mold_center_x-arm_rows_shouder_x_centerline_offsets[cur_arm_row], y=arm_rows_shoulder_y_abs[cur_arm_row])
    print_left_actuator(cur_arm_row, arm_forarm_preActuator_length, num_pads = 2, zero_reference_diff = ecoflex_zero_left[cur_arm_row]-MACHINE_ZERO)
    
    #print actuator B2 (second from bottom, right)
    e3DPGlobals.g.abs_move(x=control_line_B_x, y = routing_branchpoints_y[3]) # arm_rows_shoulder_y_abs[cur_arm_row]
    e3DMatrixPrinting.print_mode(print_height_abs = control_line_height_abs)
    e3DMatrixPrinting.move_z_abs(control_line_bridge_height_abs)
    e3DPGlobals.g.feed(e3DMatrixPrinting.default_print_speed)
    e3DPGlobals.g.abs_move(x=control_line_B_x + routing_turnpoint_from_lines_x, y=routing_leg_offshoot_points[2])
    e3DPGlobals.g.abs_move(x=mold_center_x+arm_rows_shouder_x_centerline_offsets[cur_arm_row], y=arm_rows_shoulder_y_abs[cur_arm_row])
    print_right_actuator(cur_arm_row, arm_forarm_preActuator_length, num_pads = 2, zero_reference_diff = ecoflex_zero_right[cur_arm_row]-MACHINE_ZERO)
    
    #print actuator B4 (bottom (row 3), left) bridging over control line A
    cur_arm_row=3
    e3DPGlobals.g.abs_move(x=control_line_B_x, y = routing_branchpoints_y[4]) # arm_rows_shoulder_y_abs[cur_arm_row]
    e3DMatrixPrinting.print_mode(print_height_abs = control_line_height_abs)
    e3DMatrixPrinting.move_z_abs(control_line_bridge_height_abs)
    e3DPGlobals.g.feed(e3DMatrixPrinting.default_print_speed)
    e3DPGlobals.g.abs_move(x=control_line_A_x)
    e3DPGlobals.g.abs_move(x=control_line_A_x - routing_turnpoint_from_lines_x, y=routing_leg_offshoot_points[3])
    e3DPGlobals.g.abs_move(x=mold_center_x-arm_rows_shouder_x_centerline_offsets[cur_arm_row], y=arm_rows_shoulder_y_abs[cur_arm_row])
    print_left_actuator(cur_arm_row, arm_forarm_preActuator_length, num_pads = 2, zero_reference_diff = ecoflex_zero_left[cur_arm_row]-MACHINE_ZERO)
        
    #print actuator A4 (bottom right) going around the control line of B4
    e3DPGlobals.g.abs_move(x=control_line_A_x, y=routing_branchpoints_y[5]) # y=(arm_rows_shoulder_y_abs[cur_arm_row]+arm_rows_shoulder_y_abs[cur_arm_row-1])/2.0
    e3DMatrixPrinting.print_mode(print_height_abs = control_line_height_abs)
    e3DMatrixPrinting.move_z_abs(control_line_bridge_height_abs)
    e3DPGlobals.g.feed(e3DMatrixPrinting.default_print_speed)
    e3DPGlobals.g.abs_move(x=control_line_B_x)
    e3DPGlobals.g.abs_move(x=control_line_B_x + routing_turnpoint_from_lines_x, y=routing_leg_offshoot_points[3])
    e3DPGlobals.g.abs_move(x=mold_center_x+arm_rows_shouder_x_centerline_offsets[cur_arm_row], y=arm_rows_shoulder_y_abs[cur_arm_row])
    print_right_actuator(cur_arm_row, arm_forarm_preActuator_length, num_pads = 2, zero_reference_diff = ecoflex_zero_right[cur_arm_row]-MACHINE_ZERO)

    #go back to home
    e3DPGlobals.g.abs_move(x=0,y=0)
Exemplo n.º 17
0
def print_output_hole_to_flow_line_with_pressureChamber(Left, hole_pos):
    x_offset_mult = (-1 if Left else 1)

    print "Printing module output to robot channels input via pressure chamber."

    # ramp down down to channel (if needed) will determine min pressure channel back end y
    pressure_channel_back_y = get_pressure_channel_back_y()

    # Print a pressure chamber/connection from cliff base to the flow channel ends
    e3DPGlobals.g.write("\n; PRINT PRESSURE CHAMBER FOR " +
                        ("LEFT" if Left else "RIGHT") + " SIDE")
    MultiMaterial.change_tool(1)  # switch to platinum
    e3DPGlobals.g.abs_move(
        x=FancyOctobot2.mold_center_x + x_offset_mult *
        FancyOctobot2.control_line_connector_x_dist_from_center_line,
        y=pressure_channel_back_y
    )  # move over front of the front edge of the module ("cliff")
    e3DMatrixPrinting.print_mode(
        print_height_abs=FancyOctobot2.control_line_height_abs)
    e3DPGlobals.g.dwell(pressure_chamber_connection_dwell_time)
    e3DPGlobals.g.feed(pressure_chamber_speed)
    e3DPGlobals.g.abs_move(
        x=FancyOctobot2.mold_center_x + x_offset_mult *
        FancyOctobot2.control_line_connector_x_dist_from_center_line,
        y=pressure_channel_back_y + pressure_chamber_total_length
    )  # print up to the channel line back end # FancyOctobot2.control_line_back_y + pressure_channel_overlap
    e3DPGlobals.g.dwell(pressure_chamber_connection_dwell_time)
    e3DMatrixPrinting.travel_mode()
    MultiMaterial.change_tool(0)

    print "PRESSURE CHAMBER TOTAL LENGTH IS " + str(
        FancyOctobot2.control_line_back_y + pressure_channel_overlap -
        pressure_channel_back_y)

    # Print a vertical line in the hole to the top of the module
    e3DPGlobals.g.write("\n; PRINT IN HOLE OF " +
                        ("LEFT" if Left else "RIGHT") + " SIDE")
    LogicModule.interface_with_hole(Left=Left, Front=True, to_cliff=False)

    # drag up the cliff and over to the hole top in pluronic
    if (LogicModule.module_top_print_height >
            FancyOctobot2.control_line_height_abs):
        print "\t CLIFF NEEDED"

        # make a standard cliff - no ramp

        e3DMatrixPrinting.travel_mode()

        ramp_height = 0.0
        e3DPGlobals.g.abs_move(
            x=FancyOctobot2.mold_center_x + x_offset_mult *
            FancyOctobot2.control_line_connector_x_dist_from_center_line,
            y=pressure_channel_back_y + pressure_channel_overlap)
        e3DMatrixPrinting.print_mode(
            print_height_abs=FancyOctobot2.control_line_height_abs,
            print_speed=e3DMatrixPrinting.default_inlet_print_speed)
        e3DPGlobals.g.dwell(pressure_chamber_connection_dwell_time)
        e3DPGlobals.g.abs_move(y=pressure_channel_back_y)
        e3DMatrixPrinting.move_z_abs(
            height=LogicModule.module_top_print_height + ramp_height,
            vertical_travel_speed=e3DMatrixPrinting.default_z_drag_speed
        )  # drag z up the cliff
        e3DPGlobals.g.feed(e3DMatrixPrinting.default_print_speed)
        hole_pos = (LogicModule.front_left_hole_pos
                    if Left else LogicModule.front_right_hole_pos)
        e3DPGlobals.g.abs_move(
            x=hole_pos[0],
            y=hole_pos[1],
            z=LogicModule.module_top_print_height)  # move above the hole
        e3DPGlobals.g.dwell(pressure_chamber_connection_dwell_time)
        e3DMatrixPrinting.travel_mode()

        ## ramp down from logic module print height to pressure channel (control line) height
        #e3DMatrixPrinting.move_z_abs(height = FancyOctobot2.control_line_height_abs, vertical_travel_speed = e3DMatrixPrinting.default_z_drag_speed) # drag z up the cliff
        #e3DPGlobals.g.feed(e3DMatrixPrinting.default_print_speed)
        #e3DPGlobals.g.abs_move(x=FancyOctobot2.mold_center_x+x_offset_mult*FancyOctobot2.control_line_connector_x_dist_from_center_line, y=LogicModule.module_front_edge_y)
        #e3DPGlobals.g.abs_move(x=FancyOctobot2.mold_center_x+x_offset_mult*FancyOctobot2.control_line_connector_x_dist_from_center_line, y=pressure_channel_back_y, z=FancyOctobot2.control_line_height_abs) # move over front of the front edge of the module ("cliff")
        #e3DPGlobals.g.abs_move(x=FancyOctobot2.mold_center_x+x_offset_mult*FancyOctobot2.control_line_connector_x_dist_from_center_line, y=pressure_channel_back_y+pressure_channel_overlap) # move over front of the front edge of the module ("cliff")
        #e3DPGlobals.g.dwell(pressure_chamber_connection_dwell_time)
        #e3DMatrixPrinting.travel_mode()
    else:
        print "CLIFF FROM MODULE TO CONTROL lINES NEEDED"
        print "ERROR: Cliff from pressure lines up tp logic module print height not implmented yet!"
        e3DPGlobals.g.write(
            "ERROR: Cliff from pressure lines up tp logic module print height not implmented yet!"
        )
Exemplo n.º 18
0
def print_actuator(upperarm_length = 11, forarm_preActuator_length = 1, elbow_angle = 0, forarm_postActuator_length =4, theta=0, num_pads = 2):
    """Prints a soft actuator with the stem starting in the current position and rotated by theta. Assume nozzle is already at the correct height and already in print mode. (Continuation feature)
    
    Basic actuator geometry is
    
    y
    ^
    |
    +-->x
    
    []  second pad
    |   forarm_length
    []  first pad
    |   forarm_preActuator_length
    .   elbow (with optional bend angle of the forarm)
    |   upperarm_length
    x   start point

    """
                                                   
    # pad parameters
    pad_length = 2.6 # length in Y
    pad_width = 2.6 # width in x
    n_meanders = 8
    pad_print_speed = 4.5
    pad_print_speed = pad_print_speed * 0.75
    meander_separation_dist = pad_length/n_meanders
    vent_stem_length = 1 # added 20150327
    vent_spot_dwell = 0 # added 20150327
    
    def print_actuator_pad():
        """Helper funciton. Print one actuator pad here"""
        e3DPGlobals.g.write("\n; Print actuator pad.")
        e3DPGlobals.g.feed(pad_print_speed)
        e3DMatrixPrinting.move_x(-pad_width/2, theta) #move to the lower left corner of the pad
        for meander in range(n_meanders-1):
            e3DMatrixPrinting.move_xy(x_distance=pad_width, y_distance=meander_separation_dist,theta=theta)        # horizontal across the whole pad
            e3DMatrixPrinting.move_x(-pad_width,theta)
        e3DMatrixPrinting.move_xy(x_distance=pad_width, y_distance=meander_separation_dist,theta=theta)    
        e3DMatrixPrinting.move_x(-pad_width/2, theta)           # move to the middle of the top of the pad
    
    e3DPGlobals.g.write("\n; PRINT ACTUATOR.")                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
    e3DPGlobals.g.relative()                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
    e3DPGlobals.g.feed(e3DMatrixPrinting.default_print_speed*3) # *3 added on D-52
    e3DPGlobals.g.feed(e3DMatrixPrinting.default_print_speed/2) # *3 added on D-52
    e3DPGlobals.g.feed(e3DMatrixPrinting.default_print_speed) 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
    #print the forarm up to the elbow bend
    e3DMatrixPrinting.move_y(upperarm_length, theta)
    
    theta+=elbow_angle # make a turn at the elbow
    
    #print the forarm after the elbow bend to the first pad
    e3DMatrixPrinting.move_y(forarm_preActuator_length, theta)
    
    # block below added on 2015.04.03
    if num_pads == 1:
        sign = (-1 if theta<0 else 1)
        theta = sign * 120
        print "theta_new"
        print theta
        e3DMatrixPrinting.move_y(1, theta) 
    
    #print actuator pad 1
    print_actuator_pad()
    
    if num_pads == 2:
        #print connection stem to actuator second actuator pad
        e3DPGlobals.g.feed(e3DMatrixPrinting.default_print_speed*3) # *3 added on D-52
        e3DPGlobals.g.feed(e3DMatrixPrinting.default_print_speed/2) # *3 added on D-52
        e3DPGlobals.g.feed(e3DMatrixPrinting.default_print_speed) 
        e3DMatrixPrinting.move_y(forarm_postActuator_length, theta)
    
        #print actuator pad 2
        print_actuator_pad()
    
    #added 20150327: print short stem to vent
    e3DMatrixPrinting.move_y(vent_stem_length, theta)
    e3DPGlobals.g.dwell(vent_spot_dwell)
    #added 20150501, Experiment D-104 to avoid blobs at end of actuator
    e3DMatrixPrinting.turn_pressure_off(com_port = 1, start_stop_dwell_time = 0)
    e3DMatrixPrinting.move_y(2, theta)
       
    e3DPGlobals.g.absolute()                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
    e3DMatrixPrinting.travel_mode()
    e3DPGlobals.g.write("\n; Done with Actuator.\n\n")
Exemplo n.º 19
0
def print_actuator(upperarm_length=11,
                   forarm_preActuator_length=1,
                   elbow_angle=0,
                   forarm_postActuator_length=4,
                   theta=0,
                   num_pads=2):
    """Prints a soft actuator with the stem starting in the current position and rotated by theta. Assume nozzle is already at the correct height and already in print mode. (Continuation feature)
    
    Basic actuator geometry is
    
    y
    ^
    |
    +-->x
    
    []  second pad
    |   forarm_length
    []  first pad
    |   forarm_preActuator_length
    .   elbow (with optional bend angle of the forarm)
    |   upperarm_length
    x   start point

    """

    # pad parameters
    pad_length = 2.6  # length in Y
    pad_width = 2.6  # width in x
    n_meanders = 8
    pad_print_speed = 4.5
    pad_print_speed = pad_print_speed * 0.75
    meander_separation_dist = pad_length / n_meanders
    vent_stem_length = 1.5  # added 20150327
    vent_spot_dwell = 0.5  # added 20150327

    def print_actuator_pad():
        """Helper funciton. Print one actuator pad here"""
        e3DPGlobals.g.write("\n; Print actuator pad.")
        e3DPGlobals.g.feed(pad_print_speed)
        e3DMatrixPrinting.move_x(
            -pad_width / 2, theta)  #move to the lower left corner of the pad
        for meander in range(n_meanders - 1):
            e3DMatrixPrinting.move_xy(
                x_distance=pad_width,
                y_distance=meander_separation_dist,
                theta=theta)  # horizontal across the whole pad
            e3DMatrixPrinting.move_x(-pad_width, theta)
        e3DMatrixPrinting.move_xy(x_distance=pad_width,
                                  y_distance=meander_separation_dist,
                                  theta=theta)
        e3DMatrixPrinting.move_x(
            -pad_width / 2, theta)  # move to the middle of the top of the pad

    e3DPGlobals.g.write("\n; PRINT ACTUATOR.")
    e3DPGlobals.g.relative()
    e3DPGlobals.g.feed(e3DMatrixPrinting.default_print_speed *
                       3)  # *3 added on D-52
    e3DPGlobals.g.feed(e3DMatrixPrinting.default_print_speed /
                       2)  # *3 added on D-52
    e3DPGlobals.g.feed(e3DMatrixPrinting.default_print_speed)

    #print the forarm up to the elbow bend
    e3DMatrixPrinting.move_y(upperarm_length, theta)

    theta += elbow_angle  # make a turn at the elbow

    #print the forarm after the elbow bend to the first pad
    e3DMatrixPrinting.move_y(forarm_preActuator_length, theta)

    # block below added on 2015.04.03
    if num_pads == 1:
        sign = (-1 if theta < 0 else 1)
        theta = sign * 120
        print "theta_new"
        print theta
        e3DMatrixPrinting.move_y(1, theta)

    #print actuator pad 1
    print_actuator_pad()

    if num_pads == 2:
        #print connection stem to actuator second actuator pad
        e3DPGlobals.g.feed(e3DMatrixPrinting.default_print_speed *
                           3)  # *3 added on D-52
        e3DPGlobals.g.feed(e3DMatrixPrinting.default_print_speed /
                           2)  # *3 added on D-52
        e3DPGlobals.g.feed(e3DMatrixPrinting.default_print_speed)
        e3DMatrixPrinting.move_y(forarm_postActuator_length, theta)

        #print actuator pad 2
        print_actuator_pad()

    #added 20150327: print short stem to vent
    e3DMatrixPrinting.move_y(vent_stem_length, theta)
    e3DPGlobals.g.dwell(vent_spot_dwell)
    #added 20150501, Experiment D-104 to avoid blobs at end of actuator
    e3DMatrixPrinting.turn_pressure_off(com_port=1, start_stop_dwell_time=0)
    e3DPGlobals.g.dwell(1)
    e3DMatrixPrinting.move_y(2, theta)

    e3DPGlobals.g.absolute()
    e3DMatrixPrinting.travel_mode()
    e3DPGlobals.g.write("\n; Done with Actuator.\n\n")