Browse Source

Merge github.com:ErikZalm/Marlin into Marlin_v1

Guillaume Seguin 12 years ago
parent
commit
18199ff960
32 changed files with 2596 additions and 1563 deletions
  1. 1
    1
      ArduinoAddons/Arduino_0.xx/Gen6/bootloaders/atmega644p/ATmegaBOOT.c
  2. 1
    1
      ArduinoAddons/Arduino_0.xx/Sanguino/bootloaders/atmega644p/ATmegaBOOT.c
  3. 1
    1
      ArduinoAddons/Arduino_0.xx/libraries/LiquidCrystal/LiquidCrystal.cpp
  4. 1
    1
      ArduinoAddons/Arduino_0.xx/libraries/U8glib/utility/chessengine.c
  5. 1
    1
      ArduinoAddons/Arduino_1.x.x/libraries/LiquidCrystal/LiquidCrystal.cpp
  6. 1
    1
      ArduinoAddons/Arduino_1.x.x/libraries/U8glib/utility/chessengine.c
  7. 1
    1
      ArduinoAddons/Arduino_1.x.x/sanguino/bootloaders/atmega/ATmegaBOOT_168.c
  8. 1
    1
      ArduinoAddons/Arduino_1.x.x/sanguino/bootloaders/atmega644p/ATmegaBOOT.c
  9. 1
    1
      ArduinoAddons/Arduino_1.x.x/sanguino/bootloaders/atmega644p/ATmegaBOOT.c.tst
  10. 138
    35
      Marlin/Configuration.h
  11. 12
    1
      Marlin/ConfigurationStore.cpp
  12. 28
    6
      Marlin/Configuration_adv.h
  13. 1
    1
      Marlin/LiquidCrystalRus.cpp
  14. 8
    2
      Marlin/Makefile
  15. 12
    1
      Marlin/Marlin.h
  16. 286
    35
      Marlin/Marlin_main.cpp
  17. 2
    0
      Marlin/Servo.cpp
  18. 13
    7
      Marlin/cardreader.cpp
  19. 4
    1
      Marlin/cardreader.h
  20. 17
    6
      Marlin/dogm_lcd_implementation.h
  21. 134
    113
      Marlin/language.h
  22. 374
    128
      Marlin/pins.h
  23. 53
    27
      Marlin/planner.cpp
  24. 3
    1
      Marlin/planner.h
  25. 93
    110
      Marlin/stepper.cpp
  26. 89
    52
      Marlin/temperature.cpp
  27. 3
    0
      Marlin/temperature.h
  28. 128
    52
      Marlin/ultralcd.cpp
  29. 49
    1
      Marlin/ultralcd.h
  30. 757
    748
      Marlin/ultralcd_implementation_hitachi_HD44780.h
  31. 131
    0
      Marlin/ultralcd_st7920_u8glib_rrd.h
  32. 252
    227
      README.md

+ 1
- 1
ArduinoAddons/Arduino_0.xx/Gen6/bootloaders/atmega644p/ATmegaBOOT.c View File

168
     WDTCSR = 0;
168
     WDTCSR = 0;
169
 
169
 
170
     // Check if the WDT was used to reset, in which case we dont bootload and skip straight to the code. woot.
170
     // Check if the WDT was used to reset, in which case we dont bootload and skip straight to the code. woot.
171
-    if (! (ch &  _BV(EXTRF))) // if its a not an external reset...
171
+    if (! (ch &  _BV(EXTRF))) // if it's a not an external reset...
172
       app_start();  // skip bootloader
172
       app_start();  // skip bootloader
173
 #endif
173
 #endif
174
 
174
 

+ 1
- 1
ArduinoAddons/Arduino_0.xx/Sanguino/bootloaders/atmega644p/ATmegaBOOT.c View File

168
     WDTCSR = 0;
168
     WDTCSR = 0;
169
 
169
 
170
     // Check if the WDT was used to reset, in which case we dont bootload and skip straight to the code. woot.
170
     // Check if the WDT was used to reset, in which case we dont bootload and skip straight to the code. woot.
171
-    if (! (ch &  _BV(EXTRF))) // if its a not an external reset...
171
+    if (! (ch &  _BV(EXTRF))) // if it's a not an external reset...
172
       app_start();  // skip bootloader
172
       app_start();  // skip bootloader
173
 #endif
173
 #endif
174
 
174
 

+ 1
- 1
ArduinoAddons/Arduino_0.xx/libraries/LiquidCrystal/LiquidCrystal.cpp View File

21
 //    S = 0; No shift 
21
 //    S = 0; No shift 
22
 //
22
 //
23
 // Note, however, that resetting the Arduino doesn't reset the LCD, so we
23
 // Note, however, that resetting the Arduino doesn't reset the LCD, so we
24
-// can't assume that its in that state when a sketch starts (and the
24
+// can't assume that it's in that state when a sketch starts (and the
25
 // LiquidCrystal constructor is called).
25
 // LiquidCrystal constructor is called).
26
 
26
 
27
 LiquidCrystal::LiquidCrystal(uint8_t rs, uint8_t rw, uint8_t enable,
27
 LiquidCrystal::LiquidCrystal(uint8_t rs, uint8_t rw, uint8_t enable,

+ 1
- 1
ArduinoAddons/Arduino_0.xx/libraries/U8glib/utility/chessengine.c View File

72
 	- Castling: Need to check for fields under attack
72
 	- Castling: Need to check for fields under attack
73
 	    --> done
73
 	    --> done
74
 	
74
 	
75
-	- Check for WIN / LOOSE situation, perhaps call ce_Eval() once on the top-level board setup
75
+	- Check for WIN / LOSE situation, perhaps call ce_Eval() once on the top-level board setup
76
 	    just after the real move
76
 	    just after the real move
77
 	- cleanup cu_Move
77
 	- cleanup cu_Move
78
 	    --> almost done
78
 	    --> almost done

+ 1
- 1
ArduinoAddons/Arduino_1.x.x/libraries/LiquidCrystal/LiquidCrystal.cpp View File

21
 //    S = 0; No shift 
21
 //    S = 0; No shift 
22
 //
22
 //
23
 // Note, however, that resetting the Arduino doesn't reset the LCD, so we
23
 // Note, however, that resetting the Arduino doesn't reset the LCD, so we
24
-// can't assume that its in that state when a sketch starts (and the
24
+// can't assume that it's in that state when a sketch starts (and the
25
 // LiquidCrystal constructor is called).
25
 // LiquidCrystal constructor is called).
26
 
26
 
27
 LiquidCrystal::LiquidCrystal(uint8_t rs, uint8_t rw, uint8_t enable,
27
 LiquidCrystal::LiquidCrystal(uint8_t rs, uint8_t rw, uint8_t enable,

+ 1
- 1
ArduinoAddons/Arduino_1.x.x/libraries/U8glib/utility/chessengine.c View File

72
 	- Castling: Need to check for fields under attack
72
 	- Castling: Need to check for fields under attack
73
 	    --> done
73
 	    --> done
74
 	
74
 	
75
-	- Check for WIN / LOOSE situation, perhaps call ce_Eval() once on the top-level board setup
75
+	- Check for WIN / LOSE situation, perhaps call ce_Eval() once on the top-level board setup
76
 	    just after the real move
76
 	    just after the real move
77
 	- cleanup cu_Move
77
 	- cleanup cu_Move
78
 	    --> almost done
78
 	    --> almost done

+ 1
- 1
ArduinoAddons/Arduino_1.x.x/sanguino/bootloaders/atmega/ATmegaBOOT_168.c View File

301
 	WDTCSR = 0;
301
 	WDTCSR = 0;
302
 
302
 
303
 	// Check if the WDT was used to reset, in which case we dont bootload and skip straight to the code. woot.
303
 	// Check if the WDT was used to reset, in which case we dont bootload and skip straight to the code. woot.
304
-	if (! (ch &  _BV(EXTRF))) // if its a not an external reset...
304
+	if (! (ch &  _BV(EXTRF))) // if it's a not an external reset...
305
 		app_start();  // skip bootloader
305
 		app_start();  // skip bootloader
306
 #else
306
 #else
307
 	asm volatile("nop\n\t");
307
 	asm volatile("nop\n\t");

+ 1
- 1
ArduinoAddons/Arduino_1.x.x/sanguino/bootloaders/atmega644p/ATmegaBOOT.c View File

172
     WDTCSR = 0;
172
     WDTCSR = 0;
173
 
173
 
174
     // Check if the WDT was used to reset, in which case we dont bootload and skip straight to the code. woot.
174
     // Check if the WDT was used to reset, in which case we dont bootload and skip straight to the code. woot.
175
-    if (! (ch &  _BV(EXTRF))) // if its a not an external reset...
175
+    if (! (ch &  _BV(EXTRF))) // if it's a not an external reset...
176
       app_start();  // skip bootloader
176
       app_start();  // skip bootloader
177
 #endif
177
 #endif
178
 
178
 

+ 1
- 1
ArduinoAddons/Arduino_1.x.x/sanguino/bootloaders/atmega644p/ATmegaBOOT.c.tst View File

172
     WDTCSR = 0;
172
     WDTCSR = 0;
173
 
173
 
174
     // Check if the WDT was used to reset, in which case we dont bootload and skip straight to the code. woot.
174
     // Check if the WDT was used to reset, in which case we dont bootload and skip straight to the code. woot.
175
-    if (! (ch &  _BV(EXTRF))) // if its a not an external reset...
175
+    if (! (ch &  _BV(EXTRF))) // if it's a not an external reset...
176
       app_start();  // skip bootloader
176
       app_start();  // skip bootloader
177
 #endif
177
 #endif
178
 
178
 

+ 138
- 35
Marlin/Configuration.h View File

1
 #ifndef CONFIGURATION_H
1
 #ifndef CONFIGURATION_H
2
 #define CONFIGURATION_H
2
 #define CONFIGURATION_H
3
 
3
 
4
-// This configurtion file contains the basic settings.
4
+// This configuration file contains the basic settings.
5
 // Advanced settings can be found in Configuration_adv.h
5
 // Advanced settings can be found in Configuration_adv.h
6
 // BASIC SETTINGS: select your board type, temperature sensor type, axis scaling, and endstop configuration
6
 // BASIC SETTINGS: select your board type, temperature sensor type, axis scaling, and endstop configuration
7
 
7
 
8
-//User specified version info of this build to display in [Pronterface, etc] terminal window during startup.
9
-//Implementation of an idea by Prof Braino to inform user that any changes made
10
-//to this build by the user have been successfully uploaded into firmware.
8
+// User-specified version info of this build to display in [Pronterface, etc] terminal window during
9
+// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
10
+// build by the user have been successfully uploaded into firmware.
11
 #define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time
11
 #define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time
12
-#define STRING_CONFIG_H_AUTHOR "(none, default config)" //Who made the changes.
12
+#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
13
 
13
 
14
 // SERIAL_PORT selects which serial port should be used for communication with the host.
14
 // SERIAL_PORT selects which serial port should be used for communication with the host.
15
 // This allows the connection of wireless adapters (for instance) to non-default port pins.
15
 // This allows the connection of wireless adapters (for instance) to non-default port pins.
26
 // 12 = Gen7 v1.3
26
 // 12 = Gen7 v1.3
27
 // 13 = Gen7 v1.4
27
 // 13 = Gen7 v1.4
28
 // 3  = MEGA/RAMPS up to 1.2 = 3
28
 // 3  = MEGA/RAMPS up to 1.2 = 3
29
-// 33 = RAMPS 1.3 / 1.4 (Power outputs: Extruder, Bed, Fan)
29
+// 33 = RAMPS 1.3 / 1.4 (Power outputs: Extruder, Fan, Bed)
30
 // 34 = RAMPS 1.3 / 1.4 (Power outputs: Extruder0, Extruder1, Bed)
30
 // 34 = RAMPS 1.3 / 1.4 (Power outputs: Extruder0, Extruder1, Bed)
31
 // 4  = Duemilanove w/ ATMega328P pin assignment
31
 // 4  = Duemilanove w/ ATMega328P pin assignment
32
 // 5  = Gen6
32
 // 5  = Gen6
35
 // 62 = Sanguinololu 1.2 and above
35
 // 62 = Sanguinololu 1.2 and above
36
 // 63 = Melzi
36
 // 63 = Melzi
37
 // 64 = STB V1.1
37
 // 64 = STB V1.1
38
+// 65 = Azteeg X1
39
+// 66 = Melzi with ATmega1284 (MaKr3d version)
38
 // 7  = Ultimaker
40
 // 7  = Ultimaker
39
 // 71 = Ultimaker (Older electronics. Pre 1.5.4. This is rare)
41
 // 71 = Ultimaker (Older electronics. Pre 1.5.4. This is rare)
42
+// 77 = 3Drag Controller
40
 // 8  = Teensylu
43
 // 8  = Teensylu
41
 // 80 = Rumba
44
 // 80 = Rumba
42
 // 81 = Printrboard (AT90USB1286)
45
 // 81 = Printrboard (AT90USB1286)
48
 // 90 = Alpha OMCA board
51
 // 90 = Alpha OMCA board
49
 // 91 = Final OMCA board
52
 // 91 = Final OMCA board
50
 // 301 = Rambo
53
 // 301 = Rambo
54
+// 21 = Elefu Ra Board (v3)
51
 
55
 
52
 #ifndef MOTHERBOARD
56
 #ifndef MOTHERBOARD
53
 #define MOTHERBOARD 7
57
 #define MOTHERBOARD 7
54
 #endif
58
 #endif
55
 
59
 
60
+// Define this to set a custom name for your generic Mendel,
61
+// #define CUSTOM_MENDEL_NAME "This Mendel"
62
+
56
 // This defines the number of extruders
63
 // This defines the number of extruders
57
 #define EXTRUDERS 1
64
 #define EXTRUDERS 1
58
 
65
 
62
 
69
 
63
 #define POWER_SUPPLY 1
70
 #define POWER_SUPPLY 1
64
 
71
 
72
+
73
+//===========================================================================
74
+//============================== Delta Settings =============================
75
+//===========================================================================
76
+// Enable DELTA kinematics
77
+//#define DELTA
78
+
79
+// Make delta curves from many straight lines (linear interpolation).
80
+// This is a trade-off between visible corners (not enough segments)
81
+// and processor overload (too many expensive sqrt calls).
82
+#define DELTA_SEGMENTS_PER_SECOND 200
83
+
84
+// Center-to-center distance of the holes in the diagonal push rods.
85
+#define DELTA_DIAGONAL_ROD 250.0 // mm
86
+
87
+// Horizontal offset from middle of printer to smooth rod center.
88
+#define DELTA_SMOOTH_ROD_OFFSET 175.0 // mm
89
+
90
+// Horizontal offset of the universal joints on the end effector.
91
+#define DELTA_EFFECTOR_OFFSET 33.0 // mm
92
+
93
+// Horizontal offset of the universal joints on the carriages.
94
+#define DELTA_CARRIAGE_OFFSET 18.0 // mm
95
+
96
+// Effective horizontal distance bridged by diagonal push rods.
97
+#define DELTA_RADIUS (DELTA_SMOOTH_ROD_OFFSET-DELTA_EFFECTOR_OFFSET-DELTA_CARRIAGE_OFFSET)
98
+
99
+// Effective X/Y positions of the three vertical towers.
100
+#define SIN_60 0.8660254037844386
101
+#define COS_60 0.5
102
+#define DELTA_TOWER1_X -SIN_60*DELTA_RADIUS // front left tower
103
+#define DELTA_TOWER1_Y -COS_60*DELTA_RADIUS
104
+#define DELTA_TOWER2_X SIN_60*DELTA_RADIUS // front right tower
105
+#define DELTA_TOWER2_Y -COS_60*DELTA_RADIUS
106
+#define DELTA_TOWER3_X 0.0 // back middle tower
107
+#define DELTA_TOWER3_Y DELTA_RADIUS
108
+
65
 //===========================================================================
109
 //===========================================================================
66
 //=============================Thermal Settings  ============================
110
 //=============================Thermal Settings  ============================
67
 //===========================================================================
111
 //===========================================================================
82
 // 8 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup)
126
 // 8 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup)
83
 // 9 is 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup)
127
 // 9 is 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup)
84
 // 10 is 100k RS thermistor 198-961 (4.7k pullup)
128
 // 10 is 100k RS thermistor 198-961 (4.7k pullup)
129
+// 60 is 100k Maker's Tool Works Kapton Bed Thermister
85
 //
130
 //
86
 //    1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k
131
 //    1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k
87
 //                          (but gives greater accuracy and more stable PID)
132
 //                          (but gives greater accuracy and more stable PID)
90
 // 55 is 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan) (1k pullup)
135
 // 55 is 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan) (1k pullup)
91
 
136
 
92
 #define TEMP_SENSOR_0 -1
137
 #define TEMP_SENSOR_0 -1
93
-#define TEMP_SENSOR_1 0
138
+#define TEMP_SENSOR_1 -1
94
 #define TEMP_SENSOR_2 0
139
 #define TEMP_SENSOR_2 0
95
 #define TEMP_SENSOR_BED 0
140
 #define TEMP_SENSOR_BED 0
96
 
141
 
142
+// This makes temp sensor 1 a redundant sensor for sensor 0. If the temperatures difference between these sensors is to high the print will be aborted.
143
+//#define TEMP_SENSOR_1_AS_REDUNDANT 
144
+#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10
145
+
97
 // Actual temperature must be close to target for this long before M109 returns success
146
 // Actual temperature must be close to target for this long before M109 returns success
98
 #define TEMP_RESIDENCY_TIME 10  // (seconds)
147
 #define TEMP_RESIDENCY_TIME 10  // (seconds)
99
 #define TEMP_HYSTERESIS 3       // (degC) range of +/- temperatures considered "close" to the target one
148
 #define TEMP_HYSTERESIS 3       // (degC) range of +/- temperatures considered "close" to the target one
100
-#define TEMP_WINDOW     1       // (degC) Window around target to start the recidency timer x degC early.
149
+#define TEMP_WINDOW     1       // (degC) Window around target to start the residency timer x degC early.
101
 
150
 
102
 // The minimal temperature defines the temperature below which the heater will not be enabled It is used
151
 // The minimal temperature defines the temperature below which the heater will not be enabled It is used
103
 // to check that the wiring to the thermistor is not broken.
152
 // to check that the wiring to the thermistor is not broken.
123
 // PID settings:
172
 // PID settings:
124
 // Comment the following line to disable PID and enable bang-bang.
173
 // Comment the following line to disable PID and enable bang-bang.
125
 #define PIDTEMP
174
 #define PIDTEMP
126
-#define BANG_MAX 256 // limits current to nozzle while in bang-bang mode; 256=full current
127
-#define PID_MAX 256 // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 256=full current
175
+#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
176
+#define PID_MAX 255 // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
128
 #ifdef PIDTEMP
177
 #ifdef PIDTEMP
129
   //#define PID_DEBUG // Sends debug data to the serial port.
178
   //#define PID_DEBUG // Sends debug data to the serial port.
130
   //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
179
   //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
131
   #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
180
   #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
132
                                   // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
181
                                   // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
133
   #define PID_INTEGRAL_DRIVE_MAX 255  //limit for the integral term
182
   #define PID_INTEGRAL_DRIVE_MAX 255  //limit for the integral term
134
-  #define K1 0.95 //smoothing factor withing the PID
183
+  #define K1 0.95 //smoothing factor within the PID
135
   #define PID_dT ((16.0 * 8.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine
184
   #define PID_dT ((16.0 * 8.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine
136
 
185
 
137
 // If you are using a preconfigured hotend then you can use one of the value sets by uncommenting it
186
 // If you are using a preconfigured hotend then you can use one of the value sets by uncommenting it
152
 #endif // PIDTEMP
201
 #endif // PIDTEMP
153
 
202
 
154
 // Bed Temperature Control
203
 // Bed Temperature Control
155
-// Select PID or bang-bang with PIDTEMPBED.  If bang-bang, BED_LIMIT_SWITCHING will enable hysteresis
204
+// Select PID or bang-bang with PIDTEMPBED. If bang-bang, BED_LIMIT_SWITCHING will enable hysteresis
156
 //
205
 //
157
-// uncomment this to enable PID on the bed.   It uses the same frequency PWM as the extruder.
206
+// Uncomment this to enable PID on the bed. It uses the same frequency PWM as the extruder.
158
 // If your PID_dT above is the default, and correct for your hardware/configuration, that means 7.689Hz,
207
 // If your PID_dT above is the default, and correct for your hardware/configuration, that means 7.689Hz,
159
 // which is fine for driving a square wave into a resistive load and does not significantly impact you FET heating.
208
 // which is fine for driving a square wave into a resistive load and does not significantly impact you FET heating.
160
 // This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W heater.
209
 // This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W heater.
161
-// If your configuration is significantly different than this and you don't understand the issues involved, you proabaly
210
+// If your configuration is significantly different than this and you don't understand the issues involved, you probably
162
 // shouldn't use bed PID until someone else verifies your hardware works.
211
 // shouldn't use bed PID until someone else verifies your hardware works.
163
 // If this is enabled, find your own PID constants below.
212
 // If this is enabled, find your own PID constants below.
164
 //#define PIDTEMPBED
213
 //#define PIDTEMPBED
165
 //
214
 //
166
 //#define BED_LIMIT_SWITCHING
215
 //#define BED_LIMIT_SWITCHING
167
 
216
 
168
-// This sets the max power delived to the bed, and replaces the HEATER_BED_DUTY_CYCLE_DIVIDER option.
217
+// This sets the max power delivered to the bed, and replaces the HEATER_BED_DUTY_CYCLE_DIVIDER option.
169
 // all forms of bed control obey this (PID, bang-bang, bang-bang with hysteresis)
218
 // all forms of bed control obey this (PID, bang-bang, bang-bang with hysteresis)
170
-// setting this to anything other than 256 enables a form of PWM to the bed just like HEATER_BED_DUTY_CYCLE_DIVIDER did,
219
+// setting this to anything other than 255 enables a form of PWM to the bed just like HEATER_BED_DUTY_CYCLE_DIVIDER did,
171
 // so you shouldn't use it unless you are OK with PWM on your bed.  (see the comment on enabling PIDTEMPBED)
220
 // so you shouldn't use it unless you are OK with PWM on your bed.  (see the comment on enabling PIDTEMPBED)
172
-#define MAX_BED_POWER 256 // limits duty cycle to bed; 256=full current
221
+#define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
173
 
222
 
174
 #ifdef PIDTEMPBED
223
 #ifdef PIDTEMPBED
175
 //120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
224
 //120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
176
-//from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, argressive factor of .15 (vs .1, 1, 10)
225
+//from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)
177
     #define  DEFAULT_bedKp 10.00
226
     #define  DEFAULT_bedKp 10.00
178
     #define  DEFAULT_bedKi .023
227
     #define  DEFAULT_bedKi .023
179
     #define  DEFAULT_bedKd 305.4
228
     #define  DEFAULT_bedKd 305.4
205
 // Uncomment the following line to enable CoreXY kinematics
254
 // Uncomment the following line to enable CoreXY kinematics
206
 // #define COREXY
255
 // #define COREXY
207
 
256
 
208
-// corse Endstop Settings
257
+// coarse Endstop Settings
209
 #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
258
 #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
210
 
259
 
211
 #ifndef ENDSTOPPULLUPS
260
 #ifndef ENDSTOPPULLUPS
212
-  // fine Enstop settings: Individual Pullups. will be ignord if ENDSTOPPULLUPS is defined
213
-  #define ENDSTOPPULLUP_XMAX
214
-  #define ENDSTOPPULLUP_YMAX
215
-  #define ENDSTOPPULLUP_ZMAX
216
-  #define ENDSTOPPULLUP_XMIN
217
-  #define ENDSTOPPULLUP_YMIN
218
-  //#define ENDSTOPPULLUP_ZMIN
261
+  // fine Enstop settings: Individual Pullups. will be ignored if ENDSTOPPULLUPS is defined
262
+  // #define ENDSTOPPULLUP_XMAX
263
+  // #define ENDSTOPPULLUP_YMAX
264
+  // #define ENDSTOPPULLUP_ZMAX
265
+  // #define ENDSTOPPULLUP_XMIN
266
+  // #define ENDSTOPPULLUP_YMIN
267
+  // #define ENDSTOPPULLUP_ZMIN
219
 #endif
268
 #endif
220
 
269
 
221
 #ifdef ENDSTOPPULLUPS
270
 #ifdef ENDSTOPPULLUPS
232
 const bool Y_ENDSTOPS_INVERTING = true; // set to true to invert the logic of the endstops.
281
 const bool Y_ENDSTOPS_INVERTING = true; // set to true to invert the logic of the endstops.
233
 const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of the endstops.
282
 const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of the endstops.
234
 //#define DISABLE_MAX_ENDSTOPS
283
 //#define DISABLE_MAX_ENDSTOPS
284
+//#define DISABLE_MIN_ENDSTOPS
285
+
286
+// Disable max endstops for compatibility with endstop checking routine
287
+#if defined(COREXY) && !defined(DISABLE_MAX_ENDSTOPS)
288
+  #define DISABLE_MAX_ENDSTOPS
289
+#endif
235
 
290
 
236
 // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
291
 // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
237
 #define X_ENABLE_ON 0
292
 #define X_ENABLE_ON 0
258
 #define Y_HOME_DIR -1
313
 #define Y_HOME_DIR -1
259
 #define Z_HOME_DIR -1
314
 #define Z_HOME_DIR -1
260
 
315
 
261
-#define min_software_endstops true //If true, axis won't move to coordinates less than HOME_POS.
262
-#define max_software_endstops true  //If true, axis won't move to coordinates greater than the defined lengths below.
316
+#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS.
317
+#define max_software_endstops true  // If true, axis won't move to coordinates greater than the defined lengths below.
263
 // Travel limits after homing
318
 // Travel limits after homing
264
 #define X_MAX_POS 205
319
 #define X_MAX_POS 205
265
 #define X_MIN_POS 0
320
 #define X_MIN_POS 0
277
 //#define BED_CENTER_AT_0_0  // If defined, the center of the bed is at (X=0, Y=0)
332
 //#define BED_CENTER_AT_0_0  // If defined, the center of the bed is at (X=0, Y=0)
278
 
333
 
279
 //Manual homing switch locations:
334
 //Manual homing switch locations:
335
+// For deltabots this means top and center of the cartesian print volume.
280
 #define MANUAL_X_HOME_POS 0
336
 #define MANUAL_X_HOME_POS 0
281
 #define MANUAL_Y_HOME_POS 0
337
 #define MANUAL_Y_HOME_POS 0
282
 #define MANUAL_Z_HOME_POS 0
338
 #define MANUAL_Z_HOME_POS 0
339
+//#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing.
283
 
340
 
284
 //// MOVEMENT SETTINGS
341
 //// MOVEMENT SETTINGS
285
 #define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
342
 #define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
287
 
344
 
288
 // default settings
345
 // default settings
289
 
346
 
290
-#define DEFAULT_AXIS_STEPS_PER_UNIT   {78.7402,78.7402,200.0*8/3,760*1.1}  // default steps per unit for ultimaker
347
+#define DEFAULT_AXIS_STEPS_PER_UNIT   {78.7402,78.7402,200.0*8/3,760*1.1}  // default steps per unit for Ultimaker
291
 #define DEFAULT_MAX_FEEDRATE          {500, 500, 5, 25}    // (mm/sec)
348
 #define DEFAULT_MAX_FEEDRATE          {500, 500, 5, 25}    // (mm/sec)
292
 #define DEFAULT_MAX_ACCELERATION      {9000,9000,100,10000}    // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for skeinforge 40+, for older versions raise them a lot.
349
 #define DEFAULT_MAX_ACCELERATION      {9000,9000,100,10000}    // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for skeinforge 40+, for older versions raise them a lot.
293
 
350
 
294
 #define DEFAULT_ACCELERATION          3000    // X, Y, Z and E max acceleration in mm/s^2 for printing moves
351
 #define DEFAULT_ACCELERATION          3000    // X, Y, Z and E max acceleration in mm/s^2 for printing moves
295
-#define DEFAULT_RETRACT_ACCELERATION  3000   // X, Y, Z and E max acceleration in mm/s^2 for r retracts
352
+#define DEFAULT_RETRACT_ACCELERATION  3000   // X, Y, Z and E max acceleration in mm/s^2 for retracts
296
 
353
 
297
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
354
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
298
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
355
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
300
 // #define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
357
 // #define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
301
 // #define EXTRUDER_OFFSET_Y {0.0, 5.00}  // (in mm) for each extruder, offset of the hotend on the Y axis
358
 // #define EXTRUDER_OFFSET_Y {0.0, 5.00}  // (in mm) for each extruder, offset of the hotend on the Y axis
302
 
359
 
303
-// The speed change that does not require acceleration (i.e. the software might assume it can be done instanteneously)
360
+// The speed change that does not require acceleration (i.e. the software might assume it can be done instantaneously)
304
 #define DEFAULT_XYJERK                20.0    // (mm/sec)
361
 #define DEFAULT_XYJERK                20.0    // (mm/sec)
305
 #define DEFAULT_ZJERK                 0.4     // (mm/sec)
362
 #define DEFAULT_ZJERK                 0.4     // (mm/sec)
306
 #define DEFAULT_EJERK                 5.0    // (mm/sec)
363
 #define DEFAULT_EJERK                 5.0    // (mm/sec)
338
 //#define ULTIMAKERCONTROLLER //as available from the ultimaker online store.
395
 //#define ULTIMAKERCONTROLLER //as available from the ultimaker online store.
339
 //#define ULTIPANEL  //the ultipanel as on thingiverse
396
 //#define ULTIPANEL  //the ultipanel as on thingiverse
340
 
397
 
398
+// The MaKr3d Makr-Panel with graphic controller and SD support
399
+// http://reprap.org/wiki/MaKr3d_MaKrPanel
400
+//#define MAKRPANEL
401
+
341
 // The RepRapDiscount Smart Controller (white PCB)
402
 // The RepRapDiscount Smart Controller (white PCB)
342
 // http://reprap.org/wiki/RepRapDiscount_Smart_Controller
403
 // http://reprap.org/wiki/RepRapDiscount_Smart_Controller
343
 //#define REPRAP_DISCOUNT_SMART_CONTROLLER
404
 //#define REPRAP_DISCOUNT_SMART_CONTROLLER
357
 //#define REPRAPWORLD_KEYPAD
418
 //#define REPRAPWORLD_KEYPAD
358
 //#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // how much should be moved when a key is pressed, eg 10.0 means 10mm per click
419
 //#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // how much should be moved when a key is pressed, eg 10.0 means 10mm per click
359
 
420
 
421
+// The Elefu RA Board Control Panel
422
+// http://www.elefu.com/index.php?route=product/product&product_id=53
423
+// REMEMBER TO INSTALL LiquidCrystal_I2C.h in your ARUDINO library folder: https://github.com/kiyoshigawa/LiquidCrystal_I2C
424
+//#define RA_CONTROL_PANEL
425
+
360
 //automatic expansion
426
 //automatic expansion
427
+#if defined (MAKRPANEL)
428
+ #define DOGLCD
429
+ #define SDSUPPORT
430
+ #define ULTIPANEL
431
+ #define NEWPANEL
432
+ #define DEFAULT_LCD_CONTRAST 17
433
+#endif
434
+
361
 #if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
435
 #if defined (REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
362
  #define DOGLCD
436
  #define DOGLCD
363
  #define U8GLIB_ST7920
437
  #define U8GLIB_ST7920
373
   #define NEWPANEL
447
   #define NEWPANEL
374
   #define ULTIPANEL
448
   #define ULTIPANEL
375
 #endif
449
 #endif
450
+#if defined(RA_CONTROL_PANEL)
451
+ #define ULTIPANEL
452
+ #define NEWPANEL
453
+ #define LCD_I2C_TYPE_PCA8574
454
+ #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
455
+#endif
376
 
456
 
377
 //I2C PANELS
457
 //I2C PANELS
378
 
458
 
438
   #endif
518
   #endif
439
 #endif
519
 #endif
440
 
520
 
521
+// default LCD contrast for dogm-like LCD displays
522
+#ifdef DOGLCD
523
+# ifndef DEFAULT_LCD_CONTRAST
524
+#  define DEFAULT_LCD_CONTRAST 32
525
+# endif
526
+#endif
527
+
441
 // Increase the FAN pwm frequency. Removes the PWM noise but increases heating in the FET/Arduino
528
 // Increase the FAN pwm frequency. Removes the PWM noise but increases heating in the FET/Arduino
442
 //#define FAST_PWM_FAN
529
 //#define FAST_PWM_FAN
443
 
530
 
531
+// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency
532
+// which is not ass annoying as with the hardware PWM. On the other hand, if this frequency
533
+// is too low, you should also increment SOFT_PWM_SCALE.
534
+//#define FAN_SOFT_PWM
535
+
536
+// Incrementing this by 1 will double the software PWM frequency,
537
+// affecting heaters, and the fan if FAN_SOFT_PWM is enabled.
538
+// However, control resolution will be halved for each increment;
539
+// at zero value, there are 128 effective control positions.
540
+#define SOFT_PWM_SCALE 0
541
+
444
 // M240  Triggers a camera by emulating a Canon RC-1 Remote
542
 // M240  Triggers a camera by emulating a Canon RC-1 Remote
445
 // Data from: http://www.doc-diy.net/photo/rc-1_hacked/
543
 // Data from: http://www.doc-diy.net/photo/rc-1_hacked/
446
 // #define PHOTOGRAPH_PIN     23
544
 // #define PHOTOGRAPH_PIN     23
452
 //#define BARICUDA
550
 //#define BARICUDA
453
 
551
 
454
 /*********************************************************************\
552
 /*********************************************************************\
455
-*
456
 * R/C SERVO support
553
 * R/C SERVO support
457
-*
458
 * Sponsored by TrinityLabs, Reworked by codexmas
554
 * Sponsored by TrinityLabs, Reworked by codexmas
459
-*
460
 **********************************************************************/
555
 **********************************************************************/
461
 
556
 
462
 // Number of servos
557
 // Number of servos
466
 // leaving it undefined or defining as 0 will disable the servo subsystem
561
 // leaving it undefined or defining as 0 will disable the servo subsystem
467
 // If unsure, leave commented / disabled
562
 // If unsure, leave commented / disabled
468
 //
563
 //
469
-// #define NUM_SERVOS 3
564
+//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command
565
+
566
+// Servo Endstops
567
+// 
568
+// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes.
569
+// Use M206 command to correct for switch height offset to actual nozzle height. Store that setting with M500.
570
+// 
571
+//#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1
572
+//#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles
470
 
573
 
471
 #include "Configuration_adv.h"
574
 #include "Configuration_adv.h"
472
 #include "thermistortables.h"
575
 #include "thermistortables.h"

+ 12
- 1
Marlin/ConfigurationStore.cpp View File

37
 // the default values are used whenever there is a change to the data, to prevent
37
 // the default values are used whenever there is a change to the data, to prevent
38
 // wrong data being written to the variables.
38
 // wrong data being written to the variables.
39
 // ALSO:  always make sure the variables in the Store and retrieve sections are in the same order.
39
 // ALSO:  always make sure the variables in the Store and retrieve sections are in the same order.
40
-#define EEPROM_VERSION "V07"
40
+#define EEPROM_VERSION "V08"
41
 
41
 
42
 #ifdef EEPROM_SETTINGS
42
 #ifdef EEPROM_SETTINGS
43
 void Config_StoreSettings() 
43
 void Config_StoreSettings() 
78
     EEPROM_WRITE_VAR(i,dummy);
78
     EEPROM_WRITE_VAR(i,dummy);
79
     EEPROM_WRITE_VAR(i,dummy);
79
     EEPROM_WRITE_VAR(i,dummy);
80
   #endif
80
   #endif
81
+  #ifndef DOGLCD
82
+    int lcd_contrast = 32;
83
+  #endif
84
+  EEPROM_WRITE_VAR(i,lcd_contrast);
81
   char ver2[4]=EEPROM_VERSION;
85
   char ver2[4]=EEPROM_VERSION;
82
   i=EEPROM_OFFSET;
86
   i=EEPROM_OFFSET;
83
   EEPROM_WRITE_VAR(i,ver2); // validate data
87
   EEPROM_WRITE_VAR(i,ver2); // validate data
198
         EEPROM_READ_VAR(i,Kp);
202
         EEPROM_READ_VAR(i,Kp);
199
         EEPROM_READ_VAR(i,Ki);
203
         EEPROM_READ_VAR(i,Ki);
200
         EEPROM_READ_VAR(i,Kd);
204
         EEPROM_READ_VAR(i,Kd);
205
+        #ifndef DOGLCD
206
+        int lcd_contrast;
207
+        #endif
208
+        EEPROM_READ_VAR(i,lcd_contrast);
201
 
209
 
202
 		// Call updatePID (similar to when we have processed M301)
210
 		// Call updatePID (similar to when we have processed M301)
203
 		updatePID();
211
 		updatePID();
244
     absPreheatHPBTemp = ABS_PREHEAT_HPB_TEMP;
252
     absPreheatHPBTemp = ABS_PREHEAT_HPB_TEMP;
245
     absPreheatFanSpeed = ABS_PREHEAT_FAN_SPEED;
253
     absPreheatFanSpeed = ABS_PREHEAT_FAN_SPEED;
246
 #endif
254
 #endif
255
+#ifdef DOGLCD
256
+    lcd_contrast = DEFAULT_LCD_CONTRAST;
257
+#endif
247
 #ifdef PIDTEMP
258
 #ifdef PIDTEMP
248
     Kp = DEFAULT_Kp;
259
     Kp = DEFAULT_Kp;
249
     Ki = scalePID_i(DEFAULT_Ki);
260
     Ki = scalePID_i(DEFAULT_Ki);

+ 28
- 6
Marlin/Configuration_adv.h View File

18
 //#define WATCH_TEMP_PERIOD 40000 //40 seconds
18
 //#define WATCH_TEMP_PERIOD 40000 //40 seconds
19
 //#define WATCH_TEMP_INCREASE 10  //Heat up at least 10 degree in 20 seconds
19
 //#define WATCH_TEMP_INCREASE 10  //Heat up at least 10 degree in 20 seconds
20
 
20
 
21
-// Wait for Cooldown
22
-// This defines if the M109 call should not block if it is cooling down.
23
-// example: From a current temp of 220, you set M109 S200. 
24
-// if CooldownNoWait is defined M109 will not wait for the cooldown to finish
25
-#define CooldownNoWait true
26
-
27
 #ifdef PIDTEMP
21
 #ifdef PIDTEMP
28
   // this adds an experimental additional term to the heatingpower, proportional to the extrusion speed.
22
   // this adds an experimental additional term to the heatingpower, proportional to the extrusion speed.
29
   // if Kc is choosen well, the additional required power due to increased melting should be compensated.
23
   // if Kc is choosen well, the additional required power due to increased melting should be compensated.
152
   #define EXTRUDERS 1
146
   #define EXTRUDERS 1
153
 #endif
147
 #endif
154
 
148
 
149
+// Enable this for dual x-carriage printers. 
150
+// A dual x-carriage design has the advantage that the inactive extruder can be parked which
151
+// prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
152
+// allowing faster printing speeds.
153
+//#define DUAL_X_CARRIAGE
154
+#ifdef DUAL_X_CARRIAGE
155
+// Configuration for second X-carriage
156
+// Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop;
157
+// the second x-carriage always homes to the maximum endstop.
158
+#define X2_MIN_POS 88     // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage
159
+#define X2_MAX_POS 350.45 // set maximum to the distance between toolheads when both heads are homed 
160
+#define X2_HOME_DIR 1     // the second X-carriage always homes to the maximum endstop position
161
+#define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position 
162
+    // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software 
163
+    // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops
164
+    // without modifying the firmware (through the "M218 T1 X???" command).
165
+    // Remember: you should set the second extruder x-offset to 0 in your slicer.
166
+
167
+// Pins for second x-carriage stepper driver (defined here to avoid further complicating pins.h)
168
+#define X2_ENABLE_PIN 29
169
+#define X2_STEP_PIN 25
170
+#define X2_DIR_PIN 23
171
+
172
+#endif // DUAL_X_CARRIAGE
173
+    
155
 //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
174
 //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
156
 #define X_HOME_RETRACT_MM 5 
175
 #define X_HOME_RETRACT_MM 5 
157
 #define Y_HOME_RETRACT_MM 5 
176
 #define Y_HOME_RETRACT_MM 5 
318
 //===========================================================================
337
 //===========================================================================
319
 //=============================  Define Defines  ============================
338
 //=============================  Define Defines  ============================
320
 //===========================================================================
339
 //===========================================================================
340
+#if EXTRUDERS > 1 && defined TEMP_SENSOR_1_AS_REDUNDANT
341
+  #error "You cannot use TEMP_SENSOR_1_AS_REDUNDANT if EXTRUDERS > 1"
342
+#endif
321
 
343
 
322
 #if TEMP_SENSOR_0 > 0
344
 #if TEMP_SENSOR_0 > 0
323
   #define THERMISTORHEATER_0 TEMP_SENSOR_0
345
   #define THERMISTORHEATER_0 TEMP_SENSOR_0

+ 1
- 1
Marlin/LiquidCrystalRus.cpp View File

36
 //    S = 0; No shift 
36
 //    S = 0; No shift 
37
 //
37
 //
38
 // Note, however, that resetting the Arduino doesn't reset the LCD, so we
38
 // Note, however, that resetting the Arduino doesn't reset the LCD, so we
39
-// can't assume that its in that state when a sketch starts (and the
39
+// can't assume that it's in that state when a sketch starts (and the
40
 // LiquidCrystal constructor is called).
40
 // LiquidCrystal constructor is called).
41
 // 
41
 // 
42
 // modified 27 Jul 2011
42
 // modified 27 Jul 2011

+ 8
- 2
Marlin/Makefile View File

114
 else ifeq  ($(HARDWARE_MOTHERBOARD),63)
114
 else ifeq  ($(HARDWARE_MOTHERBOARD),63)
115
 HARDWARE_VARIANT ?= Sanguino
115
 HARDWARE_VARIANT ?= Sanguino
116
 MCU              ?= atmega644p
116
 MCU              ?= atmega644p
117
+else ifeq  ($(HARDWARE_MOTHERBOARD),65)
118
+HARDWARE_VARIANT ?= Sanguino
119
+MCU              ?= atmega1284p
120
+else ifeq  ($(HARDWARE_MOTHERBOARD),66)
121
+HARDWARE_VARIANT ?= Sanguino
122
+MCU              ?= atmega1284p
117
 
123
 
118
 #Ultimaker
124
 #Ultimaker
119
 else ifeq  ($(HARDWARE_MOTHERBOARD),7)
125
 else ifeq  ($(HARDWARE_MOTHERBOARD),7)
213
 	SdFile.cpp SdVolume.cpp motion_control.cpp planner.cpp		\
219
 	SdFile.cpp SdVolume.cpp motion_control.cpp planner.cpp		\
214
 	stepper.cpp temperature.cpp cardreader.cpp ConfigurationStore.cpp \
220
 	stepper.cpp temperature.cpp cardreader.cpp ConfigurationStore.cpp \
215
 	watchdog.cpp
221
 	watchdog.cpp
216
-CXXSRC += LiquidCrystal.cpp ultralcd.cpp SPI.cpp Servo.cpp
222
+CXXSRC += LiquidCrystal.cpp ultralcd.cpp SPI.cpp Servo.cpp Tone.cpp
217
 
223
 
218
 #Check for Arduino 1.0.0 or higher and use the correct sourcefiles for that version
224
 #Check for Arduino 1.0.0 or higher and use the correct sourcefiles for that version
219
 ifeq ($(shell [ $(ARDUINO_VERSION) -ge 100 ] && echo true), true)
225
 ifeq ($(shell [ $(ARDUINO_VERSION) -ge 100 ] && echo true), true)
287
 # Programming support using avrdude. Settings and variables.
293
 # Programming support using avrdude. Settings and variables.
288
 AVRDUDE_PORT = $(UPLOAD_PORT)
294
 AVRDUDE_PORT = $(UPLOAD_PORT)
289
 AVRDUDE_WRITE_FLASH = -U flash:w:$(BUILD_DIR)/$(TARGET).hex:i
295
 AVRDUDE_WRITE_FLASH = -U flash:w:$(BUILD_DIR)/$(TARGET).hex:i
290
-AVRDUDE_FLAGS = -D -C $(ARDUINO_INSTALL_DIR)/hardware/tools/avrdude.conf \
296
+AVRDUDE_FLAGS = -D -C $(ARDUINO_INSTALL_DIR)/hardware/tools/avr/etc/avrdude.conf \
291
 	-p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) \
297
 	-p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) \
292
 	-b $(UPLOAD_RATE)
298
 	-b $(UPLOAD_RATE)
293
 
299
 

+ 12
- 1
Marlin/Marlin.h View File

96
 
96
 
97
 void manage_inactivity();
97
 void manage_inactivity();
98
 
98
 
99
-#if defined(X_ENABLE_PIN) && X_ENABLE_PIN > -1
99
+#if defined(DUAL_X_CARRIAGE) && defined(X_ENABLE_PIN) && X_ENABLE_PIN > -1 \
100
+    && defined(X2_ENABLE_PIN) && X2_ENABLE_PIN > -1
101
+  #define  enable_x() do { WRITE(X_ENABLE_PIN, X_ENABLE_ON); WRITE(X2_ENABLE_PIN, X_ENABLE_ON); } while (0)
102
+  #define disable_x() do { WRITE(X_ENABLE_PIN,!X_ENABLE_ON); WRITE(X2_ENABLE_PIN,!X_ENABLE_ON); } while (0)
103
+#elif defined(X_ENABLE_PIN) && X_ENABLE_PIN > -1
100
   #define  enable_x() WRITE(X_ENABLE_PIN, X_ENABLE_ON)
104
   #define  enable_x() WRITE(X_ENABLE_PIN, X_ENABLE_ON)
101
   #define disable_x() WRITE(X_ENABLE_PIN,!X_ENABLE_ON)
105
   #define disable_x() WRITE(X_ENABLE_PIN,!X_ENABLE_ON)
102
 #else
106
 #else
157
 void ClearToSend();
161
 void ClearToSend();
158
 
162
 
159
 void get_coordinates();
163
 void get_coordinates();
164
+#ifdef DELTA
165
+void calculate_delta(float cartesian[3]);
166
+#endif
160
 void prepare_move();
167
 void prepare_move();
161
 void kill();
168
 void kill();
162
 void Stop();
169
 void Stop();
191
 extern int EtoPPressure;
198
 extern int EtoPPressure;
192
 #endif
199
 #endif
193
 
200
 
201
+#ifdef FAN_SOFT_PWM
202
+extern unsigned char fanSpeedSoftPwm;
203
+#endif
204
+
194
 #ifdef FWRETRACT
205
 #ifdef FWRETRACT
195
 extern bool autoretract_enabled;
206
 extern bool autoretract_enabled;
196
 extern bool retracted;
207
 extern bool retracted;

+ 286
- 35
Marlin/Marlin_main.cpp View File

67
 // G91 - Use Relative Coordinates
67
 // G91 - Use Relative Coordinates
68
 // G92 - Set current position to cordinates given
68
 // G92 - Set current position to cordinates given
69
 
69
 
70
-//RepRap M Codes
70
+// M Codes
71
 // M0   - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled)
71
 // M0   - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled)
72
 // M1   - Same as M0
72
 // M1   - Same as M0
73
-// M104 - Set extruder target temp
74
-// M105 - Read current temp
75
-// M106 - Fan on
76
-// M107 - Fan off
77
-// M109 - Wait for extruder current temp to reach target temp.
78
-// M114 - Display current position
79
-
80
-//Custom M Codes
81
 // M17  - Enable/Power all stepper motors
73
 // M17  - Enable/Power all stepper motors
82
 // M18  - Disable all stepper motors; same as M84
74
 // M18  - Disable all stepper motors; same as M84
83
 // M20  - List SD card
75
 // M20  - List SD card
92
 // M29  - Stop SD write
84
 // M29  - Stop SD write
93
 // M30  - Delete file from SD (M30 filename.g)
85
 // M30  - Delete file from SD (M30 filename.g)
94
 // M31  - Output time since last M109 or SD card start to serial
86
 // M31  - Output time since last M109 or SD card start to serial
87
+// M32  - Select file and start SD print (Can be used when printing from SD card)
95
 // M42  - Change pin status via gcode Use M42 Px Sy to set pin x to value y, when omitting Px the onboard led will be used.
88
 // M42  - Change pin status via gcode Use M42 Px Sy to set pin x to value y, when omitting Px the onboard led will be used.
96
 // M80  - Turn on Power Supply
89
 // M80  - Turn on Power Supply
97
 // M81  - Turn off Power Supply
90
 // M81  - Turn off Power Supply
101
 //        or use S<seconds> to specify an inactivity timeout, after which the steppers will be disabled.  S0 to disable the timeout.
94
 //        or use S<seconds> to specify an inactivity timeout, after which the steppers will be disabled.  S0 to disable the timeout.
102
 // M85  - Set inactivity shutdown timer with parameter S<seconds>. To disable set zero (default)
95
 // M85  - Set inactivity shutdown timer with parameter S<seconds>. To disable set zero (default)
103
 // M92  - Set axis_steps_per_unit - same syntax as G92
96
 // M92  - Set axis_steps_per_unit - same syntax as G92
97
+// M104 - Set extruder target temp
98
+// M105 - Read current temp
99
+// M106 - Fan on
100
+// M107 - Fan off
101
+// M109 - Sxxx Wait for extruder current temp to reach target temp. Waits only when heating
102
+//        Rxxx Wait for extruder current temp to reach target temp. Waits when heating and cooling
104
 // M114 - Output current position to serial port
103
 // M114 - Output current position to serial port
105
 // M115 - Capabilities string
104
 // M115 - Capabilities string
106
 // M117 - display message
105
 // M117 - display message
110
 // M128 - EtoP Open (BariCUDA EtoP = electricity to air pressure transducer by jmil)
109
 // M128 - EtoP Open (BariCUDA EtoP = electricity to air pressure transducer by jmil)
111
 // M129 - EtoP Closed (BariCUDA EtoP = electricity to air pressure transducer by jmil)
110
 // M129 - EtoP Closed (BariCUDA EtoP = electricity to air pressure transducer by jmil)
112
 // M140 - Set bed target temp
111
 // M140 - Set bed target temp
113
-// M190 - Wait for bed current temp to reach target temp.
112
+// M190 - Sxxx Wait for bed current temp to reach target temp. Waits only when heating
113
+//        Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling
114
 // M200 - Set filament diameter
114
 // M200 - Set filament diameter
115
 // M201 - Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000)
115
 // M201 - Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000)
116
 // M202 - Set max acceleration in units/s^2 for travel moves (M202 X1000 Y1000) Unused in Marlin!!
116
 // M202 - Set max acceleration in units/s^2 for travel moves (M202 X1000 Y1000) Unused in Marlin!!
125
 // M220 S<factor in percent>- set speed factor override percentage
125
 // M220 S<factor in percent>- set speed factor override percentage
126
 // M221 S<factor in percent>- set extrude factor override percentage
126
 // M221 S<factor in percent>- set extrude factor override percentage
127
 // M240 - Trigger a camera to take a photograph
127
 // M240 - Trigger a camera to take a photograph
128
+// M250 - Set LCD contrast C<contrast value> (value 0..63)
128
 // M280 - set servo position absolute. P: servo index, S: angle or microseconds
129
 // M280 - set servo position absolute. P: servo index, S: angle or microseconds
129
 // M300 - Play beepsound S<frequency Hz> P<duration ms>
130
 // M300 - Play beepsound S<frequency Hz> P<duration ms>
130
 // M301 - Set PID parameters P I and D
131
 // M301 - Set PID parameters P I and D
131
-// M302 - Allow cold extrudes
132
+// M302 - Allow cold extrudes, or set the minimum extrude S<temperature>.
132
 // M303 - PID relay autotune S<temperature> sets the target temperature. (default target temperature = 150C)
133
 // M303 - PID relay autotune S<temperature> sets the target temperature. (default target temperature = 150C)
133
 // M304 - Set bed PID parameters P I and D
134
 // M304 - Set bed PID parameters P I and D
134
 // M400 - Finish all moves
135
 // M400 - Finish all moves
177
 #endif
178
 #endif
178
 uint8_t active_extruder = 0;
179
 uint8_t active_extruder = 0;
179
 int fanSpeed=0;
180
 int fanSpeed=0;
181
+#ifdef SERVO_ENDSTOPS
182
+  int servo_endstops[] = SERVO_ENDSTOPS;
183
+  int servo_endstop_angles[] = SERVO_ENDSTOP_ANGLES;
184
+#endif
180
 #ifdef BARICUDA
185
 #ifdef BARICUDA
181
 int ValvePressure=0;
186
 int ValvePressure=0;
182
 int EtoPPressure=0;
187
 int EtoPPressure=0;
194
 //===========================================================================
199
 //===========================================================================
195
 const char axis_codes[NUM_AXIS] = {'X', 'Y', 'Z', 'E'};
200
 const char axis_codes[NUM_AXIS] = {'X', 'Y', 'Z', 'E'};
196
 static float destination[NUM_AXIS] = {  0.0, 0.0, 0.0, 0.0};
201
 static float destination[NUM_AXIS] = {  0.0, 0.0, 0.0, 0.0};
202
+#ifdef DELTA
203
+static float delta[3] = {0.0, 0.0, 0.0};
204
+#endif
197
 static float offset[3] = {0.0, 0.0, 0.0};
205
 static float offset[3] = {0.0, 0.0, 0.0};
198
 static bool home_all_axis = true;
206
 static bool home_all_axis = true;
199
 static float feedrate = 1500.0, next_feedrate, saved_feedrate;
207
 static float feedrate = 1500.0, next_feedrate, saved_feedrate;
234
   Servo servos[NUM_SERVOS];
242
   Servo servos[NUM_SERVOS];
235
 #endif
243
 #endif
236
 
244
 
245
+bool CooldownNoWait = true;
246
+bool target_direction;
247
+
237
 //===========================================================================
248
 //===========================================================================
238
 //=============================ROUTINES=============================
249
 //=============================ROUTINES=============================
239
 //===========================================================================
250
 //===========================================================================
351
   #if (NUM_SERVOS >= 5)
362
   #if (NUM_SERVOS >= 5)
352
     #error "TODO: enter initalisation code for more servos"
363
     #error "TODO: enter initalisation code for more servos"
353
   #endif
364
   #endif
365
+
366
+  // Set position of Servo Endstops that are defined
367
+  #ifdef SERVO_ENDSTOPS
368
+  for(int8_t i = 0; i < 3; i++)
369
+  {
370
+    if(servo_endstops[i] > -1) {
371
+      servos[servo_endstops[i]].write(servo_endstop_angles[i * 2 + 1]);
372
+    }
373
+  }
374
+  #endif
354
 }
375
 }
355
 
376
 
356
 void setup()
377
 void setup()
404
   servo_init();
425
   servo_init();
405
 
426
 
406
   lcd_init();
427
   lcd_init();
428
+  _delay_ms(1000);	// wait 1sec to display the splash screen
407
   
429
   
408
   #if defined(CONTROLLERFAN_PIN) && CONTROLLERFAN_PIN > -1
430
   #if defined(CONTROLLERFAN_PIN) && CONTROLLERFAN_PIN > -1
409
     SET_OUTPUT(CONTROLLERFAN_PIN); //Set pin used for driver cooling fan
431
     SET_OUTPUT(CONTROLLERFAN_PIN); //Set pin used for driver cooling fan
655
 XYZ_CONSTS_FROM_CONFIG(float, home_retract_mm, HOME_RETRACT_MM);
677
 XYZ_CONSTS_FROM_CONFIG(float, home_retract_mm, HOME_RETRACT_MM);
656
 XYZ_CONSTS_FROM_CONFIG(signed char, home_dir,  HOME_DIR);
678
 XYZ_CONSTS_FROM_CONFIG(signed char, home_dir,  HOME_DIR);
657
 
679
 
680
+#ifdef DUAL_X_CARRIAGE
681
+  #if EXTRUDERS == 1 || defined(COREXY) \
682
+      || !defined(X2_ENABLE_PIN) || !defined(X2_STEP_PIN) || !defined(X2_DIR_PIN) \
683
+      || !defined(X2_HOME_POS) || !defined(X2_MIN_POS) || !defined(X2_MAX_POS) \
684
+      || !defined(X_MAX_PIN) || X_MAX_PIN < 0
685
+    #error "Missing or invalid definitions for DUAL_X_CARRIAGE mode."
686
+  #endif
687
+  #if X_HOME_DIR != -1 || X2_HOME_DIR != 1
688
+    #error "Please use canonical x-carriage assignment" // the x-carriages are defined by their homing directions
689
+  #endif  
690
+    
691
+static float x_home_pos(int extruder) {
692
+  if (extruder == 0)
693
+    return base_home_pos(X_AXIS) + add_homeing[X_AXIS];
694
+  else
695
+    // In dual carriage mode the extruder offset provides an override of the
696
+    // second X-carriage offset when homed - otherwise X2_HOME_POS is used.
697
+    // This allow soft recalibration of the second extruder offset position without firmware reflash 
698
+    // (through the M218 command).
699
+    return (extruder_offset[X_AXIS][1] > 0) ? extruder_offset[X_AXIS][1] : X2_HOME_POS;
700
+}
701
+
702
+static int x_home_dir(int extruder) {
703
+  return (extruder == 0) ? X_HOME_DIR : X2_HOME_DIR;
704
+}
705
+
706
+static float inactive_x_carriage_pos = X2_MAX_POS;
707
+#endif     
708
+
658
 static void axis_is_at_home(int axis) {
709
 static void axis_is_at_home(int axis) {
710
+#ifdef DUAL_X_CARRIAGE
711
+  if (axis == X_AXIS && active_extruder != 0) {
712
+    current_position[X_AXIS] = x_home_pos(active_extruder);
713
+    min_pos[X_AXIS] =          X2_MIN_POS;
714
+    max_pos[X_AXIS] =          max(extruder_offset[X_AXIS][1], X2_MAX_POS);
715
+    return;
716
+  }
717
+#endif  
659
   current_position[axis] = base_home_pos(axis) + add_homeing[axis];
718
   current_position[axis] = base_home_pos(axis) + add_homeing[axis];
660
   min_pos[axis] =          base_min_pos(axis) + add_homeing[axis];
719
   min_pos[axis] =          base_min_pos(axis) + add_homeing[axis];
661
   max_pos[axis] =          base_max_pos(axis) + add_homeing[axis];
720
   max_pos[axis] =          base_max_pos(axis) + add_homeing[axis];
669
       axis==Y_AXIS ? HOMEAXIS_DO(Y) :
728
       axis==Y_AXIS ? HOMEAXIS_DO(Y) :
670
       axis==Z_AXIS ? HOMEAXIS_DO(Z) :
729
       axis==Z_AXIS ? HOMEAXIS_DO(Z) :
671
       0) {
730
       0) {
731
+    int axis_home_dir = home_dir(axis);
732
+#ifdef DUAL_X_CARRIAGE
733
+    if (axis == X_AXIS)
734
+      axis_home_dir = x_home_dir(active_extruder);
735
+#endif
736
+
737
+    // Engage Servo endstop if enabled
738
+    #ifdef SERVO_ENDSTOPS
739
+      if (SERVO_ENDSTOPS[axis] > -1) {
740
+        servos[servo_endstops[axis]].write(servo_endstop_angles[axis * 2]);
741
+      }
742
+    #endif
743
+      
672
     current_position[axis] = 0;
744
     current_position[axis] = 0;
673
     plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
745
     plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
674
-    destination[axis] = 1.5 * max_length(axis) * home_dir(axis);
746
+    destination[axis] = 1.5 * max_length(axis) * axis_home_dir;
675
     feedrate = homing_feedrate[axis];
747
     feedrate = homing_feedrate[axis];
676
     plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
748
     plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
677
     st_synchronize();
749
     st_synchronize();
678
 
750
 
679
     current_position[axis] = 0;
751
     current_position[axis] = 0;
680
     plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
752
     plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
681
-    destination[axis] = -home_retract_mm(axis) * home_dir(axis);
753
+    destination[axis] = -home_retract_mm(axis) * axis_home_dir;
682
     plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
754
     plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
683
     st_synchronize();
755
     st_synchronize();
684
 
756
 
685
-    destination[axis] = 2*home_retract_mm(axis) * home_dir(axis);
757
+    destination[axis] = 2*home_retract_mm(axis) * axis_home_dir;
686
     feedrate = homing_feedrate[axis]/2 ;
758
     feedrate = homing_feedrate[axis]/2 ;
687
     plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
759
     plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
688
     st_synchronize();
760
     st_synchronize();
691
     destination[axis] = current_position[axis];
763
     destination[axis] = current_position[axis];
692
     feedrate = 0.0;
764
     feedrate = 0.0;
693
     endstops_hit_on_purpose();
765
     endstops_hit_on_purpose();
766
+
767
+    // Retract Servo endstop if enabled
768
+    #ifdef SERVO_ENDSTOPS
769
+      if (SERVO_ENDSTOPS[axis] > -1) {
770
+        servos[servo_endstops[axis]].write(servo_endstop_angles[axis * 2 + 1]);
771
+      }
772
+    #endif
694
   }
773
   }
695
 }
774
 }
696
 #define HOMEAXIS(LETTER) homeaxis(LETTER##_AXIS)
775
 #define HOMEAXIS(LETTER) homeaxis(LETTER##_AXIS)
781
       for(int8_t i=0; i < NUM_AXIS; i++) {
860
       for(int8_t i=0; i < NUM_AXIS; i++) {
782
         destination[i] = current_position[i];
861
         destination[i] = current_position[i];
783
       }
862
       }
784
-      feedrate = 0.0;
863
+          feedrate = 0.0;
864
+
865
+#ifdef DELTA
866
+          // A delta can only safely home all axis at the same time
867
+          // all axis have to home at the same time
868
+
869
+          // Move all carriages up together until the first endstop is hit.
870
+          current_position[X_AXIS] = 0;
871
+          current_position[Y_AXIS] = 0;
872
+          current_position[Z_AXIS] = 0;
873
+          plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); 
874
+
875
+          destination[X_AXIS] = 3 * Z_MAX_LENGTH;
876
+          destination[Y_AXIS] = 3 * Z_MAX_LENGTH;
877
+          destination[Z_AXIS] = 3 * Z_MAX_LENGTH;
878
+          feedrate = 1.732 * homing_feedrate[X_AXIS];
879
+          plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
880
+          st_synchronize();
881
+          endstops_hit_on_purpose();
882
+
883
+          current_position[X_AXIS] = destination[X_AXIS];
884
+          current_position[Y_AXIS] = destination[Y_AXIS];
885
+          current_position[Z_AXIS] = destination[Z_AXIS];
886
+          
887
+          // take care of back off and rehome now we are all at the top
888
+          HOMEAXIS(X);
889
+          HOMEAXIS(Y);
890
+          HOMEAXIS(Z);
891
+
892
+          calculate_delta(current_position);
893
+          plan_set_position(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS]);
894
+
895
+#else // NOT DELTA
896
+
785
       home_all_axis = !((code_seen(axis_codes[0])) || (code_seen(axis_codes[1])) || (code_seen(axis_codes[2])));
897
       home_all_axis = !((code_seen(axis_codes[0])) || (code_seen(axis_codes[1])) || (code_seen(axis_codes[2])));
786
 
898
 
787
       #if Z_HOME_DIR > 0                      // If homing away from BED do Z first
899
       #if Z_HOME_DIR > 0                      // If homing away from BED do Z first
795
       {
907
       {
796
         current_position[X_AXIS] = 0;current_position[Y_AXIS] = 0;
908
         current_position[X_AXIS] = 0;current_position[Y_AXIS] = 0;
797
 
909
 
910
+       #ifndef DUAL_X_CARRIAGE
911
+        int x_axis_home_dir = home_dir(X_AXIS);
912
+       #else
913
+        int x_axis_home_dir = x_home_dir(active_extruder);
914
+       #endif
915
+        
798
         plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
916
         plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
799
-        destination[X_AXIS] = 1.5 * X_MAX_LENGTH * X_HOME_DIR;destination[Y_AXIS] = 1.5 * Y_MAX_LENGTH * Y_HOME_DIR;
917
+        destination[X_AXIS] = 1.5 * max_length(X_AXIS) * x_axis_home_dir;destination[Y_AXIS] = 1.5 * max_length(Y_AXIS) * home_dir(Y_AXIS);
800
         feedrate = homing_feedrate[X_AXIS];
918
         feedrate = homing_feedrate[X_AXIS];
801
         if(homing_feedrate[Y_AXIS]<feedrate)
919
         if(homing_feedrate[Y_AXIS]<feedrate)
802
           feedrate =homing_feedrate[Y_AXIS];
920
           feedrate =homing_feedrate[Y_AXIS];
812
         feedrate = 0.0;
930
         feedrate = 0.0;
813
         st_synchronize();
931
         st_synchronize();
814
         endstops_hit_on_purpose();
932
         endstops_hit_on_purpose();
933
+
934
+        current_position[X_AXIS] = destination[X_AXIS];
935
+        current_position[Y_AXIS] = destination[Y_AXIS];
936
+        current_position[Z_AXIS] = destination[Z_AXIS];
815
       }
937
       }
816
       #endif
938
       #endif
817
 
939
 
818
       if((home_all_axis) || (code_seen(axis_codes[X_AXIS])))
940
       if((home_all_axis) || (code_seen(axis_codes[X_AXIS])))
819
       {
941
       {
942
+      #ifdef DUAL_X_CARRIAGE
943
+        int tmp_extruder = active_extruder;
944
+        active_extruder = !active_extruder;
945
+        HOMEAXIS(X);
946
+        inactive_x_carriage_pos = current_position[X_AXIS];
947
+        active_extruder = tmp_extruder;
948
+      #endif         
820
         HOMEAXIS(X);
949
         HOMEAXIS(X);
821
       }
950
       }
822
 
951
 
849
         }
978
         }
850
       }
979
       }
851
       plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
980
       plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
852
-
981
+#endif // else DELTA
982
+          
853
       #ifdef ENDSTOPS_ONLY_FOR_HOMING
983
       #ifdef ENDSTOPS_ONLY_FOR_HOMING
854
         enable_endstops(false);
984
         enable_endstops(false);
855
       #endif
985
       #endif
988
         card.removeFile(strchr_pointer + 4);
1118
         card.removeFile(strchr_pointer + 4);
989
       }
1119
       }
990
       break;
1120
       break;
1121
+    case 32: //M32 - Select file and start SD print
1122
+      if(card.sdprinting) {
1123
+        st_synchronize();
1124
+        card.closefile();
1125
+        card.sdprinting = false;
1126
+      }
1127
+      starpos = (strchr(strchr_pointer + 4,'*'));
1128
+      if(starpos!=NULL)
1129
+        *(starpos-1)='\0';
1130
+      card.openFile(strchr_pointer + 4,true);
1131
+      card.startFileprint();
1132
+      starttime=millis();
1133
+      break;
991
     case 928: //M928 - Start SD write
1134
     case 928: //M928 - Start SD write
992
       starpos = (strchr(strchr_pointer + 5,'*'));
1135
       starpos = (strchr(strchr_pointer + 5,'*'));
993
       if(starpos != NULL){
1136
       if(starpos != NULL){
1055
     case 105 : // M105
1198
     case 105 : // M105
1056
       if(setTargetedHotend(105)){
1199
       if(setTargetedHotend(105)){
1057
         break;
1200
         break;
1058
-      }
1201
+        }
1059
       #if defined(TEMP_0_PIN) && TEMP_0_PIN > -1
1202
       #if defined(TEMP_0_PIN) && TEMP_0_PIN > -1
1060
         SERIAL_PROTOCOLPGM("ok T:");
1203
         SERIAL_PROTOCOLPGM("ok T:");
1061
         SERIAL_PROTOCOL_F(degHotend(tmp_extruder),1);
1204
         SERIAL_PROTOCOL_F(degHotend(tmp_extruder),1);
1098
       #ifdef AUTOTEMP
1241
       #ifdef AUTOTEMP
1099
         autotemp_enabled=false;
1242
         autotemp_enabled=false;
1100
       #endif
1243
       #endif
1101
-      if (code_seen('S')) setTargetHotend(code_value(), tmp_extruder);
1244
+      if (code_seen('S')) { 
1245
+        setTargetHotend(code_value(), tmp_extruder);
1246
+        CooldownNoWait = true;
1247
+      } else if (code_seen('R')) {
1248
+        setTargetHotend(code_value(), tmp_extruder);
1249
+        CooldownNoWait = false;
1250
+      }
1102
       #ifdef AUTOTEMP
1251
       #ifdef AUTOTEMP
1103
         if (code_seen('S')) autotemp_min=code_value();
1252
         if (code_seen('S')) autotemp_min=code_value();
1104
         if (code_seen('B')) autotemp_max=code_value();
1253
         if (code_seen('B')) autotemp_max=code_value();
1113
       codenum = millis();
1262
       codenum = millis();
1114
 
1263
 
1115
       /* See if we are heating up or cooling down */
1264
       /* See if we are heating up or cooling down */
1116
-      bool target_direction = isHeatingHotend(tmp_extruder); // true if heating, false if cooling
1265
+      target_direction = isHeatingHotend(tmp_extruder); // true if heating, false if cooling
1117
 
1266
 
1118
       #ifdef TEMP_RESIDENCY_TIME
1267
       #ifdef TEMP_RESIDENCY_TIME
1119
         long residencyStart;
1268
         long residencyStart;
1169
     case 190: // M190 - Wait for bed heater to reach target.
1318
     case 190: // M190 - Wait for bed heater to reach target.
1170
     #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1
1319
     #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1
1171
         LCD_MESSAGEPGM(MSG_BED_HEATING);
1320
         LCD_MESSAGEPGM(MSG_BED_HEATING);
1172
-        if (code_seen('S')) setTargetBed(code_value());
1321
+        if (code_seen('S')) { 
1322
+          setTargetBed(code_value());
1323
+          CooldownNoWait = true;
1324
+        } else if (code_seen('R')) {
1325
+          setTargetBed(code_value());
1326
+          CooldownNoWait = false;
1327
+        }
1173
         codenum = millis();
1328
         codenum = millis();
1174
-        while(isHeatingBed())
1329
+        
1330
+        target_direction = isHeatingBed(); // true if heating, false if cooling
1331
+        
1332
+        while ( target_direction ? (isHeatingBed()) : (isCoolingBed()&&(CooldownNoWait==false)) )
1175
         {
1333
         {
1176
           if(( millis() - codenum) > 1000 ) //Print Temp Reading every 1 second while heating up.
1334
           if(( millis() - codenum) > 1000 ) //Print Temp Reading every 1 second while heating up.
1177
           {
1335
           {
1550
     #if LARGE_FLASH == true && ( BEEPER > 0 || defined(ULTRALCD) )
1708
     #if LARGE_FLASH == true && ( BEEPER > 0 || defined(ULTRALCD) )
1551
     case 300: // M300
1709
     case 300: // M300
1552
     {
1710
     {
1553
-      int beepS = 400;
1554
-      int beepP = 1000;
1555
-      if(code_seen('S')) beepS = code_value();
1556
-      if(code_seen('P')) beepP = code_value();
1557
-      #if BEEPER > 0
1558
-        tone(BEEPER, beepS);
1711
+      int beepS = code_seen('S') ? code_value() : 110;
1712
+      int beepP = code_seen('P') ? code_value() : 1000;
1713
+      if (beepS > 0)
1714
+      {
1715
+        #if BEEPER > 0
1716
+          tone(BEEPER, beepS);
1717
+          delay(beepP);
1718
+          noTone(BEEPER);
1719
+        #elif defined(ULTRALCD)
1720
+          lcd_buzz(beepS, beepP);
1721
+        #endif
1722
+      }
1723
+      else
1724
+      {
1559
         delay(beepP);
1725
         delay(beepP);
1560
-        noTone(BEEPER);
1561
-      #elif defined(ULTRALCD)
1562
-        lcd_buzz(beepS, beepP);
1563
-      #endif
1726
+      }
1564
     }
1727
     }
1565
     break;
1728
     break;
1566
     #endif // M300
1729
     #endif // M300
1633
       #endif
1796
       #endif
1634
      }
1797
      }
1635
     break;
1798
     break;
1636
-
1637
-    case 302: // allow cold extrudes
1799
+#ifdef DOGLCD
1800
+    case 250: // M250  Set LCD contrast value: C<value> (value 0..63)
1801
+     {
1802
+	  if (code_seen('C')) {
1803
+	   lcd_setcontrast( ((int)code_value())&63 );
1804
+          }
1805
+          SERIAL_PROTOCOLPGM("lcd contrast value: ");
1806
+          SERIAL_PROTOCOL(lcd_contrast);
1807
+          SERIAL_PROTOCOLLN("");
1808
+     }
1809
+    break;
1810
+#endif
1811
+    #ifdef PREVENT_DANGEROUS_EXTRUDE
1812
+    case 302: // allow cold extrudes, or set the minimum extrude temperature
1638
     {
1813
     {
1639
-      allow_cold_extrudes(true);
1814
+	  float temp = .0;
1815
+	  if (code_seen('S')) temp=code_value();
1816
+      set_extrude_min_temp(temp);
1640
     }
1817
     }
1641
     break;
1818
     break;
1819
+	#endif
1642
     case 303: // M303 PID autotune
1820
     case 303: // M303 PID autotune
1643
     {
1821
     {
1644
       float temp = 150.0;
1822
       float temp = 150.0;
1887
       if(tmp_extruder != active_extruder) {
2065
       if(tmp_extruder != active_extruder) {
1888
         // Save current position to return to after applying extruder offset
2066
         // Save current position to return to after applying extruder offset
1889
         memcpy(destination, current_position, sizeof(destination));
2067
         memcpy(destination, current_position, sizeof(destination));
2068
+      #ifdef DUAL_X_CARRIAGE
2069
+        // only apply Y extruder offset in dual x carriage mode (x offset is already used in determining home pos)
2070
+        current_position[Y_AXIS] = current_position[Y_AXIS] -
2071
+                     extruder_offset[Y_AXIS][active_extruder] +
2072
+                     extruder_offset[Y_AXIS][tmp_extruder];
2073
+
2074
+        float tmp_x_pos = current_position[X_AXIS];
2075
+
2076
+        // Set the new active extruder and position
2077
+        active_extruder = tmp_extruder;
2078
+        axis_is_at_home(X_AXIS); //this function updates X min/max values.
2079
+        current_position[X_AXIS] = inactive_x_carriage_pos;
2080
+        inactive_x_carriage_pos = tmp_x_pos;      
2081
+      #else    
1890
         // Offset extruder (only by XY)
2082
         // Offset extruder (only by XY)
1891
         int i;
2083
         int i;
1892
         for(i = 0; i < 2; i++) {
2084
         for(i = 0; i < 2; i++) {
1896
         }
2088
         }
1897
         // Set the new active extruder and position
2089
         // Set the new active extruder and position
1898
         active_extruder = tmp_extruder;
2090
         active_extruder = tmp_extruder;
2091
+      #endif //else DUAL_X_CARRIAGE
1899
         plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
2092
         plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
1900
         // Move to the old position if 'F' was in the parameters
2093
         // Move to the old position if 'F' was in the parameters
1901
         if(make_move && Stopped == false) {
2094
         if(make_move && Stopped == false) {
2032
   }
2225
   }
2033
 }
2226
 }
2034
 
2227
 
2228
+#ifdef DELTA
2229
+void calculate_delta(float cartesian[3])
2230
+{
2231
+  delta[X_AXIS] = sqrt(sq(DELTA_DIAGONAL_ROD)
2232
+                       - sq(DELTA_TOWER1_X-cartesian[X_AXIS])
2233
+                       - sq(DELTA_TOWER1_Y-cartesian[Y_AXIS])
2234
+                       ) + cartesian[Z_AXIS];
2235
+  delta[Y_AXIS] = sqrt(sq(DELTA_DIAGONAL_ROD)
2236
+                       - sq(DELTA_TOWER2_X-cartesian[X_AXIS])
2237
+                       - sq(DELTA_TOWER2_Y-cartesian[Y_AXIS])
2238
+                       ) + cartesian[Z_AXIS];
2239
+  delta[Z_AXIS] = sqrt(sq(DELTA_DIAGONAL_ROD)
2240
+                       - sq(DELTA_TOWER3_X-cartesian[X_AXIS])
2241
+                       - sq(DELTA_TOWER3_Y-cartesian[Y_AXIS])
2242
+                       ) + cartesian[Z_AXIS];
2243
+  /*
2244
+  SERIAL_ECHOPGM("cartesian x="); SERIAL_ECHO(cartesian[X_AXIS]);
2245
+  SERIAL_ECHOPGM(" y="); SERIAL_ECHO(cartesian[Y_AXIS]);
2246
+  SERIAL_ECHOPGM(" z="); SERIAL_ECHOLN(cartesian[Z_AXIS]);
2247
+
2248
+  SERIAL_ECHOPGM("delta x="); SERIAL_ECHO(delta[X_AXIS]);
2249
+  SERIAL_ECHOPGM(" y="); SERIAL_ECHO(delta[Y_AXIS]);
2250
+  SERIAL_ECHOPGM(" z="); SERIAL_ECHOLN(delta[Z_AXIS]);
2251
+  */
2252
+}
2253
+#endif
2254
+
2035
 void prepare_move()
2255
 void prepare_move()
2036
 {
2256
 {
2037
   clamp_to_software_endstops(destination);
2257
   clamp_to_software_endstops(destination);
2038
 
2258
 
2039
   previous_millis_cmd = millis();
2259
   previous_millis_cmd = millis();
2260
+#ifdef DELTA
2261
+  float difference[NUM_AXIS];
2262
+  for (int8_t i=0; i < NUM_AXIS; i++) {
2263
+    difference[i] = destination[i] - current_position[i];
2264
+  }
2265
+  float cartesian_mm = sqrt(sq(difference[X_AXIS]) +
2266
+                            sq(difference[Y_AXIS]) +
2267
+                            sq(difference[Z_AXIS]));
2268
+  if (cartesian_mm < 0.000001) { cartesian_mm = abs(difference[E_AXIS]); }
2269
+  if (cartesian_mm < 0.000001) { return; }
2270
+  float seconds = 6000 * cartesian_mm / feedrate / feedmultiply;
2271
+  int steps = max(1, int(DELTA_SEGMENTS_PER_SECOND * seconds));
2272
+  // SERIAL_ECHOPGM("mm="); SERIAL_ECHO(cartesian_mm);
2273
+  // SERIAL_ECHOPGM(" seconds="); SERIAL_ECHO(seconds);
2274
+  // SERIAL_ECHOPGM(" steps="); SERIAL_ECHOLN(steps);
2275
+  for (int s = 1; s <= steps; s++) {
2276
+    float fraction = float(s) / float(steps);
2277
+    for(int8_t i=0; i < NUM_AXIS; i++) {
2278
+      destination[i] = current_position[i] + difference[i] * fraction;
2279
+    }
2280
+    calculate_delta(destination);
2281
+    plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS],
2282
+                     destination[E_AXIS], feedrate*feedmultiply/60/100.0,
2283
+                     active_extruder);
2284
+  }
2285
+#else
2040
   // Do not use feedmultiply for E or Z only moves
2286
   // Do not use feedmultiply for E or Z only moves
2041
   if( (current_position[X_AXIS] == destination [X_AXIS]) && (current_position[Y_AXIS] == destination [Y_AXIS])) {
2287
   if( (current_position[X_AXIS] == destination [X_AXIS]) && (current_position[Y_AXIS] == destination [Y_AXIS])) {
2042
       plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
2288
       plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
2044
   else {
2290
   else {
2045
     plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate*feedmultiply/60/100.0, active_extruder);
2291
     plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate*feedmultiply/60/100.0, active_extruder);
2046
   }
2292
   }
2293
+#endif
2047
   for(int8_t i=0; i < NUM_AXIS; i++) {
2294
   for(int8_t i=0; i < NUM_AXIS; i++) {
2048
     current_position[i] = destination[i];
2295
     current_position[i] = destination[i];
2049
   }
2296
   }
2086
        || !READ(E2_ENABLE_PIN)
2333
        || !READ(E2_ENABLE_PIN)
2087
     #endif
2334
     #endif
2088
     #if EXTRUDER > 1
2335
     #if EXTRUDER > 1
2336
+      #if defined(X2_ENABLE_PIN) && X2_ENABLE_PIN > -1
2337
+       || !READ(X2_ENABLE_PIN)
2338
+      #endif
2089
        || !READ(E1_ENABLE_PIN)
2339
        || !READ(E1_ENABLE_PIN)
2090
     #endif
2340
     #endif
2091
        || !READ(E0_ENABLE_PIN)) //If any of the drivers are enabled...
2341
        || !READ(E0_ENABLE_PIN)) //If any of the drivers are enabled...
2287
   }
2537
   }
2288
   return false;
2538
   return false;
2289
 }
2539
 }
2540
+

+ 2
- 0
Marlin/Servo.cpp View File

41
  detach()    - Stops an attached servos from pulsing its i/o pin.
41
  detach()    - Stops an attached servos from pulsing its i/o pin.
42
 
42
 
43
 */
43
 */
44
+#include "Configuration.h" 
45
+
44
 #ifdef NUM_SERVOS
46
 #ifdef NUM_SERVOS
45
 #include <avr/interrupt.h>
47
 #include <avr/interrupt.h>
46
 #include <Arduino.h>
48
 #include <Arduino.h>

+ 13
- 7
Marlin/cardreader.cpp View File

18
    saving = false;
18
    saving = false;
19
    logging = false;
19
    logging = false;
20
    autostart_atmillis=0;
20
    autostart_atmillis=0;
21
+   workDirDepth = 0;
22
+   memset(workDirParents, 0, sizeof(workDirParents));
21
 
23
 
22
    autostart_stilltocheck=true; //the sd start is delayed, because otherwise the serial cannot answer fast enought to make contact with the hostsoftware.
24
    autostart_stilltocheck=true; //the sd start is delayed, because otherwise the serial cannot answer fast enought to make contact with the hostsoftware.
23
    lastnr=0;
25
    lastnr=0;
204
   if(cardOK)
206
   if(cardOK)
205
   {
207
   {
206
     sdprinting = true;
208
     sdprinting = true;
207
-    
208
   }
209
   }
209
 }
210
 }
210
 
211
 
521
   }
522
   }
522
   else
523
   else
523
   {
524
   {
524
-    workDirParentParent=workDirParent;
525
-    workDirParent=*parent;
526
-    
525
+    if (workDirDepth < MAX_DIR_DEPTH) {
526
+      for (int d = ++workDirDepth; d--;)
527
+        workDirParents[d+1] = workDirParents[d];
528
+      workDirParents[0]=*parent;
529
+    }
527
     workDir=newfile;
530
     workDir=newfile;
528
   }
531
   }
529
 }
532
 }
530
 
533
 
531
 void CardReader::updir()
534
 void CardReader::updir()
532
 {
535
 {
533
-  if(!workDir.isRoot())
536
+  if(workDirDepth > 0)
534
   {
537
   {
535
-    workDir=workDirParent;
536
-    workDirParent=workDirParentParent;
538
+    --workDirDepth;
539
+    workDir = workDirParents[0];
540
+    int d;
541
+    for (int d = 0; d < workDirDepth; d++)
542
+      workDirParents[d] = workDirParents[d+1];
537
   }
543
   }
538
 }
544
 }
539
 
545
 

+ 4
- 1
Marlin/cardreader.h View File

3
 
3
 
4
 #ifdef SDSUPPORT
4
 #ifdef SDSUPPORT
5
 
5
 
6
+#define MAX_DIR_DEPTH 10
7
+
6
 #include "SdFile.h"
8
 #include "SdFile.h"
7
 enum LsAction {LS_SerialPrint,LS_Count,LS_GetFilename};
9
 enum LsAction {LS_SerialPrint,LS_Count,LS_GetFilename};
8
 class CardReader
10
 class CardReader
53
   bool filenameIsDir;
55
   bool filenameIsDir;
54
   int lastnr; //last number of the autostart;
56
   int lastnr; //last number of the autostart;
55
 private:
57
 private:
56
-  SdFile root,*curDir,workDir,workDirParent,workDirParentParent;
58
+  SdFile root,*curDir,workDir,workDirParents[MAX_DIR_DEPTH];
59
+  uint16_t workDirDepth;
57
   Sd2Card card;
60
   Sd2Card card;
58
   SdVolume volume;
61
   SdVolume volume;
59
   SdFile file;
62
   SdFile file;

+ 17
- 6
Marlin/dogm_lcd_implementation.h View File

33
 #define LCD_CLICKED (buttons&EN_C)
33
 #define LCD_CLICKED (buttons&EN_C)
34
 #endif
34
 #endif
35
 
35
 
36
-// CHANGE_DE begin ***
37
-#include <U8glib.h>	// DE_U8glib
36
+#include <U8glib.h>
38
 #include "DOGMbitmaps.h"
37
 #include "DOGMbitmaps.h"
39
 #include "dogm_font_data_marlin.h"
38
 #include "dogm_font_data_marlin.h"
40
 #include "ultralcd.h"
39
 #include "ultralcd.h"
40
+#include "ultralcd_st7920_u8glib_rrd.h"
41
 
41
 
42
 
42
 
43
 /* Russian language not supported yet, needs custom font
43
 /* Russian language not supported yet, needs custom font
74
 
74
 
75
 #define FONT_STATUSMENU	u8g_font_6x9
75
 #define FONT_STATUSMENU	u8g_font_6x9
76
 
76
 
77
+int lcd_contrast;
77
 
78
 
78
 // LCD selection
79
 // LCD selection
79
 #ifdef U8GLIB_ST7920
80
 #ifdef U8GLIB_ST7920
80
-// SPI Com: SCK = en = (D4), MOSI = rw = (RS), CS = di = (ENABLE)
81
-U8GLIB_ST7920_128X64_1X u8g(LCD_PINS_D4, LCD_PINS_ENABLE, LCD_PINS_RS);
81
+//U8GLIB_ST7920_128X64_RRD u8g(0,0,0);
82
+U8GLIB_ST7920_128X64_RRD u8g(0);
83
+#elif defined(MAKRPANEL)
84
+// The MaKrPanel display, ST7565 controller as well
85
+U8GLIB_NHD_C12864 u8g(DOGLCD_CS, DOGLCD_A0);
82
 #else
86
 #else
87
+// for regular DOGM128 display with HW-SPI
83
 U8GLIB_DOGM128 u8g(DOGLCD_CS, DOGLCD_A0);	// HW-SPI Com: CS, A0
88
 U8GLIB_DOGM128 u8g(DOGLCD_CS, DOGLCD_A0);	// HW-SPI Com: CS, A0
84
 #endif
89
 #endif
85
 
90
 
86
 static void lcd_implementation_init()
91
 static void lcd_implementation_init()
87
 {
92
 {
93
+#ifdef LCD_PIN_BL
94
+	pinMode(LCD_PIN_BL, OUTPUT);	// Enable LCD backlight
95
+	digitalWrite(LCD_PIN_BL, HIGH);
96
+#endif
97
+
98
+        u8g.setContrast(lcd_contrast);	
88
 	//  Uncomment this if you have the first generation (V1.10) of STBs board
99
 	//  Uncomment this if you have the first generation (V1.10) of STBs board
89
 	//  pinMode(17, OUTPUT);	// Enable LCD backlight
100
 	//  pinMode(17, OUTPUT);	// Enable LCD backlight
90
 	//  digitalWrite(17, HIGH);
101
 	//  digitalWrite(17, HIGH);
118
 			u8g.setFont(u8g_font_6x10_marlin);
129
 			u8g.setFont(u8g_font_6x10_marlin);
119
 			u8g.drawStr(62,10,"MARLIN"); 
130
 			u8g.drawStr(62,10,"MARLIN"); 
120
 			u8g.setFont(u8g_font_5x8);
131
 			u8g.setFont(u8g_font_5x8);
121
-			u8g.drawStr(62,19,"V1.0.0 RC2");
132
+			u8g.drawStr(62,19,"V1.0.0 RC2-mm");
122
 			u8g.setFont(u8g_font_6x10_marlin);
133
 			u8g.setFont(u8g_font_6x10_marlin);
123
 			u8g.drawStr(62,28,"by ErikZalm");
134
 			u8g.drawStr(62,28,"by ErikZalm");
124
 			u8g.drawStr(62,41,"DOGM128 LCD");
135
 			u8g.drawStr(62,41,"DOGM128 LCD");
125
 			u8g.setFont(u8g_font_5x8);
136
 			u8g.setFont(u8g_font_5x8);
126
 			u8g.drawStr(62,48,"enhancements");
137
 			u8g.drawStr(62,48,"enhancements");
127
 			u8g.setFont(u8g_font_5x8);
138
 			u8g.setFont(u8g_font_5x8);
128
-			u8g.drawStr(62,55,"by STB");
139
+			u8g.drawStr(62,55,"by STB, MM");
129
 			u8g.drawStr(62,61,"uses u");
140
 			u8g.drawStr(62,61,"uses u");
130
 			u8g.drawStr90(92,57,"8");
141
 			u8g.drawStr90(92,57,"8");
131
 			u8g.drawStr(100,61,"glib");
142
 			u8g.drawStr(100,61,"glib");

+ 134
- 113
Marlin/language.h View File

3
 
3
 
4
 // NOTE: IF YOU CHANGE THIS FILE / MERGE THIS FILE WITH CHANGES
4
 // NOTE: IF YOU CHANGE THIS FILE / MERGE THIS FILE WITH CHANGES
5
 //
5
 //
6
-//   ==&gt; ALWAYS TRY TO COMPILE MARLIN WITH/WITHOUT "ULTIPANEL" / "ULTRALCD" / "SDSUPPORT" #define IN "Configuration.h" 
7
-//   ==&gt; ALSO TRY ALL AVAILABLE "LANGUAGE_CHOICE" OPTIONS
6
+//   ==> ALWAYS TRY TO COMPILE MARLIN WITH/WITHOUT "ULTIPANEL" / "ULTRALCD" / "SDSUPPORT" #define IN "Configuration.h" 
7
+//   ==> ALSO TRY ALL AVAILABLE "LANGUAGE_CHOICE" OPTIONS
8
 
8
 
9
 // Languages
9
 // Languages
10
 // 1  English
10
 // 1  English
11
 // 2  Polish
11
 // 2  Polish
12
-// 3  French	(awaiting translation!)
12
+// 3  French
13
 // 4  German
13
 // 4  German
14
 // 5  Spanish
14
 // 5  Spanish
15
 // 6  Russian
15
 // 6  Russian
29
 #elif MOTHERBOARD == 80
29
 #elif MOTHERBOARD == 80
30
 	#define MACHINE_NAME "Rumba"
30
 	#define MACHINE_NAME "Rumba"
31
 	#define FIRMWARE_URL "https://github.com/ErikZalm/Marlin/"
31
 	#define FIRMWARE_URL "https://github.com/ErikZalm/Marlin/"
32
+#elif MOTHERBOARD == 77
33
+	#define MACHINE_NAME "3Drag"
34
+	#define FIRMWARE_URL "http://3dprint.elettronicain.it/"
32
 #else
35
 #else
33
-	#define MACHINE_NAME "Mendel"
36
+	#ifdef CUSTOM_MENDEL_NAME
37
+		#define MACHINE_NAME CUSTOM_MENDEL_NAME
38
+	#else
39
+		#define MACHINE_NAME "Mendel"
40
+	#endif
34
 	#define FIRMWARE_URL "http://www.mendel-parts.com"
41
 	#define FIRMWARE_URL "http://www.mendel-parts.com"
35
 #endif
42
 #endif
36
 
43
 
75
 	#define MSG_PID_D "PID-D"
82
 	#define MSG_PID_D "PID-D"
76
 	#define MSG_PID_C "PID-C"
83
 	#define MSG_PID_C "PID-C"
77
 	#define MSG_ACC  "Accel"
84
 	#define MSG_ACC  "Accel"
78
-	#define MSG_VXY_JERK "Vxy-jerk"
79
-	#define MSG_VZ_JERK "Vz-jerk"
80
-	#define MSG_VE_JERK "Ve-jerk"
85
+	#define MSG_VXY_JERK "Vxy-jerk"
86
+	#define MSG_VZ_JERK "Vz-jerk"
87
+	#define MSG_VE_JERK "Ve-jerk"
81
 	#define MSG_VMAX "Vmax "
88
 	#define MSG_VMAX "Vmax "
82
 	#define MSG_X "x"
89
 	#define MSG_X "x"
83
 	#define MSG_Y "y"
90
 	#define MSG_Y "y"
94
 	#define MSG_RECTRACT "Rectract"
101
 	#define MSG_RECTRACT "Rectract"
95
 	#define MSG_TEMPERATURE "Temperature"
102
 	#define MSG_TEMPERATURE "Temperature"
96
 	#define MSG_MOTION "Motion"
103
 	#define MSG_MOTION "Motion"
104
+	#define MSG_CONTRAST "LCD contrast"
97
 	#define MSG_STORE_EPROM "Store memory"
105
 	#define MSG_STORE_EPROM "Store memory"
98
 	#define MSG_LOAD_EPROM "Load memory"
106
 	#define MSG_LOAD_EPROM "Load memory"
99
 	#define MSG_RESTORE_FAILSAFE "Restore Failsafe"
107
 	#define MSG_RESTORE_FAILSAFE "Restore Failsafe"
188
 	#define MSG_SD_ERR_WRITE_TO_FILE "error writing to file"
196
 	#define MSG_SD_ERR_WRITE_TO_FILE "error writing to file"
189
 	#define MSG_SD_CANT_ENTER_SUBDIR "Cannot enter subdir: "
197
 	#define MSG_SD_CANT_ENTER_SUBDIR "Cannot enter subdir: "
190
 
198
 
191
-	#define MSG_STEPPER_TO_HIGH "Steprate to high: "
199
+	#define MSG_STEPPER_TOO_HIGH "Steprate too high: "
192
 	#define MSG_ENDSTOPS_HIT "endstops hit: "
200
 	#define MSG_ENDSTOPS_HIT "endstops hit: "
193
 	#define MSG_ERR_COLD_EXTRUDE_STOP " cold extrusion prevented"
201
 	#define MSG_ERR_COLD_EXTRUDE_STOP " cold extrusion prevented"
194
 	#define MSG_ERR_LONG_EXTRUDE_STOP " too long extrusion prevented"
202
 	#define MSG_ERR_LONG_EXTRUDE_STOP " too long extrusion prevented"
235
 	#define MSG_PID_C "PID-C"
243
 	#define MSG_PID_C "PID-C"
236
 	#define MSG_ACC  "Acc"
244
 	#define MSG_ACC  "Acc"
237
 	#define MSG_VXY_JERK "Zryw Vxy"
245
 	#define MSG_VXY_JERK "Zryw Vxy"
238
-	#define MSG_VZ_JERK "Zryw Vz"
239
-	#define MSG_VE_JERK "Zryw Ve"
246
+	#define MSG_VZ_JERK "Zryw Vz"
247
+	#define MSG_VE_JERK "Zryw Ve"
240
 	#define MSG_VMAX "Vmax"
248
 	#define MSG_VMAX "Vmax"
241
 	#define MSG_X "x"
249
 	#define MSG_X "x"
242
 	#define MSG_Y "y"
250
 	#define MSG_Y "y"
253
 	#define MSG_RECTRACT "Wycofanie"
261
 	#define MSG_RECTRACT "Wycofanie"
254
 	#define MSG_TEMPERATURE "Temperatura"
262
 	#define MSG_TEMPERATURE "Temperatura"
255
 	#define MSG_MOTION "Ruch"
263
 	#define MSG_MOTION "Ruch"
264
+	#define MSG_CONTRAST "LCD contrast"
256
 	#define MSG_STORE_EPROM "Zapisz w pamieci"
265
 	#define MSG_STORE_EPROM "Zapisz w pamieci"
257
 	#define MSG_LOAD_EPROM "Wczytaj z pamieci"
266
 	#define MSG_LOAD_EPROM "Wczytaj z pamieci"
258
 	#define MSG_RESTORE_FAILSAFE " Ustawienia fabryczne"
267
 	#define MSG_RESTORE_FAILSAFE " Ustawienia fabryczne"
348
 	#define MSG_SD_ERR_WRITE_TO_FILE "blad podczas zapisu do pliku"
357
 	#define MSG_SD_ERR_WRITE_TO_FILE "blad podczas zapisu do pliku"
349
 	#define MSG_SD_CANT_ENTER_SUBDIR "Nie mozna odczytac podkatalogu: "
358
 	#define MSG_SD_CANT_ENTER_SUBDIR "Nie mozna odczytac podkatalogu: "
350
 
359
 
351
-	#define MSG_STEPPER_TO_HIGH "Za duza czestotliwosc krokow: "
360
+	#define MSG_STEPPER_TOO_HIGH "Za duza czestotliwosc krokow: "
352
 	#define MSG_ENDSTOPS_HIT "Wylacznik krancowy zostal wyzwolony na pozycji: "
361
 	#define MSG_ENDSTOPS_HIT "Wylacznik krancowy zostal wyzwolony na pozycji: "
353
 	#define MSG_ERR_COLD_EXTRUDE_STOP " uniemozliwiono zimna ekstruzje"
362
 	#define MSG_ERR_COLD_EXTRUDE_STOP " uniemozliwiono zimna ekstruzje"
354
 	#define MSG_ERR_LONG_EXTRUDE_STOP " uniemozliwiono zbyt dluga ekstruzje"
363
 	#define MSG_ERR_LONG_EXTRUDE_STOP " uniemozliwiono zbyt dluga ekstruzje"
396
 #define MSG_PID_C " PID-C: "
405
 #define MSG_PID_C " PID-C: "
397
 #define MSG_ACC " Acc:"
406
 #define MSG_ACC " Acc:"
398
 #define MSG_VXY_JERK "Vxy-jerk"
407
 #define MSG_VXY_JERK "Vxy-jerk"
399
-#define MSG_VZ_JERK "Vz-jerk"
400
-#define MSG_VE_JERK "Ve-jerk"
408
+#define MSG_VZ_JERK "Vz-jerk"
409
+#define MSG_VE_JERK "Ve-jerk"
401
 #define MSG_VMAX " Vmax "
410
 #define MSG_VMAX " Vmax "
402
 #define MSG_X "x:"
411
 #define MSG_X "x:"
403
 #define MSG_Y "y:"
412
 #define MSG_Y "y:"
416
 #define MSG_TEMPERATURE_WIDE " Temperature \x7E"
425
 #define MSG_TEMPERATURE_WIDE " Temperature \x7E"
417
 #define MSG_TEMPERATURE_RTN " Temperature \003"
426
 #define MSG_TEMPERATURE_RTN " Temperature \003"
418
 #define MSG_MOTION_WIDE " Mouvement \x7E"
427
 #define MSG_MOTION_WIDE " Mouvement \x7E"
428
+	#define MSG_CONTRAST "LCD contrast"
419
 #define MSG_STORE_EPROM " Sauvegarder memoire"
429
 #define MSG_STORE_EPROM " Sauvegarder memoire"
420
 #define MSG_LOAD_EPROM " Lire memoire"
430
 #define MSG_LOAD_EPROM " Lire memoire"
421
 #define MSG_RESTORE_FAILSAFE " Restaurer memoire"
431
 #define MSG_RESTORE_FAILSAFE " Restaurer memoire"
512
 #define MSG_SD_ERR_WRITE_TO_FILE "Erreur d'ecriture dans le fichier"
522
 #define MSG_SD_ERR_WRITE_TO_FILE "Erreur d'ecriture dans le fichier"
513
 #define MSG_SD_CANT_ENTER_SUBDIR "Impossible d'entrer dans le sous-repertoire: "
523
 #define MSG_SD_CANT_ENTER_SUBDIR "Impossible d'entrer dans le sous-repertoire: "
514
 
524
 
515
-#define MSG_STEPPER_TO_HIGH "Steprate trop eleve: "
525
+#define MSG_STEPPER_TOO_HIGH "Steprate trop eleve: "
516
 #define MSG_ENDSTOPS_HIT "Fin de course atteint: "
526
 #define MSG_ENDSTOPS_HIT "Fin de course atteint: "
517
 #define MSG_ERR_COLD_EXTRUDE_STOP " Extrusion a froid evitee"
527
 #define MSG_ERR_COLD_EXTRUDE_STOP " Extrusion a froid evitee"
518
 #define MSG_ERR_LONG_EXTRUDE_STOP " Extrusion longue evitee"
528
 #define MSG_ERR_LONG_EXTRUDE_STOP " Extrusion longue evitee"
528
 
538
 
529
 	#define MSG_SD_INSERTED      "SDKarte erkannt"
539
 	#define MSG_SD_INSERTED      "SDKarte erkannt"
530
 	#define MSG_SD_REMOVED       "SDKarte entfernt"
540
 	#define MSG_SD_REMOVED       "SDKarte entfernt"
531
-	#define MSG_MAIN             "Hauptmneü"
541
+	#define MSG_MAIN             "Hauptmenü"
532
 	#define MSG_AUTOSTART        "Autostart"
542
 	#define MSG_AUTOSTART        "Autostart"
533
 	#define MSG_DISABLE_STEPPERS "Stepper abschalten"
543
 	#define MSG_DISABLE_STEPPERS "Stepper abschalten"
534
 	#define MSG_AUTO_HOME        "Auto Nullpunkt"
544
 	#define MSG_AUTO_HOME        "Auto Nullpunkt"
547
 	#define MSG_NOZZLE2          "Düse3"
557
 	#define MSG_NOZZLE2          "Düse3"
548
 	#define MSG_BED              "Bett"
558
 	#define MSG_BED              "Bett"
549
 	#define MSG_FAN_SPEED        "Lüftergeschw."
559
 	#define MSG_FAN_SPEED        "Lüftergeschw."
550
-	#define MSG_FLOW             "Fluß"
560
+	#define MSG_FLOW             "Fluss"
551
 	#define MSG_CONTROL          "Einstellungen"
561
 	#define MSG_CONTROL          "Einstellungen"
552
 	#define MSG_MIN              "\002 Min"
562
 	#define MSG_MIN              "\002 Min"
553
 	#define MSG_MAX              "\002 Max"
563
 	#define MSG_MAX              "\002 Max"
561
 	#define MSG_PID_C            "PID-C"
571
 	#define MSG_PID_C            "PID-C"
562
 	#define MSG_ACC              "Acc"
572
 	#define MSG_ACC              "Acc"
563
 	#define MSG_VXY_JERK         "Vxy-jerk"
573
 	#define MSG_VXY_JERK         "Vxy-jerk"
564
-	#define MSG_VZ_JERK          "Vz-jerk"
565
-	#define MSG_VE_JERK          "Ve-jerk"
574
+	#define MSG_VZ_JERK          "Vz-jerk"
575
+	#define MSG_VE_JERK          "Ve-jerk"
566
 	#define MSG_VMAX             "Vmax "
576
 	#define MSG_VMAX             "Vmax "
567
 	#define MSG_X                "x"
577
 	#define MSG_X                "x"
568
 	#define MSG_Y                "y"
578
 	#define MSG_Y                "y"
580
 	#define MSG_WATCH            "Beobachten"
590
 	#define MSG_WATCH            "Beobachten"
581
 	#define MSG_TEMPERATURE      "Temperatur"
591
 	#define MSG_TEMPERATURE      "Temperatur"
582
 	#define MSG_MOTION           "Bewegung"
592
 	#define MSG_MOTION           "Bewegung"
593
+	#define MSG_CONTRAST "LCD contrast"
583
 	#define MSG_STORE_EPROM      "EPROM speichern"
594
 	#define MSG_STORE_EPROM      "EPROM speichern"
584
 	#define MSG_LOAD_EPROM       "EPROM laden"
595
 	#define MSG_LOAD_EPROM       "EPROM laden"
585
 	#define MSG_RESTORE_FAILSAFE "Standardkonfig."
596
 	#define MSG_RESTORE_FAILSAFE "Standardkonfig."
674
 	#define MSG_SD_ERR_WRITE_TO_FILE "error writing to file"
685
 	#define MSG_SD_ERR_WRITE_TO_FILE "error writing to file"
675
 	#define MSG_SD_CANT_ENTER_SUBDIR "Cannot enter subdir:"
686
 	#define MSG_SD_CANT_ENTER_SUBDIR "Cannot enter subdir:"
676
 
687
 
677
-	#define MSG_STEPPER_TO_HIGH "Steprate to high : "
688
+	#define MSG_STEPPER_TOO_HIGH "Steprate too high : "
678
 	#define MSG_ENDSTOPS_HIT "endstops hit: "
689
 	#define MSG_ENDSTOPS_HIT "endstops hit: "
679
 	#define MSG_ERR_COLD_EXTRUDE_STOP " cold extrusion prevented"
690
 	#define MSG_ERR_COLD_EXTRUDE_STOP " cold extrusion prevented"
680
 	#define MSG_ERR_LONG_EXTRUDE_STOP " too long extrusion prevented"
691
 	#define MSG_ERR_LONG_EXTRUDE_STOP " too long extrusion prevented"
685
 #if LANGUAGE_CHOICE == 5
696
 #if LANGUAGE_CHOICE == 5
686
 
697
 
687
 // LCD Menu Messages
698
 // LCD Menu Messages
688
-#define WELCOME_MSG MACHINE_NAME " Lista."
699
+#define WELCOME_MSG MACHINE_NAME "Lista."
689
 #define MSG_SD_INSERTED "Tarjeta SD Colocada"
700
 #define MSG_SD_INSERTED "Tarjeta SD Colocada"
690
 #define MSG_SD_REMOVED "Tarjeta SD Retirada"
701
 #define MSG_SD_REMOVED "Tarjeta SD Retirada"
691
-#define MSG_MAIN " Menu Principal \003"
702
+#define MSG_MAIN "Menu Principal"
692
 #define MSG_AUTOSTART " Autostart"
703
 #define MSG_AUTOSTART " Autostart"
693
-#define MSG_DISABLE_STEPPERS " Apagar Motores"
694
-#define MSG_AUTO_HOME " Llevar Ejes al Cero"
695
-#define MSG_SET_ORIGIN " Establecer Cero"
696
-#define MSG_COOLDOWN " Enfriar"
697
-#define MSG_EXTRUDE " Extruir"
698
-#define MSG_RETRACT " Retraer"
699
-#define MSG_PREHEAT_PLA " Precalentar PLA"
700
-#define MSG_PREHEAT_PLA_SETTINGS " Ajustar temp. PLA"
701
-#define MSG_PREHEAT_ABS " Precalentar ABS"
702
-#define MSG_PREHEAT_ABS_SETTINGS " Ajustar temp. ABS"
703
-#define MSG_MOVE_AXIS " Mover Ejes      \x7E"
704
-#define MSG_SPEED " Velocidad:"
705
-#define MSG_NOZZLE " \002Nozzle:"
706
-#define MSG_NOZZLE1 " \002Nozzle2:"
707
-#define MSG_NOZZLE2 " \002Nozzle3:"
708
-#define MSG_BED " \002Base:"
709
-#define MSG_FAN_SPEED " Ventilador:"
710
-#define MSG_FLOW " Flujo:"
711
-#define MSG_CONTROL " Control \003"
712
-#define MSG_MIN " \002 Min:"
713
-#define MSG_MAX " \002 Max:"
714
-#define MSG_FACTOR " \002 Fact:"
715
-#define MSG_AUTOTEMP " Autotemp:"
716
-#define MSG_ON "On "
704
+#define MSG_DISABLE_STEPPERS "Apagar Motores"
705
+#define MSG_AUTO_HOME "Llevar al Origen" // "Llevar Ejes al Cero"
706
+#define MSG_SET_ORIGIN "Establecer Cero"
707
+#define MSG_PREHEAT_PLA "Precalentar PLA"
708
+#define MSG_PREHEAT_PLA_SETTINGS "Ajustar temp. PLA"
709
+#define MSG_PREHEAT_ABS "Precalentar ABS"
710
+#define MSG_PREHEAT_ABS_SETTINGS "Ajustar temp. ABS"
711
+#define MSG_COOLDOWN "Enfriar"
712
+#define MSG_EXTRUDE "Extruir"
713
+#define MSG_RETRACT "Retraer"
714
+#define MSG_MOVE_AXIS "Mover Ejes"
715
+#define MSG_SPEED "Velocidad"
716
+#define MSG_NOZZLE "Nozzle"
717
+#define MSG_NOZZLE1 "Nozzle2"
718
+#define MSG_NOZZLE2 "Nozzle3"
719
+#define MSG_BED "Base"
720
+#define MSG_FAN_SPEED "Ventilador"
721
+#define MSG_FLOW "Flujo"
722
+#define MSG_CONTROL "Control"
723
+#define MSG_MIN "\002 Min"
724
+#define MSG_MAX "\002 Max"
725
+#define MSG_FACTOR "\002 Fact"
726
+#define MSG_AUTOTEMP "Autotemp"
727
+#define MSG_ON "On"
717
 #define MSG_OFF "Off"
728
 #define MSG_OFF "Off"
718
-#define MSG_PID_P " PID-P: "
719
-#define MSG_PID_I " PID-I: "
720
-#define MSG_PID_D " PID-D: "
721
-#define MSG_PID_C " PID-C: "
722
-#define MSG_ACC  " Acc:"
723
-#define MSG_VXY_JERK " Vxy-jerk: "
724
-#define MSG_VZ_JERK "Vz-jerk"
725
-#define MSG_VE_JERK "Ve-jerk"
726
-#define MSG_VMAX " Vmax "
727
-#define MSG_X "x:"
728
-#define MSG_Y "y:"
729
-#define MSG_Z "z:"
730
-#define MSG_E "e:"
731
-#define MSG_VMIN " Vmin:"
732
-#define MSG_VTRAV_MIN " VTrav min:"
733
-#define MSG_AMAX " Amax "
734
-#define MSG_A_RETRACT " A-retrac.:"
735
-#define MSG_XSTEPS " Xpasos/mm:"
736
-#define MSG_YSTEPS " Ypasos/mm:"
737
-#define MSG_ZSTEPS " Zpasos/mm:"
738
-#define MSG_ESTEPS " Epasos/mm:"
739
-#define MSG_MAIN_WIDE " Menu Principal  \003"
740
-#define MSG_RECTRACT_WIDE " Retraer         \x7E"
741
-#define MSG_TEMPERATURE_WIDE " Temperatura     \x7E"
742
-#define MSG_TEMPERATURE_RTN  " Temperatura     \003"
743
-#define MSG_MOTION_WIDE " Movimiento      \x7E"
744
-#define MSG_STORE_EPROM " Guardar Memoria"
745
-#define MSG_LOAD_EPROM " Cargar Memoria"
746
-#define MSG_RESTORE_FAILSAFE " Rest. de emergencia"
747
-#define MSG_REFRESH "\004Volver a cargar"
748
-#define MSG_WATCH " Monitorizar \003"
749
-#define MSG_PREPARE " Preparar \x7E"
750
-#define MSG_PREPARE_ALT " Preparar \003"
751
-#define MSG_CONTROL_ARROW " Control  \x7E"
752
-#define MSG_RETRACT_ARROW " Retraer  \x7E"
753
-#define MSG_TUNE " Ajustar \x7E"
754
-#define MSG_PAUSE_PRINT " Pausar Impresion \x7E"
755
-#define MSG_RESUME_PRINT " Reanudar Impresion \x7E"
756
-#define MSG_STOP_PRINT " Detener Impresion \x7E"
757
-#define MSG_CARD_MENU " Menu de SD    \x7E"
758
-#define MSG_NO_CARD " No hay Tarjeta SD"
729
+#define MSG_PID_P "PID-P"
730
+#define MSG_PID_I "PID-I"
731
+#define MSG_PID_D "PID-D"
732
+#define MSG_PID_C "PID-C"
733
+#define MSG_ACC  "Acel"
734
+#define MSG_VXY_JERK "Vxy-jerk"
735
+#define MSG_VZ_JERK "Vz-jerk"
736
+#define MSG_VE_JERK "Ve-jerk"
737
+#define MSG_VMAX "Vmax"
738
+#define MSG_X "x"
739
+#define MSG_Y "y"
740
+#define MSG_Z "z"
741
+#define MSG_E "e"
742
+#define MSG_VMIN "Vmin"
743
+#define MSG_VTRAV_MIN "VTrav min"
744
+#define MSG_AMAX "Amax"
745
+#define MSG_A_RETRACT "A-retrac."
746
+#define MSG_XSTEPS "X pasos/mm"
747
+#define MSG_YSTEPS "Y pasos/mm"
748
+#define MSG_ZSTEPS "Z pasos/mm"
749
+#define MSG_ESTEPS "E pasos/mm"
750
+#define MSG_RECTRACT "Retraer"
751
+#define MSG_TEMPERATURE "Temperatura"
752
+#define MSG_MOTION "Movimiento"
753
+#define MSG_STORE_EPROM "Guardar Memoria"
754
+#define MSG_LOAD_EPROM "Cargar Memoria"
755
+#define MSG_RESTORE_FAILSAFE "Rest. de emergencia"
756
+#define MSG_REFRESH "Volver a cargar"
757
+#define MSG_WATCH "Monitorizar"
758
+#define MSG_PREPARE "Preparar"
759
+#define MSG_TUNE "Ajustar"
760
+#define MSG_PAUSE_PRINT "Pausar Impresion"
761
+#define MSG_RESUME_PRINT "Reanudar Impresion"
762
+#define MSG_STOP_PRINT "Detener Impresion"
763
+#define MSG_CARD_MENU "Menu de SD"
764
+#define MSG_NO_CARD "No hay Tarjeta SD"
759
 #define MSG_DWELL "Reposo..."
765
 #define MSG_DWELL "Reposo..."
760
 #define MSG_USERWAIT "Esperando Ordenes..."
766
 #define MSG_USERWAIT "Esperando Ordenes..."
767
+#define MSG_RESUMING "Resumiendo Impresion"
761
 #define MSG_NO_MOVE "Sin movimiento"
768
 #define MSG_NO_MOVE "Sin movimiento"
762
-#define MSG_PART_RELEASE "Desacople Parcial"
763
 #define MSG_KILLED "PARADA DE EMERGENCIA. "
769
 #define MSG_KILLED "PARADA DE EMERGENCIA. "
764
-#define MSG_STOPPED "PARADA. "
765
-#define MSG_STEPPER_RELEASED "Desacoplada."
766
-#define MSG_CONTROL_RETRACT  " Retraer mm:"
767
-#define MSG_CONTROL_RETRACTF " Retraer  F:"
768
-#define MSG_CONTROL_RETRACT_ZLIFT " Levantar mm:"
769
-#define MSG_CONTROL_RETRACT_RECOVER " DesRet +mm:"
770
-#define MSG_CONTROL_RETRACT_RECOVERF " DesRet F:"
771
-#define MSG_AUTORETRACT " AutoRetr.:"
770
+#define MSG_STOPPED "PARADA."
771
+#define MSG_CONTROL_RETRACT  "Retraer mm"
772
+#define MSG_CONTROL_RETRACTF "Retraer  F"
773
+#define MSG_CONTROL_RETRACT_ZLIFT "Levantar mm"
774
+#define MSG_CONTROL_RETRACT_RECOVER "DesRet +mm"
775
+#define MSG_CONTROL_RETRACT_RECOVERF "DesRet F"
776
+#define MSG_AUTORETRACT "AutoRetr."
772
 #define MSG_FILAMENTCHANGE "Change filament"
777
 #define MSG_FILAMENTCHANGE "Change filament"
778
+#define MSG_INIT_SDCARD "Iniciando. Tarjeta-SD"
779
+#define MSG_CNG_SDCARD "Cambiar Tarjeta-SD"
780
+#define MSG_RECTRACT_WIDE "Retraer"
781
+#define MSG_TEMPERATURE_WIDE "Temperatura"
782
+#define MSG_TEMPERATURE_RTN  "Temperatura"
783
+#define MSG_MAIN_WIDE "Menu Principal"
784
+#define MSG_MOTION_WIDE "Movimiento"
785
+#define MSG_PREPARE_ALT "Preparar"
786
+#define MSG_CONTROL_ARROW "Control"
787
+#define MSG_RETRACT_ARROW "Retraer"
788
+#define MSG_PART_RELEASE "Desacople Parcial"
789
+#define MSG_STEPPER_RELEASED "Desacoplada."
790
+
773
 // Serial Console Messages
791
 // Serial Console Messages
774
 
792
 
775
 #define MSG_Enqueing "En cola \""
793
 #define MSG_Enqueing "En cola \""
814
 #define MSG_Y_MIN "y_min: "
832
 #define MSG_Y_MIN "y_min: "
815
 #define MSG_Y_MAX "y_max: "
833
 #define MSG_Y_MAX "y_max: "
816
 #define MSG_Z_MIN "z_min: "
834
 #define MSG_Z_MIN "z_min: "
835
+#define MSG_Z_MAX "z_max: "
817
 #define MSG_M119_REPORT "Comprobando fines de carrera."
836
 #define MSG_M119_REPORT "Comprobando fines de carrera."
818
 #define MSG_ENDSTOP_HIT "PULSADO"
837
 #define MSG_ENDSTOP_HIT "PULSADO"
819
 #define MSG_ENDSTOP_OPEN "abierto"
838
 #define MSG_ENDSTOP_OPEN "abierto"
820
 #define MSG_HOTEND_OFFSET "Hotend offsets:"
839
 #define MSG_HOTEND_OFFSET "Hotend offsets:"
821
-        
822
 #define MSG_SD_CANT_OPEN_SUBDIR "No se pudo abrir la subcarpeta."
840
 #define MSG_SD_CANT_OPEN_SUBDIR "No se pudo abrir la subcarpeta."
823
 #define MSG_SD_INIT_FAIL "Fallo al iniciar la SD"
841
 #define MSG_SD_INIT_FAIL "Fallo al iniciar la SD"
824
 #define MSG_SD_VOL_INIT_FAIL "Fallo al montar el volumen"
842
 #define MSG_SD_VOL_INIT_FAIL "Fallo al montar el volumen"
835
 #define MSG_SD_ERR_WRITE_TO_FILE "Error al escribir en el archivo"
853
 #define MSG_SD_ERR_WRITE_TO_FILE "Error al escribir en el archivo"
836
 #define MSG_SD_CANT_ENTER_SUBDIR "No se puede abrir la carpeta:"
854
 #define MSG_SD_CANT_ENTER_SUBDIR "No se puede abrir la carpeta:"
837
 
855
 
838
-#define MSG_STEPPER_TO_HIGH "Steprate demasiado alto : "
856
+#define MSG_STEPPER_TOO_HIGH "Steprate demasiado alto : "
839
 #define MSG_ENDSTOPS_HIT "Se ha tocado el fin de carril: "
857
 #define MSG_ENDSTOPS_HIT "Se ha tocado el fin de carril: "
840
 #define MSG_ERR_COLD_EXTRUDE_STOP " extrusion fria evitada"
858
 #define MSG_ERR_COLD_EXTRUDE_STOP " extrusion fria evitada"
841
 #define MSG_ERR_LONG_EXTRUDE_STOP " extrusion demasiado larga evitada"
859
 #define MSG_ERR_LONG_EXTRUDE_STOP " extrusion demasiado larga evitada"
881
 #define MSG_PID_C							" PID-C: "
899
 #define MSG_PID_C							" PID-C: "
882
 #define MSG_ACC								" Acc:"
900
 #define MSG_ACC								" Acc:"
883
 #define MSG_VXY_JERK						" Vxy-jerk: "
901
 #define MSG_VXY_JERK						" Vxy-jerk: "
884
-#define MSG_VZ_JERK                         "Vz-jerk"
885
-#define MSG_VE_JERK                         "Ve-jerk"
902
+#define MSG_VZ_JERK                         "Vz-jerk"
903
+#define MSG_VE_JERK                         "Ve-jerk"
886
 #define MSG_VMAX							" Vmax "
904
 #define MSG_VMAX							" Vmax "
887
 #define MSG_X								"x:"
905
 #define MSG_X								"x:"
888
 #define MSG_Y								"y:"
906
 #define MSG_Y								"y:"
899
 #define MSG_RECTRACT    					" Откат подачи      \x7E"
917
 #define MSG_RECTRACT    					" Откат подачи      \x7E"
900
 #define MSG_TEMPERATURE  				" Температура       \x7E"
918
 #define MSG_TEMPERATURE  				" Температура       \x7E"
901
 #define MSG_MOTION						" Скорости          \x7E"
919
 #define MSG_MOTION						" Скорости          \x7E"
920
+	#define MSG_CONTRAST "LCD contrast"
902
 #define MSG_STORE_EPROM						" Сохранить настройки"
921
 #define MSG_STORE_EPROM						" Сохранить настройки"
903
 #define MSG_LOAD_EPROM						" Загрузить настройки"
922
 #define MSG_LOAD_EPROM						" Загрузить настройки"
904
 #define MSG_RESTORE_FAILSAFE				" Сброс настроек     "
923
 #define MSG_RESTORE_FAILSAFE				" Сброс настроек     "
989
 #define MSG_SD_NOT_PRINTING					"нет SD печати"
1008
 #define MSG_SD_NOT_PRINTING					"нет SD печати"
990
 #define MSG_SD_ERR_WRITE_TO_FILE			"ошибка записи в файл"
1009
 #define MSG_SD_ERR_WRITE_TO_FILE			"ошибка записи в файл"
991
 #define MSG_SD_CANT_ENTER_SUBDIR			"Не зайти в папку:"
1010
 #define MSG_SD_CANT_ENTER_SUBDIR			"Не зайти в папку:"
992
-#define MSG_STEPPER_TO_HIGH					"Частота шагов очень высока : "
1011
+#define MSG_STEPPER_TOO_HIGH				"Частота шагов очень высока : "
993
 #define MSG_ENDSTOPS_HIT					"концевик сработал: "
1012
 #define MSG_ENDSTOPS_HIT					"концевик сработал: "
994
 #define MSG_ERR_COLD_EXTRUDE_STOP			" защита холодной экструзии"
1013
 #define MSG_ERR_COLD_EXTRUDE_STOP			" защита холодной экструзии"
995
 #define MSG_ERR_LONG_EXTRUDE_STOP			" защита превышения длинны экструзии"
1014
 #define MSG_ERR_LONG_EXTRUDE_STOP			" защита превышения длинны экструзии"
1000
 #if LANGUAGE_CHOICE == 7
1019
 #if LANGUAGE_CHOICE == 7
1001
 
1020
 
1002
 	// LCD Menu Messages
1021
 	// LCD Menu Messages
1003
-	#define WELCOME_MSG MACHINE_NAME " Pronto."
1022
+	#define WELCOME_MSG MACHINE_NAME " Pronta"
1004
 	#define MSG_SD_INSERTED          "SD Card inserita"
1023
 	#define MSG_SD_INSERTED          "SD Card inserita"
1005
 	#define MSG_SD_REMOVED           "SD Card rimossa"
1024
 	#define MSG_SD_REMOVED           "SD Card rimossa"
1006
 	#define MSG_MAIN                 "Menu principale"
1025
 	#define MSG_MAIN                 "Menu principale"
1012
 	#define MSG_PREHEAT_PLA_SETTINGS "Preris. PLA Conf"
1031
 	#define MSG_PREHEAT_PLA_SETTINGS "Preris. PLA Conf"
1013
 	#define MSG_PREHEAT_ABS          "Preriscalda ABS"
1032
 	#define MSG_PREHEAT_ABS          "Preriscalda ABS"
1014
 	#define MSG_PREHEAT_ABS_SETTINGS "Preris. ABS Conf"
1033
 	#define MSG_PREHEAT_ABS_SETTINGS "Preris. ABS Conf"
1015
-	#define MSG_COOLDOWN             "Rafredda"
1034
+	#define MSG_COOLDOWN             "Raffredda"
1016
 	#define MSG_EXTRUDE              "Estrudi"
1035
 	#define MSG_EXTRUDE              "Estrudi"
1017
 	#define MSG_RETRACT              "Ritrai"
1036
 	#define MSG_RETRACT              "Ritrai"
1018
 	#define MSG_MOVE_AXIS            "Muovi Asse"
1037
 	#define MSG_MOVE_AXIS            "Muovi Asse"
1036
 	#define MSG_PID_C                "PID-C"
1055
 	#define MSG_PID_C                "PID-C"
1037
 	#define MSG_ACC                  "Accel"
1056
 	#define MSG_ACC                  "Accel"
1038
 	#define MSG_VXY_JERK             "Vxy-jerk"
1057
 	#define MSG_VXY_JERK             "Vxy-jerk"
1039
-	#define MSG_VZ_JERK              "Vz-jerk"
1040
-	#define MSG_VE_JERK              "Ve-jerk"
1058
+	#define MSG_VZ_JERK              "Vz-jerk"
1059
+	#define MSG_VE_JERK              "Ve-jerk"
1041
 	#define MSG_VMAX                 "Vmax"
1060
 	#define MSG_VMAX                 "Vmax"
1042
 	#define MSG_X                    "x"
1061
 	#define MSG_X                    "x"
1043
 	#define MSG_Y                    "y"
1062
 	#define MSG_Y                    "y"
1054
 	#define MSG_RECTRACT             "Ritrai"
1073
 	#define MSG_RECTRACT             "Ritrai"
1055
 	#define MSG_TEMPERATURE          "Temperatura"
1074
 	#define MSG_TEMPERATURE          "Temperatura"
1056
 	#define MSG_MOTION               "Movimento"
1075
 	#define MSG_MOTION               "Movimento"
1076
+	#define MSG_CONTRAST "LCD contrast"
1057
 	#define MSG_STORE_EPROM          "Salva in EEPROM"
1077
 	#define MSG_STORE_EPROM          "Salva in EEPROM"
1058
 	#define MSG_LOAD_EPROM           "Carica da EEPROM"
1078
 	#define MSG_LOAD_EPROM           "Carica da EEPROM"
1059
 	#define MSG_RESTORE_FAILSAFE     "Impostaz. default"
1079
 	#define MSG_RESTORE_FAILSAFE     "Impostaz. default"
1149
 	#define MSG_SD_ERR_WRITE_TO_FILE "Errore nella scrittura su file"
1169
 	#define MSG_SD_ERR_WRITE_TO_FILE "Errore nella scrittura su file"
1150
 	#define MSG_SD_CANT_ENTER_SUBDIR "Impossibile entrare nella sottocartella: "
1170
 	#define MSG_SD_CANT_ENTER_SUBDIR "Impossibile entrare nella sottocartella: "
1151
 
1171
 
1152
-	#define MSG_STEPPER_TO_HIGH      "Steprate troppo alto: "
1172
+	#define MSG_STEPPER_TOO_HIGH     "Steprate troppo alto: "
1153
 	#define MSG_ENDSTOPS_HIT         "Raggiunto il fondo carrello: "
1173
 	#define MSG_ENDSTOPS_HIT         "Raggiunto il fondo carrello: "
1154
 	#define MSG_ERR_COLD_EXTRUDE_STOP " prevenuta estrusione fredda"
1174
 	#define MSG_ERR_COLD_EXTRUDE_STOP " prevenuta estrusione fredda"
1155
 	#define MSG_ERR_LONG_EXTRUDE_STOP " prevenuta estrusione troppo lunga"
1175
 	#define MSG_ERR_LONG_EXTRUDE_STOP " prevenuta estrusione troppo lunga"
1198
 	#define MSG_PID_C " PID-C: "
1218
 	#define MSG_PID_C " PID-C: "
1199
 	#define MSG_ACC  " Acc:"
1219
 	#define MSG_ACC  " Acc:"
1200
 	#define MSG_VXY_JERK " Vxy-jerk: "
1220
 	#define MSG_VXY_JERK " Vxy-jerk: "
1201
-	#define MSG_VZ_JERK "Vz-jerk"
1202
-	#define MSG_VE_JERK "Ve-jerk"
1221
+	#define MSG_VZ_JERK "Vz-jerk"
1222
+	#define MSG_VE_JERK "Ve-jerk"
1203
 	#define MSG_VMAX " Vmax "
1223
 	#define MSG_VMAX " Vmax "
1204
 	#define MSG_X "x:"
1224
 	#define MSG_X "x:"
1205
 	#define MSG_Y "y:"
1225
 	#define MSG_Y "y:"
1246
 	#define MSG_CONTROL_RETRACT_RECOVER " DesRet +mm:"
1266
 	#define MSG_CONTROL_RETRACT_RECOVER " DesRet +mm:"
1247
 	#define MSG_CONTROL_RETRACT_RECOVERF " DesRet  F:"
1267
 	#define MSG_CONTROL_RETRACT_RECOVERF " DesRet  F:"
1248
 	#define MSG_AUTORETRACT " AutoRetr.:"
1268
 	#define MSG_AUTORETRACT " AutoRetr.:"
1249
-        #define MSG_SERIAL_ERROR_MENU_STRUCTURE "Algo esta errado na estrutura do Menu."
1250
-        #define MSG_FILAMENTCHANGE "Change filament"
1269
+	#define MSG_SERIAL_ERROR_MENU_STRUCTURE "Algo esta errado na estrutura do Menu."
1270
+	#define MSG_FILAMENTCHANGE "Change filament"
1251
 
1271
 
1252
 // Serial Console Messages
1272
 // Serial Console Messages
1253
 
1273
 
1315
 	#define MSG_SD_ERR_WRITE_TO_FILE "Erro ao escrever no arquivo"
1335
 	#define MSG_SD_ERR_WRITE_TO_FILE "Erro ao escrever no arquivo"
1316
 	#define MSG_SD_CANT_ENTER_SUBDIR "Nao pode abrir o sub diretorio:"
1336
 	#define MSG_SD_CANT_ENTER_SUBDIR "Nao pode abrir o sub diretorio:"
1317
 
1337
 
1318
-	#define MSG_STEPPER_TO_HIGH "Steprate muito alto : "
1338
+	#define MSG_STEPPER_TOO_HIGH "Steprate muito alto : "
1319
 	#define MSG_ENDSTOPS_HIT "O ponto final foi tocado: "
1339
 	#define MSG_ENDSTOPS_HIT "O ponto final foi tocado: "
1320
 	#define MSG_ERR_COLD_EXTRUDE_STOP " Extrusao a frio evitada"
1340
 	#define MSG_ERR_COLD_EXTRUDE_STOP " Extrusao a frio evitada"
1321
 	#define MSG_ERR_LONG_EXTRUDE_STOP " Extrusao muito larga evitada"
1341
 	#define MSG_ERR_LONG_EXTRUDE_STOP " Extrusao muito larga evitada"
1366
 	#define MSG_PID_C "PID-C"
1386
 	#define MSG_PID_C "PID-C"
1367
 	#define MSG_ACC  "Kiihtyv"
1387
 	#define MSG_ACC  "Kiihtyv"
1368
 	#define MSG_VXY_JERK "Vxy-jerk"
1388
 	#define MSG_VXY_JERK "Vxy-jerk"
1369
-	#define MSG_VZ_JERK "Vz-jerk"
1370
-	#define MSG_VE_JERK "Ve-jerk"
1389
+	#define MSG_VZ_JERK "Vz-jerk"
1390
+	#define MSG_VE_JERK "Ve-jerk"
1371
 	#define MSG_VMAX "Vmax "
1391
 	#define MSG_VMAX "Vmax "
1372
 	#define MSG_X "x"
1392
 	#define MSG_X "x"
1373
 	#define MSG_Y "y"
1393
 	#define MSG_Y "y"
1384
 	#define MSG_RECTRACT "Veda takaisin"
1404
 	#define MSG_RECTRACT "Veda takaisin"
1385
 	#define MSG_TEMPERATURE "Lampotila"
1405
 	#define MSG_TEMPERATURE "Lampotila"
1386
 	#define MSG_MOTION "Liike"
1406
 	#define MSG_MOTION "Liike"
1407
+	#define MSG_CONTRAST "LCD contrast"
1387
 	#define MSG_STORE_EPROM "Tallenna muistiin"
1408
 	#define MSG_STORE_EPROM "Tallenna muistiin"
1388
 	#define MSG_LOAD_EPROM "Lataa muistista"
1409
 	#define MSG_LOAD_EPROM "Lataa muistista"
1389
 	#define MSG_RESTORE_FAILSAFE "Palauta oletus"
1410
 	#define MSG_RESTORE_FAILSAFE "Palauta oletus"
1476
 	#define MSG_SD_ERR_WRITE_TO_FILE "virhe kirjoitettaessa tiedostoon"
1497
 	#define MSG_SD_ERR_WRITE_TO_FILE "virhe kirjoitettaessa tiedostoon"
1477
 	#define MSG_SD_CANT_ENTER_SUBDIR "Alihakemistoon ei voitu siirtya: "
1498
 	#define MSG_SD_CANT_ENTER_SUBDIR "Alihakemistoon ei voitu siirtya: "
1478
 
1499
 
1479
-	#define MSG_STEPPER_TO_HIGH "Askellustaajuus liian suuri: "
1500
+	#define MSG_STEPPER_TOO_HIGH "Askellustaajuus liian suuri: "
1480
 	#define MSG_ENDSTOPS_HIT "paatyrajat aktivoitu: "
1501
 	#define MSG_ENDSTOPS_HIT "paatyrajat aktivoitu: "
1481
 	#define MSG_ERR_COLD_EXTRUDE_STOP " kylmana pursotus estetty"
1502
 	#define MSG_ERR_COLD_EXTRUDE_STOP " kylmana pursotus estetty"
1482
 	#define MSG_ERR_LONG_EXTRUDE_STOP " liian pitka pursotus estetty"
1503
 	#define MSG_ERR_LONG_EXTRUDE_STOP " liian pitka pursotus estetty"

+ 374
- 128
Marlin/pins.h View File

53
 
53
 
54
 #endif /* 99 */
54
 #endif /* 99 */
55
 
55
 
56
+
56
 /****************************************************************************************
57
 /****************************************************************************************
57
 * Gen7 v1.1, v1.2, v1.3 pin assignment
58
 * Gen7 v1.1, v1.2, v1.3 pin assignment
58
 *
59
 *
227
 #endif
228
 #endif
228
 
229
 
229
 //x axis pins
230
 //x axis pins
230
-    #define X_STEP_PIN      21                  //different from stanard GEN7
231
-    #define X_DIR_PIN       20            //different from stanard GEN7
231
+    #define X_STEP_PIN      21                  // different from standard GEN7
232
+    #define X_DIR_PIN       20                  // different from standard GEN7
232
     #define X_ENABLE_PIN    24
233
     #define X_ENABLE_PIN    24
233
     #define X_STOP_PIN      0
234
     #define X_STOP_PIN      0
234
 
235
 
297
 * Arduino Mega pin assignment
298
 * Arduino Mega pin assignment
298
 *
299
 *
299
 ****************************************************************************************/
300
 ****************************************************************************************/
300
-#if MOTHERBOARD == 3 || MOTHERBOARD == 33 || MOTHERBOARD == 34
301
+#if MOTHERBOARD == 3 || MOTHERBOARD == 33 || MOTHERBOARD == 34 || MOTHERBOARD == 77
301
 #define KNOWN_BOARD 1
302
 #define KNOWN_BOARD 1
302
 
303
 
303
 //////////////////FIX THIS//////////////
304
 //////////////////FIX THIS//////////////
307
  #endif
308
  #endif
308
 #endif
309
 #endif
309
 
310
 
311
+
310
 // uncomment one of the following lines for RAMPS v1.3 or v1.0, comment both for v1.2 or 1.1
312
 // uncomment one of the following lines for RAMPS v1.3 or v1.0, comment both for v1.2 or 1.1
311
 // #define RAMPS_V_1_3
313
 // #define RAMPS_V_1_3
312
 // #define RAMPS_V_1_0
314
 // #define RAMPS_V_1_0
313
 
315
 
314
-#if MOTHERBOARD == 33 || MOTHERBOARD == 34
315
 
316
 
316
-#define LARGE_FLASH        true
317
-
318
-#define X_STEP_PIN         54
319
-#define X_DIR_PIN          55
320
-#define X_ENABLE_PIN       38
321
-#define X_MIN_PIN           3
322
-#define X_MAX_PIN           2
317
+#if MOTHERBOARD == 33 || MOTHERBOARD == 34 || MOTHERBOARD == 77
323
 
318
 
324
-#define Y_STEP_PIN         60
325
-#define Y_DIR_PIN          61
326
-#define Y_ENABLE_PIN       56
327
-#define Y_MIN_PIN          14
328
-#define Y_MAX_PIN          15
329
-
330
-#define Z_STEP_PIN         46
331
-#define Z_DIR_PIN          48
332
-#define Z_ENABLE_PIN       62
333
-#define Z_MIN_PIN          18
334
-#define Z_MAX_PIN          19
335
-
336
-#define Z2_STEP_PIN        36
337
-#define Z2_DIR_PIN         34
338
-#define Z2_ENABLE_PIN      30
319
+  #define LARGE_FLASH true
320
+  
321
+  #if MOTHERBOARD == 77
322
+    #define X_STEP_PIN         54
323
+    #define X_DIR_PIN          55
324
+    #define X_ENABLE_PIN       38
325
+    #define X_MIN_PIN           3
326
+    #define X_MAX_PIN           -1   //2 //Max endstops default to disabled "-1", set to commented value to enable.
327
+
328
+    #define Y_STEP_PIN         60
329
+    #define Y_DIR_PIN          61
330
+    #define Y_ENABLE_PIN       56
331
+    #define Y_MIN_PIN          14
332
+    #define Y_MAX_PIN          -1   //15
333
+
334
+    #define Z_STEP_PIN         46
335
+    #define Z_DIR_PIN          48
336
+    #define Z_ENABLE_PIN       63
337
+    #define Z_MIN_PIN          18
338
+    #define Z_MAX_PIN          -1
339
+
340
+    #define Z2_STEP_PIN        36
341
+    #define Z2_DIR_PIN         34
342
+    #define Z2_ENABLE_PIN      30
343
+
344
+    #define E0_STEP_PIN        26
345
+    #define E0_DIR_PIN         28
346
+    #define E0_ENABLE_PIN      24
347
+
348
+    #define E1_STEP_PIN        36
349
+    #define E1_DIR_PIN         34
350
+    #define E1_ENABLE_PIN      30
351
+
352
+    #define SDPOWER            -1
353
+    #define SDSS               25//53
354
+    #define LED_PIN            13
355
+
356
+    #define BEEPER             33    
339
 
357
 
340
-#define E0_STEP_PIN        26
341
-#define E0_DIR_PIN         28
342
-#define E0_ENABLE_PIN      24
358
+  #else
343
 
359
 
344
-#define E1_STEP_PIN        36
345
-#define E1_DIR_PIN         34
346
-#define E1_ENABLE_PIN      30
360
+    #define X_STEP_PIN         54
361
+    #define X_DIR_PIN          55
362
+    #define X_ENABLE_PIN       38
363
+    #define X_MIN_PIN           3
364
+    #define X_MAX_PIN           2
365
+
366
+    #define Y_STEP_PIN         60
367
+    #define Y_DIR_PIN          61
368
+    #define Y_ENABLE_PIN       56
369
+    #define Y_MIN_PIN          14
370
+    #define Y_MAX_PIN          15
371
+
372
+    #define Z_STEP_PIN         46
373
+    #define Z_DIR_PIN          48
374
+    #define Z_ENABLE_PIN       62
375
+    #define Z_MIN_PIN          18
376
+    #define Z_MAX_PIN          19
377
+
378
+    #define Z2_STEP_PIN        36
379
+    #define Z2_DIR_PIN         34
380
+    #define Z2_ENABLE_PIN      30
381
+
382
+    #define E0_STEP_PIN        26
383
+    #define E0_DIR_PIN         28
384
+    #define E0_ENABLE_PIN      24
385
+
386
+    #define E1_STEP_PIN        36
387
+    #define E1_DIR_PIN         34
388
+    #define E1_ENABLE_PIN      30
389
+
390
+    #define SDPOWER            -1
391
+    #define SDSS               53
392
+    #define LED_PIN            13
393
+  #endif
347
 
394
 
348
-#define SDPOWER            -1
349
-#define SDSS               53
350
-#define LED_PIN            13
395
+  #if MOTHERBOARD == 33
396
+    #define FAN_PIN            9 // (Sprinter config)
397
+  #else
398
+    #define FAN_PIN            4 // IO pin. Buffer needed
399
+  #endif
351
 
400
 
352
-#if MOTHERBOARD == 33
353
-#define FAN_PIN            9 // (Sprinter config)
354
-#else
355
-#define FAN_PIN            4 // IO pin. Buffer needed
356
-#endif
357
-#define PS_ON_PIN          12
401
+  #if MOTHERBOARD == 77
402
+    #define FAN_PIN            8 
403
+  #endif
358
 
404
 
359
-#if defined(REPRAP_DISCOUNT_SMART_CONTROLLER) || defined(G3D_PANEL)
360
-#define KILL_PIN           41
361
-#else
362
-#define KILL_PIN           -1
363
-#endif
405
+  #define PS_ON_PIN          12
364
 
406
 
365
-#define HEATER_0_PIN       10   // EXTRUDER 1
366
-#if MOTHERBOARD == 33
367
-#define HEATER_1_PIN       -1
368
-#else
369
-#define HEATER_1_PIN       9    // EXTRUDER 2 (FAN On Sprinter)
370
-#endif
371
-#define HEATER_2_PIN       -1
372
-#define TEMP_0_PIN         13   // ANALOG NUMBERING
373
-#define TEMP_1_PIN         15   // ANALOG NUMBERING
374
-#define TEMP_2_PIN         -1   // ANALOG NUMBERING
375
-#define HEATER_BED_PIN     8    // BED
376
-#define TEMP_BED_PIN       14   // ANALOG NUMBERING
407
+  #if defined(REPRAP_DISCOUNT_SMART_CONTROLLER) || defined(G3D_PANEL)
408
+    #define KILL_PIN           41
409
+  #else
410
+    #define KILL_PIN           -1
411
+  #endif
377
 
412
 
378
-#ifdef NUM_SERVOS
379
-  #define SERVO0_PIN         11
380
-  #if NUM_SERVOS > 1
381
-  #define SERVO1_PIN         6
413
+  #define HEATER_0_PIN       10   // EXTRUDER 1
414
+  #if MOTHERBOARD == 33 
415
+    #define HEATER_1_PIN       -1
416
+  #else
417
+    #define HEATER_1_PIN       9    // EXTRUDER 2 (FAN On Sprinter)
382
   #endif
418
   #endif
383
-  #if NUM_SERVOS > 2
384
-  #define SERVO2_PIN         5
419
+  #define HEATER_2_PIN       -1 
420
+
421
+  #if MOTHERBOARD == 77
422
+    #define HEATER_0_PIN       10   
423
+    #define HEATER_1_PIN       12 
424
+    #define HEATER_2_PIN       6   
385
   #endif
425
   #endif
386
-  #if NUM_SERVOS > 2
387
-  #define SERVO3_PIN         4
426
+
427
+  #define TEMP_0_PIN         13   // ANALOG NUMBERING
428
+  #define TEMP_1_PIN         15   // ANALOG NUMBERING
429
+  #define TEMP_2_PIN         -1   // ANALOG NUMBERING
430
+  #if MOTHERBOARD == 77
431
+    #define HEATER_BED_PIN     9    // BED
432
+  #else
433
+    #define HEATER_BED_PIN     8    // BED
388
   #endif
434
   #endif
389
-#endif
435
+  #define TEMP_BED_PIN       14   // ANALOG NUMBERING
390
 
436
 
391
-#ifdef ULTRA_LCD
392
 
437
 
393
-  #ifdef NEWPANEL
394
-    #define LCD_PINS_RS 16 
395
-    #define LCD_PINS_ENABLE 17
396
-    #define LCD_PINS_D4 23
397
-    #define LCD_PINS_D5 25
398
-    #define LCD_PINS_D6 27
399
-    #define LCD_PINS_D7 29
400
 
438
 
401
-    #ifdef REPRAP_DISCOUNT_SMART_CONTROLLER
402
-      #define BEEPER 37
439
+  #ifdef NUM_SERVOS
440
+    #define SERVO0_PIN         11
403
 
441
 
404
-      #define BTN_EN1 31
405
-      #define BTN_EN2 33
406
-      #define BTN_ENC 35
442
+    #if NUM_SERVOS > 1
443
+      #define SERVO1_PIN         6
444
+    #endif
407
 
445
 
408
-      #define SDCARDDETECT 49
409
-    #else
410
-      //arduino pin which triggers an piezzo beeper
411
-      #define BEEPER 33  // Beeper on AUX-4
412
-
413
-      //buttons are directly attached using AUX-2
414
-      #ifdef REPRAPWORLD_KEYPAD
415
-        #define BTN_EN1 64 // encoder
416
-        #define BTN_EN2 59 // encoder
417
-        #define BTN_ENC 63 // enter button
418
-        #define SHIFT_OUT 40 // shift register
419
-        #define SHIFT_CLK 44 // shift register
420
-        #define SHIFT_LD 42 // shift register
421
-      #else
422
-        #define BTN_EN1 37
423
-        #define BTN_EN2 35
424
-        #define BTN_ENC 31  //the click
425
-      #endif
446
+    #if NUM_SERVOS > 2
447
+      #define SERVO2_PIN         5
448
+    #endif
426
 
449
 
427
-      #ifdef G3D_PANEL
428
-        #define SDCARDDETECT 49
429
-      #else
430
-        #define SDCARDDETECT -1  // Ramps does not use this port
431
-      #endif
450
+    #if NUM_SERVOS > 3
451
+      #define SERVO3_PIN         4
432
     #endif
452
     #endif
453
+  #endif
433
 
454
 
434
-  #else //old style panel with shift register
435
-    //arduino pin witch triggers an piezzo beeper
436
-    #define BEEPER 33   // No Beeper added 
455
+  #ifdef ULTRA_LCD
437
 
456
 
438
-    //buttons are attached to a shift register
439
-  // Not wired this yet
440
-    //#define SHIFT_CLK 38
441
-    //#define SHIFT_LD 42
442
-    //#define SHIFT_OUT 40
443
-    //#define SHIFT_EN 17
457
+    #ifdef NEWPANEL
458
+      #define LCD_PINS_RS 16 
459
+      #define LCD_PINS_ENABLE 17
460
+      #define LCD_PINS_D4 23
461
+      #define LCD_PINS_D5 25 
462
+      #define LCD_PINS_D6 27
463
+      #define LCD_PINS_D7 29
444
 
464
 
445
-    #define LCD_PINS_RS 16
446
-    #define LCD_PINS_ENABLE 17
447
-    #define LCD_PINS_D4 23
448
-    #define LCD_PINS_D5 25
449
-    #define LCD_PINS_D6 27
450
-    #define LCD_PINS_D7 29
451
-  #endif 
452
-#endif //ULTRA_LCD
465
+      #ifdef REPRAP_DISCOUNT_SMART_CONTROLLER
466
+        #define BEEPER 37
467
+
468
+        #define BTN_EN1 31
469
+        #define BTN_EN2 33
470
+        #define BTN_ENC 35
471
+
472
+        #define SDCARDDETECT 49
473
+      #else
474
+        //arduino pin which triggers an piezzo beeper
475
+        #define BEEPER 33  // Beeper on AUX-4
476
+
477
+        //buttons are directly attached using AUX-2
478
+        #ifdef REPRAPWORLD_KEYPAD
479
+          #define BTN_EN1 64 // encoder
480
+          #define BTN_EN2 59 // encoder
481
+          #define BTN_ENC 63 // enter button
482
+          #define SHIFT_OUT 40 // shift register
483
+          #define SHIFT_CLK 44 // shift register
484
+          #define SHIFT_LD 42 // shift register
485
+        #else
486
+          #define BTN_EN1 37
487
+          #define BTN_EN2 35
488
+          #define BTN_ENC 31  //the click
489
+        #endif
490
+
491
+        #ifdef G3D_PANEL
492
+          #define SDCARDDETECT 49
493
+        #else
494
+          #define SDCARDDETECT -1  // Ramps does not use this port
495
+        #endif
496
+    
497
+      #endif
498
+    
499
+      #if MOTHERBOARD == 77 
500
+        #define BEEPER -1 
501
+
502
+        #define LCD_PINS_RS 27 
503
+        #define LCD_PINS_ENABLE 29 
504
+        #define LCD_PINS_D4 37 
505
+        #define LCD_PINS_D5 35 
506
+        #define LCD_PINS_D6 33 
507
+        #define LCD_PINS_D7 31 
508
+
509
+       //buttons 
510
+       #define BTN_EN1 16 
511
+       #define BTN_EN2 17 
512
+       #define BTN_ENC 23 //the click 
513
+
514
+    #endif 
515
+    #else //old style panel with shift register
516
+      //arduino pin witch triggers an piezzo beeper
517
+      #define BEEPER 33		//No Beeper added
518
+
519
+      //buttons are attached to a shift register
520
+	// Not wired this yet
521
+      //#define SHIFT_CLK 38
522
+      //#define SHIFT_LD 42
523
+      //#define SHIFT_OUT 40
524
+      //#define SHIFT_EN 17
525
+    
526
+      #define LCD_PINS_RS 16 
527
+      #define LCD_PINS_ENABLE 17
528
+      #define LCD_PINS_D4 23
529
+      #define LCD_PINS_D5 25 
530
+      #define LCD_PINS_D6 27
531
+      #define LCD_PINS_D7 29
532
+    #endif 
533
+  #endif //ULTRA_LCD
453
 
534
 
454
 #else // RAMPS_V_1_1 or RAMPS_V_1_2 as default (MOTHERBOARD == 3)
535
 #else // RAMPS_V_1_1 or RAMPS_V_1_2 as default (MOTHERBOARD == 3)
455
 
536
 
493
 #define HEATER_1_PIN        -1
574
 #define HEATER_1_PIN        -1
494
 #define HEATER_2_PIN        -1
575
 #define HEATER_2_PIN        -1
495
 #define TEMP_0_PIN          2    // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
576
 #define TEMP_0_PIN          2    // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
496
-#define TEMP_1_PIN          -1
497
-#define TEMP_2_PIN          -1
577
+#define TEMP_1_PIN          -1   
578
+#define TEMP_2_PIN          -1   
498
 #define TEMP_BED_PIN        1    // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
579
 #define TEMP_BED_PIN        1    // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
499
-#endif// MOTHERBOARD == 33 || MOTHERBOARD == 34
500
 
580
 
501
-// SPI for Max6675 Thermocouple
581
+#endif // MOTHERBOARD == 33 || MOTHERBOARD == 34 || MOTHERBOARD == 77
582
+
583
+// SPI for Max6675 Thermocouple 
502
 
584
 
503
 #ifndef SDSUPPORT
585
 #ifndef SDSUPPORT
504
-// these pins are defined in the SD library if building with SD support
586
+// these pins are defined in the SD library if building with SD support  
505
   #define MAX_SCK_PIN          52
587
   #define MAX_SCK_PIN          52
506
   #define MAX_MISO_PIN         50
588
   #define MAX_MISO_PIN         50
507
   #define MAX_MOSI_PIN         51
589
   #define MAX_MOSI_PIN         51
510
   #define MAX6675_SS       49
592
   #define MAX6675_SS       49
511
 #endif
593
 #endif
512
 
594
 
513
-#endif//MOTHERBOARD == 3 || MOTHERBOARD == 33 || MOTHERBOARD == 34
595
+#endif //MOTHERBOARD == 3 || MOTHERBOARD == 33 || MOTHERBOARD == 34 || MOTHERBOARD == 77
596
+
597
+
514
 
598
 
515
 /****************************************************************************************
599
 /****************************************************************************************
516
 * Duemilanove w/ ATMega328P pin assignment
600
 * Duemilanove w/ ATMega328P pin assignment
561
 #endif
645
 #endif
562
 
646
 
563
 /****************************************************************************************
647
 /****************************************************************************************
648
+* Elefu RA Board Pin Assignments
649
+*
650
+****************************************************************************************/
651
+#if MOTHERBOARD == 21
652
+#define	KNOWN_BOARD 1
653
+
654
+#ifndef __AVR_ATmega2560__
655
+ #error Oops!  Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu.
656
+#endif
657
+
658
+
659
+#define X_STEP_PIN		     49
660
+#define X_DIR_PIN			     13
661
+#define X_ENABLE_PIN		   48
662
+#define X_MIN_PIN			     35
663
+#define X_MAX_PIN			     -1 //34
664
+
665
+#define Y_STEP_PIN         11
666
+#define Y_DIR_PIN          9
667
+#define Y_ENABLE_PIN       12
668
+#define Y_MIN_PIN          33
669
+#define Y_MAX_PIN          -1 //32
670
+
671
+#define Z_STEP_PIN         7
672
+#define Z_DIR_PIN          6
673
+#define Z_ENABLE_PIN       8
674
+#define Z_MIN_PIN          31
675
+#define Z_MAX_PIN          -1 //30
676
+
677
+#define E2_STEP_PIN        43
678
+#define E2_DIR_PIN         47
679
+#define E2_ENABLE_PIN      42
680
+
681
+#define E1_STEP_PIN        18
682
+#define E1_DIR_PIN         19
683
+#define E1_ENABLE_PIN      38
684
+
685
+#define E0_STEP_PIN        40
686
+#define E0_DIR_PIN         41
687
+#define E0_ENABLE_PIN      37
688
+
689
+#define SDPOWER            -1
690
+#define LED_PIN            -1 //Use +12V Aux port for LED Ring
691
+
692
+#define FAN_PIN            16 //5V PWM
693
+
694
+#define PS_ON_PIN          10 //Set to -1 if using a manual switch on the PWRSW Connector
695
+#define SLEEP_WAKE_PIN		 26 //This feature still needs work
696
+
697
+#define HEATER_0_PIN       45	//12V PWM1
698
+#define HEATER_1_PIN       46	//12V PWM2
699
+#define HEATER_2_PIN       17	//12V PWM3
700
+#define HEATER_BED_PIN     44	//DOUBLE 12V PWM
701
+#define TEMP_0_PIN         3	//ANALOG NUMBERING
702
+#define TEMP_1_PIN         2 	//ANALOG NUMBERING
703
+#define TEMP_2_PIN         1 	//ANALOG NUMBERING
704
+#define TEMP_BED_PIN       0	//ANALOG NUMBERING
705
+
706
+#define BEEPER 		         36
707
+
708
+#define KILL_PIN           -1
709
+
710
+// M240  Triggers a camera by emulating a Canon RC-1 Remote
711
+// Data from: http://www.doc-diy.net/photo/rc-1_hacked/
712
+#define PHOTOGRAPH_PIN     29
713
+
714
+#ifdef RA_CONTROL_PANEL
715
+
716
+  #define SDSS             53
717
+  #define SDCARDDETECT     28
718
+
719
+  #define BTN_EN1          14
720
+  #define BTN_EN2          39
721
+  #define BTN_ENC          15  //the click
722
+    
723
+  #define BLEN_C           2
724
+  #define BLEN_B           1
725
+  #define BLEN_A           0
726
+    
727
+  //encoder rotation values
728
+  #define encrot0          0
729
+  #define encrot1          2
730
+  #define encrot2          3
731
+  #define encrot3          1
732
+  
733
+#endif //RA_CONTROL_PANEL
734
+
735
+#ifdef RA_DISCO
736
+  //variables for which pins the TLC5947 is using
737
+  #define TLC_CLOCK_PIN    25
738
+  #define TLC_BLANK_PIN    23
739
+  #define TLC_XLAT_PIN     22
740
+  #define TLC_DATA_PIN     24
741
+
742
+  //We also need to define pin to port number mapping for the 2560 to match the pins listed above. If you change the TLC pins, update this as well per the 2560 datasheet!
743
+  //This currently only works with the RA Board.
744
+  #define TLC_CLOCK_BIT 3 //bit 3 on port A
745
+  #define TLC_CLOCK_PORT &PORTA //bit 3 on port A
746
+  
747
+  #define TLC_BLANK_BIT 1 //bit 1 on port A
748
+  #define TLC_BLANK_PORT &PORTA //bit 1 on port A
749
+
750
+  #define TLC_DATA_BIT 2 //bit 2 on port A
751
+  #define TLC_DATA_PORT &PORTA //bit 2 on port A
752
+
753
+  #define TLC_XLAT_BIT 0 //bit 0 on port A
754
+  #define TLC_XLAT_PORT &PORTA //bit 0 on port A
755
+
756
+  //change this to match your situation. Lots of TLCs takes up the arduino SRAM very quickly, so be careful 
757
+  //Leave it at at least 1 if you have enabled RA_LIGHTING
758
+  //The number of TLC5947 boards chained together for use with the animation, additional ones will repeat the animation on them, but are not individually addressable and mimic those before them. You can leave the default at 2 even if you only have 1 TLC5947 module.
759
+  #define NUM_TLCS 2 
760
+
761
+  //These TRANS_ARRAY values let you change the order the LEDs on the lighting modules will animate for chase functions. 
762
+  //Modify them according to your specific situation.
763
+  //NOTE: the array should be 8 long for every TLC you have. These defaults assume (2) TLCs.
764
+  #define TRANS_ARRAY {0, 1, 2, 3, 4, 5, 6, 7, 15, 14, 13, 12, 11, 10, 9, 8} //forwards
765
+  //#define TRANS_ARRAY {7, 6, 5, 4, 3, 2, 1, 0, 8, 9, 10, 11, 12, 13, 14, 15} //backwards
766
+#endif //RA_LIGHTING
767
+
768
+
769
+#endif /* Ra Board */
770
+
771
+
772
+/****************************************************************************************
564
 * Gen6 pin assignment
773
 * Gen6 pin assignment
565
 *
774
 *
566
 ****************************************************************************************/
775
 ****************************************************************************************/
634
 #if MOTHERBOARD == 64
843
 #if MOTHERBOARD == 64
635
 #define STB
844
 #define STB
636
 #endif
845
 #endif
637
-#if MOTHERBOARD == 63
846
+#if MOTHERBOARD == 63 || MOTHERBOARD == 66
638
 #define MELZI
847
 #define MELZI
639
 #endif
848
 #endif
640
-#if MOTHERBOARD == 62 || MOTHERBOARD == 63 || MOTHERBOARD == 64
849
+#if MOTHERBOARD == 65
850
+#define AZTEEG_X1
851
+#endif
852
+#if MOTHERBOARD == 62 || MOTHERBOARD == 63 || MOTHERBOARD == 64 || MOTHERBOARD == 65 || MOTHERBOARD == 66
641
 #undef MOTHERBOARD
853
 #undef MOTHERBOARD
642
 #define MOTHERBOARD 6
854
 #define MOTHERBOARD 6
643
 #define SANGUINOLOLU_V_1_2
855
 #define SANGUINOLOLU_V_1_2
679
 
891
 
680
 #ifdef STB
892
 #ifdef STB
681
 #define FAN_PIN            4
893
 #define FAN_PIN            4
894
+	//  Uncomment this if you have the first generation (V1.10) of STBs board
895
+#define LCD_PIN_BL         17 // LCD backlight LED
896
+#endif
897
+
898
+#ifdef AZTEEG_X1
899
+#define FAN_PIN            4
682
 #endif
900
 #endif
683
 
901
 
684
 #define PS_ON_PIN          -1
902
 #define PS_ON_PIN          -1
759
    #endif //Newpanel
977
    #endif //Newpanel
760
  #endif //Ultipanel
978
  #endif //Ultipanel
761
 
979
 
980
+ #ifdef MAKRPANEL
981
+     #define BEEPER 29
982
+     // Pins for DOGM SPI LCD Support
983
+     #define DOGLCD_A0  30
984
+     #define DOGLCD_CS  17
985
+     #define LCD_PIN_BL	28	// backlight LED on PA3
986
+     // GLCD features
987
+     #define LCD_CONTRAST 1
988
+     // Uncomment screen orientation
989
+     #define LCD_SCREEN_ROT_0
990
+       // #define LCD_SCREEN_ROT_90
991
+       // #define LCD_SCREEN_ROT_180
992
+       // #define LCD_SCREEN_ROT_270
993
+     //The encoder and click button
994
+     #define BTN_EN1 11
995
+     #define BTN_EN2 10
996
+     #define BTN_ENC 16  //the click switch
997
+     //not connected to a pin
998
+     #define SDCARDDETECT -1    
999
+ #endif //Makrpanel
1000
+
762
 #endif
1001
 #endif
763
 
1002
 
764
 
1003
 
1831
 #define Z_MAX_PIN          -1
2070
 #define Z_MAX_PIN          -1
1832
 #endif
2071
 #endif
1833
 
2072
 
2073
+#ifdef DISABLE_MIN_ENDSTOPS
2074
+#define X_MIN_PIN          -1
2075
+#define Y_MIN_PIN          -1
2076
+#define Z_MIN_PIN          -1
2077
+#endif
2078
+
1834
 #define SENSITIVE_PINS {0, 1, X_STEP_PIN, X_DIR_PIN, X_ENABLE_PIN, X_MIN_PIN, X_MAX_PIN, Y_STEP_PIN, Y_DIR_PIN, Y_ENABLE_PIN, Y_MIN_PIN, Y_MAX_PIN, Z_STEP_PIN, Z_DIR_PIN, Z_ENABLE_PIN, Z_MIN_PIN, Z_MAX_PIN, PS_ON_PIN, \
2079
 #define SENSITIVE_PINS {0, 1, X_STEP_PIN, X_DIR_PIN, X_ENABLE_PIN, X_MIN_PIN, X_MAX_PIN, Y_STEP_PIN, Y_DIR_PIN, Y_ENABLE_PIN, Y_MIN_PIN, Y_MAX_PIN, Z_STEP_PIN, Z_DIR_PIN, Z_ENABLE_PIN, Z_MIN_PIN, Z_MAX_PIN, PS_ON_PIN, \
1835
                         HEATER_BED_PIN, FAN_PIN,                  \
2080
                         HEATER_BED_PIN, FAN_PIN,                  \
1836
                         _E0_PINS _E1_PINS _E2_PINS             \
2081
                         _E0_PINS _E1_PINS _E2_PINS             \
1837
                         analogInputToDigitalPin(TEMP_0_PIN), analogInputToDigitalPin(TEMP_1_PIN), analogInputToDigitalPin(TEMP_2_PIN), analogInputToDigitalPin(TEMP_BED_PIN) }
2082
                         analogInputToDigitalPin(TEMP_0_PIN), analogInputToDigitalPin(TEMP_1_PIN), analogInputToDigitalPin(TEMP_2_PIN), analogInputToDigitalPin(TEMP_BED_PIN) }
1838
 #endif
2083
 #endif
2084
+

+ 53
- 27
Marlin/planner.cpp View File

98
 //=============================private variables ============================
98
 //=============================private variables ============================
99
 //===========================================================================
99
 //===========================================================================
100
 #ifdef PREVENT_DANGEROUS_EXTRUDE
100
 #ifdef PREVENT_DANGEROUS_EXTRUDE
101
-bool allow_cold_extrude=false;
101
+float extrude_min_temp=EXTRUDE_MINTEMP;
102
 #endif
102
 #endif
103
 #ifdef XY_FREQUENCY_LIMIT
103
 #ifdef XY_FREQUENCY_LIMIT
104
 #define MAX_FREQ_TIME (1000000.0/XY_FREQUENCY_LIMIT)
104
 #define MAX_FREQ_TIME (1000000.0/XY_FREQUENCY_LIMIT)
473
     disable_e2(); 
473
     disable_e2(); 
474
   }
474
   }
475
 #if defined(FAN_PIN) && FAN_PIN > -1
475
 #if defined(FAN_PIN) && FAN_PIN > -1
476
-  #ifndef FAN_SOFT_PWM
477
-    #ifdef FAN_KICKSTART_TIME
478
-      static unsigned long fan_kick_end;
479
-      if (tail_fan_speed) {
480
-        if (fan_kick_end == 0) {
481
-          // Just starting up fan - run at full power.
482
-          fan_kick_end = millis() + FAN_KICKSTART_TIME;
483
-          tail_fan_speed = 255;
484
-        } else if (fan_kick_end > millis())
485
-          // Fan still spinning up.
486
-          tail_fan_speed = 255;
487
-      } else {
488
-        fan_kick_end = 0;
489
-      }
490
-    #endif//FAN_KICKSTART_TIME
491
-    analogWrite(FAN_PIN,tail_fan_speed);
476
+  #ifdef FAN_KICKSTART_TIME
477
+    static unsigned long fan_kick_end;
478
+    if (tail_fan_speed) {
479
+      if (fan_kick_end == 0) {
480
+        // Just starting up fan - run at full power.
481
+        fan_kick_end = millis() + FAN_KICKSTART_TIME;
482
+        tail_fan_speed = 255;
483
+      } else if (fan_kick_end > millis())
484
+        // Fan still spinning up.
485
+        tail_fan_speed = 255;
486
+    } else {
487
+      fan_kick_end = 0;
488
+    }
489
+  #endif//FAN_KICKSTART_TIME
490
+  #ifdef FAN_SOFT_PWM
491
+  fanSpeedSoftPwm = tail_fan_speed;
492
+  #else
493
+  analogWrite(FAN_PIN,tail_fan_speed);
492
   #endif//!FAN_SOFT_PWM
494
   #endif//!FAN_SOFT_PWM
493
 #endif//FAN_PIN > -1
495
 #endif//FAN_PIN > -1
494
 #ifdef AUTOTEMP
496
 #ifdef AUTOTEMP
537
   #ifdef PREVENT_DANGEROUS_EXTRUDE
539
   #ifdef PREVENT_DANGEROUS_EXTRUDE
538
   if(target[E_AXIS]!=position[E_AXIS])
540
   if(target[E_AXIS]!=position[E_AXIS])
539
   {
541
   {
540
-    if(degHotend(active_extruder)<EXTRUDE_MINTEMP && !allow_cold_extrude)
542
+    if(degHotend(active_extruder)<extrude_min_temp)
541
     {
543
     {
542
       position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part
544
       position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part
543
       SERIAL_ECHO_START;
545
       SERIAL_ECHO_START;
562
   block->busy = false;
564
   block->busy = false;
563
 
565
 
564
   // Number of steps for each axis
566
   // Number of steps for each axis
565
-  block->steps_x = labs(target[X_AXIS]-position[X_AXIS]);
566
-  block->steps_y = labs(target[Y_AXIS]-position[Y_AXIS]);
567
+#ifndef COREXY
568
+// default non-h-bot planning
569
+block->steps_x = labs(target[X_AXIS]-position[X_AXIS]);
570
+block->steps_y = labs(target[Y_AXIS]-position[Y_AXIS]);
571
+#else
572
+// corexy planning
573
+// these equations follow the form of the dA and dB equations on http://www.corexy.com/theory.html
574
+block->steps_x = labs((target[X_AXIS]-position[X_AXIS]) + (target[Y_AXIS]-position[Y_AXIS]));
575
+block->steps_y = labs((target[X_AXIS]-position[X_AXIS]) - (target[Y_AXIS]-position[Y_AXIS]));
576
+#endif
567
   block->steps_z = labs(target[Z_AXIS]-position[Z_AXIS]);
577
   block->steps_z = labs(target[Z_AXIS]-position[Z_AXIS]);
568
   block->steps_e = labs(target[E_AXIS]-position[E_AXIS]);
578
   block->steps_e = labs(target[E_AXIS]-position[E_AXIS]);
569
   block->steps_e *= extrudemultiply;
579
   block->steps_e *= extrudemultiply;
584
 
594
 
585
   // Compute direction bits for this block 
595
   // Compute direction bits for this block 
586
   block->direction_bits = 0;
596
   block->direction_bits = 0;
597
+#ifndef COREXY
587
   if (target[X_AXIS] < position[X_AXIS])
598
   if (target[X_AXIS] < position[X_AXIS])
588
   {
599
   {
589
     block->direction_bits |= (1<<X_AXIS); 
600
     block->direction_bits |= (1<<X_AXIS); 
592
   {
603
   {
593
     block->direction_bits |= (1<<Y_AXIS); 
604
     block->direction_bits |= (1<<Y_AXIS); 
594
   }
605
   }
606
+#else
607
+  if ((target[X_AXIS]-position[X_AXIS]) + (target[Y_AXIS]-position[Y_AXIS]) < 0)
608
+  {
609
+    block->direction_bits |= (1<<X_AXIS); 
610
+  }
611
+  if ((target[X_AXIS]-position[X_AXIS]) - (target[Y_AXIS]-position[Y_AXIS]) < 0)
612
+  {
613
+    block->direction_bits |= (1<<Y_AXIS); 
614
+  }
615
+#endif
595
   if (target[Z_AXIS] < position[Z_AXIS])
616
   if (target[Z_AXIS] < position[Z_AXIS])
596
   {
617
   {
597
     block->direction_bits |= (1<<Z_AXIS); 
618
     block->direction_bits |= (1<<Z_AXIS); 
636
   } 
657
   } 
637
 
658
 
638
   float delta_mm[4];
659
   float delta_mm[4];
639
-  delta_mm[X_AXIS] = (target[X_AXIS]-position[X_AXIS])/axis_steps_per_unit[X_AXIS];
640
-  delta_mm[Y_AXIS] = (target[Y_AXIS]-position[Y_AXIS])/axis_steps_per_unit[Y_AXIS];
660
+  #ifndef COREXY
661
+    delta_mm[X_AXIS] = (target[X_AXIS]-position[X_AXIS])/axis_steps_per_unit[X_AXIS];
662
+    delta_mm[Y_AXIS] = (target[Y_AXIS]-position[Y_AXIS])/axis_steps_per_unit[Y_AXIS];
663
+  #else
664
+    delta_mm[X_AXIS] = ((target[X_AXIS]-position[X_AXIS]) + (target[Y_AXIS]-position[Y_AXIS]))/axis_steps_per_unit[X_AXIS];
665
+    delta_mm[Y_AXIS] = ((target[X_AXIS]-position[X_AXIS]) - (target[Y_AXIS]-position[Y_AXIS]))/axis_steps_per_unit[Y_AXIS];
666
+  #endif
641
   delta_mm[Z_AXIS] = (target[Z_AXIS]-position[Z_AXIS])/axis_steps_per_unit[Z_AXIS];
667
   delta_mm[Z_AXIS] = (target[Z_AXIS]-position[Z_AXIS])/axis_steps_per_unit[Z_AXIS];
642
   delta_mm[E_AXIS] = ((target[E_AXIS]-position[E_AXIS])/axis_steps_per_unit[E_AXIS])*extrudemultiply/100.0;
668
   delta_mm[E_AXIS] = ((target[E_AXIS]-position[E_AXIS])/axis_steps_per_unit[E_AXIS])*extrudemultiply/100.0;
643
   if ( block->steps_x <=dropsegments && block->steps_y <=dropsegments && block->steps_z <=dropsegments )
669
   if ( block->steps_x <=dropsegments && block->steps_y <=dropsegments && block->steps_z <=dropsegments )
757
       block->acceleration_st = axis_steps_per_sqr_second[Z_AXIS];
783
       block->acceleration_st = axis_steps_per_sqr_second[Z_AXIS];
758
   }
784
   }
759
   block->acceleration = block->acceleration_st / steps_per_mm;
785
   block->acceleration = block->acceleration_st / steps_per_mm;
760
-  block->acceleration_rate = (long)((float)block->acceleration_st * 8.388608);
786
+  block->acceleration_rate = (long)((float)block->acceleration_st * (16777216.0 / (F_CPU / 8.0)));
761
 
787
 
762
 #if 0  // Use old jerk for now
788
 #if 0  // Use old jerk for now
763
   // Compute path unit vector
789
   // Compute path unit vector
918
   return (block_buffer_head-block_buffer_tail + BLOCK_BUFFER_SIZE) & (BLOCK_BUFFER_SIZE - 1);
944
   return (block_buffer_head-block_buffer_tail + BLOCK_BUFFER_SIZE) & (BLOCK_BUFFER_SIZE - 1);
919
 }
945
 }
920
 
946
 
921
-void allow_cold_extrudes(bool allow)
922
-{
923
 #ifdef PREVENT_DANGEROUS_EXTRUDE
947
 #ifdef PREVENT_DANGEROUS_EXTRUDE
924
-  allow_cold_extrude=allow;
925
-#endif
948
+void set_extrude_min_temp(float temp)
949
+{
950
+  extrude_min_temp=temp;
926
 }
951
 }
952
+#endif
927
 
953
 
928
 // Calculate the steps/s^2 acceleration rates, based on the mm/s^s
954
 // Calculate the steps/s^2 acceleration rates, based on the mm/s^s
929
 void reset_acceleration_rates()
955
 void reset_acceleration_rates()

+ 3
- 1
Marlin/planner.h View File

139
     return true;
139
     return true;
140
 }
140
 }
141
 
141
 
142
-void allow_cold_extrudes(bool allow);
142
+#ifdef PREVENT_DANGEROUS_EXTRUDE
143
+void set_extrude_min_temp(float temp);
144
+#endif
143
 
145
 
144
 void reset_acceleration_rates();
146
 void reset_acceleration_rates();
145
 #endif
147
 #endif

+ 93
- 110
Marlin/stepper.cpp View File

272
     timer = (unsigned short)pgm_read_word_near(table_address);
272
     timer = (unsigned short)pgm_read_word_near(table_address);
273
     timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3);
273
     timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3);
274
   }
274
   }
275
-  if(timer < 100) { timer = 100; MYSERIAL.print(MSG_STEPPER_TO_HIGH); MYSERIAL.println(step_rate); }//(20kHz this should never happen)
275
+  if(timer < 100) { timer = 100; MYSERIAL.print(MSG_STEPPER_TOO_HIGH); MYSERIAL.println(step_rate); }//(20kHz this should never happen)
276
   return timer;
276
   return timer;
277
 }
277
 }
278
 
278
 
345
     // Set directions TO DO This should be done once during init of trapezoid. Endstops -> interrupt
345
     // Set directions TO DO This should be done once during init of trapezoid. Endstops -> interrupt
346
     out_bits = current_block->direction_bits;
346
     out_bits = current_block->direction_bits;
347
 
347
 
348
-    // Set direction en check limit switches
349
-    if ((out_bits & (1<<X_AXIS)) != 0) {   // stepping along -X axis
350
-      #if !defined COREXY  //NOT COREXY
348
+
349
+    // Set the direction bits (X_AXIS=A_AXIS and Y_AXIS=B_AXIS for COREXY)
350
+    if((out_bits & (1<<X_AXIS))!=0){
351
+      #ifdef DUAL_X_CARRIAGE
352
+      if (active_extruder != 0)
353
+        WRITE(X2_DIR_PIN,INVERT_X_DIR);
354
+      else
355
+      #endif        
351
         WRITE(X_DIR_PIN, INVERT_X_DIR);
356
         WRITE(X_DIR_PIN, INVERT_X_DIR);
352
-      #endif
353
       count_direction[X_AXIS]=-1;
357
       count_direction[X_AXIS]=-1;
358
+    }
359
+    else{
360
+      #ifdef DUAL_X_CARRIAGE
361
+      if (active_extruder != 0)
362
+        WRITE(X2_DIR_PIN,!INVERT_X_DIR);
363
+      else
364
+      #endif        
365
+        WRITE(X_DIR_PIN, !INVERT_X_DIR);
366
+      count_direction[X_AXIS]=1;
367
+    }
368
+    if((out_bits & (1<<Y_AXIS))!=0){
369
+      WRITE(Y_DIR_PIN, INVERT_Y_DIR);
370
+      count_direction[Y_AXIS]=-1;
371
+    }
372
+    else{
373
+      WRITE(Y_DIR_PIN, !INVERT_Y_DIR);
374
+      count_direction[Y_AXIS]=1;
375
+    }
376
+    
377
+    // Set direction en check limit switches
378
+    #ifndef COREXY
379
+    if ((out_bits & (1<<X_AXIS)) != 0) {   // stepping along -X axis
380
+    #else
381
+    if ((((out_bits & (1<<X_AXIS)) != 0)&&(out_bits & (1<<Y_AXIS)) != 0)) {   //-X occurs for -A and -B
382
+    #endif
354
       CHECK_ENDSTOPS
383
       CHECK_ENDSTOPS
355
       {
384
       {
356
-        #if defined(X_MIN_PIN) && X_MIN_PIN > -1
357
-          bool x_min_endstop=(READ(X_MIN_PIN) != X_ENDSTOPS_INVERTING);
358
-          if(x_min_endstop && old_x_min_endstop && (current_block->steps_x > 0)) {
359
-            endstops_trigsteps[X_AXIS] = count_position[X_AXIS];
360
-            endstop_x_hit=true;
361
-            step_events_completed = current_block->step_event_count;
362
-          }
363
-          old_x_min_endstop = x_min_endstop;
364
-        #endif
385
+        #ifdef DUAL_X_CARRIAGE
386
+        // with 2 x-carriages, endstops are only checked in the homing direction for the active extruder
387
+        if ((active_extruder == 0 && X_HOME_DIR == -1) || (active_extruder != 0 && X2_HOME_DIR == -1))
388
+        #endif          
389
+        {
390
+          #if defined(X_MIN_PIN) && X_MIN_PIN > -1
391
+            bool x_min_endstop=(READ(X_MIN_PIN) != X_ENDSTOPS_INVERTING);
392
+            if(x_min_endstop && old_x_min_endstop && (current_block->steps_x > 0)) {
393
+              endstops_trigsteps[X_AXIS] = count_position[X_AXIS];
394
+              endstop_x_hit=true;
395
+              step_events_completed = current_block->step_event_count;
396
+            }
397
+            old_x_min_endstop = x_min_endstop;
398
+          #endif
399
+        }
365
       }
400
       }
366
     }
401
     }
367
     else { // +direction
402
     else { // +direction
368
-      #if !defined COREXY  //NOT COREXY
369
-        WRITE(X_DIR_PIN,!INVERT_X_DIR);
370
-      #endif
371
-      
372
-      count_direction[X_AXIS]=1;
373
       CHECK_ENDSTOPS 
403
       CHECK_ENDSTOPS 
374
       {
404
       {
375
-        #if defined(X_MAX_PIN) && X_MAX_PIN > -1
376
-          bool x_max_endstop=(READ(X_MAX_PIN) != X_ENDSTOPS_INVERTING);
377
-          if(x_max_endstop && old_x_max_endstop && (current_block->steps_x > 0)){
378
-            endstops_trigsteps[X_AXIS] = count_position[X_AXIS];
379
-            endstop_x_hit=true;
380
-            step_events_completed = current_block->step_event_count;
381
-          }
382
-          old_x_max_endstop = x_max_endstop;
383
-        #endif
405
+        #ifdef DUAL_X_CARRIAGE
406
+        // with 2 x-carriages, endstops are only checked in the homing direction for the active extruder
407
+        if ((active_extruder == 0 && X_HOME_DIR == 1) || (active_extruder != 0 && X2_HOME_DIR == 1))
408
+        #endif          
409
+        {
410
+          #if defined(X_MAX_PIN) && X_MAX_PIN > -1
411
+            bool x_max_endstop=(READ(X_MAX_PIN) != X_ENDSTOPS_INVERTING);
412
+            if(x_max_endstop && old_x_max_endstop && (current_block->steps_x > 0)){
413
+              endstops_trigsteps[X_AXIS] = count_position[X_AXIS];
414
+              endstop_x_hit=true;
415
+              step_events_completed = current_block->step_event_count;
416
+            }
417
+            old_x_max_endstop = x_max_endstop;
418
+          #endif
419
+        }  
384
       }
420
       }
385
     }
421
     }
386
 
422
 
423
+    #ifndef COREXY
387
     if ((out_bits & (1<<Y_AXIS)) != 0) {   // -direction
424
     if ((out_bits & (1<<Y_AXIS)) != 0) {   // -direction
388
-      #if !defined COREXY  //NOT COREXY
389
-        WRITE(Y_DIR_PIN,INVERT_Y_DIR);
390
-      #endif
391
-      count_direction[Y_AXIS]=-1;
425
+    #else
426
+    if ((((out_bits & (1<<X_AXIS)) != 0)&&(out_bits & (1<<Y_AXIS)) == 0)) {   // -Y occurs for -A and +B
427
+    #endif
392
       CHECK_ENDSTOPS
428
       CHECK_ENDSTOPS
393
       {
429
       {
394
         #if defined(Y_MIN_PIN) && Y_MIN_PIN > -1
430
         #if defined(Y_MIN_PIN) && Y_MIN_PIN > -1
403
       }
439
       }
404
     }
440
     }
405
     else { // +direction
441
     else { // +direction
406
-      #if !defined COREXY  //NOT COREXY
407
-        WRITE(Y_DIR_PIN,!INVERT_Y_DIR);
408
-      #endif
409
-      count_direction[Y_AXIS]=1;
410
       CHECK_ENDSTOPS
442
       CHECK_ENDSTOPS
411
       {
443
       {
412
         #if defined(Y_MAX_PIN) && Y_MAX_PIN > -1
444
         #if defined(Y_MAX_PIN) && Y_MAX_PIN > -1
420
         #endif
452
         #endif
421
       }
453
       }
422
     }
454
     }
423
-    
424
-    
425
-    #ifdef COREXY  //coreXY kinematics defined
426
-      if((current_block->steps_x >= current_block->steps_y)&&((out_bits & (1<<X_AXIS)) == 0)){  //+X is major axis
427
-        WRITE(X_DIR_PIN, !INVERT_X_DIR);
428
-        WRITE(Y_DIR_PIN, !INVERT_Y_DIR);
429
-      }
430
-      if((current_block->steps_x >= current_block->steps_y)&&((out_bits & (1<<X_AXIS)) != 0)){  //-X is major axis
431
-        WRITE(X_DIR_PIN, INVERT_X_DIR);
432
-        WRITE(Y_DIR_PIN, INVERT_Y_DIR);
433
-      }      
434
-      if((current_block->steps_y > current_block->steps_x)&&((out_bits & (1<<Y_AXIS)) == 0)){  //+Y is major axis
435
-        WRITE(X_DIR_PIN, !INVERT_X_DIR);
436
-        WRITE(Y_DIR_PIN, INVERT_Y_DIR);
437
-      }        
438
-      if((current_block->steps_y > current_block->steps_x)&&((out_bits & (1<<Y_AXIS)) != 0)){  //-Y is major axis
439
-        WRITE(X_DIR_PIN, INVERT_X_DIR);
440
-        WRITE(Y_DIR_PIN, !INVERT_Y_DIR);
441
-      }  
442
-    #endif //coreXY
443
-    
444
-    
455
+
445
     if ((out_bits & (1<<Z_AXIS)) != 0) {   // -direction
456
     if ((out_bits & (1<<Z_AXIS)) != 0) {   // -direction
446
       WRITE(Z_DIR_PIN,INVERT_Z_DIR);
457
       WRITE(Z_DIR_PIN,INVERT_Z_DIR);
447
       
458
       
516
       }    
527
       }    
517
       #endif //ADVANCE
528
       #endif //ADVANCE
518
 
529
 
519
-      #if !defined COREXY      
520
         counter_x += current_block->steps_x;
530
         counter_x += current_block->steps_x;
521
         if (counter_x > 0) {
531
         if (counter_x > 0) {
522
-          WRITE(X_STEP_PIN, !INVERT_X_STEP_PIN);
532
+          #ifdef DUAL_X_CARRIAGE
533
+          if (active_extruder != 0)
534
+            WRITE(X2_STEP_PIN,!INVERT_X_STEP_PIN);
535
+          else
536
+          #endif        
537
+            WRITE(X_STEP_PIN, !INVERT_X_STEP_PIN);
523
           counter_x -= current_block->step_event_count;
538
           counter_x -= current_block->step_event_count;
524
           count_position[X_AXIS]+=count_direction[X_AXIS];   
539
           count_position[X_AXIS]+=count_direction[X_AXIS];   
525
-          WRITE(X_STEP_PIN, INVERT_X_STEP_PIN);
540
+          #ifdef DUAL_X_CARRIAGE
541
+          if (active_extruder != 0)
542
+            WRITE(X2_STEP_PIN,INVERT_X_STEP_PIN);
543
+          else
544
+          #endif        
545
+            WRITE(X_STEP_PIN, INVERT_X_STEP_PIN);
526
         }
546
         }
527
   
547
   
528
         counter_y += current_block->steps_y;
548
         counter_y += current_block->steps_y;
532
           count_position[Y_AXIS]+=count_direction[Y_AXIS]; 
552
           count_position[Y_AXIS]+=count_direction[Y_AXIS]; 
533
           WRITE(Y_STEP_PIN, INVERT_Y_STEP_PIN);
553
           WRITE(Y_STEP_PIN, INVERT_Y_STEP_PIN);
534
         }
554
         }
535
-      #endif
536
   
555
   
537
-      #ifdef COREXY
538
-        counter_x += current_block->steps_x;        
539
-        counter_y += current_block->steps_y;
540
-        
541
-        if ((counter_x > 0)&&!(counter_y>0)){  //X step only
542
-          WRITE(X_STEP_PIN, !INVERT_X_STEP_PIN);
543
-          WRITE(Y_STEP_PIN, !INVERT_Y_STEP_PIN);
544
-          counter_x -= current_block->step_event_count; 
545
-          count_position[X_AXIS]+=count_direction[X_AXIS];         
546
-          WRITE(X_STEP_PIN, INVERT_X_STEP_PIN);
547
-          WRITE(Y_STEP_PIN, INVERT_Y_STEP_PIN);
548
-        }
549
-        
550
-        if (!(counter_x > 0)&&(counter_y>0)){  //Y step only
551
-          WRITE(X_STEP_PIN, !INVERT_X_STEP_PIN);
552
-          WRITE(Y_STEP_PIN, !INVERT_Y_STEP_PIN);
553
-          counter_y -= current_block->step_event_count; 
554
-          count_position[Y_AXIS]+=count_direction[Y_AXIS];
555
-          WRITE(X_STEP_PIN, INVERT_X_STEP_PIN);
556
-          WRITE(Y_STEP_PIN, INVERT_Y_STEP_PIN);
557
-        }        
558
-        
559
-        if ((counter_x > 0)&&(counter_y>0)){  //step in both axes
560
-          if (((out_bits & (1<<X_AXIS)) == 0)^((out_bits & (1<<Y_AXIS)) == 0)){  //X and Y in different directions
561
-            WRITE(Y_STEP_PIN, !INVERT_Y_STEP_PIN);
562
-            counter_x -= current_block->step_event_count;             
563
-            WRITE(Y_STEP_PIN, INVERT_Y_STEP_PIN);
564
-            step_wait();
565
-            count_position[X_AXIS]+=count_direction[X_AXIS];
566
-            count_position[Y_AXIS]+=count_direction[Y_AXIS];
567
-            WRITE(Y_STEP_PIN, !INVERT_Y_STEP_PIN);
568
-            counter_y -= current_block->step_event_count;
569
-            WRITE(Y_STEP_PIN, INVERT_Y_STEP_PIN);
570
-          }
571
-          else{  //X and Y in same direction
572
-            WRITE(X_STEP_PIN, !INVERT_X_STEP_PIN);
573
-            counter_x -= current_block->step_event_count;             
574
-            WRITE(X_STEP_PIN, INVERT_X_STEP_PIN) ;
575
-            step_wait();
576
-            count_position[X_AXIS]+=count_direction[X_AXIS];
577
-            count_position[Y_AXIS]+=count_direction[Y_AXIS];
578
-            WRITE(X_STEP_PIN, !INVERT_X_STEP_PIN); 
579
-            counter_y -= current_block->step_event_count;    
580
-            WRITE(X_STEP_PIN, INVERT_X_STEP_PIN);        
581
-          }
582
-        }
583
-      #endif //corexy
584
-      
585
       counter_z += current_block->steps_z;
556
       counter_z += current_block->steps_z;
586
       if (counter_z > 0) {
557
       if (counter_z > 0) {
587
         WRITE(Z_STEP_PIN, !INVERT_Z_STEP_PIN);
558
         WRITE(Z_STEP_PIN, !INVERT_Z_STEP_PIN);
746
   #if defined(X_DIR_PIN) && X_DIR_PIN > -1
717
   #if defined(X_DIR_PIN) && X_DIR_PIN > -1
747
     SET_OUTPUT(X_DIR_PIN);
718
     SET_OUTPUT(X_DIR_PIN);
748
   #endif
719
   #endif
720
+  #if defined(X2_DIR_PIN) && X2_DIR_PIN > -1
721
+    SET_OUTPUT(X2_DIR_PIN);
722
+  #endif
749
   #if defined(Y_DIR_PIN) && Y_DIR_PIN > -1 
723
   #if defined(Y_DIR_PIN) && Y_DIR_PIN > -1 
750
     SET_OUTPUT(Y_DIR_PIN);
724
     SET_OUTPUT(Y_DIR_PIN);
751
   #endif
725
   #endif
772
     SET_OUTPUT(X_ENABLE_PIN);
746
     SET_OUTPUT(X_ENABLE_PIN);
773
     if(!X_ENABLE_ON) WRITE(X_ENABLE_PIN,HIGH);
747
     if(!X_ENABLE_ON) WRITE(X_ENABLE_PIN,HIGH);
774
   #endif
748
   #endif
749
+  #if defined(X2_ENABLE_PIN) && X2_ENABLE_PIN > -1
750
+    SET_OUTPUT(X2_ENABLE_PIN);
751
+    if(!X_ENABLE_ON) WRITE(X2_ENABLE_PIN,HIGH);
752
+  #endif
775
   #if defined(Y_ENABLE_PIN) && Y_ENABLE_PIN > -1
753
   #if defined(Y_ENABLE_PIN) && Y_ENABLE_PIN > -1
776
     SET_OUTPUT(Y_ENABLE_PIN);
754
     SET_OUTPUT(Y_ENABLE_PIN);
777
     if(!Y_ENABLE_ON) WRITE(Y_ENABLE_PIN,HIGH);
755
     if(!Y_ENABLE_ON) WRITE(Y_ENABLE_PIN,HIGH);
849
     WRITE(X_STEP_PIN,INVERT_X_STEP_PIN);
827
     WRITE(X_STEP_PIN,INVERT_X_STEP_PIN);
850
     disable_x();
828
     disable_x();
851
   #endif  
829
   #endif  
830
+  #if defined(X2_STEP_PIN) && (X2_STEP_PIN > -1) 
831
+    SET_OUTPUT(X2_STEP_PIN);
832
+    WRITE(X2_STEP_PIN,INVERT_X_STEP_PIN);
833
+    disable_x();
834
+  #endif  
852
   #if defined(Y_STEP_PIN) && (Y_STEP_PIN > -1) 
835
   #if defined(Y_STEP_PIN) && (Y_STEP_PIN > -1) 
853
     SET_OUTPUT(Y_STEP_PIN);
836
     SET_OUTPUT(Y_STEP_PIN);
854
     WRITE(Y_STEP_PIN,INVERT_Y_STEP_PIN);
837
     WRITE(Y_STEP_PIN,INVERT_Y_STEP_PIN);

+ 89
- 52
Marlin/temperature.cpp View File

40
 int target_temperature[EXTRUDERS] = { 0 };
40
 int target_temperature[EXTRUDERS] = { 0 };
41
 int target_temperature_bed = 0;
41
 int target_temperature_bed = 0;
42
 int current_temperature_raw[EXTRUDERS] = { 0 };
42
 int current_temperature_raw[EXTRUDERS] = { 0 };
43
-float current_temperature[EXTRUDERS] = { 0 };
43
+float current_temperature[EXTRUDERS] = { 0.0 };
44
 int current_temperature_bed_raw = 0;
44
 int current_temperature_bed_raw = 0;
45
-float current_temperature_bed = 0;
46
-
45
+float current_temperature_bed = 0.0;
46
+#ifdef TEMP_SENSOR_1_AS_REDUNDANT
47
+  int redundant_temperature_raw = 0;
48
+  float redundant_temperature = 0.0;
49
+#endif
47
 #ifdef PIDTEMP
50
 #ifdef PIDTEMP
48
   float Kp=DEFAULT_Kp;
51
   float Kp=DEFAULT_Kp;
49
   float Ki=(DEFAULT_Ki*PID_dT);
52
   float Ki=(DEFAULT_Ki*PID_dT);
59
   float bedKd=(DEFAULT_bedKd/PID_dT);
62
   float bedKd=(DEFAULT_bedKd/PID_dT);
60
 #endif //PIDTEMPBED
63
 #endif //PIDTEMPBED
61
   
64
   
65
+#ifdef FAN_SOFT_PWM
66
+  unsigned char fanSpeedSoftPwm;
67
+#endif
62
   
68
   
63
 //===========================================================================
69
 //===========================================================================
64
 //=============================private variables============================
70
 //=============================private variables============================
104
     (defined(EXTRUDER_2_AUTO_FAN_PIN) && EXTRUDER_2_AUTO_FAN_PIN > -1)
110
     (defined(EXTRUDER_2_AUTO_FAN_PIN) && EXTRUDER_2_AUTO_FAN_PIN > -1)
105
   static unsigned long extruder_autofan_last_check;
111
   static unsigned long extruder_autofan_last_check;
106
 #endif  
112
 #endif  
107
-  
113
+
108
 #if EXTRUDERS > 3
114
 #if EXTRUDERS > 3
109
-# error Unsupported number of extruders
115
+  # error Unsupported number of extruders
110
 #elif EXTRUDERS > 2
116
 #elif EXTRUDERS > 2
111
-# define ARRAY_BY_EXTRUDERS(v1, v2, v3) { v1, v2, v3 }
117
+  # define ARRAY_BY_EXTRUDERS(v1, v2, v3) { v1, v2, v3 }
112
 #elif EXTRUDERS > 1
118
 #elif EXTRUDERS > 1
113
-# define ARRAY_BY_EXTRUDERS(v1, v2, v3) { v1, v2 }
119
+  # define ARRAY_BY_EXTRUDERS(v1, v2, v3) { v1, v2 }
114
 #else
120
 #else
115
-# define ARRAY_BY_EXTRUDERS(v1, v2, v3) { v1 }
121
+  # define ARRAY_BY_EXTRUDERS(v1, v2, v3) { v1 }
116
 #endif
122
 #endif
117
 
123
 
118
 // Init min and max temp with extreme values to prevent false errors during startup
124
 // Init min and max temp with extreme values to prevent false errors during startup
124
 #ifdef BED_MAXTEMP
130
 #ifdef BED_MAXTEMP
125
 static int bed_maxttemp_raw = HEATER_BED_RAW_HI_TEMP;
131
 static int bed_maxttemp_raw = HEATER_BED_RAW_HI_TEMP;
126
 #endif
132
 #endif
127
-static void *heater_ttbl_map[EXTRUDERS] = ARRAY_BY_EXTRUDERS( (void *)HEATER_0_TEMPTABLE, (void *)HEATER_1_TEMPTABLE, (void *)HEATER_2_TEMPTABLE );
128
-static uint8_t heater_ttbllen_map[EXTRUDERS] = ARRAY_BY_EXTRUDERS( HEATER_0_TEMPTABLE_LEN, HEATER_1_TEMPTABLE_LEN, HEATER_2_TEMPTABLE_LEN );
133
+
134
+#ifdef TEMP_SENSOR_1_AS_REDUNDANT
135
+  static void *heater_ttbl_map[2] = {(void *)HEATER_0_TEMPTABLE, (void *)HEATER_1_TEMPTABLE };
136
+  static uint8_t heater_ttbllen_map[2] = { HEATER_0_TEMPTABLE_LEN, HEATER_1_TEMPTABLE_LEN };
137
+#else
138
+  static void *heater_ttbl_map[EXTRUDERS] = ARRAY_BY_EXTRUDERS( (void *)HEATER_0_TEMPTABLE, (void *)HEATER_1_TEMPTABLE, (void *)HEATER_2_TEMPTABLE );
139
+  static uint8_t heater_ttbllen_map[EXTRUDERS] = ARRAY_BY_EXTRUDERS( HEATER_0_TEMPTABLE_LEN, HEATER_1_TEMPTABLE_LEN, HEATER_2_TEMPTABLE_LEN );
140
+#endif
129
 
141
 
130
 static float analog2temp(int raw, uint8_t e);
142
 static float analog2temp(int raw, uint8_t e);
131
 static float analog2tempBed(int raw);
143
 static float analog2tempBed(int raw);
136
 unsigned long watchmillis[EXTRUDERS] = ARRAY_BY_EXTRUDERS(0,0,0);
148
 unsigned long watchmillis[EXTRUDERS] = ARRAY_BY_EXTRUDERS(0,0,0);
137
 #endif //WATCH_TEMP_PERIOD
149
 #endif //WATCH_TEMP_PERIOD
138
 
150
 
151
+#ifndef SOFT_PWM_SCALE
152
+#define SOFT_PWM_SCALE 0
153
+#endif
154
+
139
 //===========================================================================
155
 //===========================================================================
140
 //=============================   functions      ============================
156
 //=============================   functions      ============================
141
 //===========================================================================
157
 //===========================================================================
157
   float Kp, Ki, Kd;
173
   float Kp, Ki, Kd;
158
   float max = 0, min = 10000;
174
   float max = 0, min = 10000;
159
 
175
 
160
-	if ((extruder > EXTRUDERS)
176
+  if ((extruder > EXTRUDERS)
161
   #if (TEMP_BED_PIN <= -1)
177
   #if (TEMP_BED_PIN <= -1)
162
-		||(extruder < 0)
163
-	#endif
164
-	){
165
-  	SERIAL_ECHOLN("PID Autotune failed. Bad extruder number.");
166
-  	return;
167
-	}
178
+       ||(extruder < 0)
179
+  #endif
180
+       ){
181
+          SERIAL_ECHOLN("PID Autotune failed. Bad extruder number.");
182
+          return;
183
+        }
168
 	
184
 	
169
   SERIAL_ECHOLN("PID Autotune start");
185
   SERIAL_ECHOLN("PID Autotune start");
170
   
186
   
171
   disable_heater(); // switch off all heaters.
187
   disable_heater(); // switch off all heaters.
172
 
188
 
173
-	if (extruder<0)
174
-	{
175
-	 	soft_pwm_bed = (MAX_BED_POWER)/2;
176
-		bias = d = (MAX_BED_POWER)/2;
177
-  }
178
-	else
179
-	{
180
-	  soft_pwm[extruder] = (PID_MAX)/2;
181
-		bias = d = (PID_MAX)/2;
189
+  if (extruder<0)
190
+  {
191
+     soft_pwm_bed = (MAX_BED_POWER)/2;
192
+     bias = d = (MAX_BED_POWER)/2;
193
+   }
194
+   else
195
+   {
196
+     soft_pwm[extruder] = (PID_MAX)/2;
197
+     bias = d = (PID_MAX)/2;
182
   }
198
   }
183
 
199
 
184
 
200
 
196
       if(heating == true && input > temp) {
212
       if(heating == true && input > temp) {
197
         if(millis() - t2 > 5000) { 
213
         if(millis() - t2 > 5000) { 
198
           heating=false;
214
           heating=false;
199
-					if (extruder<0)
200
-						soft_pwm_bed = (bias - d) >> 1;
201
-					else
202
-						soft_pwm[extruder] = (bias - d) >> 1;
215
+          if (extruder<0)
216
+            soft_pwm_bed = (bias - d) >> 1;
217
+          else
218
+            soft_pwm[extruder] = (bias - d) >> 1;
203
           t1=millis();
219
           t1=millis();
204
           t_high=t1 - t2;
220
           t_high=t1 - t2;
205
           max=temp;
221
           max=temp;
250
               */
266
               */
251
             }
267
             }
252
           }
268
           }
253
-					if (extruder<0)
254
-						soft_pwm_bed = (bias + d) >> 1;
255
-					else
256
-						soft_pwm[extruder] = (bias + d) >> 1;
269
+          if (extruder<0)
270
+            soft_pwm_bed = (bias + d) >> 1;
271
+          else
272
+            soft_pwm[extruder] = (bias + d) >> 1;
257
           cycles++;
273
           cycles++;
258
           min=temp;
274
           min=temp;
259
         }
275
         }
260
       } 
276
       } 
261
     }
277
     }
262
     if(input > (temp + 20)) {
278
     if(input > (temp + 20)) {
263
-      SERIAL_PROTOCOLLNPGM("PID Autotune failed! Temperature to high");
279
+      SERIAL_PROTOCOLLNPGM("PID Autotune failed! Temperature too high");
264
       return;
280
       return;
265
     }
281
     }
266
     if(millis() - temp_millis > 2000) {
282
     if(millis() - temp_millis > 2000) {
267
-			int p;
268
-			if (extruder<0){
269
-	      p=soft_pwm_bed;       
270
-	      SERIAL_PROTOCOLPGM("ok B:");
271
-			}else{
272
-	      p=soft_pwm[extruder];       
273
-	      SERIAL_PROTOCOLPGM("ok T:");
274
-			}
283
+      int p;
284
+      if (extruder<0){
285
+        p=soft_pwm_bed;       
286
+        SERIAL_PROTOCOLPGM("ok B:");
287
+      }else{
288
+        p=soft_pwm[extruder];       
289
+        SERIAL_PROTOCOLPGM("ok T:");
290
+      }
275
 			
291
 			
276
       SERIAL_PROTOCOL(input);   
292
       SERIAL_PROTOCOL(input);   
277
       SERIAL_PROTOCOLPGM(" @:");
293
       SERIAL_PROTOCOLPGM(" @:");
284
       return;
300
       return;
285
     }
301
     }
286
     if(cycles > ncycles) {
302
     if(cycles > ncycles) {
287
-      SERIAL_PROTOCOLLNPGM("PID Autotune finished ! Place the Kp, Ki and Kd constants in the configuration.h");
303
+      SERIAL_PROTOCOLLNPGM("PID Autotune finished! Put the Kp, Ki and Kd constants into Configuration.h");
288
       return;
304
       return;
289
     }
305
     }
290
     lcd_update();
306
     lcd_update();
471
         }
487
         }
472
     }
488
     }
473
     #endif
489
     #endif
474
-
490
+    #ifdef TEMP_SENSOR_1_AS_REDUNDANT
491
+      if(fabs(current_temperature[0] - redundant_temperature) > MAX_REDUNDANT_TEMP_SENSOR_DIFF) {
492
+        disable_heater();
493
+        if(IsStopped() == false) {
494
+          SERIAL_ERROR_START;
495
+          SERIAL_ERRORLNPGM("Extruder switched off. Temperature difference between temp sensors is too high !");
496
+          LCD_ALERTMESSAGEPGM("Err: REDUNDANT TEMP ERROR");
497
+        }
498
+        #ifndef BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE
499
+          Stop();
500
+        #endif
501
+      }
502
+    #endif
475
   } // End extruder for loop
503
   } // End extruder for loop
476
 
504
 
477
   #if (defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN > -1) || \
505
   #if (defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN > -1) || \
565
 // Derived from RepRap FiveD extruder::getTemperature()
593
 // Derived from RepRap FiveD extruder::getTemperature()
566
 // For hot end temperature measurement.
594
 // For hot end temperature measurement.
567
 static float analog2temp(int raw, uint8_t e) {
595
 static float analog2temp(int raw, uint8_t e) {
596
+#ifdef TEMP_SENSOR_1_AS_REDUNDANT
597
+  if(e > EXTRUDERS)
598
+#else
568
   if(e >= EXTRUDERS)
599
   if(e >= EXTRUDERS)
600
+#endif
569
   {
601
   {
570
       SERIAL_ERROR_START;
602
       SERIAL_ERROR_START;
571
       SERIAL_ERROR((int)e);
603
       SERIAL_ERROR((int)e);
644
         current_temperature[e] = analog2temp(current_temperature_raw[e], e);
676
         current_temperature[e] = analog2temp(current_temperature_raw[e], e);
645
     }
677
     }
646
     current_temperature_bed = analog2tempBed(current_temperature_bed_raw);
678
     current_temperature_bed = analog2tempBed(current_temperature_bed_raw);
647
-
679
+    #ifdef TEMP_SENSOR_1_AS_REDUNDANT
680
+      redundant_temperature = analog2temp(redundant_temperature_raw, 1);
681
+    #endif
648
     //Reset the watchdog after we know we have a temperature measurement.
682
     //Reset the watchdog after we know we have a temperature measurement.
649
     watchdog_reset();
683
     watchdog_reset();
650
 
684
 
693
     setPwmFrequency(FAN_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8
727
     setPwmFrequency(FAN_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8
694
     #endif
728
     #endif
695
     #ifdef FAN_SOFT_PWM
729
     #ifdef FAN_SOFT_PWM
696
-	soft_pwm_fan=(unsigned char)fanSpeed;
697
-	#endif
730
+    soft_pwm_fan = fanSpeedSoftPwm / 2;
731
+    #endif
698
   #endif  
732
   #endif  
699
 
733
 
700
   #ifdef HEATER_0_USES_MAX6675
734
   #ifdef HEATER_0_USES_MAX6675
994
 // Timer 0 is shared with millies
1028
 // Timer 0 is shared with millies
995
 ISR(TIMER0_COMPB_vect)
1029
 ISR(TIMER0_COMPB_vect)
996
 {
1030
 {
997
-  //these variables are only accesible from the ISR, but static, so they don't loose their value
1031
+  //these variables are only accesible from the ISR, but static, so they don't lose their value
998
   static unsigned char temp_count = 0;
1032
   static unsigned char temp_count = 0;
999
   static unsigned long raw_temp_0_value = 0;
1033
   static unsigned long raw_temp_0_value = 0;
1000
   static unsigned long raw_temp_1_value = 0;
1034
   static unsigned long raw_temp_1_value = 0;
1001
   static unsigned long raw_temp_2_value = 0;
1035
   static unsigned long raw_temp_2_value = 0;
1002
   static unsigned long raw_temp_bed_value = 0;
1036
   static unsigned long raw_temp_bed_value = 0;
1003
   static unsigned char temp_state = 0;
1037
   static unsigned char temp_state = 0;
1004
-  static unsigned char pwm_count = 1;
1038
+  static unsigned char pwm_count = (1 << SOFT_PWM_SCALE);
1005
   static unsigned char soft_pwm_0;
1039
   static unsigned char soft_pwm_0;
1006
   #if EXTRUDERS > 1
1040
   #if EXTRUDERS > 1
1007
   static unsigned char soft_pwm_1;
1041
   static unsigned char soft_pwm_1;
1029
     if(soft_pwm_b > 0) WRITE(HEATER_BED_PIN,1);
1063
     if(soft_pwm_b > 0) WRITE(HEATER_BED_PIN,1);
1030
     #endif
1064
     #endif
1031
     #ifdef FAN_SOFT_PWM
1065
     #ifdef FAN_SOFT_PWM
1032
-    soft_pwm_fan =(unsigned char) fanSpeed;
1066
+    soft_pwm_fan = fanSpeedSoftPwm / 2;
1033
     if(soft_pwm_fan > 0) WRITE(FAN_PIN,1);
1067
     if(soft_pwm_fan > 0) WRITE(FAN_PIN,1);
1034
     #endif
1068
     #endif
1035
   }
1069
   }
1047
   if(soft_pwm_fan <= pwm_count) WRITE(FAN_PIN,0);
1081
   if(soft_pwm_fan <= pwm_count) WRITE(FAN_PIN,0);
1048
   #endif
1082
   #endif
1049
   
1083
   
1050
-  pwm_count++;
1084
+  pwm_count += (1 << SOFT_PWM_SCALE);
1051
   pwm_count &= 0x7f;
1085
   pwm_count &= 0x7f;
1052
   
1086
   
1053
   switch(temp_state) {
1087
   switch(temp_state) {
1145
 #if EXTRUDERS > 1
1179
 #if EXTRUDERS > 1
1146
       current_temperature_raw[1] = raw_temp_1_value;
1180
       current_temperature_raw[1] = raw_temp_1_value;
1147
 #endif
1181
 #endif
1182
+#ifdef TEMP_SENSOR_1_AS_REDUNDANT
1183
+      redundant_temperature_raw = raw_temp_1_value;
1184
+#endif
1148
 #if EXTRUDERS > 2
1185
 #if EXTRUDERS > 2
1149
       current_temperature_raw[2] = raw_temp_2_value;
1186
       current_temperature_raw[2] = raw_temp_2_value;
1150
 #endif
1187
 #endif

+ 3
- 0
Marlin/temperature.h View File

37
 extern float current_temperature[EXTRUDERS];
37
 extern float current_temperature[EXTRUDERS];
38
 extern int target_temperature_bed;
38
 extern int target_temperature_bed;
39
 extern float current_temperature_bed;
39
 extern float current_temperature_bed;
40
+#ifdef TEMP_SENSOR_1_AS_REDUNDANT
41
+  extern float redundant_temperature;
42
+#endif
40
 
43
 
41
 #ifdef PIDTEMP
44
 #ifdef PIDTEMP
42
   extern float Kp,Ki,Kd,Kc;
45
   extern float Kp,Ki,Kd,Kc;

+ 128
- 52
Marlin/ultralcd.cpp View File

8
 #include "stepper.h"
8
 #include "stepper.h"
9
 #include "ConfigurationStore.h"
9
 #include "ConfigurationStore.h"
10
 
10
 
11
+int8_t encoderDiff; /* encoderDiff is updated from interrupt context and added to encoderPosition every LCD update */
12
+
11
 /* Configuration settings */
13
 /* Configuration settings */
12
 int plaPreheatHotendTemp;
14
 int plaPreheatHotendTemp;
13
 int plaPreheatHPBTemp;
15
 int plaPreheatHPBTemp;
47
 static void lcd_control_temperature_preheat_pla_settings_menu();
49
 static void lcd_control_temperature_preheat_pla_settings_menu();
48
 static void lcd_control_temperature_preheat_abs_settings_menu();
50
 static void lcd_control_temperature_preheat_abs_settings_menu();
49
 static void lcd_control_motion_menu();
51
 static void lcd_control_motion_menu();
52
+#ifdef DOGLCD
53
+static void lcd_set_contrast();
54
+#endif
50
 static void lcd_control_retract_menu();
55
 static void lcd_control_retract_menu();
51
 static void lcd_sdcard_menu();
56
 static void lcd_sdcard_menu();
52
 
57
 
122
 #ifndef REPRAPWORLD_KEYPAD
127
 #ifndef REPRAPWORLD_KEYPAD
123
 volatile uint8_t buttons;//Contains the bits of the currently pressed buttons.
128
 volatile uint8_t buttons;//Contains the bits of the currently pressed buttons.
124
 #else
129
 #else
125
-volatile uint16_t buttons;//Contains the bits of the currently pressed buttons (extended).
130
+volatile uint8_t buttons_reprapworld_keypad; // to store the reprapworld_keypad shiftregister values
126
 #endif
131
 #endif
127
-
128
 uint8_t currentMenuViewOffset;              /* scroll offset in the current menu */
132
 uint8_t currentMenuViewOffset;              /* scroll offset in the current menu */
129
 uint32_t blocking_enc;
133
 uint32_t blocking_enc;
130
 uint8_t lastEncoderBits;
134
 uint8_t lastEncoderBits;
131
-int8_t encoderDiff; /* encoderDiff is updated from interrupt context and added to encoderPosition every LCD update */
132
 uint32_t encoderPosition;
135
 uint32_t encoderPosition;
133
 #if (SDCARDDETECT > 0)
136
 #if (SDCARDDETECT > 0)
134
 bool lcd_oldcardstatus;
137
 bool lcd_oldcardstatus;
173
     }
176
     }
174
 
177
 
175
     // Dead zone at 100% feedrate
178
     // Dead zone at 100% feedrate
176
-    if (feedmultiply < 100 && (feedmultiply + int(encoderPosition)) > 100 ||
177
-            feedmultiply > 100 && (feedmultiply + int(encoderPosition)) < 100)
179
+    if ((feedmultiply < 100 && (feedmultiply + int(encoderPosition)) > 100) ||
180
+            (feedmultiply > 100 && (feedmultiply + int(encoderPosition)) < 100))
178
     {
181
     {
179
         encoderPosition = 0;
182
         encoderPosition = 0;
180
         feedmultiply = 100;
183
         feedmultiply = 100;
357
     if (encoderPosition != 0)
360
     if (encoderPosition != 0)
358
     {
361
     {
359
         current_position[X_AXIS] += float((int)encoderPosition) * move_menu_scale;
362
         current_position[X_AXIS] += float((int)encoderPosition) * move_menu_scale;
360
-        if (current_position[X_AXIS] < X_MIN_POS)
363
+        if (min_software_endstops && current_position[X_AXIS] < X_MIN_POS)
361
             current_position[X_AXIS] = X_MIN_POS;
364
             current_position[X_AXIS] = X_MIN_POS;
362
-        if (current_position[X_AXIS] > X_MAX_POS)
365
+        if (max_software_endstops && current_position[X_AXIS] > X_MAX_POS)
363
             current_position[X_AXIS] = X_MAX_POS;
366
             current_position[X_AXIS] = X_MAX_POS;
364
         encoderPosition = 0;
367
         encoderPosition = 0;
365
         plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 600, active_extruder);
368
         plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 600, active_extruder);
381
     if (encoderPosition != 0)
384
     if (encoderPosition != 0)
382
     {
385
     {
383
         current_position[Y_AXIS] += float((int)encoderPosition) * move_menu_scale;
386
         current_position[Y_AXIS] += float((int)encoderPosition) * move_menu_scale;
384
-        if (current_position[Y_AXIS] < Y_MIN_POS)
387
+        if (min_software_endstops && current_position[Y_AXIS] < Y_MIN_POS)
385
             current_position[Y_AXIS] = Y_MIN_POS;
388
             current_position[Y_AXIS] = Y_MIN_POS;
386
-        if (current_position[Y_AXIS] > Y_MAX_POS)
389
+        if (max_software_endstops && current_position[Y_AXIS] > Y_MAX_POS)
387
             current_position[Y_AXIS] = Y_MAX_POS;
390
             current_position[Y_AXIS] = Y_MAX_POS;
388
         encoderPosition = 0;
391
         encoderPosition = 0;
389
         plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 600, active_extruder);
392
         plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 600, active_extruder);
405
     if (encoderPosition != 0)
408
     if (encoderPosition != 0)
406
     {
409
     {
407
         current_position[Z_AXIS] += float((int)encoderPosition) * move_menu_scale;
410
         current_position[Z_AXIS] += float((int)encoderPosition) * move_menu_scale;
408
-        if (current_position[Z_AXIS] < Z_MIN_POS)
411
+        if (min_software_endstops && current_position[Z_AXIS] < Z_MIN_POS)
409
             current_position[Z_AXIS] = Z_MIN_POS;
412
             current_position[Z_AXIS] = Z_MIN_POS;
410
-        if (current_position[Z_AXIS] > Z_MAX_POS)
413
+        if (max_software_endstops && current_position[Z_AXIS] > Z_MAX_POS)
411
             current_position[Z_AXIS] = Z_MAX_POS;
414
             current_position[Z_AXIS] = Z_MAX_POS;
412
         encoderPosition = 0;
415
         encoderPosition = 0;
413
-        plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 60, active_extruder);
416
+        plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], homing_feedrate[Z_AXIS]/60, active_extruder);
414
         lcdDrawUpdate = 1;
417
         lcdDrawUpdate = 1;
415
     }
418
     }
416
     if (lcdDrawUpdate)
419
     if (lcdDrawUpdate)
492
     MENU_ITEM(back, MSG_MAIN, lcd_main_menu);
495
     MENU_ITEM(back, MSG_MAIN, lcd_main_menu);
493
     MENU_ITEM(submenu, MSG_TEMPERATURE, lcd_control_temperature_menu);
496
     MENU_ITEM(submenu, MSG_TEMPERATURE, lcd_control_temperature_menu);
494
     MENU_ITEM(submenu, MSG_MOTION, lcd_control_motion_menu);
497
     MENU_ITEM(submenu, MSG_MOTION, lcd_control_motion_menu);
498
+#ifdef DOGLCD
499
+//    MENU_ITEM_EDIT(int3, MSG_CONTRAST, &lcd_contrast, 0, 63);
500
+    MENU_ITEM(submenu, MSG_CONTRAST, lcd_set_contrast);
501
+#endif
495
 #ifdef FWRETRACT
502
 #ifdef FWRETRACT
496
     MENU_ITEM(submenu, MSG_RETRACT, lcd_control_retract_menu);
503
     MENU_ITEM(submenu, MSG_RETRACT, lcd_control_retract_menu);
497
 #endif
504
 #endif
505
 
512
 
506
 static void lcd_control_temperature_menu()
513
 static void lcd_control_temperature_menu()
507
 {
514
 {
515
+#ifdef PIDTEMP
508
     // set up temp variables - undo the default scaling
516
     // set up temp variables - undo the default scaling
509
     raw_Ki = unscalePID_i(Ki);
517
     raw_Ki = unscalePID_i(Ki);
510
     raw_Kd = unscalePID_d(Kd);
518
     raw_Kd = unscalePID_d(Kd);
519
+#endif
511
 
520
 
512
     START_MENU();
521
     START_MENU();
513
     MENU_ITEM(back, MSG_CONTROL, lcd_control_menu);
522
     MENU_ITEM(back, MSG_CONTROL, lcd_control_menu);
601
     END_MENU();
610
     END_MENU();
602
 }
611
 }
603
 
612
 
613
+#ifdef DOGLCD
614
+static void lcd_set_contrast()
615
+{
616
+    if (encoderPosition != 0)
617
+    {
618
+        lcd_contrast -= encoderPosition;
619
+        if (lcd_contrast < 0) lcd_contrast = 0;
620
+        else if (lcd_contrast > 63) lcd_contrast = 63;
621
+        encoderPosition = 0;
622
+        lcdDrawUpdate = 1;
623
+        u8g.setContrast(lcd_contrast);
624
+    }
625
+    if (lcdDrawUpdate)
626
+    {
627
+        lcd_implementation_drawedit(PSTR("Contrast"), itostr2(lcd_contrast));
628
+    }
629
+    if (LCD_CLICKED)
630
+    {
631
+        lcd_quick_feedback();
632
+        currentMenu = lcd_control_menu;
633
+        encoderPosition = 0;
634
+    }
635
+}
636
+#endif
637
+
604
 #ifdef FWRETRACT
638
 #ifdef FWRETRACT
605
 static void lcd_control_retract_menu()
639
 static void lcd_control_retract_menu()
606
 {
640
 {
734
 menu_edit_type(unsigned long, long5, ftostr5, 0.01)
768
 menu_edit_type(unsigned long, long5, ftostr5, 0.01)
735
 
769
 
736
 #ifdef REPRAPWORLD_KEYPAD
770
 #ifdef REPRAPWORLD_KEYPAD
737
-    static void reprapworld_keypad_move_y_down() {
738
-        encoderPosition = 1;
739
-        move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP;
740
-        lcd_move_y();
741
-    }
742
-    static void reprapworld_keypad_move_y_up() {
743
-        encoderPosition = -1;
744
-        move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP;
745
-        lcd_move_y();
746
-    }
747
-    static void reprapworld_keypad_move_home() {
748
-        //enquecommand_P((PSTR("G28"))); // move all axis home
749
-        // TODO gregor: move all axis home, i have currently only one axis on my prusa i3
750
-        enquecommand_P((PSTR("G28 Y")));
751
-    }
771
+	static void reprapworld_keypad_move_z_up() {
772
+    encoderPosition = 1;
773
+    move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP;
774
+		lcd_move_z();
775
+  }
776
+	static void reprapworld_keypad_move_z_down() {
777
+    encoderPosition = -1;
778
+    move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP;
779
+		lcd_move_z();
780
+  }
781
+	static void reprapworld_keypad_move_x_left() {
782
+    encoderPosition = -1;
783
+    move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP;
784
+		lcd_move_x();
785
+  }
786
+	static void reprapworld_keypad_move_x_right() {
787
+    encoderPosition = 1;
788
+    move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP;
789
+		lcd_move_x();
790
+	}
791
+	static void reprapworld_keypad_move_y_down() {
792
+    encoderPosition = 1;
793
+    move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP;
794
+		lcd_move_y();
795
+	}
796
+	static void reprapworld_keypad_move_y_up() {
797
+		encoderPosition = -1;
798
+		move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP;
799
+    lcd_move_y();
800
+	}
801
+	static void reprapworld_keypad_move_home() {
802
+		enquecommand_P((PSTR("G28"))); // move all axis home
803
+	}
752
 #endif
804
 #endif
753
 
805
 
754
 /** End of menus **/
806
 /** End of menus **/
875
     if (lcd_next_update_millis < millis())
927
     if (lcd_next_update_millis < millis())
876
     {
928
     {
877
 #ifdef ULTIPANEL
929
 #ifdef ULTIPANEL
878
-        #ifdef REPRAPWORLD_KEYPAD
879
-        if (REPRAPWORLD_KEYPAD_MOVE_Y_DOWN) {
880
-            reprapworld_keypad_move_y_down();
881
-        }
882
-        if (REPRAPWORLD_KEYPAD_MOVE_Y_UP) {
883
-            reprapworld_keypad_move_y_up();
884
-        }
885
-        if (REPRAPWORLD_KEYPAD_MOVE_HOME) {
886
-            reprapworld_keypad_move_home();
887
-        }
888
-        #endif
930
+		#ifdef REPRAPWORLD_KEYPAD
931
+        	if (REPRAPWORLD_KEYPAD_MOVE_Z_UP) {
932
+        		reprapworld_keypad_move_z_up();
933
+        	}
934
+        	if (REPRAPWORLD_KEYPAD_MOVE_Z_DOWN) {
935
+        		reprapworld_keypad_move_z_down();
936
+        	}
937
+        	if (REPRAPWORLD_KEYPAD_MOVE_X_LEFT) {
938
+        		reprapworld_keypad_move_x_left();
939
+        	}
940
+        	if (REPRAPWORLD_KEYPAD_MOVE_X_RIGHT) {
941
+        		reprapworld_keypad_move_x_right();
942
+        	}
943
+        	if (REPRAPWORLD_KEYPAD_MOVE_Y_DOWN) {
944
+        		reprapworld_keypad_move_y_down();
945
+        	}
946
+        	if (REPRAPWORLD_KEYPAD_MOVE_Y_UP) {
947
+        		reprapworld_keypad_move_y_up();
948
+        	}
949
+        	if (REPRAPWORLD_KEYPAD_MOVE_HOME) {
950
+        		reprapworld_keypad_move_home();
951
+        	}
952
+		#endif
889
         if (encoderDiff)
953
         if (encoderDiff)
890
         {
954
         {
891
             lcdDrawUpdate = 1;
955
             lcdDrawUpdate = 1;
960
     lcd_status_message_level = 0;
1024
     lcd_status_message_level = 0;
961
 }
1025
 }
962
 
1026
 
1027
+#ifdef DOGLCD
1028
+void lcd_setcontrast(uint8_t value)
1029
+{
1030
+    lcd_contrast = value & 63;
1031
+    u8g.setContrast(lcd_contrast);	
1032
+}
1033
+#endif
1034
+
963
 #ifdef ULTIPANEL
1035
 #ifdef ULTIPANEL
964
 /* Warning: This function is called from interrupt context */
1036
 /* Warning: This function is called from interrupt context */
965
 void lcd_buttons_update()
1037
 void lcd_buttons_update()
971
   #if BTN_ENC > 0
1043
   #if BTN_ENC > 0
972
     if((blocking_enc<millis()) && (READ(BTN_ENC)==0))
1044
     if((blocking_enc<millis()) && (READ(BTN_ENC)==0))
973
         newbutton |= EN_C;
1045
         newbutton |= EN_C;
974
-  #endif      
975
-  #ifdef REPRAPWORLD_KEYPAD
976
-    // for the reprapworld_keypad
977
-    uint8_t newbutton_reprapworld_keypad=0;
978
-    WRITE(SHIFT_LD,LOW);
979
-    WRITE(SHIFT_LD,HIGH);
980
-    for(int8_t i=0;i<8;i++) {
981
-        newbutton_reprapworld_keypad = newbutton_reprapworld_keypad>>1;
982
-        if(READ(SHIFT_OUT))
983
-            newbutton_reprapworld_keypad|=(1<<7);
984
-        WRITE(SHIFT_CLK,HIGH);
985
-        WRITE(SHIFT_CLK,LOW);
986
-    }
987
-    newbutton |= ((~newbutton_reprapworld_keypad) << REPRAPWORLD_BTN_OFFSET); //invert it, because a pressed switch produces a logical 0
988
   #endif
1046
   #endif
989
     buttons = newbutton;
1047
     buttons = newbutton;
1048
+    #ifdef REPRAPWORLD_KEYPAD
1049
+      // for the reprapworld_keypad
1050
+      uint8_t newbutton_reprapworld_keypad=0;
1051
+      WRITE(SHIFT_LD,LOW);
1052
+      WRITE(SHIFT_LD,HIGH);
1053
+      for(int8_t i=0;i<8;i++) {
1054
+          newbutton_reprapworld_keypad = newbutton_reprapworld_keypad>>1;
1055
+          if(READ(SHIFT_OUT))
1056
+              newbutton_reprapworld_keypad|=(1<<7);
1057
+          WRITE(SHIFT_CLK,HIGH);
1058
+          WRITE(SHIFT_CLK,LOW);
1059
+      }
1060
+      buttons_reprapworld_keypad=~newbutton_reprapworld_keypad; //invert it, because a pressed switch produces a logical 0
1061
+	#endif
990
 #else   //read it from the shift register
1062
 #else   //read it from the shift register
991
     uint8_t newbutton=0;
1063
     uint8_t newbutton=0;
992
     WRITE(SHIFT_LD,LOW);
1064
     WRITE(SHIFT_LD,LOW);
1252
 // grab the pid i value out of the temp variable; scale it; then update the PID driver
1324
 // grab the pid i value out of the temp variable; scale it; then update the PID driver
1253
 void copy_and_scalePID_i()
1325
 void copy_and_scalePID_i()
1254
 {
1326
 {
1327
+#ifdef PIDTEMP
1255
   Ki = scalePID_i(raw_Ki);
1328
   Ki = scalePID_i(raw_Ki);
1256
   updatePID();
1329
   updatePID();
1330
+#endif
1257
 }
1331
 }
1258
 
1332
 
1259
 // Callback for after editing PID d value
1333
 // Callback for after editing PID d value
1260
 // grab the pid d value out of the temp variable; scale it; then update the PID driver
1334
 // grab the pid d value out of the temp variable; scale it; then update the PID driver
1261
 void copy_and_scalePID_d()
1335
 void copy_and_scalePID_d()
1262
 {
1336
 {
1337
+#ifdef PIDTEMP
1263
   Kd = scalePID_d(raw_Kd);
1338
   Kd = scalePID_d(raw_Kd);
1264
   updatePID();
1339
   updatePID();
1340
+#endif
1265
 }
1341
 }
1266
 
1342
 
1267
 #endif //ULTRA_LCD
1343
 #endif //ULTRA_LCD

+ 49
- 1
Marlin/ultralcd.h View File

11
   void lcd_setstatuspgm(const char* message);
11
   void lcd_setstatuspgm(const char* message);
12
   void lcd_setalertstatuspgm(const char* message);
12
   void lcd_setalertstatuspgm(const char* message);
13
   void lcd_reset_alert_level();
13
   void lcd_reset_alert_level();
14
-  
14
+
15
+#ifdef DOGLCD
16
+  extern int lcd_contrast;
17
+  void lcd_setcontrast(uint8_t value);
18
+#endif
19
+
15
   static unsigned char blink = 0;	// Variable for visualisation of fan rotation in GLCD
20
   static unsigned char blink = 0;	// Variable for visualisation of fan rotation in GLCD
16
 
21
 
17
   #define LCD_MESSAGEPGM(x) lcd_setstatuspgm(PSTR(x))
22
   #define LCD_MESSAGEPGM(x) lcd_setstatuspgm(PSTR(x))
22
 
27
 
23
   #ifdef ULTIPANEL
28
   #ifdef ULTIPANEL
24
   void lcd_buttons_update();
29
   void lcd_buttons_update();
30
+  extern volatile uint8_t buttons;  //the last checked buttons in a bit array.
31
+  #ifdef REPRAPWORLD_KEYPAD
32
+    extern volatile uint8_t buttons_reprapworld_keypad; // to store the keypad shiftregister values
33
+  #endif
25
   #else
34
   #else
26
   FORCE_INLINE void lcd_buttons_update() {}
35
   FORCE_INLINE void lcd_buttons_update() {}
27
   #endif
36
   #endif
37
   void lcd_buzz(long duration,uint16_t freq);
46
   void lcd_buzz(long duration,uint16_t freq);
38
   bool lcd_clicked();
47
   bool lcd_clicked();
39
 
48
 
49
+  #ifdef NEWPANEL
50
+    #define EN_C (1<<BLEN_C)
51
+    #define EN_B (1<<BLEN_B)
52
+    #define EN_A (1<<BLEN_A)
53
+
54
+    #define LCD_CLICKED (buttons&EN_C)
55
+    #ifdef REPRAPWORLD_KEYPAD
56
+  	  #define EN_REPRAPWORLD_KEYPAD_F3 (1<<BLEN_REPRAPWORLD_KEYPAD_F3)
57
+  	  #define EN_REPRAPWORLD_KEYPAD_F2 (1<<BLEN_REPRAPWORLD_KEYPAD_F2)
58
+  	  #define EN_REPRAPWORLD_KEYPAD_F1 (1<<BLEN_REPRAPWORLD_KEYPAD_F1)
59
+  	  #define EN_REPRAPWORLD_KEYPAD_UP (1<<BLEN_REPRAPWORLD_KEYPAD_UP)
60
+  	  #define EN_REPRAPWORLD_KEYPAD_RIGHT (1<<BLEN_REPRAPWORLD_KEYPAD_RIGHT)
61
+  	  #define EN_REPRAPWORLD_KEYPAD_MIDDLE (1<<BLEN_REPRAPWORLD_KEYPAD_MIDDLE)
62
+  	  #define EN_REPRAPWORLD_KEYPAD_DOWN (1<<BLEN_REPRAPWORLD_KEYPAD_DOWN)
63
+  	  #define EN_REPRAPWORLD_KEYPAD_LEFT (1<<BLEN_REPRAPWORLD_KEYPAD_LEFT)
64
+
65
+  	  #define LCD_CLICKED ((buttons&EN_C) || (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_F1))
66
+  	  #define REPRAPWORLD_KEYPAD_MOVE_Z_UP (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_F2)
67
+  	  #define REPRAPWORLD_KEYPAD_MOVE_Z_DOWN (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_F3)
68
+  	  #define REPRAPWORLD_KEYPAD_MOVE_X_LEFT (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_LEFT)
69
+  	  #define REPRAPWORLD_KEYPAD_MOVE_X_RIGHT (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_RIGHT)
70
+  	  #define REPRAPWORLD_KEYPAD_MOVE_Y_DOWN (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_DOWN)
71
+  	  #define REPRAPWORLD_KEYPAD_MOVE_Y_UP (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_UP)
72
+  	  #define REPRAPWORLD_KEYPAD_MOVE_HOME (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_MIDDLE)
73
+    #endif //REPRAPWORLD_KEYPAD
74
+  #else
75
+    //atomatic, do not change
76
+    #define B_LE (1<<BL_LE)
77
+    #define B_UP (1<<BL_UP)
78
+    #define B_MI (1<<BL_MI)
79
+    #define B_DW (1<<BL_DW)
80
+    #define B_RI (1<<BL_RI)
81
+    #define B_ST (1<<BL_ST)
82
+    #define EN_B (1<<BLEN_B)
83
+    #define EN_A (1<<BLEN_A)
84
+    
85
+    #define LCD_CLICKED ((buttons&B_MI)||(buttons&B_ST))
86
+  #endif//NEWPANEL
87
+
40
 #else //no lcd
88
 #else //no lcd
41
   FORCE_INLINE void lcd_update() {}
89
   FORCE_INLINE void lcd_update() {}
42
   FORCE_INLINE void lcd_init() {}
90
   FORCE_INLINE void lcd_init() {}

+ 757
- 748
Marlin/ultralcd_implementation_hitachi_HD44780.h
File diff suppressed because it is too large
View File


+ 131
- 0
Marlin/ultralcd_st7920_u8glib_rrd.h View File

1
+#ifndef ULCDST7920_H
2
+#define ULCDST7920_H
3
+
4
+#include "Marlin.h"
5
+
6
+#ifdef U8GLIB_ST7920
7
+
8
+//set optimization so ARDUINO optimizes this file
9
+#pragma GCC optimize (3)
10
+
11
+#define ST7920_CLK_PIN  LCD_PINS_D4
12
+#define ST7920_DAT_PIN  LCD_PINS_ENABLE
13
+#define ST7920_CS_PIN   LCD_PINS_RS
14
+
15
+//#define PAGE_HEIGHT 8   //128 byte frambuffer
16
+//#define PAGE_HEIGHT 16  //256 byte frambuffer
17
+#define PAGE_HEIGHT 32  //512 byte framebuffer
18
+
19
+#define WIDTH 128
20
+#define HEIGHT 64
21
+
22
+#include <U8glib.h>
23
+
24
+static void ST7920_SWSPI_SND_8BIT(uint8_t val)
25
+{
26
+  uint8_t i;
27
+  for( i=0; i<8; i++ )
28
+  {
29
+    WRITE(ST7920_CLK_PIN,0);
30
+    WRITE(ST7920_DAT_PIN,val&0x80); 
31
+    val<<=1;
32
+    WRITE(ST7920_CLK_PIN,1);
33
+  }
34
+}
35
+
36
+#define ST7920_CS()              {WRITE(ST7920_CS_PIN,1);u8g_10MicroDelay();}
37
+#define ST7920_NCS()             {WRITE(ST7920_CS_PIN,0);}
38
+#define ST7920_SET_CMD()         {ST7920_SWSPI_SND_8BIT(0xf8);u8g_10MicroDelay();}
39
+#define ST7920_SET_DAT()         {ST7920_SWSPI_SND_8BIT(0xfa);u8g_10MicroDelay();}
40
+#define ST7920_WRITE_BYTE(a)     {ST7920_SWSPI_SND_8BIT((a)&0xf0);ST7920_SWSPI_SND_8BIT((a)<<4);u8g_10MicroDelay();}
41
+#define ST7920_WRITE_BYTES(p,l)  {uint8_t i;for(i=0;i<l;i++){ST7920_SWSPI_SND_8BIT(*p&0xf0);ST7920_SWSPI_SND_8BIT(*p<<4);p++;}u8g_10MicroDelay();}
42
+
43
+uint8_t u8g_dev_rrd_st7920_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, void *arg)
44
+{
45
+  uint8_t i,y;
46
+  switch(msg)
47
+  {
48
+    case U8G_DEV_MSG_INIT:
49
+      {
50
+        SET_OUTPUT(ST7920_CS_PIN);
51
+        WRITE(ST7920_CS_PIN,0);
52
+        SET_OUTPUT(ST7920_DAT_PIN);
53
+        WRITE(ST7920_DAT_PIN,0);
54
+        SET_OUTPUT(ST7920_CLK_PIN);
55
+        WRITE(ST7920_CLK_PIN,1);
56
+
57
+        ST7920_CS();
58
+        u8g_Delay(90);                 //initial delay for boot up
59
+        ST7920_SET_CMD();
60
+        ST7920_WRITE_BYTE(0x08);       //display off, cursor+blink off
61
+        ST7920_WRITE_BYTE(0x01);       //clear CGRAM ram
62
+        u8g_Delay(10);                 //delay for cgram clear
63
+        ST7920_WRITE_BYTE(0x3E);       //extended mode + gdram active
64
+        for(y=0;y<HEIGHT/2;y++)        //clear GDRAM
65
+        {
66
+          ST7920_WRITE_BYTE(0x80|y);   //set y
67
+          ST7920_WRITE_BYTE(0x80);     //set x = 0
68
+          ST7920_SET_DAT();
69
+          for(i=0;i<2*WIDTH/8;i++)     //2x width clears both segments
70
+            ST7920_WRITE_BYTE(0);
71
+          ST7920_SET_CMD();
72
+        }
73
+        ST7920_WRITE_BYTE(0x0C); //display on, cursor+blink off
74
+        ST7920_NCS();
75
+      }
76
+      break;
77
+
78
+    case U8G_DEV_MSG_STOP:
79
+      break;
80
+    case U8G_DEV_MSG_PAGE_NEXT:
81
+      {
82
+        uint8_t *ptr;
83
+        u8g_pb_t *pb = (u8g_pb_t *)(dev->dev_mem);
84
+        y = pb->p.page_y0;
85
+        ptr = (uint8_t*)pb->buf;
86
+
87
+        ST7920_CS();
88
+        for( i = 0; i < PAGE_HEIGHT; i ++ )
89
+        {
90
+          ST7920_SET_CMD();
91
+          if ( y < 32 )
92
+          {
93
+            ST7920_WRITE_BYTE(0x80 | y);       //y
94
+            ST7920_WRITE_BYTE(0x80);           //x=0
95
+          }
96
+          else
97
+          {
98
+            ST7920_WRITE_BYTE(0x80 | (y-32));  //y
99
+            ST7920_WRITE_BYTE(0x80 | 8);       //x=64
100
+          }
101
+
102
+          ST7920_SET_DAT();
103
+          ST7920_WRITE_BYTES(ptr,WIDTH/8); //ptr is incremented inside of macro
104
+          y++;
105
+        }
106
+        ST7920_NCS();
107
+      }
108
+      break;
109
+  }
110
+#if PAGE_HEIGHT == 8
111
+  return u8g_dev_pb8h1_base_fn(u8g, dev, msg, arg);
112
+#elif PAGE_HEIGHT == 16
113
+  return u8g_dev_pb16h1_base_fn(u8g, dev, msg, arg);
114
+#else
115
+  return u8g_dev_pb32h1_base_fn(u8g, dev, msg, arg);
116
+#endif
117
+}
118
+
119
+uint8_t   u8g_dev_st7920_128x64_rrd_buf[WIDTH*(PAGE_HEIGHT/8)] U8G_NOCOMMON;
120
+u8g_pb_t  u8g_dev_st7920_128x64_rrd_pb = {{PAGE_HEIGHT,HEIGHT,0,0,0},WIDTH,u8g_dev_st7920_128x64_rrd_buf};
121
+u8g_dev_t u8g_dev_st7920_128x64_rrd_sw_spi = {u8g_dev_rrd_st7920_128x64_fn,&u8g_dev_st7920_128x64_rrd_pb,&u8g_com_null_fn};
122
+
123
+class U8GLIB_ST7920_128X64_RRD : public U8GLIB
124
+{
125
+  public:
126
+    U8GLIB_ST7920_128X64_RRD(uint8_t dummy) : U8GLIB(&u8g_dev_st7920_128x64_rrd_sw_spi) {}
127
+};
128
+
129
+
130
+#endif //U8GLIB_ST7920
131
+#endif //ULCDST7920_H

+ 252
- 227
README.md View File

1
-==========================
2
-Marlin 3D Printer Firmware
3
-==========================
4
-
5
-Notes: 
6
------
7
-
8
-The configuration is now split in two files:
9
-  Configuration.h for the normal settings
10
-  Configuration_adv.h for the advanced settings
11
-
12
-Gen7T is not supported.
13
-
14
-Quick Information
15
-===================
16
-This RepRap firmware is a mashup between <a href="https://github.com/kliment/Sprinter">Sprinter</a>, <a href="https://github.com/simen/grbl/tree">grbl</a> and many original parts.
17
-
18
-Derived from Sprinter and Grbl by Erik van der Zalm.
19
-Sprinters lead developers are Kliment and caru.
20
-Grbls lead developer is Simen Svale Skogsrud. Sonney Jeon (Chamnit) improved some parts of grbl
21
-A fork by bkubicek for the Ultimaker was merged, and further development was aided by him.
22
-Some features have been added by:
23
-Lampmaker, Bradley Feldman, and others...
24
-
25
-
26
-Features:
27
-
28
-*   Interrupt based movement with real linear acceleration
29
-*   High steprate
30
-*   Look ahead (Keep the speed high when possible. High cornering speed)
31
-*   Interrupt based temperature protection
32
-*   preliminary support for Matthew Roberts advance algorithm 
33
-    For more info see: http://reprap.org/pipermail/reprap-dev/2011-May/003323.html
34
-*   Full endstop support
35
-*   SD Card support
36
-*   SD Card folders (works in pronterface)
37
-*   SD Card autostart support
38
-*   LCD support (ideally 20x4) 
39
-*   LCD menu system for autonomous SD card printing, controlled by an click-encoder. 
40
-*   EEPROM storage of e.g. max-velocity, max-acceleration, and similar variables
41
-*   many small but handy things originating from bkubicek's fork.
42
-*   Arc support
43
-*   Temperature oversampling
44
-*   Dynamic Temperature setpointing aka "AutoTemp"
45
-*   Support for QTMarlin, a very beta GUI for PID-tuning and velocity-acceleration testing. https://github.com/bkubicek/QTMarlin
46
-*   Endstop trigger reporting to the host software.
47
-*   Updated sdcardlib
48
-*   Heater power reporting. Useful for PID monitoring.
49
-*   PID tuning
50
-*   CoreXY kinematics (www.corexy.com/theory.html)
51
-*   Configurable serial port to support connection of wireless adaptors.
52
-*   Automatic operation of extruder/cold-end cooling fans based on nozzle temperature
53
-
54
-The default baudrate is 250000. This baudrate has less jitter and hence errors than the usual 115200 baud, but is less supported by drivers and host-environments.
55
-
56
-
57
-Differences and additions to the already good Sprinter firmware:
58
-================================================================
59
-
60
-*Look-ahead:*
61
-
62
-Marlin has look-ahead. While sprinter has to break and re-accelerate at each corner, 
63
-lookahead will only decelerate and accelerate to a velocity, 
64
-so that the change in vectorial velocity magnitude is less than the xy_jerk_velocity.
65
-This is only possible, if some future moves are already processed, hence the name. 
66
-It leads to less over-deposition at corners, especially at flat angles.
67
-
68
-*Arc support:*
69
-
70
-Slic3r can find curves that, although broken into segments, were ment to describe an arc.
71
-Marlin is able to print those arcs. The advantage is the firmware can choose the resolution,
72
-and can perform the arc with nearly constant velocity, resulting in a nice finish. 
73
-Also, less serial communication is needed.
74
-
75
-*Temperature Oversampling:*
76
-
77
-To reduce noise and make the PID-differential term more useful, 16 ADC conversion results are averaged.
78
-
79
-*AutoTemp:*
80
-
81
-If your gcode contains a wide spread of extruder velocities, or you realtime change the building speed, the temperature should be changed accordingly.
82
-Usually, higher speed requires higher temperature.
83
-This can now be performed by the AutoTemp function
84
-By calling M109 S<mintemp> T<maxtemp> F<factor> you enter the autotemp mode.
85
-
86
-You can leave it by calling M109 without any F.
87
-If active, the maximal extruder stepper rate of all buffered moves will be calculated, and named "maxerate" [steps/sec].
88
-The wanted temperature then will be set to t=tempmin+factor*maxerate, while being limited between tempmin and tempmax.
89
-If the target temperature is set manually or by gcode to a value less then tempmin, it will be kept without change.
90
-Ideally, your gcode can be completely free of temperature controls, apart from a M109 S T F in the start.gcode, and a M109 S0 in the end.gcode.
91
-
92
-*EEPROM:*
93
-
94
-If you know your PID values, the acceleration and max-velocities of your unique machine, you can set them, and finally store them in the EEPROM.
95
-After each reboot, it will magically load them from EEPROM, independent what your Configuration.h says.
96
-
97
-*LCD Menu:*
98
-
99
-If your hardware supports it, you can build yourself a LCD-CardReader+Click+encoder combination. It will enable you to realtime tune temperatures,
100
-accelerations, velocities, flow rates, select and print files from the SD card, preheat, disable the steppers, and do other fancy stuff.
101
-One working hardware is documented here: http://www.thingiverse.com/thing:12663 
102
-Also, with just a 20x4 or 16x2 display, useful data is shown.
103
-
104
-*SD card folders:*
105
-
106
-If you have an SD card reader attached to your controller, also folders work now. Listing the files in pronterface will show "/path/subpath/file.g".
107
-You can write to file in a subfolder by specifying a similar text using small letters in the path.
108
-Also, backup copies of various operating systems are hidden, as well as files not ending with ".g".
109
-
110
-*SD card folders:*
111
-
112
-If you place a file auto[0-9].g into the root of the sd card, it will be automatically executed if you boot the printer. The same file will be executed by selecting "Autostart" from the menu.
113
-First *0 will be performed, than *1 and so on. That way, you can heat up or even print automatically without user interaction.
114
-
115
-*Endstop trigger reporting:*
116
-
117
-If an endstop is hit while moving towards the endstop, the location at which the firmware thinks that the endstop was triggered is outputed on the serial port.
118
-This is useful, because the user gets a warning message.
119
-However, also tools like QTMarlin can use this for finding acceptable combinations of velocity+acceleration.
120
-
121
-*Coding paradigm:*
122
-
123
-Not relevant from a user side, but Marlin was split into thematic junks, and has tried to partially enforced private variables.
124
-This is intended to make it clearer, what interacts which what, and leads to a higher level of modularization.
125
-We think that this is a useful prestep for porting this firmware to e.g. an ARM platform in the future.
126
-A lot of RAM (with enabled LCD ~2200 bytes) was saved by storing char []="some message" in Program memory.
127
-In the serial communication, a #define based level of abstraction was enforced, so that it is clear that
128
-some transfer is information (usually beginning with "echo:"), an error "error:", or just normal protocol,
129
-necessary for backwards compatibility.
130
-
131
-*Interrupt based temperature measurements:*
132
-
133
-An interrupt is used to manage ADC conversions, and enforce checking for critical temperatures.
134
-This leads to less blocking in the heater management routine.
135
-
136
-
137
-Non-standard M-Codes, different to an old version of sprinter:
138
-==============================================================
139
-Movement:
140
-
141
-*   G2  - CW ARC
142
-*   G3  - CCW ARC
143
-
144
-General:
145
-
146
-*   M17  - Enable/Power all stepper motors. Compatibility to ReplicatorG.
147
-*   M18  - Disable all stepper motors; same as M84.Compatibility to ReplicatorG.
148
-*   M30  - Print time since last M109 or SD card start to serial
149
-*   M42  - Change pin status via gcode
150
-*   M80  - Turn on Power Supply
151
-*   M81  - Turn off Power Supply
152
-*   M114 - Output current position to serial port 
153
-*   M119 - Output Endstop status to serial port
154
-
155
-Movement variables:
156
-
157
-*   M202 - Set max acceleration in units/s^2 for travel moves (M202 X1000 Y1000) Unused in Marlin!!
158
-*   M203 - Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in mm/sec
159
-*   M204 - Set default acceleration: S normal moves T filament only moves (M204 S3000 T7000) im mm/sec^2  also sets minimum segment time in ms (B20000) to prevent buffer underruns and M20 minimum feedrate
160
-*   M206 - set home offsets.  This sets the X,Y,Z coordinates of the endstops (and is added to the {X,Y,Z}_HOME_POS configuration options (and is also added to the coordinates, if any, provided to G82, as with earlier firmware)
161
-*   M220 - set build speed mulitplying S:factor in percent ; aka "realtime tuneing in the gcode". So you can slow down if you have islands in one height-range, and speed up otherwise.
162
-*   M221 - set the extrude multiplying S:factor in percent
163
-*   M400 - Finish all buffered moves.
164
-
165
-Temperature variables:
166
-*   M301 - Set PID parameters P I and D
167
-*   M302 - Allow cold extrudes
168
-*   M303 - PID relay autotune S<temperature> sets the target temperature. (default target temperature = 150C)
169
-
170
-Advance:
171
-
172
-*   M200 - Set filament diameter for advance
173
-*   M205 - advanced settings:  minimum travel speed S=while printing T=travel only,  B=minimum segment time X= maximum xy jerk, Z=maximum Z jerk
174
-
175
-EEPROM:
176
-
177
-*   M500 - stores paramters in EEPROM. This parameters are stored:  axis_steps_per_unit,  max_feedrate, max_acceleration  ,acceleration,retract_acceleration,
178
-  minimumfeedrate,mintravelfeedrate,minsegmenttime,  jerk velocities, PID
179
-*   M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).  
180
-*   M502 - reverts to the default "factory settings".  You still need to store them in EEPROM afterwards if you want to.
181
-*   M503 - print the current settings (from memory not from eeprom)
182
-
183
-MISC:
184
-
185
-*   M240 - Trigger a camera to take a photograph
186
-*   M999 - Restart after being stopped by error
187
-
188
-Configuring and compilation:
189
-============================
190
-
191
-Install the arduino software IDE/toolset v23 (Some configurations also work with 1.x.x)
192
-   http://www.arduino.cc/en/Main/Software
193
-
194
-For gen6/gen7 and sanguinololu the Sanguino directory in the Marlin dir needs to be copied to the arduino environment.
195
-  copy ArduinoAddons\Arduino_x.x.x\sanguino <arduino home>\hardware\Sanguino
196
-
197
-Install Ultimaker's RepG 25 build
198
-    http://software.ultimaker.com
199
-For SD handling and as better substitute (apart from stl manipulation) download
200
-the very nice Kliment's printrun/pronterface  https://github.com/kliment/Printrun
201
-
202
-Copy the Ultimaker Marlin firmware
203
-   https://github.com/ErikZalm/Marlin/tree/Marlin_v1
204
-   (Use the download button)
205
-
206
-Start the arduino IDE.
207
-Select Tools -> Board -> Arduino Mega 2560    or your microcontroller
208
-Select the correct serial port in Tools ->Serial Port
209
-Open Marlin.pde
210
-
211
-Click the Verify/Compile button
212
-
213
-Click the Upload button
214
-If all goes well the firmware is uploading
215
-
216
-Start Ultimaker's Custom RepG 25
217
-Make sure Show Experimental Profiles is enabled in Preferences
218
-Select Sprinter as the Driver
219
-
220
-Press the Connect button.
221
-
222
-KNOWN ISSUES: RepG will display:  Unknown: marlin x.y.z
223
-
224
-That's ok.  Enjoy Silky Smooth Printing.
225
-
226
-
227
-
1
+==========================
2
+Marlin 3D Printer Firmware
3
+==========================
4
+
5
+[![Flattr this git repo](http://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=ErikZalm&url=https://github.com/ErikZalm/Marlin&title=Marlin&language=&tags=github&category=software)
6
+
7
+Quick Information
8
+===================
9
+This RepRap firmware is a mashup between <a href="https://github.com/kliment/Sprinter">Sprinter</a>, <a href="https://github.com/simen/grbl/tree">grbl</a> and many original parts.
10
+
11
+Derived from Sprinter and Grbl by Erik van der Zalm.
12
+Sprinters lead developers are Kliment and caru.
13
+Grbls lead developer is Simen Svale Skogsrud. Sonney Jeon (Chamnit) improved some parts of grbl
14
+A fork by bkubicek for the Ultimaker was merged, and further development was aided by him.
15
+Some features have been added by:
16
+Lampmaker, Bradley Feldman, and others...
17
+
18
+
19
+Features:
20
+
21
+*   Interrupt based movement with real linear acceleration
22
+*   High steprate
23
+*   Look ahead (Keep the speed high when possible. High cornering speed)
24
+*   Interrupt based temperature protection
25
+*   preliminary support for Matthew Roberts advance algorithm
26
+    For more info see: http://reprap.org/pipermail/reprap-dev/2011-May/003323.html
27
+*   Full endstop support
28
+*   SD Card support
29
+*   SD Card folders (works in pronterface)
30
+*   SD Card autostart support
31
+*   LCD support (ideally 20x4)
32
+*   LCD menu system for autonomous SD card printing, controlled by an click-encoder.
33
+*   EEPROM storage of e.g. max-velocity, max-acceleration, and similar variables
34
+*   many small but handy things originating from bkubicek's fork.
35
+*   Arc support
36
+*   Temperature oversampling
37
+*   Dynamic Temperature setpointing aka "AutoTemp"
38
+*   Support for QTMarlin, a very beta GUI for PID-tuning and velocity-acceleration testing. https://github.com/bkubicek/QTMarlin
39
+*   Endstop trigger reporting to the host software.
40
+*   Updated sdcardlib
41
+*   Heater power reporting. Useful for PID monitoring.
42
+*   PID tuning
43
+*   CoreXY kinematics (www.corexy.com/theory.html)
44
+*   Delta kinematics
45
+*   Dual X-carriage support for multiple extruder systems
46
+*   Configurable serial port to support connection of wireless adaptors.
47
+*   Automatic operation of extruder/cold-end cooling fans based on nozzle temperature
48
+*   RC Servo Support, specify angle or duration for continuous rotation servos.
49
+
50
+The default baudrate is 250000. This baudrate has less jitter and hence errors than the usual 115200 baud, but is less supported by drivers and host-environments.
51
+
52
+
53
+Differences and additions to the already good Sprinter firmware:
54
+================================================================
55
+
56
+*Look-ahead:*
57
+
58
+Marlin has look-ahead. While sprinter has to break and re-accelerate at each corner,
59
+lookahead will only decelerate and accelerate to a velocity,
60
+so that the change in vectorial velocity magnitude is less than the xy_jerk_velocity.
61
+This is only possible, if some future moves are already processed, hence the name.
62
+It leads to less over-deposition at corners, especially at flat angles.
63
+
64
+*Arc support:*
65
+
66
+Slic3r can find curves that, although broken into segments, were ment to describe an arc.
67
+Marlin is able to print those arcs. The advantage is the firmware can choose the resolution,
68
+and can perform the arc with nearly constant velocity, resulting in a nice finish.
69
+Also, less serial communication is needed.
70
+
71
+*Temperature Oversampling:*
72
+
73
+To reduce noise and make the PID-differential term more useful, 16 ADC conversion results are averaged.
74
+
75
+*AutoTemp:*
76
+
77
+If your gcode contains a wide spread of extruder velocities, or you realtime change the building speed, the temperature should be changed accordingly.
78
+Usually, higher speed requires higher temperature.
79
+This can now be performed by the AutoTemp function
80
+By calling M109 S<mintemp> T<maxtemp> F<factor> you enter the autotemp mode.
81
+
82
+You can leave it by calling M109 without any F.
83
+If active, the maximal extruder stepper rate of all buffered moves will be calculated, and named "maxerate" [steps/sec].
84
+The wanted temperature then will be set to t=tempmin+factor*maxerate, while being limited between tempmin and tempmax.
85
+If the target temperature is set manually or by gcode to a value less then tempmin, it will be kept without change.
86
+Ideally, your gcode can be completely free of temperature controls, apart from a M109 S T F in the start.gcode, and a M109 S0 in the end.gcode.
87
+
88
+*EEPROM:*
89
+
90
+If you know your PID values, the acceleration and max-velocities of your unique machine, you can set them, and finally store them in the EEPROM.
91
+After each reboot, it will magically load them from EEPROM, independent what your Configuration.h says.
92
+
93
+*LCD Menu:*
94
+
95
+If your hardware supports it, you can build yourself a LCD-CardReader+Click+encoder combination. It will enable you to realtime tune temperatures,
96
+accelerations, velocities, flow rates, select and print files from the SD card, preheat, disable the steppers, and do other fancy stuff.
97
+One working hardware is documented here: http://www.thingiverse.com/thing:12663
98
+Also, with just a 20x4 or 16x2 display, useful data is shown.
99
+
100
+*SD card folders:*
101
+
102
+If you have an SD card reader attached to your controller, also folders work now. Listing the files in pronterface will show "/path/subpath/file.g".
103
+You can write to file in a subfolder by specifying a similar text using small letters in the path.
104
+Also, backup copies of various operating systems are hidden, as well as files not ending with ".g".
105
+
106
+*SD card folders:*
107
+
108
+If you place a file auto[0-9].g into the root of the sd card, it will be automatically executed if you boot the printer. The same file will be executed by selecting "Autostart" from the menu.
109
+First *0 will be performed, than *1 and so on. That way, you can heat up or even print automatically without user interaction.
110
+
111
+*Endstop trigger reporting:*
112
+
113
+If an endstop is hit while moving towards the endstop, the location at which the firmware thinks that the endstop was triggered is outputed on the serial port.
114
+This is useful, because the user gets a warning message.
115
+However, also tools like QTMarlin can use this for finding acceptable combinations of velocity+acceleration.
116
+
117
+*Coding paradigm:*
118
+
119
+Not relevant from a user side, but Marlin was split into thematic junks, and has tried to partially enforced private variables.
120
+This is intended to make it clearer, what interacts which what, and leads to a higher level of modularization.
121
+We think that this is a useful prestep for porting this firmware to e.g. an ARM platform in the future.
122
+A lot of RAM (with enabled LCD ~2200 bytes) was saved by storing char []="some message" in Program memory.
123
+In the serial communication, a #define based level of abstraction was enforced, so that it is clear that
124
+some transfer is information (usually beginning with "echo:"), an error "error:", or just normal protocol,
125
+necessary for backwards compatibility.
126
+
127
+*Interrupt based temperature measurements:*
128
+
129
+An interrupt is used to manage ADC conversions, and enforce checking for critical temperatures.
130
+This leads to less blocking in the heater management routine.
131
+
132
+Implemented G Codes:
133
+====================
134
+
135
+*  G0  -> G1
136
+*  G1  - Coordinated Movement X Y Z E
137
+*  G2  - CW ARC
138
+*  G3  - CCW ARC
139
+*  G4  - Dwell S<seconds> or P<milliseconds>
140
+*  G10 - retract filament according to settings of M207
141
+*  G11 - retract recover filament according to settings of M208
142
+*  G28 - Home all Axis
143
+*  G90 - Use Absolute Coordinates
144
+*  G91 - Use Relative Coordinates
145
+*  G92 - Set current position to cordinates given
146
+
147
+M Codes
148
+*  M0   - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled)
149
+*  M1   - Same as M0
150
+*  M17  - Enable/Power all stepper motors
151
+*  M18  - Disable all stepper motors; same as M84
152
+*  M20  - List SD card
153
+*  M21  - Init SD card
154
+*  M22  - Release SD card
155
+*  M23  - Select SD file (M23 filename.g)
156
+*  M24  - Start/resume SD print
157
+*  M25  - Pause SD print
158
+*  M26  - Set SD position in bytes (M26 S12345)
159
+*  M27  - Report SD print status
160
+*  M28  - Start SD write (M28 filename.g)
161
+*  M29  - Stop SD write
162
+*  M30  - Delete file from SD (M30 filename.g)
163
+*  M31  - Output time since last M109 or SD card start to serial
164
+*  M32  - Select file and start SD print (Can be used when printing from SD card)
165
+*  M42  - Change pin status via gcode Use M42 Px Sy to set pin x to value y, when omitting Px the onboard led will be used.
166
+*  M80  - Turn on Power Supply
167
+*  M81  - Turn off Power Supply
168
+*  M82  - Set E codes absolute (default)
169
+*  M83  - Set E codes relative while in Absolute Coordinates (G90) mode
170
+*  M84  - Disable steppers until next move, or use S<seconds> to specify an inactivity timeout, after which the steppers will be disabled.  S0 to disable the timeout.
171
+*  M85  - Set inactivity shutdown timer with parameter S<seconds>. To disable set zero (default)
172
+*  M92  - Set axis_steps_per_unit - same syntax as G92
173
+*  M104 - Set extruder target temp
174
+*  M105 - Read current temp
175
+*  M106 - Fan on
176
+*  M107 - Fan off
177
+*  M109 - Sxxx Wait for extruder current temp to reach target temp. Waits only when heating
178
+*         Rxxx Wait for extruder current temp to reach target temp. Waits when heating and cooling
179
+*  M114 - Output current position to serial port
180
+*  M115 - Capabilities string
181
+*  M117 - display message
182
+*  M119 - Output Endstop status to serial port
183
+*  M126 - Solenoid Air Valve Open (BariCUDA support by jmil)
184
+*  M127 - Solenoid Air Valve Closed (BariCUDA vent to atmospheric pressure by jmil)
185
+*  M128 - EtoP Open (BariCUDA EtoP = electricity to air pressure transducer by jmil)
186
+*  M129 - EtoP Closed (BariCUDA EtoP = electricity to air pressure transducer by jmil)
187
+*  M140 - Set bed target temp
188
+*  M190 - Sxxx Wait for bed current temp to reach target temp. Waits only when heating
189
+*         Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling
190
+*  M200 - Set filament diameter
191
+*  M201 - Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000)
192
+*  M202 - Set max acceleration in units/s^2 for travel moves (M202 X1000 Y1000) Unused in Marlin!!
193
+*  M203 - Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in mm/sec
194
+*  M204 - Set default acceleration: S normal moves T filament only moves (M204 S3000 T7000) im mm/sec^2  also sets minimum segment time in ms (B20000) to prevent buffer underruns and M20 minimum feedrate
195
+*  M205 -  advanced settings:  minimum travel speed S=while printing T=travel only,  B=minimum segment time X= maximum xy jerk, Z=maximum Z jerk, E=maximum E jerk
196
+*  M206 - set additional homeing offset
197
+*  M207 - set retract length S[positive mm] F[feedrate mm/sec] Z[additional zlift/hop]
198
+*  M208 - set recover=unretract length S[positive mm surplus to the M207 S*] F[feedrate mm/sec]
199
+*  M209 - S<1=true/0=false> enable automatic retract detect if the slicer did not support G10/11: every normal extrude-only move will be classified as retract depending on the direction.
200
+*  M218 - set hotend offset (in mm): T<extruder_number> X<offset_on_X> Y<offset_on_Y>
201
+*  M220 S<factor in percent>- set speed factor override percentage
202
+*  M221 S<factor in percent>- set extrude factor override percentage
203
+*  M240 - Trigger a camera to take a photograph
204
+*  M280 - Position an RC Servo P<index> S<angle/microseconds>, ommit S to report back current angle
205
+*  M300 - Play beepsound S<frequency Hz> P<duration ms>
206
+*  M301 - Set PID parameters P I and D
207
+*  M302 - Allow cold extrudes
208
+*  M303 - PID relay autotune S<temperature> sets the target temperature. (default target temperature = 150C)
209
+*  M304 - Set bed PID parameters P I and D
210
+*  M400 - Finish all moves
211
+*  M500 - stores paramters in EEPROM
212
+*  M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
213
+*  M502 - reverts to the default "factory settings".  You still need to store them in EEPROM afterwards if you want to.
214
+*  M503 - print the current settings (from memory not from eeprom)
215
+*  M540 - Use S[0|1] to enable or disable the stop SD card print on endstop hit (requires ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
216
+*  M600 - Pause for filament change X[pos] Y[pos] Z[relative lift] E[initial retract] L[later retract distance for removal]
217
+*  M907 - Set digital trimpot motor current using axis codes.
218
+*  M908 - Control digital trimpot directly.
219
+*  M350 - Set microstepping mode.
220
+*  M351 - Toggle MS1 MS2 pins directly.
221
+*  M928 - Start SD logging (M928 filename.g) - ended by M29
222
+*  M999 - Restart after being stopped by error
223
+
224
+
225
+Configuring and compilation:
226
+============================
227
+
228
+Install the arduino software IDE/toolset v23 (Some configurations also work with 1.x.x)
229
+   http://www.arduino.cc/en/Main/Software
230
+
231
+For gen6/gen7 and sanguinololu the Sanguino directory in the Marlin dir needs to be copied to the arduino environment.
232
+  copy ArduinoAddons\Arduino_x.x.x\sanguino <arduino home>\hardware\Sanguino
233
+
234
+Copy the Marlin firmware
235
+   https://github.com/ErikZalm/Marlin/tree/Marlin_v1
236
+   (Use the download button)
237
+
238
+Start the arduino IDE.
239
+Select Tools -> Board -> Arduino Mega 2560    or your microcontroller
240
+Select the correct serial port in Tools ->Serial Port
241
+Open Marlin.pde
242
+
243
+Click the Verify/Compile button
244
+
245
+Click the Upload button
246
+If all goes well the firmware is uploading
247
+
248
+That's ok.  Enjoy Silky Smooth Printing.
249
+
250
+
251
+
252
+

Loading…
Cancel
Save