Author Topic: driving straight  (Read 1870 times)

0 Members and 1 Guest are viewing this topic.

Offline javafiendTopic starter

  • Robot Overlord
  • ****
  • Posts: 125
  • Helpful? 0
driving straight
« on: March 31, 2008, 11:30:20 AM »
Has anyone else had problems with their $50 robot, or any differential drive robot for that matter, drifting to one side or the other when it should be going straight?  Mine has been doing it from the beginning, with sensor code commented out, and seems fine structurally.

How did you fix it?

Thanks!

Offline bukowski

  • Robot Overlord
  • ****
  • Posts: 219
  • Helpful? 0
Re: driving straight
« Reply #1 on: March 31, 2008, 11:44:29 AM »
Mine ran fine... perfectly straight from what I could tell.
Is it consistantly turning in the same direction? (eg always making a slow left turn) if so, you could adjust the speed in the code to match up the wheel speed, or adjust one of your wheel's OD if you want to jerry rig it.

Offline AndrewM

  • Robot Overlord
  • ****
  • Posts: 255
  • Helpful? 0
Re: driving straight
« Reply #2 on: March 31, 2008, 11:54:44 AM »
Assuming your left and right wheels are the same size, you just need to adjust the pwm sent to one servo or the other.  Two servos are often slightly different in their application of a pwm signal as you are now experiencing.  If the robot is turning consistently to the right, you need to reduce the pwm signal sent to the left servo slightly; vice versa for if it is turning to the left.  It is basically a trial and error kind of thing.
blog: www.iamwhen.com
Saving the world from humanity one robot at a time.

Offline superchiku

  • Supreme Robot
  • *****
  • Posts: 953
  • Helpful? 5
  • cooll
Re: driving straight
« Reply #3 on: March 31, 2008, 01:34:12 PM »
andrew is right sometimes u have to adjust the pwm values to make the bot go straight, so try doing that it will work out
JAYDEEP ...

IT AND ROBOTICS ENGINEER

"IN THE END IT DOESNT EVEN MATTER"

Offline michaelsane

  • Jr. Member
  • **
  • Posts: 31
  • Helpful? 0
Re: driving straight
« Reply #4 on: March 31, 2008, 03:58:33 PM »
In theory the robot is not going to go perfectly strait even if you do tweak your pwm values, because there is no feedback.  If you want to use an optical encoder on the wheels then you could send out the pwm signals, and stop after each axel makes x amount of revolutions.  If you are interested in optical encoders US Digital makes some really nice ones (and affordable).

 


Get Your Ad Here

data_list