ソースを参照

Merge pull request #4464 from thinkyhead/rc_fix_steps_per_mm_handling

Account for DELTA in Planner::refresh_positioning
Scott Lahteine 8年前
コミット
c68ca95345
3個のファイルの変更9行の追加3行の削除
  1. 1
    0
      Marlin/Marlin.h
  2. 2
    2
      Marlin/Marlin_main.cpp
  3. 6
    1
      Marlin/planner.cpp

+ 1
- 0
Marlin/Marlin.h ファイルの表示

314
     void adjust_delta(float cartesian[3]);
314
     void adjust_delta(float cartesian[3]);
315
   #endif
315
   #endif
316
 #elif ENABLED(SCARA)
316
 #elif ENABLED(SCARA)
317
+  extern float delta[3];
317
   extern float axis_scaling[3];  // Build size scaling
318
   extern float axis_scaling[3];  // Build size scaling
318
   void inverse_kinematics(const float cartesian[3]);
319
   void inverse_kinematics(const float cartesian[3]);
319
   void forward_kinematics_SCARA(float f_scara[3]);
320
   void forward_kinematics_SCARA(float f_scara[3]);

+ 2
- 2
Marlin/Marlin_main.cpp ファイルの表示

456
   #define TOWER_2 Y_AXIS
456
   #define TOWER_2 Y_AXIS
457
   #define TOWER_3 Z_AXIS
457
   #define TOWER_3 Z_AXIS
458
 
458
 
459
-  float delta[3] = { 0 };
459
+  float delta[3];
460
   float cartesian_position[3] = { 0 };
460
   float cartesian_position[3] = { 0 };
461
   #define SIN_60 0.8660254037844386
461
   #define SIN_60 0.8660254037844386
462
   #define COS_60 0.5
462
   #define COS_60 0.5
489
 
489
 
490
 #if ENABLED(SCARA)
490
 #if ENABLED(SCARA)
491
   float delta_segments_per_second = SCARA_SEGMENTS_PER_SECOND;
491
   float delta_segments_per_second = SCARA_SEGMENTS_PER_SECOND;
492
-  static float delta[3] = { 0 };
492
+  float delta[3];
493
   float axis_scaling[3] = { 1, 1, 1 };    // Build size scaling, default to 1
493
   float axis_scaling[3] = { 1, 1, 1 };    // Build size scaling, default to 1
494
 #endif
494
 #endif
495
 
495
 

+ 6
- 1
Marlin/planner.cpp ファイルの表示

1183
 // Recalculate position, steps_to_mm if axis_steps_per_mm changes!
1183
 // Recalculate position, steps_to_mm if axis_steps_per_mm changes!
1184
 void Planner::refresh_positioning() {
1184
 void Planner::refresh_positioning() {
1185
   LOOP_XYZE(i) planner.steps_to_mm[i] = 1.0 / planner.axis_steps_per_mm[i];
1185
   LOOP_XYZE(i) planner.steps_to_mm[i] = 1.0 / planner.axis_steps_per_mm[i];
1186
-  set_position_mm(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
1186
+  #if ENABLED(DELTA) || ENABLED(SCARA)
1187
+    inverse_kinematics(current_position);
1188
+    set_position_mm(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS]);
1189
+  #else
1190
+    set_position_mm(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
1191
+  #endif
1187
   reset_acceleration_rates();
1192
   reset_acceleration_rates();
1188
 }
1193
 }
1189
 
1194
 

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