Almost done trapezioidal model

This commit is contained in:
eddyem
2025-04-11 22:14:43 +03:00
parent 33d7800a62
commit 89d67fd95c
5 changed files with 246 additions and 27 deletions

View File

@@ -35,14 +35,11 @@ typedef enum{
typedef enum{
ST_STOP, // stopped
ST_ACC, // accelerated
ST_CONSTSPEED, // moving with constant speed
ST_DEC, // decelerated
ST_ERROR, // some error -> stop
ST_MOVE, // moving
ST_AMOUNT
} movestate_t;
typedef struct{
typedef struct{ // all values could be both as positive and negative
double coord;
double speed;
double accel;
@@ -59,10 +56,13 @@ typedef struct{
int (*calculate)(moveparam_t *target, double t); // calculate stages of traectory beginning from t
movestate_t (*proc_move)(moveparam_t *next, double t); // calculate next model point for time t
movestate_t (*get_state)(moveparam_t *cur); // get current moving state
void (*stop)(); // stop by ramp
void (*emergency_stop); // stop with highest acceleration
void (*stop)(double t); // stop by ramp
void (*emergency_stop)(double t); // stop with highest acceleration
double (*stoppedtime)(); // time when moving will ends
} movemodel_t;
extern double coord_tolerance;
double nanot();
movemodel_t *init_moving(ramptype_t type, limits_t *l);
int init_coordtol(double tolerance);