ソースを参照

hop_amount => current_hop

Scott Lahteine 6年前
コミット
0c01099f17
3個のファイルの変更12行の追加12行の削除
  1. 10
    10
      Marlin/src/feature/fwretract.cpp
  2. 1
    1
      Marlin/src/feature/fwretract.h
  3. 1
    1
      Marlin/src/module/motion.cpp

+ 10
- 10
Marlin/src/feature/fwretract.cpp ファイルの表示

54
       FWRetract::swap_retract_length,                // M207 W - G10 Swap Retract length
54
       FWRetract::swap_retract_length,                // M207 W - G10 Swap Retract length
55
       FWRetract::swap_retract_recover_length,        // M208 W - G11 Swap Recover length
55
       FWRetract::swap_retract_recover_length,        // M208 W - G11 Swap Recover length
56
       FWRetract::swap_retract_recover_feedrate_mm_s, // M208 R - G11 Swap Recover feedrate
56
       FWRetract::swap_retract_recover_feedrate_mm_s, // M208 R - G11 Swap Recover feedrate
57
-      FWRetract::hop_amount;
57
+      FWRetract::current_hop;
58
 
58
 
59
 void FWRetract::reset() {
59
 void FWRetract::reset() {
60
   autoretract_enabled = false;
60
   autoretract_enabled = false;
66
   swap_retract_length = RETRACT_LENGTH_SWAP;
66
   swap_retract_length = RETRACT_LENGTH_SWAP;
67
   swap_retract_recover_length = RETRACT_RECOVER_LENGTH_SWAP;
67
   swap_retract_recover_length = RETRACT_RECOVER_LENGTH_SWAP;
68
   swap_retract_recover_feedrate_mm_s = RETRACT_RECOVER_FEEDRATE_SWAP;
68
   swap_retract_recover_feedrate_mm_s = RETRACT_RECOVER_FEEDRATE_SWAP;
69
-  hop_amount = 0.0;
69
+  current_hop = 0.0;
70
 
70
 
71
   for (uint8_t i = 0; i < EXTRUDERS; ++i) {
71
   for (uint8_t i = 0; i < EXTRUDERS; ++i) {
72
     retracted[i] = false;
72
     retracted[i] = false;
96
   #endif
96
   #endif
97
 ) {
97
 ) {
98
 
98
 
99
-  static float hop_amount = 0.0;  // Total amount lifted, for use in recover
99
+  static float current_hop = 0.0;  // Total amount lifted, for use in recover
100
 
100
 
101
   // Prevent two retracts or recovers in a row
101
   // Prevent two retracts or recovers in a row
102
   if (retracted[active_extruder] == retracting) return;
102
   if (retracted[active_extruder] == retracting) return;
125
     }
125
     }
126
     SERIAL_ECHOLNPAIR("current_position[z] ", current_position[Z_AXIS]);
126
     SERIAL_ECHOLNPAIR("current_position[z] ", current_position[Z_AXIS]);
127
     SERIAL_ECHOLNPAIR("current_position[e] ", current_position[E_AXIS]);
127
     SERIAL_ECHOLNPAIR("current_position[e] ", current_position[E_AXIS]);
128
-    SERIAL_ECHOLNPAIR("hop_amount ", hop_amount);
128
+    SERIAL_ECHOLNPAIR("current_hop ", current_hop);
129
   //*/
129
   //*/
130
 
130
 
131
   const float old_feedrate_mm_s = feedrate_mm_s,
131
   const float old_feedrate_mm_s = feedrate_mm_s,
144
     prepare_move_to_destination();                        // set_current_to_destination
144
     prepare_move_to_destination();                        // set_current_to_destination
145
 
145
 
146
     // Is a Z hop set, and has the hop not yet been done?
146
     // Is a Z hop set, and has the hop not yet been done?
147
-    if (retract_zlift > 0.01 && !hop_amount) {            // Apply hop only once
148
-      hop_amount += retract_zlift;                        // Add to the hop total (again, only once)
147
+    if (retract_zlift > 0.01 && !current_hop) {           // Apply hop only once
148
+      current_hop += retract_zlift;                       // Add to the hop total (again, only once)
149
       destination[Z_AXIS] += retract_zlift;               // Raise Z by the zlift (M207 Z) amount
149
       destination[Z_AXIS] += retract_zlift;               // Raise Z by the zlift (M207 Z) amount
150
       feedrate_mm_s = planner.max_feedrate_mm_s[Z_AXIS];  // Maximum Z feedrate
150
       feedrate_mm_s = planner.max_feedrate_mm_s[Z_AXIS];  // Maximum Z feedrate
151
       prepare_move_to_destination();                      // Raise up, set_current_to_destination
151
       prepare_move_to_destination();                      // Raise up, set_current_to_destination
153
   }
153
   }
154
   else {
154
   else {
155
     // If a hop was done and Z hasn't changed, undo the Z hop
155
     // If a hop was done and Z hasn't changed, undo the Z hop
156
-    if (hop_amount) {
157
-      current_position[Z_AXIS] += hop_amount;             // Restore the actual Z position
156
+    if (current_hop) {
157
+      current_position[Z_AXIS] += current_hop;            // Restore the actual Z position
158
       SYNC_PLAN_POSITION_KINEMATIC();                     // Unspoof the position planner
158
       SYNC_PLAN_POSITION_KINEMATIC();                     // Unspoof the position planner
159
       feedrate_mm_s = planner.max_feedrate_mm_s[Z_AXIS];  // Z feedrate to max
159
       feedrate_mm_s = planner.max_feedrate_mm_s[Z_AXIS];  // Z feedrate to max
160
       prepare_move_to_destination();                      // Lower Z, set_current_to_destination
160
       prepare_move_to_destination();                      // Lower Z, set_current_to_destination
161
-      hop_amount = 0.0;                                   // Clear the hop amount
161
+      current_hop = 0.0;                                  // Clear the hop amount
162
     }
162
     }
163
 
163
 
164
     destination[E_AXIS] += (base_retract + (swapping ? swap_retract_recover_length : retract_recover_length)) * renormalize;
164
     destination[E_AXIS] += (base_retract + (swapping ? swap_retract_recover_length : retract_recover_length)) * renormalize;
192
     }
192
     }
193
     SERIAL_ECHOLNPAIR("current_position[z] ", current_position[Z_AXIS]);
193
     SERIAL_ECHOLNPAIR("current_position[z] ", current_position[Z_AXIS]);
194
     SERIAL_ECHOLNPAIR("current_position[e] ", current_position[E_AXIS]);
194
     SERIAL_ECHOLNPAIR("current_position[e] ", current_position[E_AXIS]);
195
-    SERIAL_ECHOLNPAIR("hop_amount ", hop_amount);
195
+    SERIAL_ECHOLNPAIR("current_hop ", current_hop);
196
   //*/
196
   //*/
197
 
197
 
198
 }
198
 }

+ 1
- 1
Marlin/src/feature/fwretract.h ファイルの表示

46
                swap_retract_length,                // M207 W - G10 Swap Retract length
46
                swap_retract_length,                // M207 W - G10 Swap Retract length
47
                swap_retract_recover_length,        // M208 W - G11 Swap Recover length
47
                swap_retract_recover_length,        // M208 W - G11 Swap Recover length
48
                swap_retract_recover_feedrate_mm_s, // M208 R - G11 Swap Recover feedrate
48
                swap_retract_recover_feedrate_mm_s, // M208 R - G11 Swap Recover feedrate
49
-               hop_amount;
49
+               current_hop;
50
 
50
 
51
   FWRetract() { reset(); }
51
   FWRetract() { reset(); }
52
 
52
 

+ 1
- 1
Marlin/src/module/motion.cpp ファイルの表示

1462
 
1462
 
1463
   // Clear retracted status if homing the Z axis
1463
   // Clear retracted status if homing the Z axis
1464
   #if ENABLED(FWRETRACT)
1464
   #if ENABLED(FWRETRACT)
1465
-    if (axis == Z_AXIS) fwretract.hop_amount = 0.0;
1465
+    if (axis == Z_AXIS) fwretract.current_hop = 0.0;
1466
   #endif
1466
   #endif
1467
 
1467
 
1468
   #if ENABLED(DEBUG_LEVELING_FEATURE)
1468
   #if ENABLED(DEBUG_LEVELING_FEATURE)

読み込み中…
キャンセル
保存