extruder: Create a new class and python file to track the printer extruder

Create a new python file (extruder.py) to control the extruder heater
and stepper motors.  This separates the extruder control logic from
the cartesian robot code - making it easier to customize both the
kinematic control of the robot as well as the extruder.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2016-07-10 12:23:35 -04:00
parent 4a527a46ce
commit af99ab1645
8 changed files with 88 additions and 27 deletions

View file

@ -6,14 +6,14 @@
import logging
import stepper, homing
StepList = (0, 1, 2, 3)
StepList = (0, 1, 2)
class CartKinematics:
def __init__(self, printer, config):
steppers = ['stepper_x', 'stepper_y', 'stepper_z', 'stepper_e']
steppers = ['stepper_x', 'stepper_y', 'stepper_z']
self.steppers = [stepper.PrinterStepper(printer, config.getsection(n))
for n in steppers]
self.stepper_pos = [0, 0, 0, 0]
self.stepper_pos = [0, 0, 0]
def build_config(self):
for stepper in self.steppers:
stepper.build_config()
@ -31,9 +31,6 @@ class CartKinematics:
accel_factor = min([self.steppers[i].max_accel / abs(axes_d[i])
for i in StepList if axes_d[i]])
return velocity_factor * move_d, accel_factor * move_d
def get_max_e_speed(self):
s = self.steppers[3]
return s.max_velocity, s.max_accel
def home(self, toolhead, axis):
# Each axis is homed independently and in order
homing_state = homing.Homing(toolhead, self.steppers) # XXX