Skip to content

Commit 8adff3a

Browse files
Merge pull request #18 from simplefoc/dev
PR for documentation site release for v2.3.1
2 parents 0bf0f4f + 7846703 commit 8adff3a

File tree

8 files changed

+38
-46
lines changed

8 files changed

+38
-46
lines changed

docs/simplefoc_library/code/current_sense/index.md

+3
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ teensy | ✔️ | ❌ | ❌
6262
Raspberry Pi Pico | ✔️ | ❌ | ❌
6363
Portenta H7 | ✔️ | ❌ | ❌
6464
nRF52 | ✔️ | ❌ | ❌
65+
Renesas (UNO R4) | ❌ | ❌ | ❌
66+
67+
Note: current sensing on Renesas MCUs will be added in a future release.
6568

6669
## Digging deeper
6770

docs/simplefoc_library/code/current_sense/inline.md

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ SAMD51 | ✔️
3232
Teensy | ✔️
3333
Raspberry Pi Pico | ✔️
3434
Portenta H7 | ✔️
35+
Renesas (UNO R4) | ❌ (TBD)
3536

3637
## Hardware configuration
3738
To instantiate the inline current sensor using the <span class="simple">Simple<span class="foc">FOC</span>library</span> just create an instance of the class `InlineCurrentSense`.

docs/simplefoc_library/code/current_sense/low_side.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ SAMD51 | ❌
3939
Teensy | ❌
4040
Raspberry Pi Pico | ❌
4141
Portenta H7 | ❌
42+
Renesas (UNO R4) | ❌ (TBD)
4243

4344

4445
### Important hardware considerations
@@ -182,7 +183,7 @@ motor.linkCurrentSense(&current_sense);
182183

183184
### Where to place the `current_sense` configuration in your FOC code?
184185

185-
It is very important that the the current sensing `init` function is called after the `BLDCMotor` and `BLDCDriver` init functions are called. Which will make sure that the driver is enabled when current sense calibration is taking place. Also, it is important that the current sense `init` function is called before starting the foc algorithm with the `initFOC` function.
186+
It is very important that the the current sensing `init` function is called after the `BLDCDriver` init function is called. This will make sure that the driver is enabled when current sense calibration is taking place. Also, it is important that the current sense `init` function is called before initializing the motor and starting the foc algorithm with the `initFOC` function.
186187

187188
So the suggested code structure would be:
188189

@@ -207,6 +208,7 @@ void setup(){
207208
}
208209
```
209210
Function `initFOC()` will make sure that the `BLDCDriver` and `LowsideCurrentSense` classes are both well aligned, it is very important that the phase `A` of the current sense is exactly the phase `A` of the driver, phase `B` of the current sense exactly pahse `B` of the driver and the same for the phase `C`. To verify this, the `initFOC` will be calling the current sense's function `current_sense.driverAlign(...)`.
211+
210212
### Alignment with the motor phases `driverAlign(...)`
211213

212214
The current sense and the driver alignment inside `initFOC` is done by calling the function:

docs/simplefoc_library/code/drivers/bldc_driver/bldc_driver_6pwm.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ To create the interface to the BLDC driver you need to specify the 6 `PWM` pin n
3232
// - phB_h, phB_l - B phase pwm pin high/low pair
3333
// - phB_h, phC_l - C phase pwm pin high/low pair
3434
// - enable pin - (optional input)
35-
BLDCDriver6PWM motor = BLDCDriver6PWM(5,6, 9,10, 3,11, 8);
35+
BLDCDriver6PWM driver = BLDCDriver6PWM(5,6, 9,10, 3,11, 8);
3636
```
3737
<blockquote class="warning">
3838
⚠️ 6 PWM configuration is very hardware specific and please make sure to respect certain guidelines in order for it to work properly!
@@ -65,15 +65,15 @@ In hardware 6 PWM mode the user uses only one timer, usually Timer 1 for all the
6565
Where `T1Cx` are the Timer 1 channels and `T1CxN` are their complementary channels (inverted channels). Each pair of `T1Cx` and `T1CxN` is used for one pair of the high/low PWM pins. The library will configure the necessary timers and registers if you provide these pins to the constrictor of the `BLDCDriver6PWM` class. For example:
6666
```cpp
6767
// BLDCDriver6PWM( int phA_h, int phA_l, int phB_h, int phB_l, int phC_h, int phC_l, int en)
68-
BLDCDriver6PWM motor = BLDCDriver6PWM(PA8, PB13, PA9, PB14, PA10, PB15);
68+
BLDCDriver6PWM driver = BLDCDriver6PWM(PA8, PB13, PA9, PB14, PA10, PB15);
6969
```
7070

7171
#### Software 6 PWM mode
7272
If it is not possible to use the hardware 6 PWM mode with your board <span class="simple">Simple<span class="foc">FOC</span>library</span> enables you to use any two channels of any of the timers as your high/low side PWM pair. Basically, the library will automatically configure the complementary channels on the provided low side pins. The only requirement for this code to work properly is exatcly the same as for the Arudino UNO, each phase high/low PWM pair needs to belong to the same timer.
7373
For example, if we take STM32 Nucleo F401RE board we can take for example:
7474
```cpp
7575
// BLDCDriver6PWM( int phA_h, int phA_l, int phB_h, int phB_l, int phC_h, int phC_l, int en)
76-
BLDCDriver6PWM motor = BLDCDriver6PWM(7, 2, 6, 3, 5, 4);
76+
BLDCDriver6PWM driver = BLDCDriver6PWM(7, 2, 6, 3, 5, 4);
7777
```
7878
Where
7979

@@ -84,7 +84,7 @@ Where
8484
On Bluepill we could use:
8585
```cpp
8686
// BLDCDriver6PWM( int phA_h, int phA_l, int phB_h, int phB_l, int phC_h, int phC_l, int en)
87-
BLDCDriver6PWM motor = BLDCDriver6PWM(PA8, PA9, PB6, PB7, PB8, PB9);
87+
BLDCDriver6PWM driver = BLDCDriver6PWM(PA8, PA9, PB6, PB7, PB8, PB9);
8888
```
8989
Where
9090

@@ -247,4 +247,4 @@ void loop() {
247247
// phase A: 3V, phase B: 6V, phase C: 5V
248248
driver.setPwm(3,6,5);
249249
}
250-
```
250+
```

docs/simplefoc_library/code/drivers/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,6 @@ samd21/51 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️
4242
teensy | ✔️ | ✔️ | ✔️ | ✔️ | ✔️
4343
Raspberry Pi Pico | ✔️ | ✔️ | ✔️ | ✔️ | ✔️
4444
Portenta H7 | ✔️ | ✔️ | ✔️ | ❌ | ✔️
45+
Renesas (UNO R4 Minima) | ✔️ | ✔️ | ✔️ | ✔️ | ✔️
4546

4647
<sup>*</sup> For ESP32, the support for 6 PWM depends on the model of ESP32. The models that have a MCPWM peripheral support 6 PWM, the ones that do not only support the other PWM modes.

docs/simplefoc_library/code/motors/bldc_motors.md

+7-9
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`:

docs/simplefoc_library/work_roadmap.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,20 @@ For more info about the features of library releases visit the [github releases
4949
## MCU support
5050
- [ ] ESP8266 - initial
5151
- [ ] Portenta H7 - initial
52+
- [ ] Renesas support - initial
5253
- [x] Arduino leonardo
5354
- [x] Raspberry pi Pico - [PR #78](https://github.com/simplefoc/Arduino-FOC/pull/78)
5455
- [x] SAM - Arduino DUE
5556
- [x] SAMD21/51
5657
- [x] Teensy support
5758
- [x] ESP32 support
5859
- [x] STM32 Nucleo support
59-
- [x] STM32 BLuepill support
60+
- [x] STM32 Bluepill support
61+
- [x] nRF52 support
6062
- [x] Hardware specific code separation : easier porting in between devices `hardware_utils.cpp/.h`
6163

6264
## Driver support
63-
- [ ] Driver support: Disable the pahses in 6PWM mode
65+
- [x] Driver support: Disable the phases in 6PWM mode
6466
- [x] Driver support: Implement support for MOSFET control low and high pairs
6567
- [x] Driver support: DRV8302 borads
6668

index.md

+14-29
Original file line numberDiff line numberDiff line change
@@ -29,36 +29,21 @@ Therefore this is an attempt to:
2929
- *Medium-power* BLDC driver (<30Amps): [Arduino <span class="simple">Simple<b>FOC</b>PowerShield</span> ](https://github.com/simplefoc/Arduino-SimpleFOC-PowerShield).
3030

3131
<blockquote class="info" markdown="1">
32-
<p class="heading">NEW RELEASE 📢: <span class="simple">Simple<span class="foc">FOC</span>library</span> v2.3.0 <a href="https://github.com/simplefoc/Arduino-FOC/releases/tag/v2.3.0">see release</a></p>
33-
- Arduino Mega 6pwm more timers supported
34-
- Arduino boards - frequency change support either 32kHz or 4kHz
35-
- Arduino Uno - synched timers in 3pwm and 6pwm mode [#71](https://github.com/simplefoc/Arduino-FOC/issues/71)
36-
- Teensy 3.x initial support for 6pwm
37-
- Teensy 4.x initial support for 6pwm
38-
- Example for v3.1 SimpleFOCShield
39-
- RP2040 compatibility for earlehillpower core [#234](https://github.com/simplefoc/Arduino-FOC/pull/234) [#236](https://github.com/simplefoc/Arduino-FOC/pull/236)
40-
- More flexible monitoring API
41-
- start, end and separator characters
42-
- decimal places (settable through commander)
43-
- Added machine readable verbose mode in `Commander` [#233](https://github.com/simplefoc/Arduino-FOC/pull/233)
44-
- *Simple**FOC**WebController* - Web based user interface for SimpleFOC by [@geekuillaume](https://github.com/geekuillaume) - [webcontroller.simplefoc.com](https://webcontroller.simplefoc.com)
45-
- bugfix - `MagneticSensorPWM` multiple occasions - [#258](https://github.com/simplefoc/Arduino-FOC/pull/258)
46-
- bugfix - current sense align - added offset exchange when exchanging pins
47-
- bugfix - trapezoid 150 fixed
48-
- bugfix - 4pwm on ESP8266 [#224](https://github.com/simplefoc/Arduino-FOC/pull/224)
49-
- Additional `InlineCurrentSense` and `LowsideCurrentSense` constructor using milliVolts per Amp [#253](https://github.com/simplefoc/Arduino-FOC/pull/253)
50-
- STM32L4xx current sense support by [@Triple6](https://github.com/Triple6) (discord) [#257](https://github.com/simplefoc/Arduino-FOC/pull/257)
51-
- phase disable in 6pwm mode
52-
- stm32 - software and hardware 6pwm
53-
- atmega328
54-
- atmega2560
55-
- Lag compensation using motor inductance [#246](https://github.com/simplefoc/Arduino-FOC/issues/246)
56-
- current control through voltage torque mode enhancement
57-
- extended `BLDCMotor` and `StepperMotor` constructors to receive the inductance paramerer
58-
- can also be set using `motor.phase_inductance` or through `Commander`
32+
<p class="heading">NEW RELEASE 📢: <span class="simple">Simple<span class="foc">FOC</span>library</span> v2.3.1 <a href="https://github.com/simplefoc/Arduino-FOC/releases/tag/v2.3.1">see release</a></p>
33+
- Support for Arduino UNO R4 Minima (Renesas R7FA4M1 MCU - note UNO R4 WiFi is not yet supported)
34+
- Support setting PWM polarity on ESP32 (thanks to [@mcells](https://github.com/mcells))
35+
- Expose I2C errors in MagneticSensorI2C (thanks to [@padok](https://github.com/padok))
36+
- Improved default trig functions (sine, cosine) - faster, smaller
37+
- Overridable trig functions - plug in your own optimized versions
38+
- Bugfix: microseconds overflow in velocity mode [#287](https://github.com/simplefoc/Arduino-FOC/issues/287)
39+
- Bugfix: KV initialization ([5fc3128](https://github.com/simplefoc/Arduino-FOC/commit/5fc3128d282b65c141ca486327c6235089999627))
40+
- And more bugfixes - see the [complete list of 2.3.1 fixes here](https://github.com/simplefoc/Arduino-FOC/issues?q=is%3Aissue+milestone%3A2.3.1_Release)
41+
- Change: simplify initFOC() API ([d57d32d](https://github.com/simplefoc/Arduino-FOC/commit/d57d32dd8715dbed4e476469bc3de0c052f1d531). [5231e5e](https://github.com/simplefoc/Arduino-FOC/commit/5231e5e1d044b0cc33ede67664b6ef2f9d0a8cdf), [10c5b87](https://github.com/simplefoc/Arduino-FOC/commit/10c5b872672cab72df16ddd738bbf09bcce95d28))
42+
- Change: check for linked driver in currentsense and exit gracefully ([5ef4d9d](https://github.com/simplefoc/Arduino-FOC/commit/5ef4d9d5a92e03da0dd5af7f624243ab30f1b688))
43+
- Compatibility with newest versions of Arduino framework for STM32, Renesas, ESP32, Atmel SAM, Atmel AVR, nRF52 and RP2040
5944
</blockquote>
6045

61-
## Arduino <span class="simple">Simple<span class="foc">FOC</span>library</span> <i><small>v2.3.0</small></i>
46+
## Arduino <span class="simple">Simple<span class="foc">FOC</span>library</span> <i><small>v2.3.1</small></i>
6247
<iframe class="youtube" src="https://www.youtube.com/embed/Y5kLeqTc6Zk" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
6348
This video demonstrates the Simple FOC library basic usage, electronic connections and shows its capabilities.
6449

@@ -79,7 +64,7 @@ This video demonstrates the Simple FOC library basic usage, electronic connectio
7964
- **Cross-platform**:
8065
- Seamless code transfer from one microcontroller family to another
8166
- Supports multiple [MCU architectures](microcontrollers):
82-
- Arduino: UNO, MEGA, DUE, Leonardo ....
67+
- Arduino: UNO, MEGA, DUE, Leonardo, Nano, UNO R4, MKR ....
8368
- STM32
8469
- ESP32
8570
- Teensy

0 commit comments

Comments
 (0)