GELway - Self Balancing Robot with Self Reset

Post your NXJ projects, project ideas, etc here!

Moderators: 99jonathan, roger, imaqine

GELway - Self Balancing Robot with Self Reset

Postby iWitzand » Tue Jul 28, 2009 1:25 am

Quick Link http://code.google.com/p/gelway/
Has the project, available for download with documentation
----------------------------------------------------------------------------------
Hello everyone,

I am currently halfway through my thesis for the year. I was tasked with building a Coordinated LEGO Segway, and attempting to improve on previous methods.

For the last 4 months or so I have focused on getting my robot to balance, and fine tuning the PID controller.

At this stage its current functionality is
- Able to be driven by mobile phone (I have edited an existing Java Bluetooth mobile application, so that it sends integers to the NXT).
- Able to be driven by my Laptop (not that exciting)
- Can use any Hitechnic gyro with the need for the software to be updated
- Has the start of a behavioural system being implemented into it. At this stage it can avoid obstacles, and be driven by Bluetooth, but will be updated with more Behaviours in the future.
- Has a self reset which uses the EOPD sensor to detect if it is upright. I haven’t seen this implemented in any other balancing robot, it’s pretty simple, but very effective, and stops the robots wheels continuously moving once it falls over. The second YouTube link shows how this works.

For the next few months I plan on building a second balancing robot, and working on communication between two robots. I’ll work on areas like having different sensors attached to each robot, and getting a joint view of the environment to problem solve. An example might be to group the robots closer together if it is night time, having one robot detect upper obstacles and one to detect lower obstacles.

Once I finish my work for the year, it is submitted on 2nd November, I will post my code and the thesis write up. At this stage it is up to 70 pages, so it is a big read, but might be interesting to someone.

Here are the two video’s I have posted so far,

Driving with mobile phone, ramp testing
http://www.youtube.com/watch?v=I6qQwWdYVHM

Using EOPD sensor to reset balance
http://www.youtube.com/watch?v=hIpSBAiAFq0

Feel free to provide any feedback, or ask questions,

Steve
Last edited by iWitzand on Mon Nov 09, 2009 2:00 am, edited 1 time in total.
iWitzand
Novice
 
Posts: 30
Joined: Tue Jun 09, 2009 8:27 am

Postby allonhadaya » Tue Jul 28, 2009 5:41 am

Nice Project!

I did something similar this past summer, but just for fun. I created a Windows Mobile application and an abstract java class. For new robots, I just define the abstract methods for behavior on key presses.

I can't wait until I can play with legos for a thesis. ;)
allonhadaya
New User
 
Posts: 11
Joined: Mon May 25, 2009 1:32 am
Location: United States

Postby gloomyandy » Tue Jul 28, 2009 7:48 am

Hi,
Nice project...

- Can use any Hitechnic gyro with the need for the software to be updated


Could you explain a little more about what software updates are needed?

Interesting use of the EOPD sensor. In my robot I used an accelerometer to provide an absolute tilt input which allowed detection of the robot falling. I aslo used this this with a Kalman filter to correct the gyro drift. I assume you are also having to correct for this... My robot would balance well (until the batteries ran out), but I never really got steering and movement working, so I'm looking forward to seeing your code!

All the best

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4172
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Postby iWitzand » Tue Jul 28, 2009 9:54 am

Hey Andy,

Yeh sorry was probably a poor choice of english. What I meant was that the gyro calculates its own offset, when the robot is turned on, provided the robot is kept stationary at the start.

I worked with some existing balancing code, which had been set up to use only their own gyro. I just added a simple loop, which takes the average value of the gyro being read 50 times. This way the program isn't written to work with only one gyro, but can handle any hitechnic gyro.

I was thinking of using the accelerometer for mine, but thought an EOPD was easier, plus it could also recognise if it had been lifted off the ground. Would your robot try to balance if you kept it upright, but off the ground?

I have seen designs using a Kalman filter, i've looked at yours on YouTube, and sort of wished I went down that track, but I am a bit to indepth into my robot now, and moving onto communicating between two robots. Plus the addition of the accelerometer means I lose another sensor port. I will definately post my code once I am done,

Steve
iWitzand
Novice
 
Posts: 30
Joined: Tue Jun 09, 2009 8:27 am

Postby gloomyandy » Wed Jul 29, 2009 7:55 am

Hi Steve,
Good luck with finishing everything up, it looks like an interesting project.

I wonder if you could help me with something. I did a quick search yesterday for details of the Marvin project and found a Wiki, I started to read some of the details but had to stop and go and do some real work! I've just tried to get back to it but now I'm not able to access the Wiki pages. Do you have a link to the Marvin stuff that works?

Thanks

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4172
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Postby iWitzand » Wed Jul 29, 2009 1:50 pm

Hey Andy,

I just tried to get on myself, it appears whatever they had up has been pulled down. Luckily I saved a PDF of all there documentation. If you want to send me your email address I can forward it on. I also have their original source code I think as well somewhere. So I can send that too.

Steve
iWitzand
Novice
 
Posts: 30
Joined: Tue Jun 09, 2009 8:27 am

Postby gloomyandy » Wed Jul 29, 2009 2:15 pm

Thanks Steve that would be great... I've emailed you (via this site), my email address...

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4172
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Postby sabinehaag » Mon Aug 03, 2009 10:48 am

Hello together,

could anyone give me a hint how to let the "Segway" move around? I managed to get it stable and let it turn, but have no clue how to get it move forward or backward...

Best regards
sabinehaag
New User
 
Posts: 3
Joined: Mon Aug 03, 2009 10:45 am

Postby pEhrlich » Mon Aug 03, 2009 7:25 pm

until someone else has a better idea --

I've never tried to make a segway, but couldn't you somehow tell it to match an angle that is not straight up in order to move? The greater the angle, the faster it goes..
User avatar
pEhrlich
Advanced Member
 
Posts: 158
Joined: Fri Jan 04, 2008 1:38 am

Postby iWitzand » Sat Aug 08, 2009 11:57 am

hey pEhrlich,

Getting it to move forwards and backwards can be tricky. At least I found anyway. This is because most balancing robots use some form of PI/PID controller to keep it balanced and remove disturbance.

How I overcame this was to increase/decrease a small offset to the gyrosensor readings gradually over a specified period of time. This will offset the robots balance causing it to move forwards or backwards. However once I stop apply the offset the robot will start balancing in one spot again, this is because the PID controller removes the disturbance in the Gyro. Does this make sense?

I know there is probably a more effective way of doing this, but it worked for me.

Witz
iWitzand
Novice
 
Posts: 30
Joined: Tue Jun 09, 2009 8:27 am

Postby iWitzand » Mon Aug 17, 2009 9:57 am

Anyone intersted in following my robots progress, I just put another video up, shows the robot with different wheels. I found the best set of wheels for my balancing robot was the motorcycle wheels. Here is the link for the latest video

http://www.youtube.com/watch?v=xzsrYRL6V3A

It gets more intestesting towards the end, when it is moving around really fast.

Witz
iWitzand
Novice
 
Posts: 30
Joined: Tue Jun 09, 2009 8:27 am

Postby tatranky » Mon Aug 17, 2009 6:59 pm

Nice Projekt.... :D

I'm trying to make one myself, but i can't find any clue on how to make a constant scantime on the NXT. As far as i understand it, i need a constant scantime to calculate the PID precicely... Or is there another way??
User avatar
tatranky
New User
 
Posts: 6
Joined: Mon Aug 17, 2009 6:56 pm
Location: DK - Aalborg

Postby Atr » Mon Aug 17, 2009 9:54 pm

Yup, I'm interested in your project and I like it :)
The stability of your seg is quite impressive.

I have borrowed a gyro sensor from my university and will test it soon.
I'm glad that you will post your code, looking forward to see it.
Atr
New User
 
Posts: 9
Joined: Sat Oct 11, 2008 8:02 pm
Location: Poland

Postby iWitzand » Tue Aug 18, 2009 2:36 am

Hey guys, a few have shown interested in the balancing part of my robot. Its a bit rough right now, as in I haven't commented it. But hope this helps a little.

Code: Select all
Code Removed


If you need more help in working out parameters such as motor angle and velocity, gyro angle and velocity let me know.

Witz
Last edited by iWitzand on Sat Aug 22, 2009 12:14 am, edited 1 time in total.
iWitzand
Novice
 
Posts: 30
Joined: Tue Jun 09, 2009 8:27 am

Postby iWitzand » Wed Aug 19, 2009 11:50 am

Hey everyone,

Anyone keeping up with my robot here is my latest video, it basically tests the GELway carrying different weights, mainly household items such as shoes, a tool box, uno attack, a Nintendo Gamecube =).

http://www.youtube.com/watch?v=lMKqaLCVizc

My next video will involve GELway Jousting haha, if you watch the video right till the end you will see a sneak peak.

Witz
iWitzand
Novice
 
Posts: 30
Joined: Tue Jun 09, 2009 8:27 am

Next

Return to NXJ Projects

Who is online

Users browsing this forum: No registered users and 1 guest

more stuff