File syn_interpolator.c¶
FileList > motor > syn_interpolator.c
Go to the source code of this file
Coordinated multi-axis linear & circular arc trajectory interpolator implementation.
#include "../util/syn_assert.h"#include "syn_interpolator.h"#include <math.h>#include <string.h>
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. |
Macros¶
| Type | Name |
|---|---|
| define | M_PI 3.14159265358979323846 |
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.
Macro Definition Documentation¶
define M_PI¶
The documentation for this class was generated from the following file src/syntropic/motor/syn_interpolator.c