Questions Regarding SimpleFOC Serial Communication

Hello All,

I would like to make a raspberrypi send and receive commands to the BLDC driver (I think through commander commands?) rather than through VScode terminal and my keyboard.

I can get the commands I want to the RaspberryPi. However I don’t know how to take those commands and get them into BLDC Driver or read values off the driver with the RaspberryPi:

  1. What is the serial communication protocol I need to use to connect the RaspberryPi and Driver: Is it set by Platform IO, is it set by the driver, is it set by SimpleFOC? Whatever it is where do I look to know what it is?

  2. Is there a pin map set by SimpleFOC or PlatformIO? I ask because I don’t think a million usb cables is practical for setups with lots of motors and therefore I would like to know what the communication medium is and how to know where to connect it on the PCB.

  3. How is the commander commands being converted into binary? Is this a SimpleFOC thing or is this a PlatformIO thing? For example how do I know commander command M5 = a given value in binary.

I know that that is a lot of questions, but help answering any of those questions is much appreciated. :grinning:

Thanks in advance,

Logan

It’s a simple serial comm, RX/TX. No USB.

Pin map for what exactly, Serial? Depending on your control board, you need to read the specs. PlatformIO or Arduino IDE have nothing to do with the underlying hardware.

You write C/C++ code to write/read from Serial on your hardware.

I believe you may get a lot more help if you first spend some time doing some basic embedded programming in Arduino and join Arduino forums, there are a lot more people that could help you there, as these are not SimpleFOC questions but basic embedded C/C++ and Arduino programming questions.

There are simply not enough people here on that forum that would be available to help with this.

Please join

you will get a lot more help there.

Also I would suggest you read and implement the Arduino serial comm tutorials and examples.

https://www.ladyada.net/learn/arduino/lesson4.html

Cheers,
Valentine

Thank you for your replies. From your feedback I believe I am overcomplicating this problem.

I see examples of SimpleFOC doing things like skateboards, balancers, moment wheels, etc. many of which are not connected to a computer running VScode.

How are people taking desired motor commands and inputing them into the driver with out the VScode serial terminal?

I’m not familiar with VSCode, however, Arduino IDE has built-in Serial comm terminal, and you connect a USB directly to the board, type in the command and the Arduino board reads it as Serial.

As I said, it may be best to spend some time writing some basic Serial code and turn on/off LEDs to understand how it works.

Cheers,
Valentine

Interesting, I did not know Arduino IDE was so similar. SimpleFOC on VScode communicates in a very similar way. Potentially I could connect a raspberry PI to a Arduino (because Raspberry Pi can communicate over WIFI). Then send signals through Pi and then through Arduino and that way have light weight computers connected rather that giant PC connected.

However again, in further retroflection this seems to complicated and a problem I believe I am overcomplicating for something I have seen many people do. I think there is something important I am missing.

I2C Discussion

This might be what I am looking for. Just came across this will need to read further, will report back.

Edit:

Ok, I think this what I am looking for. @Valentine thanks for your help with this problem. I am going swap over to that discussion if I need clarification questions to keep organization.

1 Like