Rev 1 | Blame | Last modification | View Log | Download
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><!-- saved from url=(0054)http://www.cs.uu.nl/people/markov/lego/tips/index.html --><HTML><HEAD><TITLE>Lego Robots: Tips and Tricks</TITLE><META http-equiv=Content-Type content="text/html; charset=windows-1250"><META content="MSHTML 6.00.2800.1226" name=GENERATOR></HEAD><BODY background="Lego Robots Tips and Tricks_soubory/back.jpg"><TABLE><TBODY><TR vAlign=top><TD><P><IMG src="Lego Robots Tips and Tricks_soubory/logo.gif"></P><P><A href="http://www.cs.uu.nl/people/markov/lego/index.html"><IMGheight=58 alt=[Home] src="Lego Robots Tips and Tricks_soubory/homeoff.gif"width=78 align=ABSCENTER border=0></A></P><P><Ahref="http://www.cs.uu.nl/people/markov/lego/challenge/index.html"><IMGheight=58 alt=[Challenge]src="Lego Robots Tips and Tricks_soubory/challengeoff.gif" width=78align=ABSCENTER border=0></A></P><P><A href="http://www.cs.uu.nl/people/markov/lego/rcxcc/index.html"><IMGheight=58 alt=[RcxCC]src="Lego Robots Tips and Tricks_soubory/rcxccoff.gif" width=78align=ABSCENTER border=0></A></P><P><A href="http://www.cs.uu.nl/people/markov/lego/robots/index.html"><IMGheight=58 alt=[Robots]src="Lego Robots Tips and Tricks_soubory/robotsoff.gif" width=78align=ABSCENTER border=0></A></P><P><A href="http://www.cs.uu.nl/people/markov/lego/tips/index.html"><IMGheight=58 alt=[Tips] src="Lego Robots Tips and Tricks_soubory/tipson.gif"width=78 align=ABSCENTER border=0></A></P><P><A href="http://www.cs.uu.nl/people/markov/lego/links/index.html"><IMGheight=58 alt=[Links]src="Lego Robots Tips and Tricks_soubory/linksoff.gif" width=78align=ABSCENTER border=0></A></P></TD><TD><FONT size=+4>Lego Robots Tips and Tricks</FONT><P><IMG src="Lego Robots Tips and Tricks_soubory/divide.gif"></P><P><H2>Sensors</H2><H3>Putting light and touch sensors on one input</H3>It is easy to puttouch and light sensors on one sensor input. In this case better set thesensor mode to raw. In nqc this can be done as follows: <PRE> SetSensor(SENSOR_2,_SENSOR_CFG(SENSOR_TYPE_LIGHT, SENSOR_MODE_RAW));</PRE>Now a value below 100 is a touch sensor event. Values above thiscorrespond to light levels (the higher the darker).<H3>Using the IR port for proximity detection</H3>It turns out that thelight sensor is very sensitive to the infra-red light produced by the theIR port on the robot. To uses this, mount the light sensor above the IRport, pointing forward. Now regularly send messages. When there is a wallclose in front of the robot, you can notice this by high intensity changesin the reading of the light sensor (preferably in raw mode). The closeryou get, the higher the fluctuations become. After a bit of tuning you canrather accurately predict the distance. Here is a simple <Ahref="http://www.cs.uu.nl/people/markov/lego/tips/ping.nqc">nqcprogram</A> to demonstrate how this works. Thanks to Dave Chen and SimenSvale Skogsrud for finding out about this.<H2>Design</H2><H3>Front and back</H3>All designs that come with Lego MindStorms use theIR-port side of the RCX as the front. This is not a good idea because younormally add a lot of stuff at the front, making the IR-port almostinvisible. Also, for balance reasons, it is good to put the motors underthe middle of the RCX. Finally, if you use a swivelling wheel, put it atthe back, not at the front. Pulling a swivelling wheel gives a muchstraighter motion than pushing it.<H3>Drive-Steer mechanism</H3><P><TABLE><TBODY><TR vAlign=top><TD><IMG src="Lego Robots Tips and Tricks_soubory/step3.jpg"> </TD><TD>This mechanism is based on the adder-subtractors of <Ahref="http://carol.wins.uva.nl/~leo/lego/diff.html">Leo </A>and <Ahref="http://www.phred.org/~alex/lego/">Alex </A>. It must be drivenby two motors; one connected to one of the four gears on one side,and the other connected to one of the three gears on the other side.One motor makes the wheels move in the same direction. The othersterrs by making the wheels move in opposite direction. My design isacccording to me stronger than the other ones. More pictures can befound <Ahref="http://www.cs.uu.nl/people/markov/lego/tips/Differential1/index.html">here</A>.</TD></TR></TBODY></TABLE><H3>Double motor power</H3><P><TABLE><TBODY><TR vAlign=top><TD><IMG src="Lego Robots Tips and Tricks_soubory/twomotors.jpg"></TD><TD>If you need extra motor power, and you have enough motors,connect two together. You can out them both on the same output todrive them simultaneously. This is especially good for heavy robotsor if you want your robots to go fast. I assume you can do the samewith three or more motors, but I am not sure how many you canconnect to one output. </TD></TR></TBODY></TABLE><H3>Bumpers</H3><P><TABLE><TBODY><TR vAlign=top><TD><IMG src="Lego Robots Tips and Tricks_soubory/bumper1.jpg"> </TD><TD>Here is bumper I designed that uses only one touch sensor.Instructions for building it can be found <Ahref="http://www.cs.uu.nl/people/markov/lego/tips/bumper1/index.html">here</A>.</TD></TR></TBODY></TABLE><H2>Internals</H2><H3>Free memory</H3>After loading the firmware, it seems that there isabout 6K of memory available for programs. You can use the <B>RCX CommandCenter</B> to free this memory when required.<H2>Programming with SPIRIT.OCX</H2><H3>Using the joystick</H3>Here is an <Ahref="http://www.cs.uu.nl/people/markov/lego/tips/RCXJoystick.zip">exampleprogram</A> (in Delphi 3) of how you can use the joystick to steer theRCX. It comes with full source and is freeware. It is a simplifiedstand-alone version of the joystick window in my RCX Command Centerversion 2.0.<H3>Registering SPIRIT.OCX</H3>If you don't want to install the legosoftware on your system but still use programs like the <B>RCX CommandCenter</B> you must register the OCX. Copy the spirit.ocx file from thelego Cdrom to you harddisk and use the Run command in the windows Startmenu to execute <PRE> REGSVR32.EXE spirit.ocx</PRE>This will register the ocx on your machine. (You might need tospecify the path of the ocx in the above command.)<H3>Bugs</H3>There is a bug in the OCX: When polling the mode of a sensor(e.g. Poll(11,0)) you don't get the right mode but 32* the mode.<P>There is another bug in the polling command. Polling the watch givesyou the total time in minutes, and not divided in hours and minutes as thedoc suggests. </P></TD></TR></TBODY></TABLE></BODY></HTML>