1#ifndef BITSIM_ACTUATORS_BLDC_MOTOR_H
2#define BITSIM_ACTUATORS_BLDC_MOTOR_H
50DCEquivalentState
dc_equivalent_step(
const BLDCMotorParameters &m,
const DCEquivalentState &s,
131 PhasePair pair_{0, 0};
The basic types of bitsim. Code outside this file names Eigen's matrix and vector types only through ...
real_t phase_emf(int phase, real_t theta_e) const
The back-EMF of a phase per unit of mechanical speed [V s/rad]. The phases are shifted by 120 electri...
Definition bldc_motor.cpp:62
const BLDCMotorParameters & parameters() const noexcept
Definition bldc_motor.h:123
real_t step(real_t V, real_t theta, real_t w, real_t dt)
Advance the current by dt [s] for supply voltage V and return the torque [N m]. theta and w are the m...
Definition bldc_motor.cpp:69
static int hall_code(real_t theta_e)
The code of the three Hall sensors, 120 electrical degrees apart, at electrical angle theta_e: h1 + 2...
Definition bldc_motor.cpp:33
static PhasePair commutation(int hall_code)
The commutation table: for each Hall code the pair of phases whose back-EMF is largest in that sector...
Definition bldc_motor.cpp:41
BLDCMotor(const BLDCMotorParameters &m, real_t hall_offset=0.0)
Definition bldc_motor.cpp:25
real_t k_line() const noexcept
The peak of the line-to-line back-EMF per unit of speed: .
Definition bldc_motor.h:121
real_t sensed_angle(real_t theta) const
The electrical angle the controller sees for the mechanical angle theta [rad].
Definition bldc_motor.cpp:67
real_t current() const noexcept
Definition bldc_motor.h:115
const PhasePair & pair() const noexcept
Definition bldc_motor.h:116
Definition dc_motor_backend_base.h:11
DCEquivalentState dc_equivalent_step(const BLDCMotorParameters &m, const DCEquivalentState &s, real_t V, real_t T_load, real_t dt)
One explicit Euler step of dt [s] of the DC-equivalent model: the motor seen from its supply with the...
Definition bldc_motor.cpp:17
Definition dc_motor_backend_base.h:9
double real_t
real_t
Definition bitsim_types.h:20
The parameters of a brushless DC motor. R and L are measured between two terminals,...
Definition bldc_motor.h:17
real_t Kt() const noexcept
The torque constant [N m/A], equal to Ke in SI units.
Definition bldc_motor.h:29
real_t Ke
back-EMF constant [V s/rad]; Kt = Ke in SI units
Definition bldc_motor.h:20
real_t J
inertia of the rotor [kg m^2]
Definition bldc_motor.h:21
real_t V_supply
supply voltage [V]
Definition bldc_motor.h:24
real_t L
inductance between two terminals [H]
Definition bldc_motor.h:19
real_t R
resistance between two terminals [Ohm]
Definition bldc_motor.h:18
real_t b
viscous friction [N m s/rad]
Definition bldc_motor.h:22
int pole_pairs
electrical turns per mechanical turn
Definition bldc_motor.h:23
A rotor with inertia and viscous friction, for a BLDCMotor without a physics engine: .
Definition bldc_motor.h:139
real_t w
speed [rad/s]
Definition bldc_motor.h:141
void step(const BLDCMotorParameters &m, real_t T_motor, real_t T_load, real_t dt)
One explicit Euler step of dt [s].
Definition bldc_motor.cpp:83
real_t theta
mechanical angle [rad]
Definition bldc_motor.h:140
The state of the DC-equivalent model: current [A] and speed [rad/s].
Definition bldc_motor.h:36
real_t w
Definition bldc_motor.h:38
real_t i
Definition bldc_motor.h:37
The two phases that carry the current in a sector: it goes in through high and out through low....
Definition bldc_motor.h:58
int high
Definition bldc_motor.h:59
int low
Definition bldc_motor.h:60