Skip to content

Commit 046e0fb

Browse files
committed
forgotten unset handling of KV
1 parent 1b2f5a7 commit 046e0fb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/BLDCMotor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ BLDCMotor::BLDCMotor(int pp, float _R, float _KV)
1313
// save phase resistance number
1414
phase_resistance = _R;
1515
// save back emf constant KV = 1/KV
16-
K_bemf = 1.0/_KV;
16+
K_bemf = _isset(_KV) ? 1.0/_KV : NOT_SET;
1717

1818
// torque control type is voltage by default
1919
torque_controller = TorqueControlType::voltage;

src/StepperMotor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ StepperMotor::StepperMotor(int pp, float _R, float _KV)
1414
// save phase resistance number
1515
phase_resistance = _R;
1616
// save back emf constant KV = 1/KV
17-
K_bemf = 1.0/_KV;
17+
K_bemf = _isset(_KV) ? 1.0/_KV : NOT_SET;
1818

1919
// torque control type is voltage by default
2020
// current and foc_current not supported yet

0 commit comments

Comments
 (0)