Browse Source

Use a, b, c instead of lx, ly, lz

Scott Lahteine 8 years ago
parent
commit
c5cac486f5
5 changed files with 116 additions and 111 deletions
  1. 1
    2
      Marlin/Marlin_main.cpp
  2. 80
    79
      Marlin/planner.cpp
  3. 17
    12
      Marlin/planner.h
  4. 15
    15
      Marlin/stepper.cpp
  5. 3
    3
      Marlin/stepper.h

+ 1
- 2
Marlin/Marlin_main.cpp View File

6892
     KEEPALIVE_STATE(IN_HANDLER);
6892
     KEEPALIVE_STATE(IN_HANDLER);
6893
 
6893
 
6894
     // Set extruder to saved position
6894
     // Set extruder to saved position
6895
-    current_position[E_AXIS] = lastpos[E_AXIS];
6896
-    destination[E_AXIS] = lastpos[E_AXIS];
6895
+    destination[E_AXIS] = current_position[E_AXIS] = lastpos[E_AXIS];
6897
     planner.set_e_position_mm(current_position[E_AXIS]);
6896
     planner.set_e_position_mm(current_position[E_AXIS]);
6898
 
6897
 
6899
     #if IS_KINEMATIC
6898
     #if IS_KINEMATIC

+ 80
- 79
Marlin/planner.cpp View File

594
  * Planner::_buffer_line
594
  * Planner::_buffer_line
595
  *
595
  *
596
  * Add a new linear movement to the buffer.
596
  * Add a new linear movement to the buffer.
597
- * Not apply the leveling.
598
  *
597
  *
599
- *  x,y,z,e   - target position in mm
600
- *  fr_mm_s   - (target) speed of the move
601
- *  extruder  - target extruder
598
+ * Leveling and kinematics should be applied ahead of calling this.
599
+ *
600
+ *  a,b,c,e     - target positions in mm or degrees
601
+ *  fr_mm_s     - (target) speed of the move
602
+ *  extruder    - target extruder
602
  */
603
  */
603
-void Planner::_buffer_line(const float &lx, const float &ly, const float &lz, const float &e, float fr_mm_s, const uint8_t extruder) {
604
+void Planner::_buffer_line(const float &a, const float &b, const float &c, const float &e, float fr_mm_s, const uint8_t extruder) {
604
   // Calculate the buffer head after we push this byte
605
   // Calculate the buffer head after we push this byte
605
   int next_buffer_head = next_block_index(block_buffer_head);
606
   int next_buffer_head = next_block_index(block_buffer_head);
606
 
607
 
611
   // The target position of the tool in absolute steps
612
   // The target position of the tool in absolute steps
612
   // Calculate target position in absolute steps
613
   // Calculate target position in absolute steps
613
   //this should be done after the wait, because otherwise a M92 code within the gcode disrupts this calculation somehow
614
   //this should be done after the wait, because otherwise a M92 code within the gcode disrupts this calculation somehow
614
-  long target[NUM_AXIS] = {
615
-    lround(lx * axis_steps_per_mm[X_AXIS]),
616
-    lround(ly * axis_steps_per_mm[Y_AXIS]),
617
-    lround(lz * axis_steps_per_mm[Z_AXIS]),
615
+  long target[XYZE] = {
616
+    lround(a * axis_steps_per_mm[X_AXIS]),
617
+    lround(b * axis_steps_per_mm[Y_AXIS]),
618
+    lround(c * axis_steps_per_mm[Z_AXIS]),
618
     lround(e * axis_steps_per_mm[E_AXIS])
619
     lround(e * axis_steps_per_mm[E_AXIS])
619
   };
620
   };
620
 
621
 
621
-  long dx = target[X_AXIS] - position[X_AXIS],
622
-       dy = target[Y_AXIS] - position[Y_AXIS],
623
-       dz = target[Z_AXIS] - position[Z_AXIS];
622
+  long da = target[X_AXIS] - position[X_AXIS],
623
+       db = target[Y_AXIS] - position[Y_AXIS],
624
+       dc = target[Z_AXIS] - position[Z_AXIS];
624
 
625
 
625
   /*
626
   /*
626
   SERIAL_ECHOPAIR("  Planner FR:", fr_mm_s);
627
   SERIAL_ECHOPAIR("  Planner FR:", fr_mm_s);
627
   SERIAL_CHAR(' ');
628
   SERIAL_CHAR(' ');
628
   #if IS_KINEMATIC
629
   #if IS_KINEMATIC
629
-    SERIAL_ECHOPAIR("A:", lx);
630
-    SERIAL_ECHOPAIR(" (", dx);
631
-    SERIAL_ECHOPAIR(") B:", ly);
630
+    SERIAL_ECHOPAIR("A:", a);
631
+    SERIAL_ECHOPAIR(" (", da);
632
+    SERIAL_ECHOPAIR(") B:", b);
632
   #else
633
   #else
633
-    SERIAL_ECHOPAIR("X:", lx);
634
-    SERIAL_ECHOPAIR(" (", dx);
635
-    SERIAL_ECHOPAIR(") Y:", ly);
634
+    SERIAL_ECHOPAIR("X:", a);
635
+    SERIAL_ECHOPAIR(" (", da);
636
+    SERIAL_ECHOPAIR(") Y:", b);
636
   #endif
637
   #endif
637
-  SERIAL_ECHOPAIR(" (", dy);
638
+  SERIAL_ECHOPAIR(" (", db);
638
   #if ENABLED(DELTA)
639
   #if ENABLED(DELTA)
639
-    SERIAL_ECHOPAIR(") C:", lz);
640
+    SERIAL_ECHOPAIR(") C:", c);
640
   #else
641
   #else
641
-    SERIAL_ECHOPAIR(") Z:", lz);
642
+    SERIAL_ECHOPAIR(") Z:", c);
642
   #endif
643
   #endif
643
-  SERIAL_ECHOPAIR(" (", dz);
644
+  SERIAL_ECHOPAIR(" (", dc);
644
   SERIAL_CHAR(')');
645
   SERIAL_CHAR(')');
645
   SERIAL_EOL;
646
   SERIAL_EOL;
646
   //*/
647
   //*/
679
   #if ENABLED(COREXY)
680
   #if ENABLED(COREXY)
680
     // corexy planning
681
     // corexy planning
681
     // these equations follow the form of the dA and dB equations on http://www.corexy.com/theory.html
682
     // these equations follow the form of the dA and dB equations on http://www.corexy.com/theory.html
682
-    block->steps[A_AXIS] = labs(dx + dy);
683
-    block->steps[B_AXIS] = labs(dx - dy);
684
-    block->steps[Z_AXIS] = labs(dz);
683
+    block->steps[A_AXIS] = labs(da + db);
684
+    block->steps[B_AXIS] = labs(da - db);
685
+    block->steps[Z_AXIS] = labs(dc);
685
   #elif ENABLED(COREXZ)
686
   #elif ENABLED(COREXZ)
686
     // corexz planning
687
     // corexz planning
687
-    block->steps[A_AXIS] = labs(dx + dz);
688
-    block->steps[Y_AXIS] = labs(dy);
689
-    block->steps[C_AXIS] = labs(dx - dz);
688
+    block->steps[A_AXIS] = labs(da + dc);
689
+    block->steps[Y_AXIS] = labs(db);
690
+    block->steps[C_AXIS] = labs(da - dc);
690
   #elif ENABLED(COREYZ)
691
   #elif ENABLED(COREYZ)
691
     // coreyz planning
692
     // coreyz planning
692
-    block->steps[X_AXIS] = labs(dx);
693
-    block->steps[B_AXIS] = labs(dy + dz);
694
-    block->steps[C_AXIS] = labs(dy - dz);
693
+    block->steps[X_AXIS] = labs(da);
694
+    block->steps[B_AXIS] = labs(db + dc);
695
+    block->steps[C_AXIS] = labs(db - dc);
695
   #else
696
   #else
696
     // default non-h-bot planning
697
     // default non-h-bot planning
697
-    block->steps[X_AXIS] = labs(dx);
698
-    block->steps[Y_AXIS] = labs(dy);
699
-    block->steps[Z_AXIS] = labs(dz);
698
+    block->steps[X_AXIS] = labs(da);
699
+    block->steps[Y_AXIS] = labs(db);
700
+    block->steps[Z_AXIS] = labs(dc);
700
   #endif
701
   #endif
701
 
702
 
702
   block->steps[E_AXIS] = labs(de) * volumetric_multiplier[extruder] * flow_percentage[extruder] * 0.01 + 0.5;
703
   block->steps[E_AXIS] = labs(de) * volumetric_multiplier[extruder] * flow_percentage[extruder] * 0.01 + 0.5;
720
     block->e_to_p_pressure = baricuda_e_to_p_pressure;
721
     block->e_to_p_pressure = baricuda_e_to_p_pressure;
721
   #endif
722
   #endif
722
 
723
 
723
-  // Compute direction bits for this block
724
-  uint8_t db = 0;
724
+  // Compute direction bit-mask for this block
725
+  uint8_t dm = 0;
725
   #if ENABLED(COREXY)
726
   #if ENABLED(COREXY)
726
-    if (dx < 0) SBI(db, X_HEAD); // Save the real Extruder (head) direction in X Axis
727
-    if (dy < 0) SBI(db, Y_HEAD); // ...and Y
728
-    if (dz < 0) SBI(db, Z_AXIS);
729
-    if (dx + dy < 0) SBI(db, A_AXIS); // Motor A direction
730
-    if (dx - dy < 0) SBI(db, B_AXIS); // Motor B direction
727
+    if (da < 0) SBI(dm, X_HEAD); // Save the real Extruder (head) direction in X Axis
728
+    if (db < 0) SBI(dm, Y_HEAD); // ...and Y
729
+    if (dc < 0) SBI(dm, Z_AXIS);
730
+    if (da + db < 0) SBI(dm, A_AXIS); // Motor A direction
731
+    if (da - db < 0) SBI(dm, B_AXIS); // Motor B direction
731
   #elif ENABLED(COREXZ)
732
   #elif ENABLED(COREXZ)
732
-    if (dx < 0) SBI(db, X_HEAD); // Save the real Extruder (head) direction in X Axis
733
-    if (dy < 0) SBI(db, Y_AXIS);
734
-    if (dz < 0) SBI(db, Z_HEAD); // ...and Z
735
-    if (dx + dz < 0) SBI(db, A_AXIS); // Motor A direction
736
-    if (dx - dz < 0) SBI(db, C_AXIS); // Motor C direction
733
+    if (da < 0) SBI(dm, X_HEAD); // Save the real Extruder (head) direction in X Axis
734
+    if (db < 0) SBI(dm, Y_AXIS);
735
+    if (dc < 0) SBI(dm, Z_HEAD); // ...and Z
736
+    if (da + dc < 0) SBI(dm, A_AXIS); // Motor A direction
737
+    if (da - dc < 0) SBI(dm, C_AXIS); // Motor C direction
737
   #elif ENABLED(COREYZ)
738
   #elif ENABLED(COREYZ)
738
-    if (dx < 0) SBI(db, X_AXIS);
739
-    if (dy < 0) SBI(db, Y_HEAD); // Save the real Extruder (head) direction in Y Axis
740
-    if (dz < 0) SBI(db, Z_HEAD); // ...and Z
741
-    if (dy + dz < 0) SBI(db, B_AXIS); // Motor B direction
742
-    if (dy - dz < 0) SBI(db, C_AXIS); // Motor C direction
739
+    if (da < 0) SBI(dm, X_AXIS);
740
+    if (db < 0) SBI(dm, Y_HEAD); // Save the real Extruder (head) direction in Y Axis
741
+    if (dc < 0) SBI(dm, Z_HEAD); // ...and Z
742
+    if (db + dc < 0) SBI(dm, B_AXIS); // Motor B direction
743
+    if (db - dc < 0) SBI(dm, C_AXIS); // Motor C direction
743
   #else
744
   #else
744
-    if (dx < 0) SBI(db, X_AXIS);
745
-    if (dy < 0) SBI(db, Y_AXIS);
746
-    if (dz < 0) SBI(db, Z_AXIS);
745
+    if (da < 0) SBI(dm, X_AXIS);
746
+    if (db < 0) SBI(dm, Y_AXIS);
747
+    if (dc < 0) SBI(dm, Z_AXIS);
747
   #endif
748
   #endif
748
-  if (de < 0) SBI(db, E_AXIS);
749
-  block->direction_bits = db;
749
+  if (de < 0) SBI(dm, E_AXIS);
750
+  block->direction_bits = dm;
750
 
751
 
751
   block->active_extruder = extruder;
752
   block->active_extruder = extruder;
752
 
753
 
859
   #if ENABLED(COREXY) || ENABLED(COREXZ) || ENABLED(COREYZ)
860
   #if ENABLED(COREXY) || ENABLED(COREXZ) || ENABLED(COREYZ)
860
     float delta_mm[7];
861
     float delta_mm[7];
861
     #if ENABLED(COREXY)
862
     #if ENABLED(COREXY)
862
-      delta_mm[X_HEAD] = dx * steps_to_mm[A_AXIS];
863
-      delta_mm[Y_HEAD] = dy * steps_to_mm[B_AXIS];
864
-      delta_mm[Z_AXIS] = dz * steps_to_mm[Z_AXIS];
865
-      delta_mm[A_AXIS] = (dx + dy) * steps_to_mm[A_AXIS];
866
-      delta_mm[B_AXIS] = (dx - dy) * steps_to_mm[B_AXIS];
863
+      delta_mm[X_HEAD] = da * steps_to_mm[A_AXIS];
864
+      delta_mm[Y_HEAD] = db * steps_to_mm[B_AXIS];
865
+      delta_mm[Z_AXIS] = dc * steps_to_mm[Z_AXIS];
866
+      delta_mm[A_AXIS] = (da + db) * steps_to_mm[A_AXIS];
867
+      delta_mm[B_AXIS] = (da - db) * steps_to_mm[B_AXIS];
867
     #elif ENABLED(COREXZ)
868
     #elif ENABLED(COREXZ)
868
-      delta_mm[X_HEAD] = dx * steps_to_mm[A_AXIS];
869
-      delta_mm[Y_AXIS] = dy * steps_to_mm[Y_AXIS];
870
-      delta_mm[Z_HEAD] = dz * steps_to_mm[C_AXIS];
871
-      delta_mm[A_AXIS] = (dx + dz) * steps_to_mm[A_AXIS];
872
-      delta_mm[C_AXIS] = (dx - dz) * steps_to_mm[C_AXIS];
869
+      delta_mm[X_HEAD] = da * steps_to_mm[A_AXIS];
870
+      delta_mm[Y_AXIS] = db * steps_to_mm[Y_AXIS];
871
+      delta_mm[Z_HEAD] = dc * steps_to_mm[C_AXIS];
872
+      delta_mm[A_AXIS] = (da + dc) * steps_to_mm[A_AXIS];
873
+      delta_mm[C_AXIS] = (da - dc) * steps_to_mm[C_AXIS];
873
     #elif ENABLED(COREYZ)
874
     #elif ENABLED(COREYZ)
874
-      delta_mm[X_AXIS] = dx * steps_to_mm[X_AXIS];
875
-      delta_mm[Y_HEAD] = dy * steps_to_mm[B_AXIS];
876
-      delta_mm[Z_HEAD] = dz * steps_to_mm[C_AXIS];
877
-      delta_mm[B_AXIS] = (dy + dz) * steps_to_mm[B_AXIS];
878
-      delta_mm[C_AXIS] = (dy - dz) * steps_to_mm[C_AXIS];
875
+      delta_mm[X_AXIS] = da * steps_to_mm[X_AXIS];
876
+      delta_mm[Y_HEAD] = db * steps_to_mm[B_AXIS];
877
+      delta_mm[Z_HEAD] = dc * steps_to_mm[C_AXIS];
878
+      delta_mm[B_AXIS] = (db + dc) * steps_to_mm[B_AXIS];
879
+      delta_mm[C_AXIS] = (db - dc) * steps_to_mm[C_AXIS];
879
     #endif
880
     #endif
880
   #else
881
   #else
881
     float delta_mm[4];
882
     float delta_mm[4];
882
-    delta_mm[X_AXIS] = dx * steps_to_mm[X_AXIS];
883
-    delta_mm[Y_AXIS] = dy * steps_to_mm[Y_AXIS];
884
-    delta_mm[Z_AXIS] = dz * steps_to_mm[Z_AXIS];
883
+    delta_mm[X_AXIS] = da * steps_to_mm[X_AXIS];
884
+    delta_mm[Y_AXIS] = db * steps_to_mm[Y_AXIS];
885
+    delta_mm[Z_AXIS] = dc * steps_to_mm[Z_AXIS];
885
   #endif
886
   #endif
886
   delta_mm[E_AXIS] = 0.01 * (de * steps_to_mm[E_AXIS]) * volumetric_multiplier[extruder] * flow_percentage[extruder];
887
   delta_mm[E_AXIS] = 0.01 * (de * steps_to_mm[E_AXIS]) * volumetric_multiplier[extruder] * flow_percentage[extruder];
887
 
888
 
1184
  * On CORE machines stepper ABC will be translated from the given XYZ.
1185
  * On CORE machines stepper ABC will be translated from the given XYZ.
1185
  */
1186
  */
1186
 
1187
 
1187
-void Planner::_set_position_mm(const float &lx, const float &ly, const float &lz, const float &e) {
1188
-  long nx = position[X_AXIS] = lround(lx * axis_steps_per_mm[X_AXIS]),
1189
-       ny = position[Y_AXIS] = lround(ly * axis_steps_per_mm[Y_AXIS]),
1190
-       nz = position[Z_AXIS] = lround(lz * axis_steps_per_mm[Z_AXIS]),
1188
+void Planner::_set_position_mm(const float &a, const float &b, const float &c, const float &e) {
1189
+  long na = position[X_AXIS] = lround(a * axis_steps_per_mm[X_AXIS]),
1190
+       nb = position[Y_AXIS] = lround(b * axis_steps_per_mm[Y_AXIS]),
1191
+       nc = position[Z_AXIS] = lround(c * axis_steps_per_mm[Z_AXIS]),
1191
        ne = position[E_AXIS] = lround(e * axis_steps_per_mm[E_AXIS]);
1192
        ne = position[E_AXIS] = lround(e * axis_steps_per_mm[E_AXIS]);
1192
-  stepper.set_position(nx, ny, nz, ne);
1193
+  stepper.set_position(na, nb, nc, ne);
1193
   previous_nominal_speed = 0.0; // Resets planner junction speeds. Assumes start from rest.
1194
   previous_nominal_speed = 0.0; // Resets planner junction speeds. Assumes start from rest.
1194
 
1195
 
1195
   memset(previous_speed, 0, sizeof(previous_speed));
1196
   memset(previous_speed, 0, sizeof(previous_speed));

+ 17
- 12
Marlin/planner.h View File

232
     /**
232
     /**
233
      * Planner::_buffer_line
233
      * Planner::_buffer_line
234
      *
234
      *
235
-     * Add a new linear movement to the buffer.
236
-     * Doesn't apply the leveling.
235
+     * Add a new direct linear movement to the buffer.
236
+     *
237
+     * Leveling and kinematics should be applied ahead of this.
237
      *
238
      *
238
-     *  x,y,z,e   - target position in mm
239
-     *  fr_mm_s   - (target) speed of the move
239
+     *  a,b,c,e   - target position in mm or degrees
240
+     *  fr_mm_s   - (target) speed of the move (mm/s)
240
      *  extruder  - target extruder
241
      *  extruder  - target extruder
241
      */
242
      */
242
-    static void _buffer_line(const float &lx, const float &ly, const float &lz, const float &e, float fr_mm_s, const uint8_t extruder);
243
+    static void _buffer_line(const float &a, const float &b, const float &c, const float &e, float fr_mm_s, const uint8_t extruder);
243
 
244
 
244
-    static void _set_position_mm(const float &lx, const float &ly, const float &lz, const float &e);
245
+    static void _set_position_mm(const float &a, const float &b, const float &c, const float &e);
245
 
246
 
246
     /**
247
     /**
247
      * Add a new linear movement to the buffer.
248
      * Add a new linear movement to the buffer.
248
      * The target is NOT translated to delta/scara
249
      * The target is NOT translated to delta/scara
249
      *
250
      *
250
-     *  x,y,z,e   - target position in mm
251
-     *  fr_mm_s   - (target) speed of the move (mm/s)
252
-     *  extruder  - target extruder
251
+     * Leveling will be applied to input on cartesians.
252
+     * Kinematic machines should call buffer_line_kinematic (for leveled moves).
253
+     * (Cartesians may also call buffer_line_kinematic.)
254
+     *
255
+     *  lx,ly,lz,e   - target position in mm or degrees
256
+     *  fr_mm_s      - (target) speed of the move (mm/s)
257
+     *  extruder     - target extruder
253
      */
258
      */
254
     static FORCE_INLINE void buffer_line(ARG_X, ARG_Y, ARG_Z, const float &e, float fr_mm_s, const uint8_t extruder) {
259
     static FORCE_INLINE void buffer_line(ARG_X, ARG_Y, ARG_Z, const float &e, float fr_mm_s, const uint8_t extruder) {
255
-      #if PLANNER_LEVELING && ! IS_KINEMATIC
260
+      #if PLANNER_LEVELING && IS_CARTESIAN
256
         apply_leveling(lx, ly, lz);
261
         apply_leveling(lx, ly, lz);
257
       #endif
262
       #endif
258
       _buffer_line(lx, ly, lz, e, fr_mm_s, extruder);
263
       _buffer_line(lx, ly, lz, e, fr_mm_s, extruder);
267
      *  fr_mm_s  - (target) speed of the move (mm/s)
272
      *  fr_mm_s  - (target) speed of the move (mm/s)
268
      *  extruder - target extruder
273
      *  extruder - target extruder
269
      */
274
      */
270
-     static FORCE_INLINE void buffer_line_kinematic(const float target[NUM_AXIS], float fr_mm_s, const uint8_t extruder) {
275
+    static FORCE_INLINE void buffer_line_kinematic(const float target[XYZE], float fr_mm_s, const uint8_t extruder) {
271
       #if PLANNER_LEVELING
276
       #if PLANNER_LEVELING
272
         float pos[XYZ] = { target[X_AXIS], target[Y_AXIS], target[Z_AXIS] };
277
         float pos[XYZ] = { target[X_AXIS], target[Y_AXIS], target[Z_AXIS] };
273
         apply_leveling(pos);
278
         apply_leveling(pos);
292
      * Clears previous speed values.
297
      * Clears previous speed values.
293
      */
298
      */
294
     static FORCE_INLINE void set_position_mm(ARG_X, ARG_Y, ARG_Z, const float &e) {
299
     static FORCE_INLINE void set_position_mm(ARG_X, ARG_Y, ARG_Z, const float &e) {
295
-      #if PLANNER_LEVELING && ! IS_KINEMATIC
300
+      #if PLANNER_LEVELING && IS_CARTESIAN
296
         apply_leveling(lx, ly, lz);
301
         apply_leveling(lx, ly, lz);
297
       #endif
302
       #endif
298
       _set_position_mm(lx, ly, lz, e);
303
       _set_position_mm(lx, ly, lz, e);

+ 15
- 15
Marlin/stepper.cpp View File

953
  * This allows get_axis_position_mm to correctly
953
  * This allows get_axis_position_mm to correctly
954
  * derive the current XYZ position later on.
954
  * derive the current XYZ position later on.
955
  */
955
  */
956
-void Stepper::set_position(const long& x, const long& y, const long& z, const long& e) {
956
+void Stepper::set_position(const long &a, const long &b, const long &c, const long &e) {
957
 
957
 
958
   synchronize(); // Bad to set stepper counts in the middle of a move
958
   synchronize(); // Bad to set stepper counts in the middle of a move
959
 
959
 
962
   #if ENABLED(COREXY)
962
   #if ENABLED(COREXY)
963
     // corexy positioning
963
     // corexy positioning
964
     // these equations follow the form of the dA and dB equations on http://www.corexy.com/theory.html
964
     // these equations follow the form of the dA and dB equations on http://www.corexy.com/theory.html
965
-    count_position[A_AXIS] = x + y;
966
-    count_position[B_AXIS] = x - y;
967
-    count_position[Z_AXIS] = z;
965
+    count_position[A_AXIS] = a + b;
966
+    count_position[B_AXIS] = a - b;
967
+    count_position[Z_AXIS] = c;
968
   #elif ENABLED(COREXZ)
968
   #elif ENABLED(COREXZ)
969
     // corexz planning
969
     // corexz planning
970
-    count_position[A_AXIS] = x + z;
971
-    count_position[Y_AXIS] = y;
972
-    count_position[C_AXIS] = x - z;
970
+    count_position[A_AXIS] = a + c;
971
+    count_position[Y_AXIS] = b;
972
+    count_position[C_AXIS] = a - c;
973
   #elif ENABLED(COREYZ)
973
   #elif ENABLED(COREYZ)
974
     // coreyz planning
974
     // coreyz planning
975
-    count_position[X_AXIS] = x;
976
-    count_position[B_AXIS] = y + z;
977
-    count_position[C_AXIS] = y - z;
975
+    count_position[X_AXIS] = a;
976
+    count_position[B_AXIS] = y + c;
977
+    count_position[C_AXIS] = y - c;
978
   #else
978
   #else
979
     // default non-h-bot planning
979
     // default non-h-bot planning
980
-    count_position[X_AXIS] = x;
981
-    count_position[Y_AXIS] = y;
982
-    count_position[Z_AXIS] = z;
980
+    count_position[X_AXIS] = a;
981
+    count_position[Y_AXIS] = b;
982
+    count_position[Z_AXIS] = c;
983
   #endif
983
   #endif
984
 
984
 
985
   count_position[E_AXIS] = e;
985
   count_position[E_AXIS] = e;
986
   CRITICAL_SECTION_END;
986
   CRITICAL_SECTION_END;
987
 }
987
 }
988
 
988
 
989
-void Stepper::set_position(const AxisEnum &axis, const long& v) {
989
+void Stepper::set_position(const AxisEnum &axis, const long &v) {
990
   CRITICAL_SECTION_START;
990
   CRITICAL_SECTION_START;
991
   count_position[axis] = v;
991
   count_position[axis] = v;
992
   CRITICAL_SECTION_END;
992
   CRITICAL_SECTION_END;
993
 }
993
 }
994
 
994
 
995
-void Stepper::set_e_position(const long& e) {
995
+void Stepper::set_e_position(const long &e) {
996
   CRITICAL_SECTION_START;
996
   CRITICAL_SECTION_START;
997
   count_position[E_AXIS] = e;
997
   count_position[E_AXIS] = e;
998
   CRITICAL_SECTION_END;
998
   CRITICAL_SECTION_END;

+ 3
- 3
Marlin/stepper.h View File

188
     //
188
     //
189
     // Set the current position in steps
189
     // Set the current position in steps
190
     //
190
     //
191
-    static void set_position(const long& x, const long& y, const long& z, const long& e);
192
-    static void set_position(const AxisEnum& a, const long& v);
193
-    static void set_e_position(const long& e);
191
+    static void set_position(const long &a, const long &b, const long &c, const long &e);
192
+    static void set_position(const AxisEnum &a, const long &v);
193
+    static void set_e_position(const long &e);
194
 
194
 
195
     //
195
     //
196
     // Set direction bits for all steppers
196
     // Set direction bits for all steppers

Loading…
Cancel
Save