Story
I will describe my second project, the "Self Balancing Robot, " which I mentioned during the construction of the "RC Car - LEGO Powered by Raspberry Pi CM4 with SaraKIT" I will begin similarly, as both projects were practically developed at the same time and for similar reasons.
I've always had a passion for crafting with Lego bricks, and I've never been one to follow pre-made instructions. Recently, I ventured into the world of Raspberry Pi, deeply appreciating its vast capabilities while also acknowledging its limitations. When it came to projects involving moving parts, I used to rely on servomechanisms connected to the Raspberry Pi. However, servos came with their fair share of drawbacks – they were noisy, imprecise, and prone to breakdowns.
More recently, I've been engrossed in developing an open-source PCB project known as SaraKIT. This groundbreaking board empowers us to masterfully control BLDC Gimbal Motors, achieving an unparalleled level of precision, with fractional angle control, near-silence, and remarkable power.
With a collection of Lego bricks left from my previous endeavors, I've always dreamt of building an ultra-quiet and incredibly fast vehicle that could be effortlessly maneuvered via phone or computer. I was particularly fascinated by the idea of creating a Self Balancing Robot.
SaraKIT was primarily developed as the main PCB for building voice assistants like Alexa, Google Home, and now ChatGPT, but in a much more advanced version that incorporates visual perception (I'll soon publish more projects closely related to this topic and AI, image recognition, etc.).
However, even then, I thought that since we have such a fantastic board with all the necessary components, such as precise control of BLDC Gimbal Motors, substantial power, and an accelerometer, I would build a Self Balancing Robot from Lego bricks in my spare time. Fulfilling dreams is quite enjoyable.
When the "spare time" finally arrived, I quickly built the first prototype. The physical assembly went smoothly, but the software didn't. I'm not a fan of copying projects, so I didn't read much about it on the internet. I decided to write everything from scratch. After all, how hard could it be to create accelerometer-based wheel control?
Big mistake - that's when I learned that an accelerometer alone isn't enough; a gyroscope is also necessary. Thanks to this idea, a new component, a gyroscope, was added to the SaraKIT board in the next version.
A few weeks later, a fully operational Self Balancing Robot was born. Watch it in action in the video:
It wasn't easy. There are a few parameters described in the code that need to be manually adjusted depending on the vehicle's weight and mass distribution. It took me a few hours, but the result was fantastic. Thanks to the fast BLCD motors, it's genuinely challenging to tip over such a vehicle.
We control it using a smartphone or a computer; sample software in C++, Python, and Delphi will be available in our GitHub repository.
Remote Controller on GitHub: https://github.com/SaraEye/SaraKIT-RCCar-Remote-Controller
The robot is powered by a power bank. For mobile devices, we recommend a simple connection to the PowerBank (PD2.0 PD3.0 Fast Charging and QC4 with USB-C output) with a special PD 12v cable. Or by connecting a USB cable via USB-C Pd Trigger Module Pd 12v.
- Two FOC gimbal motor drivers for BLDC motors
- An accelerometer with a gyroscope
- Support for motor encoders
- 3 sensitive microphones for voice control
- Two camera outputs for live streaming from a moving vehicle
- The ability to connect power from easily available Power Banks (PD2.0 PD3.0 Fast Charging and QC4 with USB-C output) with a special PD 12v cable or by connecting a USB cable via USB-C Pd Trigger Module Pd 12v.
Additionally, you will need two BLDC gimbal motors, two encoders, two motor-to-brick adapters, and some building blocks. The design of the vehicle is up to you. The brick adapters can be easily 3D-printed (the relevant stl and obj files are included on our website) or purchased for a few dollars from our site.
This robot demonstrates the power of BLDC gimbal motors; it is very difficult to overturn, quiet, and fast, and does not require heavy loads to be placed high up.
You can find C++ and Python code for Raspberry Pi4 in the
SaraKIT Github repository:
https://github.com/SaraEye
https://github.com/SaraEye/SaraKIT-RCCar-Remote-Controller