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

ESP32 C6 fix #442

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
28 changes: 7 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,13 @@ 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/)

> 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
> NEXT RELEASE 📢 : <span class="simple">Simple<span class="foc">FOC</span>library</span> v2.3.5
> - Motor characterization code thanks to @mcells
> - Bugfix for ESP32 C6 thanks to @kondor1622
> - See the complete list of bugfixes and new features of v2.3.5 [fixes and PRs](https://github.com/simplefoc/Arduino-FOC/milestone/12)


## Arduino *SimpleFOClibrary* v2.3.5

<p align="">
<a href="https://youtu.be/Y5kLeqTc6Zk">
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=Simple FOC
version=2.3.4
version=2.3.5
author=Simplefoc <info@simplefoc.com>
maintainer=Simplefoc <info@simplefoc.com>
sentence=A library demistifying FOC for BLDC motors
Expand Down
4 changes: 1 addition & 3 deletions src/BLDCMotor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,7 @@ int BLDCMotor::alignSensor() {
zero_electric_angle = electricalAngle();
//zero_electric_angle = _normalizeAngle(_electricalAngle(sensor_direction*sensor->getAngle(), pole_pairs));
_delay(20);
if(monitor_port){
SIMPLEFOC_DEBUG("MOT: Zero elec. angle: ", zero_electric_angle);
}
SIMPLEFOC_DEBUG("MOT: Zero elec. angle: ", zero_electric_angle);
// stop everything
setPhaseVoltage(0, 0, 0);
_delay(200);
Expand Down
6 changes: 3 additions & 3 deletions src/drivers/hardware_specific/esp32/esp32_driver_mcpwm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ uint8_t _findNextTimer(int group){
*/
int _findBestGroup(int no_pins, long pwm_freq, int* group, int* timer){
// an empty group is always the best option
for(int i=0; i<2; i++){
for(int i=0; i<SOC_MCPWM_GROUPS; i++){
if(!group_pins_used[i]){
*group = i;
*timer=0; // use the first timer in an empty group
Expand All @@ -196,15 +196,15 @@ int _findBestGroup(int no_pins, long pwm_freq, int* group, int* timer){
// second best option is if there is a group with
// pair number of pwms available as we can then
// set the pwm frequency
for(int i=0; i<2; i++){
for(int i=0; i<SOC_MCPWM_GROUPS; i++){
if(_hasAvailablePins(i, no_pins+1)) {
*group=i;
*timer = _findNextTimer(i);
return 1;
}
}
// third best option is any group that has enough pins
for(int i=0; i<2; i++){
for(int i=0; i<SOC_MCPWM_GROUPS; i++){
if(_hasAvailablePins(i, no_pins)) {
*group=i;
*timer = _findLastTimer(i);
Expand Down
2 changes: 1 addition & 1 deletion src/sensors/Encoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class Encoder: public Sensor{
/**
* returns 0 if it does need search for absolute zero
* 0 - encoder without index
* 1 - ecoder with index
* 1 - encoder with index
*/
int needsSearch() override;

Expand Down
Loading