Skip to content

Commit 238eb1c

Browse files
committed
Initialize all of the HFI variables with some defaults
1 parent 3f816f0 commit 238eb1c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/BLDCMotor.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,13 @@ void BLDCMotor::init() {
106106
SIMPLEFOC_DEBUG("MOT: Enable driver.");
107107
enable();
108108
_delay(500);
109+
110+
//Initialize HFI variables
109111
motor_status = FOCMotorStatus::motor_uncalibrated;
110112
hfi_state=1;
111113
prev_hfi_time=micros();
114+
hfi_voltage=0.05*voltage_limit;
115+
hfi_frequency=1000;
112116
}
113117

114118

0 commit comments

Comments
 (0)