Git Product home page Git Product logo

Comments (14)

Candas1 avatar Candas1 commented on July 17, 2024

Hi,

You should add a title to the issue.
Have you used this option in platformio.ini ?
libarchive = false

from arduino-foc.

Kurburis avatar Kurburis commented on July 17, 2024

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.

Candas1 avatar Candas1 commented on July 17, 2024

How are you defining the board in platformio.ini?

from arduino-foc.

Kurburis avatar Kurburis commented on July 17, 2024

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.

runger1101001 avatar runger1101001 commented on July 17, 2024

It's lib_archive - with an underscore...

from arduino-foc.

Candas1 avatar Candas1 commented on July 17, 2024

Oups 😂

from arduino-foc.

Kurburis avatar Kurburis commented on July 17, 2024

It's lib_archive - with an underscore...

Tried it with the underscore, didn't change anything.

from arduino-foc.

runger1101001 avatar runger1101001 commented on July 17, 2024

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.

Kurburis avatar Kurburis commented on July 17, 2024

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.

runger1101001 avatar runger1101001 commented on July 17, 2024

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.

Kurburis avatar Kurburis commented on July 17, 2024

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.

Kurburis avatar Kurburis commented on July 17, 2024

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.

runger1101001 avatar runger1101001 commented on July 17, 2024

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.

Kurburis avatar Kurburis commented on July 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.