May 30, 2010

Segway in NXT-G

Update March 2012: The project with source code is located here.

In the past year, a classmate and I have researched 'self-balancing robots' as a final year project. The goal was to create a simulation model of such a robot, and the result was an NXT Segway, with a HiTechic Gyro sensor, and programmed in RobotC (and a 170-page document going with it). I found this to be a very interesting project, but since the project document was written in Dutch entirely, that won't be very helpful to most of you.

Another Segway, you might think, and that's actually quite right. Today however, I wanted to try to program this Segway in NXT-G, because the current version of NXT-G (2.0) is relatively fast. It turns out that the Segway can still balance very well when programmed in NXT-G. It's a little slower, but it can still handle uneven terrain and small disturbances.

In the next week, I'll post some more updates, including the NXT-G program. Basically, all you need to create this robot is the HiTechnic Gyro sensor, any NXT set (any wheel size will work), and the NXT-G 2.0 software.

6 comments:

Martijn Hellemans "Dino_Martino" said...

perhaps you *can* post the dutch text... might be useful for the few dutch & flemish peoples on here ;)
We might not be numbreous, but we *are* here!
KR,
Martijn

Paul Cobbaut said...

The Dutch text would be very welcome indeed!

groetjes,
paul

Matthias Paul Scholz said...

Nice project.
It would be interesting to know how complexity and size of the NXT-G programm code compares to the code of the same program when written in NXC, RobotC or leJOS NXJ.

Laurens Valk said...

Matthias,

The code in NXT-G is much slower. For example, I had a few parallel loops full of code in RobotC that ran within a milisecond -- I added in pauses to make the main loop 5 msec on average per loop, which I found to be ideal for the segway.

NXT-G however takes 13 msec for a complete main loop, even without Wait Blocks. It is therefore less responsive to disturbances on for example uneven terrain, but driving around on a flat floor is still possible.

I'm currently working on a project page with instructions to make the segway. I think I will share the pre-compiled code instead of the full code to avoid problems with different versions of NXT-G and for example broken My Blocks.

drew said...

Can't wait to see what you came up with Valk! I previously completed a successful nxt-g segway using only a light sensor, but am presently having trouble figuring out a gyroscope version.
Also, does anyone know if its possible to use a sony PS3 controller with the mindstorm NXT? (that would be the next project if applicable) Thanks

-Drew

5Littleman13 said...

is it possible to make a segway using a accelerometer?

Related Posts Plugin for WordPress, Blogger...