I'd Rather Be Building Robots

August 1, 2009

Released: ROBOTC Driver Suite RC6

Filed under: RobotC Drivers, Sensors — Xander @ 23:34

Another release with some changes and additions:
HTAC-driver.h:

  • Fixed bad registers
  • Added HTACreadAllAxes(tSensors link, int &x, int &y, int &z)
  • Removed HTACreadAllAxes(tSensors link, tIntArray &data)
  • Changed HTACreadX, Y, Z to use by reference instead of as return value

HTIRS-driver.h:

  • Fixed wrong registers

HTEOPD-driver.h:

  • Added HTEOPDsetShortRangeNW and HTEOPDsetLongRangeNW, these don’t wait 10ms
  • Changed the underlying sensor types for ROBOTC 1.57A and higher.

New Drivers:

  • Added support for MSDIST-nx Sharp IR sensor
  • Added support for MSAC Acceleration sensor
  • Added support for MSHID Human Interface Device sensor

This is a quick interim release to address a couple of issues and to syncronise with the version that will be hosted on the HiTechnic website. Stay tuned for many changes in the next month or so. New drivers will include:

  • The new HiTechnic colour sensor
  • Mindsensors RCX sensor MUX
  • Mindsensors PFMate
  • Mindsensors Servo controller
  • and maybe even a few you’ve never even heard of…

I’ve also been working on making most functions pass by reference, rather than making use of structs of arrays. All of these things will be in the next release.

The drivers’ website is here: [LINK].
The documentation can be found here: [LINK].
You can download the software from the Source Forge page here: [LINK].

July 31, 2009

Exclusive: New HiTechnic Colour Sensor Bares All!

Filed under: Ramblings, Sensors — Xander @ 20:22

HiTechnic Colour SensorA new version of the colour sensor has been brought out by HiTechnic.  It features a number of new abilities:

  • Increased sensitivity; the sensor can determine a large object’s colour from up to 20 cm away.
  • No longer needs an RGB LED but uses a bright white LED instead.  The RGB values are determined by the very sensitive colour sensor.
  • The LED can be switched off to determine the RGB values of ambient light or a light source directed at the sensor.  Now you can really tell the difference between a fluorescent light and an incandescent light bulb.

Rather than sending me a fully assembled sensor, HiTechnic sent it to me in discrete parts, namely the PCB (Printed Circuit Board) with all the components, the grey body, the white cover and the black cap with holes.  This would allow me to take some pictures of its innards to share with you before closing it all up.

So without further ado, I present to you the new colour sensor in all its naked, exposed glory:

New HiTechnic Colour Sensor [Click to enlarge]  New HiTechnic Colour Sensor [Click to enlarge]

Extreme close up of colour sensor. [Click to enlarge]I didn’t take pictures of the underside of the PCB since there really wasn’t much there. The domed component on top of the colour sensor is a very bright LED. The colour sensor is the cylindrical shaped clear doodad at the bottom with the flat front.  When viewed from the front you can see there is a rather large square sensing area.  I took a macro picture of the colour sensor itself, which you can see here on the left.  If you look very closely, you’ll notice that the light is reflected at a 90 degree angle onto the sensor which is actually mounted on the PCB.  This is done by the black block which you can see in the above right, notice how it has that surface at a 45 degree angle?  I realised this when I saw the small vias (connections between the different PCB layers) next to the sensor area which could only be on the PCB itself.

A ROBOTC driver for this sensor and some of its new functionality will be available very shortly as part of the ROBOTC Driver Suite.  Until then you can safely use the sensor with the drivers for the older model, you just won’t have access to some of its advanced features.

July 25, 2009

All aboard the Arduino Bandwagon!

Filed under: Arduino, Experiments, Ramblings — Xander @ 07:17

Having read the countless articles, websites and hearing about it from friends, I’ve decided to jump on the Arduino bandwagon.  I bought one of the new ArduinoMega boards with a very nice shield and some other things.

 ArduinoMega Shield

The ArduinoMega is an Arduino compatible board with an ATmega1280 controller that has 128KB flash, 8KB SRAM and 4KB EEPROM.  It has 54 digital IO pins (of which 14 can provide PWM output), 16 10bit analogue inputs, I2C and a bunch of other ones.

The idea is to use the ArduinoMega as a (very) smart sensor/I2C slave for the NXT.  I am not sure what I’ll do with it, yet.  I have a Wiznet WIZ810MJ Ethernet module in a drawer somewhere, perhaps I can use that.  So far I have managed to upload a “blink” program and it works.  The only bad thing about the Arduino programming environment is that it is very, very slow on my Windows 7 64bit laptop.  I have it running on a Vista 64bit VM without any issues, though.  Perhaps they have fixed this in the upcoming 0017 release.  For now I will just use the VM-based solution.

I ordered the stuff from an online shop in Germany called Watterrot.  I was really impressed with how quickly my order was processed and shipped.  I ordered it on Wednesday lunch time, it shipped out on Thursday afternoon and by Friday afternoon I had all my items.  Their packages are traceable, so you can hit F5 (refresh) in your browser until the lettering wears off.  They also stock a very wide variety of SparkFun items (117 of them @ 25/07/09), which is great.  To top it all off, they have very good prices and only charge €10 euro for shipping and handling for orders within the EU!  That’s less than a 1/3 than what some of the shops in the Netherlands charge for a similar order.  I will definitely order from them the next time.

July 21, 2009

TwitterTattle: Big Brother Is Watching You

Filed under: Experiments, Sensors — Xander @ 22:49

Bailey, me and Pixel.  [click to enlarge] I love our dogs more than anything.  Even more than my NXTs.  I can hear you all gasp and mutter “blasphemer!”.  Now before you throw me on the fire, you must understand that I was a dog person before I was a robot person.

Anyway, as I was saying, as much as I love my dogs, they have a tendency to bark.  When we’re home, we can (and do) tell them to shut up, sometimes combined with the (in)appropriate expletives, depending on volume and time duration of said barking spree. However, when we’re not there, we obviously can’t keep an eye and ear on them.  Luck would have it that Mindsensors have a new sensor, the NXTHID.  It’s a sensor that can act as a Human Interface Device (HID), like a keyboard.  Using I2C commands, you can, for example, send data to a program on your computer via a USB cable as if *you* were typing it.  You can also make it start a program using the “run command” by sending the “Windows Key” modifier and the letter “r” and entering the command line in the text box followed by an newline and return carriage. 

TwitterTattle [click to enlarge] That gave me an idea. How cool would it be to know how much the dogs had barked and for how long?  Everyone (and their dog) is using Twitter nowadays, so why not my NXT as well?  I did some Google’ing for a command line Twitter client for Windows and bumped into a very handy little script that uses wget to send a message.  It’s really very simple.  Put the batch file and wget program in a directory in your PATH (like C:\Windows or another directory you added to the PATH variable yourself).  Make sure you edit the twitter.bat file to set the username and password of your Twitter account. 

I created a small program that uses a test release of the NXTHID driver I made.  It will be part of the next release of the ROBOTC Driver Suite.  You can download the zip file with the program and all the necessary drivers here: [LINK].  The program is quite simple.  First we check if the dog is barking, this is done by checking if the sound sensor is registering a loud noise.  Usually our house is pretty quiet, so if the sensor reads “100”, we can be pretty sure that it’s a bark.  If we’re not already running a total bark time timer, we reset it now and start counting.  Another timer to check how long it’s been since the last bark is also reset.  If there hasn’t been any barking for 30 seconds and our total barking time has been less than 90 seconds (that’s 60 seconds of barking time + the 30 seconds since the last bark), we’ll ignore it.  However, if the total barking time is more than 90 seconds, we’ll start up the twitter script to alert us.  After the tweet is sent, the whole process starts anew.

It is important to set your NXT to not switch itself off after 10 minutes or you’ll never know how bad your dog has been.  You can view my NXT’s Twitter page here: [LINK].

July 8, 2009

Moar Powah!

Filed under: Ramblings, Robots — Xander @ 07:17

Did you just buy a Wii-mote for a robotics project and you can’t wait to use it?  If you have a 15-tonne hydraulic grappling arm at your disposal, you could do what these guys did.

I am sure this beats the crap out of whatever you had in mind of controlling with that Wii-mote.  Feeling inadequate yet? [Source: Entity Crisis via Gizmodo]

July 2, 2009

Release your inner evil scientist

Filed under: Experiments, Sensors — Xander @ 08:49

This could be *you*Are you a budding evil scientist but lack the electronics skills to build your own sharks with laser beams?  Well, you no longer need to outsource your plans for world domination to second rate henchmen.  Now you can learn the skills needed to do this kind of thing yourself. HiTechnic have brought out the Experimenter’s Kit A, which consists of the solderless version of the Protoboard, a solderless breadboard, a whole bunch of electronic components, jumper wires and, of course, a handbook with quite a number of experiments.  Sample programs in NXT-G, LabView, NXC and RobotC (written by yours truly) are available for each experiment.  They’re easy to modify and expand on so the only limit is your imagination.

The experimenter's kit A

The kit allows you learn how to interface your NXT with more than just the pre-made sensors that are available on the market.  It includes push buttons, a temperature sensor, a magnetic sensor (plus magnet) and much more.  You can even build your own ambient cancelling light sensor!  That’ll give you a good idea of how the EOPD sensor works.  The handbook has plenty of drawings, photos and diagram, so you won’t be left in any doubt as to which components to place where.

When you’re done with the experiments in this kit, you’ll be well acquainted with interfacing non-Lego electronics with your brick and programming it to access their data.  How to make your own NXT controlled Death Star will be covered in the second edition of the handbook.

June 30, 2009

HiTechnic Sensor Hack

Filed under: Experiments, Sensors — Xander @ 08:57

Click for bigger version In two previous articles (here and here) I had tried to come up with a way to use IR light to gauge distances.  It wasn’t very successful, but such is the risk of trying something new.  So last night, whilst sitting at my laptop, I wondered if there was a way to emulate a $10 device (a Sharp IR Sensor) with more than $100’s worth of NXT sensors.  It seems there is.  I repurposed a HiTechnic IR Link and IR Seeker (v2) and turned them into a very limited IR distance sensor.

Click for larger version So how does it work? Well, remember I mentioned a few articles back how you could turn an IR Link into a beacon by pulsing it at 1200Hz? Well, instead of using the IR Seeker’s direction register to determine where the beacon is, you could, instead, just query the forward pointing sensor (sensor number 2) for signal strength.  Now if you put the IR Link next to the IR Seeker and point them at an object some of the beacon signal from the IR Link is bound to bounce back and be detected by the IR Seeker.  Using the contraption on the left, I set out to take readings at various distances.  The results surprised me a little.

Click for larger version

The first 3 points I expected to look that way, the surface was simply too close.  However, the linearity of the next couple of points really boggled me.  Did this actually work?  They are most likely highly inaccurate as the values bounced around a fair bit, even though the program was taking 10 readings and averaging them out before displaying them.  So there you go, a highly inaccurate, completely impractical IR distance sensor!  I think the EOPD is probably more suitable for this kind of thing but what would the fun be in that?

You can download the program here: [LINK].  Please note that you will need to use my driver suite, too.  You can pick that up here: [LINK].

June 23, 2009

Subsumption, all the cool kids are doing it

Filed under: Ramblings, Robots, Tutorials — Xander @ 21:05

Taken from http://roachnet.wordpress.com/ “Subsumption?” I hear you say, “What’s that?”  Subsumption is a form of behaviour based robotics where multiple behaviours can control a robot using a hierarchical system.  However, don’t take my word for it!  Check out Thom Roach’s great new blog.  He’s written some really ace articles on the subject without reverting to dry stuffy theory like you see in most research papers.  Using clear text and simple diagrams he shows us how you could make a simple robot that uses subsumption to get around.  Be sure to read them in reverse chronological order!

Released: RobotC Driver Suite RC5

Filed under: RobotC Drivers, Sensors — Xander @ 20:31

Some minor changes in this version and some bug fixes.

Changelog:

HTDIR-test1.c (0.2)

  • Partial rewrite by Dick Swan, waits a little longer for sensor initialisation
  • Nicer intro screen
  • Less screen flickering, only updated if there’s been a change in data.

common.h: (0.3.2)

  • makes use of the new alpha’s built-in clearI2CBus(). It is still defined for the older firmwares

MSLL-driver.h: (0.5)

  • Bug in LLreadSteering() fixed

HTPB-driver.h: (0.7)

  • Fixed a couple of function calls that had not been renamed.

TODO:

  • Add UART (RCX) functionality to HiTechnic IR Link driver.

The drivers’ website is here: [LINK]. The documentation can be found here: [LINK]. You can download the software from the Source Forge page here: [LINK].

June 19, 2009

SHOCKING: IR Seeker V2 exposed!!!

Filed under: Ramblings, Sensors — Xander @ 20:14

NXT IRSeeker V2Ever wondered what an IR Seeker V2 looks like on the inside but didn’t have a spare $50 you could just throw away?  Well wonder no more!  I was given a pre-production IR Seeker by HiTechnic to write a RobotC driver for it.  The lens cap on it wasn’t as clear as the production version so they sent me a replacement lens cap and sensor cover.  That meant I had to do some minor brain surgery on the sensor casing.  Armed with a sharp blade I went to work. 

Click me for a bigger versionAfter removing the white plastic cover, the lens cap came off smoothly after a bit of prodding and poking.  As you can see on the picture to the right, there are 5 IR sensors, each pointing in a different direction.  The rounded lens cover ensures that they can all receive an undistorted IR signal.  You can click on the picture for a bigger version which shows a bit more detail.

Click me for a bigger version I wasn’t satisfied with just slipping the new lens cover on and closing it all up.  No, I wanted to see it all.  Slowly I pulled the small printed circuit board (PCB) out of its cover. I was not disappointed when I turned it over.  The big chip roughly in the middle is the brains of the whole thing.  It’s a very powerful processor that does all the Digital Signal Processing (DSP) of the 5 sensor inputs.  It can detect both DC and modulated IR signals at 600 and 1200Hz.  The small silver rectangle next to the main processor seems to be an oscillator or crystal running at 10MHz.  I have no idea what the smaller IC does. You can click on the picture of the PCB to see a larger version.

So there you have it; the inside scoop.  The guts of the IR Seeker spilled all over your monitor in all of their glory.  Maybe not as shocking as the title led you to believe, but pretty cool none the less.

« Previous PageNext Page »

Blog at WordPress.com.