Skip to content

Commit d4e1c2c

Browse files
committed
Remove sqrt 2 multiplication and correct bemf calculation
1 parent 0caaf03 commit d4e1c2c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/BLDCMotor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ BLDCMotor::BLDCMotor(int pp, float _R, float _KV, float _inductance)
4646
// 1/sqrt(2) - rms value
4747
KV_rating = NOT_SET;
4848
if (_isset(_KV))
49-
KV_rating = _KV*_SQRT2;
49+
KV_rating = _KV;
5050
// save phase inductance
5151
phase_inductance = _inductance;
5252

@@ -396,7 +396,7 @@ void BLDCMotor::move(float new_target) {
396396
if(_isset(new_target)) target = new_target;
397397

398398
// calculate the back-emf voltage if KV_rating available U_bemf = vel*(1/KV)
399-
if (_isset(KV_rating)) voltage_bemf = shaft_velocity/KV_rating/_RPM_TO_RADS;
399+
if (_isset(KV_rating)) voltage_bemf = shaft_velocity/(KV_rating*_SQRT3)/_RPM_TO_RADS;
400400
// estimate the motor current if phase reistance available and current_sense not available
401401
if(!current_sense && _isset(phase_resistance)) current.q = (voltage.q - voltage_bemf)/phase_resistance;
402402

0 commit comments

Comments
 (0)