|
bitsim
Model, simulate, estimate and control robots in C++
|
The electrical model of a three-phase brushless motor with six-step commutation from three Hall sensors. More...
#include <bldc_motor.h>
Public Member Functions | |
| BLDCMotor (const BLDCMotorParameters &m, real_t hall_offset=0.0) | |
| 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 electrical degrees. | |
| real_t | sensed_angle (real_t theta) const |
| The electrical angle the controller sees for the mechanical angle theta [rad]. | |
| 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 mechanical angle [rad] and speed [rad/s] of the rotor. The current is taken to move to the new pair at once when the sector changes. | |
| real_t | current () const noexcept |
| const PhasePair & | pair () const noexcept |
| real_t | k_line () const noexcept |
| The peak of the line-to-line back-EMF per unit of speed: \(\pi K_e / 3\). | |
| const BLDCMotorParameters & | parameters () const noexcept |
Static Public Member Functions | |
| 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 h2 + 4 h3. Each sensor is on for half a turn, so the code tells which of six sectors the rotor is in. | |
| 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. Codes 0 and 7 never happen with working sensors and give {0, 0}. | |
The electrical model of a three-phase brushless motor with six-step commutation from three Hall sensors.
The rotor's angle and speed come from outside, so the same model works with a simple rotor model, BLDCRotor, and with a rigid body in a physics engine. Each step works out the sector from the Hall sensors, connects the two phases of the commutation table in series, advances their current and returns the torque. The back-EMF of each phase is sinusoidal, scaled so that its average over a sector matches the DC-equivalent model.
|
explicit |
| m | The motor |
| hall_offset | How far the Hall sensors are from where they should be [electrical rad]; a misplaced sensor makes the controller see the wrong sector |
|
static |
The commutation table: for each Hall code the pair of phases whose back-EMF is largest in that sector. Codes 0 and 7 never happen with working sensors and give {0, 0}.
|
inlinenoexcept |
|
static |
The code of the three Hall sensors, 120 electrical degrees apart, at electrical angle theta_e: h1 + 2 h2 + 4 h3. Each sensor is on for half a turn, so the code tells which of six sectors the rotor is in.
|
inlinenoexcept |
The peak of the line-to-line back-EMF per unit of speed: \(\pi K_e / 3\).
|
inlinenoexcept |
|
inlinenoexcept |
The back-EMF of a phase per unit of mechanical speed [V s/rad]. The phases are shifted by 120 electrical degrees.
The electrical angle the controller sees for the mechanical angle theta [rad].
Advance the current by dt [s] for supply voltage V and return the torque [N m]. theta and w are the mechanical angle [rad] and speed [rad/s] of the rotor. The current is taken to move to the new pair at once when the sector changes.