Society of Robots - Robot Forum

Software => Software => Topic started by: MtnbikerET on October 30, 2010, 05:21:38 PM

Title: Help with $50 robot using ATMega168p
Post by: MtnbikerET on October 30, 2010, 05:21:38 PM
I compiled the source code, hooked everything up, but for some reason, my robot just spins in circles. Thats all it does. I tried changing the code, but it always just spins in circle. Help please?

I can post videos if you want.
Title: Re: Help with $50 robot using ATMega168p
Post by: knossos on October 30, 2010, 10:56:42 PM
We would need more information, but first thing I would check is to make sure one motor or servo is inverted from the other (they should be inverted, either in software, or physically, depending on what types of motors or servos you are using and how you are driving them).  Easy way to check this is to pick up the robot and see if the wheels are spinning the same direction when it is supposed to be moving forward. 

Second, the wheels could be spinning at different speeds.   If so, then the robot would constantly turn in one direction.  There are many reasons that this might happen such as (in no particular order) differing motor performance (even on two identical motors), electrical design of circuit, insufficient power to a motor, uneven weight distribution, etc etc.  Encoders can help to resolve this, or you can fine tune them by adjusting how they fast they are driven in software.