Individual extruder flow rate

Extension of M221, Tune menu
This commit is contained in:
Dim3nsioneer 2014-03-15 18:09:46 +01:00
parent 8613a74443
commit 3906f27c46
4 changed files with 72 additions and 2 deletions

View File

@ -203,7 +203,8 @@ void setPwmFrequency(uint8_t pin, int val);
extern float homing_feedrate[]; extern float homing_feedrate[];
extern bool axis_relative_modes[]; extern bool axis_relative_modes[];
extern int feedmultiply; extern int feedmultiply;
extern int extrudemultiply; // Sets extrude multiply factor (in percent) extern int extrudemultiply; // Sets extrude multiply factor (in percent) for all extruders
extern int extruder_multiply[EXTRUDERS]; // sets extrude multiply factor (in percent) for each extruder individually
extern float volumetric_multiplier[EXTRUDERS]; // reciprocal of cross-sectional area of filament (in square millimeters), stored this way to reduce computational burden in planner extern float volumetric_multiplier[EXTRUDERS]; // reciprocal of cross-sectional area of filament (in square millimeters), stored this way to reduce computational burden in planner
extern float current_position[NUM_AXIS] ; extern float current_position[NUM_AXIS] ;
extern float add_homeing[3]; extern float add_homeing[3];

View File

@ -189,6 +189,14 @@ bool axis_relative_modes[] = AXIS_RELATIVE_MODES;
int feedmultiply=100; //100->1 200->2 int feedmultiply=100; //100->1 200->2
int saved_feedmultiply; int saved_feedmultiply;
int extrudemultiply=100; //100->1 200->2 int extrudemultiply=100; //100->1 200->2
int extruder_multiply[EXTRUDERS] = {100
#if EXTRUDERS > 1
, 100
#if EXTRUDERS > 2
, 100
#endif
#endif
};
float volumetric_multiplier[EXTRUDERS] = {1.0 float volumetric_multiplier[EXTRUDERS] = {1.0
#if EXTRUDERS > 1 #if EXTRUDERS > 1
, 1.0 , 1.0
@ -2426,7 +2434,18 @@ void process_commands()
{ {
if(code_seen('S')) if(code_seen('S'))
{ {
extrudemultiply = code_value() ; int tmp_code = code_value();
if (code_seen('T'))
{
if(setTargetedHotend(221)){
break;
}
extruder_multiply[tmp_extruder] = tmp_code;
}
else
{
extrudemultiply = tmp_code ;
}
} }
} }
break; break;
@ -3546,6 +3565,9 @@ bool setTargetedHotend(int code){
case 218: case 218:
SERIAL_ECHO(MSG_M218_INVALID_EXTRUDER); SERIAL_ECHO(MSG_M218_INVALID_EXTRUDER);
break; break;
case 221:
SERIAL_ECHO(MSG_M221_INVALID_EXTRUDER);
break;
} }
SERIAL_ECHOLN(tmp_extruder); SERIAL_ECHOLN(tmp_extruder);
return true; return true;

View File

@ -100,6 +100,9 @@
#define MSG_BED "Bed" #define MSG_BED "Bed"
#define MSG_FAN_SPEED "Fan speed" #define MSG_FAN_SPEED "Fan speed"
#define MSG_FLOW "Flow" #define MSG_FLOW "Flow"
#define MSG_FLOW0 "Flow 0"
#define MSG_FLOW1 "Flow 1"
#define MSG_FLOW2 "Flow 2"
#define MSG_CONTROL "Control" #define MSG_CONTROL "Control"
#define MSG_MIN " \002 Min" #define MSG_MIN " \002 Min"
#define MSG_MAX " \002 Max" #define MSG_MAX " \002 Max"
@ -192,6 +195,7 @@
#define MSG_M105_INVALID_EXTRUDER "M105 Invalid extruder " #define MSG_M105_INVALID_EXTRUDER "M105 Invalid extruder "
#define MSG_M200_INVALID_EXTRUDER "M200 Invalid extruder " #define MSG_M200_INVALID_EXTRUDER "M200 Invalid extruder "
#define MSG_M218_INVALID_EXTRUDER "M218 Invalid extruder " #define MSG_M218_INVALID_EXTRUDER "M218 Invalid extruder "
#define MSG_M221_INVALID_EXTRUDER "M221 Invalid extruder "
#define MSG_ERR_NO_THERMISTORS "No thermistors - no temperature" #define MSG_ERR_NO_THERMISTORS "No thermistors - no temperature"
#define MSG_M109_INVALID_EXTRUDER "M109 Invalid extruder " #define MSG_M109_INVALID_EXTRUDER "M109 Invalid extruder "
#define MSG_HEATING "Heating..." #define MSG_HEATING "Heating..."
@ -283,6 +287,9 @@
#define MSG_BED "Loze" #define MSG_BED "Loze"
#define MSG_FAN_SPEED "Obroty wiatraka" #define MSG_FAN_SPEED "Obroty wiatraka"
#define MSG_FLOW "Przeplyw" #define MSG_FLOW "Przeplyw"
#define MSG_FLOW0 "Przeplyw 0"
#define MSG_FLOW1 "Przeplyw 1"
#define MSG_FLOW2 "Przeplyw 2"
#define MSG_CONTROL "Kontrola" #define MSG_CONTROL "Kontrola"
#define MSG_MIN " \002 Min" #define MSG_MIN " \002 Min"
#define MSG_MAX " \002 Max" #define MSG_MAX " \002 Max"
@ -378,6 +385,7 @@
#define MSG_M105_INVALID_EXTRUDER "M105 Niepoprawny ekstruder " #define MSG_M105_INVALID_EXTRUDER "M105 Niepoprawny ekstruder "
#define MSG_M200_INVALID_EXTRUDER "M200 Niepoprawny ekstruder " #define MSG_M200_INVALID_EXTRUDER "M200 Niepoprawny ekstruder "
#define MSG_M218_INVALID_EXTRUDER "M218 Niepoprawny ekstruder " #define MSG_M218_INVALID_EXTRUDER "M218 Niepoprawny ekstruder "
#define MSG_M221_INVALID_EXTRUDER "M221 Niepoprawny ekstruder "
#define MSG_ERR_NO_THERMISTORS "Brak termistorow - brak temperatury :(" #define MSG_ERR_NO_THERMISTORS "Brak termistorow - brak temperatury :("
#define MSG_M109_INVALID_EXTRUDER "M109 Niepoprawny ekstruder " #define MSG_M109_INVALID_EXTRUDER "M109 Niepoprawny ekstruder "
#define MSG_HEATING "Nagrzewanie ekstrudera..." #define MSG_HEATING "Nagrzewanie ekstrudera..."
@ -470,6 +478,9 @@
#define MSG_BED "Plateau" #define MSG_BED "Plateau"
#define MSG_FAN_SPEED "Vite. ventilateur" #define MSG_FAN_SPEED "Vite. ventilateur"
#define MSG_FLOW "Flux" #define MSG_FLOW "Flux"
#define MSG_FLOW0 "Flux 0"
#define MSG_FLOW1 "Flux 1"
#define MSG_FLOW2 "Flux 2"
#define MSG_CONTROL "Controler" #define MSG_CONTROL "Controler"
#define MSG_MIN " \002 Min" #define MSG_MIN " \002 Min"
#define MSG_MAX " \002 Max" #define MSG_MAX " \002 Max"
@ -563,6 +574,7 @@
#define MSG_M105_INVALID_EXTRUDER "M105 Extruder invalide" #define MSG_M105_INVALID_EXTRUDER "M105 Extruder invalide"
#define MSG_M200_INVALID_EXTRUDER "M200 Extruder invalide" #define MSG_M200_INVALID_EXTRUDER "M200 Extruder invalide"
#define MSG_M218_INVALID_EXTRUDER "M218 Extruder invalide" #define MSG_M218_INVALID_EXTRUDER "M218 Extruder invalide"
#define MSG_M221_INVALID_EXTRUDER "M221 Extruder invalide"
#define MSG_ERR_NO_THERMISTORS "Pas de thermistor, pas de temperature" #define MSG_ERR_NO_THERMISTORS "Pas de thermistor, pas de temperature"
#define MSG_M109_INVALID_EXTRUDER "M109 Extruder invalide " #define MSG_M109_INVALID_EXTRUDER "M109 Extruder invalide "
#define MSG_HEATING "En chauffe..." #define MSG_HEATING "En chauffe..."
@ -654,6 +666,9 @@
#define MSG_BED "Bett" #define MSG_BED "Bett"
#define MSG_FAN_SPEED "Lüftergeschw." #define MSG_FAN_SPEED "Lüftergeschw."
#define MSG_FLOW "Fluss" #define MSG_FLOW "Fluss"
#define MSG_FLOW0 "Fluss 0"
#define MSG_FLOW1 "Fluss 1"
#define MSG_FLOW2 "Fluss 2"
#define MSG_CONTROL "Einstellungen" #define MSG_CONTROL "Einstellungen"
#define MSG_MIN "\002 Min" #define MSG_MIN "\002 Min"
#define MSG_MAX "\002 Max" #define MSG_MAX "\002 Max"
@ -749,6 +764,7 @@
#define MSG_M105_INVALID_EXTRUDER "M105 Invalid extruder " #define MSG_M105_INVALID_EXTRUDER "M105 Invalid extruder "
#define MSG_M200_INVALID_EXTRUDER "M200 Invalid extruder " #define MSG_M200_INVALID_EXTRUDER "M200 Invalid extruder "
#define MSG_M218_INVALID_EXTRUDER "M218 Invalid extruder " #define MSG_M218_INVALID_EXTRUDER "M218 Invalid extruder "
#define MSG_M221_INVALID_EXTRUDER "M221 Invalid extruder "
#define MSG_ERR_NO_THERMISTORS "No thermistors - no temp" #define MSG_ERR_NO_THERMISTORS "No thermistors - no temp"
#define MSG_M109_INVALID_EXTRUDER "M109 Invalid extruder " #define MSG_M109_INVALID_EXTRUDER "M109 Invalid extruder "
#define MSG_HEATING "Heating..." #define MSG_HEATING "Heating..."
@ -839,6 +855,9 @@
#define MSG_BED "Base" #define MSG_BED "Base"
#define MSG_FAN_SPEED "Ventilador" #define MSG_FAN_SPEED "Ventilador"
#define MSG_FLOW "Flujo" #define MSG_FLOW "Flujo"
#define MSG_FLOW0 "Flujo 0"
#define MSG_FLOW1 "Flujo 1"
#define MSG_FLOW2 "Flujo 2"
#define MSG_CONTROL "Control" #define MSG_CONTROL "Control"
#define MSG_MIN "\002 Min" #define MSG_MIN "\002 Min"
#define MSG_MAX "\002 Max" #define MSG_MAX "\002 Max"
@ -940,6 +959,7 @@
#define MSG_M105_INVALID_EXTRUDER "M105 Extrusor Invalido " #define MSG_M105_INVALID_EXTRUDER "M105 Extrusor Invalido "
#define MSG_M200_INVALID_EXTRUDER "M200 Extrusor Invalido " #define MSG_M200_INVALID_EXTRUDER "M200 Extrusor Invalido "
#define MSG_M218_INVALID_EXTRUDER "M218 Extrusor Invalido " #define MSG_M218_INVALID_EXTRUDER "M218 Extrusor Invalido "
#define MSG_M221_INVALID_EXTRUDER "M221 Extrusor Invalido "
#define MSG_ERR_NO_THERMISTORS "No hay termistores - no temp" #define MSG_ERR_NO_THERMISTORS "No hay termistores - no temp"
#define MSG_M109_INVALID_EXTRUDER "M109 Extrusor Invalido " #define MSG_M109_INVALID_EXTRUDER "M109 Extrusor Invalido "
#define MSG_HEATING "Calentando..." #define MSG_HEATING "Calentando..."
@ -1029,6 +1049,9 @@
#define MSG_BED "\002 Кровать:" #define MSG_BED "\002 Кровать:"
#define MSG_FAN_SPEED "Куллер:" #define MSG_FAN_SPEED "Куллер:"
#define MSG_FLOW "Поток:" #define MSG_FLOW "Поток:"
#define MSG_FLOW0 " Поток0:"
#define MSG_FLOW1 " Поток1:"
#define MSG_FLOW2 " Поток2:"
#define MSG_CONTROL "Настройки \003" #define MSG_CONTROL "Настройки \003"
#define MSG_MIN "\002 Минимум:" #define MSG_MIN "\002 Минимум:"
#define MSG_MAX "\002 Максимум:" #define MSG_MAX "\002 Максимум:"
@ -1122,6 +1145,7 @@
#define MSG_M105_INVALID_EXTRUDER "M105 ошибка экструдера " #define MSG_M105_INVALID_EXTRUDER "M105 ошибка экструдера "
#define MSG_M200_INVALID_EXTRUDER "M200 ошибка экструдера " #define MSG_M200_INVALID_EXTRUDER "M200 ошибка экструдера "
#define MSG_M218_INVALID_EXTRUDER "M218 ошибка экструдера " #define MSG_M218_INVALID_EXTRUDER "M218 ошибка экструдера "
#define MSG_M221_INVALID_EXTRUDER "M221 ошибка экструдера "
#define MSG_ERR_NO_THERMISTORS "Нет термистра - нет температуры" #define MSG_ERR_NO_THERMISTORS "Нет термистра - нет температуры"
#define MSG_M109_INVALID_EXTRUDER "M109 ошибка экструдера " #define MSG_M109_INVALID_EXTRUDER "M109 ошибка экструдера "
#define MSG_HEATING "Нагрев... " #define MSG_HEATING "Нагрев... "
@ -1210,6 +1234,9 @@
#define MSG_BED "Piatto" #define MSG_BED "Piatto"
#define MSG_FAN_SPEED "Ventola" #define MSG_FAN_SPEED "Ventola"
#define MSG_FLOW "Flusso" #define MSG_FLOW "Flusso"
#define MSG_FLOW0 "Flusso 0"
#define MSG_FLOW1 "Flusso 1"
#define MSG_FLOW2 "Flusso 2"
#define MSG_CONTROL "Controllo" #define MSG_CONTROL "Controllo"
#define MSG_MIN " \002 Min:" #define MSG_MIN " \002 Min:"
#define MSG_MAX " \002 Max:" #define MSG_MAX " \002 Max:"
@ -1303,6 +1330,7 @@
#define MSG_M105_INVALID_EXTRUDER "M105 Estrusore non valido " #define MSG_M105_INVALID_EXTRUDER "M105 Estrusore non valido "
#define MSG_M200_INVALID_EXTRUDER "M200 Estrusore non valido " #define MSG_M200_INVALID_EXTRUDER "M200 Estrusore non valido "
#define MSG_M218_INVALID_EXTRUDER "M218 Estrusore non valido " #define MSG_M218_INVALID_EXTRUDER "M218 Estrusore non valido "
#define MSG_M221_INVALID_EXTRUDER "M221 Estrusore non valido "
#define MSG_ERR_NO_THERMISTORS "Nessun Termistore - nessuna temperatura" #define MSG_ERR_NO_THERMISTORS "Nessun Termistore - nessuna temperatura"
#define MSG_M109_INVALID_EXTRUDER "M109 Estrusore non valido " #define MSG_M109_INVALID_EXTRUDER "M109 Estrusore non valido "
#define MSG_HEATING "Riscaldamento..." #define MSG_HEATING "Riscaldamento..."
@ -1395,6 +1423,9 @@
#define MSG_BED "\002Base:" #define MSG_BED "\002Base:"
#define MSG_FAN_SPEED "Velocidade vento." #define MSG_FAN_SPEED "Velocidade vento."
#define MSG_FLOW "Fluxo:" #define MSG_FLOW "Fluxo:"
#define MSG_FLOW0 "Fluxo0:"
#define MSG_FLOW1 "Fluxo1:"
#define MSG_FLOW2 "Fluxo2:"
#define MSG_CONTROL "Controle \003" #define MSG_CONTROL "Controle \003"
#define MSG_MIN "\002 Min:" #define MSG_MIN "\002 Min:"
#define MSG_MAX "\002 Max:" #define MSG_MAX "\002 Max:"
@ -1492,6 +1523,7 @@
#define MSG_M105_INVALID_EXTRUDER "M105 Extrusor inválido " #define MSG_M105_INVALID_EXTRUDER "M105 Extrusor inválido "
#define MSG_M200_INVALID_EXTRUDER "M200 Extrusor inválido " #define MSG_M200_INVALID_EXTRUDER "M200 Extrusor inválido "
#define MSG_M218_INVALID_EXTRUDER "M218 Extrusor inválido " #define MSG_M218_INVALID_EXTRUDER "M218 Extrusor inválido "
#define MSG_M221_INVALID_EXTRUDER "M221 Extrusor inválido "
#define MSG_ERR_NO_THERMISTORS "Nao ha termistor - no temp" #define MSG_ERR_NO_THERMISTORS "Nao ha termistor - no temp"
#define MSG_M109_INVALID_EXTRUDER "M109 Extrusor inválido " #define MSG_M109_INVALID_EXTRUDER "M109 Extrusor inválido "
#define MSG_HEATING "Aquecendo..." #define MSG_HEATING "Aquecendo..."
@ -1583,6 +1615,9 @@
#define MSG_BED "Alusta" #define MSG_BED "Alusta"
#define MSG_FAN_SPEED "Tuul. nopeus" #define MSG_FAN_SPEED "Tuul. nopeus"
#define MSG_FLOW "Virtaus" #define MSG_FLOW "Virtaus"
#define MSG_FLOW0 "Virtaus 0"
#define MSG_FLOW1 "Virtaus 1"
#define MSG_FLOW2 "Virtaus 2"
#define MSG_CONTROL "Kontrolli" #define MSG_CONTROL "Kontrolli"
#define MSG_MIN " \002 Min" #define MSG_MIN " \002 Min"
#define MSG_MAX " \002 Max" #define MSG_MAX " \002 Max"
@ -1675,6 +1710,7 @@
#define MSG_M105_INVALID_EXTRUDER "M105 Virheellinen suutin " #define MSG_M105_INVALID_EXTRUDER "M105 Virheellinen suutin "
#define MSG_M200_INVALID_EXTRUDER "M200 Virheellinen suutin " #define MSG_M200_INVALID_EXTRUDER "M200 Virheellinen suutin "
#define MSG_M218_INVALID_EXTRUDER "M218 Virheellinen suutin " #define MSG_M218_INVALID_EXTRUDER "M218 Virheellinen suutin "
#define MSG_M221_INVALID_EXTRUDER "M221 Virheellinen suutin "
#define MSG_ERR_NO_THERMISTORS "Ei termistoreja - ei lampotiloja" #define MSG_ERR_NO_THERMISTORS "Ei termistoreja - ei lampotiloja"
#define MSG_M109_INVALID_EXTRUDER "M109 Virheellinen suutin " #define MSG_M109_INVALID_EXTRUDER "M109 Virheellinen suutin "
#define MSG_HEATING "Lammitan..." #define MSG_HEATING "Lammitan..."
@ -1766,6 +1802,9 @@
#define MSG_BED "Base" #define MSG_BED "Base"
#define MSG_FAN_SPEED "Ixoriador" #define MSG_FAN_SPEED "Ixoriador"
#define MSG_FLOW "Fluxo" #define MSG_FLOW "Fluxo"
#define MSG_FLOW0 "Fluxo 0"
#define MSG_FLOW1 "Fluxo 1"
#define MSG_FLOW2 "Fluxo 2"
#define MSG_CONTROL "Control" #define MSG_CONTROL "Control"
#define MSG_MIN "\002 Min" #define MSG_MIN "\002 Min"
#define MSG_MAX "\002 Max" #define MSG_MAX "\002 Max"
@ -1867,6 +1906,7 @@
#define MSG_M105_INVALID_EXTRUDER "M105 Extrusor Invalido " #define MSG_M105_INVALID_EXTRUDER "M105 Extrusor Invalido "
#define MSG_M200_INVALID_EXTRUDER "M200 Extrusor Invalido " #define MSG_M200_INVALID_EXTRUDER "M200 Extrusor Invalido "
#define MSG_M218_INVALID_EXTRUDER "M218 Extrusor Invalido " #define MSG_M218_INVALID_EXTRUDER "M218 Extrusor Invalido "
#define MSG_M221_INVALID_EXTRUDER "M221 Extrusor Invalido "
#define MSG_ERR_NO_THERMISTORS "No i hai termistores - no temp" #define MSG_ERR_NO_THERMISTORS "No i hai termistores - no temp"
#define MSG_M109_INVALID_EXTRUDER "M109 Extrusor Invalido " #define MSG_M109_INVALID_EXTRUDER "M109 Extrusor Invalido "
#define MSG_HEATING "Calentando..." #define MSG_HEATING "Calentando..."

View File

@ -414,6 +414,13 @@ static void lcd_tune_menu()
#endif #endif
MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &fanSpeed, 0, 255); MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &fanSpeed, 0, 255);
MENU_ITEM_EDIT(int3, MSG_FLOW, &extrudemultiply, 10, 999); MENU_ITEM_EDIT(int3, MSG_FLOW, &extrudemultiply, 10, 999);
MENU_ITEM_EDIT(int3, MSG_FLOW0, &extruder_multiply[0], 10, 999);
#if TEMP_SENSOR_1 != 0
MENU_ITEM_EDIT(int3, MSG_FLOW1, &extruder_multiply[1], 10, 999);
#endif
#if TEMP_SENSOR_2 != 0
MENU_ITEM_EDIT(int3, MSG_FLOW2, &extruder_multiply[2], 10, 999);
#endif
#ifdef BABYSTEPPING #ifdef BABYSTEPPING
#ifdef BABYSTEP_XY #ifdef BABYSTEP_XY