Work in progress for the esp32 code of the FOC algorithm for actual control of a BLDC motor.
For the first run tests, the V/F OpenLoop method was choose.
V/F Control is a open loop method that consist of aplying a gain value for the Voltage of the motor pins.
Code example:
Volts = ref*Gf*gain_adc;
comp_value = Volts*BLDC_MCPWM_PERIOD/Tmax;
//here is where de duty cycle is defined
duty_A = comp_value*FEM_sin(theta);
duty_B = comp_value*FEM_sin(theta + pi/3.0);
duty_C = comp_value*FEM_sin(theta - pi/3.0);
by changing the value of the
Another necessary step is muntiplying the
For this work i will be using a A2212/13T brushless motor.
- Resistance 0.090$\Omega$
- Poles 14
- Inductance 0.1mH
$ K_v = \frac{\omega_{rpm}}{V_P0.95} $
$ K_p = \frac{60}{2 \pi K_v} $ if Kv in rpm
for Kv in rad it simply is the inverse of Kp
$ K_p = \frac{1}{K_v} $