From 10601a932ace48207f7597b1cfaecf73aa48f817 Mon Sep 17 00:00:00 2001 From: Per Ivar Nerseth Date: Mon, 15 Jun 2020 03:09:25 +0200 Subject: [PATCH] Zonestar P802M bed thermistor (#18289) Co-authored-by: Scott Lahteine --- Marlin/src/lcd/thermistornames.h | 2 + Marlin/src/module/thermistor/thermistor_502.h | 60 +++++++++++++++++++ Marlin/src/module/thermistor/thermistors.h | 3 + Marlin/src/pins/pins.h | 2 +- platformio.ini | 10 ++++ 5 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 Marlin/src/module/thermistor/thermistor_502.h diff --git a/Marlin/src/lcd/thermistornames.h b/Marlin/src/lcd/thermistornames.h index 7a464c30ab..f347460638 100644 --- a/Marlin/src/lcd/thermistornames.h +++ b/Marlin/src/lcd/thermistornames.h @@ -60,6 +60,8 @@ #define THERMISTOR_NAME "ATC 104GT-2" #elif THERMISTOR_ID == 501 #define THERMISTOR_NAME "Zonestar (Tronxy X3A)" +#elif THERMISTOR_ID == 502 + #define THERMISTOR_NAME "Zonestar (P802M Hot Bed)" #elif THERMISTOR_ID == 512 #define THERMISTOR_NAME "RPW-Ultra" #elif THERMISTOR_ID == 6 diff --git a/Marlin/src/module/thermistor/thermistor_502.h b/Marlin/src/module/thermistor/thermistor_502.h new file mode 100644 index 0000000000..1a4019ed5c --- /dev/null +++ b/Marlin/src/module/thermistor/thermistor_502.h @@ -0,0 +1,60 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +// Unknown thermistor for the Zonestar P802M hot bed. Adjusted By Nerseth +// These were the shipped settings from Zonestar in original firmware: P802M_8_Repetier_V1.6_Zonestar.zip +const short temptable_502[][2] PROGMEM = { + { OV( 56.0 / 4), 300 }, + { OV( 187.0 / 4), 250 }, + { OV( 615.0 / 4), 190 }, + { OV( 690.0 / 4), 185 }, + { OV( 750.0 / 4), 180 }, + { OV( 830.0 / 4), 175 }, + { OV( 920.0 / 4), 170 }, + { OV(1010.0 / 4), 165 }, + { OV(1118.0 / 4), 160 }, + { OV(1215.0 / 4), 155 }, + { OV(1330.0 / 4), 145 }, + { OV(1460.0 / 4), 140 }, + { OV(1594.0 / 4), 135 }, + { OV(1752.0 / 4), 130 }, + { OV(1900.0 / 4), 125 }, + { OV(2040.0 / 4), 120 }, + { OV(2200.0 / 4), 115 }, + { OV(2350.0 / 4), 110 }, + { OV(2516.0 / 4), 105 }, + { OV(2671.0 / 4), 98 }, + { OV(2831.0 / 4), 92 }, + { OV(2975.0 / 4), 85 }, + { OV(3115.0 / 4), 76 }, + { OV(3251.0 / 4), 72 }, + { OV(3480.0 / 4), 62 }, + { OV(3580.0 / 4), 52 }, + { OV(3660.0 / 4), 46 }, + { OV(3740.0 / 4), 40 }, + { OV(3869.0 / 4), 30 }, + { OV(3912.0 / 4), 25 }, + { OV(3948.0 / 4), 20 }, + { OV(4077.0 / 4), -20 }, + { OV(4094.0 / 4), -55 } +}; diff --git a/Marlin/src/module/thermistor/thermistors.h b/Marlin/src/module/thermistor/thermistors.h index 106adef6cc..04b091b2a0 100644 --- a/Marlin/src/module/thermistor/thermistors.h +++ b/Marlin/src/module/thermistor/thermistors.h @@ -70,6 +70,9 @@ #if ANY_THERMISTOR_IS(501) // 100K Zonestar thermistor #include "thermistor_501.h" #endif +#if ANY_THERMISTOR_IS(502) // Unknown thermistor used by the Zonestar Prusa P802M hot bed + #include "thermistor_502.h" +#endif #if ANY_THERMISTOR_IS(512) // 100k thermistor in RPW-Ultra hotend, Pull-up = 4.7 kOhm, "unknown model" #include "thermistor_512.h" #endif diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 64e19e8410..f134f92216 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -291,7 +291,7 @@ #elif MB(MELZI_MAKR3D) #include "sanguino/pins_MELZI_MAKR3D.h" // ATmega644P, ATmega1284P env:sanguino644p env:sanguino1284p #elif MB(MELZI_CREALITY) - #include "sanguino/pins_MELZI_CREALITY.h" // ATmega1284P env:melzi env:melzi_optiboot + #include "sanguino/pins_MELZI_CREALITY.h" // ATmega1284P env:melzi env:melzi_optimized env:melzi_optiboot #elif MB(MELZI_MALYAN) #include "sanguino/pins_MELZI_MALYAN.h" // ATmega644P, ATmega1284P env:sanguino644p env:sanguino1284p #elif MB(MELZI_TRONXY) diff --git a/platformio.ini b/platformio.ini index cfd04e26cb..3b64e717f2 100644 --- a/platformio.ini +++ b/platformio.ini @@ -166,6 +166,16 @@ platform = atmelavr extends = env:melzi upload_speed = 115200 +# +# Melzi and clones (Zonestar Melzi2 with tuned flags) +# +[env:melzi_optimized] +platform = atmelavr +extends = env:melzi +upload_speed = 115200 +build_flags = ${common.build_flags} -fno-tree-scev-cprop -fno-split-wide-types -Wl,--relax -mcall-prologues +build_unflags = -g -ggdb + # # AT90USB1286 boards using CDC bootloader # - BRAINWAVE