SimpleFOClibrary 2.4.0
Loading...
Searching...
No Matches
FOCMotor Class Referenceabstract

#include <FOCMotor.h>

Inheritance diagram for FOCMotor:
[legend]
Collaboration diagram for FOCMotor:
[legend]

Public Member Functions

 FOCMotor ()
 
virtual int init ()=0
 
virtual void disable ()=0
 
virtual void enable ()=0
 
virtual void setPhaseVoltage (float Uq, float Ud, float angle_el)=0
 
virtual float estimateBEMF (float velocity)
 
virtual int initFOC ()
 
virtual void loopFOC ()
 
virtual void move (float target=NOT_SET)
 
void linkSensor (Sensor *sensor)
 
void linkCurrentSense (CurrentSense *current_sense)
 
float shaftAngle ()
 
float shaftVelocity ()
 
float electricalAngle ()
 
int characteriseMotor (float voltage, float correction_factor)
 
int tuneCurrentController (float bandwidth)
 
void useMonitoring (Print &serial)
 
void monitor ()
 
void updateVelocityLimit (float new_velocity_limit)
 
void updateCurrentLimit (float new_current_limit)
 
void updateVoltageLimit (float new_voltage_limit)
 
void updateTorqueControlType (TorqueControlType new_torque_controller)
 
void updateMotionControlType (MotionControlType new_motion_controller)
 
float velocityOpenloop (float target_velocity)
 
float angleOpenloop (float target_angle)
 
void linkCustomMotionControl (float(*controlMethod)(FOCMotor *motor))
 

Public Attributes

float target
 current target value - depends of the controller
 
float feed_forward_velocity = 0.0f
 current feed forward velocity
 
float shaft_angle
 current motor angle
 
float electrical_angle
 current electrical angle
 
float shaft_velocity
 current motor velocity
 
float current_sp
 target current ( q current )
 
float shaft_velocity_sp
 current target velocity
 
float shaft_angle_sp
 current target angle
 
DQVoltage_s voltage
 current d and q voltage set to the motor
 
DQCurrent_s current
 current d and q current measured
 
float voltage_bemf
 estimated backemf voltage (if provided KV constant)
 
float Ualpha
 
float Ubeta
 Phase voltages U alpha and U beta used for inverse Park and Clarke transform.
 
DQCurrent_s feed_forward_current
 current d and q current measured
 
DQVoltage_s feed_forward_voltage
 current d and q voltage set to the motor
 
float voltage_sensor_align
 sensor and motor align voltage parameter
 
float velocity_index_search
 target velocity for index search
 
float phase_resistance
 motor phase resistance
 
int pole_pairs
 motor pole pairs number
 
float KV_rating
 motor KV rating
 
float phase_inductance
 motor phase inductance q axis - FOR BACKWARDS COMPATIBILITY
 
DQ_s axis_inductance {NOT_SET, NOT_SET}
 motor direct axis phase inductance
 
float voltage_limit
 Voltage limiting variable - global limit.
 
float current_limit
 Current limiting variable - global limit.
 
float velocity_limit
 Velocity limiting variable - global limit.
 
int8_t enabled = 0
 enabled or disabled motor flag
 
FOCMotorStatus motor_status = FOCMotorStatus::motor_uninitialized
 motor status
 
FOCModulationType foc_modulation
 parameter determining modulation algorithm
 
int8_t modulation_centered = 1
 flag (1) centered modulation around driver limit /2 or (0) pulled to 0
 
TorqueControlType torque_controller
 parameter determining the torque control type
 
MotionControlType controller
 parameter determining the control loop to be used
 
PIDController PID_current_q {DEF_PID_CURR_P,DEF_PID_CURR_I,DEF_PID_CURR_D,DEF_PID_CURR_RAMP, DEF_POWER_SUPPLY}
 parameter determining the q current PID config
 
PIDController PID_current_d {DEF_PID_CURR_P,DEF_PID_CURR_I,DEF_PID_CURR_D,DEF_PID_CURR_RAMP, DEF_POWER_SUPPLY}
 parameter determining the d current PID config
 
LowPassFilter LPF_current_q {DEF_CURR_FILTER_Tf}
 parameter determining the current Low pass filter configuration
 
LowPassFilter LPF_current_d {DEF_CURR_FILTER_Tf}
 parameter determining the current Low pass filter configuration
 
PIDController PID_velocity {DEF_PID_VEL_P,DEF_PID_VEL_I,DEF_PID_VEL_D,DEF_PID_VEL_RAMP,DEF_PID_VEL_LIMIT}
 parameter determining the velocity PID configuration
 
PIDController P_angle {DEF_P_ANGLE_P,0,0,0,DEF_VEL_LIM}
 parameter determining the position PID configuration
 
LowPassFilter LPF_velocity {DEF_VEL_FILTER_Tf}
 parameter determining the velocity Low pass filter configuration
 
LowPassFilter LPF_angle {0.0}
 parameter determining the angle low pass filter configuration
 
unsigned int motion_downsample = DEF_MOTION_DOWNSMAPLE
 parameter defining the ratio of downsampling for move commad
 
unsigned int motion_cnt = 0
 counting variable for downsampling for move commad
 
float sensor_offset
 user defined sensor zero offset
 
float zero_electric_angle = NOT_SET
 absolute zero electric angle - if available
 
Direction sensor_direction = Direction::UNKNOWN
 default is CW. if sensor_direction == Direction::CCW then direction will be flipped compared to CW. Set to UNKNOWN to set by calibration
 
bool pp_check_result = false
 the result of the PP check, if run during loopFOC
 
unsigned int monitor_downsample = DEF_MON_DOWNSMAPLE
 show monitor outputs each monitor_downsample calls
 
char monitor_start_char = '\0'
 monitor starting character
 
char monitor_end_char = '\0'
 monitor outputs ending character
 
char monitor_separator = '\t'
 monitor outputs separation character
 
unsigned int monitor_decimals = 4
 monitor outputs decimal places
 
uint8_t monitor_variables = _MON_TARGET | _MON_VOLT_Q | _MON_VEL | _MON_ANGLE
 Bit array holding the map of variables the user wants to monitor.
 
Sensorsensor
 CurrentSense link.
 
CurrentSensecurrent_sense
 
Print * monitor_port
 Serial terminal variable if provided.
 
uint32_t loopfoc_time_us = 0
 filtered loop times
 
uint32_t move_time_us = 0
 

Protected Member Functions

void updateLoopFOCTime ()
 
void updateMotionControlTime ()
 
int alignSensor ()
 
int alignCurrentSense ()
 
int absoluteZeroSearch ()
 

Protected Attributes

uint32_t last_loopfoc_timestamp_us = 0
 timestamp of the last loopFOC execution in microseconds
 
uint32_t last_loopfoc_time_us = 0
 last elapsed time of loopFOC in microseconds
 
uint32_t last_move_timestamp_us = 0
 timestamp of the last move execution in microseconds
 
uint32_t last_move_time_us = 0
 last elapsed time of move in microseconds
 

Detailed Description

Generic motor class

Definition at line 97 of file FOCMotor.h.

Constructor & Destructor Documentation

◆ FOCMotor()

FOCMotor::FOCMotor ( )

Default constructor - setting all variabels to default values

Definition at line 7 of file FOCMotor.cpp.

Member Function Documentation

◆ absoluteZeroSearch()

int FOCMotor::absoluteZeroSearch ( )
protected

Motor and sensor alignment to the sensors absolute 0 angle

Definition at line 930 of file FOCMotor.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ alignCurrentSense()

int FOCMotor::alignCurrentSense ( )
protected

Current sense and motor phase alignment

Definition at line 827 of file FOCMotor.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ alignSensor()

int FOCMotor::alignSensor ( )
protected

Sensor alignment to electrical 0 angle of the motor

Definition at line 847 of file FOCMotor.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ angleOpenloop()

float FOCMotor::angleOpenloop ( float  target_angle)

Function (iterative) generating open loop movement towards the target angle it uses voltage_limit and velocity_limit variables

Parameters
target_angle- rad

Definition at line 414 of file FOCMotor.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ characteriseMotor()

int FOCMotor::characteriseMotor ( float  voltage,
float  correction_factor = 1.0f 
)

Measure resistance and inductance of a motor and print results to debug. If a sensor is available, an estimate of zero electric angle will be reported too.

Parameters
voltageThe voltage applied to the motor
correction_factorIs 1.5 for 3 phase motors, because we measure over a series-parallel connection. TODO: what about 2 phase motors?
Returns
0 for success, >0 for failure

How this code works: If we apply a current spike in the d´-axis, there will be cross coupling to the q´-axis current, if we didn´t use the actual d-axis (ie. d´ != d). This has to do with saliency (Ld != Lq). The amount of cross coupled current is somewhat proportional to the angle error, which means that if we iteratively change the angle to min/maximise this current, we get the correct d-axis (and q-axis).

The d_electrical_angle should now be aligned to the d axis or the -d axis. We can therefore calculate two possible electrical zero angles. We then report the one closest to the actual value. This could be useful if the zero search method is not reliable enough (eg. high pole count).

Definition at line 96 of file FOCMotor.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ disable()

virtual void FOCMotor::disable ( )
pure virtual

Motor disable function

Implemented in BLDCMotor, HybridStepperMotor, and StepperMotor.

Here is the caller graph for this function:

◆ electricalAngle()

float FOCMotor::electricalAngle ( )

Electrical angle calculation

Definition at line 77 of file FOCMotor.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ enable()

virtual void FOCMotor::enable ( )
pure virtual

Motor enable function

Implemented in BLDCMotor, HybridStepperMotor, and StepperMotor.

◆ estimateBEMF()

virtual float FOCMotor::estimateBEMF ( float  velocity)
inlinevirtual

Estimation of the Back EMF voltage

Parameters
velocity- current shaft velocity

Reimplemented in BLDCMotor, HybridStepperMotor, and StepperMotor.

Definition at line 130 of file FOCMotor.h.

Here is the caller graph for this function:

◆ init()

virtual int FOCMotor::init ( )
pure virtual

Motor hardware init function

Implemented in BLDCMotor, HybridStepperMotor, and StepperMotor.

◆ initFOC()

int FOCMotor::initFOC ( )
virtual

Function initializing FOC algorithm and aligning sensor's and motors' zero position

  • If zero_electric_offset parameter is set the alignment procedure is skipped

Definition at line 774 of file FOCMotor.cpp.

Here is the call graph for this function:

◆ linkCurrentSense()

void FOCMotor::linkCurrentSense ( CurrentSense _current_sense)

Function linking a motor and current sensing

Parameters
current_senseCurrentSense class wrapper for the FOC algorihtm to read the motor current measurements

CurrentSense linking method

Definition at line 60 of file FOCMotor.cpp.

Here is the caller graph for this function:

◆ linkCustomMotionControl()

void FOCMotor::linkCustomMotionControl ( float(*)(FOCMotor *motor)  controlMethod)
inline

Function setting a custom motion control method defined by the user

Note
the custom control method has to be defined by the user and should follow the signature: float controlMethod(FOCMotor* motor)
Parameters
controlMethod- pointer to the custom control method function defined by the user

Definition at line 381 of file FOCMotor.h.

◆ linkSensor()

void FOCMotor::linkSensor ( Sensor _sensor)

Function linking a motor and a sensor

Parameters
sensorSensor class wrapper for the FOC algorihtm to read the motor angle and velocity

Sensor linking method

Definition at line 53 of file FOCMotor.cpp.

◆ loopFOC()

void FOCMotor::loopFOC ( )
virtual

Function running FOC algorithm in real-time it calculates the gets motor angle and sets the appropriate voltages to the phase pwm signals

  • the faster you can run it the better Arduino UNO ~1ms, Bluepill ~ 100us

Definition at line 580 of file FOCMotor.cpp.

Here is the call graph for this function:

◆ monitor()

void FOCMotor::monitor ( )

Utility function intended to be used with serial plotter to monitor motor variables significantly slowing the execution down!!!!

Definition at line 321 of file FOCMotor.cpp.

Here is the call graph for this function:

◆ move()

void FOCMotor::move ( float  target = NOT_SET)
virtual

Function executing the control loops set by the controller.

Parameters
targetEither voltage, angle or velocity based on the motor.controller If it is not set the motor will use the target set in its variable motor.target

This function doesn't need to be run upon each loop execution - depends of the use case

Definition at line 673 of file FOCMotor.cpp.

Here is the call graph for this function:

◆ setPhaseVoltage()

virtual void FOCMotor::setPhaseVoltage ( float  Uq,
float  Ud,
float  angle_el 
)
pure virtual

Method using FOC to set Uq to the motor at the optimal angle Heart of the FOC algorithm

Parameters
UqCurrent voltage in q axis to set to the motor
UdCurrent voltage in d axis to set to the motor
angle_elcurrent electrical angle of the motor

Implemented in BLDCMotor, HybridStepperMotor, and StepperMotor.

Here is the caller graph for this function:

◆ shaftAngle()

float FOCMotor::shaftAngle ( )

Shaft angle calculation in radians [rad]

Definition at line 65 of file FOCMotor.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ shaftVelocity()

float FOCMotor::shaftVelocity ( )

Shaft angle calculation function in radian per second [rad/s] It implements low pass filtering

Definition at line 71 of file FOCMotor.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tuneCurrentController()

int FOCMotor::tuneCurrentController ( float  bandwidth)

Auto-tune the current controller PID parameters based on desired bandwidth. Uses a simple method that assumes a first order system and requires knowledge of the motor phase resistance and inductance (if not set, the characteriseMotor function can be used).

Parameters
bandwidthDesired closed-loop bandwidth in Hz.
Returns
returns 0 for success, >0 for failure

Definition at line 538 of file FOCMotor.cpp.

Here is the call graph for this function:

◆ updateCurrentLimit()

void FOCMotor::updateCurrentLimit ( float  new_current_limit)

Update limit values in controllers when changed

Parameters
new_current_limit- new current limit value
Note
Updates current limit in:
  • motor.current_limit
  • motor.PID_velocity.limit (if current control)

Definition at line 453 of file FOCMotor.cpp.

Here is the caller graph for this function:

◆ updateLoopFOCTime()

void FOCMotor::updateLoopFOCTime ( )
inlineprotected

Function udating loop time measurement time between two loopFOC executions in microseconds It filters the value using low pass filtering alpha = 0.1

Note
- using _micros() function - be aware of its overflow every ~70 minutes

Definition at line 393 of file FOCMotor.h.

Here is the caller graph for this function:

◆ updateMotionControlTime()

void FOCMotor::updateMotionControlTime ( )
inlineprotected

Definition at line 397 of file FOCMotor.h.

Here is the caller graph for this function:

◆ updateMotionControlType()

void FOCMotor::updateMotionControlType ( MotionControlType  new_motion_controller)

Update motion control type and related target values

Parameters
new_motion_controller- new motion control type
Note
Updates the target value based on the new controller type
  • if velocity control: target is set to 0rad/s
  • if angle control: target is set to the current shaft_angle
  • if torque control: target is set to 0V or 0A depending on torque control type

Definition at line 495 of file FOCMotor.cpp.

Here is the call graph for this function:

◆ updateTorqueControlType()

void FOCMotor::updateTorqueControlType ( TorqueControlType  new_torque_controller)

Update torque control type and related controller limit values

Parameters
new_torque_controller- new torque control type
Note
Updates motor.torque_controller and motor.PID_velocity.limit

Definition at line 480 of file FOCMotor.cpp.

Here is the call graph for this function:

◆ updateVelocityLimit()

void FOCMotor::updateVelocityLimit ( float  new_velocity_limit)

Update limit values in controllers when changed

Parameters
new_velocity_limit- new velocity limit value
Note
Updates velocity limit in:
  • motor.velocity_limit
  • motor.P_angle.limit

Definition at line 446 of file FOCMotor.cpp.

Here is the caller graph for this function:

◆ updateVoltageLimit()

void FOCMotor::updateVoltageLimit ( float  new_voltage_limit)

Update limit values in controllers when changed

Parameters
new_voltage_limit- new voltage limit value
Note
Updates voltage limit in:
  • motor.voltage_limit
  • motor.PID_current_q.limit
  • motor.PID_current_d.limit
  • motor.PID_velocity.limit (if voltage control)

Definition at line 466 of file FOCMotor.cpp.

Here is the caller graph for this function:

◆ useMonitoring()

void FOCMotor::useMonitoring ( Print &  print)

Function providing BLDCMotor class with the Serial interface and enabling monitoring mode

Parameters
serialMonitoring Serial class reference

Monitoring functions

Definition at line 87 of file FOCMotor.cpp.

Here is the call graph for this function:

◆ velocityOpenloop()

float FOCMotor::velocityOpenloop ( float  target_velocity)

Function (iterative) generating open loop movement for target velocity it uses voltage_limit variable

Parameters
target_velocity- rad/s

Definition at line 389 of file FOCMotor.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ axis_inductance

DQ_s FOCMotor::axis_inductance {NOT_SET, NOT_SET}

motor direct axis phase inductance

Definition at line 235 of file FOCMotor.h.

◆ controller

MotionControlType FOCMotor::controller

parameter determining the control loop to be used

Definition at line 253 of file FOCMotor.h.

◆ current

DQCurrent_s FOCMotor::current

current d and q current measured

Definition at line 219 of file FOCMotor.h.

◆ current_limit

float FOCMotor::current_limit

Current limiting variable - global limit.

Definition at line 239 of file FOCMotor.h.

◆ current_sense

CurrentSense* FOCMotor::current_sense

Definition at line 302 of file FOCMotor.h.

◆ current_sp

float FOCMotor::current_sp

target current ( q current )

Definition at line 215 of file FOCMotor.h.

◆ electrical_angle

float FOCMotor::electrical_angle

current electrical angle

Definition at line 213 of file FOCMotor.h.

◆ enabled

int8_t FOCMotor::enabled = 0

enabled or disabled motor flag

Definition at line 243 of file FOCMotor.h.

◆ feed_forward_current

DQCurrent_s FOCMotor::feed_forward_current

current d and q current measured

Definition at line 223 of file FOCMotor.h.

◆ feed_forward_velocity

float FOCMotor::feed_forward_velocity = 0.0f

current feed forward velocity

Definition at line 211 of file FOCMotor.h.

◆ feed_forward_voltage

DQVoltage_s FOCMotor::feed_forward_voltage

current d and q voltage set to the motor

Definition at line 224 of file FOCMotor.h.

◆ foc_modulation

FOCModulationType FOCMotor::foc_modulation

parameter determining modulation algorithm

Definition at line 247 of file FOCMotor.h.

◆ KV_rating

float FOCMotor::KV_rating

motor KV rating

Definition at line 233 of file FOCMotor.h.

◆ last_loopfoc_time_us

uint32_t FOCMotor::last_loopfoc_time_us = 0
protected

last elapsed time of loopFOC in microseconds

Definition at line 409 of file FOCMotor.h.

◆ last_loopfoc_timestamp_us

uint32_t FOCMotor::last_loopfoc_timestamp_us = 0
protected

timestamp of the last loopFOC execution in microseconds

Definition at line 408 of file FOCMotor.h.

◆ last_move_time_us

uint32_t FOCMotor::last_move_time_us = 0
protected

last elapsed time of move in microseconds

Definition at line 411 of file FOCMotor.h.

◆ last_move_timestamp_us

uint32_t FOCMotor::last_move_timestamp_us = 0
protected

timestamp of the last move execution in microseconds

Definition at line 410 of file FOCMotor.h.

◆ loopfoc_time_us

uint32_t FOCMotor::loopfoc_time_us = 0

filtered loop times

Definition at line 308 of file FOCMotor.h.

◆ LPF_angle

LowPassFilter FOCMotor::LPF_angle {0.0}

parameter determining the angle low pass filter configuration

Definition at line 263 of file FOCMotor.h.

◆ LPF_current_d

LowPassFilter FOCMotor::LPF_current_d {DEF_CURR_FILTER_Tf}

parameter determining the current Low pass filter configuration

Definition at line 259 of file FOCMotor.h.

◆ LPF_current_q

LowPassFilter FOCMotor::LPF_current_q {DEF_CURR_FILTER_Tf}

parameter determining the current Low pass filter configuration

Definition at line 258 of file FOCMotor.h.

◆ LPF_velocity

LowPassFilter FOCMotor::LPF_velocity {DEF_VEL_FILTER_Tf}

parameter determining the velocity Low pass filter configuration

Definition at line 262 of file FOCMotor.h.

◆ modulation_centered

int8_t FOCMotor::modulation_centered = 1

flag (1) centered modulation around driver limit /2 or (0) pulled to 0

Definition at line 248 of file FOCMotor.h.

◆ monitor_decimals

unsigned int FOCMotor::monitor_decimals = 4

monitor outputs decimal places

Definition at line 290 of file FOCMotor.h.

◆ monitor_downsample

unsigned int FOCMotor::monitor_downsample = DEF_MON_DOWNSMAPLE

show monitor outputs each monitor_downsample calls

Definition at line 286 of file FOCMotor.h.

◆ monitor_end_char

char FOCMotor::monitor_end_char = '\0'

monitor outputs ending character

Definition at line 288 of file FOCMotor.h.

◆ monitor_port

Print* FOCMotor::monitor_port

Serial terminal variable if provided.

time between two loopFOC executions in microseconds

Definition at line 305 of file FOCMotor.h.

◆ monitor_separator

char FOCMotor::monitor_separator = '\t'

monitor outputs separation character

Definition at line 289 of file FOCMotor.h.

◆ monitor_start_char

char FOCMotor::monitor_start_char = '\0'

monitor starting character

Definition at line 287 of file FOCMotor.h.

◆ monitor_variables

uint8_t FOCMotor::monitor_variables = _MON_TARGET | _MON_VOLT_Q | _MON_VEL | _MON_ANGLE

Bit array holding the map of variables the user wants to monitor.

Definition at line 292 of file FOCMotor.h.

◆ motion_cnt

unsigned int FOCMotor::motion_cnt = 0

counting variable for downsampling for move commad

Definition at line 265 of file FOCMotor.h.

◆ motion_downsample

unsigned int FOCMotor::motion_downsample = DEF_MOTION_DOWNSMAPLE

parameter defining the ratio of downsampling for move commad

Definition at line 264 of file FOCMotor.h.

◆ motor_status

motor status

Definition at line 244 of file FOCMotor.h.

◆ move_time_us

uint32_t FOCMotor::move_time_us = 0

Definition at line 309 of file FOCMotor.h.

◆ P_angle

PIDController FOCMotor::P_angle {DEF_P_ANGLE_P,0,0,0,DEF_VEL_LIM}

parameter determining the position PID configuration

Definition at line 261 of file FOCMotor.h.

◆ phase_inductance

float FOCMotor::phase_inductance

motor phase inductance q axis - FOR BACKWARDS COMPATIBILITY

Definition at line 234 of file FOCMotor.h.

◆ phase_resistance

float FOCMotor::phase_resistance

motor phase resistance

Definition at line 231 of file FOCMotor.h.

◆ PID_current_d

parameter determining the d current PID config

Definition at line 257 of file FOCMotor.h.

◆ PID_current_q

parameter determining the q current PID config

Definition at line 256 of file FOCMotor.h.

◆ PID_velocity

parameter determining the velocity PID configuration

Definition at line 260 of file FOCMotor.h.

◆ pole_pairs

int FOCMotor::pole_pairs

motor pole pairs number

Definition at line 232 of file FOCMotor.h.

◆ pp_check_result

bool FOCMotor::pp_check_result = false

the result of the PP check, if run during loopFOC

Definition at line 271 of file FOCMotor.h.

◆ sensor

Sensor* FOCMotor::sensor

CurrentSense link.

Sensor link:

Definition at line 300 of file FOCMotor.h.

◆ sensor_direction

Direction FOCMotor::sensor_direction = Direction::UNKNOWN

default is CW. if sensor_direction == Direction::CCW then direction will be flipped compared to CW. Set to UNKNOWN to set by calibration

Definition at line 270 of file FOCMotor.h.

◆ sensor_offset

float FOCMotor::sensor_offset

user defined sensor zero offset

Definition at line 268 of file FOCMotor.h.

◆ shaft_angle

float FOCMotor::shaft_angle

current motor angle

Definition at line 212 of file FOCMotor.h.

◆ shaft_angle_sp

float FOCMotor::shaft_angle_sp

current target angle

Definition at line 217 of file FOCMotor.h.

◆ shaft_velocity

float FOCMotor::shaft_velocity

current motor velocity

Definition at line 214 of file FOCMotor.h.

◆ shaft_velocity_sp

float FOCMotor::shaft_velocity_sp

current target velocity

Definition at line 216 of file FOCMotor.h.

◆ target

float FOCMotor::target

current target value - depends of the controller

Definition at line 210 of file FOCMotor.h.

◆ torque_controller

TorqueControlType FOCMotor::torque_controller

parameter determining the torque control type

Definition at line 252 of file FOCMotor.h.

◆ Ualpha

float FOCMotor::Ualpha

Definition at line 221 of file FOCMotor.h.

◆ Ubeta

float FOCMotor::Ubeta

Phase voltages U alpha and U beta used for inverse Park and Clarke transform.

Definition at line 221 of file FOCMotor.h.

◆ velocity_index_search

float FOCMotor::velocity_index_search

target velocity for index search

Definition at line 228 of file FOCMotor.h.

◆ velocity_limit

float FOCMotor::velocity_limit

Velocity limiting variable - global limit.

Definition at line 240 of file FOCMotor.h.

◆ voltage

DQVoltage_s FOCMotor::voltage

current d and q voltage set to the motor

Definition at line 218 of file FOCMotor.h.

◆ voltage_bemf

float FOCMotor::voltage_bemf

estimated backemf voltage (if provided KV constant)

Definition at line 220 of file FOCMotor.h.

◆ voltage_limit

float FOCMotor::voltage_limit

Voltage limiting variable - global limit.

Definition at line 238 of file FOCMotor.h.

◆ voltage_sensor_align

float FOCMotor::voltage_sensor_align

sensor and motor align voltage parameter

Definition at line 227 of file FOCMotor.h.

◆ zero_electric_angle

float FOCMotor::zero_electric_angle = NOT_SET

absolute zero electric angle - if available

Definition at line 269 of file FOCMotor.h.


The documentation for this class was generated from the following files: