def interface_with_hole(Left, Front, to_cliff, Valve = False): if (Valve == 1): hole_pos = check_valve_left_hole_pos if Left else check_valve_right_hole_pos else: hole_pos = ((front_left_hole_pos if Left else front_right_hole_pos) if Front else (back_left_hole_pos if Left else back_right_hole_pos)) # The code below was commented out by RTruby on 2015.01.21; module_top_print_height should be module_hole_depth #print "\tInterfacing with hole at " + str(hole_pos) + " at depth " + str(module_top_print_height) + "." print "\tInterfacing with hole at " + str(hole_pos) + " at depth " + str(module_hole_depth) e3DPGlobals.g.abs_move(x=hole_pos[0], y=hole_pos[1]) # move above the hole e3DMatrixPrinting.print_mode(print_height_abs=module_hole_depth) # go in the hole, start extrusion e3DPGlobals.g.dwell(hole_flush_dwell_time) # Note by RTruby, 2015.01.21 - module_top_print_height was originally -1 # in the line below; THIS MUST CHANGE - figure out how to #if-else below added for D-90 if (Valve == 1): height_offset_between_lines_to_valves = 1.5 e3DMatrixPrinting.move_z_abs(height = module_top_print_height-height_offset_between_lines_to_valves, vertical_travel_speed = e3DMatrixPrinting.default_z_drag_speed) # drag up to top of hole else: e3DMatrixPrinting.move_z_abs(height = module_top_print_height, vertical_travel_speed = e3DMatrixPrinting.default_z_drag_speed) # drag up to top of hole if (to_cliff): e3DPGlobals.g.feed(e3DMatrixPrinting.default_print_speed) e3DPGlobals.g.abs_move(x= (-1 if Left else 1) * line_offset_x +centerline_x, y = (module_front_edge_y if Front else module_back_edge_y)) # move above the hole #else: #e3DMatrixPrinting.travel_mode()
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()
def print_triangular_meander(print_height, N, edge, angle): n = np.sqrt(N) m = n n = n - 1 pi = 3.141592653589793 angle_converted = pi*angle/180.0 h = edge*(np.sqrt(3.0)/2) e3DMatrixPrinting.print_mode(print_height_abs = print_height, print_speed = 1.5) e3DPGlobals.g.relative() def trace_inner_units(repeats): for repeat in range(int(repeats)): e3DMatrixPrinting.move_xy(x_distance = edge/2, y_distance = h, theta = angle_converted) 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)
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()
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()
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()
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)
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)
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()
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()
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()
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()
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()
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()
def print_triangular_meander(print_height, N, edge, angle): n = np.sqrt(N) m = n n = n - 1 pi = 3.141592653589793 angle_converted = pi * angle / 180.0 h = edge * (np.sqrt(3.0) / 2) e3DMatrixPrinting.print_mode(print_height_abs=print_height, print_speed=1.5) e3DPGlobals.g.relative() def trace_inner_units(repeats): for repeat in range(int(repeats)): e3DMatrixPrinting.move_xy(x_distance=edge / 2, y_distance=h, theta=angle_converted) 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)
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) 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.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[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) 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.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[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]) # arm_formarm_preActuator_length + 2 added 20150604 print_left_actuator(cur_arm_row, arm_forarm_preActuator_length + 2, 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]) # arm_formarm_preActuator_length + 2 added 20150604 print_right_actuator(cur_arm_row, arm_forarm_preActuator_length + 2, 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)
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()
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)
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!" )