3pi NO-MOD Laser Pointer Follower

The place to discuss the Pololu 3pi, m3pi, and Zumo robots and share your code.

3pi NO-MOD Laser Pointer Follower

Postby jomara » Sat Dec 26, 2009 10:05 pm

Hey,

Not sure if this has been done before, but used the reflectance sensors as light (laser) sensors.

Slightly dark room works best but all things are tweakable.

Video:
http://www.youtube.com/watch?v=SZ5xTccYRCg

Crappy code attached.

Thanks!
Jason
Attachments
build_1.zip
Crappy Source, HEX. Compiled under CYGWIN.
(80.24 KiB) Downloaded 339 times
jomara
 
Posts: 4
Joined: Tue Dec 22, 2009 7:04 am

Re: 3pi NO-MOD Laser Pointer Follower

Postby paul » Sat Dec 26, 2009 11:43 pm

Cool! Thanks for posting. That is something I have not seen before, so of course I have some questions: I see that you are using the IR_EMITTERS_OFF option to the read_line_sensors function...so what kind of range of values do you see with the green laser pointer? Did you check whether the sensors were more sensitive to a red one? Does the same robot, when there is no laser to follow, seek out the bright spots in a room?

-Paul
User avatar
paul
Pololu Employee
 
Posts: 1490
Joined: Sat Nov 29, 2003 11:06 pm
Location: Las Vegas, NV

Re: 3pi NO-MOD Laser Pointer Follower

Postby jomara » Sun Dec 27, 2009 4:16 pm

Paul,

Thanks for the feedback! I haven't tested this idea using a red laser but I assume it would work fine. This is truly a physics question and I'm unsure if a different wavelength of light would produce better results. My green laser pointer has a wavelength of around 400nm and a red would be around 800nm, closer to the Infrared spectrum (so better?).

The time constant can be thought of as shutter speed. Longer time is equal to longer exposure so you could 'in theory' see the laser light farther away, but the problem arises when you have over-exposure and all details are lost. Because of this, the robot will go to a brighter spot on the floor if it is a point spot, ambient should be okay.

My code had no documentation, but the routines are quite simple:
get_fulcrum() --> Is a center of gravity calculation. Think of the five sensors equally spaced on a beam with a pivot. Each sensor get heavier as more light is detected thus get_fulcrum() simply determines where the pivot or fulcrum is located.
Things get messy but in the main loop I have a PI controller (based upon error from the center sensor).

Anyway, I would look forward to any updates, clean-up, tweaks to this code. The big issue with this first implementation is that the robot continually moves forward. It would be cool to make this more smart. Ideas?

Again, thanks to you Paul.
Jason
jomara
 
Posts: 4
Joined: Tue Dec 22, 2009 7:04 am

Re: 3pi NO-MOD Laser Pointer Follower

Postby paul » Mon Dec 28, 2009 10:23 am

I don't know about whether it is "truly a physics question" - it is more just a practical question of which kind of laser pointer has the best combination of brightness and ability to trigger the sensor. I am betting on red. I am actually surprised that the green one works at all.

It sounds difficult to teach the robot whether it should go forward or backward. Perhaps you could mount an additional QTR-1RC sensor on the back of the 3pi so that it could know when the light source in in the back? Otherwise, maybe you could keep track of whether the light seems to be getting dimmer as the robot drives forward, and if so, have it try turning around? That might get tricky if the laser spot is constantly moving around!

-Paul
User avatar
paul
Pololu Employee
 
Posts: 1490
Joined: Sat Nov 29, 2003 11:06 pm
Location: Las Vegas, NV

Re: 3pi NO-MOD Laser Pointer Follower

Postby BorisPI » Tue Jul 26, 2011 10:50 am

It doesn't have to be a laser at all, I tried using a LED flashlight and it worked fine!
BorisPI
 
Posts: 16
Joined: Sat Jul 23, 2011 11:01 am

Re: 3pi NO-MOD Laser Pointer Follower

Postby Cumma » Mon May 20, 2013 11:02 am

BorisPI wrote:It doesn't have to be a laser at all, I tried using a LED flashlight and it worked fine!

I also using a led flashlight and it is quite good to use.
Cumma
 
Posts: 1
Joined: Mon May 20, 2013 11:01 am


Return to 3pi, m3pi, and Zumo Robots

Who is online

Users browsing this forum: No registered users and 4 guests