Controlling Lego NXT Robots with Matlab

For research in Knuthlab, I am interested in controlling the Lego NXT Bricks with Mathworks MATLAB.  MATLAB is a high-level mathematical language structured much like C.  The main benefit is that many sophisticated mathematical algorithms are available for immediate use in MATLAB, and that these algorithms are fast and easily developed.  Furthermore, much signal processing research is performed in MATLAB; including most of my own algorithms.

NXT Brick

The most promising solution is to have MATLAB send commands to the NXT Brick and to receive sensor readings from the NXT Brick.  In both cases Bluetooth is the obvious means of communication.

At this stage, we have found three possible solutions:

  1. Incorporate Java Classes into MATLAB and then employ either iCommand or LeJOS NXT which both use the Java Programming Language to control the NXT Brick.
  2. Adopt the solution engineered by Gregory Gutt for the George Mason Neural Dynamics Laboratory, which employs RealTerm as a server to pass commands to the NXT via Bluetooth in the form of a Byte Stream.  This is a very attractive solution, but would require the writing of more detailed NXT commands in MATLAB…an endeavor possibly worth the effort.  Crucial to this effort are the steps of using RealTerm from MATLAB and understanding the Byte Streams used by NXT.
  3. The last possibility would be interfacing MATLAB to one of the various C or C-like interfaces to NXT.  This would require the writing of MEX files, which I am not very excited about doing.

We will have to make some decisions in the near future, but the prospect of interfacing MATLAB directly to the Brick via Byte Streams sent by RealTerm seems to me to be the most robust and flexible solution.  I will keep you posted.

Kevin Knuth
Albany NY

Posted under Computation, Lego, NXT, Research, Robotics, Software, Solutions

This post was written by drknuth on March 30, 2007

Tags: , , , , , , ,

Burning Pieces of Space Junk Just Miss Airliner

And now for the unforeseen…

A Russian satellite deorbited last night and narrowly missed a LanChile Airbus A340 travelling between Santiago, Chile and Aukland, New Zealand.  The pilot radioed air traffic control at Auckland Oceanic Centre and reported flaming space junk re-entering both in front and behind his plane at a distance of five nautical miles.  The pilot reported that the supersonic roar of the space junk could be heard over the engines of the jet aircraft. 

The Russian authorities had notified Airways New Zealand that the satellite would be re-entering between 10:30 AM and 12:00 NZ time.  However, the satellite deorbited early.

More info here at thewest.com.au, and at SPACE.com

Jettisoned Rocket Stage

Space junk is a continually growing problem.  Since the launch of the first satellite Sputnik on October 4th, 1957 more than 4200 launches have carried 5500 objects into orbit.  It consists of a wide variety of objects that range from parts to entire abandoned satellites.  At the smallest scales space junk includes paint chips and nuts and bolts, and at the largest scales space junk includes jettisoned rocket stages (like the one in the figure above), solar panels, and satellites (like the one that almost hit this jet airliner).  The smaller pieces burn up in the atmosphere on re-entry.  But the largest ones can make it to the surface, and do so with speeds on the order of 22,000 mi/hr.

Impact with fast moving objects can be deadly.  BBC Science and Nature reports that a 1mm metal chip can do as much damage as a .22 caliber long rifle bullet.  A tennis-ball sized piece of metal carries in kinetic energy the equivalent of 25 sticks of dynamite.  This is because the kinetic energy increases with the velocity squared while it is only linearly proportional to the mass:

KE = \frac{1}{2} mv^2

That means that if you double the mass m, you only double the Kinetic Energy; whereas if you double the velocity v you quadruple the amount of Kinetic Energy.  Squaring 22,000 mi/hr gives you a very big number!  This is the same reason why a car accident at 70 mi/hr is so much worse than a car accident at 55 mi/hr.  Note that 55^2 = 3025 whereas 70^2 = 4900, which for the same mass means that increasing from 55 mi/hr to 70 mi/hr increases the energy by a whopping 62%.

Concerns have been growing about space junk, and just last month, the New York Times had an article on the topic.  Apparently, the Space Shuttle had been returning with hundreds of dings from collisions with space junk [RedOrbit 2003].  USSPACECOM has been tracking about 9000 objects larger than baseballs, but is unable to track anything smaller.  Meanwhile the European Space Operations Center has its own tracking capabilities.

A glove escapes from the hatch during an Apollo mission

Although space is a great place to store garbage—as long as it is in a well-defined and stable orbit.  And wouldn’t that be a future archeologist’s dream!  Imagine finding this glove (in the figure above) during an archeological expedition in 2783.

Kevin Knuth
Albany NY

Posted under Exploration, Physics, Space

This post was written by drknuth on March 28, 2007

Texture and Wallpaper Gallery

I often like to take photgraphs of various textures and wallpaper. This includes brick walls, tree bark, earth, water, and so on.  Recently, I went through and collected together some of these images that I have captured, and I organized them into a photo gallery:

http://www.huginn.com/gallery/

I have been using the Simple Picture Gallery Manager 

http://spgm.sourceforge.net/ 

and found it to work very easily.  I also installed Gallery Mage

http://tanksoftware.com/gallmage/ 

which makes it very easy to arrange and caption your photos. 
I was able to set it up in an hour or so.

The water surfaces are my favorites.  Below is a photograph of the Pacific Ocean waves just off the shore of the Galapagos.  Meanwhile, I have been trying to sell some of my photos online at bigstockphoto.com.
To my surprise, I now have sold quite a few.

 Ocean Waves

Kevin Knuth
Albany NY

Posted under Photography, Solutions, Travel, Wildlife

This post was written by drknuth on March 26, 2007

Biomimetic Underwater Robots

Today we had a visit from Dr. Joseph Ayers of Northeastern University and the Marine Science Center.  He spoke to us about his research in biomimetic underwater robots.  Dr. Ayers is a marine biologist, a neuroscientist, and at this point an engineer, a roboticist, and a nonlinear dynamicist.  He has been working on two types of robots: a lobster and a sea lamprey.  The picture below is from their website and depicts their lobster robot that is now on display at the Smithsonian Cooper-Hewitt National Design Museum in New York City.

Biomimetic Underwater Robot Lobsters

The lobster robot grew out of his research in trying to understand the neural circuitry of the lobster.  Invertibrates, such as lobsters, are interesting to neurscientists because each individual of a given species has the same exact neurons.  This means that one can actually identify and characterize individual neurons and the role that they play in the nervous systems of creatures like lobsters.  By studying these circuits, Dr. Ayers has made significant progress in teasing apart the basic neural mechanisms behind animal locomotion. 

They model the system with a Command System, a Coordinating System, a Central Pattern Generator, Proprioreceptive and Exteroreceptive Sensors, and Sensory Feedback (CCCPG for short).  The Command System dictates the behavior generated by the Central Pattern Generator (CPG), such as: go forward, back up, defend, and flee.  The Coordinating System determines the phase relationships between the muscles and limbs, which in turn controls the gait.  Both of these systems modulate the Central Pattern Generator, which directly controls the muscles via the motor neurons.  The Sensors and Sensory Feedback Systems are part of the peripheral system and serve to use incoming sensory information to modulate the behavior of the CPG.  Sensory systems.  By successfully reverse engineering the locomotive aspects of a lobster, one can demonstrate that one truly understands the system.

The sensors that the robot uses are all biomimetic.  For example, antennae are used to sense water currents as well as detect potential collisions.  Look closely at the picture and you will see that the antennae that they used were Strain Gauge Antenna, which one can buy for about $3.00.

The design of the muscles is fascinating… 
Electric motors are too big and clunky, so the only remaining option is to use a material that can stretch and contract by themselves, and for that you need some sort of shape memory.   They use Nitinol, which stands for NIckel TItanium Naval Ordnance Laboratory.  Nitinol has two crystalinze states: martensite and austenite, and thermal changes can induce a phase transition between the two mineral states.  Below a critical temperature, the Nitinol is martensite, which is a soft material, but when heated, a phase transition occurs and Nitinol transforms into the Austenite state, which is a high strength material.  The Austenite state can be transformed to martensite by simply cooling the material.  In the robot, they induce the phase change through heating by passing a 1 Amp current through the Nitinol wire.  The ocean water then serves to cool the Austenite.  The entire process serves to stretch and contract the wire muscle.

Dr. Ayers spent a sabbatical at the Institute for Nonlinear Science at the University of California at San Diego, where he learned the necessary nonlinear dynamics to  introduce chaos into the neural circuitry.  He hypothesized that the animal uses chaotic behavior to get its muscles to wiggle it out of tight spots.  This strategy indeed works, and is quite impressive.

In addition to having their early robots on display at the Smithsonian, Dr. Ayers is getting a impressive amount of publicity.  He has been featured in Science, Wired News, and will be in next months Men’s Vogue.  That is an accomplishment that most scientists will never achieve!

I learned some other interesting facts from Dr. Ayers.  One was that the center of buoyancy on a fish is below its center of mass.  This is why dead fish go belly up!  I can’t help but wonder why this should be the case?  Fighter jets are actually designed to be right at the edge of instability.  A stable aircraft is not very manueverable.  Is it possible that this unstable configuration in the living fish keeps the fish near the edge of stability so that is somehow is also at the edge of stability and thus maximally manueverable?  I really don’t know.

He also explained that terrestrial animals expend 95% of their locomotive energy to support themselves against gravity, and 5% of their locomotive energy towards translational motion.  On the other hand, aquatic animals expend 95% of their locomotive energy toward translational motion, and 5% fighting hydrodynamic resistance.

Kevin Knuth
Albany NY

Posted under Fun, Research, Robotics

This post was written by drknuth on March 24, 2007

Virgin Galactic teams with NASA

Virgin Galactic is teaming with NASA Ames Research Center to develop hypersonic aircraft for space tourism.  To be hypersonic, an aircraft needs to sustain speeds faster tha 5 times the speed of sound.  This is around 3000 miles per hour!

Virgin Galatic is well-poised for such a feat as they have exclusive rights to develop the designs of Burt Rutan of Scaled Composites who in 2004 won the Ansari X-Prize by launching SpaceShipOne to an altitude of 100 km twice in a two week time span.  I was fortunate to see the test flight of SpaceShipOne earlier that summer.

NASA Prototype Hypersonic Craft

More info at NASA Ames, and National Geographic.

Kevin Knuth
Albany NY

Posted under Exploration, Inventions

This post was written by drknuth on March 22, 2007

Tags: , , , , , ,