// Comment the following line to disable PID and enable bang-bang.
#define PIDTEMP
//#define PID_DEBUG // Sends debug data to the serial port.
//#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
//#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
//#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
//#define PID_DEBUG // Sends debug data to the serial port.
//#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
//#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
// If the temperature difference between the target temperature and the actual temperature
// is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
#define PID_FUNCTIONAL_RANGE 10 // degC
...
...
@@ -1092,7 +1093,7 @@
//#define INVERT_CLICK_BUTTON // Option for invert encoder button logic
//#define INVERT_BACK_BUTTON // Option for invert back button logic if avaible
//#define INVERT_ROTARY_SWITCH // Option for invert rotary encoder
//#define INVERT_ROTARY_SWITCH // Option for reverses the encoder direction for navigating LCD menus.
#define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value
#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value
DEBUG_ECHO=_BV(0),///< Echo commands in order as they are processed
DEBUG_INFO=_BV(1),///< Print messages for code that has debug output
DEBUG_ERRORS=_BV(2),///< Not implemented
DEBUG_DRYRUN=_BV(3),///< Ignore temperature setting
DEBUG_COMMUNICATION=_BV(4),///< Not implemented
DEBUG_DEBUG=_BV(5)///< Print Debug
};
externuint8_tmk_debug_flags;
voidclamp_to_software_endstops(floattarget[3]);
externuint8_tdebugLevel;
externboolRunning;
inlineboolIsRunning(){returnRunning;}
inlineboolIsStopped(){return!Running;}
externboolPrinting;
boolenqueuecommand(constchar*cmd);//put a single ASCII command at the end of the current buffer or return false when it is full
voidenqueuecommands_P(constchar*cmd);//put one or many ASCII commands at the end of the current buffer, read from flash
boolenqueue_and_echo_command(constchar*cmd,boolsay_ok=false);// put a single ASCII command at the end of the current buffer or return false when it is full
voidenqueue_and_echo_command_now(constchar*cmd);// enqueue now, only return when the command has been enqueued
voidenqueue_and_echo_commands_P(constchar*cmd);// put one or many ASCII commands at the end of the current buffer, read from flash
#define SERIAL_ERR_LONG_EXTRUDE_STOP "too long extrusion prevented"
#define SERIAL_MICROSTEP_MS1_MS2 "MS1,MS2 Pins"
#define SERIAL_MICROSTEP_X "X:"
#define SERIAL_MICROSTEP_Y "Y:"
...
...
@@ -178,14 +201,14 @@
#define SERIAL_KU " Ku: "
#define SERIAL_TU " Tu: "
#define SERIAL_CLASSIC_PID " Classic PID "
#define SERIAL_KP "Kp: "
#define SERIAL_KP "Kp: "
#define SERIAL_KI " Ki: "
#define SERIAL_KD " Kd: "
#define SERIAL_B "B:"
#define SERIAL_T "T:"
#define SERIAL_AT "@"
#define SERIAL_BAT "B@:"
#define SERIAL_W "W:"
#define SERIAL_T " T:"
#define SERIAL_B " B:"
#define SERIAL_AT "@"
#define SERIAL_BAT "B@:"
#define SERIAL_W "W:"
#define SERIAL_PID_AUTOTUNE_FINISHED SERIAL_PID_AUTOTUNE " finished! Put the last Kp, Ki and Kd constants from above into Configuration.h or send command M500 for save in EEPROM the new value!"
menuFunc_tcurrentMenu=lcd_status_screen;/* function pointer to the currently active menu */
menuPositionmenu_history[10];
uint8_tmenu_history_depth=0;
millis_tnext_lcd_update_ms;
uint8_tlcd_status_update_delay;
boolignore_click=false;
boolwait_for_unclick;
uint8_tlcdDrawUpdate=2;/* Set to none-zero when the LCD needs to draw, decreased after every draw. Set to 2 in LCD routines so the LCD gets at least 1 full redraw (first redraw is partial) */
booldefer_return_to_status=false;
enumLCDViewAction{
LCDVIEW_NONE,
LCDVIEW_REDRAW_NOW,
LCDVIEW_CALL_REDRAW_NEXT,
LCDVIEW_CLEAR_CALL_REDRAW,
LCDVIEW_CALL_NO_REDRAW
};
uint8_tlcdDrawUpdate=LCDVIEW_CLEAR_CALL_REDRAW;// Set when the LCD needs to draw, decrements after every draw. Set to 2 in LCD routines so the LCD gets at least 1 full redraw (first redraw is partial)
//prevMenu and prevEncoderPosition are used to store the previous menu location when editing settings.
* The "menu_edit_type" macro generates the functions needed to edit a numerical value.
*
* For example, menu_edit_type(int, int3, itostr3, 1) expands into these functions:
*
* bool _menu_edit_int3();
* void menu_edit_int3(); // edit int (interactively)
* void menu_edit_callback_int3(); // edit int (interactively) with callback on completion
* static void _menu_action_setting_edit_int3(const char* pstr, int* ptr, int minValue, int maxValue);
* static void menu_action_setting_edit_int3(const char* pstr, int* ptr, int minValue, int maxValue);
* static void menu_action_setting_edit_callback_int3(const char* pstr, int* ptr, int minValue, int maxValue, menuFunc_t callback); // edit int with callback
*
* You can then use one of the menu macros to present the edit interface: