Skip to content

Commit

Permalink
Correct/update some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dcnewman committed Apr 20, 2015
1 parent e68210a commit 6412dc5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/gpx/gpx.c
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ static Point5d mm_to_steps(Gpx *gpx, Ptr5d mm, Ptr2d excess)
static Point5d delta_mm(Gpx *gpx)
{
Point5d deltaMM;
// compute the relative distance traveled along each axis and convert to steps
// compute the relative distance traveled along each axis
if(gpx->command.flag & X_IS_SET) deltaMM.x = gpx->target.position.x - gpx->current.position.x; else deltaMM.x = 0;
if(gpx->command.flag & Y_IS_SET) deltaMM.y = gpx->target.position.y - gpx->current.position.y; else deltaMM.y = 0;
if(gpx->command.flag & Z_IS_SET) deltaMM.z = gpx->target.position.z - gpx->current.position.z; else deltaMM.z = 0;
Expand All @@ -671,7 +671,7 @@ static Point5d delta_mm(Gpx *gpx)
static Point5d delta_steps(Gpx *gpx,Point5d deltaMM)
{
Point5d deltaSteps;
// compute the relative distance traveled along each axis and convert to steps
// Convert the relative distance traveled along each axis from units of mm to steps
if(gpx->command.flag & X_IS_SET) deltaSteps.x = round(fabs(deltaMM.x) * gpx->machine.x.steps_per_mm); else deltaSteps.x = 0;
if(gpx->command.flag & Y_IS_SET) deltaSteps.y = round(fabs(deltaMM.y) * gpx->machine.y.steps_per_mm); else deltaSteps.y = 0;
if(gpx->command.flag & Z_IS_SET) deltaSteps.z = round(fabs(deltaMM.z) * gpx->machine.z.steps_per_mm); else deltaSteps.z = 0;
Expand Down Expand Up @@ -2072,11 +2072,16 @@ static int queue_ext_point(Gpx *gpx, double feedrate)

Point5d steps = mm_to_steps(gpx, &target, &gpx->excess);

// Total time required for the motion in units of microseconds
double usec = (60000000.0 * minutes);

// Time interval between steps along the axis with the highest step count
// total-time / highest-step-count
// Has units of microseconds per step
double dda_interval = usec / largest_axis(gpx->command.flag, &deltaSteps);

// Convert dda_interval into dda_rate (dda steps per second on the longest axis)
// steps-per-microsecond * 1000000 us/s = 1000000 * (1 / dda_interval)
double dda_rate = 1000000.0 / dda_interval;

gpx->accumulated.time += (minutes * 60) * ACCELERATION_TIME;
Expand Down

0 comments on commit 6412dc5

Please # to comment.