summaryrefslogtreecommitdiff
path: root/Sprinter/heater.h
diff options
context:
space:
mode:
authormidopple <mdoppler@gmx.at>2012-01-29 00:18:21 +0100
committermidopple <mdoppler@gmx.at>2012-01-29 00:18:21 +0100
commit76bbfb39ae3c46a874ace54b6d645810cc37d7ac (patch)
tree59f3610687ab46a1bc7187f5621caaf959cd3d7f /Sprinter/heater.h
parent8d17b09475758d18c5270afbee51ac33a403f8a3 (diff)
New Version Sprinter V2
- Look Vorward Funktion - - Stepper Control with Timer 1 - SOFT PWM for Extruder heating --> Free Timer 1 - G2 / G3 Command for arc real arc - Baudrate 250 kbaud - M30 Command delete file on SD Card - Text moved to flash to free RAM - M203 Command for Temp debugging
Diffstat (limited to 'Sprinter/heater.h')
-rw-r--r--Sprinter/heater.h119
1 files changed, 119 insertions, 0 deletions
diff --git a/Sprinter/heater.h b/Sprinter/heater.h
new file mode 100644
index 0000000..5470a4f
--- /dev/null
+++ b/Sprinter/heater.h
@@ -0,0 +1,119 @@
+/*
+ Reprap heater funtions based on Sprinter
+
+ 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 <http://www.gnu.org/licenses/>. */
+
+/*
+ This softwarepart for Heatercontrol is based on Sprinter
+ big thanks to kliment (https://github.com/kliment/Sprinter)
+
+*/
+
+
+#include "Configuration.h"
+#include "thermistortables.h"
+
+#if defined HEATER_USES_THERMISTOR
+#define temp2analogh( c ) temp2analog_thermistor(c,temptable,NUMTEMPS)
+#define analog2temp( c ) analog2temp_thermistor(c,temptable,NUMTEMPS)
+#elif defined HEATER_USES_AD595
+#define temp2analogh( c ) temp2analog_ad595(c)
+#define analog2temp( c ) analog2temp_ad595(c)
+#elif defined HEATER_USES_MAX6675
+#define temp2analogh( c ) temp2analog_max6675(c)
+#define analog2temp( c ) analog2temp_max6675(c)
+#endif
+
+#if defined BED_USES_THERMISTOR
+#define temp2analogBed( c ) temp2analog_thermistor((c),bedtemptable,BNUMTEMPS)
+#define analog2tempBed( c ) analog2temp_thermistor((c),bedtemptable,BNUMTEMPS)
+#elif defined BED_USES_AD595
+#define temp2analogBed( c ) temp2analog_ad595(c)
+#define analog2tempBed( c ) analog2temp_ad595(c)
+#elif defined BED_USES_MAX6675
+#define temp2analogBed( c ) temp2analog_max6675(c)
+#define analog2tempBed( c ) analog2temp_max6675(c)
+#endif
+
+#if defined (HEATER_USES_THERMISTOR) || defined (BED_USES_THERMISTOR)
+int temp2analog_thermistor(int celsius, const short table[][2], int numtemps);
+int analog2temp_thermistor(int raw,const short table[][2], int numtemps);
+#endif
+
+#if defined (HEATER_USES_AD595) || defined (BED_USES_AD595)
+int temp2analog_ad595(int celsius);
+int analog2temp_ad595(int raw);
+#endif
+
+#if defined (HEATER_USES_MAX6675) || defined (BED_USES_MAX6675)
+int temp2analog_max6675(int celsius);
+int analog2temp_max6675(int raw);
+#endif
+
+
+extern int target_raw;
+extern int target_temp;
+extern int current_raw;
+extern int current_raw_maxval;
+extern int current_raw_minval;
+extern int tt_maxval;
+extern int tt_minval;
+extern int target_bed_raw;
+extern int current_bed_raw;
+extern unsigned long previous_millis_heater, previous_millis_bed_heater;
+extern unsigned char manage_monitor;
+
+#ifdef PIDTEMP
+ extern int g_heater_pwm_val;
+
+ extern unsigned char PWM_off_time;
+ extern unsigned char PWM_out_on;
+
+ extern int temp_iState;
+ extern int temp_dState;
+ extern int prev_temp;
+ extern int pTerm;
+ extern int iTerm;
+ extern int dTerm;
+ extern int error;
+ extern int heater_duty;
+#endif
+
+
+#ifdef AUTOTEMP
+ extern float autotemp_max;
+ extern float autotemp_min;
+ extern float autotemp_factor;
+ extern int autotemp_setpoint;
+ extern bool autotemp_enabled;
+#endif
+
+
+#ifdef SMOOTHING
+ extern uint32_t nma;
+#endif
+
+#ifdef WATCHPERIOD
+ extern int watch_raw;
+ extern unsigned long watchmillis;
+#endif
+
+
+
+
+#ifdef PID_SOFT_PWM
+ void init_Timer2_softpwm(void);
+#endif
+
+void manage_heater();