RobotThoughts

Made in the workshop. Notes, projects, and mildly-useful tools.

/

Lego Mindstorms NXT Segway

1 min read

The other night I was researching building a balancing Segway like robot with the Lego Mindstorms NXT kit. I wanted a robot that could balance on two wheels and could move forward and backward. I also wanted the robot to recover when “pushed”.

I was familiar with Steve Hassenplug’s Legway built on the Lego RCX platform, but I wanted to tackle the challenge with the NXT. Luckily, I found Philo Hurbain’s NXTWay. I was intrigued enough to build a copy and try out the programming.

It is quite hard to get the balance right and in the end I created a very aggressive robot that I can push around and it will mostly right itself. Here is the video of the final creation.



48 responses to “Lego Mindstorms NXT Segway”

  1. Hi Rich,

    very impressive NXTWay. Me and my son, we want to give it a shot as well and I was wondering if you could share with us your NXT-G code so we get some ideas how the balancing portion needs to work.

    Thanks

    Marek

  2. Hi Rich,

    very impressive NXTWay. Me and my son, we want to give it a shot as well and I was wondering if you could share with us your NXT-G code so we get some ideas how the balancing portion needs to work.

    Thanks

    Marek

  3. Nice!!! 🙂

  4. Nice!!! 🙂

  5. I pretty much modified the code from Philo’s website listed above. Modify the “scale” parameter to get some of those effects.

  6. I pretty much modified the code from Philo’s website listed above. Modify the “scale” parameter to get some of those effects.

  7. swissboy

    hi,
    your bot is very nice. i have some problem with the program from Philo. could you give me the programm for the nxt??
    thanks

    and sorry for my bad english, but i speak normaly german

  8. swissboy

    hi,
    your bot is very nice. i have some problem with the program from Philo. could you give me the programm for the nxt??
    thanks

    and sorry for my bad english, but i speak normaly german

  9. Very cool what you did! I played around with the scale, but wasn’ able to do anything you did. Could you post your scale and PID values(KD, KI, KD) and potentially other params you edited?
    Also: were you able to place counterweights so that your NXTway balance standing fully upright?
    Any hints would be great – thanks!!!

  10. Very cool what you did! I played around with the scale, but wasn’ able to do anything you did. Could you post your scale and PID values(KD, KI, KD) and potentially other params you edited?
    Also: were you able to place counterweights so that your NXTway balance standing fully upright?
    Any hints would be great – thanks!!!

  11. i think all you did ws to sewt the light sensor value when it was at x it was vertical, when it was lesss it went forward to correct it self, when greater it went backwards to correct its self. and by adding a second sensor would prob make it easyer to backwards. but if you did programing a certian way just add a wheely bar.

  12. i think all you did ws to sewt the light sensor value when it was at x it was vertical, when it was lesss it went forward to correct it self, when greater it went backwards to correct its self. and by adding a second sensor would prob make it easyer to backwards. but if you did programing a certian way just add a wheely bar.

  13. I could only get it to balance, but not move or move and not balance. I need a second light sensor so I can rebuild it and try for both movement and balance without any non-lego sensors.

  14. I could only get it to balance, but not move or move and not balance. I need a second light sensor so I can rebuild it and try for both movement and balance without any non-lego sensors.

  15. Hi Rich,
    your NXT Segway is really a piece! Could you please get in touch with me?

  16. Hi Rich,
    your NXT Segway is really a piece! Could you please get in touch with me?

  17. Hey Rich,

    I was wondering if you programed this using the Mindstorms software or programs listed on Philo’s website. I am trying to program it using the Mindstorms software and I can’t get it to work.

    Thanks.

  18. Hey Rich,

    I was wondering if you programed this using the Mindstorms software or programs listed on Philo’s website. I am trying to program it using the Mindstorms software and I can’t get it to work.

    Thanks.

  19. I used the program from philo’s website and modified the variables.

  20. I used the program from philo’s website and modified the variables.

  21. brett stevens

    I have been trying to build this NXTway but I cannot get it to stand straight no matter how I vary the coefficients! Nor beable to move and stay balanced. Does anyone have some tips on how to go about “tuning” KP, KD, KI. Should the scaling parameters for err

  22. brett stevens

    I have been trying to build this NXTway but I cannot get it to stand straight no matter how I vary the coefficients! Nor beable to move and stay balanced. Does anyone have some tips on how to go about “tuning” KP, KD, KI. Should the scaling parameters for err

  23. It has been a while since I played with this one, but try to slowly change the variables. Start with one variable at a time. It took forever for mine to balance and move properly. Even after all that work it was still quite un-reliable.

  24. It has been a while since I played with this one, but try to slowly change the variables. Start with one variable at a time. It took forever for mine to balance and move properly. Even after all that work it was still quite un-reliable.

  25. Hello I would have there times ne question: I try for 5 weeks already mean Segway robot to programieren and to calibrate ultrasonic sensor (17-9) cm or photosensor (382-525) and I get it not, could you me perhaps times help or me one tap give. Mfg Nils would make me happy about an answer

  26. Hello I would have there times ne question: I try for 5 weeks already mean Segway robot to programieren and to calibrate ultrasonic sensor (17-9) cm or photosensor (382-525) and I get it not, could you me perhaps times help or me one tap give. Mfg Nils would make me happy about an answer

  27. Congratulations!! you robots are so cool!!
    do you just have a NXT kit??

  28. Congratulations!! you robots are so cool!!
    do you just have a NXT kit??

  29. I have a few NXT kits and lots of other technic kits used for parts.

  30. I have a few NXT kits and lots of other technic kits used for parts.

  31. jorge – españa

    Please. i need contact with the code source of this video. who is the creator.contact with me: gsivillerp@hotmail.com or sistemas_wl@hotmail.com.
    this is my project final of the course system embebed and i cant stand up my robot lego nxt. please urgent contact with me.

  32. jorge – españa

    Please. i need contact with the code source of this video. who is the creator.contact with me: gsivillerp@hotmail.com or sistemas_wl@hotmail.com.
    this is my project final of the course system embebed and i cant stand up my robot lego nxt. please urgent contact with me.

  33. Can you send me the blueprints on how to make it and the program for it?

    I would appreciate it.

  34. Can you send me the blueprints on how to make it and the program for it?

    I would appreciate it.

  35. can I have the segway code?

  36. can I have the segway code?

  37. descient, but put the light sensor further out, and lower the trigger point on the light sensor i built a segway robot too. make it taller, and download the segway program from nxtprograms.net (i did not make that program, but it works very well. I use a program i created, but i have not figured how to put it online)

  38. descient, but put the light sensor further out, and lower the trigger point on the light sensor i built a segway robot too. make it taller, and download the segway program from nxtprograms.net (i did not make that program, but it works very well. I use a program i created, but i have not figured how to put it online)

  39. may I have a look at your code, I found your robot quite stable. I am doing my own project as well, but it always tip over, I wonder if there is something wrong with my PID value and the algorithm.
    Hope you can share some info with me.

  40. may I have a look at your code, I found your robot quite stable. I am doing my own project as well, but it always tip over, I wonder if there is something wrong with my PID value and the algorithm.
    Hope you can share some info with me.

  41. Hello
    Your vedio is really cool
    I have few qustion

    I can balance the robot,but I don’t know how to
    foward at same time,would you mind to give me some suggestion??
    Hope you can help me:)

    May you have good day:D

  42. Hello
    Your vedio is really cool
    I have few qustion

    I can balance the robot,but I don’t know how to
    foward at same time,would you mind to give me some suggestion??
    Hope you can help me:)

    May you have good day:D

  43. I tried to build in bricx command center, but its not stabilizing. can you help me, if i send you codes ?

  44. I tried to build in bricx command center, but its not stabilizing. can you help me, if i send you codes ?

  45. melvin chan

    hello, can you please share your code, it´s for a school assignment. Thank you.

    1. Rich Thompson

      I think you will have better luck with the code links in the article. I used the NXTway code linked above.

  46. melvin chan

    hello, can you please share your code, it´s for a school assignment. Thank you.

    1. Rich Thompson

      I think you will have better luck with the code links in the article. I used the NXTway code linked above.

Leave a Reply

Your email address will not be published. Required fields are marked *