Post

More SPRK improvements

More SPRK improvements

Why SPRK again?

After a few months away from SPRK development, I decided to revisit the project and make a few improvements.
My main goals of this new version are:

  • Delete Python
  • Remake the entire robot codebase in C++ using a custom framework I built for robotics.
  • Cleanup the messy wires on GPIO and instead use SPI instead
  • Remove the arduino in favor of a custom ESP32 powered board to control every motor, stepper, servo, and sensor

SPI Communication

Why SPI?

The original SPRK used serial to communicate between the Raspberry Pi and the Arduino with a basic text-based protocol. This worked okay, but was terrible code and had some latency. I wanted to try something new and more robust, so I picked SPI.

Implementation

The Raspberry Pi is the SPI master, and the ESP32 is the SPI slave. The Pi sends commands to the ESP32, which then executes them and sends back the results. This allows for much faster communication and reduces latency. Yes, I understand that this is one more step of complexity, but I wanted to try it out and test my skills.

Diagram

If you’re curious, you can look at the diagram here

This post is licensed under CC BY 4.0 by the author.