Skip to content

Struct SYN_MotorCtrl_Config

ClassList > SYN_MotorCtrl_Config

Motor controller configuration (passed to init, copied internally).

  • #include <syn_motor_ctrl.h>

Public Attributes

Type Name
SYN_ErrLog * errlog
int32_t ff_ka
int32_t ff_kv
uint8_t ff_scale
SYN_MotorOutput motor
int32_t output_max
int32_t output_min
int32_t pid_kd
PID derivative gain (÷ 1 << pid_scale).
int32_t pid_ki
PID integral gain (÷ 1 << pid_scale).
int32_t pid_kp
PID proportional gain (÷ 1 << pid_scale).
uint8_t pid_scale
int32_t position_deadband
int32_t position_max
int32_t position_min
SYN_MotorCtrl_ReadPos read_pos
void * read_pos_ctx
int32_t stall_threshold
uint16_t stall_timeout_ms
uint16_t update_hz

Public Attributes Documentation

variable errlog

SYN_ErrLog* SYN_MotorCtrl_Config::errlog;

If set, stall/limit events logged


variable ff_ka

int32_t SYN_MotorCtrl_Config::ff_ka;

Acceleration feedforward gain


variable ff_kv

int32_t SYN_MotorCtrl_Config::ff_kv;

Velocity feedforward gain


variable ff_scale

uint8_t SYN_MotorCtrl_Config::ff_scale;

FF divisor = 1 << ff_scale


variable motor

SYN_MotorOutput SYN_MotorCtrl_Config::motor;

Motor output interface


variable output_max

int32_t SYN_MotorCtrl_Config::output_max;

Max PID output (e.g., +255)


variable output_min

int32_t SYN_MotorCtrl_Config::output_min;

Min PID output (e.g., -255)


variable pid_kd

PID derivative gain (÷ 1 << pid_scale).

int32_t SYN_MotorCtrl_Config::pid_kd;


variable pid_ki

PID integral gain (÷ 1 << pid_scale).

int32_t SYN_MotorCtrl_Config::pid_ki;


variable pid_kp

PID proportional gain (÷ 1 << pid_scale).

int32_t SYN_MotorCtrl_Config::pid_kp;


variable pid_scale

uint8_t SYN_MotorCtrl_Config::pid_scale;

Gain divisor = 1 << pid_scale


variable position_deadband

int32_t SYN_MotorCtrl_Config::position_deadband;

Units within target = done


variable position_max

int32_t SYN_MotorCtrl_Config::position_max;

Max allowed position (soft limit)


variable position_min

int32_t SYN_MotorCtrl_Config::position_min;

Min allowed position (soft limit)


variable read_pos

SYN_MotorCtrl_ReadPos SYN_MotorCtrl_Config::read_pos;

Position read function


variable read_pos_ctx

void* SYN_MotorCtrl_Config::read_pos_ctx;

Context for read_pos


variable stall_threshold

int32_t SYN_MotorCtrl_Config::stall_threshold;

Min units/period for "not stalled"


variable stall_timeout_ms

uint16_t SYN_MotorCtrl_Config::stall_timeout_ms;

0 = disabled


variable update_hz

uint16_t SYN_MotorCtrl_Config::update_hz;

Control loop frequency



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