Skip to content

Commit 3a59417

Browse files
committed
issue with SpaceVector algorithm
1 parent 47f0b7f commit 3a59417

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/BLDCMotor.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -335,10 +335,10 @@ void BLDCMotor::setPhaseVoltage(float Uq, float angle_el) {
335335
Tc = 0;
336336
}
337337

338-
// calculate the phase voltages
339-
Ua = Ta*Uq;
340-
Ub = Tb*Uq;
341-
Uc = Tc*Uq;
338+
// calculate the phase voltages and center
339+
Ua = Ta*Uq + (voltage_power_supply - Uq) / 2;
340+
Ub = Tb*Uq + (voltage_power_supply - Uq) / 2;
341+
Uc = Tc*Uq + (voltage_power_supply - Uq) / 2;
342342
break;
343343
}
344344

0 commit comments

Comments
 (0)