Skip to content

File syn_scurve.c

FileList > src > syntropic > util > syn_scurve.c

Go to the source code of this file

  • #include "syn_assert.h"
  • #include "syn_scurve.h"
  • #include <string.h>
  • #include "syn_qmath.h"

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
uint32_t syn_isqrt (uint32_t n)

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:

  • sc3d 3D profile pointer.
  • start_x Starting X coordinate.
  • start_y Starting Y coordinate.
  • start_z Starting Z coordinate.
  • target_x Target X coordinate.
  • target_y Target Y coordinate.
  • target_z Target Z coordinate.
  • v_max Vector max velocity.
  • a_max Vector max acceleration.
  • j_max Vector max jerk.

function syn_scurve3d_update

Step 3D synchronized S-Curve profile by one tick.

bool syn_scurve3d_update (
    SYN_SCurve3D * sc3d,
    int32_t * out_x,
    int32_t * out_y,
    int32_t * out_z
) 

Parameters:

  • sc3d 3D profile pointer.
  • out_x Out: Current X coordinate.
  • out_y Out: Current Y coordinate.
  • out_z Out: Current Z coordinate.

Returns:

true if move active, false if completed.


function syn_scurve_init

Initialize the S-Curve generator.

void syn_scurve_init (
    SYN_SCurve * sc,
    int32_t initial_p
) 

Parameters:

  • sc Pointer to generator.
  • initial_p Initial position.

function syn_scurve_set_constraints

Configure the kinematic constraints.

void syn_scurve_set_constraints (
    SYN_SCurve * sc,
    int32_t v_max,
    int32_t a_max,
    int32_t j_max
) 

Parameters:

  • sc Pointer to generator.
  • v_max Maximum velocity (units/tick).
  • a_max Maximum acceleration (units/tick^2).
  • j_max Maximum jerk (units/tick^3).

function syn_scurve_set_target

Set a new target position.

void syn_scurve_set_target (
    SYN_SCurve * sc,
    int32_t target
) 

Parameters:

  • sc Pointer to generator.
  • target Target position.

function syn_scurve_update

Update the trajectory generator by one time step (tick).

int32_t syn_scurve_update (
    SYN_SCurve * sc
) 

Parameters:

  • sc Pointer to generator.

Returns:

Current position.


Public Static Functions Documentation

function syn_isqrt

static inline uint32_t syn_isqrt (
    uint32_t n
) 


The documentation for this class was generated from the following file src/syntropic/util/syn_scurve.c