Skip to content

Commit

Permalink
Merge pull request #425 from simplefoc/dev
Browse files Browse the repository at this point in the history
Dev to master for the release v2.3.4
  • Loading branch information
askuric authored Jul 21, 2024
2 parents 463eb31 + 2de948c commit c72f063
Show file tree
Hide file tree
Showing 117 changed files with 2,963 additions and 2,602 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/esp32.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
- esp32:esp32:esp32doit-devkit-v1 # esp32
- esp32:esp32:esp32s2 # esp32s2
- esp32:esp32:esp32s3 # esp32s3
- esp32:esp32:esp32c3 # esp32c3

include:

Expand All @@ -30,6 +31,10 @@ jobs:
platform-url: https://espressif.github.io/arduino-esp32/package_esp32_index.json
sketch-names: esp32_position_control.ino, esp32_i2c_dual_bus_example.ino

- arduino-boards-fqbn: esp32:esp32:esp32c3 # esp32c3
platform-url: https://espressif.github.io/arduino-esp32/package_esp32_index.json
sketch-names: esp32_position_control.ino, esp32_i2c_dual_bus_example.ino, stepper_driver_2pwm_standalone.ino, stepper_driver_4pwm_standalone.ino

- arduino-boards-fqbn: esp32:esp32:esp32doit-devkit-v1 # esp32
platform-url: https://espressif.github.io/arduino-esp32/package_esp32_index.json
sketch-names: esp32_position_control.ino, esp32_i2c_dual_bus_example.ino, esp32_current_control_low_side.ino, esp32_spi_alt_example.ino
Expand Down
39 changes: 23 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
![GitHub commits since tagged version](https://img.shields.io/github/commits-since/simplefoc/arduino-foc/latest/dev)
![GitHub commit activity (branch)](https://img.shields.io/github/commit-activity/m/simplefoc/arduino-foc/dev)

[![arduino-library-badge](https://ardubadge.simplefoc.com?lib=Simple%20FOC)](https://ardubadge.simplefoc.com?lib=Simple%20FOC)
[![arduino-library-badge](https://ardubadge.simplefoc.com?lib=Simple%20FOC)](https://www.ardu-badge.com/badge/Simple%20FOC.svg)
[![PlatformIO Registry](https://badges.registry.platformio.org/packages/askuric/library/Simple%20FOC.svg)](https://registry.platformio.org/libraries/askuric/Simple%20FOC)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![status](https://joss.theoj.org/papers/4382445f249e064e9f0a7f6c1bb06b1d/status.svg)](https://joss.theoj.org/papers/4382445f249e064e9f0a7f6c1bb06b1d)

Expand All @@ -28,21 +29,27 @@ Therefore this is an attempt to:
- For official driver boards see [<span class="simple">Simple<span class="foc">FOC</span>Boards</span>](https://docs.simplefoc.com/boards)
- Many many more boards developed by the community members, see [<span class="simple">Simple<span class="foc">FOC</span>Community</span>](https://community.simplefoc.com/)

> NEW RELEASE 📢 : <span class="simple">Simple<span class="foc">FOC</span>library</span> v2.3.3
> - Teensy4
> - 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)
> - stm32
> - 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)
> - KV rating calculation fix [#347](https://github.com/simplefoc/Arduino-FOC/pull/347)
> - Much more performant Space Vector PWM 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)

## Arduino *SimpleFOClibrary* v2.3.3
> NEXT RELEASE 📢 : <span class="simple">Simple<span class="foc">FOC</span>library</span> v2.3.4
> - 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](https://docs.simplefoc.com/current_sense)
> - Support for true FOC control - `foc_current` torque control - [see in docs](https://docs.simplefoc.com/motion_control)
> - New current sense alignment procedure [#422](https://github.com/simplefoc/Arduino-FOC/pull/422) - [see in docs](https://docs.simplefoc.com/current_sense_align)
> - Support for steppers
> - Much more robust and reliable
> - More verbose and informative
> - Support for HallSensors without interrupts [#424](https://docs.simplefoc.com/https://github.com/simplefoc/Arduino-FOC/pull/424) - [see in docs](hall_sensors)
> - Docs
> - A short guide to debugging of common issues
> - A short guide to the units in the library - [see in docs](https://docs.simplefoc.com/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* v2.3.4

<p align="">
<a href="https://youtu.be/Y5kLeqTc6Zk">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// Motor instance
BLDCMotor motor = BLDCMotor(11);
BLDCDriver6PWM driver = BLDCDriver6PWM(A_PHASE_UH, A_PHASE_UL, A_PHASE_VH, A_PHASE_VL, A_PHASE_WH, A_PHASE_WL);
// Gain calculation shown at https://community.simplefoc.com/t/b-g431b-esc1-current-control/521/21
LowsideCurrentSense currentSense = LowsideCurrentSense(0.003f, -64.0f/7.0f, A_OP1_OUT, A_OP2_OUT, A_OP3_OUT);


Expand All @@ -25,6 +26,12 @@ void doTarget(char* cmd) { command.motion(&motor, cmd); }

void setup() {

// use monitoring with serial
Serial.begin(115200);
// enable more verbose output for debugging
// comment out if not needed
SimpleFOCDebug::enable(&Serial);

// initialize encoder sensor hardware
encoder.init();
encoder.enableInterrupts(doA, doB);
Expand Down Expand Up @@ -75,9 +82,6 @@ void setup() {
// maximal velocity of the position control
motor.velocity_limit = 4;


// use monitoring with serial
Serial.begin(115200);
// comment out if not needed
motor.useMonitoring(Serial);

Expand Down Expand Up @@ -107,4 +111,4 @@ void loop() {

// user communication
command.run();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ void doTarget(char* cmd) { command.scalar(&target_angle, cmd); }

void setup() {

// use monitoring with serial
Serial.begin(115200);
// enable more verbose output for debugging
// comment out if not needed
SimpleFOCDebug::enable(&Serial);

// initialize encoder sensor hardware
encoder.init();
encoder.enableInterrupts(doA, doB, doI);
Expand Down Expand Up @@ -75,8 +81,6 @@ void setup() {
motor.velocity_limit = 4;


// use monitoring with serial
Serial.begin(115200);
// comment out if not needed
motor.useMonitoring(Serial);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ void doTarget(char* cmd) { command.scalar(&target_angle, cmd); }

void setup() {

// use monitoring with serial
Serial.begin(115200);
// enable more verbose output for debugging
// comment out if not needed
SimpleFOCDebug::enable(&Serial);

// initialise magnetic sensor hardware
sensor.init();
// link the motor to the sensor
Expand Down Expand Up @@ -72,8 +78,6 @@ void setup() {
// maximal velocity of the position control
motor.velocity_limit = 40;

// use monitoring with serial
Serial.begin(115200);
// comment out if not needed
motor.useMonitoring(Serial);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ void onMotor(char* cmd){ command.motor(&motor, cmd); }

void setup() {

// use monitoring with serial
Serial.begin(115200);
// enable more verbose output for debugging
// comment out if not needed
SimpleFOCDebug::enable(&Serial);

// initialize encoder sensor hardware
encoder.init();
encoder.enableInterrupts(doA, doB);
Expand Down Expand Up @@ -90,9 +96,6 @@ void setup() {
// angle loop velocity limit
motor.velocity_limit = 50;

// use monitoring with serial for motor init
// monitoring port
Serial.begin(115200);
// comment out if not needed
motor.useMonitoring(Serial);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ void onMotor(char* cmd){ command.motor(&motor, cmd); }

void setup() {

// use monitoring with serial
Serial.begin(115200);
// enable more verbose output for debugging
// comment out if not needed
SimpleFOCDebug::enable(&Serial);

// initialize encoder sensor hardware
encoder.init();
encoder.enableInterrupts(doA, doB);
Expand Down Expand Up @@ -91,9 +97,6 @@ void setup() {
// angle loop velocity limit
motor.velocity_limit = 50;

// use monitoring with serial for motor init
// monitoring port
Serial.begin(115200);
// comment out if not needed
motor.useMonitoring(Serial);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ void onMotor(char* cmd){ command.motor(&motor, cmd); }

void setup() {

// use monitoring with serial
Serial.begin(115200);
// enable more verbose output for debugging
// comment out if not needed
SimpleFOCDebug::enable(&Serial);

// initialize encoder sensor hardware
encoder.init();
encoder.enableInterrupts(doA, doB);
Expand Down Expand Up @@ -115,10 +121,6 @@ void setup() {
motor.voltage_limit = 12.0; // 12 Volt limit
motor.current_limit = 2.0; // 2 Amp current limit


// use monitoring with serial for motor init
// monitoring port
Serial.begin(115200);
// comment out if not needed
motor.useMonitoring(Serial);
motor.monitor_variables = _MON_CURR_Q | _MON_CURR_D; // monitor the two currents d and q
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ void onMotor(char* cmd){ command.motor(&motor, cmd); }

void setup() {

// use monitoring with serial
Serial.begin(115200);
// enable more verbose output for debugging
// comment out if not needed
SimpleFOCDebug::enable(&Serial);

// initialize encoder sensor hardware
encoder.init();
encoder.enableInterrupts(doA, doB);
Expand Down Expand Up @@ -115,10 +121,6 @@ void setup() {
motor.voltage_limit = 12.0; // 12 Volt limit
motor.current_limit = 2.0; // 2 Amp current limit


// use monitoring with serial for motor init
// monitoring port
Serial.begin(115200);
// comment out if not needed
motor.useMonitoring(Serial);
motor.monitor_variables = _MON_CURR_Q | _MON_CURR_D; // monitor the two currents d and q
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ void onMotor(char* cmd){ command.motor(&motor, cmd); }

void setup() {

// use monitoring with serial
Serial.begin(115200);
// enable more verbose output for debugging
// comment out if not needed
SimpleFOCDebug::enable(&Serial);

// initialize encoder sensor hardware
encoder.init();
encoder.enableInterrupts(doA, doB);
Expand Down Expand Up @@ -116,10 +122,6 @@ void setup() {
motor.voltage_limit = 12.0; // 12 Volt limit
motor.current_limit = 2.0; // 2 Amp current limit


// use monitoring with serial for motor init
// monitoring port
Serial.begin(115200);
// comment out if not needed
motor.useMonitoring(Serial);
motor.monitor_variables = _MON_CURR_Q | _MON_CURR_D; // monitor the two currents d and q
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ void doTarget(char* cmd) { command.scalar(&target_angle, cmd); }

void setup() {

// use monitoring with serial
Serial.begin(115200);
// enable more verbose output for debugging
// comment out if not needed
SimpleFOCDebug::enable(&Serial);

// initialize encoder sensor hardware
encoder.init();
encoder.enableInterrupts(doA, doB);
Expand Down Expand Up @@ -66,9 +72,6 @@ void setup() {
// maximal velocity of the position control
motor.velocity_limit = 4;


// use monitoring with serial
Serial.begin(115200);
// comment out if not needed
motor.useMonitoring(Serial);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ void doTarget(char* cmd) { command.scalar(&target_angle, cmd); }

void setup() {

// use monitoring with serial
Serial.begin(115200);
// enable more verbose output for debugging
// comment out if not needed
SimpleFOCDebug::enable(&Serial);

// initialise magnetic sensor hardware
sensor.init();
// link the motor to the sensor
Expand Down Expand Up @@ -69,8 +75,6 @@ void setup() {
// maximal velocity of the position control
motor.velocity_limit = 40;

// use monitoring with serial
Serial.begin(115200);
// comment out if not needed
motor.useMonitoring(Serial);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ void doTarget(char* cmd) { command.scalar(&target_angle, cmd); }

void setup() {

// use monitoring with serial
Serial.begin(115200);

// initialise encoder hardware
encoder.init();
// interrupt initialization
Expand Down Expand Up @@ -85,9 +88,6 @@ void setup() {
// maximal velocity of the position control
motor.velocity_limit = 4;


// use monitoring with serial
Serial.begin(115200);
// comment out if not needed
motor.useMonitoring(Serial);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ void doI(){encoder.handleIndex();}

void setup(){

// use monitoring with serial
Serial.begin(115200);
// enable more verbose output for debugging
// comment out if not needed
SimpleFOCDebug::enable(&Serial);

// pwm frequency to be used [Hz]
driver.pwm_frequency = 20000;
// power supply voltage [V]
Expand All @@ -96,8 +102,6 @@ void setup(){
// alignment voltage limit
motor.voltage_sensor_align = 0.5;


Serial.begin(115200);
// comment out if not needed
motor.useMonitoring(Serial);
motor.monitor_variables = _MON_CURR_Q | _MON_CURR_D;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ SPIClass SPI_3(SPI3_MOSO, SPI3_MISO, SPI3_SCL);

void setup(){

// use monitoring with serial
Serial.begin(115200);
// enable more verbose output for debugging
// comment out if not needed
SimpleFOCDebug::enable(&Serial);

// pwm frequency to be used [Hz]
driver.pwm_frequency = 20000;
// power supply voltage [V]
Expand All @@ -94,8 +100,6 @@ void setup(){
// alignment voltage limit
motor.voltage_sensor_align = 0.5;


Serial.begin(115200);
// comment out if not needed
motor.useMonitoring(Serial);
motor.monitor_variables = _MON_CURR_Q | _MON_CURR_D;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ void doTarget(char* cmd) { command.scalar(&target_velocity, cmd); }


void setup() {
// use monitoring with serial
Serial.begin(115200);
// enable more verbose output for debugging
// comment out if not needed
SimpleFOCDebug::enable(&Serial);

delay(1000);
Serial.println("Initializing...");

Expand Down
Loading

0 comments on commit c72f063

Please sign in to comment.