Shop OBEX P1 Docs P2 Docs Learn Events
Help with Optical Encoding on robot drive system — Parallax Forums

Help with Optical Encoding on robot drive system

ArchiverArchiver Posts: 46,084
edited 2003-06-22 00:54 in General Discussion
I need some advice. I've been reading the "encoder" about "Dead Reckoning"
using Optical Encoding. The website
http://www.seattlerobotics.org/encoder/200010/dead_reckoning_article.html
is great to read in terms of the hardware, but the software part of the webpage
deals only with C programming. Since I don't speak C, I'm hoping to get help
from this wonderful group. I can get the Optical Encoding hardware in place,
and I'm dreaming of the software code I should add to detect the wheel
rotations. Below is the current code I use to drive my robot forward. Can
someone offer the code I'd need to read to Optical Encoders? The code loops
through the IR detection, and if they register a value less then 1000, I go
straight. I'm concerned that the extensive loops included in my code would
cause the BS2 to miss some encoder pulses. That's my question. A second
question is: should I purchase a pulse counter like a PAK VII to do this tedious
work?

again: ' Main loop.
GOSUB ping_IR_sensors
GOSUB ping_uvtron
GOSUB evade
GOTO again

evade: ' EVADE
IF AD0 < 1000 AND AD1 < 1000 THEN go_straight ' forward march
IF AD0 > 1000 THEN turn_right
IF AD1 > 1000 THEN turn_left
evade_complete:
RETURN

go_straight: 'GO STRAIGHT
PULSOUT 13, 500 'Rt servo on P13
PULSOUT 12, 1000 'Left servo on P12
PAUSE 2
GOTO evade_complete

I've got lots more code not included here, and I hope this is enough to give you
the flavor of my logic. Anyway, I check sensors, evaluate the sensors, and go
forward if the values allow it. I'm guessing that if I add the Optical encoders
to a ADC, then I'll have to add a sweep through a new subrouting, Again, my
questions are will I miss some Encoder data with all the other routines i'm
doing? Also, should I get a PAK VII from Al Williams to do this job? See
http://www.al-williams.com/pak7.htm

I look forward to hearing your comments. Please copy me directly as I get the
digest and sometimes don't read all the posts for a week or so.
Thanks in advance
Dave Cousins



Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!

[noparse][[/noparse]Non-text portions of this message have been removed]
Sign In or Register to comment.