Commit 23f5f244 authored by MagoKimbra's avatar MagoKimbra

Del Kc

parent 1a6d824d
...@@ -87,7 +87,31 @@ ...@@ -87,7 +87,31 @@
//********************************************************************** //**********************************************************************
#if !defined(MKR4) /***********************************************************************
*********************** Multiextruder NPr2 ***************************
***********************************************************************
* *
* Setting fot color meccanism NPr2 by NicolaP (www.3dmakerlab.it) *
* *
* Firmware by MagoKimbra magokimbra@hotmail.com *
* *
* Find angle setting by g-Code "M997 Cxxx" *
* *
***********************************************************************/
//#define NPR2
#ifdef NPR2
#define COLOR_STEP {120,25,-65,-155} // CARTER ANGLE
#define COLOR_SLOWRATE 170 // MICROSECOND delay for carter motor routine (Carter Motor Feedrate: upper value-slow feedrate)
#define COLOR_HOMERATE 4 // FEEDRATE for carter home
#define MOTOR_ANGLE 1.8 // Nema angle for single step
#define DRIVER_MICROSTEP 4 // Microstep moltiplicator driver (set jumper MS1-2-3) off-on-off 1/4 microstepping.
#define CARTER_MOLTIPLICATOR 14.22 // CARTER MOLTIPLICATOR (gear ratio 13/31-10/31)
#define DRIVER_EXTRUDERS 2 // This defines the number of Driver extruders
#endif
//**********************************************************************
#if !defined(MKR4) && !defined(NPR2)
#define DRIVER_EXTRUDERS EXTRUDERS // This defines the number of Driver extruders #define DRIVER_EXTRUDERS EXTRUDERS // This defines the number of Driver extruders
#endif #endif
...@@ -515,7 +539,8 @@ ...@@ -515,7 +539,8 @@
#define LCD_UNLOAD_FEEDRATE 8 // mm/s #define LCD_UNLOAD_FEEDRATE 8 // mm/s
#endif #endif
// Show a progress bar on the LCD when printing from SD?
// Show a progress bar on HD44780 LCDs for SD printing
//#define LCD_PROGRESS_BAR //#define LCD_PROGRESS_BAR
#ifdef LCD_PROGRESS_BAR #ifdef LCD_PROGRESS_BAR
// Amount of time (ms) to show the bar // Amount of time (ms) to show the bar
...@@ -526,6 +551,12 @@ ...@@ -526,6 +551,12 @@
#define PROGRESS_BAR_MSG_EXPIRE 0 #define PROGRESS_BAR_MSG_EXPIRE 0
// Enable this to show messages for MSG_TIME then hide them // Enable this to show messages for MSG_TIME then hide them
//#define PROGRESS_BAR_MSG_ONCE //#define PROGRESS_BAR_MSG_ONCE
#ifdef DOGLCD
#warning LCD_PROGRESS_BAR does not apply to graphical displays at this time.
#endif
#ifdef FILAMENT_LCD_DISPLAY
#error LCD_PROGRESS_BAR and FILAMENT_LCD_DISPLAY are not fully compatible. Comment out this line to use both.
#endif
#endif #endif
......
...@@ -91,13 +91,7 @@ void Config_StoreSettings() ...@@ -91,13 +91,7 @@ void Config_StoreSettings()
EEPROM_WRITE_VAR(i,Kp); EEPROM_WRITE_VAR(i,Kp);
EEPROM_WRITE_VAR(i,Ki); EEPROM_WRITE_VAR(i,Ki);
EEPROM_WRITE_VAR(i,Kd); EEPROM_WRITE_VAR(i,Kd);
#else #endif // PIDTEMP
float dummy = 3000.0f;
EEPROM_WRITE_VAR(i,dummy);
dummy = 0.0f;
EEPROM_WRITE_VAR(i,dummy);
EEPROM_WRITE_VAR(i,dummy);
#endif
#ifndef DOGLCD #ifndef DOGLCD
int lcd_contrast = 32; int lcd_contrast = 32;
#endif #endif
...@@ -270,12 +264,17 @@ void Config_PrintSettings() ...@@ -270,12 +264,17 @@ void Config_PrintSettings()
#ifdef PIDTEMP #ifdef PIDTEMP
SERIAL_ECHO_START; SERIAL_ECHO_START;
SERIAL_ECHOLNPGM("PID settings:"); SERIAL_ECHOLNPGM("PID settings:");
SERIAL_ECHO_START; for (int e = 0; e < EXTRUDERS; e++)
SERIAL_ECHOPAIR(" M301 P",Kp[active_extruder]); {
SERIAL_ECHOPAIR(" I" ,unscalePID_i(Ki[active_extruder])); SERIAL_ECHO_START;
SERIAL_ECHOPAIR(" D" ,unscalePID_d(Kd[active_extruder])); SERIAL_ECHOPAIR(" M301 E", (long unsigned int)e);
SERIAL_ECHOLN(""); SERIAL_ECHOPAIR(" P", Kp[e]);
#endif SERIAL_ECHOPAIR(" I" ,unscalePID_i(Ki[e]));
SERIAL_ECHOPAIR(" D" ,unscalePID_d(Kd[e]));
SERIAL_ECHOLN("");
}
#endif // PIDTEMP
#ifdef FWRETRACT #ifdef FWRETRACT
SERIAL_ECHO_START; SERIAL_ECHO_START;
SERIAL_ECHOLNPGM("Retract: S=Length (mm) F:Speed (mm/m) Z: ZLift (mm)"); SERIAL_ECHOLNPGM("Retract: S=Length (mm) F:Speed (mm/m) Z: ZLift (mm)");
...@@ -391,13 +390,14 @@ void Config_RetrieveSettings() ...@@ -391,13 +390,14 @@ void Config_RetrieveSettings()
EEPROM_READ_VAR(i,gumPreheatHotendTemp); EEPROM_READ_VAR(i,gumPreheatHotendTemp);
EEPROM_READ_VAR(i,gumPreheatHPBTemp); EEPROM_READ_VAR(i,gumPreheatHPBTemp);
EEPROM_READ_VAR(i,gumPreheatFanSpeed); EEPROM_READ_VAR(i,gumPreheatFanSpeed);
#ifndef PIDTEMP
float Kp,Ki,Kd; #ifdef PIDTEMP
#endif
// do not need to scale PID values as the values in EEPROM are already scaled // do not need to scale PID values as the values in EEPROM are already scaled
EEPROM_READ_VAR(i,Kp); EEPROM_READ_VAR(i,Kp);
EEPROM_READ_VAR(i,Ki); EEPROM_READ_VAR(i,Ki);
EEPROM_READ_VAR(i,Kd); EEPROM_READ_VAR(i,Kd);
#endif // PIDTEMP
#ifndef DOGLCD #ifndef DOGLCD
int lcd_contrast; int lcd_contrast;
#endif #endif
...@@ -461,7 +461,7 @@ void Config_ResetDefault() ...@@ -461,7 +461,7 @@ void Config_ResetDefault()
float tmp5[]=DEFAULT_Kp; float tmp5[]=DEFAULT_Kp;
float tmp6[]=DEFAULT_Ki; float tmp6[]=DEFAULT_Ki;
float tmp7[]=DEFAULT_Kd; float tmp7[]=DEFAULT_Kd;
#endif #endif // PIDTEMP
for (short i=0;i<7;i++) for (short i=0;i<7;i++)
{ {
...@@ -517,6 +517,8 @@ void Config_ResetDefault() ...@@ -517,6 +517,8 @@ void Config_ResetDefault()
lcd_contrast = DEFAULT_LCD_CONTRAST; lcd_contrast = DEFAULT_LCD_CONTRAST;
#endif #endif
#ifdef PIDTEMP #ifdef PIDTEMP
// call updatePID (similar to when we have processed M301)
updatePID();
for (short i=0;i<4;i++) for (short i=0;i<4;i++)
{ {
#ifdef SINGLENOZZLE #ifdef SINGLENOZZLE
...@@ -528,14 +530,8 @@ void Config_ResetDefault() ...@@ -528,14 +530,8 @@ void Config_ResetDefault()
Ki[i] = scalePID_i(tmp6[i]); Ki[i] = scalePID_i(tmp6[i]);
Kd[i] = scalePID_d(tmp7[i]); Kd[i] = scalePID_d(tmp7[i]);
#endif #endif
} }
// call updatePID (similar to when we have processed M301)
updatePID();
#ifdef PID_ADD_EXTRUSION_RATE
Kc = DEFAULT_Kc;
#endif//PID_ADD_EXTRUSION_RATE
#endif//PIDTEMP #endif//PIDTEMP
#ifdef FWRETRACT #ifdef FWRETRACT
......
...@@ -28,16 +28,6 @@ ...@@ -28,16 +28,6 @@
//#define WATCH_TEMP_PERIOD 40000 //40 seconds //#define WATCH_TEMP_PERIOD 40000 //40 seconds
//#define WATCH_TEMP_INCREASE 10 //Heat up at least 10 degree in 20 seconds //#define WATCH_TEMP_INCREASE 10 //Heat up at least 10 degree in 20 seconds
#ifdef PIDTEMP
// this adds an experimental additional term to the heating power, proportional to the extrusion speed.
// if Kc is chosen well, the additional required power due to increased melting should be compensated.
#define PID_ADD_EXTRUSION_RATE
#ifdef PID_ADD_EXTRUSION_RATE
#define DEFAULT_Kc (1) //heating power=Kc*(e_speed)
#endif
#endif
//automatic temperature: The hot end target temperature is calculated by all the buffered lines of gcode. //automatic temperature: The hot end target temperature is calculated by all the buffered lines of gcode.
//The maximum buffered steps/sec of the extruder motor are called "se". //The maximum buffered steps/sec of the extruder motor are called "se".
//You enter the autotemp mode by a M109 S<mintemp> B<maxtemp> F<factor> //You enter the autotemp mode by a M109 S<mintemp> B<maxtemp> F<factor>
......
...@@ -4497,28 +4497,35 @@ Sigma_Exit: ...@@ -4497,28 +4497,35 @@ Sigma_Exit:
#ifdef PIDTEMP #ifdef PIDTEMP
case 301: // M301 case 301: // M301
{ {
if(code_seen('P')) Kp[active_extruder] = code_value(); // multi-extruder PID patch: M301 updates or prints a single extruder's PID values
if(code_seen('I')) Ki[active_extruder] = scalePID_i(code_value()); // default behaviour (omitting E parameter) is to update for extruder 0 only
if(code_seen('D')) Kd[active_extruder] = scalePID_d(code_value()); int e = 0; // extruder being updated
if (code_seen('E'))
#ifdef PID_ADD_EXTRUSION_RATE {
if(code_seen('C')) Kc = code_value(); e = (int)code_value();
#endif }
if (e < EXTRUDERS) // catch bad input value
updatePID(); {
SERIAL_PROTOCOL(MSG_OK); if (code_seen('P')) Kp[e] = code_value();
SERIAL_PROTOCOL(" p:"); if (code_seen('I')) Ki[e] = scalePID_i(code_value());
SERIAL_PROTOCOL(Kp[active_extruder]); if (code_seen('D')) Kd[e] = scalePID_d(code_value());
SERIAL_PROTOCOL(" i:"); updatePID();
SERIAL_PROTOCOL(unscalePID_i(Ki[active_extruder])); SERIAL_PROTOCOL(MSG_OK);
SERIAL_PROTOCOL(" d:"); SERIAL_PROTOCOL(" e:"); // specify extruder in serial output
SERIAL_PROTOCOL(unscalePID_d(Kd[active_extruder])); SERIAL_PROTOCOL(e);
#ifdef PID_ADD_EXTRUSION_RATE SERIAL_PROTOCOL(" p:");
SERIAL_PROTOCOL(" c:"); SERIAL_PROTOCOL(Kp[e]);
//Kc does not have scaling applied above, or in resetting defaults SERIAL_PROTOCOL(" i:");
SERIAL_PROTOCOL(Kc); SERIAL_PROTOCOL(unscalePID_i(Ki[e]));
#endif SERIAL_PROTOCOL(" d:");
SERIAL_PROTOCOLLN(""); SERIAL_PROTOCOL(unscalePID_d(Kd[e]));
SERIAL_PROTOCOLLN("");
}
else
{
SERIAL_ECHO_START;
SERIAL_ECHOLN(MSG_INVALID_EXTRUDER);
}
} }
break; break;
#endif //PIDTEMP #endif //PIDTEMP
......
/** /**
*dogm_lcd_implementation.h * dogm_lcd_implementation.h
* *
*Graphics LCD implementation for 128x64 pixel LCDs by STB for ErikZalm/Marlin * Graphics LCD implementation for 128x64 pixel LCDs by STB for ErikZalm/Marlin
*Demonstrator: http://www.reprap.org/wiki/STB_Electronics * Demonstrator: http://www.reprap.org/wiki/STB_Electronics
*License: http://opensource.org/licenses/BSD-3-Clause * License: http://opensource.org/licenses/BSD-3-Clause
* *
*With the use of: * With the use of:
*u8glib by Oliver Kraus * u8glib by Oliver Kraus
*http://code.google.com/p/u8glib/ * http://code.google.com/p/u8glib/
*License: http://opensource.org/licenses/BSD-3-Clause * License: http://opensource.org/licenses/BSD-3-Clause
*/ */
#ifndef DOGM_LCD_IMPLEMENTATION_H
#define DOGM_LCD_IMPLEMENTATION_H
#ifndef ULTRA_LCD_IMPLEMENTATION_DOGM_H #define MARLIN_VERSION "4.0.1"
#define ULTRA_LCD_IMPLEMENTATION_DOGM_H
/** /**
* Implementation of the LCD display routines for a DOGM128 graphic display. These are common LCD 128x64 pixel graphic displays. * Implementation of the LCD display routines for a DOGM128 graphic display. These are common LCD 128x64 pixel graphic displays.
...@@ -51,12 +52,12 @@ ...@@ -51,12 +52,12 @@
*/ */
// DOGM parameters (size in pixels) // DOGM parameters (size in pixels)
#define DOG_CHAR_WIDTH 6 #define DOG_CHAR_WIDTH 6
#define DOG_CHAR_HEIGHT 12 #define DOG_CHAR_HEIGHT 12
#define DOG_CHAR_WIDTH_LARGE 9 #define DOG_CHAR_WIDTH_LARGE 9
#define DOG_CHAR_HEIGHT_LARGE 18 #define DOG_CHAR_HEIGHT_LARGE 18
#define START_ROW 0 #define START_ROW 0
/* Custom characters defined in font font_6x10_marlin.c */ /* Custom characters defined in font font_6x10_marlin.c */
#define LCD_STR_DEGREE "\xB0" #define LCD_STR_DEGREE "\xB0"
...@@ -69,7 +70,7 @@ ...@@ -69,7 +70,7 @@
#define LCD_STR_BEDTEMP "\xFE" #define LCD_STR_BEDTEMP "\xFE"
#define LCD_STR_THERMOMETER "\xFF" #define LCD_STR_THERMOMETER "\xFF"
#define FONT_STATUSMENU u8g_font_6x9 #define FONT_STATUSMENU u8g_font_6x9
int lcd_contrast; int lcd_contrast;
...@@ -82,86 +83,57 @@ U8GLIB_ST7920_128X64_RRD u8g(0); ...@@ -82,86 +83,57 @@ U8GLIB_ST7920_128X64_RRD u8g(0);
U8GLIB_NHD_C12864 u8g(DOGLCD_CS, DOGLCD_A0); U8GLIB_NHD_C12864 u8g(DOGLCD_CS, DOGLCD_A0);
#else #else
// for regular DOGM128 display with HW-SPI // for regular DOGM128 display with HW-SPI
U8GLIB_DOGM128 u8g(DOGLCD_CS, DOGLCD_A0); // HW-SPI Com: CS, A0 U8GLIB_DOGM128 u8g(DOGLCD_CS, DOGLCD_A0); // HW-SPI Com: CS, A0
#endif #endif
static void lcd_implementation_init() static void lcd_implementation_init() {
{ #ifdef LCD_PIN_BL
#ifdef LCD_PIN_BL pinMode(LCD_PIN_BL, OUTPUT); // Enable LCD backlight
pinMode(LCD_PIN_BL, OUTPUT); // Enable LCD backlight digitalWrite(LCD_PIN_BL, HIGH);
digitalWrite(LCD_PIN_BL, HIGH); #endif
#endif
u8g.setContrast(lcd_contrast); u8g.setContrast(lcd_contrast);
// Uncomment this if you have the first generation (V1.10) of STBs board
// pinMode(17, OUTPUT); // Enable LCD backlight
// digitalWrite(17, HIGH);
u8g.firstPage();
do {
u8g.setFont(u8g_font_6x10_marlin);
u8g.setColorIndex(1);
u8g.drawBox (0, 0, u8g.getWidth(), u8g.getHeight());
u8g.setColorIndex(1);
} while( u8g.nextPage() );
#ifdef LCD_SCREEN_ROT_90
u8g.setRot90(); // Rotate screen by 90°
#endif
#ifdef LCD_SCREEN_ROT_180 /*
u8g.setRot180(); // Rotate screen by 180° // Uncomment this if you have the first generation (V1.10) of STBs board
#endif
#ifdef LCD_SCREEN_ROT_270 pinMode(17, OUTPUT); // Enable LCD backlight
u8g.setRot270(); // Rotate screen by 270° digitalWrite(17, HIGH);
#endif
//*/
u8g.firstPage();
do { u8g.firstPage();
// RepRap init bmp do {
u8g.drawBitmapP(0,0,START_BMPBYTEWIDTH,START_BMPHEIGHT,start_bmp); u8g.setFont(u8g_font_6x10_marlin);
// Welcome message u8g.setColorIndex(1);
u8g.setFont(u8g_font_6x10_marlin); u8g.drawBox (0, 0, u8g.getWidth(), u8g.getHeight());
u8g.drawStr(62,10,"MARLIN"); u8g.setColorIndex(1);
u8g.setFont(u8g_font_5x8); } while( u8g.nextPage() );
u8g.drawStr(62,19,"V1.0.0 RC2-mm");
u8g.setFont(u8g_font_6x10_marlin);
u8g.drawStr(62,28,"by ErikZalm");
u8g.drawStr(62,41,"DOGM128 LCD");
u8g.setFont(u8g_font_5x8);
u8g.drawStr(62,48,"enhancements");
u8g.setFont(u8g_font_5x8);
u8g.drawStr(62,55,"by STB, MM");
u8g.drawStr(62,61,"uses u");
u8g.drawStr90(92,57,"8");
u8g.drawStr(100,61,"glib");
} while( u8g.nextPage() );
}
static void lcd_implementation_clear() #if defined(LCD_SCREEN_ROT_90)
{ u8g.setRot90(); // Rotate screen by 90°
// NO NEED TO IMPLEMENT LIKE SO. Picture loop automatically clears the display. #elif defined(LCD_SCREEN_ROT_180)
// u8g.setRot180(); // Rotate screen by 180°
// Check this article: http://arduino.cc/forum/index.php?topic=91395.25;wap2 #elif defined(LCD_SCREEN_ROT_270)
// u8g.setRot270(); // Rotate screen by 270°
// u8g.firstPage(); #endif
// do {
// u8g.setColorIndex(0); u8g.firstPage();
// u8g.drawBox (0, 0, u8g.getWidth(), u8g.getHeight()); do {
// u8g.setColorIndex(1); // RepRap init bmp
// } while( u8g.nextPage() ); u8g.drawBitmapP(7,7,START_BMPBYTEWIDTH,START_BMPHEIGHT,start_bmp);
// Welcome message
u8g.setFont(u8g_font_5x8);
u8g.drawStr(7, 51, "V" MARLIN_VERSION " - marlin.reprap.org");
} while( u8g.nextPage() );
} }
static void lcd_implementation_clear() { } // Automatically cleared by Picture Loop
/* Arduino < 1.0.0 is missing a function to print PROGMEM strings, so we need to implement our own */ /* Arduino < 1.0.0 is missing a function to print PROGMEM strings, so we need to implement our own */
static void lcd_printPGM(const char* str) static void lcd_printPGM(const char* str) {
{ char c;
char c; while ((c = pgm_read_byte(str++))) u8g.print(c);
while((c = pgm_read_byte(str++)) != '\0')
{
u8g.print(c);
}
} }
static void _draw_heater_status(int x, int heater) { static void _draw_heater_status(int x, int heater) {
...@@ -184,49 +156,44 @@ static void _draw_heater_status(int x, int heater) { ...@@ -184,49 +156,44 @@ static void _draw_heater_status(int x, int heater) {
} }
} }
static void lcd_implementation_status_screen() static void lcd_implementation_status_screen() {
{
static unsigned char fan_rot = 0; static unsigned char fan_rot = 0;
u8g.setColorIndex(1); // black on white
// Symbols menu graphics, animated fan u8g.setColorIndex(1); // black on white
u8g.drawBitmapP(9,1,STATUS_SCREENBYTEWIDTH,STATUS_SCREENHEIGHT, (blink % 2) && fanSpeed ? status_screen0_bmp : status_screen1_bmp);
// Symbols menu graphics, animated fan
#ifdef SDSUPPORT u8g.drawBitmapP(9,1,STATUS_SCREENBYTEWIDTH,STATUS_SCREENHEIGHT, (blink % 2) && fanSpeed ? status_screen0_bmp : status_screen1_bmp);
//SD Card Symbol
u8g.drawBox(42,42,8,7);
u8g.drawBox(50,44,2,5);
u8g.drawFrame(42,49,10,4);
u8g.drawPixel(50,43);
// Progress bar
u8g.drawFrame(54,49,73,4);
// SD Card Progress bar and clock #ifdef SDSUPPORT
u8g.setFont(FONT_STATUSMENU); // SD Card Symbol
u8g.drawBox(42,42,8,7);
u8g.drawBox(50,44,2,5);
u8g.drawFrame(42,49,10,4);
u8g.drawPixel(50,43);
// Progress bar frame
u8g.drawFrame(54,49,73,4);
// SD Card Progress bar and clock
u8g.setFont(FONT_STATUSMENU);
if (IS_SD_PRINTING) if (IS_SD_PRINTING) {
{ // Progress bar solid part
// Progress bar u8g.drawBox(55, 50, (unsigned int)(71.f * card.percentDone() / 100.f), 2);
u8g.drawBox(55,50, (unsigned int)( (71 * card.percentDone())/100) ,2); }
}
u8g.setPrintPos(80,47);
if (starttime != 0) {
uint16_t time = millis()/60000 - starttime/60000;
u8g.print(itostr2(time/60));
u8g.print(':');
u8g.print(itostr2(time%60));
}
else { else {
// do nothing lcd_printPGM(PSTR("--:--"));
} }
#endif
u8g.setPrintPos(80,47);
if(starttime != 0)
{
uint16_t time = millis()/60000 - starttime/60000;
u8g.print(itostr2(time/60));
u8g.print(':');
u8g.print(itostr2(time%60));
}else{
lcd_printPGM(PSTR("--:--"));
}
#endif
// Extruders // Extruders
_draw_heater_status(6, 0); _draw_heater_status(6, 0);
...@@ -240,107 +207,101 @@ static void lcd_implementation_status_screen() ...@@ -240,107 +207,101 @@ static void lcd_implementation_status_screen()
// Heatbed // Heatbed
_draw_heater_status(81, -1); _draw_heater_status(81, -1);
// Fan // Fan
u8g.setFont(FONT_STATUSMENU); u8g.setFont(FONT_STATUSMENU);
u8g.setPrintPos(104,27); u8g.setPrintPos(104,27);
#if defined(FAN_PIN) && FAN_PIN > -1 #if defined(FAN_PIN) && FAN_PIN > -1
u8g.print(itostr3(int((fanSpeed*100)/256 + 1))); u8g.print(itostr3(int((fanSpeed*100)/256 + 1)));
u8g.print("%"); u8g.print("%");
#else #else
u8g.print("---"); u8g.print("---");
#endif #endif
// X, Y, Z-Coordinates
// X, Y, Z-Coordinates u8g.setFont(FONT_STATUSMENU);
u8g.setFont(FONT_STATUSMENU); u8g.drawBox(0,29,128,10);
u8g.drawBox(0,29,128,10); u8g.setColorIndex(0); // white on black
u8g.setColorIndex(0); // white on black u8g.setPrintPos(2,37);
u8g.setPrintPos(2,37); u8g.print("X");
u8g.print("X"); u8g.drawPixel(8,33);
u8g.drawPixel(8,33); u8g.drawPixel(8,35);
u8g.drawPixel(8,35); u8g.setPrintPos(10,37);
u8g.setPrintPos(10,37); u8g.print(ftostr31ns(current_position[X_AXIS]));
u8g.print(ftostr31ns(current_position[X_AXIS])); u8g.setPrintPos(43,37);
u8g.setPrintPos(43,37); lcd_printPGM(PSTR("Y"));
lcd_printPGM(PSTR("Y")); u8g.drawPixel(49,33);
u8g.drawPixel(49,33); u8g.drawPixel(49,35);
u8g.drawPixel(49,35); u8g.setPrintPos(51,37);
u8g.setPrintPos(51,37); u8g.print(ftostr31ns(current_position[Y_AXIS]));
u8g.print(ftostr31ns(current_position[Y_AXIS])); u8g.setPrintPos(83,37);
u8g.setPrintPos(83,37); u8g.print("Z");
u8g.print("Z"); u8g.drawPixel(89,33);
u8g.drawPixel(89,33); u8g.drawPixel(89,35);
u8g.drawPixel(89,35); u8g.setPrintPos(91,37);
u8g.setPrintPos(91,37); u8g.print(ftostr31(current_position[Z_AXIS]));
u8g.print(ftostr31(current_position[Z_AXIS])); u8g.setColorIndex(1); // black on white
u8g.setColorIndex(1); // black on white
// Feedrate // Feedrate
u8g.setFont(u8g_font_6x10_marlin); u8g.setFont(u8g_font_6x10_marlin);
u8g.setPrintPos(3,49); u8g.setPrintPos(3,49);
u8g.print(LCD_STR_FEEDRATE[0]); u8g.print(LCD_STR_FEEDRATE[0]);
u8g.setFont(FONT_STATUSMENU); u8g.setFont(FONT_STATUSMENU);
u8g.setPrintPos(12,48); u8g.setPrintPos(12,48);
u8g.print(itostr3(feedmultiply)); u8g.print(itostr3(feedmultiply));
u8g.print('%'); u8g.print('%');
// Status line
u8g.setFont(FONT_STATUSMENU);
u8g.setPrintPos(0,61);
#ifndef FILAMENT_LCD_DISPLAY
u8g.print(lcd_status_message);
#else
if(message_millis+5000>millis()){ //Display both Status message line and Filament display on the last line
u8g.print(lcd_status_message);
}
else
{
lcd_printPGM(PSTR("dia:"));
u8g.print(ftostr12ns(filament_width_meas));
lcd_printPGM(PSTR(" factor:"));
u8g.print(itostr3(extrudemultiply));
u8g.print('%');
}
#endif
// Status line
u8g.setFont(FONT_STATUSMENU);
u8g.setPrintPos(0,61);
#ifndef FILAMENT_LCD_DISPLAY
u8g.print(lcd_status_message);
#else
if (millis() < message_millis + 5000) { //Display both Status message line and Filament display on the last line
u8g.print(lcd_status_message);
}
else {
lcd_printPGM(PSTR("dia:"));
u8g.print(ftostr12ns(filament_width_meas));
lcd_printPGM(PSTR(" factor:"));
u8g.print(itostr3(extrudemultiply));
u8g.print('%');
}
#endif
} }
static void lcd_implementation_drawmenu_generic(uint8_t row, const char* pstr, char pre_char, char post_char) static void lcd_implementation_drawmenu_generic(uint8_t row, const char* pstr, char pre_char, char post_char) {
{ char c;
char c;
uint8_t n = LCD_WIDTH - 1 - 2;
uint8_t n = LCD_WIDTH - 1 - 2;
if ((pre_char == '>') || (pre_char == LCD_STR_UPLEVEL[0] )) {
if ((pre_char == '>') || (pre_char == LCD_STR_UPLEVEL[0] )) u8g.setColorIndex(1); // black on white
{ u8g.drawBox (0, row*DOG_CHAR_HEIGHT + 3, 128, DOG_CHAR_HEIGHT);
u8g.setColorIndex(1); // black on white u8g.setColorIndex(0); // following text must be white on black
u8g.drawBox (0, row*DOG_CHAR_HEIGHT + 3, 128, DOG_CHAR_HEIGHT); }
u8g.setColorIndex(0); // following text must be white on black else {
} else u8g.setColorIndex(1); // unmarked text is black on white u8g.setColorIndex(1); // unmarked text is black on white
}
u8g.setPrintPos(0 * DOG_CHAR_WIDTH, (row + 1) * DOG_CHAR_HEIGHT);
u8g.print(pre_char == '>' ? ' ' : pre_char); // Row selector is obsolete u8g.setPrintPos(0 * DOG_CHAR_WIDTH, (row + 1) * DOG_CHAR_HEIGHT);
u8g.print(pre_char == '>' ? ' ' : pre_char); // Row selector is obsolete
while( (c = pgm_read_byte(pstr)) != '\0' ) while((c = pgm_read_byte(pstr))) {
{ u8g.print(c);
u8g.print(c); pstr++;
pstr++; n--;
n--; }
} while(n--) u8g.print(' ');
while(n--){
u8g.print(' '); u8g.print(post_char);
} u8g.print(' ');
u8g.setColorIndex(1); // restore settings to black on white
u8g.print(post_char);
u8g.print(' ');
u8g.setColorIndex(1); // restore settings to black on white
} }
static void _drawmenu_setting_edit_generic(uint8_t row, const char* pstr, char pre_char, const char* data, bool pgm) { static void _drawmenu_setting_edit_generic(uint8_t row, const char* pstr, char pre_char, const char* data, bool pgm) {
char c; char c;
uint8_t n = LCD_WIDTH - 1 - 2 - (pgm ? strlen_P(data) : strlen(data)); uint8_t n = LCD_WIDTH - 1 - 2 - (pgm ? strlen_P(data) : strlen(data));
u8g.setPrintPos(0 * DOG_CHAR_WIDTH, (row + 1) * DOG_CHAR_HEIGHT); u8g.setPrintPos(0 * DOG_CHAR_WIDTH, (row + 1) * DOG_CHAR_HEIGHT);
u8g.print(pre_char); u8g.print(pre_char);
...@@ -399,14 +360,13 @@ static void _drawmenu_setting_edit_generic(uint8_t row, const char* pstr, char p ...@@ -399,14 +360,13 @@ static void _drawmenu_setting_edit_generic(uint8_t row, const char* pstr, char p
#define lcd_implementation_drawmenu_setting_edit_callback_bool_selected(row, pstr, pstr2, data, callback) lcd_implementation_drawmenu_setting_edit_generic_P(row, pstr, '>', (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF)) #define lcd_implementation_drawmenu_setting_edit_callback_bool_selected(row, pstr, pstr2, data, callback) lcd_implementation_drawmenu_setting_edit_generic_P(row, pstr, '>', (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
#define lcd_implementation_drawmenu_setting_edit_callback_bool(row, pstr, pstr2, data, callback) lcd_implementation_drawmenu_setting_edit_generic_P(row, pstr, ' ', (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF)) #define lcd_implementation_drawmenu_setting_edit_callback_bool(row, pstr, pstr2, data, callback) lcd_implementation_drawmenu_setting_edit_generic_P(row, pstr, ' ', (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
void lcd_implementation_drawedit(const char* pstr, char* value) void lcd_implementation_drawedit(const char* pstr, char* value) {
{ u8g.setPrintPos(0 * DOG_CHAR_WIDTH_LARGE, (u8g.getHeight() - 1 - DOG_CHAR_HEIGHT_LARGE) - (1 * DOG_CHAR_HEIGHT_LARGE) - START_ROW );
u8g.setPrintPos(0 * DOG_CHAR_WIDTH_LARGE, (u8g.getHeight() - 1 - DOG_CHAR_HEIGHT_LARGE) - (1 * DOG_CHAR_HEIGHT_LARGE) - START_ROW ); u8g.setFont(u8g_font_9x18);
u8g.setFont(u8g_font_9x18); lcd_printPGM(pstr);
lcd_printPGM(pstr); u8g.print(':');
u8g.print(':'); u8g.setPrintPos((14 - strlen(value)) * DOG_CHAR_WIDTH_LARGE, (u8g.getHeight() - 1 - DOG_CHAR_HEIGHT_LARGE) - (1 * DOG_CHAR_HEIGHT_LARGE) - START_ROW );
u8g.setPrintPos((14 - strlen(value)) * DOG_CHAR_WIDTH_LARGE, (u8g.getHeight() - 1 - DOG_CHAR_HEIGHT_LARGE) - (1 * DOG_CHAR_HEIGHT_LARGE) - START_ROW ); u8g.print(value);
u8g.print(value);
} }
static void _drawmenu_sd(uint8_t row, const char* pstr, const char* filename, char * const longFilename, bool isDir, bool isSelected) { static void _drawmenu_sd(uint8_t row, const char* pstr, const char* filename, char * const longFilename, bool isDir, bool isSelected) {
...@@ -425,7 +385,7 @@ static void _drawmenu_sd(uint8_t row, const char* pstr, const char* filename, ch ...@@ -425,7 +385,7 @@ static void _drawmenu_sd(uint8_t row, const char* pstr, const char* filename, ch
} }
u8g.setPrintPos(0 * DOG_CHAR_WIDTH, (row + 1) * DOG_CHAR_HEIGHT); u8g.setPrintPos(0 * DOG_CHAR_WIDTH, (row + 1) * DOG_CHAR_HEIGHT);
u8g.print(' '); // Indent by 1 char u8g.print(' '); // Indent by 1 char
if (isDir) u8g.print(LCD_STR_FOLDER[0]); if (isDir) u8g.print(LCD_STR_FOLDER[0]);
...@@ -453,20 +413,16 @@ static void _drawmenu_sd(uint8_t row, const char* pstr, const char* filename, ch ...@@ -453,20 +413,16 @@ static void _drawmenu_sd(uint8_t row, const char* pstr, const char* filename, ch
#define lcd_implementation_drawmenu_function_selected(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, '>', ' ') #define lcd_implementation_drawmenu_function_selected(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, '>', ' ')
#define lcd_implementation_drawmenu_function(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, ' ', ' ') #define lcd_implementation_drawmenu_function(row, pstr, data) lcd_implementation_drawmenu_generic(row, pstr, ' ', ' ')
static void lcd_implementation_quick_feedback() static void lcd_implementation_quick_feedback() {
{ #if BEEPER > -1
#if BEEPER > -1
SET_OUTPUT(BEEPER); SET_OUTPUT(BEEPER);
for(int8_t i=0;i<10;i++) for(int8_t i=0; i<10; i++) {
{ WRITE(BEEPER,HIGH);
WRITE(BEEPER,HIGH); delay(3);
delay(3); WRITE(BEEPER,LOW);
WRITE(BEEPER,LOW); delay(3);
delay(3);
} }
#endif #endif
} }
#endif//ULTRA_LCD_IMPLEMENTATION_DOGM_H
#endif //__DOGM_LCD_IMPLEMENTATION_H
...@@ -79,7 +79,6 @@ ...@@ -79,7 +79,6 @@
#define MSG_PID_P "PID-P" #define MSG_PID_P "PID-P"
#define MSG_PID_I "PID-I" #define MSG_PID_I "PID-I"
#define MSG_PID_D "PID-D" #define MSG_PID_D "PID-D"
#define MSG_PID_C "PID-C"
#define MSG_ACC "Acel" #define MSG_ACC "Acel"
#define MSG_VXY_JERK "Vxy-jerk" #define MSG_VXY_JERK "Vxy-jerk"
#define MSG_VZ_JERK "Vz-jerk" #define MSG_VZ_JERK "Vz-jerk"
......
...@@ -66,7 +66,6 @@ ...@@ -66,7 +66,6 @@
#define MSG_PID_P "PID-P" #define MSG_PID_P "PID-P"
#define MSG_PID_I "PID-I" #define MSG_PID_I "PID-I"
#define MSG_PID_D "PID-D" #define MSG_PID_D "PID-D"
#define MSG_PID_C "PID-C"
#define MSG_ACC "Accel" #define MSG_ACC "Accel"
#define MSG_VXY_JERK "Vxy-jerk" #define MSG_VXY_JERK "Vxy-jerk"
#define MSG_VZ_JERK "Vz-jerk" #define MSG_VZ_JERK "Vz-jerk"
......
...@@ -79,7 +79,6 @@ ...@@ -79,7 +79,6 @@
#define MSG_PID_P "PID-P" #define MSG_PID_P "PID-P"
#define MSG_PID_I "PID-I" #define MSG_PID_I "PID-I"
#define MSG_PID_D "PID-D" #define MSG_PID_D "PID-D"
#define MSG_PID_C "PID-C"
#define MSG_ACC "Acc" #define MSG_ACC "Acc"
#define MSG_VXY_JERK "Vxy-jerk" #define MSG_VXY_JERK "Vxy-jerk"
#define MSG_VZ_JERK "Vz-jerk" #define MSG_VZ_JERK "Vz-jerk"
......
...@@ -79,7 +79,6 @@ ...@@ -79,7 +79,6 @@
#define MSG_PID_P "PID-P" #define MSG_PID_P "PID-P"
#define MSG_PID_I "PID-I" #define MSG_PID_I "PID-I"
#define MSG_PID_D "PID-D" #define MSG_PID_D "PID-D"
#define MSG_PID_C "PID-C"
#define MSG_ACC "Accel" #define MSG_ACC "Accel"
#define MSG_VXY_JERK "Vxy-jerk" #define MSG_VXY_JERK "Vxy-jerk"
#define MSG_VZ_JERK "Vz-jerk" #define MSG_VZ_JERK "Vz-jerk"
......
...@@ -66,7 +66,6 @@ ...@@ -66,7 +66,6 @@
#define MSG_PID_P "PID-P" #define MSG_PID_P "PID-P"
#define MSG_PID_I "PID-I" #define MSG_PID_I "PID-I"
#define MSG_PID_D "PID-D" #define MSG_PID_D "PID-D"
#define MSG_PID_C "PID-C"
#define MSG_ACC "Acel" #define MSG_ACC "Acel"
#define MSG_VXY_JERK "Vxy-jerk" #define MSG_VXY_JERK "Vxy-jerk"
#define MSG_VZ_JERK "Vz-jerk" #define MSG_VZ_JERK "Vz-jerk"
......
...@@ -66,7 +66,6 @@ ...@@ -66,7 +66,6 @@
#define MSG_PID_P "PID-P" #define MSG_PID_P "PID-P"
#define MSG_PID_I "PID-I" #define MSG_PID_I "PID-I"
#define MSG_PID_D "PID-D" #define MSG_PID_D "PID-D"
#define MSG_PID_C "PID-C"
#define MSG_ACC "Azelerazioa" #define MSG_ACC "Azelerazioa"
#define MSG_VXY_JERK "Vxy-astindua" #define MSG_VXY_JERK "Vxy-astindua"
#define MSG_VZ_JERK "Vz-astindua" #define MSG_VZ_JERK "Vz-astindua"
......
...@@ -79,7 +79,6 @@ ...@@ -79,7 +79,6 @@
#define MSG_PID_P "PID-P" #define MSG_PID_P "PID-P"
#define MSG_PID_I "PID-I" #define MSG_PID_I "PID-I"
#define MSG_PID_D "PID-D" #define MSG_PID_D "PID-D"
#define MSG_PID_C "PID-C"
#define MSG_ACC "Accel" #define MSG_ACC "Accel"
#define MSG_VXY_JERK "Vxy-jerk" #define MSG_VXY_JERK "Vxy-jerk"
#define MSG_VZ_JERK "Vz-jerk" #define MSG_VZ_JERK "Vz-jerk"
......
...@@ -60,9 +60,6 @@ float current_temperature_bed = 0.0; ...@@ -60,9 +60,6 @@ float current_temperature_bed = 0.0;
float Kp[4]; float Kp[4];
float Ki[4]; float Ki[4];
float Kd[4]; float Kd[4];
#ifdef PID_ADD_EXTRUSION_RATE
float Kc;
#endif
#endif //PIDTEMP #endif //PIDTEMP
#ifdef PIDTEMPBED #ifdef PIDTEMPBED
......
...@@ -23,9 +23,7 @@ ...@@ -23,9 +23,7 @@
#include "Marlin.h" #include "Marlin.h"
#include "planner.h" #include "planner.h"
#ifdef PID_ADD_EXTRUSION_RATE
#include "stepper.h"
#endif
// public functions // public functions
void tp_init(); //initialize the heating void tp_init(); //initialize the heating
...@@ -68,7 +66,7 @@ extern float current_temperature_bed; ...@@ -68,7 +66,7 @@ extern float current_temperature_bed;
#endif #endif
#ifdef PIDTEMP #ifdef PIDTEMP
extern float Kp[4],Ki[4],Kd[4],Kc; extern float Kp[4],Ki[4],Kd[4];
float scalePID_i(float i); float scalePID_i(float i);
float scalePID_d(float d); float scalePID_d(float d);
float unscalePID_i(float i); float unscalePID_i(float i);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment