Attempting to build a two-wheeled balance bot using balenaFin.

Hi folks.

I’m a member of the Balena team, usually focusing on back end systems, however I had this idea to try and build a two-wheeled balance bot using the BGM111 co-processor on the Fin to run the control loops to read the sensors and drive the wheels. I’ve started with the following equipment:

Here’s the plan:

  1. Physical build; I’m designing and 3D printing a simple frame which will mount the Fin, sensors, batteries and motors.
  2. Firmware; write a firmware in C/C++ for the Arm-based co-processor on the Fin which can run the control loops and expose an API to the compute module which has simple foward/back/left/right commands.
  3. Build a simple web interface that streams the camera view and can control the robot.

I expect this will take quite a while to complete as I only have one day a week free to work on it (and most of the parts have only just been ordered). I’ll post an update in this thread each week showing what I’ve worked on and where I’m at.

Today has been kind of a mixed day as I’ve been busy with other stuff too, but I started working on a frame design in Fusion 360. Today just cross-referencing with the Fin datasheet’s mechanical specs to get an idea of how I’m going to lay out the various components of the bot.

If you’re interested in this project then make sure to subscribe to this thread for updates as they happen.

Here’s the output from yesterday’s work:

I decided to go with a flat laser-cut chassis for the bot, and just 3D print the motor mounts, as that’ll be a lit quicker (for me). Mounting will use a combination of M2.5 and M3 hardware and zip ties to secure the gearboxes.

@jimsynz thanks for sharing the progress! I shall be following along with interest, can’t wait to see the coprocessor in action on this. What’s the blue object at the top? Battery positioned for balance weight?

Hi folks.

Yesterday I laser cut the frame from some scrap acrylic and wound up deciding that my design isn’t that great, so started redesigning it. I also downloaded and set up Simplicity Studio. It’s many things, but “simplicity” it ain’t.

One thing that held me up last week is that I accidentally only ordered 1 wheel from Adafruit, and rather than pay $30 shipping for another $2.50 wheel I decided to order these pololu wheels from and 3D print some adapters for the flat-sided shafts that came on my Adafruit gearboxes.

I also have the very basics of a web app working to control the bot. Next week it’s finalising the new design for and cutting the frame again and getting started on the co-processor firmware. The latter will be the hardest for me, because although I’m okay with C and C++ I’m unfamiliar with SiLab’s tools and APIs.

@chrisys - yes, I’m using a 3S 2200mAh LiPo because I have one lying around from one of my model planes. Because of the awesome regulator in the Fin I will be able to power it directly off the output of the LiPo without having to deal with my own power regulation. I did some googling and apparently putting the battery at the top tends to make the device more stable (contrary to my expectations).

Tune in next week for more progress!