Browse Source

Update motion_control.cpp

G03 Full circle did not work (G02 is working correct)
Aldert 9 years ago
parent
commit
d1e4237e1d
1 changed files with 8 additions and 0 deletions
  1. 8
    0
      Marlin/motion_control.cpp

+ 8
- 0
Marlin/motion_control.cpp View File

@@ -44,6 +44,14 @@ void mc_arc(float *position, float *target, float *offset, uint8_t axis_0, uint8
44 44
   if (angular_travel < 0) { angular_travel += 2*M_PI; }
45 45
   if (isclockwise) { angular_travel -= 2*M_PI; }
46 46
   
47
+  //20141002:full circle for G03 did not work, e.g. G03 X80 Y80 I20 J0 F2000 is giving an Angle of zero so head is not moving
48
+  //to compensate when start pos = target pos && angle is zero -> angle = 2Pi
49
+  if (position[axis_0] == target[axis_0] && position[axis_1] == target[axis_1] && angular_travel == 0)
50
+  {
51
+	  angular_travel += 2*M_PI;
52
+  }
53
+  //end fix G03
54
+  
47 55
   float millimeters_of_travel = hypot(angular_travel*radius, fabs(linear_travel));
48 56
   if (millimeters_of_travel < 0.001) { return; }
49 57
   uint16_t segments = floor(millimeters_of_travel/MM_PER_ARC_SEGMENT);

Loading…
Cancel
Save