Skip to content

Commit

Permalink
Added preliminary support for EASY_LOAD option to LCD menu for Bowden…
Browse files Browse the repository at this point in the history
… cable loading and unloading from menu
  • Loading branch information
Sublime authored and Sublime committed Apr 26, 2012
1 parent a0091fe commit 7817e4d
Show file tree
Hide file tree
Showing 7 changed files with 154 additions and 8 deletions.
12 changes: 9 additions & 3 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
#define TEMP_SENSOR_BED 0

// Actual temperature must be close to target for this long before M109 returns success
#define TEMP_RESIDENCY_TIME 0.1 // (seconds)
#define TEMP_RESIDENCY_TIME 15 // (seconds)
#define TEMP_HYSTERESIS 3 // (degC) range of +/- temperatures considered "close" to the target one

// The minimal temperature defines the temperature below which the heater will not be enabled It is used
Expand Down Expand Up @@ -108,8 +108,11 @@
//can be software-disabled for whatever purposes by
#define PREVENT_DANGEROUS_EXTRUDE
#define EXTRUDE_MINTEMP 170


#define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances.


//===========================================================================
//=============================Mechanical Settings===========================
//===========================================================================
Expand Down Expand Up @@ -174,7 +177,7 @@ const bool Z_ENDSTOPS_INVERTING = false; // set to true to invert the logic of t

//
#define DEFAULT_XYJERK 20.0 // (mm/sec)
#define DEFAULT_ZJERK 5.0 // (mm/sec)
#define DEFAULT_ZJERK 4.0 // (mm/sec)
#define DEFAULT_EJERK 10.0 // (mm/sec)

//===========================================================================
Expand Down Expand Up @@ -231,7 +234,7 @@ const bool Z_ENDSTOPS_INVERTING = false; // set to true to invert the logic of t



#define TANTILLUS
#define TANTILLUS // Adds 1546k over Ultipanel with click encoder

#ifdef TANTILLUS
#define BACKLIGHT 96 // Default backlight level (value 0 - 255) adjustable through menu
Expand All @@ -246,6 +249,9 @@ const bool Z_ENDSTOPS_INVERTING = false; // set to true to invert the logic of t
#define LCD_WIDTH 16
#define LCD_HEIGHT 2

#define EASY_LOAD // Add load/unload to LCD control panel ***caution*** Allows long extrusion distances (buttons request 650mm)
#define BOWDEN_LENGTH 650 // Sets max extrusion length ***caution*** Allows long extrusion distances (buttons request 650mm)

#define PREHEAT_PLA
//#define PREHEAT_ABS

Expand Down
16 changes: 16 additions & 0 deletions Marlin/Marlin.pde
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,21 @@ void process_commands()
for(int8_t i=0; i < NUM_AXIS; i++) {
destination[i] = current_position[i];
}
#ifdef TANTILLUS

feedrate = 0.0;
home_all_axis = !(code_seen(axis_codes[0]));

if((home_all_axis) || (code_seen(axis_codes[Z_AXIS]))) {
HOMEAXIS(Z);
}

if(code_seen(axis_codes[Z_AXIS])) {
if(code_value_long() != 0) {
current_position[Z_AXIS]=code_value()+add_homeing[0];
}
}
#else
feedrate = 0.0;
home_all_axis = !((code_seen(axis_codes[0])) || (code_seen(axis_codes[1])) || (code_seen(axis_codes[2])));
#ifdef QUICK_HOME
Expand Down Expand Up @@ -674,6 +689,7 @@ void process_commands()
current_position[Z_AXIS]=code_value()+add_homeing[2];
}
}
#endif
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);

#ifdef ENDSTOPS_ONLY_FOR_HOMING
Expand Down
17 changes: 15 additions & 2 deletions Marlin/language.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,19 @@
// LCD Menu Messages

#define WELCOME_MSG "Tantillus"
#define MSG_E650 " Extrude 650mm's"
#define MSG_R650 " Retract 650mm's"
#define MSG_LOAD " Load Filament"
#define MSG_UNLOAD " Unload Filament"
#define MSG_NO " NO"
#define MSG_YES " YES"

#define MSG_SD_INSERTED "Card inserted"
#define MSG_SD_REMOVED "Card removed"
#define MSG_MAIN " Main \003"
#define MSG_AUTOSTART " Autostart"
#define MSG_DISABLE_STEPPERS " Disable Steppers"
#define MSG_AUTO_HOME " Auto Home"
#define MSG_AUTO_HOME " Home"
#define MSG_SET_ORIGIN " Set Origin"
#define MSG_COOLDOWN " Cooldown"
#define MSG_EXTRUDE " Extrude"
Expand Down Expand Up @@ -157,13 +164,19 @@
// LCD Menu Messages

#define WELCOME_MSG "Tantillus"
#define MSG_E650 " Extrude 650mm's"
#define MSG_R650 " Retract 650mm's"
#define MSG_LOAD " Load Filament"
#define MSG_UNLOAD " Unload Filament"
#define MSG_NO " NO"
#define MSG_YES " YES"

#define MSG_SD_INSERTED "Card inserted"
#define MSG_SD_REMOVED "Card removed"
#define MSG_MAIN " Main \003"
#define MSG_AUTOSTART " Autostart"
#define MSG_DISABLE_STEPPERS " Stepper abschalten"
#define MSG_AUTO_HOME " Auto Heim"
#define MSG_AUTO_HOME " Heim"
#define MSG_SET_ORIGIN " Position setzen"
#define MSG_PREHEAT_PLA " Aufheizen PLA"
#define MSG_PREHEAT_ABS " Aufheizen ABS"
Expand Down
4 changes: 4 additions & 0 deletions Marlin/planner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,11 @@ void plan_buffer_line(const float &x, const float &y, const float &z, const floa
SERIAL_ECHO_START;
SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP);
}
#ifdef EASY_LOAD
if(labs(target[E_AXIS]-position[E_AXIS])>axis_steps_per_unit[E_AXIS]*BOWDEN_LENGTH)
#else
if(labs(target[E_AXIS]-position[E_AXIS])>axis_steps_per_unit[E_AXIS]*EXTRUDE_MAXLENGTH)
#endif
{
position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part
SERIAL_ECHO_START;
Expand Down
4 changes: 3 additions & 1 deletion Marlin/ultralcd.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
#define blocktime 500
#define lcdslow 5

enum MainStatus{Main_Status, Main_Menu, Main_Prepare,Sub_PrepareMove, Main_Control, Main_SD,Sub_TempControl,Sub_MotionControl};
enum MainStatus{Main_Status, Main_Menu, Main_Prepare,Sub_PrepareMove, Sub_PrepareLoad, Sub_PrepareUnload, Main_Control, Main_SD,Sub_TempControl,Sub_MotionControl};

class MainMenu{
public:
Expand All @@ -68,6 +68,8 @@
void showControlTemp();
void showAxisMove();
void showSD();
void showLoad();
void showUnload();
bool force_lcd_update;
int lastencoderpos;
int8_t lineoffset;
Expand Down
105 changes: 103 additions & 2 deletions Marlin/ultralcd.pde
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,11 @@ ItemP_preheat_pla,
#ifdef PREHEAT_ABS
ItemP_preheat_abs,
#endif
ItemP_cooldown, ItemP_home, ItemP_move, ItemP_disstep, ItemP_backlight, ItemP_origin, ItemP_autostart, /*ItemP_extrude,*/};
ItemP_cooldown, ItemP_home,
#ifdef EASY_LOAD
ItemP_load, ItemP_unload,
#endif
ItemP_move, ItemP_disstep, ItemP_backlight, ItemP_origin, ItemP_autostart, /*ItemP_extrude,*/};

//any action must not contain a ',' character anywhere, or this breaks:
#define MENUITEM(repaint_action, click_action) \
Expand Down Expand Up @@ -530,8 +534,26 @@ void MainMenu::showPrepare()
MENUITEM( lcdprintPGM(MSG_COOLDOWN) , BLOCK;setTargetHotend0(0);setTargetBed(0);beepshort(); ) ;
break;
case ItemP_home:
MENUITEM( lcdprintPGM(MSG_AUTO_HOME) , BLOCK;enquecommand("G28");beepshort(); ) ;
MENUITEM( lcdprintPGM(MSG_AUTO_HOME) , BLOCK;
#ifdef TANTILLUS
enquecommand("G1 F6000 X0 Y0");
#endif
enquecommand("G28");beepshort(); ) ;
break;

//****************************************************************************************************
#ifdef EASY_LOAD
case ItemP_load:
MENUITEM( lcdprintPGM(MSG_LOAD) , BLOCK;status=Sub_PrepareLoad;beepshort(); );
break;

case ItemP_unload:
MENUITEM( lcdprintPGM(MSG_UNLOAD) , BLOCK;status=Sub_PrepareUnload;beepshort(); );
break;
#endif
//***************************************************************************************************


case ItemP_move:
MENUITEM( lcdprintPGM(MSG_MOVE_AXIS) , BLOCK;status=Sub_PrepareMove;beepshort(); );
break;
Expand Down Expand Up @@ -597,6 +619,73 @@ void MainMenu::showPrepare()
#endif
}


//****************************************************************************************************
enum {ItemL_title,ItemL_exit,ItemL_Load};


void MainMenu::showLoad()
{
#ifdef EASY_LOAD
uint8_t line=0;

clearIfNecessary();
for(int8_t i=lineoffset;i<lineoffset+LCD_HEIGHT;i++)
{
//Serial.println((int)(line-lineoffset));
switch(i)
{
case ItemL_title:
MENUITEM( lcdprintPGM(MSG_E650) , BLOCK;beepshort(); ) ;
break;
case ItemL_exit:
MENUITEM( lcdprintPGM(MSG_NO) , BLOCK;status=Main_Menu;beepshort(); ) ;
break;
case ItemL_Load:
MENUITEM( lcdprintPGM(MSG_YES) , BLOCK;enquecommand("G1 F900 E650");beepshort(); ) ;
break;
}
line++;
}
updateActiveLines(ItemL_Load,encoderpos);
#endif
}

enum {ItemUL_title,ItemUL_exit,ItemUL_Unload};


void MainMenu::showUnload()
{
#ifdef EASY_LOAD
uint8_t line=0;

clearIfNecessary();
for(int8_t i=lineoffset;i<lineoffset+LCD_HEIGHT;i++)
{
//Serial.println((int)(line-lineoffset));
switch(i)
{
case ItemUL_title:
MENUITEM( lcdprintPGM(MSG_R650) , BLOCK;beepshort(); ) ;
break;
case ItemUL_exit:
MENUITEM( lcdprintPGM(MSG_NO) , BLOCK;status=Main_Menu;beepshort(); ) ;
break;
case ItemUL_Unload:
MENUITEM( lcdprintPGM(MSG_YES) , BLOCK;enquecommand("G1 F900 E-650");beepshort(); ) ;
break;
}
line++;
}
updateActiveLines(ItemUL_Unload,encoderpos);
#endif
}

//***************************************************************************************************




enum {
ItemAM_exit,
ItemAM_X, ItemAM_Y, ItemAM_Z, ItemAM_E
Expand Down Expand Up @@ -2206,6 +2295,18 @@ void MainMenu::update()
{
showAxisMove();
}break;
//*******************************
#ifdef EASY_LOAD
case Sub_PrepareLoad:
{
showLoad();
}break;
case Sub_PrepareUnload:
{
showUnload();
}break;
#endif
//******************************
case Main_Control:
{
showControl();
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ Additions and changes:

* Uses relative extrusion. ( Marlin default is Absolute )

* LCD home command sends X and Y back to X0 and Y0 and uses the endstop to find Z0

* Added easyload option to LCD to Load / Unload the filament without the need of a computer. (for Bowden Cables)




Expand Down

0 comments on commit 7817e4d

Please sign in to comment.