Working version of multiple extruders (up to 3)

- The temperature control is pretty much complete
  (not sure what to do w/ autotemp though)
  Changed the pins assignment to clearly separate bed and extruder heaters
  and temp sensors, changed a bit how termistor tables are handled.
- The steppers control is rudimentary
  (only chanages what pins it uses depending on the active_extruder var,
   but that's enough for switching extruder in the start.gcode in the
   the profiles)
- Tested only w/ RAMPS 1.4
This commit is contained in:
Denis B
2011-12-05 23:33:33 -05:00
parent 12e8edcac3
commit 4fd75dc813
12 changed files with 703 additions and 548 deletions

View File

@@ -57,6 +57,8 @@ const prog_char echomagic[] PROGMEM ="echo:";
#define SERIAL_ECHOPAIR(name,value) {SERIAL_ECHOPGM(name);SERIAL_ECHO(value);}
// Macro for getting current active extruder
#define ACTIVE_EXTRUDER (active_extruder)
//things to write to serial from Programmemory. saves 400 to 2k of RAM.
#define SerialprintPGM(x) serialprintPGM(MYPGM(x))
@@ -100,14 +102,31 @@ void manage_inactivity(byte debug);
#define disable_z() ;
#endif
#if E_ENABLE_PIN > -1
#define enable_e() WRITE(E_ENABLE_PIN, E_ENABLE_ON)
#define disable_e() WRITE(E_ENABLE_PIN,!E_ENABLE_ON)
#if defined(E0_ENABLE_PIN) && (E0_ENABLE_PIN > -1)
#define enable_e0() WRITE(E0_ENABLE_PIN, E_ENABLE_ON)
#define disable_e0() WRITE(E0_ENABLE_PIN,!E_ENABLE_ON)
#else
#define enable_e() ;
#define disable_e() ;
#define enable_e0() /* nothing */
#define disable_e0() /* nothing */
#endif
#if (EXTRUDERS > 1) && defined(E1_ENABLE_PIN) && (E1_ENABLE_PIN > -1)
#define enable_e1() WRITE(E1_ENABLE_PIN, E_ENABLE_ON)
#define disable_e1() WRITE(E1_ENABLE_PIN,!E_ENABLE_ON)
#else
#define enable_e1() /* nothing */
#define disable_e1() /* nothing */
#endif
#if (EXTRUDERS > 2) && defined(E2_ENABLE_PIN) && (E2_ENABLE_PIN > -1)
#define enable_e2() WRITE(E2_ENABLE_PIN, E_ENABLE_ON)
#define disable_e2() WRITE(E2_ENABLE_PIN,!E_ENABLE_ON)
#else
#define enable_e2() /* nothing */
#define disable_e2() /* nothing */
#endif
enum AxisEnum {X_AXIS=0, Y_AXIS=1, Z_AXIS=2, E_AXIS=3};
@@ -131,4 +150,7 @@ extern bool axis_relative_modes[];
extern float current_position[NUM_AXIS] ;
extern float add_homeing[3];
// Handling multiple extruders pins
extern uint8_t active_extruder;
#endif