Browse Source

Merge remote-tracking branch 'upstream/Marlin_v1' into delta-configuration

Conflicts:
	Marlin/Marlin_main.cpp
pull/1/head
Jim Morris 12 years ago
parent
commit
b9d7ccf1cd
  1. 1
      Marlin/Configuration.h
  2. 25
      Marlin/Configuration_adv.h
  3. 6
      Marlin/Marlin.h
  4. 111
      Marlin/Marlin_main.cpp
  5. 47
      Marlin/language.h
  6. 27
      Marlin/pins.h
  7. 44
      Marlin/stepper.cpp
  8. 9
      Marlin/ultralcd.cpp
  9. 2
      README.md

1
Marlin/Configuration.h

@ -28,6 +28,7 @@
// 3 = MEGA/RAMPS up to 1.2 = 3 // 3 = MEGA/RAMPS up to 1.2 = 3
// 33 = RAMPS 1.3 / 1.4 (Power outputs: Extruder, Fan, Bed) // 33 = RAMPS 1.3 / 1.4 (Power outputs: Extruder, Fan, Bed)
// 34 = RAMPS 1.3 / 1.4 (Power outputs: Extruder0, Extruder1, Bed) // 34 = RAMPS 1.3 / 1.4 (Power outputs: Extruder0, Extruder1, Bed)
// 35 = RAMPS 1.3 / 1.4 (Power outputs: Extruder, Fan, Fan)
// 4 = Duemilanove w/ ATMega328P pin assignment // 4 = Duemilanove w/ ATMega328P pin assignment
// 5 = Gen6 // 5 = Gen6
// 51 = Gen6 deluxe // 51 = Gen6 deluxe

25
Marlin/Configuration_adv.h

@ -146,6 +146,31 @@
#define EXTRUDERS 1 #define EXTRUDERS 1
#endif #endif
// Enable this for dual x-carriage printers.
// A dual x-carriage design has the advantage that the inactive extruder can be parked which
// prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
// allowing faster printing speeds.
//#define DUAL_X_CARRIAGE
#ifdef DUAL_X_CARRIAGE
// Configuration for second X-carriage
// Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop;
// the second x-carriage always homes to the maximum endstop.
#define X2_MIN_POS 88 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage
#define X2_MAX_POS 350.45 // set maximum to the distance between toolheads when both heads are homed
#define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position
#define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position
// However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software
// override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops
// without modifying the firmware (through the "M218 T1 X???" command).
// Remember: you should set the second extruder x-offset to 0 in your slicer.
// Pins for second x-carriage stepper driver (defined here to avoid further complicating pins.h)
#define X2_ENABLE_PIN 29
#define X2_STEP_PIN 25
#define X2_DIR_PIN 23
#endif // DUAL_X_CARRIAGE
//homing hits the endstop, then retracts by this distance, before it tries to slowly bump again: //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
#define X_HOME_RETRACT_MM 5 #define X_HOME_RETRACT_MM 5
#define Y_HOME_RETRACT_MM 5 #define Y_HOME_RETRACT_MM 5

6
Marlin/Marlin.h

@ -96,7 +96,11 @@ void process_commands();
void manage_inactivity(); void manage_inactivity();
#if defined(X_ENABLE_PIN) && X_ENABLE_PIN > -1 #if defined(DUAL_X_CARRIAGE) && defined(X_ENABLE_PIN) && X_ENABLE_PIN > -1 \
&& defined(X2_ENABLE_PIN) && X2_ENABLE_PIN > -1
#define enable_x() do { WRITE(X_ENABLE_PIN, X_ENABLE_ON); WRITE(X2_ENABLE_PIN, X_ENABLE_ON); } while (0)
#define disable_x() do { WRITE(X_ENABLE_PIN,!X_ENABLE_ON); WRITE(X2_ENABLE_PIN,!X_ENABLE_ON); } while (0)
#elif defined(X_ENABLE_PIN) && X_ENABLE_PIN > -1
#define enable_x() WRITE(X_ENABLE_PIN, X_ENABLE_ON) #define enable_x() WRITE(X_ENABLE_PIN, X_ENABLE_ON)
#define disable_x() WRITE(X_ENABLE_PIN,!X_ENABLE_ON) #define disable_x() WRITE(X_ENABLE_PIN,!X_ENABLE_ON)
#else #else

111
Marlin/Marlin_main.cpp

@ -194,6 +194,10 @@ int EtoPPressure=0;
float retract_recover_length=0, retract_recover_feedrate=8*60; float retract_recover_length=0, retract_recover_feedrate=8*60;
#endif #endif
#ifdef ULTIPANEL
bool powersupply = true;
#endif
//=========================================================================== //===========================================================================
//=============================private variables============================= //=============================private variables=============================
//=========================================================================== //===========================================================================
@ -677,7 +681,44 @@ XYZ_CONSTS_FROM_CONFIG(float, max_length, MAX_LENGTH);
XYZ_CONSTS_FROM_CONFIG(float, home_retract_mm, HOME_RETRACT_MM); XYZ_CONSTS_FROM_CONFIG(float, home_retract_mm, HOME_RETRACT_MM);
XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR); XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR);
#ifdef DUAL_X_CARRIAGE
#if EXTRUDERS == 1 || defined(COREXY) \
|| !defined(X2_ENABLE_PIN) || !defined(X2_STEP_PIN) || !defined(X2_DIR_PIN) \
|| !defined(X2_HOME_POS) || !defined(X2_MIN_POS) || !defined(X2_MAX_POS) \
|| !defined(X_MAX_PIN) || X_MAX_PIN < 0
#error "Missing or invalid definitions for DUAL_X_CARRIAGE mode."
#endif
#if X_HOME_DIR != -1 || X2_HOME_DIR != 1
#error "Please use canonical x-carriage assignment" // the x-carriages are defined by their homing directions
#endif
static float x_home_pos(int extruder) {
if (extruder == 0)
return base_home_pos(X_AXIS) + add_homeing[X_AXIS];
else
// In dual carriage mode the extruder offset provides an override of the
// second X-carriage offset when homed - otherwise X2_HOME_POS is used.
// This allow soft recalibration of the second extruder offset position without firmware reflash
// (through the M218 command).
return (extruder_offset[X_AXIS][1] > 0) ? extruder_offset[X_AXIS][1] : X2_HOME_POS;
}
static int x_home_dir(int extruder) {
return (extruder == 0) ? X_HOME_DIR : X2_HOME_DIR;
}
static float inactive_x_carriage_pos = X2_MAX_POS;
#endif
static void axis_is_at_home(int axis) { static void axis_is_at_home(int axis) {
#ifdef DUAL_X_CARRIAGE
if (axis == X_AXIS && active_extruder != 0) {
current_position[X_AXIS] = x_home_pos(active_extruder);
min_pos[X_AXIS] = X2_MIN_POS;
max_pos[X_AXIS] = max(extruder_offset[X_AXIS][1], X2_MAX_POS);
return;
}
#endif
current_position[axis] = base_home_pos(axis) + add_homeing[axis]; current_position[axis] = base_home_pos(axis) + add_homeing[axis];
min_pos[axis] = base_min_pos(axis) + add_homeing[axis]; min_pos[axis] = base_min_pos(axis) + add_homeing[axis];
max_pos[axis] = base_max_pos(axis) + add_homeing[axis]; max_pos[axis] = base_max_pos(axis) + add_homeing[axis];
@ -686,10 +727,16 @@ static void axis_is_at_home(int axis) {
static void homeaxis(int axis) { static void homeaxis(int axis) {
#define HOMEAXIS_DO(LETTER) \ #define HOMEAXIS_DO(LETTER) \
((LETTER##_MIN_PIN > -1 && LETTER##_HOME_DIR==-1) || (LETTER##_MAX_PIN > -1 && LETTER##_HOME_DIR==1)) ((LETTER##_MIN_PIN > -1 && LETTER##_HOME_DIR==-1) || (LETTER##_MAX_PIN > -1 && LETTER##_HOME_DIR==1))
if (axis==X_AXIS ? HOMEAXIS_DO(X) : if (axis==X_AXIS ? HOMEAXIS_DO(X) :
axis==Y_AXIS ? HOMEAXIS_DO(Y) : axis==Y_AXIS ? HOMEAXIS_DO(Y) :
axis==Z_AXIS ? HOMEAXIS_DO(Z) : axis==Z_AXIS ? HOMEAXIS_DO(Z) :
0) { 0) {
int axis_home_dir = home_dir(axis);
#ifdef DUAL_X_CARRIAGE
if (axis == X_AXIS)
axis_home_dir = x_home_dir(active_extruder);
#endif
// Engage Servo endstop if enabled // Engage Servo endstop if enabled
#ifdef SERVO_ENDSTOPS #ifdef SERVO_ENDSTOPS
@ -700,18 +747,18 @@ static void homeaxis(int axis) {
current_position[axis] = 0; current_position[axis] = 0;
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
destination[axis] = 1.5 * max_length(axis) * home_dir(axis); destination[axis] = 1.5 * max_length(axis) * axis_home_dir;
feedrate = homing_feedrate[axis]; feedrate = homing_feedrate[axis];
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
st_synchronize(); st_synchronize();
current_position[axis] = 0; current_position[axis] = 0;
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
destination[axis] = -home_retract_mm(axis) * home_dir(axis); destination[axis] = -home_retract_mm(axis) * axis_home_dir;
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder); plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
st_synchronize(); st_synchronize();
destination[axis] = 2*home_retract_mm(axis) * home_dir(axis); destination[axis] = 2*home_retract_mm(axis) * axis_home_dir;
#ifdef DELTA #ifdef DELTA
feedrate = homing_feedrate[axis]/10; feedrate = homing_feedrate[axis]/10;
#else #else
@ -868,8 +915,14 @@ void process_commands()
{ {
current_position[X_AXIS] = 0;current_position[Y_AXIS] = 0; current_position[X_AXIS] = 0;current_position[Y_AXIS] = 0;
#ifndef DUAL_X_CARRIAGE
int x_axis_home_dir = home_dir(X_AXIS);
#else
int x_axis_home_dir = x_home_dir(active_extruder);
#endif
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
destination[X_AXIS] = 1.5 * X_MAX_LENGTH * X_HOME_DIR;destination[Y_AXIS] = 1.5 * Y_MAX_LENGTH * Y_HOME_DIR; destination[X_AXIS] = 1.5 * max_length(X_AXIS) * x_axis_home_dir;destination[Y_AXIS] = 1.5 * max_length(Y_AXIS) * home_dir(Y_AXIS);
feedrate = homing_feedrate[X_AXIS]; feedrate = homing_feedrate[X_AXIS];
if(homing_feedrate[Y_AXIS]<feedrate) if(homing_feedrate[Y_AXIS]<feedrate)
feedrate =homing_feedrate[Y_AXIS]; feedrate =homing_feedrate[Y_AXIS];
@ -894,6 +947,13 @@ void process_commands()
if((home_all_axis) || (code_seen(axis_codes[X_AXIS]))) if((home_all_axis) || (code_seen(axis_codes[X_AXIS])))
{ {
#ifdef DUAL_X_CARRIAGE
int tmp_extruder = active_extruder;
active_extruder = !active_extruder;
HOMEAXIS(X);
inactive_x_carriage_pos = current_position[X_AXIS];
active_extruder = tmp_extruder;
#endif
HOMEAXIS(X); HOMEAXIS(X);
} }
@ -926,7 +986,7 @@ void process_commands()
} }
} }
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
#endif // DELTA #endif // else DELTA
#ifdef ENDSTOPS_ONLY_FOR_HOMING #ifdef ENDSTOPS_ONLY_FOR_HOMING
enable_endstops(false); enable_endstops(false);
@ -1338,20 +1398,37 @@ void process_commands()
#endif #endif
#if defined(PS_ON_PIN) && PS_ON_PIN > -1 #if defined(PS_ON_PIN) && PS_ON_PIN > -1
case 80: // M80 - ATX Power On case 80: // M80 - Turn on Power Supply
SET_OUTPUT(PS_ON_PIN); //GND SET_OUTPUT(PS_ON_PIN); //GND
WRITE(PS_ON_PIN, PS_ON_AWAKE); WRITE(PS_ON_PIN, PS_ON_AWAKE);
#ifdef ULTIPANEL
powersupply = true;
LCD_MESSAGEPGM(WELCOME_MSG);
lcd_update();
#endif
break; break;
#endif #endif
case 81: // M81 - ATX Power Off case 81: // M81 - Turn off Power Supply
disable_heater();
st_synchronize();
disable_e0();
disable_e1();
disable_e2();
finishAndDisableSteppers();
fanSpeed = 0;
delay(1000); // Wait a little before to switch off
#if defined(SUICIDE_PIN) && SUICIDE_PIN > -1 #if defined(SUICIDE_PIN) && SUICIDE_PIN > -1
st_synchronize(); st_synchronize();
suicide(); suicide();
#elif defined(PS_ON_PIN) && PS_ON_PIN > -1 #elif defined(PS_ON_PIN) && PS_ON_PIN > -1
SET_OUTPUT(PS_ON_PIN); SET_OUTPUT(PS_ON_PIN);
WRITE(PS_ON_PIN, PS_ON_ASLEEP); WRITE(PS_ON_PIN, PS_ON_ASLEEP);
#endif
#ifdef ULTIPANEL
powersupply = false;
LCD_MESSAGEPGM(MACHINE_NAME" "MSG_OFF".");
lcd_update();
#endif #endif
break; break;
@ -2005,6 +2082,20 @@ void process_commands()
if(tmp_extruder != active_extruder) { if(tmp_extruder != active_extruder) {
// Save current position to return to after applying extruder offset // Save current position to return to after applying extruder offset
memcpy(destination, current_position, sizeof(destination)); memcpy(destination, current_position, sizeof(destination));
#ifdef DUAL_X_CARRIAGE
// only apply Y extruder offset in dual x carriage mode (x offset is already used in determining home pos)
current_position[Y_AXIS] = current_position[Y_AXIS] -
extruder_offset[Y_AXIS][active_extruder] +
extruder_offset[Y_AXIS][tmp_extruder];
float tmp_x_pos = current_position[X_AXIS];
// Set the new active extruder and position
active_extruder = tmp_extruder;
axis_is_at_home(X_AXIS); //this function updates X min/max values.
current_position[X_AXIS] = inactive_x_carriage_pos;
inactive_x_carriage_pos = tmp_x_pos;
#else
// Offset extruder (only by XY) // Offset extruder (only by XY)
int i; int i;
for(i = 0; i < 2; i++) { for(i = 0; i < 2; i++) {
@ -2014,6 +2105,7 @@ void process_commands()
} }
// Set the new active extruder and position // Set the new active extruder and position
active_extruder = tmp_extruder; active_extruder = tmp_extruder;
#endif //else DUAL_X_CARRIAGE
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
// Move to the old position if 'F' was in the parameters // Move to the old position if 'F' was in the parameters
if(make_move && Stopped == false) { if(make_move && Stopped == false) {
@ -2258,6 +2350,9 @@ void controllerFan()
|| !READ(E2_ENABLE_PIN) || !READ(E2_ENABLE_PIN)
#endif #endif
#if EXTRUDER > 1 #if EXTRUDER > 1
#if defined(X2_ENABLE_PIN) && X2_ENABLE_PIN > -1
|| !READ(X2_ENABLE_PIN)
#endif
|| !READ(E1_ENABLE_PIN) || !READ(E1_ENABLE_PIN)
#endif #endif
|| !READ(E0_ENABLE_PIN)) //If any of the drivers are enabled... || !READ(E0_ENABLE_PIN)) //If any of the drivers are enabled...

47
Marlin/language.h

@ -60,6 +60,8 @@
#define MSG_PREHEAT_ABS "Preheat ABS" #define MSG_PREHEAT_ABS "Preheat ABS"
#define MSG_PREHEAT_ABS_SETTINGS "Preheat ABS Conf" #define MSG_PREHEAT_ABS_SETTINGS "Preheat ABS Conf"
#define MSG_COOLDOWN "Cooldown" #define MSG_COOLDOWN "Cooldown"
#define MSG_SWITCH_PS_ON "Switch Power On"
#define MSG_SWITCH_PS_OFF "Switch Power Off"
#define MSG_EXTRUDE "Extrude" #define MSG_EXTRUDE "Extrude"
#define MSG_RETRACT "Retract" #define MSG_RETRACT "Retract"
#define MSG_MOVE_AXIS "Move Axis" #define MSG_MOVE_AXIS "Move Axis"
@ -220,6 +222,8 @@
#define MSG_PREHEAT_ABS "Rozgrzej ABS" #define MSG_PREHEAT_ABS "Rozgrzej ABS"
#define MSG_PREHEAT_ABS_SETTINGS "Ustawienia roz. ABS" #define MSG_PREHEAT_ABS_SETTINGS "Ustawienia roz. ABS"
#define MSG_COOLDOWN "Chlodzenie" #define MSG_COOLDOWN "Chlodzenie"
#define MSG_SWITCH_PS_ON "Switch Power On"
#define MSG_SWITCH_PS_OFF "Switch Power Off"
#define MSG_EXTRUDE "Ekstruzja" #define MSG_EXTRUDE "Ekstruzja"
#define MSG_RETRACT "Cofanie" #define MSG_RETRACT "Cofanie"
#define MSG_MOVE_AXIS "Ruch osi" #define MSG_MOVE_AXIS "Ruch osi"
@ -290,6 +294,8 @@
#define MSG_CONTROL_RETRACT_RECOVERF "Cof. wycof. F" #define MSG_CONTROL_RETRACT_RECOVERF "Cof. wycof. F"
#define MSG_AUTORETRACT "Auto. wycofanie" #define MSG_AUTORETRACT "Auto. wycofanie"
#define MSG_FILAMENTCHANGE "Change filament" #define MSG_FILAMENTCHANGE "Change filament"
#define MSG_INIT_SDCARD "Init. SD-Card"
#define MSG_CNG_SDCARD "Change SD-Card"
// Serial Console Messages // Serial Console Messages
@ -380,6 +386,8 @@
#define MSG_PREHEAT_ABS " Prechauffage ABS" #define MSG_PREHEAT_ABS " Prechauffage ABS"
#define MSG_PREHEAT_ABS_SETTINGS " Regl. prechauffe ABS" #define MSG_PREHEAT_ABS_SETTINGS " Regl. prechauffe ABS"
#define MSG_COOLDOWN " Refroidissement" #define MSG_COOLDOWN " Refroidissement"
#define MSG_SWITCH_PS_ON "Allumer alimentation"
#define MSG_SWITCH_PS_OFF "Eteindre alimentation"
#define MSG_EXTRUDE " Extrusion" #define MSG_EXTRUDE " Extrusion"
#define MSG_RETRACT " Retractation" #define MSG_RETRACT " Retractation"
#define MSG_PREHEAT_PLA " Prechauffage PLA" #define MSG_PREHEAT_PLA " Prechauffage PLA"
@ -421,10 +429,9 @@
#define MSG_ZSTEPS " Zpas/mm:" #define MSG_ZSTEPS " Zpas/mm:"
#define MSG_ESTEPS " Epas/mm:" #define MSG_ESTEPS " Epas/mm:"
#define MSG_MAIN_WIDE " Principal \003" #define MSG_MAIN_WIDE " Principal \003"
#define MSG_RECTRACT_WIDE " Rectractater \x7E" #define MSG_RECTRACT "Rectracter"
#define MSG_TEMPERATURE_WIDE " Temperature \x7E" #define MSG_TEMPERATURE "Temperature"
#define MSG_TEMPERATURE_RTN " Temperature \003" #define MSG_MOTION "Mouvement"
#define MSG_MOTION_WIDE " Mouvement \x7E"
#define MSG_CONTRAST "LCD contrast" #define MSG_CONTRAST "LCD contrast"
#define MSG_STORE_EPROM " Sauvegarder memoire" #define MSG_STORE_EPROM " Sauvegarder memoire"
#define MSG_LOAD_EPROM " Lire memoire" #define MSG_LOAD_EPROM " Lire memoire"
@ -443,6 +450,7 @@
#define MSG_NO_CARD " Pas de carte" #define MSG_NO_CARD " Pas de carte"
#define MSG_DWELL "Repos..." #define MSG_DWELL "Repos..."
#define MSG_USERWAIT "Attente de l'utilisateur..." #define MSG_USERWAIT "Attente de l'utilisateur..."
#define MSG_RESUMING "Reprise de l'impression"
#define MSG_NO_MOVE "Aucun mouvement." #define MSG_NO_MOVE "Aucun mouvement."
#define MSG_PART_RELEASE "Relache partielle" #define MSG_PART_RELEASE "Relache partielle"
#define MSG_KILLED "TUE." #define MSG_KILLED "TUE."
@ -455,6 +463,8 @@
#define MSG_CONTROL_RETRACT_RECOVERF " UnRet F:" #define MSG_CONTROL_RETRACT_RECOVERF " UnRet F:"
#define MSG_AUTORETRACT " Retract. Auto.:" #define MSG_AUTORETRACT " Retract. Auto.:"
#define MSG_FILAMENTCHANGE "Change filament" #define MSG_FILAMENTCHANGE "Change filament"
#define MSG_INIT_SDCARD "Init. la carte SD"
#define MSG_CNG_SDCARD "Changer de carte SD"
// Serial Console Messages // Serial Console Messages
@ -548,6 +558,8 @@
#define MSG_PREHEAT_ABS "Vorwärmen ABS" #define MSG_PREHEAT_ABS "Vorwärmen ABS"
#define MSG_PREHEAT_ABS_SETTINGS "Vorwärmen ABS Einstellungen" #define MSG_PREHEAT_ABS_SETTINGS "Vorwärmen ABS Einstellungen"
#define MSG_COOLDOWN "Abkühlen" #define MSG_COOLDOWN "Abkühlen"
#define MSG_SWITCH_PS_ON "Switch Power On"
#define MSG_SWITCH_PS_OFF "Switch Power Off"
#define MSG_EXTRUDE "Extrude" #define MSG_EXTRUDE "Extrude"
#define MSG_RETRACT "Retract" #define MSG_RETRACT "Retract"
#define MSG_MOVE_AXIS "Achsen bewegen" #define MSG_MOVE_AXIS "Achsen bewegen"
@ -618,6 +630,8 @@
#define MSG_CONTROL_RETRACT_RECOVERF "UnRet F" #define MSG_CONTROL_RETRACT_RECOVERF "UnRet F"
#define MSG_AUTORETRACT "AutoRetr." #define MSG_AUTORETRACT "AutoRetr."
#define MSG_FILAMENTCHANGE "Filament wechseln" #define MSG_FILAMENTCHANGE "Filament wechseln"
#define MSG_INIT_SDCARD "Init. SD-Card"
#define MSG_CNG_SDCARD "Change SD-Card"
// Serial Console Messages // Serial Console Messages
@ -709,6 +723,8 @@
#define MSG_PREHEAT_ABS "Precalentar ABS" #define MSG_PREHEAT_ABS "Precalentar ABS"
#define MSG_PREHEAT_ABS_SETTINGS "Ajustar temp. ABS" #define MSG_PREHEAT_ABS_SETTINGS "Ajustar temp. ABS"
#define MSG_COOLDOWN "Enfriar" #define MSG_COOLDOWN "Enfriar"
#define MSG_SWITCH_PS_ON "Switch Power On"
#define MSG_SWITCH_PS_OFF "Switch Power Off"
#define MSG_EXTRUDE "Extruir" #define MSG_EXTRUDE "Extruir"
#define MSG_RETRACT "Retraer" #define MSG_RETRACT "Retraer"
#define MSG_MOVE_AXIS "Mover Ejes" #define MSG_MOVE_AXIS "Mover Ejes"
@ -876,6 +892,8 @@
#define MSG_PREHEAT_ABS " Преднагрев ABS " #define MSG_PREHEAT_ABS " Преднагрев ABS "
#define MSG_PREHEAT_ABS_SETTINGS " Настр. преднагр.ABS" #define MSG_PREHEAT_ABS_SETTINGS " Настр. преднагр.ABS"
#define MSG_COOLDOWN " Охлаждение " #define MSG_COOLDOWN " Охлаждение "
#define MSG_SWITCH_PS_ON "Switch Power On"
#define MSG_SWITCH_PS_OFF "Switch Power Off"
#define MSG_EXTRUDE " Экструзия " #define MSG_EXTRUDE " Экструзия "
#define MSG_RETRACT " Откат" #define MSG_RETRACT " Откат"
#define MSG_MOVE_AXIS " Движение по осям \x7E" #define MSG_MOVE_AXIS " Движение по осям \x7E"
@ -932,6 +950,7 @@
#define MSG_NO_CARD " Нет карты" #define MSG_NO_CARD " Нет карты"
#define MSG_DWELL "Сон..." #define MSG_DWELL "Сон..."
#define MSG_USERWAIT "Нажмите для продолж." #define MSG_USERWAIT "Нажмите для продолж."
#define MSG_RESUMING "Resuming print"
#define MSG_NO_MOVE "Нет движения. " #define MSG_NO_MOVE "Нет движения. "
#define MSG_PART_RELEASE " Извлечение принта " #define MSG_PART_RELEASE " Извлечение принта "
#define MSG_KILLED "УБИТО. " #define MSG_KILLED "УБИТО. "
@ -943,6 +962,8 @@
#define MSG_CONTROL_RETRACT_RECOVERF " Возврат F:" #define MSG_CONTROL_RETRACT_RECOVERF " Возврат F:"
#define MSG_AUTORETRACT " АвтоОткат:" #define MSG_AUTORETRACT " АвтоОткат:"
#define MSG_FILAMENTCHANGE "Change filament" #define MSG_FILAMENTCHANGE "Change filament"
#define MSG_INIT_SDCARD "Init. SD-Card"
#define MSG_CNG_SDCARD "Change SD-Card"
// Serial Console Messages // Serial Console Messages
@ -1032,6 +1053,8 @@
#define MSG_PREHEAT_ABS "Preriscalda ABS" #define MSG_PREHEAT_ABS "Preriscalda ABS"
#define MSG_PREHEAT_ABS_SETTINGS "Preris. ABS Conf" #define MSG_PREHEAT_ABS_SETTINGS "Preris. ABS Conf"
#define MSG_COOLDOWN "Raffredda" #define MSG_COOLDOWN "Raffredda"
#define MSG_SWITCH_PS_ON "Switch Power On"
#define MSG_SWITCH_PS_OFF "Switch Power Off"
#define MSG_EXTRUDE "Estrudi" #define MSG_EXTRUDE "Estrudi"
#define MSG_RETRACT "Ritrai" #define MSG_RETRACT "Ritrai"
#define MSG_MOVE_AXIS "Muovi Asse" #define MSG_MOVE_AXIS "Muovi Asse"
@ -1193,6 +1216,8 @@
#define MSG_PREHEAT_ABS " pre-aquecer ABS" #define MSG_PREHEAT_ABS " pre-aquecer ABS"
#define MSG_PREHEAT_ABS_SETTINGS " pre-aquecer ABS Setting" #define MSG_PREHEAT_ABS_SETTINGS " pre-aquecer ABS Setting"
#define MSG_COOLDOWN " Esfriar" #define MSG_COOLDOWN " Esfriar"
#define MSG_SWITCH_PS_ON "Switch Power On"
#define MSG_SWITCH_PS_OFF "Switch Power Off"
#define MSG_EXTRUDE " Extrudar" #define MSG_EXTRUDE " Extrudar"
#define MSG_RETRACT " Retrair" #define MSG_RETRACT " Retrair"
#define MSG_PREHEAT_PLA " pre-aquecer PLA" #define MSG_PREHEAT_PLA " pre-aquecer PLA"
@ -1234,10 +1259,9 @@
#define MSG_ZSTEPS " Zpasso/mm:" #define MSG_ZSTEPS " Zpasso/mm:"
#define MSG_ESTEPS " Epasso/mm:" #define MSG_ESTEPS " Epasso/mm:"
#define MSG_MAIN_WIDE " Menu Principal \003" #define MSG_MAIN_WIDE " Menu Principal \003"
#define MSG_RECTRACT_WIDE " Retrair \x7E" #define MSG_RECTRACT "Retrair"
#define MSG_TEMPERATURE_WIDE " Temperatura \x7E" #define MSG_TEMPERATURE "Temperatura"
#define MSG_TEMPERATURE_RTN " Temperatura \003" #define MSG_MOTION "Movimento"
#define MSG_MOTION_WIDE " Movimento \x7E"
#define MSG_STORE_EPROM " Guardar memoria" #define MSG_STORE_EPROM " Guardar memoria"
#define MSG_LOAD_EPROM " Carregar memoria" #define MSG_LOAD_EPROM " Carregar memoria"
#define MSG_RESTORE_FAILSAFE " Rest. de emergencia" #define MSG_RESTORE_FAILSAFE " Rest. de emergencia"
@ -1255,6 +1279,7 @@
#define MSG_NO_CARD " Sem cartao SD" #define MSG_NO_CARD " Sem cartao SD"
#define MSG_DWELL "Repouso..." #define MSG_DWELL "Repouso..."
#define MSG_USERWAIT "Esperando Ordem..." #define MSG_USERWAIT "Esperando Ordem..."
#define MSG_RESUMING "Resuming print"
#define MSG_NO_MOVE "Sem movimento." #define MSG_NO_MOVE "Sem movimento."
#define MSG_PART_RELEASE "Lancamento Parcial" #define MSG_PART_RELEASE "Lancamento Parcial"
#define MSG_KILLED "PARADA DE EMERGENCIA. " #define MSG_KILLED "PARADA DE EMERGENCIA. "
@ -1268,6 +1293,8 @@
#define MSG_AUTORETRACT " AutoRetr.:" #define MSG_AUTORETRACT " AutoRetr.:"
#define MSG_SERIAL_ERROR_MENU_STRUCTURE "Algo esta errado na estrutura do Menu." #define MSG_SERIAL_ERROR_MENU_STRUCTURE "Algo esta errado na estrutura do Menu."
#define MSG_FILAMENTCHANGE "Change filament" #define MSG_FILAMENTCHANGE "Change filament"
#define MSG_INIT_SDCARD "Init. SD-Card"
#define MSG_CNG_SDCARD "Change SD-Card"
// Serial Console Messages // Serial Console Messages
@ -1363,6 +1390,8 @@
#define MSG_PREHEAT_ABS "Esilammita ABS" #define MSG_PREHEAT_ABS "Esilammita ABS"
#define MSG_PREHEAT_ABS_SETTINGS "Esilammita ABS konf" #define MSG_PREHEAT_ABS_SETTINGS "Esilammita ABS konf"
#define MSG_COOLDOWN "Jaahdyta" #define MSG_COOLDOWN "Jaahdyta"
#define MSG_SWITCH_PS_ON "Switch Power On"
#define MSG_SWITCH_PS_OFF "Switch Power Off"
#define MSG_EXTRUDE "Pursota" #define MSG_EXTRUDE "Pursota"
#define MSG_RETRACT "Veda takaisin" #define MSG_RETRACT "Veda takaisin"
#define MSG_MOVE_AXIS "Liikuta akseleita" #define MSG_MOVE_AXIS "Liikuta akseleita"
@ -1430,6 +1459,8 @@
#define MSG_CONTROL_RETRACT_RECOVERF "UnRet F" #define MSG_CONTROL_RETRACT_RECOVERF "UnRet F"
#define MSG_AUTORETRACT "AutoVeto." #define MSG_AUTORETRACT "AutoVeto."
#define MSG_FILAMENTCHANGE "Change filament" #define MSG_FILAMENTCHANGE "Change filament"
#define MSG_INIT_SDCARD "Init. SD-Card"
#define MSG_CNG_SDCARD "Change SD-Card"
// Serial Console Messages // Serial Console Messages

27
Marlin/pins.h

@ -298,7 +298,7 @@
* Arduino Mega pin assignment * Arduino Mega pin assignment
* *
****************************************************************************************/ ****************************************************************************************/
#if MOTHERBOARD == 3 || MOTHERBOARD == 33 || MOTHERBOARD == 34 || MOTHERBOARD == 77 #if MOTHERBOARD == 3 || MOTHERBOARD == 33 || MOTHERBOARD == 34 || MOTHERBOARD == 35 || MOTHERBOARD == 77
#define KNOWN_BOARD 1 #define KNOWN_BOARD 1
//////////////////FIX THIS////////////// //////////////////FIX THIS//////////////
@ -314,7 +314,7 @@
// #define RAMPS_V_1_0 // #define RAMPS_V_1_0
#if MOTHERBOARD == 33 || MOTHERBOARD == 34 || MOTHERBOARD == 77 #if MOTHERBOARD == 33 || MOTHERBOARD == 34 || MOTHERBOARD == 35 || MOTHERBOARD == 77
#define LARGE_FLASH true #define LARGE_FLASH true
@ -392,7 +392,7 @@
#define LED_PIN 13 #define LED_PIN 13
#endif #endif
#if MOTHERBOARD == 33 #if MOTHERBOARD == 33 || MOTHERBOARD == 35
#define FAN_PIN 9 // (Sprinter config) #define FAN_PIN 9 // (Sprinter config)
#else #else
#define FAN_PIN 4 // IO pin. Buffer needed #define FAN_PIN 4 // IO pin. Buffer needed
@ -402,6 +402,10 @@
#define FAN_PIN 8 #define FAN_PIN 8
#endif #endif
#if MOTHERBOARD == 35
#define CONTROLLERFAN_PIN 10 //Pin used for the fan to cool controller
#endif
#define PS_ON_PIN 12 #define PS_ON_PIN 12
#if defined(REPRAP_DISCOUNT_SMART_CONTROLLER) || defined(G3D_PANEL) #if defined(REPRAP_DISCOUNT_SMART_CONTROLLER) || defined(G3D_PANEL)
@ -410,12 +414,18 @@
#define KILL_PIN -1 #define KILL_PIN -1
#endif #endif
#if MOTHERBOARD == 35
#define HEATER_0_PIN 8
#else
#define HEATER_0_PIN 10 // EXTRUDER 1 #define HEATER_0_PIN 10 // EXTRUDER 1
#endif
#if MOTHERBOARD == 33 #if MOTHERBOARD == 33
#define HEATER_1_PIN -1 #define HEATER_1_PIN -1
#else #else
#define HEATER_1_PIN 9 // EXTRUDER 2 (FAN On Sprinter) #define HEATER_1_PIN 9 // EXTRUDER 2 (FAN On Sprinter)
#endif #endif
#define HEATER_2_PIN -1 #define HEATER_2_PIN -1
#if MOTHERBOARD == 77 #if MOTHERBOARD == 77
@ -427,11 +437,16 @@
#define TEMP_0_PIN 13 // ANALOG NUMBERING #define TEMP_0_PIN 13 // ANALOG NUMBERING
#define TEMP_1_PIN 15 // ANALOG NUMBERING #define TEMP_1_PIN 15 // ANALOG NUMBERING
#define TEMP_2_PIN -1 // ANALOG NUMBERING #define TEMP_2_PIN -1 // ANALOG NUMBERING
#if MOTHERBOARD == 35
#define HEATER_BED_PIN -1 // NO BED
#else
#if MOTHERBOARD == 77 #if MOTHERBOARD == 77
#define HEATER_BED_PIN 9 // BED #define HEATER_BED_PIN 9 // BED
#else #else
#define HEATER_BED_PIN 8 // BED #define HEATER_BED_PIN 8 // BED
#endif #endif
#endif
#define TEMP_BED_PIN 14 // ANALOG NUMBERING #define TEMP_BED_PIN 14 // ANALOG NUMBERING
@ -578,7 +593,7 @@
#define TEMP_2_PIN -1 #define TEMP_2_PIN -1
#define TEMP_BED_PIN 1 // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!! #define TEMP_BED_PIN 1 // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
#endif // MOTHERBOARD == 33 || MOTHERBOARD == 34 || MOTHERBOARD == 77 #endif // MOTHERBOARD == 33 || MOTHERBOARD == 34 || MOTHERBOARD == 35 || MOTHERBOARD == 77
// SPI for Max6675 Thermocouple // SPI for Max6675 Thermocouple
@ -592,9 +607,7 @@
#define MAX6675_SS 49 #define MAX6675_SS 49
#endif #endif
#endif //MOTHERBOARD == 3 || MOTHERBOARD == 33 || MOTHERBOARD == 34 || MOTHERBOARD == 77 #endif //MOTHERBOARD == 3 || MOTHERBOARD == 33 || MOTHERBOARD == 34 || MOTHERBOARD == 35 || MOTHERBOARD == 77
/**************************************************************************************** /****************************************************************************************
* Duemilanove w/ ATMega328P pin assignment * Duemilanove w/ ATMega328P pin assignment

44
Marlin/stepper.cpp

@ -348,10 +348,20 @@ ISR(TIMER1_COMPA_vect)
// Set the direction bits (X_AXIS=A_AXIS and Y_AXIS=B_AXIS for COREXY) // Set the direction bits (X_AXIS=A_AXIS and Y_AXIS=B_AXIS for COREXY)
if((out_bits & (1<<X_AXIS))!=0){ if((out_bits & (1<<X_AXIS))!=0){
#ifdef DUAL_X_CARRIAGE
if (active_extruder != 0)
WRITE(X2_DIR_PIN,INVERT_X_DIR);
else
#endif
WRITE(X_DIR_PIN, INVERT_X_DIR); WRITE(X_DIR_PIN, INVERT_X_DIR);
count_direction[X_AXIS]=-1; count_direction[X_AXIS]=-1;
} }
else{ else{
#ifdef DUAL_X_CARRIAGE
if (active_extruder != 0)
WRITE(X2_DIR_PIN,!INVERT_X_DIR);
else
#endif
WRITE(X_DIR_PIN, !INVERT_X_DIR); WRITE(X_DIR_PIN, !INVERT_X_DIR);
count_direction[X_AXIS]=1; count_direction[X_AXIS]=1;
} }
@ -371,6 +381,11 @@ ISR(TIMER1_COMPA_vect)
if ((((out_bits & (1<<X_AXIS)) != 0)&&(out_bits & (1<<Y_AXIS)) != 0)) { //-X occurs for -A and -B if ((((out_bits & (1<<X_AXIS)) != 0)&&(out_bits & (1<<Y_AXIS)) != 0)) { //-X occurs for -A and -B
#endif #endif
CHECK_ENDSTOPS CHECK_ENDSTOPS
{
#ifdef DUAL_X_CARRIAGE
// with 2 x-carriages, endstops are only checked in the homing direction for the active extruder
if ((active_extruder == 0 && X_HOME_DIR == -1) || (active_extruder != 0 && X2_HOME_DIR == -1))
#endif
{ {
#if defined(X_MIN_PIN) && X_MIN_PIN > -1 #if defined(X_MIN_PIN) && X_MIN_PIN > -1
bool x_min_endstop=(READ(X_MIN_PIN) != X_ENDSTOPS_INVERTING); bool x_min_endstop=(READ(X_MIN_PIN) != X_ENDSTOPS_INVERTING);
@ -383,8 +398,14 @@ ISR(TIMER1_COMPA_vect)
#endif #endif
} }
} }
}
else { // +direction else { // +direction
CHECK_ENDSTOPS CHECK_ENDSTOPS
{
#ifdef DUAL_X_CARRIAGE
// with 2 x-carriages, endstops are only checked in the homing direction for the active extruder
if ((active_extruder == 0 && X_HOME_DIR == 1) || (active_extruder != 0 && X2_HOME_DIR == 1))
#endif
{ {
#if defined(X_MAX_PIN) && X_MAX_PIN > -1 #if defined(X_MAX_PIN) && X_MAX_PIN > -1
bool x_max_endstop=(READ(X_MAX_PIN) != X_ENDSTOPS_INVERTING); bool x_max_endstop=(READ(X_MAX_PIN) != X_ENDSTOPS_INVERTING);
@ -397,6 +418,7 @@ ISR(TIMER1_COMPA_vect)
#endif #endif
} }
} }
}
#ifndef COREXY #ifndef COREXY
if ((out_bits & (1<<Y_AXIS)) != 0) { // -direction if ((out_bits & (1<<Y_AXIS)) != 0) { // -direction
@ -507,9 +529,19 @@ ISR(TIMER1_COMPA_vect)
counter_x += current_block->steps_x; counter_x += current_block->steps_x;
if (counter_x > 0) { if (counter_x > 0) {
#ifdef DUAL_X_CARRIAGE
if (active_extruder != 0)
WRITE(X2_STEP_PIN,!INVERT_X_STEP_PIN);
else
#endif
WRITE(X_STEP_PIN, !INVERT_X_STEP_PIN); WRITE(X_STEP_PIN, !INVERT_X_STEP_PIN);
counter_x -= current_block->step_event_count; counter_x -= current_block->step_event_count;
count_position[X_AXIS]+=count_direction[X_AXIS]; count_position[X_AXIS]+=count_direction[X_AXIS];
#ifdef DUAL_X_CARRIAGE
if (active_extruder != 0)
WRITE(X2_STEP_PIN,INVERT_X_STEP_PIN);
else
#endif
WRITE(X_STEP_PIN, INVERT_X_STEP_PIN); WRITE(X_STEP_PIN, INVERT_X_STEP_PIN);
} }
@ -685,6 +717,9 @@ void st_init()
#if defined(X_DIR_PIN) && X_DIR_PIN > -1 #if defined(X_DIR_PIN) && X_DIR_PIN > -1
SET_OUTPUT(X_DIR_PIN); SET_OUTPUT(X_DIR_PIN);
#endif #endif
#if defined(X2_DIR_PIN) && X2_DIR_PIN > -1
SET_OUTPUT(X2_DIR_PIN);
#endif
#if defined(Y_DIR_PIN) && Y_DIR_PIN > -1 #if defined(Y_DIR_PIN) && Y_DIR_PIN > -1
SET_OUTPUT(Y_DIR_PIN); SET_OUTPUT(Y_DIR_PIN);
#endif #endif
@ -711,6 +746,10 @@ void st_init()
SET_OUTPUT(X_ENABLE_PIN); SET_OUTPUT(X_ENABLE_PIN);
if(!X_ENABLE_ON) WRITE(X_ENABLE_PIN,HIGH); if(!X_ENABLE_ON) WRITE(X_ENABLE_PIN,HIGH);
#endif #endif
#if defined(X2_ENABLE_PIN) && X2_ENABLE_PIN > -1
SET_OUTPUT(X2_ENABLE_PIN);
if(!X_ENABLE_ON) WRITE(X2_ENABLE_PIN,HIGH);
#endif
#if defined(Y_ENABLE_PIN) && Y_ENABLE_PIN > -1 #if defined(Y_ENABLE_PIN) && Y_ENABLE_PIN > -1
SET_OUTPUT(Y_ENABLE_PIN); SET_OUTPUT(Y_ENABLE_PIN);
if(!Y_ENABLE_ON) WRITE(Y_ENABLE_PIN,HIGH); if(!Y_ENABLE_ON) WRITE(Y_ENABLE_PIN,HIGH);
@ -788,6 +827,11 @@ void st_init()
WRITE(X_STEP_PIN,INVERT_X_STEP_PIN); WRITE(X_STEP_PIN,INVERT_X_STEP_PIN);
disable_x(); disable_x();
#endif #endif
#if defined(X2_STEP_PIN) && (X2_STEP_PIN > -1)
SET_OUTPUT(X2_STEP_PIN);
WRITE(X2_STEP_PIN,INVERT_X_STEP_PIN);
disable_x();
#endif
#if defined(Y_STEP_PIN) && (Y_STEP_PIN > -1) #if defined(Y_STEP_PIN) && (Y_STEP_PIN > -1)
SET_OUTPUT(Y_STEP_PIN); SET_OUTPUT(Y_STEP_PIN);
WRITE(Y_STEP_PIN,INVERT_Y_STEP_PIN); WRITE(Y_STEP_PIN,INVERT_Y_STEP_PIN);

9
Marlin/ultralcd.cpp

@ -40,6 +40,7 @@ void copy_and_scalePID_d();
/* Different menus */ /* Different menus */
static void lcd_status_screen(); static void lcd_status_screen();
#ifdef ULTIPANEL #ifdef ULTIPANEL
extern bool powersupply;
static void lcd_main_menu(); static void lcd_main_menu();
static void lcd_tune_menu(); static void lcd_tune_menu();
static void lcd_prepare_menu(); static void lcd_prepare_menu();
@ -348,6 +349,14 @@ static void lcd_prepare_menu()
MENU_ITEM(function, MSG_PREHEAT_PLA, lcd_preheat_pla); MENU_ITEM(function, MSG_PREHEAT_PLA, lcd_preheat_pla);
MENU_ITEM(function, MSG_PREHEAT_ABS, lcd_preheat_abs); MENU_ITEM(function, MSG_PREHEAT_ABS, lcd_preheat_abs);
MENU_ITEM(function, MSG_COOLDOWN, lcd_cooldown); MENU_ITEM(function, MSG_COOLDOWN, lcd_cooldown);
#if PS_ON_PIN > -1
if (powersupply)
{
MENU_ITEM(gcode, MSG_SWITCH_PS_OFF, PSTR("M81"));
}else{
MENU_ITEM(gcode, MSG_SWITCH_PS_ON, PSTR("M80"));
}
#endif
MENU_ITEM(submenu, MSG_MOVE_AXIS, lcd_move_menu); MENU_ITEM(submenu, MSG_MOVE_AXIS, lcd_move_menu);
END_MENU(); END_MENU();
} }

2
README.md

@ -41,6 +41,8 @@ Features:
* Heater power reporting. Useful for PID monitoring. * Heater power reporting. Useful for PID monitoring.
* PID tuning * PID tuning
* CoreXY kinematics (www.corexy.com/theory.html) * CoreXY kinematics (www.corexy.com/theory.html)
* Delta kinematics
* Dual X-carriage support for multiple extruder systems
* Configurable serial port to support connection of wireless adaptors. * Configurable serial port to support connection of wireless adaptors.
* Automatic operation of extruder/cold-end cooling fans based on nozzle temperature * Automatic operation of extruder/cold-end cooling fans based on nozzle temperature
* RC Servo Support, specify angle or duration for continuous rotation servos. * RC Servo Support, specify angle or duration for continuous rotation servos.

Loading…
Cancel
Save