]> pere.pagekite.me Git - homepage.git/blob - blog/data/2016-11-04-lego-htway.txt
Oppdater gaveforslag.
[homepage.git] / blog / data / 2016-11-04-lego-htway.txt
1 Title: My own self balancing Lego Segway
2 Tags: english, debian, robot, lego
3 Date: 2016-11-04 10:15
4
5 <p>A while back I received a Gyro sensor for the NXT
6 <a href="mindstorms.lego.com">Mindstorms</a> controller as a birthday
7 present. It had been on my wishlist for a while, because I wanted to
8 build a Segway like balancing lego robot. I had already built
9 <a href="http://www.nxtprograms.com/NXT2/segway/">a simple balancing
10 robot</a> with the kids, using the light/color sensor included in the
11 NXT kit as the balance sensor, but it was not working very well. It
12 could balance for a while, but was very sensitive to the light
13 condition in the room and the reflective properties of the surface and
14 would fall over after a short while. I wanted something more robust,
15 and had
16 <a href="https://www.hitechnic.com/cgi-bin/commerce.cgi?preadd=action&key=NGY1044">the
17 gyro sensor from HiTechnic</a> I believed would solve it on my
18 wishlist for some years before it suddenly showed up as a gift from my
19 loved ones. :)</p>
20
21 <p>Unfortunately I have not had time to sit down and play with it
22 since then. But that changed some days ago, when I was searching for
23 lego segway information and came across a recipe from HiTechnic for
24 building
25 <a href="http://www.hitechnic.com/blog/gyro-sensor/htway/">the
26 HTWay</a>, a segway like balancing robot. Build instructions and
27 <a href="https://www.hitechnic.com/upload/786-HTWayC.nxc">source
28 code</a> was included, so it was just a question of putting it all
29 together. And thanks to the great work of many Debian developers, the
30 compiler needed to build the source for the NXT is already included in
31 Debian, so I was read to go in less than an hour. The resulting robot
32 do not look very impressive in its simplicity:</p>
33
34 <p align="center"><img width="70%" src="http://people.skolelinux.org/pere/blog/images/2016-11-04-lego-htway-robot.jpeg"></p>
35
36 <p>Because I lack the infrared sensor used to control the robot in the
37 design from HiTechnic, I had to comment out the last task
38 (taskControl). I simply placed /* and */ around it get the program
39 working without that sensor present. Now it balances just fine until
40 the battery status run low:</p>
41
42 <p align="center"><video width="70%" controls="true">
43 <source src="http://people.skolelinux.org/pere/blog/images/2016-11-04-lego-htway-balancing.ogv" type="video/ogg">
44 </video></p>
45
46 <p>Now we would like to teach it how to follow a line and take remote
47 control instructions using the included Bluetooth receiver in the NXT.</p>
48
49 <p>If you, like me, love LEGO and want to make sure we find the tools
50 they need to work with LEGO in Debian and all our derivative
51 distributions like Ubuntu, check out
52 <a href="http://wiki.debian.org/LegoDesigners">the LEGO designers
53 project page</a> and join the Debian LEGO team. Personally I own a
54 RCX and NXT controller (no EV3), and would like to make sure the
55 Debian tools needed to program the systems I own work as they
56 should.</p>