Tweaks. Seek rate updates when set. CCW arc full circle fix.

- Fixed a minor issue where the seek rates would not immediately be
used and only would after a reset. Should update live now.

- A full circle IJ offset CCW arc would not do anything. Fixed bug via
a simple if-then statement.

- Radius mode tweaks to check for negative value in sqrt() rather than
isnan() it. Error report updated to indicate what actually happened.
This commit is contained in:
Sonny Jeon
2012-11-10 12:49:33 -07:00
parent 978de77c2f
commit e6ad15b548
5 changed files with 19 additions and 14 deletions

View File

@ -105,8 +105,11 @@ void mc_arc(float *position, float *target, float *offset, uint8_t axis_0, uint8
// CCW angle between position and target from circle center. Only one atan2() trig computation required.
float angular_travel = atan2(r_axis0*rt_axis1-r_axis1*rt_axis0, r_axis0*rt_axis0+r_axis1*rt_axis1);
if (angular_travel < 0) { angular_travel += 2*M_PI; }
if (isclockwise) { angular_travel -= 2*M_PI; }
if (isclockwise) { // Correct atan2 output per direction
if (angular_travel >= 0) { angular_travel -= 2*M_PI; }
} else {
if (angular_travel <= 0) { angular_travel += 2*M_PI; }
}
float millimeters_of_travel = hypot(angular_travel*radius, fabs(linear_travel));
if (millimeters_of_travel == 0.0) { return; }