2018-06-09 02:55:24 +03:00
|
|
|
#ifndef ITERSOLVE_H
|
|
|
|
#define ITERSOLVE_H
|
|
|
|
|
2019-10-27 20:23:03 +03:00
|
|
|
#include <stdint.h> // int32_t
|
2018-06-09 02:55:24 +03:00
|
|
|
|
2019-10-28 04:05:57 +03:00
|
|
|
enum {
|
2019-12-10 23:53:50 +03:00
|
|
|
AF_X = 1 << 0, AF_Y = 1 << 1, AF_Z = 1 << 2,
|
2019-10-28 04:05:57 +03:00
|
|
|
};
|
|
|
|
|
2018-06-09 02:55:24 +03:00
|
|
|
struct stepper_kinematics;
|
2019-10-27 20:23:03 +03:00
|
|
|
struct move;
|
2019-10-27 18:06:46 +03:00
|
|
|
typedef double (*sk_calc_callback)(struct stepper_kinematics *sk, struct move *m
|
|
|
|
, double move_time);
|
2019-10-27 18:14:40 +03:00
|
|
|
typedef void (*sk_post_callback)(struct stepper_kinematics *sk);
|
2018-06-09 02:55:24 +03:00
|
|
|
struct stepper_kinematics {
|
|
|
|
double step_dist, commanded_pos;
|
|
|
|
struct stepcompress *sc;
|
2019-10-28 04:05:57 +03:00
|
|
|
|
2019-11-02 05:21:30 +03:00
|
|
|
double last_flush_time, last_move_time;
|
2019-10-28 04:05:57 +03:00
|
|
|
struct trapq *tq;
|
|
|
|
int active_flags;
|
2019-12-10 23:53:50 +03:00
|
|
|
double gen_steps_pre_active, gen_steps_post_active;
|
2019-10-28 04:05:57 +03:00
|
|
|
|
2019-10-27 18:06:46 +03:00
|
|
|
sk_calc_callback calc_position_cb;
|
2019-10-27 18:14:40 +03:00
|
|
|
sk_post_callback post_cb;
|
2018-06-09 02:55:24 +03:00
|
|
|
};
|
|
|
|
|
2019-10-28 04:05:57 +03:00
|
|
|
int32_t itersolve_generate_steps(struct stepper_kinematics *sk
|
|
|
|
, double flush_time);
|
|
|
|
double itersolve_check_active(struct stepper_kinematics *sk, double flush_time);
|
|
|
|
void itersolve_set_trapq(struct stepper_kinematics *sk, struct trapq *tq);
|
2018-06-09 02:55:24 +03:00
|
|
|
void itersolve_set_stepcompress(struct stepper_kinematics *sk
|
|
|
|
, struct stepcompress *sc, double step_dist);
|
2019-11-19 20:27:33 +03:00
|
|
|
double itersolve_calc_position_from_coord(struct stepper_kinematics *sk
|
|
|
|
, double x, double y, double z);
|
2019-11-14 02:58:51 +03:00
|
|
|
void itersolve_set_position(struct stepper_kinematics *sk
|
|
|
|
, double x, double y, double z);
|
2018-06-22 20:03:07 +03:00
|
|
|
double itersolve_get_commanded_pos(struct stepper_kinematics *sk);
|
2018-06-09 02:55:24 +03:00
|
|
|
|
|
|
|
#endif // itersolve.h
|