Pololu Robotics & Electronics
My account Comments or questions? About Pololu Contact Ordering information Distributors

Pololu Forum

External factors in line follower


HI Ben,
The reading was 8.5V



Did you try powering your system with NiMH batteries?

- Ben


So I have tried to use the 4 NiMh batteries as the main power source,
and unfortunately the system didn’t work at all.
I measured the input and output voltage but I didn’t write down the values.
I did however fully charged the batteries.

The most logical explanation I could think of was that an electrical component is probably loading the power source resulting in incorrect input voltage.
And so I have separated my main power source to two parts:

The U3V12F9 is connected with a 33uF Cap between the Vin and Ground.
I am using a standard L293D to drive the motors:
-The 9V is used to power the motors
-The 5V is used to power the IC

I have a LED connected to my micro-controller, indicating whether the latter is functioning well.I have tried to test the new power system, but the result was the same.
The bot worked fine for about 30 seconds, but then it went crazy, the motors started running really fast uncontrollably and the LED went off.
The motors are driven according to your guide on PWM:
https://www.pololu.com/docs/0J21/5.c switching between ‘break’ and ‘forward’

I have to tried eliminate options for the malfunction by switching the power supplies
separately. The U3V12F9 seems to be working well, with 5V input and 9.08V output.
The LM7805 works fine as well, with 8.6V input and 4.96V output.
When I switch them both ON nothing seems to work, one of them loads the other, resulting in incorrect input voltage readings. It is very strange, the power supplies are connected only through the L293D.

Please advice, I do not know what to do anymore.



It is not easy for me to follow what components you have, how they are connected, and what you have tried so far. Can you post a wiring diagram that shows how everything is connected? Also, can you post some pictures of your setup?

- Ben


I have successfully powered my bot with the 4.8 V and it works well for about 3 turns of the course. After that it shuts down and the batteries values is about 3V.
I am using these batteries: https://www.pololu.com/catalog/product/1002
If I were to use these batteries instead: https://www.pololu.com/catalog/product/1003
will it increase the bot’s life span?

Am i understanding the mAh concept correctly?



Yes. You can find out more about battery capacity here:

pololu.com/blog/2/understand … h-is-not-a

- Ben


I have been trying to make my bot go faster by increasing it’s speed when I only use only K in the PID algorithm. I have tried every possible value for K (integer) but when I add on D to the equation I can’t seem to stop the bot from “zig-zaging”. The bots acts perfectly at a curve and follows the line to the letter. But when there is a straight line it starts zig-zaging again.

I just want to make sure that I understood the way to calibrate my bot.
I have used this tutorial:

First I have calibrated my bot on straight line using only P,then I have added D to the equation so that my bot will follow the curved lines.

What am I doing wrong?
Which of the gains (K ,D,I) is responsible for making the bot zig-zag?

Thank you,


You might try reducing P once you add in D. You also should verify that you have the right sign on D (i.e. D is making things more stable and not less stable). What motors are you using?

- Ben


These are the motors I have:



High-speed, low-torque motors like that are going to be very difficult to control. That is probably a big part of your problem.

- Ben