summaryrefslogtreecommitdiff
path: root/Sprinter
diff options
context:
space:
mode:
authorEmanuele Caruso <emanuele.caruso@gmail.com>2011-07-24 19:36:35 +0200
committerEmanuele Caruso <emanuele.caruso@gmail.com>2011-07-24 19:36:35 +0200
commitedb91dd6fa7eac120251e5e45a40c19b9c429bcb (patch)
tree0544fc562a7d398a2d97627c33dc0ef6e07e0f87 /Sprinter
parentf712ec88f34dc71ab230a11cad12d4e599455c8a (diff)
parent6731e67015772678813e40f55c49816e84da2394 (diff)
Merge remote branch 'origin/experimental' into experimental
Diffstat (limited to 'Sprinter')
-rw-r--r--Sprinter/Configuration.h18
-rw-r--r--Sprinter/Sprinter.pde28
-rw-r--r--Sprinter/fastio.h270
-rw-r--r--Sprinter/pins.h4
-rw-r--r--Sprinter/thermistortables.h32
5 files changed, 197 insertions, 155 deletions
diff --git a/Sprinter/Configuration.h b/Sprinter/Configuration.h
index 319c839..5d64c7b 100644
--- a/Sprinter/Configuration.h
+++ b/Sprinter/Configuration.h
@@ -15,6 +15,7 @@
// 1 is 100k thermistor
// 2 is 200k thermistor
// 3 is mendel-parts thermistor
+// 4 is 10k thermistor
#define THERMISTORHEATER 1
#define THERMISTORBED 1
@@ -28,6 +29,8 @@ float axis_steps_per_unit[] = {80, 80, 3200/1.25,700};
#define ENDSTOPPULLUPS 1 // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
// The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins.
const bool ENDSTOPS_INVERTING = false; //set to true to invert the logic of the endstops
+//If your axes are only moving in one direction, make sure the endstops are connected properly.
+//If your axes move in one direction ONLY when the endstops are triggered, set ENDSTOPS_INVERTING to true here
// This determines the communication speed of the printer
#define BAUDRATE 115200
@@ -41,10 +44,10 @@ const bool ENDSTOPS_INVERTING = false; //set to true to invert the logic of the
#include "thermistortables.h"
// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
-const bool X_ENABLE_ON = 0;
-const bool Y_ENABLE_ON = 0;
-const bool Z_ENABLE_ON = 0;
-const bool E_ENABLE_ON = 0;
+#define X_ENABLE_ON 0
+#define Y_ENABLE_ON 0
+#define Z_ENABLE_ON 0
+#define E_ENABLE_ON 0
// Disables axis when it's not being used.
const bool DISABLE_X = false;
@@ -60,9 +63,9 @@ const bool INVERT_E_DIR = false;
//// ENDSTOP SETTINGS:
// Sets direction of endstops when homing; 1=MAX, -1=MIN
-const int X_HOME_DIR = -1;
-const int Y_HOME_DIR = -1;
-const int Z_HOME_DIR = -1;
+#define X_HOME_DIR -1
+#define Y_HOME_DIR -1
+#define Z_HOME_DIR -1
const bool min_software_endstops = false; //If true, axis won't move to coordinates less than zero.
const bool max_software_endstops = true; //If true, axis won't move to coordinates greater than the defined lengths below.
@@ -73,6 +76,7 @@ const int Z_MAX_LENGTH = 100;
//// MOVEMENT SETTINGS
const int NUM_AXIS = 4; // The axis order in all axis related arrays is X, Y, Z, E
float max_feedrate[] = {200000, 200000, 240, 500000};
+float homing_feedrate[] = {1500,1500,120};
bool axis_relative_modes[] = {false, false, false, false};
// Min step delay in microseconds. If you are experiencing missing steps, try to raise the delay microseconds, but be aware this
diff --git a/Sprinter/Sprinter.pde b/Sprinter/Sprinter.pde
index f9b73fc..aeaf540 100644
--- a/Sprinter/Sprinter.pde
+++ b/Sprinter/Sprinter.pde
@@ -127,7 +127,7 @@ int tt = 0, bt = 0;
int temp_iState_max = 100 * PID_INTEGRAL_DRIVE_MAX / PID_IGAIN;
#endif
#ifdef SMOOTHING
- uint32_t nma = SMOOTHFACTOR * analogRead(TEMP_0_PIN);
+ uint32_t nma = 0;
#endif
#ifdef WATCHPERIOD
int watch_raw = -1000;
@@ -541,8 +541,7 @@ inline void process_commands()
case 28: //G28 Home all Axis one at a time
saved_feedrate = feedrate;
for(int i=0; i < NUM_AXIS; i++) {
- destination[i] = 0;
- current_position[i] = 0;
+ destination[i] = current_position[i];
}
feedrate = 0;
@@ -552,7 +551,7 @@ inline void process_commands()
if ((X_MIN_PIN > -1 && X_HOME_DIR==-1) || (X_MAX_PIN > -1 && X_HOME_DIR==1)){
current_position[0] = 0;
destination[0] = 1.5 * X_MAX_LENGTH * X_HOME_DIR;
- feedrate = max_start_speed_units_per_second[0] * 60;
+ feedrate = homing_feedrate[0];
prepare_move();
current_position[0] = 0;
@@ -562,8 +561,8 @@ inline void process_commands()
destination[0] = 10 * X_HOME_DIR;
prepare_move();
- current_position[0] = 0;
- destination[0] = 0;
+ current_position[0] = (X_HOME_DIR == -1) ? 0 : X_MAX_LENGTH;
+ destination[0] = current_position[0];
feedrate = 0;
}
}
@@ -572,7 +571,7 @@ inline void process_commands()
if ((Y_MIN_PIN > -1 && Y_HOME_DIR==-1) || (Y_MAX_PIN > -1 && Y_HOME_DIR==1)){
current_position[1] = 0;
destination[1] = 1.5 * Y_MAX_LENGTH * Y_HOME_DIR;
- feedrate = max_start_speed_units_per_second[1] * 60;
+ feedrate = homing_feedrate[1];
prepare_move();
current_position[1] = 0;
@@ -582,8 +581,8 @@ inline void process_commands()
destination[1] = 10 * Y_HOME_DIR;
prepare_move();
- current_position[1] = 0;
- destination[1] = 0;
+ current_position[1] = (Y_HOME_DIR == -1) ? 0 : Y_MAX_LENGTH;
+ destination[1] = current_position[1];
feedrate = 0;
}
}
@@ -592,7 +591,7 @@ inline void process_commands()
if ((Z_MIN_PIN > -1 && Z_HOME_DIR==-1) || (Z_MAX_PIN > -1 && Z_HOME_DIR==1)){
current_position[2] = 0;
destination[2] = 1.5 * Z_MAX_LENGTH * Z_HOME_DIR;
- feedrate = max_feedrate[2]/2;
+ feedrate = homing_feedrate[2];
prepare_move();
current_position[2] = 0;
@@ -602,8 +601,8 @@ inline void process_commands()
destination[2] = 10 * Z_HOME_DIR;
prepare_move();
- current_position[2] = 0;
- destination[2] = 0;
+ current_position[2] = (Z_HOME_DIR == -1) ? 0 : Z_MAX_LENGTH;
+ destination[2] = current_position[2];
feedrate = 0;
}
@@ -734,7 +733,9 @@ inline void process_commands()
#endif
break;
case 140: // M140 set bed temp
- if (code_seen('S')) target_bed_raw = temp2analogBed(code_value());
+ #if TEMP_1_PIN > -1 || defined BED_USES_AD595
+ if (code_seen('S')) target_bed_raw = temp2analogBed(code_value());
+ #endif
break;
case 105: // M105
#if (TEMP_0_PIN > -1) || defined (HEATER_USES_MAX6675)|| defined HEATER_USES_AD595
@@ -1389,6 +1390,7 @@ void manage_heater()
current_raw = read_max6675();
#endif
#ifdef SMOOTHING
+ if (!nma) nma = SMOOTHFACTOR * current_raw;
nma = (nma + current_raw) - (nma / SMOOTHFACTOR);
current_raw = nma / SMOOTHFACTOR;
#endif
diff --git a/Sprinter/fastio.h b/Sprinter/fastio.h
index aa5ad0e..1d28d05 100644
--- a/Sprinter/fastio.h
+++ b/Sprinter/fastio.h
@@ -179,53 +179,53 @@ pins
#define DIO13_PWM NULL
-#define AIO0_PIN PINC0
-#define AIO0_RPORT PINC
-#define AIO0_WPORT PORTC
-#define AIO0_DDR DDRC
-#define AIO0_PWM NULL
+#define DIO14_PIN PINC0
+#define DIO14_RPORT PINC
+#define DIO14_WPORT PORTC
+#define DIO14_DDR DDRC
+#define DIO14_PWM NULL
-#define AIO1_PIN PINC1
-#define AIO1_RPORT PINC
-#define AIO1_WPORT PORTC
-#define AIO1_DDR DDRC
-#define AIO1_PWM NULL
+#define DIO15_PIN PINC1
+#define DIO15_RPORT PINC
+#define DIO15_WPORT PORTC
+#define DIO15_DDR DDRC
+#define DIO15_PWM NULL
-#define AIO2_PIN PINC2
-#define AIO2_RPORT PINC
-#define AIO2_WPORT PORTC
-#define AIO2_DDR DDRC
-#define AIO2_PWM NULL
+#define DIO16_PIN PINC2
+#define DIO16_RPORT PINC
+#define DIO16_WPORT PORTC
+#define DIO16_DDR DDRC
+#define DIO16_PWM NULL
-#define AIO3_PIN PINC3
-#define AIO3_RPORT PINC
-#define AIO3_WPORT PORTC
-#define AIO3_DDR DDRC
-#define AIO3_PWM NULL
+#define DIO17_PIN PINC3
+#define DIO17_RPORT PINC
+#define DIO17_WPORT PORTC
+#define DIO17_DDR DDRC
+#define DIO17_PWM NULL
-#define AIO4_PIN PINC4
-#define AIO4_RPORT PINC
-#define AIO4_WPORT PORTC
-#define AIO4_DDR DDRC
-#define AIO4_PWM NULL
+#define DIO18_PIN PINC4
+#define DIO18_RPORT PINC
+#define DIO18_WPORT PORTC
+#define DIO18_DDR DDRC
+#define DIO18_PWM NULL
-#define AIO5_PIN PINC5
-#define AIO5_RPORT PINC
-#define AIO5_WPORT PORTC
-#define AIO5_DDR DDRC
-#define AIO5_PWM NULL
+#define DIO19_PIN PINC5
+#define DIO19_RPORT PINC
+#define DIO19_WPORT PORTC
+#define DIO19_DDR DDRC
+#define DIO19_PWM NULL
-#define AIO6_PIN PINC6
-#define AIO6_RPORT PINC
-#define AIO6_WPORT PORTC
-#define AIO6_DDR DDRC
-#define AIO6_PWM NULL
+#define DIO20_PIN PINC6
+#define DIO20_RPORT PINC
+#define DIO20_WPORT PORTC
+#define DIO20_DDR DDRC
+#define DIO20_PWM NULL
-#define AIO7_PIN PINC7
-#define AIO7_RPORT PINC
-#define AIO7_WPORT PORTC
-#define AIO7_DDR DDRC
-#define AIO7_PWM NULL
+#define DIO21_PIN PINC7
+#define DIO21_RPORT PINC
+#define DIO21_WPORT PORTC
+#define DIO21_DDR DDRC
+#define DIO21_PWM NULL
@@ -1265,101 +1265,101 @@ pins
#define DIO53_DDR DDRB
#define DIO53_PWM NULL
-#define AIO0_PIN PINF0
-#define AIO0_RPORT PINF
-#define AIO0_WPORT PORTF
-#define AIO0_DDR DDRF
-#define AIO0_PWM NULL
-
-#define AIO1_PIN PINF1
-#define AIO1_RPORT PINF
-#define AIO1_WPORT PORTF
-#define AIO1_DDR DDRF
-#define AIO1_PWM NULL
-
-#define AIO2_PIN PINF2
-#define AIO2_RPORT PINF
-#define AIO2_WPORT PORTF
-#define AIO2_DDR DDRF
-#define AIO2_PWM NULL
-
-#define AIO3_PIN PINF3
-#define AIO3_RPORT PINF
-#define AIO3_WPORT PORTF
-#define AIO3_DDR DDRF
-#define AIO3_PWM NULL
-
-#define AIO4_PIN PINF4
-#define AIO4_RPORT PINF
-#define AIO4_WPORT PORTF
-#define AIO4_DDR DDRF
-#define AIO4_PWM NULL
-
-#define AIO5_PIN PINF5
-#define AIO5_RPORT PINF
-#define AIO5_WPORT PORTF
-#define AIO5_DDR DDRF
-#define AIO5_PWM NULL
-
-#define AIO6_PIN PINF6
-#define AIO6_RPORT PINF
-#define AIO6_WPORT PORTF
-#define AIO6_DDR DDRF
-#define AIO6_PWM NULL
-
-#define AIO7_PIN PINF7
-#define AIO7_RPORT PINF
-#define AIO7_WPORT PORTF
-#define AIO7_DDR DDRF
-#define AIO7_PWM NULL
-
-#define AIO8_PIN PINK0
-#define AIO8_RPORT PINK
-#define AIO8_WPORT PORTK
-#define AIO8_DDR DDRK
-#define AIO8_PWM NULL
-
-#define AIO9_PIN PINK1
-#define AIO9_RPORT PINK
-#define AIO9_WPORT PORTK
-#define AIO9_DDR DDRK
-#define AIO9_PWM NULL
-
-#define AIO10_PIN PINK2
-#define AIO10_RPORT PINK
-#define AIO10_WPORT PORTK
-#define AIO10_DDR DDRK
-#define AIO10_PWM NULL
-
-#define AIO11_PIN PINK3
-#define AIO11_RPORT PINK
-#define AIO11_WPORT PORTK
-#define AIO11_DDR DDRK
-#define AIO11_PWM NULL
-
-#define AIO12_PIN PINK4
-#define AIO12_RPORT PINK
-#define AIO12_WPORT PORTK
-#define AIO12_DDR DDRK
-#define AIO12_PWM NULL
-
-#define AIO13_PIN PINK5
-#define AIO13_RPORT PINK
-#define AIO13_WPORT PORTK
-#define AIO13_DDR DDRK
-#define AIO13_PWM NULL
-
-#define AIO14_PIN PINK6
-#define AIO14_RPORT PINK
-#define AIO14_WPORT PORTK
-#define AIO14_DDR DDRK
-#define AIO14_PWM NULL
-
-#define AIO15_PIN PINK7
-#define AIO15_RPORT PINK
-#define AIO15_WPORT PORTK
-#define AIO15_DDR DDRK
-#define AIO15_PWM NULL
+#define DIO54_PIN PINF0
+#define DIO54_RPORT PINF
+#define DIO54_WPORT PORTF
+#define DIO54_DDR DDRF
+#define DIO54_PWM NULL
+
+#define DIO55_PIN PINF1
+#define DIO55_RPORT PINF
+#define DIO55_WPORT PORTF
+#define DIO55_DDR DDRF
+#define DIO55_PWM NULL
+
+#define DIO56_PIN PINF2
+#define DIO56_RPORT PINF
+#define DIO56_WPORT PORTF
+#define DIO56_DDR DDRF
+#define DIO56_PWM NULL
+
+#define DIO57_PIN PINF3
+#define DIO57_RPORT PINF
+#define DIO57_WPORT PORTF
+#define DIO57_DDR DDRF
+#define DIO57_PWM NULL
+
+#define DIO58_PIN PINF4
+#define DIO58_RPORT PINF
+#define DIO58_WPORT PORTF
+#define DIO58_DDR DDRF
+#define DIO58_PWM NULL
+
+#define DIO59_PIN PINF5
+#define DIO59_RPORT PINF
+#define DIO59_WPORT PORTF
+#define DIO59_DDR DDRF
+#define DIO59_PWM NULL
+
+#define DIO60_PIN PINF6
+#define DIO60_RPORT PINF
+#define DIO60_WPORT PORTF
+#define DIO60_DDR DDRF
+#define DIO60_PWM NULL
+
+#define DIO61_PIN PINF7
+#define DIO61_RPORT PINF
+#define DIO61_WPORT PORTF
+#define DIO61_DDR DDRF
+#define DIO61_PWM NULL
+
+#define DIO62_PIN PINK0
+#define DIO62_RPORT PINK
+#define DIO62_WPORT PORTK
+#define DIO62_DDR DDRK
+#define DIO62_PWM NULL
+
+#define DIO63_PIN PINK1
+#define DIO63_RPORT PINK
+#define DIO63_WPORT PORTK
+#define DIO63_DDR DDRK
+#define DIO63_PWM NULL
+
+#define DIO64_PIN PINK2
+#define DIO64_RPORT PINK
+#define DIO64_WPORT PORTK
+#define DIO64_DDR DDRK
+#define DIO64_PWM NULL
+
+#define DIO65_PIN PINK3
+#define DIO65_RPORT PINK
+#define DIO65_WPORT PORTK
+#define DIO65_DDR DDRK
+#define DIO65_PWM NULL
+
+#define DIO66_PIN PINK4
+#define DIO66_RPORT PINK
+#define DIO66_WPORT PORTK
+#define DIO66_DDR DDRK
+#define DIO66_PWM NULL
+
+#define DIO67_PIN PINK5
+#define DIO67_RPORT PINK
+#define DIO67_WPORT PORTK
+#define DIO67_DDR DDRK
+#define DIO67_PWM NULL
+
+#define DIO68_PIN PINK6
+#define DIO68_RPORT PINK
+#define DIO68_WPORT PORTK
+#define DIO68_DDR DDRK
+#define DIO68_PWM NULL
+
+#define DIO69_PIN PINK7
+#define DIO69_RPORT PINK
+#define DIO69_WPORT PORTK
+#define DIO69_DDR DDRK
+#define DIO69_PWM NULL
diff --git a/Sprinter/pins.h b/Sprinter/pins.h
index 1bd6702..720f3a9 100644
--- a/Sprinter/pins.h
+++ b/Sprinter/pins.h
@@ -246,6 +246,10 @@
#define E_DIR_PIN 28
#define E_ENABLE_PIN 24
+#define E_1_STEP_PIN 36
+#define E_1_DIR_PIN 34
+#define E_1_ENABLE_PIN 30
+
#define SDPOWER -1
#define SDSS 53
#define LED_PIN 13
diff --git a/Sprinter/thermistortables.h b/Sprinter/thermistortables.h
index 6c583af..de9aee6 100644
--- a/Sprinter/thermistortables.h
+++ b/Sprinter/thermistortables.h
@@ -130,6 +130,32 @@ const short temptable_3[NUMTEMPS_3][2] = {
};
#endif
+#if (THERMISTORHEATER == 4) || (THERMISTORBED == 4) //10k thermistor
+
+#define NUMTEMPS_4 20
+short temptable_4[NUMTEMPS_4][2] = {
+ {1, 430},
+ {54, 137},
+ {107, 107},
+ {160, 91},
+ {213, 80},
+ {266, 71},
+ {319, 64},
+ {372, 57},
+ {425, 51},
+ {478, 46},
+ {531, 41},
+ {584, 35},
+ {637, 30},
+ {690, 25},
+ {743, 20},
+ {796, 14},
+ {849, 7},
+ {902, 0},
+ {955, -11},
+ {1008, -35}
+};
+#endif
#if THERMISTORHEATER == 1
#define NUMTEMPS NUMTEMPS_1
@@ -140,6 +166,9 @@ const short temptable_3[NUMTEMPS_3][2] = {
#elif THERMISTORHEATER == 3
#define NUMTEMPS NUMTEMPS_3
#define temptable temptable_3
+#elif THERMISTORHEATER == 4
+#define NUMTEMPS NUMTEMPS_4
+#define temptable temptable_4
#elif defined HEATER_USES_THERMISTOR
#error No heater thermistor table specified
#endif
@@ -152,6 +181,9 @@ const short temptable_3[NUMTEMPS_3][2] = {
#elif THERMISTORBED == 3
#define BNUMTEMPS NUMTEMPS_3
#define bedtemptable temptable_3
+#elif THERMISTORBED == 4
+#define BNUMTEMPS NUMTEMPS_4
+#define bedtemptable temptable_4
#elif defined BED_USES_THERMISTOR
#error No bed thermistor table specified
#endif