Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/encoders/calibrated/CalibratedSensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,11 @@ void CalibratedSensor::calibrate(FOCMotor &motor, int settle_time_ms)
{
// if the LUT is already defined, skip the calibration

if(calibrationLut == NULL) {
if (calibrationLut == NULL) {
allocated = true;
calibrationLut = new uint16_t[n_lut];
}else{
SIMPLEFOC_DEBUG("SEN_CAL: Using pre-defined LUT for calibration.");
return;
} else {
SIMPLEFOC_DEBUG("SEN_CAL: Overwriting pre-defined LUT for calibration.");
}
SIMPLEFOC_DEBUG("SEN_CAL: Starting Sensor Calibration.");

Expand Down
2 changes: 1 addition & 1 deletion src/encoders/calibrated/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ If you calibrate once during setup and save the LUT to EEPROM or hardcode it, yo

1. **First run**: Call `calibrate(motor)` → Serial outputs LUT
2. **Copy LUT**: Paste the generated values into your code
3. **Subsequent runs**: Pass LUT to constructor and `calibrate()` → instantaneous, no rotation needed
3. **Subsequent runs**: Pass LUT to constructor and DO NOT call `calibrate()` → instantaneous, no rotation needed

Your code will look something like this:

Expand Down
Loading