You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/simplefoc_library/code/current_sense/inline.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,7 @@ SAMD51 | ✔️
32
32
Teensy | ✔️
33
33
Raspberry Pi Pico | ✔️
34
34
Portenta H7 | ✔️
35
+
Renesas (UNO R4) | ❌ (TBD)
35
36
36
37
## Hardware configuration
37
38
To instantiate the inline current sensor using the <spanclass="simple">Simple<spanclass="foc">FOC</span>library</span> just create an instance of the class `InlineCurrentSense`.
### Where to place the `current_sense` configuration in your FOC code?
184
185
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.
186
187
187
188
So the suggested code structure would be:
188
189
@@ -207,6 +208,7 @@ void setup(){
207
208
}
208
209
```
209
210
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
+
210
212
### Alignment with the motor phases `driverAlign(...)`
211
213
212
214
The current sense and the driver alignment inside `initFOC` is done by calling the function:
<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.
- 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)
- 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`
- 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
0 commit comments