def check_move(self, move): end_pos = move.end_pos xy2 = end_pos[0]**2 + end_pos[1]**2 if xy2 <= self.limit_xy2 and not move.axes_d[2]: # Normal XY move return if self.need_home: raise homing.EndstopMoveError(end_pos, "Must home first") limit_xy2 = self.max_xy2 if end_pos[2] > self.limit_z: limit_xy2 = min(limit_xy2, (self.max_z - end_pos[2])**2) if xy2 > limit_xy2 or end_pos[2] < self.min_z or end_pos[ 2] > self.max_z: raise homing.EndstopMoveError(end_pos) if move.axes_d[2]: move.limit_speed(self.max_z_velocity, move.accel) limit_xy2 = -1. # Limit the speed/accel of this move if is is at the extreme # end of the build envelope extreme_xy2 = max(xy2, move.start_pos[0]**2 + move.start_pos[1]**2) if extreme_xy2 > self.slow_xy2: r = 0.5 if extreme_xy2 > self.very_slow_xy2: r = 0.25 max_velocity = self.max_velocity if move.axes_d[2]: max_velocity = self.max_z_velocity move.limit_speed(max_velocity * r, self.max_accel * r) limit_xy2 = -1. self.limit_xy2 = min(limit_xy2, self.slow_xy2)
def check_move(self, move): if move.axes_d[0]: t_pos = move.end_pos[0] if t_pos < self.limits[0][0] or t_pos > self.limits[0][1]: if self.limits[0][0] > self.limits[0][1]: raise homing.EndstopMoveError(move.end_pos, "Must home axis first") raise homing.EndstopMoveError(move.end_pos)
def _check_endstops(self, move): end_pos = move.end_pos for i in (0, 1, 2): if (move.axes_d[i] and (end_pos[i] < self.limits[i][0] or end_pos[i] > self.limits[i][1])): if self.limits[i][0] > self.limits[i][1]: raise homing.EndstopMoveError(end_pos, "Must home axis first") raise homing.EndstopMoveError(end_pos)
def check_move(self, move): end_pos = move.end_pos xy2 = end_pos[0]**2 + end_pos[1]**2 if xy2 > self.limit_xy2 or end_pos[2] < 0.: if self.limit_xy2 < 0.: raise homing.EndstopMoveError(end_pos, "Must home first") raise homing.EndstopMoveError(end_pos) if end_pos[2] > self.limit_z: if end_pos[2] > self.max_z or xy2 > (self.max_z - end_pos[2])**2: raise homing.EndstopMoveError(end_pos) if move.axes_d[2]: move.limit_speed(self.max_z_velocity, 9999999.9)
def check_move(self, move): move.extrude_r = move.axes_d[3] / move.move_d move.extrude_max_corner_v = 0. if not self.heater.can_extrude: raise homing.EndstopMoveError( move.end_pos, "Extrude below minimum temp") if not move.is_kinematic_move: # Extrude only move - limit accel and velocity if move.axes_d[3] > self.max_e_dist: raise homing.EndstopMoveError( move.end_pos, "Extrude only move too long") move.limit_speed(self.max_e_velocity, self.max_e_accel) elif move.extrude_r > self.max_extrude_ratio: logging.debug("%s vs %s" % (move.extrude_r, self.max_extrude_ratio)) raise homing.EndstopMoveError( move.end_pos, "Move exceeds maximum extrusion cross section")
def check_move(self, move): end_pos = move.end_pos xy2 = end_pos[0]**2 + end_pos[1]**2 if xy2 > self.limit_xy2: if self.limit_xy2 < 0.: raise homing.EndstopMoveError(end_pos, "Must home axis first") raise homing.EndstopMoveError(end_pos) if move.axes_d[2]: if end_pos[2] < self.limit_z[0] or end_pos[2] > self.limit_z[1]: if self.limit_z[0] > self.limit_z[1]: raise homing.EndstopMoveError(end_pos, "Must home axis first") raise homing.EndstopMoveError(end_pos) # Move with Z - update velocity and accel for slower Z axis z_ratio = move.move_d / abs(move.axes_d[2]) move.limit_speed(self.max_z_velocity * z_ratio, self.max_z_accel * z_ratio)
def check_move(self, move): move.extrude_r = move.axes_d[3] / move.move_d move.extrude_max_corner_v = 0. if not self.heater.can_extrude: raise homing.EndstopMoveError(move.end_pos, "Extrude below minimum temp") if not move.is_kinematic_move or move.extrude_r < 0.: # Extrude only move (or retraction move) - limit accel and velocity if abs(move.axes_d[3]) > self.max_e_dist: raise homing.EndstopMoveError(move.end_pos, "Extrude move too long") inv_extrude_r = 1. / abs(move.extrude_r) move.limit_speed(self.max_e_velocity * inv_extrude_r, self.max_e_accel * inv_extrude_r) elif (move.extrude_r > self.max_extrude_ratio and move.axes_d[3] > self.nozzle_diameter * self.max_extrude_ratio): logging.debug("Overextrude: %s vs %s" % (move.extrude_r, self.max_extrude_ratio)) raise homing.EndstopMoveError( move.end_pos, "Move exceeds maximum extrusion cross section")
def check_move(self, move): end_pos = move.end_pos end_xy2 = end_pos[0]**2 + end_pos[1]**2 if end_xy2 <= self.limit_xy2 and not move.axes_d[2]: # Normal XY move return if self.need_home: raise homing.EndstopMoveError(end_pos, "Must home first") end_z = end_pos[2] limit_xy2 = self.max_xy2 if end_z > self.limit_z: limit_xy2 = min(limit_xy2, (self.max_z - end_z)**2) if end_xy2 > limit_xy2 or end_z > self.max_z or end_z < self.min_z: # Move out of range - verify not a homing move if (end_pos[:2] != self.home_position[:2] or end_z < self.min_z or end_z > self.home_position[2]): raise homing.EndstopMoveError(end_pos) limit_xy2 = -1. if move.axes_d[2]: move.limit_speed(self.max_z_velocity, move.accel) limit_xy2 = -1. self.limit_xy2 = limit_xy2
def check_move(self, move): raise homing.EndstopMoveError( move.end_pos, "Extrude when no extruder present")