GELway - Self Balancing Robot with Self Reset

Post your NXJ projects, project ideas, etc here!

Moderators: 99jonathan, roger, imaqine

Postby helifreak » Thu Nov 26, 2009 5:45 am

Urhg....


I have been struggling with this all night...

I have migrated the code to Lejos 0.8.5 - as I can't get 0.8.0 to flash on my OS X 10.6 machine.

My main is calling load_normal - which looks like
Code: Select all
      LCD.drawString("InitGyro...", 2, 1);

      // Start Bluetooth reader thread
      //br = new BluetoothReader(conn);
      //br.start();
      // Start Balance control thread
      // BalanceController bc = new BalanceController(ctrl);
     //LCD.drawString("Starting Balance Controller...", 2, 1);
      BalanceController bc = new BalanceController(ctrl);
      bc.start();
      //LCD.clear();
    
      //Behavior b1 = (Behavior) new GELwayDriver(ctrl, br); // Needed to drive robot and slave
      // Behavior b1 = new GELwayFollower(ctrl);
      Behavior b2 = (Behavior) new DetectObstacle(ctrl); // Needed to avoid obstacles
      //Behavior b3 = new KeepStraight(ctrl); // Needed to keep straight
      Behavior[] bArray = { b2};
      Arbitrator arby = new Arbitrator(bArray);
      arby.start();



The problem I am seeing is that my gyro calibration is coming back with a gyro offset of 0.0 (zero). Uhg. Could this be due to using 0.8.5? When reading my Gyro using NXT 1.28 it seems to be working fine.
Last edited by helifreak on Thu Nov 26, 2009 6:13 am, edited 1 time in total.
helifreak
New User
 
Posts: 9
Joined: Mon Nov 16, 2009 6:40 pm

Postby helifreak » Thu Nov 26, 2009 6:12 am

Ok, I have double checked and triple checked that I have my gyro sensor plugged into the correct port (port 3) - and created a really simple program which prints out the reading of the sensor every 200ms - the reading is -1...

Here is the program:
Code: Select all
      while (true) {
       LCD.drawString("value: " + port.readValue(), 2, 5);
         try {
            Thread.sleep(200);
         } catch (InterruptedException e) {
         }



However, when I run the NXT firmware, and run the data log on the the port, I see correct values for the gyro sensor.

I am baffled.

This is using Lejos 0.8.5 firmware - compiled with lejos 0.8.5 classes on Mac OS 10.6 (Snow Leopard) - with the Snow Leopard -d32 fixes installed.
helifreak
New User
 
Posts: 9
Joined: Mon Nov 16, 2009 6:40 pm

Postby gloomyandy » Thu Nov 26, 2009 7:42 am

Hi,
Please post all of your test program. Also what kind of gyro are you using?

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

Postby helifreak » Fri Nov 27, 2009 3:39 am

Yay! Got a basic single Obstacle avoiding GELway working under Lejos 0.8.5. I'll try to summarize what I had to do to get things working:

The main problem I was having was that the GyroscopeSensor class wasn't able to read my gyro (Hitechnic Gyro) using the generic port.readValue() methods - I have no idea why. I had to instantiate a GyroSensor object and use it to read the values.

So in GyroscopeSensor.java, I added :

GyrosSensor theSensor = new GyroSensor(port);

and replaced all of the port.readValue() calls with theSensor.readValue()


Two main framework changes:

lejos.subsumption is now lejos.robotics.subsumption
and Motor.getActualSpeed has been replaced by Motor.getRotationSpeed

Oh, and I also bumped up the balance loop delay to 10.

Its working great now... Balancing robots have so much personality...

Congrats iWitzand... what an amazing thesis project you have produced!
helifreak
New User
 
Posts: 9
Joined: Mon Nov 16, 2009 6:40 pm

Postby iWitzand » Fri Nov 27, 2009 2:57 pm

Hey helifreak (always feels weird using user names haha),

I am glad you got it working, makes me happy to know the robot is getting out there, since I put so much time into it.

For anyone interested I passed my thesis =). Results came out yesterday, and got the marks I was after so I have been celebrating like all good uni students do haha.

As for the wheels, I used the motor cycle wheels, but if you remember back to a video I made the robot can balance with any wheels attached, but balances the best using the motor cycle wheels. As for the battery pack, I used a rechargable battery. However a friend overseas has used batteries and he has had no problems. He noticed it started to struggle to balance when the batteries get low, but that was about it.

Hope all is well in the balancing world =)

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

Postby gloomyandy » Fri Nov 27, 2009 3:38 pm

Hi Steve,
Congratulations on your results! Great news...

All the best

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

Postby kellogg » Fri Dec 04, 2009 5:34 am

Hi Steve and congrats on the diploma. It is a great piece of work. I haven't touched my robot in few weeks now, but you reminded me to check the batteries. I am using rechargeable NiMH but they may be running low. I'll check it as soon as I get a chance and let you know. My wheels are also motorcycle size.

- k
kellogg
New User
 
Posts: 13
Joined: Fri Oct 23, 2009 7:07 pm

Postby gloomyandy » Fri Jan 15, 2010 1:12 pm

Hi,
This is a very popular project. So if anyone has a version of this code that works with the latest version of leJOS (0.85), please let me know (and if you don't mind send me the working code), I'll try and make sure that an updated version of the code is available for download...

Thanks

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

Gyroscope Sensor!

Postby nikky » Fri Jan 22, 2010 7:17 am

Heyhey!!

Nice project you have done! =) can i ask a favor from you? I just receive my gyroscope!! but i have no idea on how to program it and i didn't manage to find any java source code from the internet unlike the line follower, sonic sensor, sound control car etc etc. is it possible for you to teach me how to type out a simple program to let my nxt stand on 2 wheels?
(^.^)
nikky
New User
 
Posts: 1
Joined: Fri Jan 22, 2010 7:09 am

GelWay Software

Postby borbon_juggler » Sun Jan 24, 2010 5:35 pm

Hi Steve

My name is Philip, I'm in my last year of undergraduate engineering and together with my partner we decided to implement a distributed control by using LEGO robots, after investigation, we think in a platoon of robots (4 robots), whose objective will be find bombs through cooperative techniques, after some research we found it interesting do that using self-balancing robots.

Two months ago we study in depth the NXTway-GS (using SIMULINK files) and its documentation in fact trying to adapt a outer loop to act as a path tracking control using odometry to sense the position, but we noticed shortcomings such as synchronizing robots, in addition to the path tracking control is running all the time, to stop them and run routines such as avoiding obstacles should use flags, but after several attempts to implement became somewhat confused, then at that point we decided to find Another way to implement.

A week ago during the research process, I found your thesis, first want to tell, your work is very well documented, clear to the reader, and according to the objectives outlined in it, in fact, after careful reading, we decided to used your scalable platform as base. but i`d like to make a question to you:

¿Could a path tracking control be implemented as a Behavior?, you use a control distance as a behavior in the Gelway follower, but the problem is you use only one dynamic to control the robot, and psi is control indirectly by setting a PWM voltage offset in each of the motors. and you give some advise to do that.

and finally when i compile your code, give me an error in the import of lejos.subsumption.*; do you know why?
borbon_juggler
New User
 
Posts: 6
Joined: Wed Jan 20, 2010 4:45 pm

Re: GelWay Software

Postby epascual » Sun Jan 24, 2010 9:48 pm

borbon_juggler wrote:and finally when i compile your code, give me an error in the import of lejos.subsumption.*; do you know why?

Maybe this is because the package is now lejos.robotics.subsumption and the original code is using an older version.
epascual
Active User
 
Posts: 123
Joined: Sun Jan 17, 2010 12:15 am
Location: Sophia-Antipolis (France)

GelWay Software Downloaded

Postby borbon_juggler » Mon Jan 25, 2010 6:01 am

Good Night everyone:

After a Sunday full of work, and using the instruction given by Steve to Kellog in the LeJOS forum, i downloaded the controller to my Gelway robot, i know that is only the beginning, but i like suggest to make a video or something showing how initialized the robot.

Regards

Philip
borbon_juggler
New User
 
Posts: 6
Joined: Wed Jan 20, 2010 4:45 pm

Gelway Bluethoth GUI

Postby borbon_juggler » Mon Jan 25, 2010 11:16 pm

Good afternoon, as I said in my previous post, could download the Robot Controller (turning off Bluetooth functions), now I'm trying to use remotely connection using the GUI for the PC in my Laptop, but never connects, it stays waiting for a connection, someone made that works. tonight I'm going to compiling the code again.

Philip
borbon_juggler
New User
 
Posts: 6
Joined: Wed Jan 20, 2010 4:45 pm

Gelway Laptop Bluetooth Connection

Postby borbon_juggler » Tue Jan 26, 2010 10:14 pm

Hi Steve, continuing with the learning about the platform you developed for GelWay, I am now testing the communication between PC and Gelway through Bluetooth, to do that, in the main class, i activate the line loadNormal (); and leaving the others disabled, and in that way enable the line Conn.setIOMode (0); but the problem is although communication is achieved and can be seen in the" LCD the direction you are sending the robot is not running the movements, only stay in a stationary upright, should I add something more to make it work?

best regards

Philip
borbon_juggler
New User
 
Posts: 6
Joined: Wed Jan 20, 2010 4:45 pm

Hey All

Postby iWitzand » Tue Feb 02, 2010 4:55 am

Hey Phillip,

First off sorry for lack of replying. I've since left uni and have started an engineering course down in Melbourne, and have very little access to the internet. Also I had to hand over my robots back to the school, so I am not programming with them anymore.

Just quickly reading over your previous post, a bit pressed for time, I think you have managed to send bluetooth commands to the robot. I good way to test it to just use the LCD as your debugger, send a command and see if you can get it to display the sent integer. There should be a behaviou for movements, so make sure that is activiated, and see if the program actually enters it (use the LCD again).

I never used leJOS 0.85 which has a few differences, but maybe someone has got it working and they could help you more. Most of the people I assisted over the duration of my project used leJOS 0.8. I gotta run, but will try to revisit this page again sometime, wish you all the best, balancing robots is fun =)...ohh and if you can work out how to use them as shoes, that would be great.

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

PreviousNext

Return to NXJ Projects

Who is online

Users browsing this forum: No registered users and 1 guest

more stuff