Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev to master for the release v2.3.4 #425

Merged
merged 71 commits into from
Jul 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
241e8c0
LinearHall improvements and move to main repository
dekutree64 Jan 14, 2024
aeb9238
Minor formatting/comment edits
dekutree64 Jan 14, 2024
d7d4488
optimize
Candas1 Feb 9, 2024
41de6b6
Moving LinearHall back to drivers repository
dekutree64 Feb 14, 2024
3a84021
Moving LinearHall back to drivers repository
dekutree64 Feb 14, 2024
14f6726
fix RP2040 compile problems with earlehillpower
runger1101001 Apr 30, 2024
92f9fef
Merge pull request #397 from runger1101001/dev
runger1101001 Apr 30, 2024
627c0a8
Merge remote-tracking branch 'simplefoc/master' into dev
runger1101001 May 12, 2024
492d147
Merge pull request #399 from runger1101001/dev
runger1101001 May 13, 2024
3b7fa90
added initial support for current sensing for stepper motors
askuric May 20, 2024
c05289a
updated readme
askuric May 20, 2024
602c668
move setting target to start of move() #404
runger1101001 Jun 5, 2024
ac640e1
Merge pull request #405 from runger1101001/dev
runger1101001 Jun 5, 2024
f1b7452
add MT6701 I2C sensor configuration
May 11, 2024
83b606b
Merge pull request #406 from runger1101001/dev
runger1101001 Jun 5, 2024
1c732eb
Added gain documentation to B_G431B_ESC1.ino
rob-deutsch Jun 7, 2024
93bcfe0
use current sensing only if mpcpwm used and force LEDC for now
askuric Jun 7, 2024
8e8ffb2
adde the center-aligend ledc driver - enables 6pwm
askuric Jun 7, 2024
ae4df18
forgotten star
askuric Jun 7, 2024
26d111d
added the 6wpm driver
askuric Jun 8, 2024
ee91e27
removed the forced ledc
askuric Jun 8, 2024
0611830
Merge pull request #407 from rob-deutsch/patch-1
runger1101001 Jun 10, 2024
53624e4
added the inital support for new mcpwm driver
askuric Jun 10, 2024
e221e06
disable current sensing
askuric Jun 10, 2024
a7ed4ba
an initial implementation of the lowside and inline current sense wit…
askuric Jun 15, 2024
ab64524
forgotten import
askuric Jun 16, 2024
aa8591e
Revert "an initial implementation of the lowside and inline current s…
askuric Jun 16, 2024
5d4187a
added the current sensing + phase state for driver
askuric Jun 16, 2024
4c25ef0
forgotten mcpwm ifdef
askuric Jun 16, 2024
67248d8
forgotten return statement change in stm32
askuric Jun 16, 2024
69eb707
forgotten bluepill
askuric Jun 16, 2024
bbd8017
added the support for phase state for 6pwm in haredware-6pwm mode + r…
askuric Jun 20, 2024
63fda20
added workflow or s2
askuric Jun 20, 2024
3c3e9c8
added the debugging in examples
askuric Jun 20, 2024
52e8d9d
added the support for esp32s3 to read all the current phases in one i…
askuric Jun 21, 2024
910c24f
forgotten change for bg431
askuric Jun 21, 2024
2200504
s3 bugfix - it cannot read faster than 10us per adc sample
askuric Jun 21, 2024
e92567e
bugfix for #295 and #320 + added #346
askuric Jun 21, 2024
0b367c3
refactured esp32 fast adc driver - simplified a lot
askuric Jun 21, 2024
d89fa26
added the error debugging
askuric Jun 21, 2024
710edb4
more refactoring of the current sensing
askuric Jun 21, 2024
bc2f848
typo in debug macro
askuric Jun 21, 2024
a1bd20e
say the pin name if the generator fails
askuric Jun 22, 2024
8ce92e0
restructured imports
askuric Jun 22, 2024
a734d0d
typo in the defines
askuric Jun 22, 2024
538e59d
Merge pull request #414 from simplefoc/408-feature-support-for-arduin…
askuric Jun 23, 2024
e81af5d
Fix for #415 sin/cos integer overflow on 16-bit CPUs
dekutree64 Jun 29, 2024
bf75d20
Removed accidental addition of LinearHall.h
dekutree64 Jun 29, 2024
b203b83
Merge branch 'dev' into dev
dekutree64 Jun 29, 2024
53927d8
Merge branch 'dev' into feat_stepper_current_sensing
askuric Jun 30, 2024
d2a4093
one too many electrical angle
askuric Jul 13, 2024
eb4fd7f
update of pwm duty cycle on timer zero
askuric Jul 13, 2024
7d108c4
Merge branch 'dev' into feat_stepper_current_sensing
askuric Jul 13, 2024
842b361
new current sense alignement
askuric Jul 14, 2024
780bda9
exit flag currection for steppres
askuric Jul 15, 2024
ad0c4c5
feactoring and added ramping for current sense align
askuric Jul 15, 2024
9aee1aa
removed accidentally added files
askuric Jul 15, 2024
cf70cce
added the contering posibility
askuric Jul 15, 2024
dbc62a1
a correction for stepper
askuric Jul 15, 2024
c27bc4b
Merge pull request #416 from dekutree64/dev
runger1101001 Jul 18, 2024
31ed492
Merge pull request #424 from Candas1/hall_no_interrupt
runger1101001 Jul 19, 2024
996f312
Merge pull request #422 from simplefoc/feat_new_cs_align
askuric Jul 20, 2024
bd21d2b
Update CurrentSense.cpp
askuric Jul 20, 2024
d429148
refactored examples
askuric Jul 21, 2024
b2647a6
error in timer align (forgotten ifdef
askuric Jul 21, 2024
150a40b
error in exampels
askuric Jul 21, 2024
05672d2
motor init returns success
askuric Jul 21, 2024
ea8eda8
typo in transition from void to int
askuric Jul 21, 2024
5afea2b
preparations for v2.3.4
askuric Jul 21, 2024
37ca90d
readme for v2.3.4
askuric Jul 21, 2024
2de948c
Merge branch 'master' into dev
askuric Jul 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading