Browse Source

Add board MKS_BASE_HEROIC (#9926)

Followup to #9008

- Don't define micro-stepping pins for boards that lack them.
- Allow setting of 128 microsteps with `M350`.
Scott Lahteine 6 years ago
parent
commit
6d7f4f84e2
No account linked to committer's email address

+ 1
- 0
Marlin/src/core/boards.h View File

59
 #define BOARD_BAM_DICE          401   // 2PrintBeta BAM&DICE with STK drivers
59
 #define BOARD_BAM_DICE          401   // 2PrintBeta BAM&DICE with STK drivers
60
 #define BOARD_BAM_DICE_DUE      402   // 2PrintBeta BAM&DICE Due with STK drivers
60
 #define BOARD_BAM_DICE_DUE      402   // 2PrintBeta BAM&DICE Due with STK drivers
61
 #define BOARD_MKS_BASE          40    // MKS BASE 1.0
61
 #define BOARD_MKS_BASE          40    // MKS BASE 1.0
62
+#define BOARD_MKS_BASE_HEROIC   41    // MKS BASE 1.0 with Heroic HR4982 stepper drivers
62
 #define BOARD_MKS_13            47    // MKS v1.3 or 1.4 (maybe higher)
63
 #define BOARD_MKS_13            47    // MKS v1.3 or 1.4 (maybe higher)
63
 #define BOARD_MKS_GEN_L         53    // MKS GEN L
64
 #define BOARD_MKS_GEN_L         53    // MKS GEN L
64
 #define BOARD_ZRIB_V20          504   // zrib V2.0 control board (Chinese knock off RAMPS replica)
65
 #define BOARD_ZRIB_V20          504   // zrib V2.0 control board (Chinese knock off RAMPS replica)

+ 7
- 3
Marlin/src/inc/Conditionals_post.h View File

252
 
252
 
253
 // MS1 MS2 Stepper Driver Microstepping mode table
253
 // MS1 MS2 Stepper Driver Microstepping mode table
254
 #define MICROSTEP1 LOW,LOW
254
 #define MICROSTEP1 LOW,LOW
255
-#define MICROSTEP2 HIGH,LOW
256
-#define MICROSTEP4 LOW,HIGH
255
+#if ENABLED(HEROIC_STEPPER_DRIVERS)
256
+  #define MICROSTEP128 LOW,HIGH
257
+#else
258
+  #define MICROSTEP2 HIGH,LOW
259
+  #define MICROSTEP4 LOW,HIGH
260
+#endif
257
 #define MICROSTEP8 HIGH,HIGH
261
 #define MICROSTEP8 HIGH,HIGH
258
 #ifdef __SAM3X8E__
262
 #ifdef __SAM3X8E__
259
   #if MB(ALLIGATOR)
263
   #if MB(ALLIGATOR)
263
     #define MICROSTEP16 HIGH,HIGH
267
     #define MICROSTEP16 HIGH,HIGH
264
   #endif
268
   #endif
265
 #else
269
 #else
266
-#define MICROSTEP16 HIGH,HIGH
270
+  #define MICROSTEP16 HIGH,HIGH
267
 #endif
271
 #endif
268
 
272
 
269
 /**
273
 /**

+ 7
- 2
Marlin/src/module/stepper.cpp View File

1591
   void Stepper::microstep_mode(const uint8_t driver, const uint8_t stepping_mode) {
1591
   void Stepper::microstep_mode(const uint8_t driver, const uint8_t stepping_mode) {
1592
     switch (stepping_mode) {
1592
     switch (stepping_mode) {
1593
       case 1: microstep_ms(driver, MICROSTEP1); break;
1593
       case 1: microstep_ms(driver, MICROSTEP1); break;
1594
-      case 2: microstep_ms(driver, MICROSTEP2); break;
1595
-      case 4: microstep_ms(driver, MICROSTEP4); break;
1594
+      #if ENABLED(HEROIC_STEPPER_DRIVERS)
1595
+        case 128: microstep_ms(driver, MICROSTEP128); break;
1596
+      #else
1597
+        case 2: microstep_ms(driver, MICROSTEP2); break;
1598
+        case 4: microstep_ms(driver, MICROSTEP4); break;
1599
+      #endif
1596
       case 8: microstep_ms(driver, MICROSTEP8); break;
1600
       case 8: microstep_ms(driver, MICROSTEP8); break;
1597
       case 16: microstep_ms(driver, MICROSTEP16); break;
1601
       case 16: microstep_ms(driver, MICROSTEP16); break;
1598
       #if MB(ALLIGATOR)
1602
       #if MB(ALLIGATOR)
1599
         case 32: microstep_ms(driver, MICROSTEP32); break;
1603
         case 32: microstep_ms(driver, MICROSTEP32); break;
1600
       #endif
1604
       #endif
1605
+      default: SERIAL_ERROR_START(); SERIAL_ERRORLNPGM("Microsteps unavailable"); break;
1601
     }
1606
     }
1602
   }
1607
   }
1603
 
1608
 

+ 2
- 0
Marlin/src/pins/pins.h View File

102
   #include "pins_BAM_DICE_DUE.h"      // ATmega1280, ATmega2560
102
   #include "pins_BAM_DICE_DUE.h"      // ATmega1280, ATmega2560
103
 #elif MB(MKS_BASE)
103
 #elif MB(MKS_BASE)
104
   #include "pins_MKS_BASE.h"          // ATmega1280, ATmega2560
104
   #include "pins_MKS_BASE.h"          // ATmega1280, ATmega2560
105
+#elif MB(MKS_BASE_HEROIC)
106
+  #include "pins_MKS_BASE_HEROIC.h"   // ATmega1280, ATmega2560
105
 #elif MB(MKS_13)
107
 #elif MB(MKS_13)
106
   #include "pins_MKS_13.h"            // ATmega1280, ATmega2560
108
   #include "pins_MKS_13.h"            // ATmega1280, ATmega2560
107
 #elif MB(MKS_GEN_L)
109
 #elif MB(MKS_GEN_L)

+ 0
- 18
Marlin/src/pins/pins_MKS_BASE.h View File

32
 
32
 
33
 #define BOARD_NAME "MKS BASE 1.0"
33
 #define BOARD_NAME "MKS BASE 1.0"
34
 
34
 
35
-/* Microstepping pins (reverse engineered at V1.4 - due to closed source schematics)
36
-// Some new batches have the HR4982 (Heroic) instead of the A4982 (Allegro) as stepper driver. While most of the functionality is similar, the HR variant obviously doesn't work with diode smoothers (no fast decay)
37
-// But the Heroic has a 128 µStepping mode where the A4982 is doing quarter steps (MS1=L / MS2=H). To achieve comfortable tests with the M350/M351 commands, the following definitions have to made:
38
-// Example: M350 X4 Y4 ; Set X and Y Axis to quarterstep Mode to achieve MS1=0 and MS2=1
39
-// A new board with a HR4982 will now perform 128 µSteps per Fullstep
40
-// XSTEP,YSTEP ... must be adapted with M92 accordingly (128/16 => multiply by factor 8).
41
-*/
42
-#define X_MS1_PIN           5   // Digital 3  / Pin 5   / PE3
43
-#define X_MS2_PIN           6   // Digital 6  / Pin 14  / PH3
44
-#define Y_MS1_PIN           59  // Analog 5   / Pin 92  / PF5
45
-#define Y_MS2_PIN           58  // Analog 4   / Pin 93  / PF4
46
-#define Z_MS1_PIN           22  // Digital 22 / Pin 78  / PA0
47
-#define Z_MS2_PIN           39  // Digital 39 / Pin 70  / PG2
48
-#define E0_MS1_PIN          63  // Analog 9   / Pin 86  / PK1
49
-#define E0_MS2_PIN          64  // Analog 10  / Pin 87  / PK2
50
-#define E1_MS1_PIN          57  // Analog 3   / Pin 93  / PF3
51
-#define E1_MS2_PIN          4   // Digital 4  / Pin 1   / PG5
52
-
53
 //
35
 //
54
 // Heaters / Fans
36
 // Heaters / Fans
55
 //
37
 //

+ 46
- 0
Marlin/src/pins/pins_MKS_BASE_HEROIC.h View File

1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+
23
+/**
24
+ * MKS BASE with Heroic HR4982 stepper drivers
25
+ */
26
+
27
+#include "pins_MKS_BASE.h"
28
+
29
+/**
30
+ * Microstepping pins (reverse engineered at V1.4 - due to closed source schematics).
31
+ * Some new boards use HR4982 (Heroic) instead of the A4982 (Allegro) stepper drivers.
32
+ * While most of the functionality is similar, the HR variant obviously doesn't work
33
+ * with diode smoothers (no fast decay). And the Heroic has a 128 µStepping mode where
34
+ * the A4982 is doing quarter steps (MS1=L / MS2=H).
35
+ */
36
+#define HEROIC_STEPPER_DRIVERS
37
+#define X_MS1_PIN            5  // Digital 3  / Pin 5   / PE3  / SERVO2_PIN
38
+#define X_MS2_PIN            6  // Digital 6  / Pin 14  / PH3  / SERVO1_PIN
39
+#define Y_MS1_PIN           59  // Analog 5   / Pin 92  / PF5
40
+#define Y_MS2_PIN           58  // Analog 4   / Pin 93  / PF4
41
+#define Z_MS1_PIN           22  // Digital 22 / Pin 78  / PA0
42
+#define Z_MS2_PIN           39  // Digital 39 / Pin 70  / PG2
43
+#define E0_MS1_PIN          63  // Analog 9   / Pin 86  / PK1
44
+#define E0_MS2_PIN          64  // Analog 10  / Pin 87  / PK2
45
+#define E1_MS1_PIN          57  // Analog 3   / Pin 93  / PF3
46
+#define E1_MS2_PIN           4  // Digital 4  / Pin 1   / PG5  / SERVO3_PIN

Loading…
Cancel
Save