Skip to content

Commit

Permalink
Update motion_control.cpp
Browse files Browse the repository at this point in the history
G03 Full circle did not work (G02 is working correct)
  • Loading branch information
Aldert committed Oct 4, 2014
1 parent cb4a6dd commit d1e4237
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Marlin/motion_control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ void mc_arc(float *position, float *target, float *offset, uint8_t axis_0, uint8
if (angular_travel < 0) { angular_travel += 2*M_PI; }
if (isclockwise) { angular_travel -= 2*M_PI; }

//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
//to compensate when start pos = target pos && angle is zero -> angle = 2Pi
if (position[axis_0] == target[axis_0] && position[axis_1] == target[axis_1] && angular_travel == 0)
{
angular_travel += 2*M_PI;
}
//end fix G03

float millimeters_of_travel = hypot(angular_travel*radius, fabs(linear_travel));
if (millimeters_of_travel < 0.001) { return; }
uint16_t segments = floor(millimeters_of_travel/MM_PER_ARC_SEGMENT);
Expand Down

0 comments on commit d1e4237

Please sign in to comment.