djm

[NXT] Modified HiTechnic Segway

Recommended Posts

HiTechnic make third party sensors for NXTs. One of their sensor’s, the gyroscope sensor, can be used to create a LEGO NXT Segway. A video of their model is available

Additional details and building instructions are available at http://www.hitechnic.com/blog/gyro-sensor/htway/

Having seen how much enjoyment my children had when playing with this model, I decided to build some for a show being run by my LUG. I endeavour to provide the public an opportunity to interact with my displays, on the premise that it is more interesting for them. While testing the models prior to the show, I identified some minor alterations to HiTechnic’s program which appear to improve the stability of the Segway. The remainder of this post describes some observations about running the model and alterations which were made to the original program.

But first, Cutting to the Chase
If you’re more interested in running the modified program rather than reading the rest of the post, download this zip file and follow the instructions in the readme.txt file to install the program on your NXT.

General Observations
1) Having similar motor speeds helps
The robot stability seems to improve if the two NXT motors rotate at close to the same speed. An issue of differing motor speeds is described here and includes some techniques you may wish to try to better identify suitable motor pairs. Alternatively, within the zip file identified above, there is a program named rotation_count. You can install it, connect one motor to the A port and one to the C port and run the program. The program will identify the number of rotations each motor makes in 20 seconds. The closer you can get the numbers to match, the closer the motor speeds should be to being the same and the more stable the robot appears to be.

2) Battery charge level matters
I tend to run my NXTs with the rechargeable battery pack. It is noticeable that when the robots have been running for a considerable duration (hours), they become more prone to falling. This is resolved instantly by replacing the rechargeable battery pack with a fully charged battery pack.

Program Tweaks
I made a couple of tweaks to the program. One was to try to improve the stability and the others to enhance the usability.

a) Gradual Speed Change
The original program treats the command from the Infrared remote as an instant command. The two lever IR controller has three speed values; -7 (backwards), 0 (neutral) and 7 (forwards). If the Segway is travelling backwards and both levers are pushed forward, the Segway responds by changing the motor direction at full throttle i.e. from -7 to +7.
The modified program treats a change in the IR remote lever position as a speed delta change. When the Segway is travelling backwards and both levers are pushed forward, the Segway responds by changing the motor speed and direction in single increments i.e. -7, -6, -5, -4, …, 4, 5, 6, 7. This results in a more gradual acceleration/deceleration for the Segway and less “rocking”.

b) Prompt for IR Channel
The modified program begins by prompting for which IR channel number you want to control the Segway with. This allows multiple Segways to run concurrently using independent IR remote controls.

c) Continue After Falling
When the Segway falls, the original program displays a message and then exits once the NXT’s “return” key is pressed. The modified program displays the same message but then loops back to the point where the Segway is stood up. This alteration makes it easier to continue running the program when it is under the control of a member of the public e.g. at a display.

Demonstration
The following video is split into 3 segments. They illustrate;

  • the impact of having a low battery (segment 1)
  • the benefit of a fully charged battery (segment 2)
  • the behavioural difference between the original program (yellow Segway) and the modified program (white and red Segways). The difference is most noticeable toward the end of the segment. The yellow Segway will start and stop turning before the other two Segways. Similarly, the yellow Segway will begin to move forward and backwards sooner than the red and white Segways, which results in it swinging more.

If you have any questions about anything above, please post them here and I will do my best to answer them.

Regards,

David

Edited by djm
typo

Share this post


Link to post
Share on other sites

Thank you for sharing.

I like very much the idea of the motor speed increment.

I did not know you could use the PF IR remote with the light sensor to control the NXT. I presume it is the same with EV3.

Share this post


Link to post
Share on other sites

This is very interesting and informative post. Thank you for sharing!

And I really like what you did with the different colored segways. The devil is in the details :wub:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.