SimpleFOC on Arduino Giga - BLDC Motor buzzing

Hey @dro178 ,

I’m assuming you are using ArduinoIDE… I’m not sure which operating system you use, you’ll have to adapt the paths and commands a bit to match your os.

You need a local copy of the SimpleFOC library from my branch. You can use your favourite git client UI, or just use git from the command line:

git clone https://github.com/runger1101001/Arduino-FOC.git
cd Arduino-FOC
git checkout stm32_hal_pwm

this will check out my fork of SimpleFOC and switch to my “stm32_hal_pwm” branch which the PR is based on.

Then find your Arduino libraries folder. For me it is in $HOME/Documents/Arduino/libraries/
In this folder you will probably find an existing version of SimpleFOC library - there will already be a folder “Arduino-FOC”. Move the whole existing folder away, either to the trash or keep it somewhere else if you plan to put it back.

Then either copy the Arduino-FOC folder created by git clone into the libraries folder, or create a symlink (Windows: directory junction) to it in the libraries folder.

When you start ArduinoIDE, you will be able to compile your code against the github version of the library. If you hunt for it, you will see something like this in the output in ArduinoIDE:

Using library Simple FOC at version 2.3.4 in folder: /Users/runger/git/Arduino-FOC 
Using library SPI in folder: /Users/runger/Library/Arduino15/packages/arduino/hardware/mbed_giga/4.1.5/libraries/SPI (legacy)
Using library Wire in folder: /Users/runger/Library/Arduino15/packages/arduino/hardware/mbed_giga/4.1.5/libraries/Wire (legacy)