Browse Source

Merge pull request #770 from josefpavlik/Marlin_v1

Marlin v1
pull/1/head
nothinman 11 years ago
parent
commit
d4ba23bc28
  1. 5
      Marlin/Configuration.h
  2. 2
      Marlin/Marlin.h
  3. 4
      Marlin/Marlin_main.cpp
  4. 64
      Marlin/thermistortables.h
  5. 3
      Marlin/ultralcd.cpp

5
Marlin/Configuration.h

@ -123,6 +123,11 @@
// 51 is 100k thermistor - EPCOS (1k pullup) // 51 is 100k thermistor - EPCOS (1k pullup)
// 52 is 200k thermistor - ATC Semitec 204GT-2 (1k pullup) // 52 is 200k thermistor - ATC Semitec 204GT-2 (1k pullup)
// 55 is 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) // 55 is 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup)
//
// 1047 is Pt1000 with 4k7 pullup
// 1010 is Pt1000 with 1k pullup (non standard)
// 147 is Pt100 with 4k7 pullup
// 110 is Pt100 with 1k pullup (non standard)
#define TEMP_SENSOR_0 -1 #define TEMP_SENSOR_0 -1
#define TEMP_SENSOR_1 -1 #define TEMP_SENSOR_1 -1

2
Marlin/Marlin.h

@ -189,6 +189,8 @@ void enquecommand_P(const char *cmd); //put an ascii command at the end of the c
void prepare_arc_move(char isclockwise); void prepare_arc_move(char isclockwise);
void clamp_to_software_endstops(float target[3]); void clamp_to_software_endstops(float target[3]);
void refresh_cmd_timeout(void);
#ifdef FAST_PWM_FAN #ifdef FAST_PWM_FAN
void setPwmFrequency(uint8_t pin, int val); void setPwmFrequency(uint8_t pin, int val);
#endif #endif

4
Marlin/Marlin_main.cpp

@ -1080,6 +1080,10 @@ static void homeaxis(int axis) {
} }
} }
#define HOMEAXIS(LETTER) homeaxis(LETTER##_AXIS) #define HOMEAXIS(LETTER) homeaxis(LETTER##_AXIS)
+void refresh_cmd_timeout(void)
{
previous_millis_cmd = millis();
}
void process_commands() void process_commands()
{ {

64
Marlin/thermistortables.h

@ -857,6 +857,70 @@ const short temptable_60[][2] PROGMEM = {
}; };
#endif #endif
// Pt1000 and Pt100 handling
//
// Rt=R0*(1+a*T+b*T*T) [for T>0]
// a=3.9083E-3, b=-5.775E-7
#define PtA 3.9083E-3
#define PtB -5.775E-7
#define PtRt(T,R0) ((R0)*(1.0+(PtA)*(T)+(PtB)*(T)*(T)))
#define PtAdVal(T,R0,Rup) (short)(1024/(Rup/PtRt(T,R0)+1))
#define PtLine(T,R0,Rup) { PtAdVal(T,R0,Rup)*OVERSAMPLENR, T },
#if (THERMISTORHEATER_0 == 110) || (THERMISTORHEATER_1 == 110) || (THERMISTORHEATER_2 == 110) || (THERMISTORBED == 110) // Pt100 with 1k0 pullup
const short temptable_110[][2] PROGMEM = {
// only few values are needed as the curve is very flat
PtLine(0,100,1000)
PtLine(50,100,1000)
PtLine(100,100,1000)
PtLine(150,100,1000)
PtLine(200,100,1000)
PtLine(250,100,1000)
PtLine(300,100,1000)
};
#endif
#if (THERMISTORHEATER_0 == 147) || (THERMISTORHEATER_1 == 147) || (THERMISTORHEATER_2 == 147) || (THERMISTORBED == 147) // Pt100 with 4k7 pullup
const short temptable_147[][2] PROGMEM = {
// only few values are needed as the curve is very flat
PtLine(0,100,4700)
PtLine(50,100,4700)
PtLine(100,100,4700)
PtLine(150,100,4700)
PtLine(200,100,4700)
PtLine(250,100,4700)
PtLine(300,100,4700)
};
#endif
#if (THERMISTORHEATER_0 == 1010) || (THERMISTORHEATER_1 == 1010) || (THERMISTORHEATER_2 == 1010) || (THERMISTORBED == 1010) // Pt1000 with 1k0 pullup
const short temptable_1010[][2] PROGMEM = {
PtLine(0,1000,1000)
PtLine(25,1000,1000)
PtLine(50,1000,1000)
PtLine(75,1000,1000)
PtLine(100,1000,1000)
PtLine(125,1000,1000)
PtLine(150,1000,1000)
PtLine(175,1000,1000)
PtLine(200,1000,1000)
PtLine(225,1000,1000)
PtLine(250,1000,1000)
PtLine(275,1000,1000)
PtLine(300,1000,1000)
};
#endif
#if (THERMISTORHEATER_0 == 1047) || (THERMISTORHEATER_1 == 1047) || (THERMISTORHEATER_2 == 1047) || (THERMISTORBED == 1047) // Pt1000 with 4k7 pullup
const short temptable_1047[][2] PROGMEM = {
// only few values are needed as the curve is very flat
PtLine(0,1000,4700)
PtLine(50,1000,4700)
PtLine(100,1000,4700)
PtLine(150,1000,4700)
PtLine(200,1000,4700)
PtLine(250,1000,4700)
PtLine(300,1000,4700)
};
#endif
#define _TT_NAME(_N) temptable_ ## _N #define _TT_NAME(_N) temptable_ ## _N
#define TT_NAME(_N) _TT_NAME(_N) #define TT_NAME(_N) _TT_NAME(_N)

3
Marlin/ultralcd.cpp

@ -460,6 +460,7 @@ static void lcd_move_x()
{ {
if (encoderPosition != 0) if (encoderPosition != 0)
{ {
refresh_cmd_timeout();
current_position[X_AXIS] += float((int)encoderPosition) * move_menu_scale; current_position[X_AXIS] += float((int)encoderPosition) * move_menu_scale;
if (min_software_endstops && current_position[X_AXIS] < X_MIN_POS) if (min_software_endstops && current_position[X_AXIS] < X_MIN_POS)
current_position[X_AXIS] = X_MIN_POS; current_position[X_AXIS] = X_MIN_POS;
@ -489,6 +490,7 @@ static void lcd_move_y()
{ {
if (encoderPosition != 0) if (encoderPosition != 0)
{ {
refresh_cmd_timeout();
current_position[Y_AXIS] += float((int)encoderPosition) * move_menu_scale; current_position[Y_AXIS] += float((int)encoderPosition) * move_menu_scale;
if (min_software_endstops && current_position[Y_AXIS] < Y_MIN_POS) if (min_software_endstops && current_position[Y_AXIS] < Y_MIN_POS)
current_position[Y_AXIS] = Y_MIN_POS; current_position[Y_AXIS] = Y_MIN_POS;
@ -518,6 +520,7 @@ static void lcd_move_z()
{ {
if (encoderPosition != 0) if (encoderPosition != 0)
{ {
refresh_cmd_timeout();
current_position[Z_AXIS] += float((int)encoderPosition) * move_menu_scale; current_position[Z_AXIS] += float((int)encoderPosition) * move_menu_scale;
if (min_software_endstops && current_position[Z_AXIS] < Z_MIN_POS) if (min_software_endstops && current_position[Z_AXIS] < Z_MIN_POS)
current_position[Z_AXIS] = Z_MIN_POS; current_position[Z_AXIS] = Z_MIN_POS;

Loading…
Cancel
Save