October 28, 2017

Self-balancing robot version 1


I got my hand on a few micro:bits and a Kitronic :MOVE mini buggy. They were meant for my kids. But I had always wanted to build a remote controlled self-balancing robot. What's the easiest way to get something working? Repurpose parts from the buggy, add Lego and some code!

Here's version 1. It is fragile and wobbly. With a simple PID controller written in Javascript using makecode/PXT, it self-balances on carpet for over 20 minutes but doesn't do so well on hard floors.


I use a second micro:bit to instruct the robot to turn using the micro:bit's radio service. Turn too much and it falls over!


The bot:


Stripped of the Lego frame:


As you can see, it isn't exactly as "kid-friendly" as just adding Legos.

I had to add a digital gyroscope (MPU-9255), an edge connector and solder some connectors to get access to the I2C pins. See parts list below.

The hardware turns out to be too flimsy. The motors do not stay in position. The wheels have limited friction on hard floors. Tuning the PID parameters was hard and time consuming with so many sources of errors.

On the software side, I had to read the MPU-9255 specification and write code to talk to it using I2C. There is no existing makecode module for that 9-axis gyroscope/accelerometer/compass chip. The version of Javascript in makecode does not support floating point or trigonometric functions. Certainly, this can be made more "kid-friendly".

In the end, I was just amazed that it somewhat self-balanced on carpet for more than 20 minutes. It is not anywhere near Segway stable, which is not surprising given the rather primitive control algorithm.

Parts:
The servo:lite board isn't necessary. It holds 3xAAA batteries to generate regulated 3.3V volts for both the micro:bit and the servos. The micro:bit can actually run off 2xAAA batteries directly and the servos can be powered unregulated with up to 6V (4xAA batteries).

Version 3 is the updated version 1 without the servo:lite board and Legos.

Links to all the micro:bit robot posts:


January 25, 2017

2016 Bicycle Tour of the Alps


July 6th to July 16th
11 days
900km
15 mountain passes
18,000m of climb

To remind myself to do something crazy once in a while.

Many thanks to my wonderful wife for taking care of the kids while I was away.




Check out Piaw's detailed trip report for the whole tour.

Day 1, July 6th

  • 83km, 1240m climb.
  • Luzern, Sarnen, Melchtal, Stockalp, half way up Melchee-Frutt, Sarnen, train to Meiringen, bus to Rosenlaui













Day 2, July 7th

  • 86km, 1640m climb.
  • Rosenlaui, Grosse Scheidegg, Grindelwald, Interlaken, Giessbach, Meiringen, Rosenlaui












Day 3, July 8th

  • 60km, 2090m climb.
  • Rosenlaui, Innertkirchen, Grimsel Pass, Furka Pass, Tiefenbach














Day 4, July 9th

  • 116km, 840m climb.
  • Tiefenbach, St Gotthard Pass, Bellinzona, Grono













Day 5, July 10th

  • 86km, 2350m climb.
  • Grono, San Bernardino Pass, Passo dello Spluga, Campodolcino
















Day 6, July 11th

  • 78km, 1780m climb.
  • Campodolcino, Maloja Pass, St Moritz, Pontresina, Berninahaus














Day 7, July 12th

  • 87km, 1020m climb.
  • Berninahaus, Bernina Pass, Livigno Pass (Forcola di Livigno), Livigno, Munt la Schera Tunnel, Ofen Pass (Passo del Forno), Santa Maria Val Müstair, Schluderns


















Day 8, July 13th

  • 58km, 1850m climb.
  • Schluderns, Stelvio Pass, Bormio










Day 9, July 14th

  • 107km, 2270m climb.
  • Bormio, Gavia Pass, Tonale Pass, Brez


























Day 10, July 15th

  • 99km, 2260m climb.
  • Brez, Mendola Pass, Bolzano, Karersee, Passo di Costalunga (Karerpass), Canazei, Alba




















Day 11, July 16th

  • 44km, 770m climb.
  • Alba, Passo Sella, Selva di Val Gardena, Ponte Gardena













Epiloque

  • Innsbruck













More photos from Piaw.