Comments (14)
Hi,
You should add a title to the issue.
Have you used this option in platformio.ini ?
libarchive = false
from arduino-foc.
Hi,
You should add a title to the issue. Have you used this option in platformio.ini ?
libarchive = false
Sorry for the mistake; I've added a title.
I tried your suggestion, and it made no difference, unfortunately.
from arduino-foc.
How are you defining the board in platformio.ini?
from arduino-foc.
How are you defining the board in platformio.ini?
This is what I have so far
[env:nucleo_f303re]
platform = ststm32
board = nucleo_f303re
framework = arduino
libarchive = false
lib_deps = askuric/Simple FOC@^2.3.2
Wire
SPI
from arduino-foc.
It's lib_archive
- with an underscore...
from arduino-foc.
Oups 😂
from arduino-foc.
It's
lib_archive
- with an underscore...
Tried it with the underscore, didn't change anything.
from arduino-foc.
The lib_archive = false
is definately needed. If you do a make clean, it will solve the issue of not finding the correct PWM driver.
However there may be further issues with the 6PWM configuration you're using.
Please also add the following build flag to platformio.ini:
build_flags = -DSIMPLEFOC_STM32_DEBUG
And the following code to the start of your setup:
Serial.begin(115200);
SimpleFOCDebug::enable(&Serial);
delay(5000);
Please let us know the output produced by the init functions.
from arduino-foc.
Hi,
The
lib_archive = false
is definately needed. If you do a make clean, it will solve the issue of not finding the correct PWM driver.However there may be further issues with the 6PWM configuration you're using.
Please also add the following build flag to platformio.ini:
build_flags = -DSIMPLEFOC_STM32_DEBUG
And the following code to the start of your setup:
Serial.begin(115200); SimpleFOCDebug::enable(&Serial); delay(5000);
Please let us know the output produced by the init functions.
Hi,
I've been trying to do what you said, but I have a different problem now. Nothing I write via Serial or SerialUSB is visible on the serial monitor. I've tried googling the problem and I've enabled some of the flags, but still no success.
#include <Arduino.h>
void setup() {
SerialUSB.begin(9600);
delay(5000);
}
void loop()
{
SerialUSB.println("Test to see if Serial works");
delay(1000);
}
My ini file looks now like this:
[env:nucleo_f303re]
platform = ststm32
board = nucleo_f303re
framework = arduino
lib_archive = false
monitor_dtr = 0
monitor_rts = 0
build_flags =
-DSIMPLEFOC_STM32_DEBUG
-D PIO_FRAMEWORK_ARDUINO_ENABLE_CDC
-D USBCON
monitor_speed = 9600
monitor_port = COM8
lib_deps = askuric/Simple FOC@^2.3.2
Wire
SPI
from arduino-foc.
If it's a Nucleo64 board then I think it does not have USB serial. The USB is connected to the on-board ST-Link.
The ST-Link has a virtual com port feature, and normally this is connected to USART2 of the STM32s. So you can use it by using the standard "Serial" object and the build-flag:
build_flags = -DSERIAL_UART_INSTANCE=2
You have to remove the USB-Serial related build-flags.
from arduino-foc.
If it's a Nucleo64 board then I think it does not have USB serial. The USB is connected to the on-board ST-Link.
The ST-Link has a virtual com port feature, and normally this is connected to USART2 of the STM32s. So you can use it by using the standard "Serial" object and the build-flag:
build_flags = -DSERIAL_UART_INSTANCE=2
You have to remove the USB-Serial related build-flags.
Thanks, that was the solution! For others that might have the same problem, this was the platformio.ini code I've used:
[env:nucleo_f303re]
platform = ststm32
board = nucleo_f303re
framework = arduino
lib_archive = false
build_flags =
-DSIMPLEFOC_STM32_DEBUG
-DSERIAL_UART_INSTANCE=2
monitor_speed = 9600
monitor_port = COM8
lib_deps = askuric/Simple FOC@^2.3.2
Wire
SPI
from arduino-foc.
The
lib_archive = false
is definately needed. If you do a make clean, it will solve the issue of not finding the correct PWM driver.However there may be further issues with the 6PWM configuration you're using.
Please also add the following build flag to platformio.ini:
build_flags = -DSIMPLEFOC_STM32_DEBUG
And the following code to the start of your setup:
Serial.begin(115200); SimpleFOCDebug::enable(&Serial); delay(5000);
Please let us know the output produced by the init functions.
I think the problem is related to this issue: #220
The last 3 lines of my serial monitor look like this:
TIM15-CH2 TIM16-CH1N TIM8-CH2 TIM2-CH3 TIM16-CH1 TIM1-CH2 score: -6
TIM15-CH2 TIM16-CH1N TIM8-CH2 TIM2-CH3 TIM16-CH1 TIM2-CH3 score: -4
STM32-DRV: no workab
I've selected pins so none of them uses the N channel and they are all on different timers, but I still get a negative score:
TIM15-CH2 TIM8-CH1 TIM3-CH2 TIM2-CH3 TIM16-CH1 TIM1-CH2 score: -7
How is the score calculated?
from arduino-foc.
How is the score calculated?
It's a fairly complicated question, but basically the more different timers are used, the worse (higher) the score. And a negative score always means some kind of error, the configuration can't be made to work.
-7 means: the high and low low side of one or more phases are not on the same timer.
When using 6-PWM, it is best to use all the pins from TIM1 or TIM8, using the inverted channels for the low side.
If you can't do this, the next-best option is to use pins where high and low side are always on the same timer.
from arduino-foc.
How is the score calculated?
It's a fairly complicated question, but basically the more different timers are used, the worse (higher) the score. And a negative score always means some kind of error, the configuration can't be made to work.
-7 means: the high and low low side of one or more phases are not on the same timer.
When using 6-PWM, it is best to use all the pins from TIM1 or TIM8, using the inverted channels for the low side.
If you can't do this, the next-best option is to use pins where high and low side are always on the same timer.
Thank you, that was the solution. For each pair of high and low pins I used the same timer and channel (but with the N sufiix for the low one) and that worked.
from arduino-foc.
Related Issues (20)
- [FEATURE] Performance of setting the PWM duty cycles HOT 8
- [FEATURE] Add library.json to set libArchive? HOT 2
- [BUG] OpenOCD init failed while using specific pin HOT 6
- Update KV estimation example to match new code
- [FEATURE] Allowing to choose SPI pins HOT 1
- Can't change PWM frequency - 550hz [BUG] HOT 8
- [BUG] Monitor downsampling cannot be disabled HOT 2
- 20bit magnetic encoder support
- [BUG] ESP32 current sensing readings not synced with PWM - Not reproducible HOT 2
- [BUG] Error in doc: initFOC() cannot be used in open loop mode HOT 1
- driverAlign() ignores gain sign, always "MOT: Success: 3" HOT 3
- [BUG] PlatformIO adding SimpleFOC requires to specify SPI and WIRE lib_deps to prevent compile errors HOT 5
- Support for the new ESP32 LEDC library API HOT 3
- Is this FOC suppot high speed BLDC(5000rpm)?[FEATURE] HOT 2
- MagneticSensorI2C uses incorrect bit mask calculation HOT 4
- [BUG] Passing a new target to move() is sometimes ignored HOT 4
- [FEATURE] Support for arduino-esp32 v3.0.1
- [FEATURE] Current sensing for stepper motors - FOC current control
- [BUG] Trap 150 potential miscalculation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arduino-foc.