4.77778

4.8 | 9 ratings Rate this file 276 downloads (last 30 days) File Size: 11.31 MB File ID: #19147

NXTway-GS (Self-Balancing Two-Wheeled Robot) Controller Design

by Yorihisa Yamamoto

 

11 Mar 2008 (Updated 01 May 2009)

Code covered by the BSD License  

NXTway-GS Model-Based Design based on Embedded Coder Robot NXT.

Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

Download Now | Watch this File

File Information
Description

NXTway-GS is a self-balancing two-wheeled robot built with LEGO Mindstorms NXT and a Hitechnic gyro sensor. This demo presents sample models and documents describe the following contents.

How to Build NXTway-GS
Mathematical Dynamics Model of NXTway-GS
Controller Design for Balance and Drive Control
NXTway-GS Model Illustration
Simulation and Experimental Results

You can simulate NXTway-GS model and generate controller program that can be executed on the NXT. You can watch the movies of NXTway-GS simulation and control experiment at the following URL.

http://www.youtube.com/watch?v=EHPlGTLQHRc
http://www.youtube.com/watch?v=4ulBRQKCwd4

This demo uses Embedded Coder Robot NXT Demo as MBD environment. You need to download it from the following URL before trying this demo.

http://www.mathworks.com/matlabcentral/fileexchange/13399

<Disclaimer>
LEGO(R) is a trademark of the LEGO Group of companies which does not sponsor, authorize or endorse this demo. LEGO(R) and Mindstorms(R) are registered trademarks of The LEGO Group.

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
Embedded Coder Robot NXT Demo, NXT SCARA (Two-Link Planar Robot Arm) Controller Design, NXT Ballbot (Self-Balancing Robot On A Ball) Controller Design
This submission has inspired the following:
NXT SCARA (Two-Link Planar Robot Arm) Controller Design, NXT Ballbot (Self-Balancing Robot On A Ball) Controller Design, Embedded Coder Robot NXT Demo

Required Products Control System Toolbox
Fixed-Point Toolbox
Real-Time Workshop
Real-Time Workshop Embedded Coder
Simulink
Simulink Fixed Point
Simulink 3D Animation
MATLAB release MATLAB 7.5 (R2007b)
Other requirements nxtOSEK, Cygwin, GNU ARM
Zip File Content  
Other Files
nxtway_gs/docs/english/NXTway-GS Building Instructions.pdf,
nxtway_gs/docs/english/NXTway-GS Model-Based Design.pdf,
nxtway_gs/docs/japanese/NXTway-GS ,
nxtway_gs/models/iswall.m,
nxtway_gs/models/mywritevrtrack.m,
nxtway_gs/models/nxtway_gs.mdl,
nxtway_gs/models/nxtway_gs_controller.mdl,
nxtway_gs/models/nxtway_gs_controller_fixpt.mdl,
nxtway_gs/models/nxtway_gs_plant.mdl,
nxtway_gs/models/nxtway_gs_vr.mdl,
nxtway_gs/models/param_controller.m,
nxtway_gs/models/param_controller_fixpt.m,
nxtway_gs/models/param_nxtway_gs.m,
nxtway_gs/models/param_plant.m,
nxtway_gs/models/param_sim.m,
nxtway_gs/models/track.bmp,
nxtway_gs/models/track.wrl,
nxtway_gs/models/vrnxtwaytrack.wrl
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (14)
11 Mar 2008 Diego Barragán

Nice

17 Mar 2008 Anas Obeidat

it's Excellent Simulation to NXT robot and Documentation is perfect.

28 May 2008 Tatsuya Kikuchi

I watched the Self-Balancing Two-Wheeled Robot at Embedded Systems EXPO in Tokyo. It looked like a clown on a monocycle. I think this robot is joyful study case for students.

22 Jun 2008 CHENMIN CHENMIN  
29 Jun 2008 CHENMING CHENMING  
16 Jul 2008 yipeng tang  
28 Apr 2009 Anand

I am not able to unzip this file. please help

30 Apr 2009 Yorihisa Yamamoto

> Anand
This file is archived with "Compressed (zipped) folder" shortcut of Windows XP. Please try to decompress it using WinZip or other utilities.

24 Jun 2009 Sam Mirsky

Well done. Good documentation. This demo impresses everyone I show it to.

26 Dec 2009 Juan Luna

Hello,
 
I'm trying to enhance (expand) the autonomous mode that controls the NXTway, this by implementing the pure pursuit algorithm, which is executed when these option is chosen.

During the simulation, I found to have some doubts:

1. Why to calculate the current position of the robot you do not use the equation 3.1 on page 7 of document (revision 1.1)?, but instead you use this one:
 
Z = integral (thetadot * R * cos (phi)) + initial Z;
Y = integral (thetadot * R * sin (phi)) + initial Y

I know that you renamed the coordinates of the robot (pg 56), but despite of the change of coordinates I think the equations are not equivalent.

2. As I could see in the file param_controller.m the maximum linear velocity is 0.3 [m / sec], but you do not put the equivalence with the angular velocity, so: If I put in the gamepad phidot_ref=10, how much it is equivalent in angular velocity?, what I see is that what you do is to add and subtract power to the motors (with a maximum of 25 pwm).

I really appreciate your attention. Thanks in advance, any help you can give me and I am attentive to your answer.

16 Mar 2010 Juan Luna

> Yorihisa Yamamoto

Hello, I first want to say that a person who designs a system so well, as seen in the archives of NXTway-GS, you should take time to support, from the fact that the documentation leaves some empty, they took me a while to realize that control the direction of the robot is in open loop.

29 Apr 2010 Philipp B

Hello,

has somebody implented an observer based strategy for the non measured states? Great work by the way, but from the view of modern control theory an observer based method would be even better.

04 May 2010 Nguyen Hieu  
12 May 2010 Juan Luna

Philipp, i have completed the controller becoming both dynamics into one, and close the loop control in the wheel dynamics, but i calculated the remain states from the on-board sensors. the controller can track lineal and angular velocities. but the idea of an observer was made by Takachi in his early nxtWAY in with use a ligth sensor to determinate the states (ecrobot exmples).

Please login to add a comment or rating.
Updates
07 Nov 2008

1.0 : First edition
1.1 : Added fixed-point controller model
1.2 : modified motion equations

11 Nov 2008

1.2+ Add an annotation to download the generated code into NXT standard firmware

28 Nov 2008

Modified the generalized forces and state equations.
Added simulation movie

26 Feb 2009

updated building instructions
added japanese document

01 May 2009

1.4 Modified text

Tag Activity for this File
Tag Applied By Date/Time
realtime workshop Yorihisa Yamamoto 22 Oct 2008 09:52:45
embedded code Yorihisa Yamamoto 22 Oct 2008 09:52:45
verification Yorihisa Yamamoto 22 Oct 2008 09:52:45
lego Yorihisa Yamamoto 22 Oct 2008 09:52:45
mindstorms Yorihisa Yamamoto 22 Oct 2008 09:52:45
nxt Yorihisa Yamamoto 22 Oct 2008 09:52:45
nxtway Yorihisa Yamamoto 22 Oct 2008 09:52:45
legway Yorihisa Yamamoto 22 Oct 2008 09:52:45
robot Yorihisa Yamamoto 22 Oct 2008 09:52:45
segway Yorihisa Yamamoto 22 Oct 2008 09:52:45
embed Cristina McIntire 10 Nov 2008 10:43:50
modeling Cristina McIntire 10 Nov 2008 10:44:01
model Cristina McIntire 11 Nov 2008 12:14:46
model Yorihisa Yamamoto 06 Jan 2009 00:45:56
control Yorihisa Yamamoto 06 Jan 2009 00:46:57
ecrobot Gautam Vallabha 08 Apr 2009 13:14:54
potw Shari Freedman 14 Aug 2009 11:10:29

Contact us at files@mathworks.com