|
Smart Knob Controller
|
Class for 3-phase BLDC motor control using PWM and encoder feedback. More...
#include <motor.h>
Public Member Functions | |
| Motor (TIM_HandleTypeDef *htim, uint32_t chA, uint32_t chB, uint32_t chC, GPIO &enA, GPIO &enB, GPIO &enC, Encoder &encoder) | |
| Constructs a Motor object. | |
| void | setEffort (int effort) |
| Sets the motor effort as a percentage (-100 to 100). | |
| void | commutate () |
| Applies 3-phase commutation based on current encoder angle and effort. | |
| void | enable () |
| Enables all motor phases. | |
| void | disable () |
| Disables all motor phases. | |
| void | testCommutation (int32_t theta, float Vq) |
| Applies open-loop commutation at specified angle and voltage. | |
| void | applyPWM (float Va, float Vb, float Vc) |
| Sets PWM outputs based on given phase voltages. | |
Class for 3-phase BLDC motor control using PWM and encoder feedback.
| void Motor::applyPWM | ( | float | Va, |
| float | Vb, | ||
| float | Vc ) |
Sets PWM outputs based on given phase voltages.
| Va | Phase A voltage. |
| Vb | Phase B voltage. |
| Vc | Phase C voltage. |
| void Motor::testCommutation | ( | int32_t | theta, |
| float | Vq ) |
Applies open-loop commutation at specified angle and voltage.
| theta | Electrical angle in encoder ticks. |
| Vq | Voltage magnitude. |