Commit 7b686baf authored by MagoKimbra's avatar MagoKimbra

Fix command M666

parent 0a67ff8a
......@@ -250,9 +250,9 @@
// If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
// IeC HotEnd
#define DEFAULT_Kp 76.42
#define DEFAULT_Ki 14.58
#define DEFAULT_Kd 100.17
#define DEFAULT_Kp 41.51
#define DEFAULT_Ki 7.28
#define DEFAULT_Kd 59.17
// Buda-Style HotEnd 2.0
// #define DEFAULT_Kp 33.24
......
......@@ -73,6 +73,9 @@ void Config_StoreSettings()
EEPROM_WRITE_VAR(i,tower_adj);
EEPROM_WRITE_VAR(i,z_probe_offset);
#endif
#ifdef ENABLE_AUTO_BED_LEVELING
EEPROM_WRITE_VAR(i,zprobe_zoffset);
#endif
#ifndef ULTIPANEL
int plaPreheatHotendTemp = PLA_PREHEAT_HOTEND_TEMP, plaPreheatHPBTemp = PLA_PREHEAT_HPB_TEMP, plaPreheatFanSpeed = PLA_PREHEAT_FAN_SPEED;
int absPreheatHotendTemp = ABS_PREHEAT_HOTEND_TEMP, absPreheatHPBTemp = ABS_PREHEAT_HPB_TEMP, absPreheatFanSpeed = ABS_PREHEAT_FAN_SPEED;
......@@ -87,9 +90,6 @@ void Config_StoreSettings()
EEPROM_WRITE_VAR(i,gumPreheatHotendTemp);
EEPROM_WRITE_VAR(i,gumPreheatHPBTemp);
EEPROM_WRITE_VAR(i,gumPreheatFanSpeed);
#if defined(CARTESIAN) || defined(COREXY) || defined(SCARA)
EEPROM_WRITE_VAR(i,zprobe_zoffset);
#endif
#ifdef PIDTEMP
EEPROM_WRITE_VAR(i,Kp);
EEPROM_WRITE_VAR(i,Ki);
......@@ -231,11 +231,13 @@ void Config_PrintSettings()
SERIAL_ECHOPAIR(" Y:",delta_tower3_y);
SERIAL_ECHOLN("");
*/
#else // no DELTA
#endif // DELTA
#ifdef ENABLE_AUTO_BED_LEVELING
SERIAL_ECHO_START;
SERIAL_ECHOPAIR("Z Probe offset (mm):" ,zprobe_zoffset);
SERIAL_ECHOLN("");
#endif // DELTA
#endif // ENABLE_AUTO_BED_LEVELING
#ifdef PIDTEMP
SERIAL_ECHO_START;
......@@ -287,6 +289,9 @@ void Config_RetrieveSettings()
// Update delta constants for updated delta_radius & tower_adj values
set_delta_constants();
#endif
#ifdef ENABLE_AUTO_BED_LEVELING
EEPROM_READ_VAR(i,zprobe_zoffset);
#endif
#ifndef ULTIPANEL
int plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed;
int absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed;
......@@ -301,9 +306,6 @@ void Config_RetrieveSettings()
EEPROM_READ_VAR(i,gumPreheatHotendTemp);
EEPROM_READ_VAR(i,gumPreheatHPBTemp);
EEPROM_READ_VAR(i,gumPreheatFanSpeed);
#if defined(CARTESIAN) || defined(COREXY) || defined(SCARA)
EEPROM_READ_VAR(i,zprobe_zoffset);
#endif
#ifndef PIDTEMP
float Kp,Ki,Kd;
#endif
......
......@@ -174,7 +174,7 @@
// M540 - Use S[0|1] to enable or disable the stop SD card print on endstop hit (requires ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
// M600 - Pause for filament change X[pos] Y[pos] Z[relative lift] E[initial retract] L[later retract distance for removal]
// M605 - Set dual x-carriage movement mode: S<mode> [ X<duplication x-offset> R<duplication temp offset> ]
// M666 - Endstop and delta geometry adjustment
// M666 - Set z probe offset or Endstop and delta geometry adjustment
// M907 - Set digital trimpot motor current using axis codes.
// M908 - Control digital trimpot directly.
// M350 - Set microstepping mode.
......@@ -3940,6 +3940,18 @@ Sigma_Exit:
#endif
break;
#ifdef ENABLE_AUTO_BED_LEVELING
case 666: // M666 Set Z probe offset
if (code_seen('P')) {
zprobe_zoffset = code_value();
}
if (code_seen('L')) {
SERIAL_ECHOPAIR("P (Z-Probe Offset):", zprobe_zoffset);
SERIAL_ECHOLN("");
}
break;
#endif // ENABLE_AUTO_BED_LEVELING
#ifdef DELTA
case 666: // M666 set delta endstop and geometry adjustment
if ( !(code_seen('P'))) {
......
......@@ -208,7 +208,7 @@ M Codes
* M540 - Use S[0|1] to enable or disable the stop SD card print on endstop hit (requires ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
* M600 - Pause for filament change X[pos] Y[pos] Z[relative lift] E[initial retract] L[later retract distance for removal]
* M605 - Set dual x-carriage movement mode: S<mode> [ X<duplication x-offset> R<duplication temp offset> ]
* M666 - Endstop and delta geometry adjustment
* M666 - Set z probe offset or Endstop and delta geometry adjustment
* M907 - Set digital trimpot motor current using axis codes.
* M908 - Control digital trimpot directly.
* M350 - Set microstepping mode.
......
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