SimpleFOC together with BLE Bluetooth Speed control

I have just tried running a BLE server on the same device as SimpleFOC (ESP32) and athough it works, the motor runs rough due to the interruptions from the BLE stack.

I am just testing in open-loop at the moment. Without the BLE connected, the motor runs fine up to 2000 RPM (I am running a 48v motor 4500 RPM so expected speed at 24v).

I am using the nimbeBLE library in PlatformIO …

Any suggestions how they can run better together. If I can’t get this working well, I will have to just go back to standard Bluetooth serial via an HC-05 …
It seems that the BLE stack is not very real-time.

I am using an App I created on MIT app Inventor, on my phone …

Thanks, any suggestions welcome.

I have decided to go with serial bluetooth standard on the ESP32. It does not affect the SimpleFOC operation at all … I get nice smooth speed control using the slider.

1 Like

BLE requires a lot of processing power, so you need to size your MCU accordingly. In my experience, a dual-core ESP32 with BLE running on one core and your app running on the other one (which is usually the default configuration) is best.

1 Like

Which begs the question: Why should something like BLE which is intended for IOT applications be so resource hungry … IOT devices are mean’t to be low resource, low power things … :slight_smile:

Anyway I had a 240Mhz dual core ESP32, and it still is crap.
But standard bluetooth seems to works well … i.e serial bluetooth

Does anyone know of a “fast” float to string function? I am sending strings back to MIT app inventor application …