Skip to content

Commit eb49ca3

Browse files
author
Richard Unger
committed
correct initFOC description for API changes
1 parent 01f7502 commit eb49ca3

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

docs/simplefoc_library/code/motors/bldc_motors.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -258,22 +258,20 @@ The alignment procedure will have to move your motor several times and might not
258258

259259
### Step 6.1 Skip alignment - position sensor
260260

261-
If you are using absolute sensors such as magnetic sensors or hall sensors, once you have done the alignment procedure and once you have the motor's zero electrical offset sensor direction you no longer need the full calibration sequence. Therefore, to the `motor.initFOC()` you can provide the sensor offset `zero_electric_offset` and sensor direction `sensor_direction` to avoid alignment procedure:
262-
```cpp
263-
// align sensor and start FOC
264-
//motor.initFOC(zero_electric_offset, sensor_direction);
265-
motor.initFOC(2.15, Direction::CW);
266-
```
267-
The same can be done by using the motor parameters:
261+
If you are using absolute sensors such as magnetic sensors or hall sensors, once you have done the alignment procedure and once you have the motor's zero electrical offset sensor direction you no longer need the full calibration sequence.
262+
263+
In this case you can set the sensor offset `zero_electric_offset` and sensor direction `sensor_direction` in the motor parameters to avoid the alignment procedure:
268264
```cpp
269-
// align sensor and start FOC
265+
// set calibration values
270266
motor.zero_electric_offset = 2.15; // rad
271267
motor.sensor_direction = Direction::CW; // CW or CCW
268+
// then call initFOC()
272269
motor.initFOC();
273270
```
274271
You can find these values by running the `find_sensor_offset_and_direction.ino` example.
275272

276-
More generally, if you know any of these two values make sure to provide and the `iniFOC` will skip that part of the calibration. For example, for encoder sensors the zero electrical offset changes all the time but the sensor direction will stay the same so you can provide it and skip a large part of the calibration sequence.
273+
If you set either of these two values the `initFOC` will skip that part of the calibration. For example, for encoder sensors the zero electrical offset changes all the time but the sensor direction will stay the same so you can provide it and skip a large part of the calibration sequence.
274+
277275
### Step 6.2 Skip alignment - current sense
278276

279277
For the current sensors it is as well possible to avoid the calibration procedure an that is done by specifying the curren sense flag called `skip_align`:

0 commit comments

Comments
 (0)