129 Ualpha = _ca * Ud - _sa * Uq;
130 Ubeta = _sa * Ud + _ca * Uq;
#define SIMPLEFOC_MOTOR_DEBUG(msg,...)
@ motor_uncalibrated
Motor is initialized, but not calibrated (open loop possible)
@ motor_initializing
Motor intiialization is in progress.
@ motor_init_failed
Motor initialization failed (not recoverable)
#define SIMPLEFOC_MOTOR_ERROR(msg,...)
@ voltage
Torque control using voltage.
bool initialized
true if driver was successfully initialized
float voltage_limit
limiting voltage set to the motor
int8_t enabled
enabled or disabled motor flag
void updateCurrentLimit(float new_current_limit)
DQ_s axis_inductance
motor direct axis phase inductance
PIDController PID_current_q
parameter determining the q current PID config
void updateVoltageLimit(float new_voltage_limit)
MotionControlType controller
parameter determining the control loop to be used
float phase_resistance
motor phase resistance
PIDController PID_current_d
parameter determining the d current PID config
Sensor * sensor
CurrentSense link.
CurrentSense * current_sense
float voltage_limit
Voltage limiting variable - global limit.
float velocity_limit
Velocity limiting variable - global limit.
PIDController P_angle
parameter determining the position PID configuration
FOCMotorStatus motor_status
motor status
float Ubeta
Phase voltages U alpha and U beta used for inverse Park and Clarke transform.
float KV_rating
motor KV rating
float voltage_sensor_align
sensor and motor align voltage parameter
Direction sensor_direction
default is CW. if sensor_direction == Direction::CCW then direction will be flipped compared to CW....
float current_limit
Current limiting variable - global limit.
TorqueControlType torque_controller
parameter determining the torque control type
PIDController PID_velocity
parameter determining the velocity PID configuration
float phase_inductance
motor phase inductance q axis - FOR BACKWARDS COMPATIBILITY
int pole_pairs
motor pole pairs number
void updateVelocityLimit(float new_velocity_limit)
virtual void setPwm(float Ua, float Ub)=0
void linkDriver(StepperDriver *driver)
void setPhaseVoltage(float Uq, float Ud, float angle_el) override
float estimateBEMF(float velocity) override
StepperMotor(int pp, float R=NOT_SET, float KV=NOT_SET, float L_q=NOT_SET, float L_d=NOT_SET)
void _sincos(float a, float *s, float *c)
void _delay(unsigned long ms)