Skip to content

Commit

Permalink
fixes #10 fixes #7
Browse files Browse the repository at this point in the history
  • Loading branch information
arhi committed Jun 30, 2018
1 parent dfb3082 commit 080a8b8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 4 additions & 3 deletions calcmove.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@ double calcmove(char * buffer, print_settings_t * print_settings){
static double oldy = 0;
static double oldz = 0;
static double olde = 0;
static double oldf = 0;
static double oldf = 1; //default feed rate = 1 overriden by first F in the code, //TODO: should be set from config, not hardcoded

static double oldxa = 0; //vector of previous movement
static double oldya = 0;
static double oldza = 0;

static double oldspeed = 0; //speed previous move ended (start speed for current move)


double ret;
double distance;
double costheta;
Expand Down Expand Up @@ -125,8 +126,8 @@ double calcmove(char * buffer, print_settings_t * print_settings){
speed = _MIN_(speed, sqrt( print_settings->accel * print_settings->jdev * sin_theta_d2 / (1.0 - sin_theta_d2)));
}
}
speed = _MIN_(speed, print_settings->x_maxspeed);
speed = _MIN_(speed, print_settings->y_maxspeed);
speed = _MIN_(speed, print_settings->x_maxspeed /60.0);
speed = _MIN_(speed, print_settings->y_maxspeed /60.0);

Ta = (f - oldspeed) / print_settings->accel; // time to reach speed from start speed (end speed of previous move)
Td = (f - speed) / print_settings->accel; // time to decelerate to "end speed" of current movement
Expand Down
5 changes: 4 additions & 1 deletion gcodestat.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ void print_usage() {
fprintf(stderr, "\t-d, --junction_deviation %f\tDefault Junction Deviation\n", DEFAULT_JUNCTION_DEVIATION);
fprintf(stderr, "\t-j, --jerk %f\t\t\tDefault jerk\n", DEFAULT_JERK);
fprintf(stderr, "\t-6, --heatup_time 0\t\t\tConstant time to add to result (seconds)\n");
fprintf(stderr, "\t-f, --max_feed %d\t\t\tMax feed\n", DEFAULT_MAX_SPEED);
fprintf(stderr, "\t-f, --max_feed %d\t\t\tMax feed in mm/min\n", DEFAULT_MAX_SPEED);
fprintf(stderr, "\t-x, --max_x_speed %d\t\t\tMax x speed in mm/min\n", DEFAULT_MAX_SPEED);
fprintf(stderr, "\t-y, --max_y_speed %d\t\t\tMax y speed in mm/min\n", DEFAULT_MAX_SPEED);
fprintf(stderr, "\t-z, --max_z_speed %d\t\t\tMax z speed in mm/min\n", DEFAULT_MAX_SPEED);
fprintf(stderr, "\t-r, --retract_time %f\t\tRetraction time in sec\n", DEFAULT_RETRACT_TIME);
fprintf(stderr, "\t-p, --prime_time %f\t\tPrime time in sec\n", DEFAULT_PRIME_TIME);
fprintf(stderr, "\t-s, --percent_step 10\t\t\tChange LCD data every ##%%\n");
Expand Down

0 comments on commit 080a8b8

Please sign in to comment.