Society of Robots - Robot Forum

Software => Software => Topic started by: superchiku on March 11, 2008, 01:23:26 PM

Title: algorithm for line tracer
Post by: superchiku on March 11, 2008, 01:23:26 PM
i need some efficient algorithm for a line tracer tracing white lines using 3 sensors

as iam using the normal if value<threshold do this else do that kinda algorithm , it is not that efficient coz as the battery dries up the sensors get less voltage and sometimes my adc can give reading below threshold even if it is moving on a white line coz the reference voltage is decreasing so i need some kind of effiient algorithms to implement my line tracing function by handling such situations

plzz specify the algorithm/....
Title: Re: algorithm for line tracer
Post by: HDL_CinC_Dragon on March 11, 2008, 09:17:35 PM
thats really the most efficient way to do it if im not mistaken. What you need to do is get yourself a battery pack with a lot of Ah(Amp Hours).
I read in another one of your posts that your only using a few NiCd cells, am I right?

Not sure how much you know about batteries so Ill start with the basics:
One AA battery has 1.5v and x amount of mAh(milliamp hours).
If you put 2 AA batteries in series with each other, you get 3v and x mAh
If you put 2 AA batteries in parallel with each other, you get 1.5v and 2x mAh
see what I mean?
for a better example, I have a 12 volt battery that supplies 18Ah or 18 amps for an hour(18000mAh). That means, If im running a 12 volt circuit and that circuit is using a constant 18 amps, the battery will only hold up for one hour until it needs to be recharged. So if I had a second battery just like it and I put the 2 in series, I would get 24 volts and 18Ah. If I put the two in parallel, I would get 12 volts and 36Ah which means that now if I was running this 12v, 36Ah battery setup, I could run that 12v, 18A circuit for 2 hours instead of one because I doubled up on my Amp Hourage.

Hopefully you didnt already know that so I didnt just waste all this typing and I was actually helpful for once.

basically the more batteries you put in series, the more voltage you get. The more batteries you put in parallel, the more Ah you get
Title: Re: algorithm for line tracer
Post by: superchiku on March 12, 2008, 03:40:03 AM
oops i already knew abt that although i already resolved that one by using battery eliminator but i have got a new problem to rectify :(

the problems just keep on coming plzz can u say what is happening
i hope my bot would start working it has god a strange probelm in pwm ,

when it is tested with only the mcu in the breadboard , i get exactly same values of pwm but when used in the bot one is lower than the other i dont know why this is happening can u help
Title: Re: algorithm for line tracer
Post by: HDL_CinC_Dragon on March 12, 2008, 02:22:08 PM
Whats changing? the frequency?
Title: Re: algorithm for line tracer
Post by: superchiku on March 12, 2008, 02:45:29 PM
no no frequency is changing i have adjusted the pwm prescaler for the motors , just the behaviour changes