diff --git a/_config.yml b/_config.yml index 7f0a049..79cc276 100644 --- a/_config.yml +++ b/_config.yml @@ -53,6 +53,7 @@ ga_tracking: UA-55976594-3 plugins: - jekyll-seo-tag + - jekyll-toc compress_html: clippings: all @@ -61,3 +62,8 @@ compress_html: startings: [] blanklines: false profile: false + +toc: + ordered_list: false + list_class: toc-li + sublist_class: toc-li diff --git a/_includes/js/custom.js b/_includes/js/custom.js index 4ac551f..136a206 100644 --- a/_includes/js/custom.js +++ b/_includes/js/custom.js @@ -65,9 +65,12 @@ var classNames = [ "BLDCMotor", "StepperMotor", "BLDCDriver3PWM", + "SimpleFOCDebug", "BLDCDriver6PWM", "StepperDriver4PWM", "StepperDriver2PWM", + "BLCDriverXPWM", + "StepperDriverXPWM", "Encoder", "MagneticSensor", "MagneticSensorSPI", @@ -178,7 +181,8 @@ var funcNames = [ "scalar", "motion", "target", - "motor" + "motor", + "SIMPLEFOC_DEBUG" ]; var structNames = [ @@ -271,4 +275,20 @@ jtd.onReady(function(){ e.innerHTML = str; }); -}); \ No newline at end of file +}); + + + +function show(id,cls){ + Array.from(document.getElementsByClassName(cls)).forEach( + function(e){e.style.display = "none";}); + console.log(Array.from(document.getElementsByClassName(cls+"-"+id))); + Array.from(document.getElementsByClassName(cls+"-"+id)).forEach( + function(e){e.style.display = "block";}); + Array.from(document.getElementsByClassName("btn-"+cls)).forEach( + function(e){e.classList.remove("btn-primary");}); + Array.from(document.getElementsByClassName("btn-"+id)).forEach( + function(e){e.classList.add("btn-primary");}); + var elmnt = document.getElementById("btn-"+id); + if(elmnt) elmnt.classList.add("btn-primary"); +} diff --git a/_layouts/default.html b/_layouts/default.html index 9177409..bae2f0b 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -127,10 +127,23 @@ {% endif %} {% endunless %} -
- {% if site.heading_anchors != false %} +
+ {% if page.toc == true %} +
+ + On this page + + + + + + + {{ content | toc_only }} +
+ {% endif %} + {% if site.heading_anchors != false %} {% include vendor/anchor_headings.html html=content beforeHeading="true" anchorBody="" anchorClass="anchor-heading" %} - {% else %} + {% else %} {{ content }} {% endif %} {% if page.has_children == true and page.has_toc != false %} diff --git a/_sass/overrides.scss b/_sass/overrides.scss index 51639ce..cd2a93b 100644 --- a/_sass/overrides.scss +++ b/_sass/overrides.scss @@ -433,4 +433,80 @@ a.remove_dec{ .inline_block_top{ display: inline-block; vertical-align: top; +} + +.hide { + display: none; +} + + + +// custom inpage toc +.inpage_toc { + position:fixed; + right:20px; + background-color: rgb(252, 252, 252); + padding: 10px; + max-width: 300px; + z-index: 100; +} +.inpage_toc a { + text-overflow: ellipsis; + white-space: normal !important; +} + +.inpage_toc { + margin: 0.2em; + margin-left: 0.7em; + padding: 5px; + padding-left: 10px; + border-right: 5px solid; + border-radius: 3px; + color: #686969; + opacity: 0.95; +} +.inpage_toc summary{ + cursor: pointer; + font-size: 1em !important; + // text-transform: none !important; + color: #686969; + margin: 10px; +} +.inpage_toc ul{ + list-style-type: none; /* Remove bullets */ +} +details[open] .marker-open { + display: inline; +} +details[open] .marker-closed { + display: none; +} +details .marker-open { + display: none; +} +details .marker-closed { + display: inline; +} + +.inpage_toc .marker-closed{ +float: right; +} +.inpage_toc .marker-open{ + float: right; +} +#toc li { + // margin: 0px; + font-size: 0.95em; +} + /* Styles for larger screens (default open) */ + @media (min-width: 768px) { + .inpage_toc{ + display: block; + } +} +/* Styles for smaller screens (default closed) */ +@media (max-width: 767px) { + .inpage_toc{ + display: none; + } } \ No newline at end of file diff --git a/docs/boards/index.md b/docs/boards/index.md index 17c67e0..248407f 100644 --- a/docs/boards/index.md +++ b/docs/boards/index.md @@ -6,6 +6,7 @@ nav_order: 2 permalink: /boards has_children: true has_toc: false +toc: true --- # SimpleFOC Boards @@ -33,7 +34,7 @@ In addition to the official boards, there are many other boards compatible with These boards are designed to be compatible with the Arduino UNO R3 headers, enabling an easy to start experience with the SimpleFOClibrary and the Arduino IDE. The boards can be used with any board with the standard Arduino headers, such as the Arduino MEGA, STM32 Nucleo boards, Adafruit Metro, ESP32 D1 R3, Arudino UNO R4 and many others. This format enables usesr to easily exchange the microcontrollers and find the best solution for their application. The boards are fully open-source and the fabrication files are available in the respective repositories, as well as detailed guides on how to fabricate the boards yourself. The boards are additionally available in the [shop](https://www.simplefoc.com/shop) for those who prefer to buy them, as well as on other mainstream platforms like Aliexpress and Ebay (no relation to the SimpleFOCproject). -## SimpleFOCShield v3.2 - [Find out more](arduino_simplefoc_shield_showcase) +### SimpleFOCShield v3.2 - [Find out more](arduino_simplefoc_shield_showcase) ![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?color=blue) ![GitHub release (latest by date)](https://img.shields.io/github/v/release/simplefoc/arduino-simplefocshield) @@ -48,6 +49,7 @@ The SimpleFOCShield, in com ### Features +{: .no_toc } - **Plug & play**: In combination with Arduino *Simple**FOC**library* - [github](https://github.com/simplefoc/Arduino-FOC) - **Low-cost**: Price of 15-30€ - [Check the pricing](https://www.simplefoc.com/shop) - **In-line current sensing**: Up to 5Amps bidirectional @@ -72,7 +74,7 @@ The SimpleFOCShield, in com -## SimpleFOC PowerShield v0.2 ⚠️( development abandoned ) +### SimpleFOC PowerShield v0.2 ⚠️( development abandoned ) A powerful arduino shield for running BLDC motors using the FOC algorithm. This board is based on the [BTN8982](https://www.infineon.com/dgdl/Infineon-BTN8982TA-DS-v01_00-EN.pdf?fileId=db3a30433fa9412f013fbe32289b7c17) half bridges and can support currents up to 30 Amps continuos and 50Amps peak. Making it a board that can run virtually any BLDC motor. @@ -91,6 +93,7 @@ This does not mean that the board itself is not functional or that it will not w ### Features +{: .no_toc } - **Plug & play**: In combination with Arduino SimpleFOClibrary - **Low-cost**: Fabrication price under €25/pcs - **⚠️ will not be sold by silplefoc.com** - **High-side current sensing**: - not yet supported by *Simple**FOC**library* @@ -114,7 +117,7 @@ Read more about this board at [link](https://github.com/simplefoc/Arduino-Simple This is a set of miniature boards designed to be small, low-cost, and easy to use. They are intended for low power applications and are designed to be compatible with the SimpleFOClibrary. The boards are created as minimal working examples and are intended to be used as a reference design for the community to build upon. The boards are fully open-source and the fabrication files are available in the respective repositories, as well as detailed guides on how to fabricate the boards yourself. The boards are additionally available in the [shop](https://www.simplefoc.com/shop) for those who prefer to buy them, as well as on other mainstream platforms like Aliexpress and Ebay (no relation to the SimpleFOCproject).
-## SimpleFOCMini v1.1 - [Find out more](simplefocmini) +### SimpleFOCMini v1.1 - [Find out more](simplefocmini) ![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?color=blue) ![GitHub release (latest by date)](https://img.shields.io/github/v/release/simplefoc/simplefocmini) @@ -128,7 +131,8 @@ Small package, low-cost BLDC driver board fully compatible with the SimpleFOClibrary - **DRV8313 based** - [datasheet](https://www.ti.com/lit/ds/symlink/drv8313.pdf?ts=1650461862269&ref_url=https%253A%252F%252Fwww.google.com%252F) - Power supply: 8-35V @@ -149,7 +153,7 @@ Read more about this board at [link](https://github.com/simplefoc/SimpleFOCMini)
-## SimpleFOC StepMini v1.0 - [See on Github](https://github.com/simplefoc/SimpleFOC-StepMini) +### SimpleFOC StepMini v1.0 - [See on Github](https://github.com/simplefoc/SimpleFOC-StepMini) ![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?color=blue) ![GitHub release (latest by date)](https://img.shields.io/github/v/release/simplefoc/simplefoc-stepmini) @@ -160,7 +164,8 @@ Small package, low-cost Stepper driver board fully compatible with the -## Features +### Features +{: .no_toc } - **Plug & play**: In combination with Arduino SimpleFOClibrary - **DRV8844 based** - [datasheet](https://www.ti.com/lit/ds/symlink/drv8844.pdf) - Power supply: 8-35V diff --git a/docs/boards/simplefoc_mini/getting_started/code.md b/docs/boards/simplefoc_mini/getting_started/code.md index 717310a..8cfc2e2 100644 --- a/docs/boards/simplefoc_mini/getting_started/code.md +++ b/docs/boards/simplefoc_mini/getting_started/code.md @@ -7,8 +7,10 @@ nav_order: 2 permalink: /mini_code grand_parent: SimpleFOCMini grand_grand_parent: SimpleFOC Boards +toc: true --- + # Writing the code Once you have all the [hardware connected](mini_connect_hardware): - Microcontroller diff --git a/docs/boards/simplefoc_mini/getting_started/connecting/mini_v1.md b/docs/boards/simplefoc_mini/getting_started/connecting/mini_v1.md index f72b856..68c33f2 100644 --- a/docs/boards/simplefoc_mini/getting_started/connecting/mini_v1.md +++ b/docs/boards/simplefoc_mini/getting_started/connecting/mini_v1.md @@ -8,9 +8,11 @@ parent: Connecting the hardware grand_parent: Starting with Mini grand_grand_parent: SimpleFOCMini grand_grand_grand_parent: SimpleFOC Boards +toc: true --- + # Connecting the hardware to SimpleFOCMini v1 Connecting the SimpleFOCMini to the microcontroller, BLDC motor and power-supply is very straight forward. diff --git a/docs/boards/simplefoc_mini/getting_started/connecting/mini_v11.md b/docs/boards/simplefoc_mini/getting_started/connecting/mini_v11.md index 64a80f0..9596b5d 100644 --- a/docs/boards/simplefoc_mini/getting_started/connecting/mini_v11.md +++ b/docs/boards/simplefoc_mini/getting_started/connecting/mini_v11.md @@ -8,6 +8,7 @@ parent: Connecting the hardware grand_parent: Starting with Mini grand_grand_parent: SimpleFOCMini grand_grand_grand_parent: SimpleFOC Boards +toc: true --- # Connecting the hardware to SimpleFOCMini v1.1 diff --git a/docs/boards/simplefoc_mini/index.md b/docs/boards/simplefoc_mini/index.md index a39ce43..ede9955 100644 --- a/docs/boards/simplefoc_mini/index.md +++ b/docs/boards/simplefoc_mini/index.md @@ -7,6 +7,7 @@ nav_order: 2 permalink: /simplefocmini has_children: true has_toc: false +toc: true --- diff --git a/docs/boards/simplefoc_mini/mini_fabrication.md b/docs/boards/simplefoc_mini/mini_fabrication.md index 41bc877..c34cf82 100644 --- a/docs/boards/simplefoc_mini/mini_fabrication.md +++ b/docs/boards/simplefoc_mini/mini_fabrication.md @@ -8,6 +8,7 @@ nav_order: 2 permalink: /mini_fabrication has_children: true has_toc: false +toc: true --- diff --git a/docs/boards/simplefoc_shield/fabrication/shield_fabrication_v1.md b/docs/boards/simplefoc_shield/fabrication/shield_fabrication_v1.md index 32d7a03..84e4e95 100644 --- a/docs/boards/simplefoc_shield/fabrication/shield_fabrication_v1.md +++ b/docs/boards/simplefoc_shield/fabrication/shield_fabrication_v1.md @@ -7,7 +7,9 @@ grand_parent: SimpleFOCShieldSimpleFOC Boards nav_order: 1 permalink: /arduino_simplefoc_shield_fabrication_v1 +toc: true --- + # Fabrication guide for SimpleFOCShield v1.x Here is a quick guide how to fabricate the Arduino SimpleFOCShield [version V1.3.3](https://github.com/simplefoc/Arduino-SimpleFOCShield/releases) diff --git a/docs/boards/simplefoc_shield/fabrication/shield_fabrication_v2.md b/docs/boards/simplefoc_shield/fabrication/shield_fabrication_v2.md index 13f4d8c..d0cb015 100644 --- a/docs/boards/simplefoc_shield/fabrication/shield_fabrication_v2.md +++ b/docs/boards/simplefoc_shield/fabrication/shield_fabrication_v2.md @@ -7,7 +7,9 @@ grand_parent: SimpleFOCShieldSimpleFOC Boards nav_order: 2 permalink: /arduino_simplefoc_shield_fabrication_v2 +toc: true --- + # Fabrication guide for SimpleFOCShield v2.x Here is a quick guide how to fabricate the Arduino SimpleFOCShield [version V2.0.4](https://github.com/simplefoc/Arduino-SimpleFOCShield/releases) diff --git a/docs/boards/simplefoc_shield/fabrication/shield_fabrication_v3.md b/docs/boards/simplefoc_shield/fabrication/shield_fabrication_v3.md index 79e89c5..1d3bafe 100644 --- a/docs/boards/simplefoc_shield/fabrication/shield_fabrication_v3.md +++ b/docs/boards/simplefoc_shield/fabrication/shield_fabrication_v3.md @@ -7,7 +7,9 @@ grand_parent: SimpleFOCShieldSimpleFOC Boards nav_order: 3 permalink: /arduino_simplefoc_shield_fabrication_v3 +toc: true --- + # Fabrication guide for SimpleFOCShield v3.x Here is a quick guide how to fabricate the Arduino SimpleFOCShield [version V3.2](https://github.com/simplefoc/Arduino-SimpleFOCShield/releases) diff --git a/docs/boards/simplefoc_shield/getting_started/code.md b/docs/boards/simplefoc_shield/getting_started/code.md index 8a850a2..762cb54 100644 --- a/docs/boards/simplefoc_shield/getting_started/code.md +++ b/docs/boards/simplefoc_shield/getting_started/code.md @@ -7,6 +7,7 @@ nav_order: 3 permalink: /foc_shield_code grand_parent: SimpleFOCShield grand_grand_parent: SimpleFOC Boards +toc: true --- # Writing the code diff --git a/docs/boards/simplefoc_shield/getting_started/connections.md b/docs/boards/simplefoc_shield/getting_started/connections.md index b7a682e..cf4141e 100644 --- a/docs/boards/simplefoc_shield/getting_started/connections.md +++ b/docs/boards/simplefoc_shield/getting_started/connections.md @@ -7,6 +7,7 @@ nav_order: 2 permalink: /foc_shield_connect_hardware grand_parent: SimpleFOCShield grand_grand_parent: SimpleFOC Boards +toc: true --- # Connecting the hardware diff --git a/docs/boards/simplefoc_shield/getting_started/soldering_pads/pads_v1.md b/docs/boards/simplefoc_shield/getting_started/soldering_pads/pads_v1.md index 7be7638..cf36b15 100644 --- a/docs/boards/simplefoc_shield/getting_started/soldering_pads/pads_v1.md +++ b/docs/boards/simplefoc_shield/getting_started/soldering_pads/pads_v1.md @@ -8,7 +8,9 @@ nav_order: 1 permalink: /pads_soldering_v1 grand_grand_parent: SimpleFOCShield grand_grand_grand_parent: SimpleFOC Boards +toc: true --- + # Hardware configuration using soldering pads
SimpleFOCShield v1 One of the very important features of the Arduino SimpleFOCShield is the hardware configuration. diff --git a/docs/boards/simplefoc_shield/getting_started/soldering_pads/pads_v2.md b/docs/boards/simplefoc_shield/getting_started/soldering_pads/pads_v2.md index 771037b..c6b3d73 100644 --- a/docs/boards/simplefoc_shield/getting_started/soldering_pads/pads_v2.md +++ b/docs/boards/simplefoc_shield/getting_started/soldering_pads/pads_v2.md @@ -8,7 +8,9 @@ nav_order: 2 permalink: /pads_soldering_v2 grand_grand_parent: SimpleFOCShield grand_grand_grand_parent: SimpleFOC Boards +toc: true --- + # Hardware configuration using soldering pads
SimpleFOCShield v2 One of the very important features of the Arduino SimpleFOCShield is the hardware configuration. diff --git a/docs/boards/simplefoc_shield/getting_started/soldering_pads/pads_v3.md b/docs/boards/simplefoc_shield/getting_started/soldering_pads/pads_v3.md index de369fa..c535cf9 100644 --- a/docs/boards/simplefoc_shield/getting_started/soldering_pads/pads_v3.md +++ b/docs/boards/simplefoc_shield/getting_started/soldering_pads/pads_v3.md @@ -8,6 +8,7 @@ nav_order: 3 permalink: /pads_soldering_v3 grand_grand_parent: SimpleFOCShield grand_grand_grand_parent: SimpleFOC Boards +toc: true --- +SimpleFOCMini V1.0 +SimpleFOCMini V1.1 -SimpleFOCMini V1.0 -SimpleFOCMini V1.1

-

+

## Encoder - Channels `A` and `B` are connected to the Arduino UNO pins `2` and `3`. @@ -55,10 +41,13 @@ Choose your SimpleFOCMini v - Motor phases `a`, `b` and `c` are connected directly the motor terminal connector connectors `M1`, `M2` and `M3` of the SimpleFOCMini board -
+## SimpleFOCMini -## SimpleFOCMini v1.0 +SimpleFOCMini V1.0 +SimpleFOCMini V1.1 + +
- The most convenient way of plugging the SimpleFOCMini v1.0 board to the Arduino UNO is to stack it on its pins `8-12`. - `GND` - `12` - `IN1` - `11` @@ -73,9 +62,7 @@ Pin `12` is not a real ground pin. As no power is transferred through the mini's
-
- -## SimpleFOCMini v1.1 +
- The most convenient way of plugging the SimpleFOCMini v1.1 board to the Arduino UNO is to stack it on its pins `9-12`. - `GND` - `GND` @@ -88,7 +75,7 @@ Pin `12` is not a real ground pin. As no power is transferred through the mini's -### Small motivation :D +# Small motivation :D

@@ -127,6 +114,10 @@ And that is it, let's setup the motor. ## Motor code + +SimpleFOCMini V1.0 +SimpleFOCMini V1.1 + First we need to define the `BLDCMotor` class with the number od pole pairs (`11`) ```cpp // define BLDC motor @@ -134,7 +125,7 @@ BLDCMotor motor = BLDCMotor(11); ```
If you are not sure what your pole pairs number is please check the find_pole_pairs.ino example.
-
+
Next we need to define the `BLDCDriver3PWM` class with the PWM pin numbers of the motor and the driver enable pin ```cpp @@ -329,7 +320,7 @@ void loop() {
-
+
```cpp #include diff --git a/docs/simplefoc_library/examples/position_control_example_mini_nucleo.md b/docs/simplefoc_library/examples/position_control_example_mini_nucleo.md index ff13da2..2b831dd 100644 --- a/docs/simplefoc_library/examples/position_control_example_mini_nucleo.md +++ b/docs/simplefoc_library/examples/position_control_example_mini_nucleo.md @@ -6,9 +6,11 @@ description: "Arduino Simple Field Oriented Control (FOC) library ." nav_order: 10 permalink: /mini_example_nucleo grand_parent: Arduino SimpleFOClibrary +toc: true --- + # Position control example
using SimpleFOCMini For this BLDC motor position control example we are going to be using this hardware: @@ -24,30 +26,11 @@ For more information about the SimpleFOC< Choose your SimpleFOCMini version: - - - - - -SimpleFOCMini V1.0 -SimpleFOCMini V1.1 +SimpleFOCMini V1.0 +SimpleFOCMini V1.1

-

+

## Encoder - Channels `A` and `B` are connected to the Arduino UNO pins `2` and `3`. @@ -55,10 +38,12 @@ Choose your SimpleFOCMini v ## Motor - Motor phases `a`, `b` and `c` are connected directly the motor terminal connector connectors `M1`, `M2` and `M3` of the SimpleFOCMini board +## SimpleFOCMini -
+SimpleFOCMini V1.0 +SimpleFOCMini V1.1 -## SimpleFOCMini v1.0 +
- The most convenient way of plugging the SimpleFOCMini board to the Nucleo board is to stack it on its pins `10-13`. - `GND` - `GND` @@ -70,9 +55,7 @@ Choose your SimpleFOCMini v
-
- -## SimpleFOCMini v1.1 +
- The most convenient way of plugging the SimpleFOCMini board to the Nucleo board is to stack it on its pins `10-13`. - `GND` - `GND` @@ -118,6 +101,11 @@ And that is it, let's setup the motor. ## Motor code + + +SimpleFOCMini V1.0 +SimpleFOCMini V1.1 + First we need to define the `BLDCMotor` class with the number od pole pairs (`11`) ```cpp // define BLDC motor @@ -136,7 +124,7 @@ Next we need to define the `BLDCDriver3PWM` class with the PWM pin numbers of th BLDCDriver3PWM driver = BLDCDriver3PWM(13, 12, 11, 10); ```
-
+
```cpp // define BLDC driver @@ -219,6 +207,10 @@ That is it, let's see the full code now! To the full code I have added a small serial [commander interface](commander_interface), to be able to change position/angle target value in real time. + +SimpleFOCMini V1.0 +SimpleFOCMini V1.1 +
```cpp @@ -309,7 +301,7 @@ void loop() {
-
+
```cpp #include diff --git a/docs/simplefoc_library/examples/position_control_example_nucleo.md b/docs/simplefoc_library/examples/position_control_example_nucleo.md index 440c518..f7121fe 100644 --- a/docs/simplefoc_library/examples/position_control_example_nucleo.md +++ b/docs/simplefoc_library/examples/position_control_example_nucleo.md @@ -6,9 +6,11 @@ description: "Arduino Simple Field Oriented Control (FOC) library ." nav_order: 5 permalink: /position_control_nucleo_example grand_parent: Arduino SimpleFOClibrary +toc: true --- + # Position control example
using SimpleFOCShield and Stm32 Nucleo-64 For this BLDC motor position control example we are going to be using this hardware: diff --git a/docs/simplefoc_library/examples/stepper_control_nucleo.md b/docs/simplefoc_library/examples/stepper_control_nucleo.md index d6659cc..1515d81 100644 --- a/docs/simplefoc_library/examples/stepper_control_nucleo.md +++ b/docs/simplefoc_library/examples/stepper_control_nucleo.md @@ -6,9 +6,11 @@ description: "Arduino Simple Field Oriented Control (FOC) library ." nav_order: 8 permalink: /stepper_control_nucleo grand_parent: Arduino SimpleFOClibrary +toc: true --- + # Stepper motor control example
using L298N and Stm32 Nucleo-64 For this stepper motor control example we are going to be using this hardware: diff --git a/docs/simplefoc_library/examples/velocity_control_example.md b/docs/simplefoc_library/examples/velocity_control_example.md index cd0faba..10f9aa9 100644 --- a/docs/simplefoc_library/examples/velocity_control_example.md +++ b/docs/simplefoc_library/examples/velocity_control_example.md @@ -6,8 +6,10 @@ description: "Arduino Simple Field Oriented Control (FOC) library ." nav_order: 2 permalink: /velocity_control_example grand_parent: Arduino SimpleFOClibrary +toc: true --- + # Velocity control example
using Drotek's L6234 driver [Drotek's L6234 breakout board](https://store-drotek.com/212-brushless-gimbal-controller-l6234.html) is a very minimalistic 3-phase BLDC motor driver and is very suitable for jump-starting your FOC experience. Here we the velocity control example project using the SimpleFOClibrary and this hardware: diff --git a/docs/simplefoc_library/hardware/drivers/BLDC_drivers.md b/docs/simplefoc_library/hardware/drivers/BLDC_drivers.md index c2bebec..3717383 100644 --- a/docs/simplefoc_library/hardware/drivers/BLDC_drivers.md +++ b/docs/simplefoc_library/hardware/drivers/BLDC_drivers.md @@ -7,8 +7,10 @@ permalink: /bldc_drivers parent: Drivers grand_parent: Supported Hardware grand_grand_parent: Arduino SimpleFOClibrary +toc: true --- + # BLDC motor drivers This library will be compatible with most 3 phase BLDC motor drivers. Such as [ L6234](https://www.st.com/en/motor-drivers/l6234.html), [ DRV8305](https://www.ti.com/product/DRV8305), [ DRV8313](https://www.ti.com/product/DRV8313) or even [ L293](http://www.ti.com/lit/ds/symlink/l293.pdf). diff --git a/docs/simplefoc_library/hardware/mcus/esp32.md b/docs/simplefoc_library/hardware/mcus/esp32.md index e0118de..e9f61dc 100644 --- a/docs/simplefoc_library/hardware/mcus/esp32.md +++ b/docs/simplefoc_library/hardware/mcus/esp32.md @@ -11,18 +11,30 @@ grand_grand_parent: Arduino SimpleFOCSimpleFOClibrary and will work with all driver types. -
+### PWM drivers + +Esp32 mcus have two different low-level drivers for PWM generation: `MCPWM` and `LEDC`. The `MCPWM` driver (**M**otor **C**ontrol **PWM**) is a more advanced driver that allows more control over the PWM signals and is used by default in the SimpleFOClibrary. The `LEDC` driver is a simpler driver that is by default intended for LED control but can also be used for motor control. The `LEDC` driver is a lot les flexible than the `MCPWM` driver but SimpleFOClibrary supports it as well. By default the `MCPWM` driver is used on all other esp32 devices if available, if not the `LEDC` driver is used (ex. esp32-s2 and esp32-c3 devices). +If you are using an esp32 device that supports the `MCPWM` driver and you want to use the `LEDC` driver, you can force the use of the `LEDC` driver by defining the `SIMPLEFOC_ESP32_USELEDC` build flag. + +

RULE OF THUMB: `MCPWM` vs `LEDC`

+If you are using an esp32 device that supports the `MCPWM` driver, it is recommended to use it. The `MCPWM` driver is more flexible and allows more control over the PWM signals. If you are using an esp32 device that does not support the `MCPWM` driver, the `LEDC` driver can be used as well. +
+ + +

BEWARE

-From the SimpleFOClibrary version v2.2.1, the library requires the esp32 arduino package version v2.0.1+ +From the SimpleFOClibrary version v2.3.4, the library requires the esp32 arduino package version v3.x
Some example esp32 based boards: diff --git a/docs/simplefoc_library/hardware/mcus/index.md b/docs/simplefoc_library/hardware/mcus/index.md index 66541af..e23603c 100644 --- a/docs/simplefoc_library/hardware/mcus/index.md +++ b/docs/simplefoc_library/hardware/mcus/index.md @@ -8,8 +8,10 @@ parent: Supported Hardware grand_parent: Arduino SimpleFOClibrary has_children: true has_toc: false +toc: true --- + # Supported microcontrollers Arduino SimpleFOClibrary allows you to chose from more than 20 architectures of microcontrollers to chose from for your projects.
@@ -37,7 +39,7 @@ Arduino (8-bit) | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ (either 4kHz or 32k Arduino DUE | ✔️ | ✔️ | ✔️ | ❌ | ✔️ stm32 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ esp32 MCPWM | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ -esp32 LEDC | ✔️ | ✔️ | ✔️ | ❌ | ✔️ +esp32 LEDC | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ esp8266 | ✔️ | ✔️ | ✔️ | ❌ | ✔️ samd21/51 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ teensy | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ diff --git a/docs/simplefoc_library/hardware/motors/BLDC_motors.md b/docs/simplefoc_library/hardware/motors/BLDC_motors.md index 42ce38e..2c6149b 100644 --- a/docs/simplefoc_library/hardware/motors/BLDC_motors.md +++ b/docs/simplefoc_library/hardware/motors/BLDC_motors.md @@ -7,8 +7,10 @@ permalink: /bldc_motors parent: Motors grand_parent: Supported Hardware grand_grand_parent: Arduino SimpleFOClibrary +toc: true --- + # BLDC motors Arduino SimpleFOClibrary supports most of the common 3 phase BLDC motors, both diff --git a/docs/simplefoc_library/hardware/motors/stepper_motors.md b/docs/simplefoc_library/hardware/motors/stepper_motors.md index 357f035..90858c6 100644 --- a/docs/simplefoc_library/hardware/motors/stepper_motors.md +++ b/docs/simplefoc_library/hardware/motors/stepper_motors.md @@ -7,8 +7,10 @@ permalink: /stepper_motors parent: Motors grand_parent: Supported Hardware grand_grand_parent: Arduino SimpleFOClibrary +toc: true --- + # Stepper motors Arduino SimpleFOClibrary supports most of common stepper motors out there. diff --git a/docs/simplefoc_library/hardware/sensors.md b/docs/simplefoc_library/hardware/sensors.md index 6efc86f..696aa6b 100644 --- a/docs/simplefoc_library/hardware/sensors.md +++ b/docs/simplefoc_library/hardware/sensors.md @@ -6,8 +6,10 @@ parent: Supported Hardware description: "Arduino Simple Field Oriented Control (FOC) library ." permalink: /position_sensors grand_parent: Arduino SimpleFOClibrary +toc: true --- + # Position sensors The library currently supports the following types of position sensors: - [Encoder](#encoders) diff --git a/docs/simplefoc_library/hardware/setup_examples/arduino_l6234.md b/docs/simplefoc_library/hardware/setup_examples/arduino_l6234.md index 31caf1d..63e2f02 100644 --- a/docs/simplefoc_library/hardware/setup_examples/arduino_l6234.md +++ b/docs/simplefoc_library/hardware/setup_examples/arduino_l6234.md @@ -7,8 +7,10 @@ nav_order: 2 permalink: /arduino_l6234 grand_parent: Supported Hardware grand_grand_parent: Arduino SimpleFOClibrary +toc: true --- + # Arduino UNO + L6234 driver [Drotek's L6234 breakout board](https://store-drotek.com/212-brushless-gimbal-controller-l6234.html) is a very minimalistic 3-phase BLDC motor driver and is very suitable for jump-starting your FOC experience. Here we show two example connections using this board and Arduino UNO: - [Arduino UNO + Drotek L6134 + Encoder](#encoder-example) diff --git a/docs/simplefoc_library/hardware/setup_examples/bluepill_conneciton.md b/docs/simplefoc_library/hardware/setup_examples/bluepill_conneciton.md index 481a7ac..b43f34c 100644 --- a/docs/simplefoc_library/hardware/setup_examples/bluepill_conneciton.md +++ b/docs/simplefoc_library/hardware/setup_examples/bluepill_conneciton.md @@ -7,9 +7,11 @@ nav_order: 5 permalink: /bluepill_connection grand_parent: Supported Hardware grand_grand_parent: Arduino SimpleFOClibrary +toc: true --- + # Stm32 Bluepill using the Arduino SimpleFOCShield The SimpleFOCShield, being a BLDC driver, can be used not just with boards with Arduino UNO headers but also as a stand alone driver board. diff --git a/docs/simplefoc_library/hardware/setup_examples/drv8302.md b/docs/simplefoc_library/hardware/setup_examples/drv8302.md index d36fce7..186d37b 100644 --- a/docs/simplefoc_library/hardware/setup_examples/drv8302.md +++ b/docs/simplefoc_library/hardware/setup_examples/drv8302.md @@ -7,9 +7,11 @@ nav_order: 6 permalink: /drv8302_connection grand_parent: Supported Hardware grand_grand_parent: Arduino SimpleFOClibrary +toc: true --- + # DRV8302 driver with Arduino UNO DRV8302 is a high performance BLDC driver board capable of delivering 15A current continuously and 27A peak current. It has temperature and over-current protection, it has Back EMF and three phase current sensing and last but not the least it can be run using only 3 PWM signals making it compatible with the SimpleFOClibrary. diff --git a/docs/simplefoc_library/hardware/setup_examples/foc_shield.md b/docs/simplefoc_library/hardware/setup_examples/foc_shield.md index 5493510..d7833a4 100644 --- a/docs/simplefoc_library/hardware/setup_examples/foc_shield.md +++ b/docs/simplefoc_library/hardware/setup_examples/foc_shield.md @@ -7,9 +7,11 @@ nav_order: 1 permalink: /arduino_simplefoc_shield grand_parent: Supported Hardware grand_grand_parent: Arduino SimpleFOClibrary +toc: true --- + # Arduino SimpleFOCShield example The SimpleFOCShield, being Arduino UNO shield, is compatible with any type of board with the same headers. Essentially, it is a L6234 chip breakout board made in a form of Arduino Shield. diff --git a/docs/simplefoc_library/hardware/setup_examples/hmbgc.md b/docs/simplefoc_library/hardware/setup_examples/hmbgc.md index daaddd5..3b8291b 100644 --- a/docs/simplefoc_library/hardware/setup_examples/hmbgc.md +++ b/docs/simplefoc_library/hardware/setup_examples/hmbgc.md @@ -7,9 +7,11 @@ nav_order: 3 permalink: /hmbgc grand_parent: Supported Hardware grand_grand_parent: Arduino SimpleFOClibrary +toc: true --- + # HMBGC V2.2 example To use HMBGC controller for vector control (FOC) you need to connect motor to one of the motor terminals and connect the encoder to the analog pins. Following pictures show the schematic of the HMBGC board necessary connections and the one real example of the connection. diff --git a/docs/simplefoc_library/hardware/setup_examples/nucleo_conneciton.md b/docs/simplefoc_library/hardware/setup_examples/nucleo_conneciton.md index 70eefe7..9558bf6 100644 --- a/docs/simplefoc_library/hardware/setup_examples/nucleo_conneciton.md +++ b/docs/simplefoc_library/hardware/setup_examples/nucleo_conneciton.md @@ -7,9 +7,11 @@ nav_order: 4 permalink: /nucleo_connection grand_parent: Supported Hardware grand_grand_parent: Arduino SimpleFOClibrary +toc: true --- + # Stm32 Nucleo-64 using the Arduino SimpleFOCShield The SimpleFOCShield, being Arduino UNO shield, is compatible with any type of board with the same headers and one of them are STM32 Nucleo-64 boards. diff --git a/docs/simplefoc_library/index.md b/docs/simplefoc_library/index.md index 50c9575..1021e3d 100644 --- a/docs/simplefoc_library/index.md +++ b/docs/simplefoc_library/index.md @@ -6,13 +6,16 @@ nav_order: 3 permalink: /arduino_simplefoc_library_showcase has_children: True has_toc: False +toc: true --- + # Arduino SimpleFOClibrary ![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg) ![arduino-library-badge](https://ardubadge.simplefoc.com?lib=Simple%20FOC) +![PlatformIO Registry](https://badges.registry.platformio.org/packages/askuric/library/Simple%20FOC.svg) [![status](https://joss.theoj.org/papers/4382445f249e064e9f0a7f6c1bb06b1d/status.svg)](https://joss.theoj.org/papers/4382445f249e064e9f0a7f6c1bb06b1d) @@ -132,10 +135,8 @@ GBM4108-120T diff --git a/docs/simplefoc_library/installation/library_download.md b/docs/simplefoc_library/installation/library_download.md index 6b38172..ae6c04b 100644 --- a/docs/simplefoc_library/installation/library_download.md +++ b/docs/simplefoc_library/installation/library_download.md @@ -6,8 +6,10 @@ nav_order: 1 description: "Arduino Simple Field Oriented Control (FOC) library ." permalink: /library_download grand_parent: Arduino SimpleFOClibrary +toc: true --- + # Installing SimpleFOClibrary ## Arduino Library Manager installation diff --git a/docs/simplefoc_library/installation/library_platformio.md b/docs/simplefoc_library/installation/library_platformio.md index e9f98b5..d874355 100644 --- a/docs/simplefoc_library/installation/library_platformio.md +++ b/docs/simplefoc_library/installation/library_platformio.md @@ -6,8 +6,10 @@ nav_order: 2 description: "Arduino Simple Field Oriented Control (FOC) library ." permalink: /library_platformio grand_parent: Arduino SimpleFOClibrary +toc: true --- + # Installing SimpleFOClibrary with PlatformIO Using SimpleFOC from PlatformIO is not hard at all! The following instructions should get you set up and compiling your code in a matter of minutes. diff --git a/docs/simplefoc_library/cheatsheet/build_flags.md b/docs/simplefoc_library/practical/cheatsheet/build_flags.md similarity index 96% rename from docs/simplefoc_library/cheatsheet/build_flags.md rename to docs/simplefoc_library/practical/cheatsheet/build_flags.md index 4cb6063..822e000 100644 --- a/docs/simplefoc_library/cheatsheet/build_flags.md +++ b/docs/simplefoc_library/practical/cheatsheet/build_flags.md @@ -4,7 +4,8 @@ title: Build Flags nav_order: 2 permalink: /cheetsheet/build_flags parent: Options Cheat Sheet -grand_parent: Arduino SimpleFOClibrary +grand_parent: Practical guides +grand_grand_parent: Arduino SimpleFOClibrary has_children: False has_toc: False --- diff --git a/docs/simplefoc_library/cheatsheet/index.md b/docs/simplefoc_library/practical/cheatsheet/index.md similarity index 82% rename from docs/simplefoc_library/cheatsheet/index.md rename to docs/simplefoc_library/practical/cheatsheet/index.md index f993aec..45524f5 100644 --- a/docs/simplefoc_library/cheatsheet/index.md +++ b/docs/simplefoc_library/practical/cheatsheet/index.md @@ -3,7 +3,8 @@ layout: default title: Options Cheat Sheet nav_order: 9 permalink: /options_cheetsheet -parent: Arduino SimpleFOClibrary +parent: Practical guides +grand_parent: Arduino SimpleFOClibrary has_children: True has_toc: False --- diff --git a/docs/simplefoc_library/cheatsheet/options.md b/docs/simplefoc_library/practical/cheatsheet/options.md similarity index 97% rename from docs/simplefoc_library/cheatsheet/options.md rename to docs/simplefoc_library/practical/cheatsheet/options.md index f1786f2..dd4ae0a 100644 --- a/docs/simplefoc_library/cheatsheet/options.md +++ b/docs/simplefoc_library/practical/cheatsheet/options.md @@ -4,12 +4,15 @@ title: Options Reference nav_order: 1 permalink: /cheetsheet/options_reference parent: Options Cheat Sheet -grand_parent: Arduino SimpleFOClibrary +grand_parent: Practical guides +grand_grand_parent: Arduino SimpleFOClibrary has_children: False has_toc: False +toc: true --- + # Options SimpleFOClibrary has many options, and the following tables summarize the important ones, collected in one convenient place for your immediate reference. diff --git a/docs/simplefoc_library/digging_deeper/practical/choosing_pins.md b/docs/simplefoc_library/practical/choosing_pins.md similarity index 85% rename from docs/simplefoc_library/digging_deeper/practical/choosing_pins.md rename to docs/simplefoc_library/practical/choosing_pins.md index c9b3682..34f8574 100644 --- a/docs/simplefoc_library/digging_deeper/practical/choosing_pins.md +++ b/docs/simplefoc_library/practical/choosing_pins.md @@ -5,10 +5,11 @@ nav_order: 3 description: "Arduino Simple Field Oriented Control (FOC) library ." permalink: /choosing_pwm_pins parent: Practical guides -grand_parent: Digging deeper -grand_grand_parent: Arduino SimpleFOClibrary +grand_parent: Arduino SimpleFOClibrary +toc: true --- + # A short guide to choosing PWM pins for your application When it comes to choosing pins for your application, there are a few things to consider. The most important thing is to make sure that the pins you choose are compatible with the hardware you are using. @@ -23,21 +24,21 @@ In this guide we will focus on the first question: **Which pins to use for PWM g The answer to these questions depends on the microcontroller you are using and the hardware you have. Here is the list of microcontroller families supported by SimpleFOC and the PWM generation modes supported by each of them: -MCU | 2 PWM mode | 4 PWM mode | 3 PWM mode | 6 PWM mode | pwm frequency config | Timer synced ---- | --- |--- |--- |--- |--- |---- -Arduino AVR (8-bit) | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ (either 4kHz or 32kHz) | ✔️ -Arduino DUE | ✔️ | ✔️ | ✔️ | ❌ | ✔️ | ❌ -stm32 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ -esp32 MCPWM | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ -esp32 LEDC | ✔️ | ✔️ | ✔️ | ❌ | ✔️ | ❌ -esp8266 | ✔️ | ✔️ | ✔️ | ❌ | ✔️ | ❌ -samd21/51 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ❌ (only 6PWM ✔️) -teensy3 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ❌ (only 6PWM ✔️) -teensy4 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ❌(6PWM and 3PWM if forced ✔️) -Raspberry Pi Pico | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ❌ (only 6PWM ✔️) -Portenta H7 | ✔️ | ✔️ | ✔️ | ❌ | ✔️ | ❌ -nRF52 |✔️ | ✔️ | ✔️ | ✔️ | ✔️| ❌ (only 6PWM ✔️) -Renesas (UNO R4 Minima) | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ❌ (only 6PWM ✔️) +MCU | 2 PWM mode | 4 PWM mode | 3 PWM mode | 6 PWM mode | PWM frequency config | PWM center align | Timer-ADC sync +--- | --- |--- |--- |--- |--- |----|---- +Arduino AVR (8-bit) | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ (4kHz or 32kHz) | ✔️ | ❌ +Arduino DUE | ✔️ | ✔️ | ✔️ | ❌ | ✔️ | ❌ | ❌ +stm32 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ +esp32 MCPWM | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ +esp32 LEDC | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ❌ +esp8266 | ✔️ | ✔️ | ✔️ | ❌ | ✔️ | ❌ | ❌ +samd21/51 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ❌ (2/3/4PWM)
✔️ (6PWM) | ❌ +teensy3 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ❌ (2/3/4PWM)
✔️ (6PWM) | ❌ +teensy4 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ❌(2/3/4PWM)
✔️ (6PWM)
✔️(3PWM forced) | ❌(2/3/4PWM)
✔️(6PWM)
✔️(3PWM aligned) +Raspberry Pi Pico | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ❌ (2/3/4PWM)
✔️ (6PWM) | ❌ +Portenta H7 | ✔️ | ✔️ | ✔️ | ❌ | ✔️ | ❌ | ❌ +nRF52 |✔️ | ✔️ | ✔️ | ✔️ | ✔️| ❌ (2/3/4PWM)
✔️ (6PWM) |❌ +Renesas (UNO R4 Minima) | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ❌ (2/3/4PWM)
✔️ (6PWM) | ❌ What is important to see is that all the supported families can be used with 2/3/4PWM modes. However, not all the architectures support 6PWM mode. Additionally, the PWM frequency can be configured for all the supported architectures, but for Arduino AVR boards, the frequency can be set to either 4kHz or 32kHz. @@ -48,8 +49,12 @@ The rule of thumb: - For 4PWM mode, try using only one timer if possible, if not use one timer per phase (so two timers). - For 6PWM mode, try using only one timer if possible, if not use one timer per phase (so three timers). -
-SimpleFOC does synchronise the PWM signals generated by different timers in some cases (as shown on the table above), but it is always better to use the pins that belong to the same timer. +

BEWARE: PWM center alignment

+SimpleFOC does synchronise (center-align) the PWM signals generated by different timers in some cases (as shown on the table above), but it is always better to use the pins that belong to the same timer. +
+ +

BEWARE: Timer-ADC sync - low-side current sensing

+Timer and ADC synchronisation, required for low-side current sensing is only avaliable for certain families of microcontrollers: stm32, esp32 (`MCPWM` based) and Teesny 4.
The information about the timers associated with the pins is sometimes hard to obtain, especially for less experienced users. So in the next few sections we will provide some information on how to find the PWM pins for some of the most popular microcontroller families. @@ -105,6 +110,7 @@ So if using one of these boards with 6PWM make sure to use the High/Low pair of ## ESP32 boards Esp32 boards have two PWM generation modules: `LEDC` and `MCPWM`. The `LEDC` module is used for generating PWM signals for LEDs, but it can also be used for motor control. The `MCPWM` module is specifically designed for motor control. +Even though `LEDC` is far less flexible than `MCPWM`, it still enables running all drivers supported by the SimpleFOClibrary. However, with `LEDC` you will not be able to use low-side current sensing, as the timers cannot bve synced with the ADCs. ### MCPWM module So when using esp32 boards that have `MCPWM` module (ex. `esp32` and `esp32s3`) you can use any of the pins for any form of PWM generation. This module allows the esp32 to be very flexible and allows for any pin to be used in PWM mode as well as to be associated to any timer. Typically, esp32 boards have 2 `MCPWM` independent modules allowing to instantiate: @@ -130,7 +136,7 @@ ESP32-P4 | ? --> All the esp32 architecture that have the `MCPWM` will by default use `MCPWM` for motor control. ### LEDC module -However, if using the boards that only support the `LEDC` module (ex. `esp32s2` and `esp32c3`), you will not be able to use the 6PWM mode. You will still be able to use 2PWM, 3PWM and 4PWM modes. `LEDC` times usually have 8 channels and different boards have different number of channels and timers available. All the pins can be used for PWM generation, but first 8 pins are associated with the first timer, the next 8 pins with the second timer and so on. +However, if using the boards that only support the `LEDC` module (ex. `esp32s2` and `esp32c3`), you will not be able to use it for most of the motor control modes. The `LEDC` module is not as flexible as the `MCPWM` module and it is not recommended for motor control applications. You will still be able to use 2PWM, 3PWM, 4PWM and 6PWM modes. `LEDC` timers usually have 8 channels and different boards have different number of channels and timers available. All the pins can be used for PWM generation, but first 8 pins are associated with the first timer, the next 8 pins with the second timer and so on. Here is the list of the number of channels available for different esp32 chips, taken from the [esp32 technical reference manual](https://espressif-docs.readthedocs-hosted.com/projects/arduino-esp32/en/latest/api/ledc.html): diff --git a/docs/simplefoc_library/digging_deeper/practical/choosing_pins_adc.md b/docs/simplefoc_library/practical/choosing_pins_adc.md similarity index 98% rename from docs/simplefoc_library/digging_deeper/practical/choosing_pins_adc.md rename to docs/simplefoc_library/practical/choosing_pins_adc.md index 5bdda9a..354d095 100644 --- a/docs/simplefoc_library/digging_deeper/practical/choosing_pins_adc.md +++ b/docs/simplefoc_library/practical/choosing_pins_adc.md @@ -5,10 +5,11 @@ nav_order: 4 description: "Arduino Simple Field Oriented Control (FOC) library ." permalink: /choosing_adc_pins parent: Practical guides -grand_parent: Digging deeper -grand_grand_parent: Arduino SimpleFOClibrary +grand_parent: Arduino SimpleFOClibrary +toc: true --- + # A short guide to choosing Analog pins for your application When it comes to choosing pins for your application, there are a few things to consider. The most important thing is to make sure that the pins you choose are compatible with the hardware you are using. diff --git a/docs/simplefoc_library/digging_deeper/practical/index.md b/docs/simplefoc_library/practical/index.md similarity index 71% rename from docs/simplefoc_library/digging_deeper/practical/index.md rename to docs/simplefoc_library/practical/index.md index bdaa303..7fc68fc 100644 --- a/docs/simplefoc_library/digging_deeper/practical/index.md +++ b/docs/simplefoc_library/practical/index.md @@ -1,10 +1,9 @@ --- layout: default title: Practical guides -parent: Digging deeper -grand_parent: Arduino SimpleFOClibrary +parent: Arduino SimpleFOClibrary description: "Arduino Simple Field Oriented Control (FOC) library ." -nav_order: 4 +nav_order: 5 permalink: /practical_guides has_children: True has_toc: False @@ -16,8 +15,13 @@ This is the section intended for the practical guides and explanations of differ Additionally, there are many different useful practical information already available on our community servers -
read more. We encourage you to check it out and feel free to ask any questions you might have. - -
+
+
+ +

Library options and build flags cheat-sheet

+
+

A guide to different options and build flags of the library.

+
-
+
+ +

Units in the library

+
+

A short guide the units for the main motor/sensor parameters and control variables and how to transfor them

+
+
diff --git a/docs/simplefoc_library/practical/library_units.md b/docs/simplefoc_library/practical/library_units.md new file mode 100644 index 0000000..fb3a4c1 --- /dev/null +++ b/docs/simplefoc_library/practical/library_units.md @@ -0,0 +1,320 @@ +--- +layout: default +title: Units in the library +nav_order: 5 +permalink: /library_units +parent: Practical guides +grand_parent: Arduino SimpleFOClibrary +toc: true +--- + + +# Units in the library + +All the motor/driver/sensor parameters and control variables are defined in the following units: + +Physical value | Description | Unit | Comment +--- | --- | --- | --- +Position/angle | `Radians` | `RAD` | Motor and sensor position in radians +Velocity | `Radians per second` | `RAD/s` | Motor and sensor velocity in radians per second +Torque/Current | `Amperes` | `A` | Motor torque or current +Voltage | `Volts` | `V` | Motor/Driver voltage +Phase resistance | `Ohms` | `Ω` | Motor phase resistance +Phase inductance | `Henries` | `H` | Motor phase inductance +KV rating | `Radians per second per volt` | `RAD/s/V` | Motor velocity constant +PWM frequency | `Hertz` | `Hz` | Motor/driver PWM frequency +PMW duty cycle | `No unit` | - | All duty cycles have the range: `0 - 1.0` + + + +## Position/angle units + +The motor and sensor position is defined in radians. One full rotation of the motor is equal to $$2\pi$$ (6.14) radians is equal to 360 degrees. + +### Some important variables in radians (`RAD`) + +- `motor.shaft_angle` - the current motor position in radians +- `motor.electrical_angle` - the current motor electrical position in radians +- `motor.target` - the target motor position in radians ( in closed-loop and open-loop angle control) +- `sensor.getAngle()` - the current sensor position in radians ( in closed-loop control) + +### Converting the angle to degrees + +In order to convert the angle from radians to degrees, you can use the following formula: + +$$ +a_{deg} = a_{rad} \cdot \frac{360}{2\pi} +$$ + +#### Setting the target angle in degrees + +For example, if you wish to set the target angle in degrees: + +```cpp +motor.target = my_target_in_degrees * _2PI/360; +``` + +Or for example if you're using [commander interface](commander) to set the target angle in degrees: + +```cpp +void onTarget(char* cmd){ + // get the target angle in degrees + float target_angle_deg = atof(cmd); + // set the target angle in radians + motor.target = target_angle_deg * _2PI/360; +} +... +void setup(){ + ... + // add the command to the commander + commander.add('A', onTarget, "angle in degrees"); + ... +} +``` + +#### Reading the sensor angle in degrees + +If you wish to read motor position in degrees, you can easily convert it using + +```cpp +float angle_deg = motor.shaft_angle * 360/_2PI; +``` + +The same can be done for the outputs of the `Sensor` class: +```cpp +float angle_deg = sensor.getAngle() * 360/_2PI; +``` + +### Converting the angle to rotations (turns) + +To convert the angle from radians to turns (rotations) you can use the following formula: + +$$ +a_{rot} = a_{rad} \cdot \frac{1}{2\pi} +$$ + +#### Setting the target angle in turns + +For example, if you wish to set the target angle in turns: + +```cpp +motor.target = my_target_in_turns / _2PI; +``` + +Or for example if you're using [commander interface](commander) to set the target angle in turns: + +```cpp +void onTarget(char* cmd){ + // get the target angle in turns + float target_angle_turns = atof(cmd); + // set the target angle in radians + motor.target = target_angle_turns / _2PI; +} +... +void setup(){ + ... + // add the command to the commander + commander.add('A', onTarget, "angle in turns"); + ... +} +``` + +#### Reading the sensor angle in turns + +If you wish to read motor position in turns, you can easily convert it using + +```cpp +float angle_turns = motor.shaft_angle / _2PI; +``` + +The same can be done for the outputs of the `Sensor` class: +```cpp +float angle_turns = sensor.getAngle() / _2PI; +``` + +## Velocity units + +All the parameters/variables related to the velocity, both for the motor and sensor, are defined in radians per second. One full rotation of the motor is equal to $$2\pi$$ (6.14) radians is equal to 360 degrees. +Some other standard units for the velocity are RPM (revolutions per minute) and 1/s (turns per second). + + +### Some important variables in radians per second (`RAD/s`) + +- `motor.shaft_velocity` - the current motor velocity in radians per second +- `motor.velocity_limit` - the velocity limit in radians per second +- `motor.feedback_velocity` - the current motor velocity in radians per second ( in closed-loop control) +- `motor.target` - the target motor velocity in radians per second ( in closed-loop and open-loop velocity control) +- `sensor.getVelocity()` - the current sensor velocity in radians per second ( in closed-loop control) + +### Converting the velocity to RPM + +In order to convert the velocity from radians per second to RPM, you can use the following formula: + +$$ +v_{RPM} = v_{RAD/s} \cdot \frac{60}{2\pi} +$$ + +
+

RULE OF THUMB

+ +The motor velocity in `RPM` is approximately 10 times the motor velocity in radians per second `RAD/s`, as $$\frac{60}{2\pi}\approx 10$$ + +So the conversion can be approximated as: + +$$v_{RPM} = 10 \cdot v_{RAD/s} $$ + +
+ +#### Setting the target velocity in RPM + +For example, if you wish to set the target velocity in RPM: + +```cpp +motor.target = my_target_in_RPM * _2PI/60; +``` + +Or for example if you're using [commander interface](commander) to set the target velocity in RPM: + +```cpp +void onTarget(char* cmd){ + // get the target velocity in RPM + float target_velocity_RPM = atof(cmd); + // set the target velocity in radians per second + motor.target = target_velocity_RPM * _2PI/60; +} +... +void setup(){ + ... + // add the command to the commander + commander.add('V', onTarget, "velocity in RPM"); + ... +} +``` + +#### Reading the sensor velocity in RPM + +If you wish to read motor velocity in RPM, you can easily convert it using + +```cpp +float velocity_RPM = motor.shaft_velocity * 60/_2PI; +``` + +The same can be done for the outputs of the `Sensor` class: +```cpp +float velocity_RPM = sensor.getVelocity() * 60/_2PI; +``` + +### Converting the velocity to turns per second + +To convert the velocity from radians per second to turns per second, you can use the following formula: + +$$ +v_{tps} = v_{rad/s} \cdot \frac{1}{2\pi} +$$ + +#### Setting the target velocity in turns per second + +For example, if you wish to set the target velocity in turns per second: + +```cpp +motor.target = my_target_in_tps / _2PI; +``` + +Or for example if you're using [commander interface](commander) to set the target velocity in turns per second: + +```cpp +void onTarget(char* cmd){ + // get the target velocity in turns per second + float target_velocity_tps = atof(cmd); + // set the target velocity in radians per second + motor.target = target_velocity_tps / _2PI; +} +... +void setup(){ + ... + // add the command to the commander + commander.add('V', onTarget, "velocity in turns per second"); + ... +} +``` + +#### Reading the sensor velocity in turns per second + +If you wish to read motor velocity in turns per second, you can easily convert it using + +```cpp +float velocity_tps = motor.shaft_velocity / _2PI; +``` + +The same can be done for the outputs of the `Sensor` class: +```cpp +float velocity_tps = sensor.getVelocity() / _2PI; +``` + +## Torque/Current units + +The motor torque or current is defined in Amperes. The torque is directly proportional to the current flowing through the motor windings. The torque constant $$K_t$$ is a parameter that describes the relationship between the motor torque and the current. + +### Some important variables in Amperes [`A`] + +- `motor.current_limit` - the current motor limit in Amperes +- `motor.target` - the target motor current in Amperes ( in closed-loop torque control or in voltage control with current estimation) +- `motor.currents.q` - the current motor currents in Amperes +- `motor.currents.q` - the current motor currents in Amperes +- `current_sense.getFOCCurrent()` - the current motor currents in Amperes +- `current_sense.getDCCurrents()` - the current measured current magnitude in Amperes +- `current_sense.getPhaseCurrents()` - the current motor phase currents in Amperes +- `PhaseCurrent_s` - the structure that holds the motor phase currents in Amperes +- `DQCurrent_s` - the structure that holds the D and Q motor currents in Amperes +- `ABCurrent_s` - the structure that holds the Alpha and Beta motor currents in Amperes + + +### Converting the current to torque + +The motor torque is directly proportional to the current through the torque constant $$K_t$$. The torque constant is defined in the motor datasheet and often can be approximated to be the same as the electrical (BEMF) constant $$K_t \approx K_e$$. + +$$ +\tau = K_t \cdot I +$$ + +#### Setting the target torque in `Nm` + +For example, if you wish to set the target torque in Nm: + +```cpp +float Kt = ....; // datasheet value +motor.target = my_target_in_Nm / Kt; // Nm / (Nm/A) = Amps +``` + +Or for example if you're using [commander interface](commander) to set the target torque in Nm: + +```cpp +void onTarget(char* cmd){ + // get the target torque in Nm + float target_torque_Nm = atof(cmd); + // set the target current in Amperes + motor.target = target_torque_Nm / Kt; +} +... +void setup(){ + ... + // add the command to the commander + commander.add('T', onTarget, "torque in Nm"); + ... +} +``` + +#### Reading the sensor current in Nm + +If you wish to read motor current in Nm, you can easily convert it using + +```cpp +float current_Nm = motor.currents.q * Kt; +``` + +Or directly from the current sensor: + +```cpp +DQCurrent_s c = current_sense.getFOCCurrent(); +float current_Nm = c.q * Kt; // torque in Nm +``` diff --git a/docs/simplefoc_library/digging_deeper/practical/phase_resistance.md b/docs/simplefoc_library/practical/phase_resistance.md similarity index 96% rename from docs/simplefoc_library/digging_deeper/practical/phase_resistance.md rename to docs/simplefoc_library/practical/phase_resistance.md index 4c5d8a5..1813ec4 100644 --- a/docs/simplefoc_library/digging_deeper/practical/phase_resistance.md +++ b/docs/simplefoc_library/practical/phase_resistance.md @@ -5,10 +5,11 @@ nav_order: 3 description: "Arduino Simple Field Oriented Control (FOC) library ." permalink: /phase_resistance parent: Practical guides -grand_parent: Digging deeper -grand_grand_parent: Arduino SimpleFOClibrary +grand_parent: Arduino SimpleFOClibrary +toc: true --- + # Phase resistance The term "phase resistance" may lend itself to some ambiguity, in both meaning and method for measurement. This page attempts to explain how to measure its value, which is required by several of the control algorithms in SimpleFOC. diff --git a/extras/Images/angle_loop_stepper_curr.png b/extras/Images/angle_loop_stepper_curr.png new file mode 100644 index 0000000..7c2ab2c Binary files /dev/null and b/extras/Images/angle_loop_stepper_curr.png differ diff --git a/extras/Images/angle_loop_stepper_volt.png b/extras/Images/angle_loop_stepper_volt.png new file mode 100644 index 0000000..63a3b4f Binary files /dev/null and b/extras/Images/angle_loop_stepper_volt.png differ diff --git a/extras/Images/bldc.png b/extras/Images/bldc.png new file mode 100644 index 0000000..3292876 Binary files /dev/null and b/extras/Images/bldc.png differ diff --git a/extras/Images/bldc_align_a.png b/extras/Images/bldc_align_a.png new file mode 100644 index 0000000..5bfb17f Binary files /dev/null and b/extras/Images/bldc_align_a.png differ diff --git a/extras/Images/bldc_align_ab.png b/extras/Images/bldc_align_ab.png new file mode 100644 index 0000000..20c0cdf Binary files /dev/null and b/extras/Images/bldc_align_ab.png differ diff --git a/extras/Images/bldc_align_b.png b/extras/Images/bldc_align_b.png new file mode 100644 index 0000000..4f59fab Binary files /dev/null and b/extras/Images/bldc_align_b.png differ diff --git a/extras/Images/closed_loop_stepper1.jpg b/extras/Images/closed_loop_stepper1.jpg new file mode 100644 index 0000000..e182765 Binary files /dev/null and b/extras/Images/closed_loop_stepper1.jpg differ diff --git a/extras/Images/closed_loop_stepper2.jpg b/extras/Images/closed_loop_stepper2.jpg new file mode 100644 index 0000000..3f1cbbf Binary files /dev/null and b/extras/Images/closed_loop_stepper2.jpg differ diff --git a/extras/Images/closed_loop_stepper3.jpg b/extras/Images/closed_loop_stepper3.jpg new file mode 100644 index 0000000..795cbe3 Binary files /dev/null and b/extras/Images/closed_loop_stepper3.jpg differ diff --git a/extras/Images/current_sense_align.png b/extras/Images/current_sense_align.png new file mode 100644 index 0000000..549c3e2 Binary files /dev/null and b/extras/Images/current_sense_align.png differ diff --git a/extras/Images/current_sense_align_stepper.png b/extras/Images/current_sense_align_stepper.png new file mode 100644 index 0000000..b3b2833 Binary files /dev/null and b/extras/Images/current_sense_align_stepper.png differ diff --git a/extras/Images/dc_current_stepper.png b/extras/Images/dc_current_stepper.png new file mode 100644 index 0000000..c74f792 Binary files /dev/null and b/extras/Images/dc_current_stepper.png differ diff --git a/extras/Images/foc_current_stepper.png b/extras/Images/foc_current_stepper.png new file mode 100644 index 0000000..113d7cb Binary files /dev/null and b/extras/Images/foc_current_stepper.png differ diff --git a/extras/Images/inline_stepper.png b/extras/Images/inline_stepper.png new file mode 100644 index 0000000..d535ffd Binary files /dev/null and b/extras/Images/inline_stepper.png differ diff --git a/extras/Images/lowside_stepper.png b/extras/Images/lowside_stepper.png new file mode 100644 index 0000000..708e13a Binary files /dev/null and b/extras/Images/lowside_stepper.png differ diff --git a/extras/Images/open_loop_control (1).jpg b/extras/Images/open_loop_control (1).jpg new file mode 100644 index 0000000..ddf00ab Binary files /dev/null and b/extras/Images/open_loop_control (1).jpg differ diff --git a/extras/Images/open_loop_control (2).jpg b/extras/Images/open_loop_control (2).jpg new file mode 100644 index 0000000..e12f14e Binary files /dev/null and b/extras/Images/open_loop_control (2).jpg differ diff --git a/extras/Images/open_loop_control.jpg b/extras/Images/open_loop_control.jpg new file mode 100644 index 0000000..c3b6c5e Binary files /dev/null and b/extras/Images/open_loop_control.jpg differ diff --git a/extras/Images/open_loop_stepper_angle.jpg b/extras/Images/open_loop_stepper_angle.jpg new file mode 100644 index 0000000..728eb86 Binary files /dev/null and b/extras/Images/open_loop_stepper_angle.jpg differ diff --git a/extras/Images/open_loop_stepper_vel.jpg b/extras/Images/open_loop_stepper_vel.jpg new file mode 100644 index 0000000..f246a6b Binary files /dev/null and b/extras/Images/open_loop_stepper_vel.jpg differ diff --git a/extras/Images/open_loop_vel_steppe1.jpg b/extras/Images/open_loop_vel_steppe1.jpg new file mode 100644 index 0000000..a0fb07a Binary files /dev/null and b/extras/Images/open_loop_vel_steppe1.jpg differ diff --git a/extras/Images/open_loop_vel_steppe2.jpg b/extras/Images/open_loop_vel_steppe2.jpg new file mode 100644 index 0000000..c21bbb3 Binary files /dev/null and b/extras/Images/open_loop_vel_steppe2.jpg differ diff --git a/extras/Images/open_loop_vel_steppe3.jpg b/extras/Images/open_loop_vel_steppe3.jpg new file mode 100644 index 0000000..b5826d4 Binary files /dev/null and b/extras/Images/open_loop_vel_steppe3.jpg differ diff --git a/extras/Images/stepper_align.png b/extras/Images/stepper_align.png new file mode 100644 index 0000000..6a24b5b Binary files /dev/null and b/extras/Images/stepper_align.png differ diff --git a/extras/Images/stepper_align_a.png b/extras/Images/stepper_align_a.png new file mode 100644 index 0000000..8d65eca Binary files /dev/null and b/extras/Images/stepper_align_a.png differ diff --git a/extras/Images/stepper_align_b.png b/extras/Images/stepper_align_b.png new file mode 100644 index 0000000..637bf36 Binary files /dev/null and b/extras/Images/stepper_align_b.png differ diff --git a/extras/Images/torque_curr_stepper.png b/extras/Images/torque_curr_stepper.png new file mode 100644 index 0000000..5a1a271 Binary files /dev/null and b/extras/Images/torque_curr_stepper.png differ diff --git a/extras/Images/torque_stepper1.jpg b/extras/Images/torque_stepper1.jpg new file mode 100644 index 0000000..420fcad Binary files /dev/null and b/extras/Images/torque_stepper1.jpg differ diff --git a/extras/Images/torque_stepper2.jpg b/extras/Images/torque_stepper2.jpg new file mode 100644 index 0000000..98379d6 Binary files /dev/null and b/extras/Images/torque_stepper2.jpg differ diff --git a/extras/Images/torque_stepper3.jpg b/extras/Images/torque_stepper3.jpg new file mode 100644 index 0000000..6eebd08 Binary files /dev/null and b/extras/Images/torque_stepper3.jpg differ diff --git a/extras/Images/torque_stepper4.jpg b/extras/Images/torque_stepper4.jpg new file mode 100644 index 0000000..b372825 Binary files /dev/null and b/extras/Images/torque_stepper4.jpg differ diff --git a/extras/Images/torque_volt_stepper.png b/extras/Images/torque_volt_stepper.png new file mode 100644 index 0000000..896971c Binary files /dev/null and b/extras/Images/torque_volt_stepper.png differ diff --git a/extras/Images/v3_pads_encoder_pul.psd b/extras/Images/v3_pads_encoder_pul.psd new file mode 100644 index 0000000..e4546ec Binary files /dev/null and b/extras/Images/v3_pads_encoder_pul.psd differ diff --git a/extras/Images/velocity_loop_stepper_curr.png b/extras/Images/velocity_loop_stepper_curr.png new file mode 100644 index 0000000..2136a0e Binary files /dev/null and b/extras/Images/velocity_loop_stepper_curr.png differ diff --git a/extras/Images/velocity_loop_stepper_volt.png b/extras/Images/velocity_loop_stepper_volt.png new file mode 100644 index 0000000..42b105e Binary files /dev/null and b/extras/Images/velocity_loop_stepper_volt.png differ diff --git a/extras/Images/voltage_loop_stepper1.jpg b/extras/Images/voltage_loop_stepper1.jpg new file mode 100644 index 0000000..985bf5a Binary files /dev/null and b/extras/Images/voltage_loop_stepper1.jpg differ diff --git a/extras/Images/voltage_loop_stepper2.jpg b/extras/Images/voltage_loop_stepper2.jpg new file mode 100644 index 0000000..e77671f Binary files /dev/null and b/extras/Images/voltage_loop_stepper2.jpg differ diff --git a/extras/Images/voltage_loop_stepper3.jpg b/extras/Images/voltage_loop_stepper3.jpg new file mode 100644 index 0000000..097a784 Binary files /dev/null and b/extras/Images/voltage_loop_stepper3.jpg differ diff --git a/extras/Images/voltage_loop_stepper4.jpg b/extras/Images/voltage_loop_stepper4.jpg new file mode 100644 index 0000000..cdf1097 Binary files /dev/null and b/extras/Images/voltage_loop_stepper4.jpg differ diff --git a/index.md b/index.md index 5f6fcb0..bd0c2c3 100644 --- a/index.md +++ b/index.md @@ -9,6 +9,7 @@ permalink: / ![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg) ![arduino-library-badge](https://ardubadge.simplefoc.com?lib=Simple%20FOC) +![PlatformIO Registry](https://badges.registry.platformio.org/packages/askuric/library/Simple%20FOC.svg) [![status](https://joss.theoj.org/papers/4382445f249e064e9f0a7f6c1bb06b1d/status.svg)](https://joss.theoj.org/papers/4382445f249e064e9f0a7f6c1bb06b1d) ![GitHub release (latest by date)](https://img.shields.io/github/v/release/simplefoc/arduino-foc) @@ -27,21 +28,24 @@ Therefore this is an attempt to: - Many many more boards developed by the community members, see [SimpleFOC Community](https://community.simplefoc.com/)
-

NEW RELEASE 📢: SimpleFOClibrary v2.3.3 see release

- - STM32 MCUs - - support for center aligned pwm (even across multiple timers and motors/drivers) [#374](https://github.com/simplefoc/Arduino-FOC/pull/374), [#388](https://github.com/simplefoc/Arduino-FOC/pull/388) - - support for DMA based low-side current sensing: [#383](https://github.com/simplefoc/Arduino-FOC/pull/383),[#378](https://github.com/simplefoc/Arduino-FOC/pull/378) - - support for F7 architecture [#388](https://github.com/simplefoc/Arduino-FOC/pull/388),[#394](https://github.com/simplefoc/Arduino-FOC/pull/394) -- Teensy4 MCUs - - support for low-side current sensing [#392](https://github.com/simplefoc/Arduino-FOC/pull/392) - - support for center aligned 6pwm and 3pwm (optional) [#392](https://github.com/simplefoc/Arduino-FOC/pull/392) - - KV rating calculation fix [#347](https://github.com/simplefoc/Arduino-FOC/pull/347) - - Much more performant Park/Clarke calculation [#340](https://github.com/simplefoc/Arduino-FOC/pull/340) - - And much more - see the complete list of bugfixes and new features of v2.3.3 [fixes and PRs](https://github.com/simplefoc/Arduino-FOC/milestone/10?closed=1) +

NEW RELEASE 📢: SimpleFOClibrary v2.3.4 see release

+ - ESP32 MCUs extended support [#414](https://github.com/simplefoc/Arduino-FOC/pull/414) + - Transition to the arduino-esp32 version v3.x (ESP-IDF v5.x) [#387](https://github.com/espressif/arduino-esp32/releases) + - New support for MCPWM driver + - New support for LEDC drivers - center-aligned PWM and 6PWM available + - Rewritten and simplified the fast ADC driver code (`adcRead`) - for low-side and inline current sensing. + - Stepper motors current sensing support [#421](https://github.com/simplefoc/Arduino-FOC/pull/421) + - Support for current sensing (low-side and inline) - [see in docs](current_sense) + - Support for true FOC control - `foc_current` torque control - [see in docs](motion_control) + - New current sense alignment procedure [#422](https://github.com/simplefoc/Arduino-FOC/pull/422) - [see in docs](current_sense_align) + - Support for steppers + - Much more robust and reliable + - More verbose and informative + - Support for HallSensors without interrupts [#4224](https://github.com/simplefoc/Arduino-FOC/pull/424) - [see in docs](hall_sensors) - Docs - - Added a practical guides section - [see the docs](digging_deeper) - - Added a guide to choosing PWM pins for your application - [see the docs](choosing_pwm_pins) - - Added docs on stm32 PWM and ADC pinouts - [ stm32 pinouts](https://docs.simplefoc.com/stm32pinouts/) + - A short guide to debugging of common issues - [see in docs](example_from_scratch) + - A short guide to the units in the library - [see in docs](library_units) + - See the complete list of bugfixes and new features of v2.3.4 [fixes and PRs](https://github.com/simplefoc/Arduino-FOC/milestone/11)
# Arduino SimpleFOClibrary - [Read more ...](arduino_simplefoc_library_showcase) diff --git a/just-the-docs.gemspec b/just-the-docs.gemspec index bf61de2..d4d4685 100644 --- a/just-the-docs.gemspec +++ b/just-the-docs.gemspec @@ -16,6 +16,7 @@ Gem::Specification.new do |spec| spec.add_runtime_dependency "bundler", "> 2.1.4" spec.add_runtime_dependency "jekyll", ">= 3.8.5", "< 4.1.0" spec.add_runtime_dependency "jekyll-seo-tag", "> 2.0" + spec.add_runtime_dependency "jekyll-toc", "> 0" spec.add_runtime_dependency "rake", ">= 12.3.1", "< 13.1.0" end