File syn_interpolator.h¶
FileList > motor > syn_interpolator.h
Go to the source code of this file
Coordinated multi-axis linear & circular arc trajectory interpolator. More...
#include "../common/syn_defs.h"#include "../util/syn_scurve.h"#include <stdbool.h>#include <stddef.h>#include <stdint.h>
Classes¶
| Type | Name |
|---|---|
| struct | SYN_Interpolator Multi-Axis Interpolator configuration and state machine. |
| struct | SYN_Vector3F 3D Vector position in steps or user units |
Public Types¶
| Type | Name |
|---|---|
| enum | SYN_Interp_Mode Interpolation mode enum. |
Public Functions¶
| Type | Name |
|---|---|
| bool | syn_interpolator_eval_at_time (SYN_Interpolator * interp, float t_sec, SYN_Vector3F * out_pos, SYN_Vector3F * out_vel) Evaluate the interpolator at a specific time offset t seconds. |
| void | syn_interpolator_init (SYN_Interpolator * interp) Initialize a Multi-Axis Interpolator. |
| SYN_Status | syn_interpolator_plan_bezier (SYN_Interpolator * interp, SYN_Vector3F p0, SYN_Vector3F p1, SYN_Vector3F p2, SYN_Vector3F p3, float feedrate, float max_accel, float max_jerk, float step_res) Plan a Cubic 3D Bezier curve trajectory. |
| SYN_Status | syn_interpolator_plan_circular (SYN_Interpolator * interp, SYN_Vector3F start, SYN_Vector3F target, SYN_Vector3F center_offset, bool is_cw, float feedrate, float max_accel, float max_jerk, float step_res) Plan a Circular 2D arc move in XY plane. |
| SYN_Status | syn_interpolator_plan_linear (SYN_Interpolator * interp, SYN_Vector3F start, SYN_Vector3F target, float feedrate, float max_accel, float max_jerk, float step_res) Plan a Linear 2D/3D motion move. |
| bool | syn_interpolator_step (SYN_Interpolator * interp, SYN_Vector3F * out_pos) Advance the interpolator by one discrete step. |
Detailed Description¶
Provides zero-allocation, fixed-step multi-axis DDA (Digital Differential Analyzer) vector trajectory generation for coordinated motion control across 2D/3D linear segments and 2D circular arcs.
Public Types Documentation¶
enum SYN_Interp_Mode¶
Interpolation mode enum.
enum SYN_Interp_Mode {
SYN_INTERP_MODE_IDLE = 0,
SYN_INTERP_MODE_LINEAR,
SYN_INTERP_MODE_CIRCULAR_CW,
SYN_INTERP_MODE_CIRCULAR_CCW
};
Public Functions Documentation¶
function syn_interpolator_eval_at_time¶
Evaluate the interpolator at a specific time offset t seconds.
bool syn_interpolator_eval_at_time (
SYN_Interpolator * interp,
float t_sec,
SYN_Vector3F * out_pos,
SYN_Vector3F * out_vel
)
Parameters:
interpPointer to interpolator struct.t_secTime offset from start of move in seconds.out_posOut: Position vector at time t.out_velOut: Velocity vector at time t (optional, can be NULL).
Returns:
true if t <= move total time.
function syn_interpolator_init¶
Initialize a Multi-Axis Interpolator.
Parameters:
interpPointer to interpolator struct.
function syn_interpolator_plan_bezier¶
Plan a Cubic 3D Bezier curve trajectory.
SYN_Status syn_interpolator_plan_bezier (
SYN_Interpolator * interp,
SYN_Vector3F p0,
SYN_Vector3F p1,
SYN_Vector3F p2,
SYN_Vector3F p3,
float feedrate,
float max_accel,
float max_jerk,
float step_res
)
Parameters:
interpPointer to interpolator struct.p0Start point P0.p1Control point P1.p2Control point P2.p3End point P3.feedrateDesired tangential speed (units/sec).max_accelMax acceleration (units/sec^2).max_jerkMax jerk (units/sec^3).step_resSpatial resolution per step.
Returns:
SYN_OK on success.
function syn_interpolator_plan_circular¶
Plan a Circular 2D arc move in XY plane.
SYN_Status syn_interpolator_plan_circular (
SYN_Interpolator * interp,
SYN_Vector3F start,
SYN_Vector3F target,
SYN_Vector3F center_offset,
bool is_cw,
float feedrate,
float max_accel,
float max_jerk,
float step_res
)
Parameters:
interpPointer to interpolator struct.startStart position (X, Y).targetTarget position (X, Y).center_offsetCenter offset relative to start (I = center.x - start.x, J = center.y - start.y).is_cwtrue for Clockwise, false for Counter-Clockwise.feedrateDesired tangential speed (units/sec).max_accelMax acceleration (units/sec^2).max_jerkMax jerk (units/sec^3).step_resSpatial resolution per step (units per step).
Returns:
SYN_OK on success.
function syn_interpolator_plan_linear¶
Plan a Linear 2D/3D motion move.
SYN_Status syn_interpolator_plan_linear (
SYN_Interpolator * interp,
SYN_Vector3F start,
SYN_Vector3F target,
float feedrate,
float max_accel,
float max_jerk,
float step_res
)
Parameters:
interpPointer to interpolator struct.startStart position (X, Y, Z).targetTarget position (X, Y, Z).feedrateDesired vector velocity (units/sec).max_accelMax acceleration (units/sec^2).max_jerkMax jerk (units/sec^3).step_resSpatial resolution per step (units per step, e.g. 0.001mm).
Returns:
SYN_OK on success.
function syn_interpolator_step¶
Advance the interpolator by one discrete step.
Parameters:
interpPointer to interpolator struct.out_posOut: Calculated position after step.
Returns:
true if move active and advanced, false if move complete.
The documentation for this class was generated from the following file src/syntropic/motor/syn_interpolator.h