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