File syn_scurve.h¶
FileList > src > syntropic > util > syn_scurve.h
Go to the source code of this file
Jerk-limited S-curve trajectory generator. More...
#include "../common/syn_defs.h"#include <stdbool.h>#include <stdint.h>
Classes¶
| Type | Name |
|---|---|
| struct | SYN_SCurve S-curve trajectory generator state. |
| struct | SYN_SCurve3D Synchronized 3D S-Curve trajectory generator. |
Public Functions¶
| Type | Name |
|---|---|
| void | syn_scurve3d_plan (SYN_SCurve3D * sc3d, int32_t start_x, int32_t start_y, int32_t start_z, int32_t target_x, int32_t target_y, int32_t target_z, int32_t v_max, int32_t a_max, int32_t j_max) Initialize and plan a synchronized 3D vector move. |
| bool | syn_scurve3d_update (SYN_SCurve3D * sc3d, int32_t * out_x, int32_t * out_y, int32_t * out_z) Step 3D synchronized S-Curve profile by one tick. |
| void | syn_scurve_init (SYN_SCurve * sc, int32_t initial_p) Initialize the S-Curve generator. |
| void | syn_scurve_set_constraints (SYN_SCurve * sc, int32_t v_max, int32_t a_max, int32_t j_max) Configure the kinematic constraints. |
| void | syn_scurve_set_target (SYN_SCurve * sc, int32_t target) Set a new target position. |
| int32_t | syn_scurve_update (SYN_SCurve * sc) Update the trajectory generator by one time step (tick). |
Public Static Functions¶
| Type | Name |
|---|---|
| int32_t | syn_scurve_acceleration (const SYN_SCurve * sc) Get current acceleration. |
| bool | syn_scurve_done (const SYN_SCurve * sc) Check if trajectory is complete. |
| int32_t | syn_scurve_position (const SYN_SCurve * sc) Get current position. |
| int32_t | syn_scurve_velocity (const SYN_SCurve * sc) Get current velocity. |
Detailed Description¶
Generates smooth motion profiles by bounding velocity, acceleration, and jerk. Ideal for stepper motors and servo positioning.
Public Functions Documentation¶
function syn_scurve3d_plan¶
Initialize and plan a synchronized 3D vector move.
void syn_scurve3d_plan (
SYN_SCurve3D * sc3d,
int32_t start_x,
int32_t start_y,
int32_t start_z,
int32_t target_x,
int32_t target_y,
int32_t target_z,
int32_t v_max,
int32_t a_max,
int32_t j_max
)
Parameters:
sc3d3D profile pointer.start_xStarting X coordinate.start_yStarting Y coordinate.start_zStarting Z coordinate.target_xTarget X coordinate.target_yTarget Y coordinate.target_zTarget Z coordinate.v_maxVector max velocity.a_maxVector max acceleration.j_maxVector max jerk.
function syn_scurve3d_update¶
Step 3D synchronized S-Curve profile by one tick.
Parameters:
sc3d3D profile pointer.out_xOut: Current X coordinate.out_yOut: Current Y coordinate.out_zOut: Current Z coordinate.
Returns:
true if move active, false if completed.
function syn_scurve_init¶
Initialize the S-Curve generator.
Parameters:
scPointer to generator.initial_pInitial position.
function syn_scurve_set_constraints¶
Configure the kinematic constraints.
Parameters:
scPointer to generator.v_maxMaximum velocity (units/tick).a_maxMaximum acceleration (units/tick^2).j_maxMaximum jerk (units/tick^3).
function syn_scurve_set_target¶
Set a new target position.
Parameters:
scPointer to generator.targetTarget position.
function syn_scurve_update¶
Update the trajectory generator by one time step (tick).
Parameters:
scPointer to generator.
Returns:
Current position.
Public Static Functions Documentation¶
function syn_scurve_acceleration¶
Get current acceleration.
Parameters:
scS-curve instance.
Returns:
Current acceleration value.
function syn_scurve_done¶
Check if trajectory is complete.
Parameters:
scS-curve instance.
Returns:
true if target reached.
function syn_scurve_position¶
Get current position.
Parameters:
scS-curve instance.
Returns:
Current position value.
function syn_scurve_velocity¶
Get current velocity.
Parameters:
scS-curve instance.
Returns:
Current velocity value.
The documentation for this class was generated from the following file src/syntropic/util/syn_scurve.h