Przeglądaj źródła

Merge pull request #251 from ZetaPhoenix/Marlin_v1_bugfix

Limit Switch locations based on MIN/MAX limits and homing direction
ErikZalm 12 lat temu
rodzic
commit
0a31ccb1d1
2 zmienionych plików z 56 dodań i 4 usunięć
  1. 8
    4
      Marlin/Configuration.h
  2. 48
    0
      Marlin/Configuration_adv.h

+ 8
- 4
Marlin/Configuration.h Wyświetl plik

@@ -203,10 +203,14 @@ const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of th
203 203
 #define Y_MAX_LENGTH (Y_MAX_POS - Y_MIN_POS)
204 204
 #define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS)
205 205
 
206
-// The position of the homing switches. Use MAX_LENGTH * -0.5 if the center should be 0, 0, 0
207
-#define X_HOME_POS 0
208
-#define Y_HOME_POS 0
209
-#define Z_HOME_POS 0
206
+// The position of the homing switches
207
+//#define MANUAL_HOME_POSITIONS  // If defined, manualy programed locations will be used
208
+//#define BED_CENTER_AT_0_0  // If defined the center of the bed is defined as (0,0)
209
+
210
+//Manual homing switch locations:
211
+#define MANUAL_X_HOME_POS 0
212
+#define MANUAL_Y_HOME_POS 0
213
+#define MANUAL_Z_HOME_POS 0
210 214
 
211 215
 //// MOVEMENT SETTINGS
212 216
 #define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E

+ 48
- 0
Marlin/Configuration_adv.h Wyświetl plik

@@ -76,6 +76,54 @@
76 76
 
77 77
 #define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing
78 78
 
79
+
80
+//// AUTOSET LOCATIONS OF LIMIT SWITCHES
81
+//// Added by ZetaPhoenix 09-15-2012
82
+#ifdef MANUAL_HOME_POSITION  //Use manual limit switch locations
83
+  #define X_HOME_POS MANUAL_X_HOME_POS
84
+  #define Y_HOME_POS MANUAL_Y_HOME_POS
85
+  #define Z_HOME_POS MANUAL_Z_HOME_POS
86
+#else //Set min/max homing switch positions based upon homing direction and min/max travel limits
87
+  //X axis
88
+  #if X_HOME_DIR == -1
89
+    #ifdef BED_CENTER_AT_0_0
90
+      #define X_HOME_POS X_MAX_LENGTH * -0.5
91
+    #else
92
+      #define X_HOME_POS X_MIN_POS
93
+    #endif //BED_CENTER_AT_0_0
94
+  #else    
95
+    #ifdef BED_CENTER_AT_0_0
96
+      #define X_HOME_POS X_MAX_LENGTH * 0.5
97
+    #else
98
+      #define X_HOME_POS X_MAX_POS
99
+    #endif //BED_CENTER_AT_0_0
100
+  #endif //X_HOME_DIR == -1
101
+  
102
+  //Y axis
103
+  #if Y_HOME_DIR == -1
104
+    #ifdef BED_CENTER_AT_0_0
105
+      #define Y_HOME_POS Y_MAX_LENGTH * -0.5
106
+    #else
107
+      #define Y_HOME_POS Y_MIN_POS
108
+    #endif //BED_CENTER_AT_0_0
109
+  #else    
110
+    #ifdef BED_CENTER_AT_0_0
111
+      #define Y_HOME_POS Y_MAX_LENGTH * 0.5
112
+    #else
113
+      #define Y_HOME_POS Y_MAX_POS
114
+    #endif //BED_CENTER_AT_0_0
115
+  #endif //Y_HOME_DIR == -1
116
+  
117
+  // Z axis
118
+  #if Z_HOME_DIR == -1 //BED_CENTER_AT_0_0 not used
119
+    #define Z_HOME_POS Z_MIN_POS
120
+  #else    
121
+    #define Z_HOME_POS Z_MAX_POS
122
+  #endif //Z_HOME_DIR == -1
123
+#endif //End auto min/max positions
124
+//END AUTOSET LOCATIONS OF LIMIT SWITCHES -ZP
125
+
126
+
79 127
 //#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats.
80 128
 
81 129
 // A single Z stepper driver is usually used to drive 2 stepper motors.

Ładowanie…
Anuluj
Zapisz