Skip to content

Struct SYN_MotorCtrl

ClassList > SYN_MotorCtrl

Motor controller instance (opaque — use API to access).

  • #include <syn_motor_ctrl.h>

Public Attributes

Type Name
SYN_MotorCtrl_Config cfg
SYN_DataLog * datalog
bool enabled
True when the controller is enabled and driving output.
int32_t ff_output
int32_t last_position
uint32_t last_update_tick
Tick of last update() call.
int32_t measured_position
int32_t measured_velocity
SYN_MotorCtrl_Metrics metrics
Move metrics — accumulated during each move, zero buffer cost.
SYN_MotorCtrl_Mode mode
SYN_MotorCtrl_StallCallback on_stall
Registered stall callback (NULL = none).
void * on_stall_ctx
User context passed to stall callback.
SYN_MotorCtrl_TargetCallback on_target
Registered on-target callback (NULL = none).
void * on_target_ctx
User context passed to on-target callback.
SYN_PID pid
int32_t pid_output
SYN_Ramp profile
Built-in ramp for move_to() (not used when set_trajectory is active).
bool profile_active
True when the built-in ramp profile is actively driving.
bool scurve_active
True when the built-in S-curve profile is actively driving.
SYN_SCurve scurve_profile
Built-in S-curve for move_to_scurve().
bool stall_active
True while output is nonzero but position isn't changing.
uint32_t stall_start_tick
Tick when stall condition was first detected.
SYN_MotorCtrl_State state
int32_t target_position
int32_t target_velocity
int32_t total_output
SYN_MotorCtrl_Trajectory trajectory
bool trajectory_active

Public Attributes Documentation

variable cfg

SYN_MotorCtrl_Config SYN_MotorCtrl::cfg;

Configuration snapshot


variable datalog

SYN_DataLog* SYN_MotorCtrl::datalog;

Attached datalog for telemetry


variable enabled

True when the controller is enabled and driving output.

bool SYN_MotorCtrl::enabled;


variable ff_output

int32_t SYN_MotorCtrl::ff_output;

Last feedforward output


variable last_position

int32_t SYN_MotorCtrl::last_position;

Position at last update


variable last_update_tick

Tick of last update() call.

uint32_t SYN_MotorCtrl::last_update_tick;


variable measured_position

int32_t SYN_MotorCtrl::measured_position;

Current position


variable measured_velocity

int32_t SYN_MotorCtrl::measured_velocity;

Current velocity


variable metrics

Move metrics — accumulated during each move, zero buffer cost.

SYN_MotorCtrl_Metrics SYN_MotorCtrl::metrics;


variable mode

SYN_MotorCtrl_Mode SYN_MotorCtrl::mode;

Current operating mode


variable on_stall

Registered stall callback (NULL = none).

SYN_MotorCtrl_StallCallback SYN_MotorCtrl::on_stall;


variable on_stall_ctx

User context passed to stall callback.

void* SYN_MotorCtrl::on_stall_ctx;


variable on_target

Registered on-target callback (NULL = none).

SYN_MotorCtrl_TargetCallback SYN_MotorCtrl::on_target;


variable on_target_ctx

User context passed to on-target callback.

void* SYN_MotorCtrl::on_target_ctx;


variable pid

SYN_PID SYN_MotorCtrl::pid;

Embedded PID controller


variable pid_output

int32_t SYN_MotorCtrl::pid_output;

Last PID output


variable profile

Built-in ramp for move_to() (not used when set_trajectory is active).

SYN_Ramp SYN_MotorCtrl::profile;


variable profile_active

True when the built-in ramp profile is actively driving.

bool SYN_MotorCtrl::profile_active;


variable scurve_active

True when the built-in S-curve profile is actively driving.

bool SYN_MotorCtrl::scurve_active;


variable scurve_profile

Built-in S-curve for move_to_scurve().

SYN_SCurve SYN_MotorCtrl::scurve_profile;


variable stall_active

True while output is nonzero but position isn't changing.

bool SYN_MotorCtrl::stall_active;


variable stall_start_tick

Tick when stall condition was first detected.

uint32_t SYN_MotorCtrl::stall_start_tick;


variable state

SYN_MotorCtrl_State SYN_MotorCtrl::state;

Current runtime state


variable target_position

int32_t SYN_MotorCtrl::target_position;

Target position value


variable target_velocity

int32_t SYN_MotorCtrl::target_velocity;

Units per second


variable total_output

int32_t SYN_MotorCtrl::total_output;

Last combined output


variable trajectory

SYN_MotorCtrl_Trajectory SYN_MotorCtrl::trajectory;

Current trajectory point


variable trajectory_active

bool SYN_MotorCtrl::trajectory_active;

True when using set_trajectory



The documentation for this class was generated from the following file src/syntropic/motor/syn_motor_ctrl.h