AForge.NET

  :: AForge.NET Framework :: Articles :: Forums ::

New NXT Tracking Turret Project

The forum is to discuss topics related to robotics, like building robot, controlling it, its software and hardware, etc.

New NXT Tracking Turret Project

Postby rbritt » Sun Sep 13, 2009 5:40 pm

Hi,
I was recently shown the A-Forge framework by a friend who is also interested in Robotics and A.I. and I have to say I'm incredibly impressed with it. It's intelligently designed,implemented and is just a complete pleasure to use.

I recently bought a NXT Lego kit and have had the chance today to start implementing a webcam based turret that will track objects around the room. Pretty standard startup project, except mine will have the voice of a Portal turret ;) Using the AForge I've been able to make incredibly fast progress; no more reinventing the wheel, hurrah!

Here is a screen shot of my current progress:

Image

It currently just reduces the image size (to counter noise) filters to a specified colour, applies a threshold to the result and finds blobs. The largest blob is marked in yellow and will be the one the turret tracks.

I've written a class that wraps the motor control that will automatically limit the turrets movement so it doesn't spin further than 180 degress and wrap my webcam cable up. The bottom left graphic shows the limit with red lines. The yellow line is the turrets current direction. This is still work in progress.. I'm discovering the pros and cons of the Lego motors regarding accuracy. Looks like I'll be having to poll the tacho count much more than I'd like, oh well.

One more thing, avoid Microsoft Lifecam vx6000.. earlier today the video on mine just became noise. Seems to be a hardware issue, same deal on other PCs. Luckily I had two! Though that puts any stereo webcam work on hold for now...

Anyway just wanted to say thanks for AForge!
User avatar
rbritt
 
Posts: 3
Joined: Wed Sep 02, 2009 8:43 pm
Location: Manchester

Re: New NXT Tracking Turret Project

Postby andrew.kirillov » Mon Sep 14, 2009 9:05 am

Hello,

Wow, looks like an interesting project. Will be nice to see more updates about it in the future.
With best regards,
Andrew


Interested in supporting AForge.NET Framework?
User avatar
andrew.kirillov
Site Admin, AForge.NET Developer
 
Posts: 3439
Joined: Fri Jan 23, 2009 9:12 am
Location: UK

Re: New NXT Tracking Turret Project

Postby rbritt » Thu Oct 08, 2009 11:17 am

Just thought I'd post a little update regarding this.

I have done some further work on the software side but I'm currently mostly working on the "mechanical". My first design put too much load on the motor I was using to control the yaw of the turret, and the gears had too much movement in them. It resulted in very inaccurate movements from the motor. I'm currently rebuilding the setup to improve it generally. I think I'm close to a solution now which has minimal gears between the motor and the turrets main pivot. Fingers crossed this will improve motor accuracy.

I still have a few things to learn though in general about improving the accuracy of the motors. I'd hoped it'd be more of a "rotate exactly 90 degrees" fire and forget affair, except the motors seem to under and over shoot all the time. Perhaps I'm doing something wrong, I'm not sure. I am taking the approach now though of monitoring the motor status. I'd wanted to not do that as it involves waiting for the bluetooth chip to switch between send and receive, but it seems to be a necessary evil. I poll the position of the motor while it's moving and create a "predicted" position based on time and velocity. I then plan to pre-empt when I need to stop the motor to keep it within my set angle limits.

I could be making a mountain out of a molehill with all of this, but at least it's fun :)

I'll post some pictures of the build soon when I've finished, probably some time next week. Progress is slow as this is a lunchtime project at work when I'm not swamped by deadlines!
User avatar
rbritt
 
Posts: 3
Joined: Wed Sep 02, 2009 8:43 pm
Location: Manchester

Re: New NXT Tracking Turret Project

Postby andrew.kirillov » Tue Oct 13, 2009 8:40 am

rbritt wrote:Progress is slow as this is a lunchtime project at work when I'm not swamped by deadlines!

I can understand you. I have the same with the framework and my hobby robotics projects. Although I use a bit more than lunchtime, but I need steal the time from weekends, nights, family :(

Regarding gears. In some cases few more gears may actually help and do the movement much more precise. Also what you can try is specifying amount of movement instead of running motors until you stop them (see MotorState.TachoLimit)
With best regards,
Andrew


Interested in supporting AForge.NET Framework?
User avatar
andrew.kirillov
Site Admin, AForge.NET Developer
 
Posts: 3439
Joined: Fri Jan 23, 2009 9:12 am
Location: UK




Return to Robotics