Przeglądaj źródła

Merge pull request #748 from wolfmanjm/add/azteegx3pro

Add/azteegx3pro
ErikZalm 11 lat temu
rodzic
commit
8ebcc9dc3a

+ 11
- 10
Marlin/Configuration.h Wyświetl plik

52
 // 65 = Azteeg X1
52
 // 65 = Azteeg X1
53
 // 66 = Melzi with ATmega1284 (MaKr3d version)
53
 // 66 = Melzi with ATmega1284 (MaKr3d version)
54
 // 67 = Azteeg X3
54
 // 67 = Azteeg X3
55
+// 68 = Azteeg X3 Pro
55
 // 7  = Ultimaker
56
 // 7  = Ultimaker
56
 // 71 = Ultimaker (Older electronics. Pre 1.5.4. This is rare)
57
 // 71 = Ultimaker (Older electronics. Pre 1.5.4. This is rare)
57
 // 77 = 3Drag Controller
58
 // 77 = 3Drag Controller
156
 // HEATER_BED_DUTY_CYCLE_DIVIDER intervals.
157
 // HEATER_BED_DUTY_CYCLE_DIVIDER intervals.
157
 //#define HEATER_BED_DUTY_CYCLE_DIVIDER 4
158
 //#define HEATER_BED_DUTY_CYCLE_DIVIDER 4
158
 
159
 
159
-// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS 
160
-//#define EXTRUDER_WATTS (12.0*12.0/6.7) //  P=I^2/R 
160
+// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS
161
+//#define EXTRUDER_WATTS (12.0*12.0/6.7) //  P=I^2/R
161
 //#define BED_WATTS (12.0*12.0/1.1)      // P=I^2/R
162
 //#define BED_WATTS (12.0*12.0/1.1)      // P=I^2/R
162
 
163
 
163
 // PID settings:
164
 // PID settings:
374
   // with accurate bed leveling, the bed is sampled in a ACCURATE_BED_LEVELING_POINTSxACCURATE_BED_LEVELING_POINTS grid and least squares solution is calculated
375
   // with accurate bed leveling, the bed is sampled in a ACCURATE_BED_LEVELING_POINTSxACCURATE_BED_LEVELING_POINTS grid and least squares solution is calculated
375
   // Note: this feature occupies 10'206 byte
376
   // Note: this feature occupies 10'206 byte
376
   #define ACCURATE_BED_LEVELING
377
   #define ACCURATE_BED_LEVELING
377
-  
378
+
378
   #ifdef ACCURATE_BED_LEVELING
379
   #ifdef ACCURATE_BED_LEVELING
379
      // I wouldn't see a reason to go above 3 (=9 probing points on the bed)
380
      // I wouldn't see a reason to go above 3 (=9 probing points on the bed)
380
     #define ACCURATE_BED_LEVELING_POINTS 2
381
     #define ACCURATE_BED_LEVELING_POINTS 2
381
   #endif
382
   #endif
382
-  
383
+
383
 #endif
384
 #endif
384
 
385
 
385
 
386
 
538
   #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD
539
   #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD
539
   #define NEWPANEL
540
   #define NEWPANEL
540
   #define ULTIPANEL
541
   #define ULTIPANEL
541
-  
542
+
542
   #ifndef ENCODER_PULSES_PER_STEP
543
   #ifndef ENCODER_PULSES_PER_STEP
543
 	#define ENCODER_PULSES_PER_STEP 4
544
 	#define ENCODER_PULSES_PER_STEP 4
544
-  #endif 
545
+  #endif
545
 
546
 
546
   #ifndef ENCODER_STEPS_PER_MENU_ITEM
547
   #ifndef ENCODER_STEPS_PER_MENU_ITEM
547
 	#define ENCODER_STEPS_PER_MENU_ITEM 1
548
 	#define ENCODER_STEPS_PER_MENU_ITEM 1
548
-  #endif 
549
-  
550
-  
549
+  #endif
550
+
551
+
551
   #ifdef LCD_USE_I2C_BUZZER
552
   #ifdef LCD_USE_I2C_BUZZER
552
 	#define LCD_FEEDBACK_FREQUENCY_HZ 1000
553
 	#define LCD_FEEDBACK_FREQUENCY_HZ 1000
553
 	#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100
554
 	#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100
554
   #endif
555
   #endif
555
-  
556
+
556
 #endif
557
 #endif
557
 
558
 
558
 // Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
559
 // Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs

+ 40
- 34
Marlin/Configuration_adv.h Wyświetl plik

12
 
12
 
13
 //// Heating sanity check:
13
 //// Heating sanity check:
14
 // This waits for the watchperiod in milliseconds whenever an M104 or M109 increases the target temperature
14
 // This waits for the watchperiod in milliseconds whenever an M104 or M109 increases the target temperature
15
-// If the temperature has not increased at the end of that period, the target temperature is set to zero. 
15
+// If the temperature has not increased at the end of that period, the target temperature is set to zero.
16
 // It can be reset with another M104/M109. This check is also only triggered if the target temperature and the current temperature
16
 // It can be reset with another M104/M109. This check is also only triggered if the target temperature and the current temperature
17
 //  differ by at least 2x WATCH_TEMP_INCREASE
17
 //  differ by at least 2x WATCH_TEMP_INCREASE
18
 //#define WATCH_TEMP_PERIOD 40000 //40 seconds
18
 //#define WATCH_TEMP_PERIOD 40000 //40 seconds
21
 #ifdef PIDTEMP
21
 #ifdef PIDTEMP
22
   // 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.
23
   // 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.
24
-  #define PID_ADD_EXTRUSION_RATE  
24
+  #define PID_ADD_EXTRUSION_RATE
25
   #ifdef PID_ADD_EXTRUSION_RATE
25
   #ifdef PID_ADD_EXTRUSION_RATE
26
     #define  DEFAULT_Kc (1) //heatingpower=Kc*(e_speed)
26
     #define  DEFAULT_Kc (1) //heatingpower=Kc*(e_speed)
27
   #endif
27
   #endif
44
 //The M105 command return, besides traditional information, the ADC value read from temperature sensors.
44
 //The M105 command return, besides traditional information, the ADC value read from temperature sensors.
45
 //#define SHOW_TEMP_ADC_VALUES
45
 //#define SHOW_TEMP_ADC_VALUES
46
 
46
 
47
-//  extruder run-out prevention. 
47
+//  extruder run-out prevention.
48
 //if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded
48
 //if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded
49
-//#define EXTRUDER_RUNOUT_PREVENT  
50
-#define EXTRUDER_RUNOUT_MINTEMP 190  
49
+//#define EXTRUDER_RUNOUT_PREVENT
50
+#define EXTRUDER_RUNOUT_MINTEMP 190
51
 #define EXTRUDER_RUNOUT_SECONDS 30.
51
 #define EXTRUDER_RUNOUT_SECONDS 30.
52
 #define EXTRUDER_RUNOUT_ESTEPS 14. //mm filament
52
 #define EXTRUDER_RUNOUT_ESTEPS 14. //mm filament
53
 #define EXTRUDER_RUNOUT_SPEED 1500.  //extrusion speed
53
 #define EXTRUDER_RUNOUT_SPEED 1500.  //extrusion speed
73
 // Extruder cooling fans
73
 // Extruder cooling fans
74
 // Configure fan pin outputs to automatically turn on/off when the associated
74
 // Configure fan pin outputs to automatically turn on/off when the associated
75
 // extruder temperature is above/below EXTRUDER_AUTO_FAN_TEMPERATURE.
75
 // extruder temperature is above/below EXTRUDER_AUTO_FAN_TEMPERATURE.
76
-// Multiple extruders can be assigned to the same pin in which case 
76
+// Multiple extruders can be assigned to the same pin in which case
77
 // the fan will turn on when any selected extruder is above the threshold.
77
 // the fan will turn on when any selected extruder is above the threshold.
78
 #define EXTRUDER_0_AUTO_FAN_PIN   -1
78
 #define EXTRUDER_0_AUTO_FAN_PIN   -1
79
 #define EXTRUDER_1_AUTO_FAN_PIN   -1
79
 #define EXTRUDER_1_AUTO_FAN_PIN   -1
103
     #else
103
     #else
104
       #define X_HOME_POS X_MIN_POS
104
       #define X_HOME_POS X_MIN_POS
105
     #endif //BED_CENTER_AT_0_0
105
     #endif //BED_CENTER_AT_0_0
106
-  #else    
106
+  #else
107
     #ifdef BED_CENTER_AT_0_0
107
     #ifdef BED_CENTER_AT_0_0
108
       #define X_HOME_POS X_MAX_LENGTH * 0.5
108
       #define X_HOME_POS X_MAX_LENGTH * 0.5
109
     #else
109
     #else
110
       #define X_HOME_POS X_MAX_POS
110
       #define X_HOME_POS X_MAX_POS
111
     #endif //BED_CENTER_AT_0_0
111
     #endif //BED_CENTER_AT_0_0
112
   #endif //X_HOME_DIR == -1
112
   #endif //X_HOME_DIR == -1
113
-  
113
+
114
   //Y axis
114
   //Y axis
115
   #if Y_HOME_DIR == -1
115
   #if Y_HOME_DIR == -1
116
     #ifdef BED_CENTER_AT_0_0
116
     #ifdef BED_CENTER_AT_0_0
118
     #else
118
     #else
119
       #define Y_HOME_POS Y_MIN_POS
119
       #define Y_HOME_POS Y_MIN_POS
120
     #endif //BED_CENTER_AT_0_0
120
     #endif //BED_CENTER_AT_0_0
121
-  #else    
121
+  #else
122
     #ifdef BED_CENTER_AT_0_0
122
     #ifdef BED_CENTER_AT_0_0
123
       #define Y_HOME_POS Y_MAX_LENGTH * 0.5
123
       #define Y_HOME_POS Y_MAX_LENGTH * 0.5
124
     #else
124
     #else
125
       #define Y_HOME_POS Y_MAX_POS
125
       #define Y_HOME_POS Y_MAX_POS
126
     #endif //BED_CENTER_AT_0_0
126
     #endif //BED_CENTER_AT_0_0
127
   #endif //Y_HOME_DIR == -1
127
   #endif //Y_HOME_DIR == -1
128
-  
128
+
129
   // Z axis
129
   // Z axis
130
   #if Z_HOME_DIR == -1 //BED_CENTER_AT_0_0 not used
130
   #if Z_HOME_DIR == -1 //BED_CENTER_AT_0_0 not used
131
     #define Z_HOME_POS Z_MIN_POS
131
     #define Z_HOME_POS Z_MIN_POS
132
-  #else    
132
+  #else
133
     #define Z_HOME_POS Z_MAX_POS
133
     #define Z_HOME_POS Z_MAX_POS
134
   #endif //Z_HOME_DIR == -1
134
   #endif //Z_HOME_DIR == -1
135
 #endif //End auto min/max positions
135
 #endif //End auto min/max positions
165
   #error "You cannot have dual drivers for both Y and Z"
165
   #error "You cannot have dual drivers for both Y and Z"
166
 #endif
166
 #endif
167
 
167
 
168
-// Enable this for dual x-carriage printers. 
168
+// Enable this for dual x-carriage printers.
169
 // A dual x-carriage design has the advantage that the inactive extruder can be parked which
169
 // A dual x-carriage design has the advantage that the inactive extruder can be parked which
170
 // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
170
 // prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
171
 // allowing faster printing speeds.
171
 // allowing faster printing speeds.
175
 // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop;
175
 // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop;
176
 // the second x-carriage always homes to the maximum endstop.
176
 // the second x-carriage always homes to the maximum endstop.
177
 #define X2_MIN_POS 80     // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage
177
 #define X2_MIN_POS 80     // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage
178
-#define X2_MAX_POS 353    // set maximum to the distance between toolheads when both heads are homed 
178
+#define X2_MAX_POS 353    // set maximum to the distance between toolheads when both heads are homed
179
 #define X2_HOME_DIR 1     // the second X-carriage always homes to the maximum endstop position
179
 #define X2_HOME_DIR 1     // the second X-carriage always homes to the maximum endstop position
180
-#define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position 
181
-    // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software 
180
+#define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position
181
+    // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software
182
     // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops
182
     // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops
183
     // without modifying the firmware (through the "M218 T1 X???" command).
183
     // without modifying the firmware (through the "M218 T1 X???" command).
184
     // Remember: you should set the second extruder x-offset to 0 in your slicer.
184
     // Remember: you should set the second extruder x-offset to 0 in your slicer.
193
 //                           as long as it supports dual x-carriages. (M605 S0)
193
 //                           as long as it supports dual x-carriages. (M605 S0)
194
 //    Mode 1: Auto-park mode. The firmware will automatically park and unpark the x-carriages on tool changes so
194
 //    Mode 1: Auto-park mode. The firmware will automatically park and unpark the x-carriages on tool changes so
195
 //                           that additional slicer support is not required. (M605 S1)
195
 //                           that additional slicer support is not required. (M605 S1)
196
-//    Mode 2: Duplication mode. The firmware will transparently make the second x-carriage and extruder copy all  
196
+//    Mode 2: Duplication mode. The firmware will transparently make the second x-carriage and extruder copy all
197
 //                           actions of the first x-carriage. This allows the printer to print 2 arbitrary items at
197
 //                           actions of the first x-carriage. This allows the printer to print 2 arbitrary items at
198
 //                           once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm])
198
 //                           once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm])
199
 
199
 
200
-// This is the default power-up mode which can be later using M605. 
201
-#define DEFAULT_DUAL_X_CARRIAGE_MODE 0 
200
+// This is the default power-up mode which can be later using M605.
201
+#define DEFAULT_DUAL_X_CARRIAGE_MODE 0
202
 
202
 
203
 // As the x-carriages are independent we can now account for any relative Z offset
203
 // As the x-carriages are independent we can now account for any relative Z offset
204
 #define EXTRUDER1_Z_OFFSET 0.0           // z offset relative to extruder 0
204
 #define EXTRUDER1_Z_OFFSET 0.0           // z offset relative to extruder 0
205
 
205
 
206
-// Default settings in "Auto-park Mode" 
206
+// Default settings in "Auto-park Mode"
207
 #define TOOLCHANGE_PARK_ZLIFT   0.2      // the distance to raise Z axis when parking an extruder
207
 #define TOOLCHANGE_PARK_ZLIFT   0.2      // the distance to raise Z axis when parking an extruder
208
 #define TOOLCHANGE_UNPARK_ZLIFT 1        // the distance to raise Z axis when unparking an extruder
208
 #define TOOLCHANGE_UNPARK_ZLIFT 1        // the distance to raise Z axis when unparking an extruder
209
 
209
 
211
 #define DEFAULT_DUPLICATION_X_OFFSET 100
211
 #define DEFAULT_DUPLICATION_X_OFFSET 100
212
 
212
 
213
 #endif //DUAL_X_CARRIAGE
213
 #endif //DUAL_X_CARRIAGE
214
-    
214
+
215
 //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
215
 //homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
216
-#define X_HOME_RETRACT_MM 5 
217
-#define Y_HOME_RETRACT_MM 5 
218
-#define Z_HOME_RETRACT_MM 1 
216
+#define X_HOME_RETRACT_MM 5
217
+#define Y_HOME_RETRACT_MM 5
218
+#define Z_HOME_RETRACT_MM 1
219
 //#define QUICK_HOME  //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
219
 //#define QUICK_HOME  //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
220
 
220
 
221
 #define AXIS_RELATIVE_MODES {false, false, false, false}
221
 #define AXIS_RELATIVE_MODES {false, false, false, false}
268
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
268
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
269
 #define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
269
 #define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
270
 
270
 
271
+// uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
272
+//#define DIGIPOT_I2C
273
+// Number of channels available for I2C digipot, For Azteeg X3 Pro we have 8
274
+#define DIGIPOT_I2C_NUM_CHANNELS 8
275
+// actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS
276
+#define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}
271
 
277
 
272
 //===========================================================================
278
 //===========================================================================
273
 //=============================Additional Features===========================
279
 //=============================Additional Features===========================
276
 #define SD_FINISHED_STEPPERRELEASE true  //if sd support and the file is finished: disable steppers?
282
 #define SD_FINISHED_STEPPERRELEASE true  //if sd support and the file is finished: disable steppers?
277
 #define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place.
283
 #define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place.
278
 
284
 
279
-#define SDCARD_RATHERRECENTFIRST  //reverse file order of sd card menu display. Its sorted practically after the filesystem block order. 
285
+#define SDCARD_RATHERRECENTFIRST  //reverse file order of sd card menu display. Its sorted practically after the filesystem block order.
280
 // if a file is deleted, it frees a block. hence, the order is not purely cronological. To still have auto0.g accessible, there is again the option to do that.
286
 // if a file is deleted, it frees a block. hence, the order is not purely cronological. To still have auto0.g accessible, there is again the option to do that.
281
 // using:
287
 // using:
282
 //#define MENU_ADDAUTOSTART
288
 //#define MENU_ADDAUTOSTART
302
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
308
   #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
303
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
309
   #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
304
   #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements
310
   #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements
305
-  
311
+
306
   #ifdef COREXY
312
   #ifdef COREXY
307
     #error BABYSTEPPING not implemented for COREXY yet.
313
     #error BABYSTEPPING not implemented for COREXY yet.
308
   #endif
314
   #endif
340
 const unsigned int dropsegments=5; //everything with less than this number of steps will be ignored as move and joined with the next movement
346
 const unsigned int dropsegments=5; //everything with less than this number of steps will be ignored as move and joined with the next movement
341
 
347
 
342
 // If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted
348
 // If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted
343
-// You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT 
349
+// You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT
344
 // in the pins.h file.  When using a push button pulling the pin to ground this will need inverted.  This setting should
350
 // in the pins.h file.  When using a push button pulling the pin to ground this will need inverted.  This setting should
345
 // be commented out otherwise
351
 // be commented out otherwise
346
-#define SDCARDDETECTINVERTED 
352
+#define SDCARDDETECTINVERTED
347
 
353
 
348
 #ifdef ULTIPANEL
354
 #ifdef ULTIPANEL
349
  #undef SDCARDDETECTINVERTED
355
  #undef SDCARDDETECTINVERTED
355
   #define POWER_SUPPLY 1
361
   #define POWER_SUPPLY 1
356
 #endif
362
 #endif
357
 // 1 = ATX
363
 // 1 = ATX
358
-#if (POWER_SUPPLY == 1) 
364
+#if (POWER_SUPPLY == 1)
359
   #define PS_ON_AWAKE  LOW
365
   #define PS_ON_AWAKE  LOW
360
   #define PS_ON_ASLEEP HIGH
366
   #define PS_ON_ASLEEP HIGH
361
 #endif
367
 #endif
362
 // 2 = X-Box 360 203W
368
 // 2 = X-Box 360 203W
363
-#if (POWER_SUPPLY == 2) 
369
+#if (POWER_SUPPLY == 2)
364
   #define PS_ON_AWAKE  HIGH
370
   #define PS_ON_AWAKE  HIGH
365
   #define PS_ON_ASLEEP LOW
371
   #define PS_ON_ASLEEP LOW
366
 #endif
372
 #endif
372
 //=============================Buffers           ============================
378
 //=============================Buffers           ============================
373
 //===========================================================================
379
 //===========================================================================
374
 
380
 
375
-// The number of linear motions that can be in the plan at any give time.  
381
+// The number of linear motions that can be in the plan at any give time.
376
 // THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ringbuffering.
382
 // THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ringbuffering.
377
 #if defined SDSUPPORT
383
 #if defined SDSUPPORT
378
   #define BLOCK_BUFFER_SIZE 16   // SD,LCD,Buttons take more memory, block buffer needs to be smaller
384
   #define BLOCK_BUFFER_SIZE 16   // SD,LCD,Buttons take more memory, block buffer needs to be smaller
387
 
393
 
388
 
394
 
389
 // Firmware based and LCD controled retract
395
 // Firmware based and LCD controled retract
390
-// M207 and M208 can be used to define parameters for the retraction. 
396
+// M207 and M208 can be used to define parameters for the retraction.
391
 // The retraction can be called by the slicer using G10 and G11
397
 // The retraction can be called by the slicer using G10 and G11
392
-// until then, intended retractions can be detected by moves that only extrude and the direction. 
398
+// until then, intended retractions can be detected by moves that only extrude and the direction.
393
 // the moves are than replaced by the firmware controlled ones.
399
 // the moves are than replaced by the firmware controlled ones.
394
 
400
 
395
 // #define FWRETRACT  //ONLY PARTIALLY TESTED
401
 // #define FWRETRACT  //ONLY PARTIALLY TESTED
411
 #ifdef FILAMENTCHANGEENABLE
417
 #ifdef FILAMENTCHANGEENABLE
412
   #ifdef EXTRUDER_RUNOUT_PREVENT
418
   #ifdef EXTRUDER_RUNOUT_PREVENT
413
     #error EXTRUDER_RUNOUT_PREVENT currently incompatible with FILAMENTCHANGE
419
     #error EXTRUDER_RUNOUT_PREVENT currently incompatible with FILAMENTCHANGE
414
-  #endif 
420
+  #endif
415
 #endif
421
 #endif
416
- 
422
+
417
 //===========================================================================
423
 //===========================================================================
418
 //=============================  Define Defines  ============================
424
 //=============================  Define Defines  ============================
419
 //===========================================================================
425
 //===========================================================================

+ 26
- 2
Marlin/Makefile Wyświetl plik

55
 BUILD_DIR          ?= applet
55
 BUILD_DIR          ?= applet
56
 
56
 
57
 # This defines whether Liquid_TWI2 support will be built
57
 # This defines whether Liquid_TWI2 support will be built
58
-LIQUID_TWI2 ?= 0
58
+LIQUID_TWI2        ?= 0
59
+
60
+# this defines if Wire is needed
61
+WIRE               ?= 0
59
 
62
 
60
 ############################################################################
63
 ############################################################################
61
 # Below here nothing should be changed...
64
 # Below here nothing should be changed...
174
 HARDWARE_VARIANT ?= arduino
177
 HARDWARE_VARIANT ?= arduino
175
 MCU              ?= atmega2560
178
 MCU              ?= atmega2560
176
 
179
 
180
+# Azteeg
181
+else ifeq  ($(HARDWARE_MOTHERBOARD),67)
182
+HARDWARE_VARIANT ?= arduino
183
+MCU              ?= atmega2560
184
+else ifeq  ($(HARDWARE_MOTHERBOARD),68)
185
+HARDWARE_VARIANT ?= arduino
186
+MCU              ?= atmega2560
187
+
177
 endif
188
 endif
178
 
189
 
179
 # Be sure to regenerate speed_lookuptable.h with create_speed_lookuptable.py
190
 # Be sure to regenerate speed_lookuptable.h with create_speed_lookuptable.py
213
 VPATH += $(ARDUINO_INSTALL_DIR)/libraries/Wire/utility
224
 VPATH += $(ARDUINO_INSTALL_DIR)/libraries/Wire/utility
214
 VPATH += $(ARDUINO_INSTALL_DIR)/libraries/LiquidTWI2
225
 VPATH += $(ARDUINO_INSTALL_DIR)/libraries/LiquidTWI2
215
 endif
226
 endif
227
+ifeq ($(WIRE), 1)
228
+VPATH += $(ARDUINO_INSTALL_DIR)/libraries/Wire
229
+VPATH += $(ARDUINO_INSTALL_DIR)/libraries/Wire/utility
230
+endif
216
 else
231
 else
217
 VPATH += $(HARDWARE_DIR)/libraries/LiquidCrystal
232
 VPATH += $(HARDWARE_DIR)/libraries/LiquidCrystal
218
 VPATH += $(HARDWARE_DIR)/libraries/SPI
233
 VPATH += $(HARDWARE_DIR)/libraries/SPI
221
 VPATH += $(HARDWARE_DIR)/libraries/Wire/utility
236
 VPATH += $(HARDWARE_DIR)/libraries/Wire/utility
222
 VPATH += $(HARDWARE_DIR)/libraries/LiquidTWI2
237
 VPATH += $(HARDWARE_DIR)/libraries/LiquidTWI2
223
 endif
238
 endif
239
+ifeq ($(WIRE, 1)
240
+VPATH += $(HARDWARE_DIR)/libraries/Wire
241
+VPATH += $(HARDWARE_DIR)/libraries/Wire/utility
242
+endif
224
 endif
243
 endif
225
 ifeq ($(HARDWARE_VARIANT), arduino)
244
 ifeq ($(HARDWARE_VARIANT), arduino)
226
 HARDWARE_SUB_VARIANT ?= mega
245
 HARDWARE_SUB_VARIANT ?= mega
241
 	MarlinSerial.cpp Sd2Card.cpp SdBaseFile.cpp SdFatUtil.cpp	\
260
 	MarlinSerial.cpp Sd2Card.cpp SdBaseFile.cpp SdFatUtil.cpp	\
242
 	SdFile.cpp SdVolume.cpp motion_control.cpp planner.cpp		\
261
 	SdFile.cpp SdVolume.cpp motion_control.cpp planner.cpp		\
243
 	stepper.cpp temperature.cpp cardreader.cpp ConfigurationStore.cpp \
262
 	stepper.cpp temperature.cpp cardreader.cpp ConfigurationStore.cpp \
244
-	watchdog.cpp SPI.cpp Servo.cpp Tone.cpp ultralcd.cpp
263
+	watchdog.cpp SPI.cpp Servo.cpp Tone.cpp ultralcd.cpp digipot_mcp4451.cpp
245
 ifeq ($(LIQUID_TWI2), 0)
264
 ifeq ($(LIQUID_TWI2), 0)
246
 CXXSRC += LiquidCrystal.cpp
265
 CXXSRC += LiquidCrystal.cpp
247
 else
266
 else
249
 CXXSRC += Wire.cpp LiquidTWI2.cpp
268
 CXXSRC += Wire.cpp LiquidTWI2.cpp
250
 endif
269
 endif
251
 
270
 
271
+ifeq ($(WIRE), 1)
272
+SRC += twi.c
273
+CXXSRC += Wire.cpp
274
+endif
275
+
252
 #Check for Arduino 1.0.0 or higher and use the correct sourcefiles for that version
276
 #Check for Arduino 1.0.0 or higher and use the correct sourcefiles for that version
253
 ifeq ($(shell [ $(ARDUINO_VERSION) -ge 100 ] && echo true), true)
277
 ifeq ($(shell [ $(ARDUINO_VERSION) -ge 100 ] && echo true), true)
254
 CXXSRC += main.cpp
278
 CXXSRC += main.cpp

+ 5
- 0
Marlin/Marlin.h Wyświetl plik

235
 // Handling multiple extruders pins
235
 // Handling multiple extruders pins
236
 extern uint8_t active_extruder;
236
 extern uint8_t active_extruder;
237
 
237
 
238
+#ifdef DIGIPOT_I2C
239
+extern void digipot_i2c_set_current( int channel, float current );
240
+extern void digipot_i2c_init();
241
+#endif
242
+
238
 #endif
243
 #endif

+ 9
- 5
Marlin/Marlin.ino Wyświetl plik

3
 /*
3
 /*
4
     Reprap firmware based on Sprinter and grbl.
4
     Reprap firmware based on Sprinter and grbl.
5
  Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
5
  Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
6
- 
6
+
7
  This program is free software: you can redistribute it and/or modify
7
  This program is free software: you can redistribute it and/or modify
8
  it under the terms of the GNU General Public License as published by
8
  it under the terms of the GNU General Public License as published by
9
  the Free Software Foundation, either version 3 of the License, or
9
  the Free Software Foundation, either version 3 of the License, or
10
  (at your option) any later version.
10
  (at your option) any later version.
11
- 
11
+
12
  This program is distributed in the hope that it will be useful,
12
  This program is distributed in the hope that it will be useful,
13
  but WITHOUT ANY WARRANTY; without even the implied warranty of
13
  but WITHOUT ANY WARRANTY; without even the implied warranty of
14
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
  GNU General Public License for more details.
15
  GNU General Public License for more details.
16
- 
16
+
17
  You should have received a copy of the GNU General Public License
17
  You should have received a copy of the GNU General Public License
18
  along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
  along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
  */
19
  */
22
  This firmware is a mashup between Sprinter and grbl.
22
  This firmware is a mashup between Sprinter and grbl.
23
   (https://github.com/kliment/Sprinter)
23
   (https://github.com/kliment/Sprinter)
24
   (https://github.com/simen/grbl/tree)
24
   (https://github.com/simen/grbl/tree)
25
- 
26
- It has preliminary support for Matthew Roberts advance algorithm 
25
+
26
+ It has preliminary support for Matthew Roberts advance algorithm
27
     http://reprap.org/pipermail/reprap-dev/2011-May/003323.html
27
     http://reprap.org/pipermail/reprap-dev/2011-May/003323.html
28
  */
28
  */
29
 
29
 
50
 #if defined(DIGIPOTSS_PIN) && DIGIPOTSS_PIN > -1
50
 #if defined(DIGIPOTSS_PIN) && DIGIPOTSS_PIN > -1
51
 #include <SPI.h>
51
 #include <SPI.h>
52
 #endif
52
 #endif
53
+
54
+#if defined(DIGIPOT_I2C)
55
+  #include <Wire.h>
56
+#endif

+ 9
- 5
Marlin/Marlin.pde Wyświetl plik

3
 /*
3
 /*
4
     Reprap firmware based on Sprinter and grbl.
4
     Reprap firmware based on Sprinter and grbl.
5
  Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
5
  Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
6
- 
6
+
7
  This program is free software: you can redistribute it and/or modify
7
  This program is free software: you can redistribute it and/or modify
8
  it under the terms of the GNU General Public License as published by
8
  it under the terms of the GNU General Public License as published by
9
  the Free Software Foundation, either version 3 of the License, or
9
  the Free Software Foundation, either version 3 of the License, or
10
  (at your option) any later version.
10
  (at your option) any later version.
11
- 
11
+
12
  This program is distributed in the hope that it will be useful,
12
  This program is distributed in the hope that it will be useful,
13
  but WITHOUT ANY WARRANTY; without even the implied warranty of
13
  but WITHOUT ANY WARRANTY; without even the implied warranty of
14
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
  GNU General Public License for more details.
15
  GNU General Public License for more details.
16
- 
16
+
17
  You should have received a copy of the GNU General Public License
17
  You should have received a copy of the GNU General Public License
18
  along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
  along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
  */
19
  */
22
  This firmware is a mashup between Sprinter and grbl.
22
  This firmware is a mashup between Sprinter and grbl.
23
   (https://github.com/kliment/Sprinter)
23
   (https://github.com/kliment/Sprinter)
24
   (https://github.com/simen/grbl/tree)
24
   (https://github.com/simen/grbl/tree)
25
- 
26
- It has preliminary support for Matthew Roberts advance algorithm 
25
+
26
+ It has preliminary support for Matthew Roberts advance algorithm
27
     http://reprap.org/pipermail/reprap-dev/2011-May/003323.html
27
     http://reprap.org/pipermail/reprap-dev/2011-May/003323.html
28
  */
28
  */
29
 
29
 
50
 #if defined(DIGIPOTSS_PIN) && DIGIPOTSS_PIN > -1
50
 #if defined(DIGIPOTSS_PIN) && DIGIPOTSS_PIN > -1
51
 #include <SPI.h>
51
 #include <SPI.h>
52
 #endif
52
 #endif
53
+
54
+#if defined(DIGIPOT_I2C)
55
+  #include <Wire.h>
56
+#endif

+ 113
- 103
Marlin/Marlin_main.cpp Wyświetl plik

249
 float delta[3] = {0.0, 0.0, 0.0};
249
 float delta[3] = {0.0, 0.0, 0.0};
250
 #endif
250
 #endif
251
 
251
 
252
-  
252
+
253
 //===========================================================================
253
 //===========================================================================
254
 //=============================private variables=============================
254
 //=============================private variables=============================
255
 //===========================================================================
255
 //===========================================================================
492
   #if defined(CONTROLLERFAN_PIN) && CONTROLLERFAN_PIN > -1
492
   #if defined(CONTROLLERFAN_PIN) && CONTROLLERFAN_PIN > -1
493
     SET_OUTPUT(CONTROLLERFAN_PIN); //Set pin used for driver cooling fan
493
     SET_OUTPUT(CONTROLLERFAN_PIN); //Set pin used for driver cooling fan
494
   #endif
494
   #endif
495
+
496
+  #ifdef DIGIPOT_I2C
497
+    digipot_i2c_init();
498
+  #endif
495
 }
499
 }
496
 
500
 
497
 
501
 
789
 static float duplicate_extruder_x_offset = DEFAULT_DUPLICATION_X_OFFSET; // used in mode 2
793
 static float duplicate_extruder_x_offset = DEFAULT_DUPLICATION_X_OFFSET; // used in mode 2
790
 static float duplicate_extruder_temp_offset = 0; // used in mode 2
794
 static float duplicate_extruder_temp_offset = 0; // used in mode 2
791
 bool extruder_duplication_enabled = false; // used in mode 2
795
 bool extruder_duplication_enabled = false; // used in mode 2
792
-#endif //DUAL_X_CARRIAGE    
796
+#endif //DUAL_X_CARRIAGE
793
 
797
 
794
 static void axis_is_at_home(int axis) {
798
 static void axis_is_at_home(int axis) {
795
 #ifdef DUAL_X_CARRIAGE
799
 #ifdef DUAL_X_CARRIAGE
802
     }
806
     }
803
     else if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && active_extruder == 0) {
807
     else if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && active_extruder == 0) {
804
       current_position[X_AXIS] = base_home_pos(X_AXIS) + add_homeing[X_AXIS];
808
       current_position[X_AXIS] = base_home_pos(X_AXIS) + add_homeing[X_AXIS];
805
-      min_pos[X_AXIS] =          base_min_pos(X_AXIS) + add_homeing[X_AXIS]; 
806
-      max_pos[X_AXIS] =          min(base_max_pos(X_AXIS) + add_homeing[X_AXIS], 
809
+      min_pos[X_AXIS] =          base_min_pos(X_AXIS) + add_homeing[X_AXIS];
810
+      max_pos[X_AXIS] =          min(base_max_pos(X_AXIS) + add_homeing[X_AXIS],
807
                                   max(extruder_offset[X_AXIS][1], X2_MAX_POS) - duplicate_extruder_x_offset);
811
                                   max(extruder_offset[X_AXIS][1], X2_MAX_POS) - duplicate_extruder_x_offset);
808
       return;
812
       return;
809
     }
813
     }
895
     st_synchronize();
899
     st_synchronize();
896
 
900
 
897
     // move back down slowly to find bed
901
     // move back down slowly to find bed
898
-    feedrate = homing_feedrate[Z_AXIS]/4; 
902
+    feedrate = homing_feedrate[Z_AXIS]/4;
899
     zPosition -= home_retract_mm(Z_AXIS) * 2;
903
     zPosition -= home_retract_mm(Z_AXIS) * 2;
900
     plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], zPosition, current_position[E_AXIS], feedrate/60, active_extruder);
904
     plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], zPosition, current_position[E_AXIS], feedrate/60, active_extruder);
901
     st_synchronize();
905
     st_synchronize();
992
 
996
 
993
     current_position[axis] = 0;
997
     current_position[axis] = 0;
994
     plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
998
     plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
995
-	
999
+
996
 
1000
 
997
     // Engage Servo endstop if enabled
1001
     // Engage Servo endstop if enabled
998
     #ifdef SERVO_ENDSTOPS
1002
     #ifdef SERVO_ENDSTOPS
1050
 #if defined (ENABLE_AUTO_BED_LEVELING) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
1054
 #if defined (ENABLE_AUTO_BED_LEVELING) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
1051
     if (axis==Z_AXIS) retract_z_probe();
1055
     if (axis==Z_AXIS) retract_z_probe();
1052
 #endif
1056
 #endif
1053
-    
1057
+
1054
   }
1058
   }
1055
 }
1059
 }
1056
 #define HOMEAXIS(LETTER) homeaxis(LETTER##_AXIS)
1060
 #define HOMEAXIS(LETTER) homeaxis(LETTER##_AXIS)
1124
         destination[Y_AXIS]=current_position[Y_AXIS];
1128
         destination[Y_AXIS]=current_position[Y_AXIS];
1125
         destination[Z_AXIS]=current_position[Z_AXIS];
1129
         destination[Z_AXIS]=current_position[Z_AXIS];
1126
         current_position[Z_AXIS]+=retract_zlift;
1130
         current_position[Z_AXIS]+=retract_zlift;
1127
-        destination[E_AXIS]=current_position[E_AXIS]+retract_length+retract_recover_length; 
1131
+        destination[E_AXIS]=current_position[E_AXIS]+retract_length+retract_recover_length;
1128
         feedrate=retract_recover_feedrate;
1132
         feedrate=retract_recover_feedrate;
1129
         retracted=false;
1133
         retracted=false;
1130
         prepare_move();
1134
         prepare_move();
1238
         // reset state used by the different modes
1242
         // reset state used by the different modes
1239
         memcpy(raised_parked_position, current_position, sizeof(raised_parked_position));
1243
         memcpy(raised_parked_position, current_position, sizeof(raised_parked_position));
1240
         delayed_move_time = 0;
1244
         delayed_move_time = 0;
1241
-        active_extruder_parked = true; 
1242
-      #else      
1245
+        active_extruder_parked = true;
1246
+      #else
1243
         HOMEAXIS(X);
1247
         HOMEAXIS(X);
1244
-      #endif         
1248
+      #endif
1245
       }
1249
       }
1246
 
1250
 
1247
       if((home_all_axis) || (code_seen(axis_codes[Y_AXIS]))) {
1251
       if((home_all_axis) || (code_seen(axis_codes[Y_AXIS]))) {
1260
           current_position[Y_AXIS]=code_value()+add_homeing[1];
1264
           current_position[Y_AXIS]=code_value()+add_homeing[1];
1261
         }
1265
         }
1262
       }
1266
       }
1263
-      
1267
+
1264
       #if Z_HOME_DIR < 0                      // If homing towards BED do Z last
1268
       #if Z_HOME_DIR < 0                      // If homing towards BED do Z last
1265
         #ifndef Z_SAFE_HOMING
1269
         #ifndef Z_SAFE_HOMING
1266
           if((home_all_axis) || (code_seen(axis_codes[Z_AXIS]))) {
1270
           if((home_all_axis) || (code_seen(axis_codes[Z_AXIS]))) {
1272
             #endif
1276
             #endif
1273
             HOMEAXIS(Z);
1277
             HOMEAXIS(Z);
1274
           }
1278
           }
1275
-        #else                      // Z Safe mode activated. 
1279
+        #else                      // Z Safe mode activated.
1276
           if(home_all_axis) {
1280
           if(home_all_axis) {
1277
             destination[X_AXIS] = round(Z_SAFE_HOMING_X_POINT - X_PROBE_OFFSET_FROM_EXTRUDER);
1281
             destination[X_AXIS] = round(Z_SAFE_HOMING_X_POINT - X_PROBE_OFFSET_FROM_EXTRUDER);
1278
             destination[Y_AXIS] = round(Z_SAFE_HOMING_Y_POINT - Y_PROBE_OFFSET_FROM_EXTRUDER);
1282
             destination[Y_AXIS] = round(Z_SAFE_HOMING_Y_POINT - Y_PROBE_OFFSET_FROM_EXTRUDER);
1279
             destination[Z_AXIS] = Z_RAISE_BEFORE_HOMING * home_dir(Z_AXIS) * (-1);    // Set destination away from bed
1283
             destination[Z_AXIS] = Z_RAISE_BEFORE_HOMING * home_dir(Z_AXIS) * (-1);    // Set destination away from bed
1280
             feedrate = XY_TRAVEL_SPEED;
1284
             feedrate = XY_TRAVEL_SPEED;
1281
             current_position[Z_AXIS] = 0;
1285
             current_position[Z_AXIS] = 0;
1282
-			
1286
+
1283
             plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
1287
             plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
1284
             plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate, active_extruder);
1288
             plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate, active_extruder);
1285
             st_synchronize();
1289
             st_synchronize();
1297
               && (current_position[Y_AXIS]+Y_PROBE_OFFSET_FROM_EXTRUDER <= Y_MAX_POS)) {
1301
               && (current_position[Y_AXIS]+Y_PROBE_OFFSET_FROM_EXTRUDER <= Y_MAX_POS)) {
1298
 
1302
 
1299
               current_position[Z_AXIS] = 0;
1303
               current_position[Z_AXIS] = 0;
1300
-              plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);			  
1304
+              plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
1301
               destination[Z_AXIS] = Z_RAISE_BEFORE_HOMING * home_dir(Z_AXIS) * (-1);    // Set destination away from bed
1305
               destination[Z_AXIS] = Z_RAISE_BEFORE_HOMING * home_dir(Z_AXIS) * (-1);    // Set destination away from bed
1302
               feedrate = max_feedrate[Z_AXIS];
1306
               feedrate = max_feedrate[Z_AXIS];
1303
               plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate, active_extruder);
1307
               plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate, active_extruder);
1317
         #endif
1321
         #endif
1318
       #endif
1322
       #endif
1319
 
1323
 
1320
-      
1321
-     
1324
+
1325
+
1322
       if(code_seen(axis_codes[Z_AXIS])) {
1326
       if(code_seen(axis_codes[Z_AXIS])) {
1323
         if(code_value_long() != 0) {
1327
         if(code_value_long() != 0) {
1324
           current_position[Z_AXIS]=code_value()+add_homeing[2];
1328
           current_position[Z_AXIS]=code_value()+add_homeing[2];
1364
 
1368
 
1365
             feedrate = homing_feedrate[Z_AXIS];
1369
             feedrate = homing_feedrate[Z_AXIS];
1366
 #ifdef ACCURATE_BED_LEVELING
1370
 #ifdef ACCURATE_BED_LEVELING
1367
-            
1371
+
1368
             int xGridSpacing = (RIGHT_PROBE_BED_POSITION - LEFT_PROBE_BED_POSITION) / (ACCURATE_BED_LEVELING_POINTS-1);
1372
             int xGridSpacing = (RIGHT_PROBE_BED_POSITION - LEFT_PROBE_BED_POSITION) / (ACCURATE_BED_LEVELING_POINTS-1);
1369
             int yGridSpacing = (BACK_PROBE_BED_POSITION - FRONT_PROBE_BED_POSITION) / (ACCURATE_BED_LEVELING_POINTS-1);
1373
             int yGridSpacing = (BACK_PROBE_BED_POSITION - FRONT_PROBE_BED_POSITION) / (ACCURATE_BED_LEVELING_POINTS-1);
1370
-            
1371
-            
1374
+
1375
+
1372
             // solve the plane equation ax + by + d = z
1376
             // solve the plane equation ax + by + d = z
1373
             // A is the matrix with rows [x y 1] for all the probed points
1377
             // A is the matrix with rows [x y 1] for all the probed points
1374
             // B is the vector of the Z positions
1378
             // B is the vector of the Z positions
1375
             // the normal vector to the plane is formed by the coefficients of the plane equation in the standard form, which is Vx*x+Vy*y+Vz*z+d = 0
1379
             // the normal vector to the plane is formed by the coefficients of the plane equation in the standard form, which is Vx*x+Vy*y+Vz*z+d = 0
1376
             // so Vx = -a Vy = -b Vz = 1 (we want the vector facing towards positive Z
1380
             // so Vx = -a Vy = -b Vz = 1 (we want the vector facing towards positive Z
1377
-            
1381
+
1378
             // "A" matrix of the linear system of equations
1382
             // "A" matrix of the linear system of equations
1379
             double eqnAMatrix[ACCURATE_BED_LEVELING_POINTS*ACCURATE_BED_LEVELING_POINTS*3];
1383
             double eqnAMatrix[ACCURATE_BED_LEVELING_POINTS*ACCURATE_BED_LEVELING_POINTS*3];
1380
             // "B" vector of Z points
1384
             // "B" vector of Z points
1381
             double eqnBVector[ACCURATE_BED_LEVELING_POINTS*ACCURATE_BED_LEVELING_POINTS];
1385
             double eqnBVector[ACCURATE_BED_LEVELING_POINTS*ACCURATE_BED_LEVELING_POINTS];
1382
-            
1383
-            
1386
+
1387
+
1384
             int probePointCounter = 0;
1388
             int probePointCounter = 0;
1385
             bool zig = true;
1389
             bool zig = true;
1386
-            
1390
+
1387
             for (int yProbe=FRONT_PROBE_BED_POSITION; yProbe <= BACK_PROBE_BED_POSITION; yProbe += yGridSpacing)
1391
             for (int yProbe=FRONT_PROBE_BED_POSITION; yProbe <= BACK_PROBE_BED_POSITION; yProbe += yGridSpacing)
1388
             {
1392
             {
1389
               int xProbe, xInc;
1393
               int xProbe, xInc;
1400
                 xInc = -xGridSpacing;
1404
                 xInc = -xGridSpacing;
1401
                 zig = true;
1405
                 zig = true;
1402
               }
1406
               }
1403
-              
1407
+
1404
               for (int xCount=0; xCount < ACCURATE_BED_LEVELING_POINTS; xCount++)
1408
               for (int xCount=0; xCount < ACCURATE_BED_LEVELING_POINTS; xCount++)
1405
               {
1409
               {
1406
                 if (probePointCounter == 0)
1410
                 if (probePointCounter == 0)
1408
                   // raise before probing
1412
                   // raise before probing
1409
                   do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], Z_RAISE_BEFORE_PROBING);
1413
                   do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], Z_RAISE_BEFORE_PROBING);
1410
                 } else
1414
                 } else
1411
-                {               
1415
+                {
1412
                   // raise extruder
1416
                   // raise extruder
1413
                   do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS);
1417
                   do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] + Z_RAISE_BETWEEN_PROBINGS);
1414
                 }
1418
                 }
1415
-                
1416
-                
1419
+
1420
+
1417
                 do_blocking_move_to(xProbe - X_PROBE_OFFSET_FROM_EXTRUDER, yProbe - Y_PROBE_OFFSET_FROM_EXTRUDER, current_position[Z_AXIS]);
1421
                 do_blocking_move_to(xProbe - X_PROBE_OFFSET_FROM_EXTRUDER, yProbe - Y_PROBE_OFFSET_FROM_EXTRUDER, current_position[Z_AXIS]);
1418
-    
1422
+
1419
                 engage_z_probe();   // Engage Z Servo endstop if available
1423
                 engage_z_probe();   // Engage Z Servo endstop if available
1420
                 run_z_probe();
1424
                 run_z_probe();
1421
                 eqnBVector[probePointCounter] = current_position[Z_AXIS];
1425
                 eqnBVector[probePointCounter] = current_position[Z_AXIS];
1422
                 retract_z_probe();
1426
                 retract_z_probe();
1423
-    
1427
+
1424
                 SERIAL_PROTOCOLPGM("Bed x: ");
1428
                 SERIAL_PROTOCOLPGM("Bed x: ");
1425
                 SERIAL_PROTOCOL(xProbe);
1429
                 SERIAL_PROTOCOL(xProbe);
1426
                 SERIAL_PROTOCOLPGM(" y: ");
1430
                 SERIAL_PROTOCOLPGM(" y: ");
1428
                 SERIAL_PROTOCOLPGM(" z: ");
1432
                 SERIAL_PROTOCOLPGM(" z: ");
1429
                 SERIAL_PROTOCOL(current_position[Z_AXIS]);
1433
                 SERIAL_PROTOCOL(current_position[Z_AXIS]);
1430
                 SERIAL_PROTOCOLPGM("\n");
1434
                 SERIAL_PROTOCOLPGM("\n");
1431
-                
1435
+
1432
                 eqnAMatrix[probePointCounter + 0*ACCURATE_BED_LEVELING_POINTS*ACCURATE_BED_LEVELING_POINTS] = xProbe;
1436
                 eqnAMatrix[probePointCounter + 0*ACCURATE_BED_LEVELING_POINTS*ACCURATE_BED_LEVELING_POINTS] = xProbe;
1433
                 eqnAMatrix[probePointCounter + 1*ACCURATE_BED_LEVELING_POINTS*ACCURATE_BED_LEVELING_POINTS] = yProbe;
1437
                 eqnAMatrix[probePointCounter + 1*ACCURATE_BED_LEVELING_POINTS*ACCURATE_BED_LEVELING_POINTS] = yProbe;
1434
                 eqnAMatrix[probePointCounter + 2*ACCURATE_BED_LEVELING_POINTS*ACCURATE_BED_LEVELING_POINTS] = 1;
1438
                 eqnAMatrix[probePointCounter + 2*ACCURATE_BED_LEVELING_POINTS*ACCURATE_BED_LEVELING_POINTS] = 1;
1437
               }
1441
               }
1438
             }
1442
             }
1439
             clean_up_after_endstop_move();
1443
             clean_up_after_endstop_move();
1440
-            
1444
+
1441
             // solve lsq problem
1445
             // solve lsq problem
1442
             double *plane_equation_coefficients = qr_solve(ACCURATE_BED_LEVELING_POINTS*ACCURATE_BED_LEVELING_POINTS, 3, eqnAMatrix, eqnBVector);
1446
             double *plane_equation_coefficients = qr_solve(ACCURATE_BED_LEVELING_POINTS*ACCURATE_BED_LEVELING_POINTS, 3, eqnAMatrix, eqnBVector);
1443
-            
1447
+
1444
             SERIAL_PROTOCOLPGM("Eqn coefficients: a: ");
1448
             SERIAL_PROTOCOLPGM("Eqn coefficients: a: ");
1445
             SERIAL_PROTOCOL(plane_equation_coefficients[0]);
1449
             SERIAL_PROTOCOL(plane_equation_coefficients[0]);
1446
             SERIAL_PROTOCOLPGM(" b: ");
1450
             SERIAL_PROTOCOLPGM(" b: ");
1447
             SERIAL_PROTOCOL(plane_equation_coefficients[1]);
1451
             SERIAL_PROTOCOL(plane_equation_coefficients[1]);
1448
             SERIAL_PROTOCOLPGM(" d: ");
1452
             SERIAL_PROTOCOLPGM(" d: ");
1449
             SERIAL_PROTOCOLLN(plane_equation_coefficients[2]);
1453
             SERIAL_PROTOCOLLN(plane_equation_coefficients[2]);
1450
-            
1451
-            
1454
+
1455
+
1452
             set_bed_level_equation_lsq(plane_equation_coefficients);
1456
             set_bed_level_equation_lsq(plane_equation_coefficients);
1453
-            
1457
+
1454
             free(plane_equation_coefficients);
1458
             free(plane_equation_coefficients);
1455
-            
1459
+
1456
 #else // ACCURATE_BED_LEVELING not defined
1460
 #else // ACCURATE_BED_LEVELING not defined
1457
-            
1458
-            
1461
+
1462
+
1459
             // prob 1
1463
             // prob 1
1460
             do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], Z_RAISE_BEFORE_PROBING);
1464
             do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], Z_RAISE_BEFORE_PROBING);
1461
             do_blocking_move_to(LEFT_PROBE_BED_POSITION - X_PROBE_OFFSET_FROM_EXTRUDER, BACK_PROBE_BED_POSITION - Y_PROBE_OFFSET_FROM_EXTRUDER, current_position[Z_AXIS]);
1465
             do_blocking_move_to(LEFT_PROBE_BED_POSITION - X_PROBE_OFFSET_FROM_EXTRUDER, BACK_PROBE_BED_POSITION - Y_PROBE_OFFSET_FROM_EXTRUDER, current_position[Z_AXIS]);
1481
             run_z_probe();
1485
             run_z_probe();
1482
             float z_at_xLeft_yFront = current_position[Z_AXIS];
1486
             float z_at_xLeft_yFront = current_position[Z_AXIS];
1483
             retract_z_probe();
1487
             retract_z_probe();
1484
-            
1488
+
1485
             SERIAL_PROTOCOLPGM("Bed x: ");
1489
             SERIAL_PROTOCOLPGM("Bed x: ");
1486
             SERIAL_PROTOCOL(LEFT_PROBE_BED_POSITION);
1490
             SERIAL_PROTOCOL(LEFT_PROBE_BED_POSITION);
1487
             SERIAL_PROTOCOLPGM(" y: ");
1491
             SERIAL_PROTOCOLPGM(" y: ");
1499
             run_z_probe();
1503
             run_z_probe();
1500
             float z_at_xRight_yFront = current_position[Z_AXIS];
1504
             float z_at_xRight_yFront = current_position[Z_AXIS];
1501
             retract_z_probe(); // Retract Z Servo endstop if available
1505
             retract_z_probe(); // Retract Z Servo endstop if available
1502
-            
1506
+
1503
             SERIAL_PROTOCOLPGM("Bed x: ");
1507
             SERIAL_PROTOCOLPGM("Bed x: ");
1504
             SERIAL_PROTOCOL(RIGHT_PROBE_BED_POSITION);
1508
             SERIAL_PROTOCOL(RIGHT_PROBE_BED_POSITION);
1505
             SERIAL_PROTOCOLPGM(" y: ");
1509
             SERIAL_PROTOCOLPGM(" y: ");
1511
             clean_up_after_endstop_move();
1515
             clean_up_after_endstop_move();
1512
 
1516
 
1513
             set_bed_level_equation(z_at_xLeft_yFront, z_at_xRight_yFront, z_at_xLeft_yBack);
1517
             set_bed_level_equation(z_at_xLeft_yFront, z_at_xRight_yFront, z_at_xLeft_yBack);
1514
-         
1515
-            
1518
+
1519
+
1516
 #endif // ACCURATE_BED_LEVELING
1520
 #endif // ACCURATE_BED_LEVELING
1517
-            st_synchronize();            
1521
+            st_synchronize();
1518
 
1522
 
1519
             // The following code correct the Z height difference from z-probe position and hotend tip position.
1523
             // The following code correct the Z height difference from z-probe position and hotend tip position.
1520
-            // The Z height on homing is measured by Z-Probe, but the probe is quite far from the hotend. 
1524
+            // The Z height on homing is measured by Z-Probe, but the probe is quite far from the hotend.
1521
             // When the bed is uneven, this height must be corrected.
1525
             // When the bed is uneven, this height must be corrected.
1522
             real_z = float(st_get_position(Z_AXIS))/axis_steps_per_unit[Z_AXIS];  //get the real Z (since the auto bed leveling is already correcting the plane)
1526
             real_z = float(st_get_position(Z_AXIS))/axis_steps_per_unit[Z_AXIS];  //get the real Z (since the auto bed leveling is already correcting the plane)
1523
             x_tmp = current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER;
1527
             x_tmp = current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER;
1529
             plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
1533
             plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
1530
         }
1534
         }
1531
         break;
1535
         break;
1532
-        
1536
+
1533
     case 30: // G30 Single Z Probe
1537
     case 30: // G30 Single Z Probe
1534
         {
1538
         {
1535
             engage_z_probe(); // Engage Z Servo endstop if available
1539
             engage_z_probe(); // Engage Z Servo endstop if available
1536
-            
1540
+
1537
             st_synchronize();
1541
             st_synchronize();
1538
             // TODO: make sure the bed_level_rotation_matrix is identity or the planner will get set incorectly
1542
             // TODO: make sure the bed_level_rotation_matrix is identity or the planner will get set incorectly
1539
             setup_for_endstop_move();
1543
             setup_for_endstop_move();
1684
         card.removeFile(strchr_pointer + 4);
1688
         card.removeFile(strchr_pointer + 4);
1685
       }
1689
       }
1686
       break;
1690
       break;
1687
-    case 32: //M32 - Select file and start SD print 
1691
+    case 32: //M32 - Select file and start SD print
1688
     {
1692
     {
1689
       if(card.sdprinting) {
1693
       if(card.sdprinting) {
1690
         st_synchronize();
1694
         st_synchronize();
1691
 
1695
 
1692
       }
1696
       }
1693
-      starpos = (strchr(strchr_pointer + 4,'*')); 
1694
-      
1697
+      starpos = (strchr(strchr_pointer + 4,'*'));
1698
+
1695
       char* namestartpos = (strchr(strchr_pointer + 4,'!'));   //find ! to indicate filename string start.
1699
       char* namestartpos = (strchr(strchr_pointer + 4,'!'));   //find ! to indicate filename string start.
1696
       if(namestartpos==NULL)
1700
       if(namestartpos==NULL)
1697
       {
1701
       {
1699
       }
1703
       }
1700
       else
1704
       else
1701
         namestartpos++; //to skip the '!'
1705
         namestartpos++; //to skip the '!'
1702
-        
1706
+
1703
       if(starpos!=NULL)
1707
       if(starpos!=NULL)
1704
         *(starpos-1)='\0';
1708
         *(starpos-1)='\0';
1705
-            
1709
+
1706
       bool call_procedure=(code_seen('P'));
1710
       bool call_procedure=(code_seen('P'));
1707
-      
1708
-      if(strchr_pointer>namestartpos) 
1711
+
1712
+      if(strchr_pointer>namestartpos)
1709
         call_procedure=false;  //false alert, 'P' found within filename
1713
         call_procedure=false;  //false alert, 'P' found within filename
1710
-      
1711
-      if( card.cardOK ) 
1714
+
1715
+      if( card.cardOK )
1712
       {
1716
       {
1713
         card.openFile(namestartpos,true,!call_procedure);
1717
         card.openFile(namestartpos,true,!call_procedure);
1714
         if(code_seen('S'))
1718
         if(code_seen('S'))
1781
 #ifdef DUAL_X_CARRIAGE
1785
 #ifdef DUAL_X_CARRIAGE
1782
       if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && tmp_extruder == 0)
1786
       if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && tmp_extruder == 0)
1783
         setTargetHotend1(code_value() == 0.0 ? 0.0 : code_value() + duplicate_extruder_temp_offset);
1787
         setTargetHotend1(code_value() == 0.0 ? 0.0 : code_value() + duplicate_extruder_temp_offset);
1784
-#endif          
1788
+#endif
1785
       setWatch();
1789
       setWatch();
1786
       break;
1790
       break;
1787
     case 140: // M140 set bed temp
1791
     case 140: // M140 set bed temp
1847
             SERIAL_PROTOCOL_F(rawHotendTemp(cur_extruder)/OVERSAMPLENR,0);
1851
             SERIAL_PROTOCOL_F(rawHotendTemp(cur_extruder)/OVERSAMPLENR,0);
1848
           }
1852
           }
1849
         #endif
1853
         #endif
1850
-		
1854
+
1851
         SERIAL_PROTOCOLLN("");
1855
         SERIAL_PROTOCOLLN("");
1852
       return;
1856
       return;
1853
       break;
1857
       break;
1865
 #ifdef DUAL_X_CARRIAGE
1869
 #ifdef DUAL_X_CARRIAGE
1866
         if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && tmp_extruder == 0)
1870
         if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && tmp_extruder == 0)
1867
           setTargetHotend1(code_value() == 0.0 ? 0.0 : code_value() + duplicate_extruder_temp_offset);
1871
           setTargetHotend1(code_value() == 0.0 ? 0.0 : code_value() + duplicate_extruder_temp_offset);
1868
-#endif          
1872
+#endif
1869
         CooldownNoWait = true;
1873
         CooldownNoWait = true;
1870
       } else if (code_seen('R')) {
1874
       } else if (code_seen('R')) {
1871
         setTargetHotend(code_value(), tmp_extruder);
1875
         setTargetHotend(code_value(), tmp_extruder);
1872
 #ifdef DUAL_X_CARRIAGE
1876
 #ifdef DUAL_X_CARRIAGE
1873
         if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && tmp_extruder == 0)
1877
         if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && tmp_extruder == 0)
1874
           setTargetHotend1(code_value() == 0.0 ? 0.0 : code_value() + duplicate_extruder_temp_offset);
1878
           setTargetHotend1(code_value() == 0.0 ? 0.0 : code_value() + duplicate_extruder_temp_offset);
1875
-#endif          
1879
+#endif
1876
         CooldownNoWait = false;
1880
         CooldownNoWait = false;
1877
       }
1881
       }
1878
       #ifdef AUTOTEMP
1882
       #ifdef AUTOTEMP
2036
             SET_OUTPUT(SUICIDE_PIN);
2040
             SET_OUTPUT(SUICIDE_PIN);
2037
             WRITE(SUICIDE_PIN, HIGH);
2041
             WRITE(SUICIDE_PIN, HIGH);
2038
         #endif
2042
         #endif
2039
-        
2043
+
2040
         #ifdef ULTIPANEL
2044
         #ifdef ULTIPANEL
2041
           powersupply = true;
2045
           powersupply = true;
2042
           LCD_MESSAGEPGM(WELCOME_MSG);
2046
           LCD_MESSAGEPGM(WELCOME_MSG);
2193
       #endif
2197
       #endif
2194
       break;
2198
       break;
2195
       //TODO: update for all axis, use for loop
2199
       //TODO: update for all axis, use for loop
2196
-    #ifdef BLINKM  
2200
+    #ifdef BLINKM
2197
     case 150: // M150
2201
     case 150: // M150
2198
       {
2202
       {
2199
         byte red;
2203
         byte red;
2200
         byte grn;
2204
         byte grn;
2201
         byte blu;
2205
         byte blu;
2202
-        
2206
+
2203
         if(code_seen('R')) red = code_value();
2207
         if(code_seen('R')) red = code_value();
2204
         if(code_seen('U')) grn = code_value();
2208
         if(code_seen('U')) grn = code_value();
2205
         if(code_seen('B')) blu = code_value();
2209
         if(code_seen('B')) blu = code_value();
2206
-        
2207
-        SendColors(red,grn,blu);        
2210
+
2211
+        SendColors(red,grn,blu);
2208
       }
2212
       }
2209
       break;
2213
       break;
2210
     #endif //BLINKM
2214
     #endif //BLINKM
2354
       {
2358
       {
2355
         extruder_offset[Z_AXIS][tmp_extruder] = code_value();
2359
         extruder_offset[Z_AXIS][tmp_extruder] = code_value();
2356
       }
2360
       }
2357
-      #endif       
2361
+      #endif
2358
       SERIAL_ECHO_START;
2362
       SERIAL_ECHO_START;
2359
       SERIAL_ECHOPGM(MSG_HOTEND_OFFSET);
2363
       SERIAL_ECHOPGM(MSG_HOTEND_OFFSET);
2360
       for(tmp_extruder = 0; tmp_extruder < EXTRUDERS; tmp_extruder++)
2364
       for(tmp_extruder = 0; tmp_extruder < EXTRUDERS; tmp_extruder++)
2387
       }
2391
       }
2388
     }
2392
     }
2389
     break;
2393
     break;
2390
-	
2394
+
2391
 	case 226: // M226 P<pin number> S<pin state>- Wait until the specified pin reaches the state required
2395
 	case 226: // M226 P<pin number> S<pin state>- Wait until the specified pin reaches the state required
2392
 	{
2396
 	{
2393
       if(code_seen('P')){
2397
       if(code_seen('P')){
2394
         int pin_number = code_value(); // pin number
2398
         int pin_number = code_value(); // pin number
2395
         int pin_state = -1; // required pin state - default is inverted
2399
         int pin_state = -1; // required pin state - default is inverted
2396
-        
2400
+
2397
         if(code_seen('S')) pin_state = code_value(); // required pin state
2401
         if(code_seen('S')) pin_state = code_value(); // required pin state
2398
-      
2402
+
2399
         if(pin_state >= -1 && pin_state <= 1){
2403
         if(pin_state >= -1 && pin_state <= 1){
2400
-        
2404
+
2401
           for(int8_t i = 0; i < (int8_t)sizeof(sensitive_pins); i++)
2405
           for(int8_t i = 0; i < (int8_t)sizeof(sensitive_pins); i++)
2402
           {
2406
           {
2403
             if (sensitive_pins[i] == pin_number)
2407
             if (sensitive_pins[i] == pin_number)
2406
               break;
2410
               break;
2407
             }
2411
             }
2408
           }
2412
           }
2409
-        
2413
+
2410
           if (pin_number > -1)
2414
           if (pin_number > -1)
2411
           {
2415
           {
2412
             st_synchronize();
2416
             st_synchronize();
2413
-            
2417
+
2414
             pinMode(pin_number, INPUT);
2418
             pinMode(pin_number, INPUT);
2415
-            
2419
+
2416
             int target;
2420
             int target;
2417
             switch(pin_state){
2421
             switch(pin_state){
2418
             case 1:
2422
             case 1:
2419
               target = HIGH;
2423
               target = HIGH;
2420
               break;
2424
               break;
2421
-            
2425
+
2422
             case 0:
2426
             case 0:
2423
               target = LOW;
2427
               target = LOW;
2424
               break;
2428
               break;
2425
-            
2429
+
2426
             case -1:
2430
             case -1:
2427
               target = !digitalRead(pin_number);
2431
               target = !digitalRead(pin_number);
2428
               break;
2432
               break;
2429
             }
2433
             }
2430
-            
2434
+
2431
             while(digitalRead(pin_number) != target){
2435
             while(digitalRead(pin_number) != target){
2432
               manage_heater();
2436
               manage_heater();
2433
               manage_inactivity();
2437
               manage_inactivity();
2437
         }
2441
         }
2438
       }
2442
       }
2439
     }
2443
     }
2440
-    break;	
2444
+    break;
2441
 
2445
 
2442
     #if NUM_SERVOS > 0
2446
     #if NUM_SERVOS > 0
2443
     case 280: // M280 - set servo position absolute. P: servo index, S: angle or microseconds
2447
     case 280: // M280 - set servo position absolute. P: servo index, S: angle or microseconds
2615
         engage_z_probe();    // Engage Z Servo endstop if available
2619
         engage_z_probe();    // Engage Z Servo endstop if available
2616
     }
2620
     }
2617
     break;
2621
     break;
2618
-    
2622
+
2619
     case 402:
2623
     case 402:
2620
     {
2624
     {
2621
         retract_z_probe();    // Retract Z Servo endstop if enabled
2625
         retract_z_probe();    // Retract Z Servo endstop if enabled
2622
     }
2626
     }
2623
     break;
2627
     break;
2624
-#endif    
2628
+#endif
2625
     case 500: // M500 Store settings in EEPROM
2629
     case 500: // M500 Store settings in EEPROM
2626
     {
2630
     {
2627
         Config_StoreSettings();
2631
         Config_StoreSettings();
2783
               //    M605 S0: Full control mode. The slicer has full control over x-carriage movement
2787
               //    M605 S0: Full control mode. The slicer has full control over x-carriage movement
2784
               //    M605 S1: Auto-park mode. The inactive head will auto park/unpark without slicer involvement
2788
               //    M605 S1: Auto-park mode. The inactive head will auto park/unpark without slicer involvement
2785
               //    M605 S2 [Xnnn] [Rmmm]: Duplication mode. The second extruder will duplicate the first with nnn
2789
               //    M605 S2 [Xnnn] [Rmmm]: Duplication mode. The second extruder will duplicate the first with nnn
2786
-              //                         millimeters x-offset and an optional differential hotend temperature of 
2790
+              //                         millimeters x-offset and an optional differential hotend temperature of
2787
               //                         mmm degrees. E.g., with "M605 S2 X100 R2" the second extruder will duplicate
2791
               //                         mmm degrees. E.g., with "M605 S2 X100 R2" the second extruder will duplicate
2788
               //                         the first with a spacing of 100mm in the x direction and 2 degrees hotter.
2792
               //                         the first with a spacing of 100mm in the x direction and 2 degrees hotter.
2789
               //
2793
               //
2790
               //    Note: the X axis should be homed after changing dual x-carriage mode.
2794
               //    Note: the X axis should be homed after changing dual x-carriage mode.
2791
     {
2795
     {
2792
         st_synchronize();
2796
         st_synchronize();
2793
-        
2797
+
2794
         if (code_seen('S'))
2798
         if (code_seen('S'))
2795
           dual_x_carriage_mode = code_value();
2799
           dual_x_carriage_mode = code_value();
2796
 
2800
 
2801
 
2805
 
2802
           if (code_seen('R'))
2806
           if (code_seen('R'))
2803
             duplicate_extruder_temp_offset = code_value();
2807
             duplicate_extruder_temp_offset = code_value();
2804
-            
2808
+
2805
           SERIAL_ECHO_START;
2809
           SERIAL_ECHO_START;
2806
           SERIAL_ECHOPGM(MSG_HOTEND_OFFSET);
2810
           SERIAL_ECHOPGM(MSG_HOTEND_OFFSET);
2807
           SERIAL_ECHO(" ");
2811
           SERIAL_ECHO(" ");
2817
         {
2821
         {
2818
           dual_x_carriage_mode = DEFAULT_DUAL_X_CARRIAGE_MODE;
2822
           dual_x_carriage_mode = DEFAULT_DUAL_X_CARRIAGE_MODE;
2819
         }
2823
         }
2820
-        
2824
+
2821
         active_extruder_parked = false;
2825
         active_extruder_parked = false;
2822
         extruder_duplication_enabled = false;
2826
         extruder_duplication_enabled = false;
2823
         delayed_move_time = 0;
2827
         delayed_move_time = 0;
2824
     }
2828
     }
2825
     break;
2829
     break;
2826
-    #endif //DUAL_X_CARRIAGE         
2830
+    #endif //DUAL_X_CARRIAGE
2827
 
2831
 
2828
     case 907: // M907 Set digital trimpot motor current using axis codes.
2832
     case 907: // M907 Set digital trimpot motor current using axis codes.
2829
     {
2833
     {
2841
       #ifdef MOTOR_CURRENT_PWM_E_PIN
2845
       #ifdef MOTOR_CURRENT_PWM_E_PIN
2842
         if(code_seen('E')) digipot_current(2, code_value());
2846
         if(code_seen('E')) digipot_current(2, code_value());
2843
       #endif
2847
       #endif
2848
+      #ifdef DIGIPOT_I2C
2849
+        // this one uses actual amps in floating point
2850
+        for(int i=0;i<NUM_AXIS;i++) if(code_seen(axis_codes[i])) digipot_i2c_set_current(i, code_value());
2851
+        // for each additional extruder (named B,C,D,E..., channels 4,5,6,7...)
2852
+        for(int i=NUM_AXIS;i<DIGIPOT_I2C_NUM_CHANNELS;i++) if(code_seen('B'+i-NUM_AXIS)) digipot_i2c_set_current(i, code_value());
2853
+      #endif
2844
     }
2854
     }
2845
     break;
2855
     break;
2846
     case 908: // M908 Control digital trimpot directly.
2856
     case 908: // M908 Control digital trimpot directly.
2913
         // Save current position to return to after applying extruder offset
2923
         // Save current position to return to after applying extruder offset
2914
         memcpy(destination, current_position, sizeof(destination));
2924
         memcpy(destination, current_position, sizeof(destination));
2915
       #ifdef DUAL_X_CARRIAGE
2925
       #ifdef DUAL_X_CARRIAGE
2916
-        if (dual_x_carriage_mode == DXC_AUTO_PARK_MODE && Stopped == false && 
2926
+        if (dual_x_carriage_mode == DXC_AUTO_PARK_MODE && Stopped == false &&
2917
             (delayed_move_time != 0 || current_position[X_AXIS] != x_home_pos(active_extruder)))
2927
             (delayed_move_time != 0 || current_position[X_AXIS] != x_home_pos(active_extruder)))
2918
         {
2928
         {
2919
           // Park old head: 1) raise 2) move to park position 3) lower
2929
           // Park old head: 1) raise 2) move to park position 3) lower
2920
-          plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] + TOOLCHANGE_PARK_ZLIFT, 
2930
+          plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] + TOOLCHANGE_PARK_ZLIFT,
2921
                 current_position[E_AXIS], max_feedrate[Z_AXIS], active_extruder);
2931
                 current_position[E_AXIS], max_feedrate[Z_AXIS], active_extruder);
2922
-          plan_buffer_line(x_home_pos(active_extruder), current_position[Y_AXIS], current_position[Z_AXIS] + TOOLCHANGE_PARK_ZLIFT, 
2932
+          plan_buffer_line(x_home_pos(active_extruder), current_position[Y_AXIS], current_position[Z_AXIS] + TOOLCHANGE_PARK_ZLIFT,
2923
                 current_position[E_AXIS], max_feedrate[X_AXIS], active_extruder);
2933
                 current_position[E_AXIS], max_feedrate[X_AXIS], active_extruder);
2924
-          plan_buffer_line(x_home_pos(active_extruder), current_position[Y_AXIS], current_position[Z_AXIS], 
2934
+          plan_buffer_line(x_home_pos(active_extruder), current_position[Y_AXIS], current_position[Z_AXIS],
2925
                 current_position[E_AXIS], max_feedrate[Z_AXIS], active_extruder);
2935
                 current_position[E_AXIS], max_feedrate[Z_AXIS], active_extruder);
2926
           st_synchronize();
2936
           st_synchronize();
2927
         }
2937
         }
2928
-        
2938
+
2929
         // apply Y & Z extruder offset (x offset is already used in determining home pos)
2939
         // apply Y & Z extruder offset (x offset is already used in determining home pos)
2930
         current_position[Y_AXIS] = current_position[Y_AXIS] -
2940
         current_position[Y_AXIS] = current_position[Y_AXIS] -
2931
                      extruder_offset[Y_AXIS][active_extruder] +
2941
                      extruder_offset[Y_AXIS][active_extruder] +
2933
         current_position[Z_AXIS] = current_position[Z_AXIS] -
2943
         current_position[Z_AXIS] = current_position[Z_AXIS] -
2934
                      extruder_offset[Z_AXIS][active_extruder] +
2944
                      extruder_offset[Z_AXIS][active_extruder] +
2935
                      extruder_offset[Z_AXIS][tmp_extruder];
2945
                      extruder_offset[Z_AXIS][tmp_extruder];
2936
-                     
2946
+
2937
         active_extruder = tmp_extruder;
2947
         active_extruder = tmp_extruder;
2938
 
2948
 
2939
         // This function resets the max/min values - the current position may be overwritten below.
2949
         // This function resets the max/min values - the current position may be overwritten below.
2941
 
2951
 
2942
         if (dual_x_carriage_mode == DXC_FULL_CONTROL_MODE)
2952
         if (dual_x_carriage_mode == DXC_FULL_CONTROL_MODE)
2943
         {
2953
         {
2944
-          current_position[X_AXIS] = inactive_extruder_x_pos; 
2954
+          current_position[X_AXIS] = inactive_extruder_x_pos;
2945
           inactive_extruder_x_pos = destination[X_AXIS];
2955
           inactive_extruder_x_pos = destination[X_AXIS];
2946
         }
2956
         }
2947
         else if (dual_x_carriage_mode == DXC_DUPLICATION_MODE)
2957
         else if (dual_x_carriage_mode == DXC_DUPLICATION_MODE)
2948
         {
2958
         {
2949
           active_extruder_parked = (active_extruder == 0); // this triggers the second extruder to move into the duplication position
2959
           active_extruder_parked = (active_extruder == 0); // this triggers the second extruder to move into the duplication position
2950
           if (active_extruder == 0 || active_extruder_parked)
2960
           if (active_extruder == 0 || active_extruder_parked)
2951
-            current_position[X_AXIS] = inactive_extruder_x_pos; 
2961
+            current_position[X_AXIS] = inactive_extruder_x_pos;
2952
           else
2962
           else
2953
-            current_position[X_AXIS] = destination[X_AXIS] + duplicate_extruder_x_offset; 
2963
+            current_position[X_AXIS] = destination[X_AXIS] + duplicate_extruder_x_offset;
2954
           inactive_extruder_x_pos = destination[X_AXIS];
2964
           inactive_extruder_x_pos = destination[X_AXIS];
2955
-          extruder_duplication_enabled = false; 
2965
+          extruder_duplication_enabled = false;
2956
         }
2966
         }
2957
         else
2967
         else
2958
         {
2968
         {
2962
           active_extruder_parked = true;
2972
           active_extruder_parked = true;
2963
           delayed_move_time = 0;
2973
           delayed_move_time = 0;
2964
         }
2974
         }
2965
-      #else    
2975
+      #else
2966
         // Offset extruder (only by XY)
2976
         // Offset extruder (only by XY)
2967
         int i;
2977
         int i;
2968
         for(i = 0; i < 2; i++) {
2978
         for(i = 0; i < 2; i++) {
3175
     {
3185
     {
3176
       // move duplicate extruder into correct duplication position.
3186
       // move duplicate extruder into correct duplication position.
3177
       plan_set_position(inactive_extruder_x_pos, current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
3187
       plan_set_position(inactive_extruder_x_pos, current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
3178
-      plan_buffer_line(current_position[X_AXIS] + duplicate_extruder_x_offset, current_position[Y_AXIS], current_position[Z_AXIS], 
3188
+      plan_buffer_line(current_position[X_AXIS] + duplicate_extruder_x_offset, current_position[Y_AXIS], current_position[Z_AXIS],
3179
           current_position[E_AXIS], max_feedrate[X_AXIS], 1);
3189
           current_position[E_AXIS], max_feedrate[X_AXIS], 1);
3180
       plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
3190
       plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
3181
       st_synchronize();
3191
       st_synchronize();
3182
       extruder_duplication_enabled = true;
3192
       extruder_duplication_enabled = true;
3183
       active_extruder_parked = false;
3193
       active_extruder_parked = false;
3184
-    }  
3194
+    }
3185
     else if (dual_x_carriage_mode == DXC_AUTO_PARK_MODE) // handle unparking of head
3195
     else if (dual_x_carriage_mode == DXC_AUTO_PARK_MODE) // handle unparking of head
3186
     {
3196
     {
3187
       if (current_position[E_AXIS] == destination[E_AXIS])
3197
       if (current_position[E_AXIS] == destination[E_AXIS])
3190
         // be used as start of first non-travel move)
3200
         // be used as start of first non-travel move)
3191
         if (delayed_move_time != 0xFFFFFFFFUL)
3201
         if (delayed_move_time != 0xFFFFFFFFUL)
3192
         {
3202
         {
3193
-          memcpy(current_position, destination, sizeof(current_position)); 
3203
+          memcpy(current_position, destination, sizeof(current_position));
3194
           if (destination[Z_AXIS] > raised_parked_position[Z_AXIS])
3204
           if (destination[Z_AXIS] > raised_parked_position[Z_AXIS])
3195
             raised_parked_position[Z_AXIS] = destination[Z_AXIS];
3205
             raised_parked_position[Z_AXIS] = destination[Z_AXIS];
3196
           delayed_move_time = millis();
3206
           delayed_move_time = millis();
3200
       delayed_move_time = 0;
3210
       delayed_move_time = 0;
3201
       // unpark extruder: 1) raise, 2) move into starting XY position, 3) lower
3211
       // unpark extruder: 1) raise, 2) move into starting XY position, 3) lower
3202
       plan_buffer_line(raised_parked_position[X_AXIS], raised_parked_position[Y_AXIS], raised_parked_position[Z_AXIS],    current_position[E_AXIS], max_feedrate[Z_AXIS], active_extruder);
3212
       plan_buffer_line(raised_parked_position[X_AXIS], raised_parked_position[Y_AXIS], raised_parked_position[Z_AXIS],    current_position[E_AXIS], max_feedrate[Z_AXIS], active_extruder);
3203
-      plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], raised_parked_position[Z_AXIS], 
3213
+      plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], raised_parked_position[Z_AXIS],
3204
           current_position[E_AXIS], min(max_feedrate[X_AXIS],max_feedrate[Y_AXIS]), active_extruder);
3214
           current_position[E_AXIS], min(max_feedrate[X_AXIS],max_feedrate[Y_AXIS]), active_extruder);
3205
-      plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], 
3215
+      plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS],
3206
           current_position[E_AXIS], max_feedrate[Z_AXIS], active_extruder);
3216
           current_position[E_AXIS], max_feedrate[Z_AXIS], active_extruder);
3207
       active_extruder_parked = false;
3217
       active_extruder_parked = false;
3208
     }
3218
     }
3350
      enable_e0();
3360
      enable_e0();
3351
      float oldepos=current_position[E_AXIS];
3361
      float oldepos=current_position[E_AXIS];
3352
      float oldedes=destination[E_AXIS];
3362
      float oldedes=destination[E_AXIS];
3353
-     plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], 
3354
-                      destination[E_AXIS]+EXTRUDER_RUNOUT_EXTRUDE*EXTRUDER_RUNOUT_ESTEPS/axis_steps_per_unit[E_AXIS], 
3363
+     plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS],
3364
+                      destination[E_AXIS]+EXTRUDER_RUNOUT_EXTRUDE*EXTRUDER_RUNOUT_ESTEPS/axis_steps_per_unit[E_AXIS],
3355
                       EXTRUDER_RUNOUT_SPEED/60.*EXTRUDER_RUNOUT_ESTEPS/axis_steps_per_unit[E_AXIS], active_extruder);
3365
                       EXTRUDER_RUNOUT_SPEED/60.*EXTRUDER_RUNOUT_ESTEPS/axis_steps_per_unit[E_AXIS], active_extruder);
3356
      current_position[E_AXIS]=oldepos;
3366
      current_position[E_AXIS]=oldepos;
3357
      destination[E_AXIS]=oldedes;
3367
      destination[E_AXIS]=oldedes;
3368
       // travel moves have been received so enact them
3378
       // travel moves have been received so enact them
3369
       delayed_move_time = 0xFFFFFFFFUL; // force moves to be done
3379
       delayed_move_time = 0xFFFFFFFFUL; // force moves to be done
3370
       memcpy(destination,current_position,sizeof(destination));
3380
       memcpy(destination,current_position,sizeof(destination));
3371
-      prepare_move(); 
3381
+      prepare_move();
3372
     }
3382
     }
3373
   #endif
3383
   #endif
3374
   #ifdef TEMP_STAT_LEDS
3384
   #ifdef TEMP_STAT_LEDS

+ 54
- 0
Marlin/digipot_mcp4451.cpp Wyświetl plik

1
+#include "Configuration.h"
2
+
3
+#ifdef DIGIPOT_I2C
4
+#include "Stream.h"
5
+#include "utility/twi.h"
6
+#include "Wire.h"
7
+
8
+// Settings for the I2C based DIGIPOT (MCP4451) on Azteeg X3 Pro
9
+#define DIGIPOT_I2C_FACTOR 106.7
10
+#define DIGIPOT_I2C_MAX_CURRENT 2.5
11
+
12
+static byte current_to_wiper( float current ){
13
+    return byte(ceil(float((DIGIPOT_I2C_FACTOR*current))));
14
+}
15
+
16
+static void i2c_send(byte addr, byte a, byte b)
17
+{
18
+	Wire.beginTransmission(addr);
19
+    Wire.write(a);
20
+    Wire.write(b);
21
+    Wire.endTransmission();
22
+}
23
+
24
+// This is for the MCP4451 I2C based digipot
25
+void digipot_i2c_set_current( int channel, float current )
26
+{
27
+    current = min( (float) max( current, 0.0f ), DIGIPOT_I2C_MAX_CURRENT);
28
+    // these addresses are specific to Azteeg X3 Pro, can be set to others,
29
+    // In this case first digipot is at address A0=0, A1= 0, second one is at A0=0, A1= 1
30
+    byte addr= 0x2C; // channel 0-3
31
+    if(channel >= 4) {
32
+    	addr= 0x2E; // channel 4-7
33
+    	channel-= 4;
34
+    }
35
+
36
+    // Initial setup
37
+    i2c_send( addr, 0x40, 0xff );
38
+    i2c_send( addr, 0xA0, 0xff );
39
+
40
+    // Set actual wiper value
41
+    byte addresses[4] = { 0x00, 0x10, 0x60, 0x70 };
42
+    i2c_send( addr, addresses[channel], current_to_wiper(current) );
43
+}
44
+
45
+void digipot_i2c_init()
46
+{
47
+    const float digipot_motor_current[] = DIGIPOT_I2C_MOTOR_CURRENTS;
48
+    Wire.begin();
49
+    // setup initial currents as defined in Configuration_adv.h
50
+    for(int i=0;i<=sizeof(digipot_motor_current)/sizeof(float);i++) {
51
+        digipot_i2c_set_current(i, digipot_motor_current[i]);
52
+    }
53
+}
54
+#endif

+ 152
- 119
Marlin/pins.h Wyświetl plik

375
 * Arduino Mega pin assignment
375
 * Arduino Mega pin assignment
376
 *
376
 *
377
 ****************************************************************************************/
377
 ****************************************************************************************/
378
-#if MOTHERBOARD == 3 || MOTHERBOARD == 33 || MOTHERBOARD == 34 || MOTHERBOARD == 35 || MOTHERBOARD == 77 || MOTHERBOARD == 67
378
+#if MOTHERBOARD == 3 || MOTHERBOARD == 33 || MOTHERBOARD == 34 || MOTHERBOARD == 35 || MOTHERBOARD == 77 || MOTHERBOARD == 67 || MOTHERBOARD == 68
379
 #define KNOWN_BOARD 1
379
 #define KNOWN_BOARD 1
380
 
380
 
381
 //////////////////FIX THIS//////////////
381
 //////////////////FIX THIS//////////////
391
 // #define RAMPS_V_1_0
391
 // #define RAMPS_V_1_0
392
 
392
 
393
 
393
 
394
-#if MOTHERBOARD == 33 || MOTHERBOARD == 34 || MOTHERBOARD == 35 || MOTHERBOARD == 77 || MOTHERBOARD == 67
394
+#if MOTHERBOARD == 33 || MOTHERBOARD == 34 || MOTHERBOARD == 35 || MOTHERBOARD == 77 || MOTHERBOARD == 67 || MOTHERBOARD == 68
395
 
395
 
396
   #define LARGE_FLASH true
396
   #define LARGE_FLASH true
397
-  
397
+
398
   #if MOTHERBOARD == 77
398
   #if MOTHERBOARD == 77
399
     #define X_STEP_PIN         54
399
     #define X_STEP_PIN         54
400
     #define X_DIR_PIN          55
400
     #define X_DIR_PIN          55
434
     #define SDSS               25//53
434
     #define SDSS               25//53
435
     #define LED_PIN            13
435
     #define LED_PIN            13
436
 
436
 
437
-    #define BEEPER             33    
437
+    #define BEEPER             33
438
 
438
 
439
   #else
439
   #else
440
 
440
 
472
     #define E1_DIR_PIN         34
472
     #define E1_DIR_PIN         34
473
     #define E1_ENABLE_PIN      30
473
     #define E1_ENABLE_PIN      30
474
 
474
 
475
+    #if MOTHERBOARD == 68
476
+      #define E2_STEP_PIN        23
477
+      #define E2_DIR_PIN         25
478
+      #define E2_ENABLE_PIN      40
479
+
480
+      #define E3_STEP_PIN        27
481
+      #define E3_DIR_PIN         29
482
+      #define E3_ENABLE_PIN      41
483
+
484
+      #define E4_STEP_PIN        43
485
+      #define E4_DIR_PIN         37
486
+      #define E4_ENABLE_PIN      42
487
+    #endif
488
+
475
     #define SDPOWER            -1
489
     #define SDPOWER            -1
476
     #define SDSS               53
490
     #define SDSS               53
477
     #define LED_PIN            13
491
     #define LED_PIN            13
478
   #endif
492
   #endif
479
 
493
 
480
-  #if MOTHERBOARD == 33 || MOTHERBOARD == 35 || MOTHERBOARD == 67
494
+  #if MOTHERBOARD == 33 || MOTHERBOARD == 35 || MOTHERBOARD == 67 || MOTHERBOARD == 68
481
     #define FAN_PIN            9 // (Sprinter config)
495
     #define FAN_PIN            9 // (Sprinter config)
482
   #else
496
   #else
483
     #define FAN_PIN            4 // IO pin. Buffer needed
497
     #define FAN_PIN            4 // IO pin. Buffer needed
484
   #endif
498
   #endif
485
 
499
 
486
   #if MOTHERBOARD == 77
500
   #if MOTHERBOARD == 77
487
-    #define FAN_PIN            8 
501
+    #define FAN_PIN            8
488
   #endif
502
   #endif
489
-  
503
+
490
   #if MOTHERBOARD == 35
504
   #if MOTHERBOARD == 35
491
     #define CONTROLLERFAN_PIN  10 //Pin used for the fan to cool controller
505
     #define CONTROLLERFAN_PIN  10 //Pin used for the fan to cool controller
492
   #endif
506
   #endif
511
     #define HEATER_1_PIN       9    // EXTRUDER 2 (FAN On Sprinter)
525
     #define HEATER_1_PIN       9    // EXTRUDER 2 (FAN On Sprinter)
512
   #endif
526
   #endif
513
 
527
 
514
-  #define HEATER_2_PIN       -1 
515
 
528
 
516
   #if MOTHERBOARD == 77
529
   #if MOTHERBOARD == 77
517
-    #define HEATER_0_PIN       10   
518
-    #define HEATER_1_PIN       12 
519
-    #define HEATER_2_PIN       6   
530
+    #define HEATER_0_PIN       10
531
+    #define HEATER_1_PIN       12
532
+    #define HEATER_2_PIN       6
533
+  #elif MOTHERBOARD == 68
534
+    #define HEATER_2_PIN       16
535
+    #define HEATER_3_PIN       17
536
+    #define HEATER_4_PIN       4
537
+    #define HEATER_5_PIN       5
538
+    #define HEATER_6_PIN       6
539
+    #define HEATER_7_PIN       11
540
+  #else
541
+    #define HEATER_2_PIN       -1
520
   #endif
542
   #endif
521
 
543
 
522
   #define TEMP_0_PIN         13   // ANALOG NUMBERING
544
   #define TEMP_0_PIN         13   // ANALOG NUMBERING
523
   #define TEMP_1_PIN         15   // ANALOG NUMBERING
545
   #define TEMP_1_PIN         15   // ANALOG NUMBERING
524
-  #define TEMP_2_PIN         -1   // ANALOG NUMBERING
546
+  #if MOTHERBOARD == 68
547
+    #define TEMP_2_PIN         12   // ANALOG NUMBERING
548
+    #define TEMP_3_PIN         11   // ANALOG NUMBERING
549
+    #define TEMP_4_PIN         10   // ANALOG NUMBERING
550
+    #define TC1                4    // ANALOG NUMBERING Thermo couple on Azteeg X3Pro
551
+    #define TC2                5    // ANALOG NUMBERING Thermo couple on Azteeg X3Pro
552
+  #else
553
+    #define TEMP_2_PIN         -1   // ANALOG NUMBERING
554
+  #endif
525
 
555
 
526
   #if MOTHERBOARD == 35
556
   #if MOTHERBOARD == 35
527
     #define HEATER_BED_PIN     -1    // NO BED
557
     #define HEATER_BED_PIN     -1    // NO BED
532
       #define HEATER_BED_PIN     8    // BED
562
       #define HEATER_BED_PIN     8    // BED
533
     #endif
563
     #endif
534
   #endif
564
   #endif
535
-  #define TEMP_BED_PIN       14   // ANALOG NUMBERING
536
-
537
 
565
 
566
+  #define TEMP_BED_PIN       14   // ANALOG NUMBERING
538
 
567
 
539
   #ifdef NUM_SERVOS
568
   #ifdef NUM_SERVOS
540
     #define SERVO0_PIN         11
569
     #define SERVO0_PIN         11
552
     #endif
581
     #endif
553
   #endif
582
   #endif
554
 
583
 
584
+  #if MOTHERBOARD == 68
585
+    #define BEEPER 33
586
+  #endif
587
+
555
   #ifdef TEMP_STAT_LEDS
588
   #ifdef TEMP_STAT_LEDS
556
     #if MOTHERBOARD == 67
589
     #if MOTHERBOARD == 67
557
       #define STAT_LED_RED       6
590
       #define STAT_LED_RED       6
558
       #define STAT_LED_BLUE     11
591
       #define STAT_LED_BLUE     11
559
     #endif
592
     #endif
560
   #endif
593
   #endif
561
-  
594
+
562
   #ifdef ULTRA_LCD
595
   #ifdef ULTRA_LCD
563
 
596
 
564
     #ifdef NEWPANEL
597
     #ifdef NEWPANEL
565
-      #define LCD_PINS_RS 16 
598
+      #define LCD_PINS_RS 16
566
       #define LCD_PINS_ENABLE 17
599
       #define LCD_PINS_ENABLE 17
567
       #define LCD_PINS_D4 23
600
       #define LCD_PINS_D4 23
568
-      #define LCD_PINS_D5 25 
601
+      #define LCD_PINS_D5 25
569
       #define LCD_PINS_D6 27
602
       #define LCD_PINS_D6 27
570
       #define LCD_PINS_D7 29
603
       #define LCD_PINS_D7 29
571
 
604
 
613
         #else
646
         #else
614
           #define SDCARDDETECT -1  // Ramps does not use this port
647
           #define SDCARDDETECT -1  // Ramps does not use this port
615
         #endif
648
         #endif
616
-    
649
+
617
       #endif
650
       #endif
618
-    
619
-      #if MOTHERBOARD == 77 
620
-        #define BEEPER -1 
621
-
622
-        #define LCD_PINS_RS 27 
623
-        #define LCD_PINS_ENABLE 29 
624
-        #define LCD_PINS_D4 37 
625
-        #define LCD_PINS_D5 35 
626
-        #define LCD_PINS_D6 33 
627
-        #define LCD_PINS_D7 31 
628
-
629
-       //buttons 
630
-       #define BTN_EN1 16 
631
-       #define BTN_EN2 17 
632
-       #define BTN_ENC 23 //the click 
633
-
634
-    #endif 
651
+
652
+      #if MOTHERBOARD == 77
653
+        #define BEEPER -1
654
+
655
+        #define LCD_PINS_RS 27
656
+        #define LCD_PINS_ENABLE 29
657
+        #define LCD_PINS_D4 37
658
+        #define LCD_PINS_D5 35
659
+        #define LCD_PINS_D6 33
660
+        #define LCD_PINS_D7 31
661
+
662
+       //buttons
663
+       #define BTN_EN1 16
664
+       #define BTN_EN2 17
665
+       #define BTN_ENC 23 //the click
666
+
667
+    #endif
635
     #else //old style panel with shift register
668
     #else //old style panel with shift register
636
       //arduino pin witch triggers an piezzo beeper
669
       //arduino pin witch triggers an piezzo beeper
637
       #define BEEPER 33		//No Beeper added
670
       #define BEEPER 33		//No Beeper added
642
       //#define SHIFT_LD 42
675
       //#define SHIFT_LD 42
643
       //#define SHIFT_OUT 40
676
       //#define SHIFT_OUT 40
644
       //#define SHIFT_EN 17
677
       //#define SHIFT_EN 17
645
-    
646
-      #define LCD_PINS_RS 16 
678
+
679
+      #define LCD_PINS_RS 16
647
       #define LCD_PINS_ENABLE 17
680
       #define LCD_PINS_ENABLE 17
648
       #define LCD_PINS_D4 23
681
       #define LCD_PINS_D4 23
649
-      #define LCD_PINS_D5 25 
682
+      #define LCD_PINS_D5 25
650
       #define LCD_PINS_D6 27
683
       #define LCD_PINS_D6 27
651
       #define LCD_PINS_D7 29
684
       #define LCD_PINS_D7 29
652
-    #endif 
685
+    #endif
653
   #endif //ULTRA_LCD
686
   #endif //ULTRA_LCD
654
 
687
 
655
 #else // RAMPS_V_1_1 or RAMPS_V_1_2 as default (MOTHERBOARD == 3)
688
 #else // RAMPS_V_1_1 or RAMPS_V_1_2 as default (MOTHERBOARD == 3)
694
 #define HEATER_1_PIN        -1
727
 #define HEATER_1_PIN        -1
695
 #define HEATER_2_PIN        -1
728
 #define HEATER_2_PIN        -1
696
 #define TEMP_0_PIN          2    // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
729
 #define TEMP_0_PIN          2    // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
697
-#define TEMP_1_PIN          -1   
698
-#define TEMP_2_PIN          -1   
730
+#define TEMP_1_PIN          -1
731
+#define TEMP_2_PIN          -1
699
 #define TEMP_BED_PIN        1    // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
732
 #define TEMP_BED_PIN        1    // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
700
 
733
 
701
 #endif // MOTHERBOARD == 33 || MOTHERBOARD == 34 || MOTHERBOARD == 35 || MOTHERBOARD == 77
734
 #endif // MOTHERBOARD == 33 || MOTHERBOARD == 34 || MOTHERBOARD == 35 || MOTHERBOARD == 77
702
 
735
 
703
-// SPI for Max6675 Thermocouple 
736
+// SPI for Max6675 Thermocouple
704
 
737
 
705
 #ifndef SDSUPPORT
738
 #ifndef SDSUPPORT
706
-// these pins are defined in the SD library if building with SD support  
739
+// these pins are defined in the SD library if building with SD support
707
   #define MAX_SCK_PIN          52
740
   #define MAX_SCK_PIN          52
708
   #define MAX_MISO_PIN         50
741
   #define MAX_MISO_PIN         50
709
   #define MAX_MOSI_PIN         51
742
   #define MAX_MOSI_PIN         51
837
   #define BTN_EN1          14
870
   #define BTN_EN1          14
838
   #define BTN_EN2          39
871
   #define BTN_EN2          39
839
   #define BTN_ENC          15  //the click
872
   #define BTN_ENC          15  //the click
840
-    
873
+
841
   #define BLEN_C           2
874
   #define BLEN_C           2
842
   #define BLEN_B           1
875
   #define BLEN_B           1
843
   #define BLEN_A           0
876
   #define BLEN_A           0
844
-    
877
+
845
   //encoder rotation values
878
   //encoder rotation values
846
   #define encrot0          0
879
   #define encrot0          0
847
   #define encrot1          2
880
   #define encrot1          2
848
   #define encrot2          3
881
   #define encrot2          3
849
   #define encrot3          1
882
   #define encrot3          1
850
-  
883
+
851
 #endif //RA_CONTROL_PANEL
884
 #endif //RA_CONTROL_PANEL
852
 
885
 
853
 #ifdef RA_DISCO
886
 #ifdef RA_DISCO
861
   //This currently only works with the RA Board.
894
   //This currently only works with the RA Board.
862
   #define TLC_CLOCK_BIT 3 //bit 3 on port A
895
   #define TLC_CLOCK_BIT 3 //bit 3 on port A
863
   #define TLC_CLOCK_PORT &PORTA //bit 3 on port A
896
   #define TLC_CLOCK_PORT &PORTA //bit 3 on port A
864
-  
897
+
865
   #define TLC_BLANK_BIT 1 //bit 1 on port A
898
   #define TLC_BLANK_BIT 1 //bit 1 on port A
866
   #define TLC_BLANK_PORT &PORTA //bit 1 on port A
899
   #define TLC_BLANK_PORT &PORTA //bit 1 on port A
867
 
900
 
871
   #define TLC_XLAT_BIT 0 //bit 0 on port A
904
   #define TLC_XLAT_BIT 0 //bit 0 on port A
872
   #define TLC_XLAT_PORT &PORTA //bit 0 on port A
905
   #define TLC_XLAT_PORT &PORTA //bit 0 on port A
873
 
906
 
874
-  //change this to match your situation. Lots of TLCs takes up the arduino SRAM very quickly, so be careful 
907
+  //change this to match your situation. Lots of TLCs takes up the arduino SRAM very quickly, so be careful
875
   //Leave it at at least 1 if you have enabled RA_LIGHTING
908
   //Leave it at at least 1 if you have enabled RA_LIGHTING
876
   //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.
909
   //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.
877
-  #define NUM_TLCS 2 
910
+  #define NUM_TLCS 2
878
 
911
 
879
-  //These TRANS_ARRAY values let you change the order the LEDs on the lighting modules will animate for chase functions. 
912
+  //These TRANS_ARRAY values let you change the order the LEDs on the lighting modules will animate for chase functions.
880
   //Modify them according to your specific situation.
913
   //Modify them according to your specific situation.
881
   //NOTE: the array should be 8 long for every TLC you have. These defaults assume (2) TLCs.
914
   //NOTE: the array should be 8 long for every TLC you have. These defaults assume (2) TLCs.
882
   #define TRANS_ARRAY {0, 1, 2, 3, 4, 5, 6, 7, 15, 14, 13, 12, 11, 10, 9, 8} //forwards
915
   #define TRANS_ARRAY {0, 1, 2, 3, 4, 5, 6, 7, 15, 14, 13, 12, 11, 10, 9, 8} //forwards
1085
        #define LCD_PINS_D7        27
1118
        #define LCD_PINS_D7        27
1086
      #endif
1119
      #endif
1087
      //The encoder and click button
1120
      //The encoder and click button
1088
-     #define BTN_EN1 11  
1089
-     #define BTN_EN2 10 
1121
+     #define BTN_EN1 11
1122
+     #define BTN_EN2 10
1090
      #ifdef LCD_I2C_PANELOLU2
1123
      #ifdef LCD_I2C_PANELOLU2
1091
        #ifdef MELZI
1124
        #ifdef MELZI
1092
          #define BTN_ENC 29 //the click switch
1125
          #define BTN_ENC 29 //the click switch
1098
        #define BTN_ENC 16  //the click switch
1131
        #define BTN_ENC 16  //the click switch
1099
      #endif //Panelolu2
1132
      #endif //Panelolu2
1100
      //not connected to a pin
1133
      //not connected to a pin
1101
-     #define SDCARDDETECT -1    
1102
-    
1134
+     #define SDCARDDETECT -1
1135
+
1103
    #endif //Newpanel
1136
    #endif //Newpanel
1104
  #endif //Ultipanel
1137
  #endif //Ultipanel
1105
 
1138
 
1121
      #define BTN_EN2 10
1154
      #define BTN_EN2 10
1122
      #define BTN_ENC 16  //the click switch
1155
      #define BTN_ENC 16  //the click switch
1123
      //not connected to a pin
1156
      //not connected to a pin
1124
-     #define SDCARDDETECT -1    
1157
+     #define SDCARDDETECT -1
1125
  #endif //Makrpanel
1158
  #endif //Makrpanel
1126
 
1159
 
1127
 #endif
1160
 #endif
1204
     #define BTN_EN1 40
1237
     #define BTN_EN1 40
1205
     #define BTN_EN2 42
1238
     #define BTN_EN2 42
1206
     #define BTN_ENC 19  //the click
1239
     #define BTN_ENC 19  //the click
1207
-    
1240
+
1208
     #define SDCARDDETECT 38
1241
     #define SDCARDDETECT 38
1209
-    
1242
+
1210
   #else //old style panel with shift register
1243
   #else //old style panel with shift register
1211
     //arduino pin witch triggers an piezzo beeper
1244
     //arduino pin witch triggers an piezzo beeper
1212
     #define BEEPER 18
1245
     #define BEEPER 18
1223
     #define LCD_PINS_D5 21
1256
     #define LCD_PINS_D5 21
1224
     #define LCD_PINS_D6 20
1257
     #define LCD_PINS_D6 20
1225
     #define LCD_PINS_D7 19
1258
     #define LCD_PINS_D7 19
1226
-  
1259
+
1227
     #define SDCARDDETECT -1
1260
     #define SDCARDDETECT -1
1228
-  #endif 
1261
+  #endif
1229
 #endif //ULTRA_LCD
1262
 #endif //ULTRA_LCD
1230
 
1263
 
1231
 #endif
1264
 #endif
1358
 #define MOTOR_CURRENT_PWM_Z_PIN 45
1391
 #define MOTOR_CURRENT_PWM_Z_PIN 45
1359
 #define MOTOR_CURRENT_PWM_E_PIN 46
1392
 #define MOTOR_CURRENT_PWM_E_PIN 46
1360
 //Motor current PWM conversion, PWM value = MotorCurrentSetting * 255 / range
1393
 //Motor current PWM conversion, PWM value = MotorCurrentSetting * 255 / range
1361
-#define MOTOR_CURRENT_PWM_RANGE 2000
1394
+#define MOTOR_CURRENT_PWM_RANGE 2000
1362
 #define DEFAULT_PWM_MOTOR_CURRENT  {1300, 1300, 1250}
1395
 #define DEFAULT_PWM_MOTOR_CURRENT  {1300, 1300, 1250}
1363
 
1396
 
1364
 //arduino pin witch triggers an piezzo beeper
1397
 //arduino pin witch triggers an piezzo beeper
1443
  #else
1476
  #else
1444
   #define TEMP_0_PIN         15   // ANALOG NUMBERING - default connector for thermistor *T0* on rumba board is used
1477
   #define TEMP_0_PIN         15   // ANALOG NUMBERING - default connector for thermistor *T0* on rumba board is used
1445
  #endif
1478
  #endif
1446
-#endif 
1479
+#endif
1447
 
1480
 
1448
 #if (TEMP_SENSOR_1==0)
1481
 #if (TEMP_SENSOR_1==0)
1449
  #define TEMP_1_PIN         -1
1482
  #define TEMP_1_PIN         -1
2153
     #define BTN_EN1 59
2186
     #define BTN_EN1 59
2154
     #define BTN_EN2 64
2187
     #define BTN_EN2 64
2155
     #define BTN_ENC 43  //the click
2188
     #define BTN_ENC 43  //the click
2156
-    
2189
+
2157
     #define BLEN_C 2
2190
     #define BLEN_C 2
2158
     #define BLEN_B 1
2191
     #define BLEN_B 1
2159
     #define BLEN_A 0
2192
     #define BLEN_A 0
2160
-    
2193
+
2161
     #define SDCARDDETECT -1		// Ramps does not use this port
2194
     #define SDCARDDETECT -1		// Ramps does not use this port
2162
-    
2195
+
2163
       //encoder rotation values
2196
       //encoder rotation values
2164
     #define encrot0 0
2197
     #define encrot0 0
2165
     #define encrot1 2
2198
     #define encrot1 2
2176
 ****************************************************************************************/
2209
 ****************************************************************************************/
2177
 #if MOTHERBOARD == 701
2210
 #if MOTHERBOARD == 701
2178
  #define KNOWN_BOARD 1
2211
  #define KNOWN_BOARD 1
2179
- 
2180
- 
2212
+
2213
+
2181
  #ifndef __AVR_ATmega2560__
2214
  #ifndef __AVR_ATmega2560__
2182
  #error Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu.
2215
  #error Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu.
2183
  #endif
2216
  #endif
2184
- 
2217
+
2185
  #define LARGE_FLASH        true
2218
  #define LARGE_FLASH        true
2186
- 
2219
+
2187
  #define X_STEP_PIN 26
2220
  #define X_STEP_PIN 26
2188
  #define X_DIR_PIN 27
2221
  #define X_DIR_PIN 27
2189
  #define X_ENABLE_PIN 25
2222
  #define X_ENABLE_PIN 25
2190
  #define X_MIN_PIN 37
2223
  #define X_MIN_PIN 37
2191
  #define X_MAX_PIN 40 //2 //Max endstops default to disabled "-1", set to commented value to enable.
2224
  #define X_MAX_PIN 40 //2 //Max endstops default to disabled "-1", set to commented value to enable.
2192
- 
2225
+
2193
  #define Y_STEP_PIN 4 // A6
2226
  #define Y_STEP_PIN 4 // A6
2194
  #define Y_DIR_PIN 54 // A0
2227
  #define Y_DIR_PIN 54 // A0
2195
  #define Y_ENABLE_PIN 5
2228
  #define Y_ENABLE_PIN 5
2196
  #define Y_MIN_PIN 41
2229
  #define Y_MIN_PIN 41
2197
  #define Y_MAX_PIN 38 //15
2230
  #define Y_MAX_PIN 38 //15
2198
- 
2231
+
2199
  #define Z_STEP_PIN 56 // A2
2232
  #define Z_STEP_PIN 56 // A2
2200
  #define Z_DIR_PIN 60 // A6
2233
  #define Z_DIR_PIN 60 // A6
2201
  #define Z_ENABLE_PIN 55 // A1
2234
  #define Z_ENABLE_PIN 55 // A1
2202
  #define Z_MIN_PIN 18
2235
  #define Z_MIN_PIN 18
2203
  #define Z_MAX_PIN 19
2236
  #define Z_MAX_PIN 19
2204
- 
2237
+
2205
  #define E0_STEP_PIN 35
2238
  #define E0_STEP_PIN 35
2206
  #define E0_DIR_PIN 36
2239
  #define E0_DIR_PIN 36
2207
  #define E0_ENABLE_PIN 34
2240
  #define E0_ENABLE_PIN 34
2208
- 
2241
+
2209
  #define E1_STEP_PIN 29
2242
  #define E1_STEP_PIN 29
2210
  #define E1_DIR_PIN 39
2243
  #define E1_DIR_PIN 39
2211
  #define E1_ENABLE_PIN 28
2244
  #define E1_ENABLE_PIN 28
2212
- 
2245
+
2213
  #define E2_STEP_PIN 23
2246
  #define E2_STEP_PIN 23
2214
  #define E2_DIR_PIN 24
2247
  #define E2_DIR_PIN 24
2215
  #define E2_ENABLE_PIN 22
2248
  #define E2_ENABLE_PIN 22
2216
- 
2249
+
2217
  #define SDPOWER -1
2250
  #define SDPOWER -1
2218
  #define SDSS 53
2251
  #define SDSS 53
2219
  #define LED_PIN 13
2252
  #define LED_PIN 13
2220
- 
2253
+
2221
  #define FAN_PIN 7
2254
  #define FAN_PIN 7
2222
  #define FAN2_PIN 6
2255
  #define FAN2_PIN 6
2223
  #define PS_ON_PIN 12
2256
  #define PS_ON_PIN 12
2224
  #define KILL_PIN -1
2257
  #define KILL_PIN -1
2225
- 
2258
+
2226
  #define HEATER_0_PIN 9 // EXTRUDER 1
2259
  #define HEATER_0_PIN 9 // EXTRUDER 1
2227
  #define HEATER_1_PIN 8 // EXTRUDER 2
2260
  #define HEATER_1_PIN 8 // EXTRUDER 2
2228
  #define HEATER_2_PIN -1
2261
  #define HEATER_2_PIN -1
2229
- 
2262
+
2230
  #if TEMP_SENSOR_0 == -1
2263
  #if TEMP_SENSOR_0 == -1
2231
    #define TEMP_0_PIN 4 // ANALOG NUMBERING
2264
    #define TEMP_0_PIN 4 // ANALOG NUMBERING
2232
  #else
2265
  #else
2233
    #define TEMP_0_PIN 13 // ANALOG NUMBERING
2266
    #define TEMP_0_PIN 13 // ANALOG NUMBERING
2234
  #endif
2267
  #endif
2235
- 
2236
- 
2268
+
2269
+
2237
  #if TEMP_SENSOR_1 == -1
2270
  #if TEMP_SENSOR_1 == -1
2238
    #define TEMP_1_PIN 8 // ANALOG NUMBERING
2271
    #define TEMP_1_PIN 8 // ANALOG NUMBERING
2239
  #else
2272
  #else
2240
    #define TEMP_1_PIN 15 // ANALOG NUMBERING
2273
    #define TEMP_1_PIN 15 // ANALOG NUMBERING
2241
  #endif
2274
  #endif
2242
- 
2275
+
2243
  #define TEMP_2_PIN -1 // ANALOG NUMBERING
2276
  #define TEMP_2_PIN -1 // ANALOG NUMBERING
2244
- 
2277
+
2245
  #define HEATER_BED_PIN 10 // BED
2278
  #define HEATER_BED_PIN 10 // BED
2246
- 
2279
+
2247
  #if TEMP_SENSOR_BED == -1
2280
  #if TEMP_SENSOR_BED == -1
2248
    #define TEMP_BED_PIN 8 // ANALOG NUMBERING
2281
    #define TEMP_BED_PIN 8 // ANALOG NUMBERING
2249
- #else 
2282
+ #else
2250
    #define TEMP_BED_PIN 14 // ANALOG NUMBERING
2283
    #define TEMP_BED_PIN 14 // ANALOG NUMBERING
2251
  #endif
2284
  #endif
2252
- 
2253
- #define BEEPER 64	
2254
- 
2255
- 
2285
+
2286
+ #define BEEPER 64
2287
+
2288
+
2256
  #define LCD_PINS_RS 14
2289
  #define LCD_PINS_RS 14
2257
  #define LCD_PINS_ENABLE 15
2290
  #define LCD_PINS_ENABLE 15
2258
  #define LCD_PINS_D4 30
2291
  #define LCD_PINS_D4 30
2259
  #define LCD_PINS_D5 31
2292
  #define LCD_PINS_D5 31
2260
  #define LCD_PINS_D6 32
2293
  #define LCD_PINS_D6 32
2261
  #define LCD_PINS_D7 33
2294
  #define LCD_PINS_D7 33
2262
- 
2263
- 
2295
+
2296
+
2264
  //buttons are directly attached using keypad
2297
  //buttons are directly attached using keypad
2265
  #define BTN_EN1 61
2298
  #define BTN_EN1 61
2266
  #define BTN_EN2 59
2299
  #define BTN_EN2 59
2267
  #define BTN_ENC 43 //the click
2300
  #define BTN_ENC 43 //the click
2268
- 
2301
+
2269
  #define BLEN_C 2
2302
  #define BLEN_C 2
2270
  #define BLEN_B 1
2303
  #define BLEN_B 1
2271
  #define BLEN_A 0
2304
  #define BLEN_A 0
2272
- 
2305
+
2273
  #define SDCARDDETECT -1	// Megatronics does not use this port
2306
  #define SDCARDDETECT -1	// Megatronics does not use this port
2274
- 
2307
+
2275
    //encoder rotation values
2308
    //encoder rotation values
2276
  #define encrot0 0
2309
  #define encrot0 0
2277
  #define encrot1 2
2310
  #define encrot1 2
2287
 ****************************************************************************************/
2320
 ****************************************************************************************/
2288
 #if MOTHERBOARD == 702
2321
 #if MOTHERBOARD == 702
2289
  #define KNOWN_BOARD 1
2322
  #define KNOWN_BOARD 1
2290
- 
2291
- 
2323
+
2324
+
2292
  #ifndef __AVR_ATmega1281__
2325
  #ifndef __AVR_ATmega1281__
2293
  #error Oops! Make sure you have 'Minitronics ' selected from the 'Tools -> Boards' menu.
2326
  #error Oops! Make sure you have 'Minitronics ' selected from the 'Tools -> Boards' menu.
2294
  #endif
2327
  #endif
2295
- 
2328
+
2296
  #define LARGE_FLASH        true
2329
  #define LARGE_FLASH        true
2297
- 
2330
+
2298
  #define X_STEP_PIN 48
2331
  #define X_STEP_PIN 48
2299
  #define X_DIR_PIN 47
2332
  #define X_DIR_PIN 47
2300
  #define X_ENABLE_PIN 49
2333
  #define X_ENABLE_PIN 49
2301
  #define X_MIN_PIN 5
2334
  #define X_MIN_PIN 5
2302
  #define X_MAX_PIN -1 //2 //Max endstops default to disabled "-1", set to commented value to enable.
2335
  #define X_MAX_PIN -1 //2 //Max endstops default to disabled "-1", set to commented value to enable.
2303
- 
2336
+
2304
  #define Y_STEP_PIN 39 // A6
2337
  #define Y_STEP_PIN 39 // A6
2305
  #define Y_DIR_PIN 40 // A0
2338
  #define Y_DIR_PIN 40 // A0
2306
  #define Y_ENABLE_PIN 38
2339
  #define Y_ENABLE_PIN 38
2307
  #define Y_MIN_PIN 2
2340
  #define Y_MIN_PIN 2
2308
  #define Y_MAX_PIN -1 //15
2341
  #define Y_MAX_PIN -1 //15
2309
- 
2342
+
2310
  #define Z_STEP_PIN 42 // A2
2343
  #define Z_STEP_PIN 42 // A2
2311
  #define Z_DIR_PIN 43 // A6
2344
  #define Z_DIR_PIN 43 // A6
2312
  #define Z_ENABLE_PIN 41 // A1
2345
  #define Z_ENABLE_PIN 41 // A1
2313
  #define Z_MIN_PIN 6
2346
  #define Z_MIN_PIN 6
2314
  #define Z_MAX_PIN -1
2347
  #define Z_MAX_PIN -1
2315
- 
2348
+
2316
  #define E0_STEP_PIN 45
2349
  #define E0_STEP_PIN 45
2317
  #define E0_DIR_PIN 44
2350
  #define E0_DIR_PIN 44
2318
  #define E0_ENABLE_PIN 27
2351
  #define E0_ENABLE_PIN 27
2319
- 
2352
+
2320
  #define E1_STEP_PIN 36
2353
  #define E1_STEP_PIN 36
2321
  #define E1_DIR_PIN 35
2354
  #define E1_DIR_PIN 35
2322
  #define E1_ENABLE_PIN 37
2355
  #define E1_ENABLE_PIN 37
2323
- 
2356
+
2324
  #define E2_STEP_PIN -1
2357
  #define E2_STEP_PIN -1
2325
  #define E2_DIR_PIN -1
2358
  #define E2_DIR_PIN -1
2326
  #define E2_ENABLE_PIN -1
2359
  #define E2_ENABLE_PIN -1
2327
- 
2360
+
2328
  #define SDPOWER -1
2361
  #define SDPOWER -1
2329
  #define SDSS 16
2362
  #define SDSS 16
2330
  #define LED_PIN 46
2363
  #define LED_PIN 46
2331
- 
2364
+
2332
  #define FAN_PIN 9
2365
  #define FAN_PIN 9
2333
  #define FAN2_PIN -1
2366
  #define FAN2_PIN -1
2334
  #define PS_ON_PIN -1
2367
  #define PS_ON_PIN -1
2335
  #define KILL_PIN -1
2368
  #define KILL_PIN -1
2336
- 
2369
+
2337
  #define HEATER_0_PIN 7 // EXTRUDER 1
2370
  #define HEATER_0_PIN 7 // EXTRUDER 1
2338
  #define HEATER_1_PIN 8 // EXTRUDER 2
2371
  #define HEATER_1_PIN 8 // EXTRUDER 2
2339
  #define HEATER_2_PIN -1
2372
  #define HEATER_2_PIN -1
2340
- 
2373
+
2341
 
2374
 
2342
  #define TEMP_0_PIN 7 // ANALOG NUMBERING
2375
  #define TEMP_0_PIN 7 // ANALOG NUMBERING
2343
  #define TEMP_1_PIN 6 // ANALOG NUMBERING
2376
  #define TEMP_1_PIN 6 // ANALOG NUMBERING
2344
  #define TEMP_2_PIN -1 // ANALOG NUMBERING
2377
  #define TEMP_2_PIN -1 // ANALOG NUMBERING
2345
- 
2378
+
2346
  #define HEATER_BED_PIN 3 // BED
2379
  #define HEATER_BED_PIN 3 // BED
2347
  #define TEMP_BED_PIN 6 // ANALOG NUMBERING
2380
  #define TEMP_BED_PIN 6 // ANALOG NUMBERING
2348
- 
2349
- #define BEEPER -1	
2350
- 
2351
- 
2381
+
2382
+ #define BEEPER -1
2383
+
2384
+
2352
  #define LCD_PINS_RS -1
2385
  #define LCD_PINS_RS -1
2353
  #define LCD_PINS_ENABLE -1
2386
  #define LCD_PINS_ENABLE -1
2354
  #define LCD_PINS_D4 -1
2387
  #define LCD_PINS_D4 -1
2355
  #define LCD_PINS_D5 -1
2388
  #define LCD_PINS_D5 -1
2356
  #define LCD_PINS_D6 -1
2389
  #define LCD_PINS_D6 -1
2357
  #define LCD_PINS_D7 -1
2390
  #define LCD_PINS_D7 -1
2358
- 
2359
- 
2391
+
2392
+
2360
  //buttons are directly attached using keypad
2393
  //buttons are directly attached using keypad
2361
  #define BTN_EN1 -1
2394
  #define BTN_EN1 -1
2362
  #define BTN_EN2 -1
2395
  #define BTN_EN2 -1
2363
  #define BTN_ENC -1 //the click
2396
  #define BTN_ENC -1 //the click
2364
- 
2397
+
2365
  #define BLEN_C 2
2398
  #define BLEN_C 2
2366
  #define BLEN_B 1
2399
  #define BLEN_B 1
2367
  #define BLEN_A 0
2400
  #define BLEN_A 0
2368
- 
2401
+
2369
  #define SDCARDDETECT -1	// Megatronics does not use this port
2402
  #define SDCARDDETECT -1	// Megatronics does not use this port
2370
- 
2403
+
2371
    //encoder rotation values
2404
    //encoder rotation values
2372
  #define encrot0 0
2405
  #define encrot0 0
2373
  #define encrot1 2
2406
  #define encrot1 2
2393
  #define X_STEP_PIN 14
2426
  #define X_STEP_PIN 14
2394
  #define X_DIR_PIN 15
2427
  #define X_DIR_PIN 15
2395
  #define X_ENABLE_PIN 24
2428
  #define X_ENABLE_PIN 24
2396
- 
2429
+
2397
  //X endstop
2430
  //X endstop
2398
  #define X_MIN_PIN 3
2431
  #define X_MIN_PIN 3
2399
  #define X_MAX_PIN -1
2432
  #define X_MAX_PIN -1
2406
  //Y endstop
2439
  //Y endstop
2407
  #define Y_MIN_PIN 2
2440
  #define Y_MIN_PIN 2
2408
  #define Y_MAX_PIN -1
2441
  #define Y_MAX_PIN -1
2409
- 
2442
+
2410
  //Z motor stepper
2443
  //Z motor stepper
2411
  #define Z_STEP_PIN 40
2444
  #define Z_STEP_PIN 40
2412
  #define Z_DIR_PIN 41
2445
  #define Z_DIR_PIN 41
2415
  //Z endstop
2448
  //Z endstop
2416
  #define Z_MIN_PIN 5
2449
  #define Z_MIN_PIN 5
2417
  #define Z_MAX_PIN -1
2450
  #define Z_MAX_PIN -1
2418
- 
2451
+
2419
  //Extruder 0 stepper
2452
  //Extruder 0 stepper
2420
  #define E0_STEP_PIN 26
2453
  #define E0_STEP_PIN 26
2421
  #define E0_DIR_PIN 28
2454
  #define E0_DIR_PIN 28
2442
  #define HEATER_BED_PIN 22
2475
  #define HEATER_BED_PIN 22
2443
  //Cheaptronic v1.0 hasent EXTRUDER 3
2476
  //Cheaptronic v1.0 hasent EXTRUDER 3
2444
  #define HEATER_2_PIN -1
2477
  #define HEATER_2_PIN -1
2445
- 
2478
+
2446
  //Temperature sensors
2479
  //Temperature sensors
2447
  #define TEMP_0_PIN 15
2480
  #define TEMP_0_PIN 15
2448
  #define TEMP_1_PIN 14
2481
  #define TEMP_1_PIN 14

Ładowanie…
Anuluj
Zapisz