go_away

Author Topic: Driving straight for 4 meters  (Read 6621 times)

0 Members and 1 Guest are viewing this topic.

Offline silversTopic starter

  • Beginner
  • *
  • Posts: 1
  • Helpful? 0
Driving straight for 4 meters
« on: February 20, 2007, 01:22:42 PM »
Hello, I'm looking to build a robot which will quite simply drive along a perfectly straight line for 4 meters. So far the one I made has slight curves to one side or another. Is there a way I can fix the curving? Or are there tips in design which can help a robot drive straight?

Which is better? Two stepper motors / Two DC motors with seperate shaft encoders / or Dual Differential Drive?

Even if the mechanical part is done right, you still have to be sure that friction on one end is equal to the other end. This seems like a difficulut task. Any suggestions?

Offline hgordon

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 373
  • Helpful? 7
Re: Driving straight for 4 meters
« Reply #1 on: February 20, 2007, 01:37:44 PM »
Have you considered using a rate gyro ?  Any measurements based on wheel rotation are subject to error because of slippage or slight differences in wheel diameters.

    http://www.dprg.org/projects/2003-01a/
Surveyor Corporation
  www.surveyor.com

Offline trigger

  • Full Member
  • ***
  • Posts: 115
  • Helpful? 0
  • It's an op amp, not a gun part.
Re: Driving straight for 4 meters
« Reply #2 on: February 20, 2007, 02:36:43 PM »
Hello, I'm looking to build a robot which will quite simply drive along a perfectly straight line for 4 meters. So far the one I made has slight curves to one side or another. Is there a way I can fix the curving? Or are there tips in design which can help a robot drive straight?

Which is better? Two stepper motors / Two DC motors with seperate shaft encoders / or Dual Differential Drive?

Even if the mechanical part is done right, you still have to be sure that friction on one end is equal to the other end. This seems like a difficulut task. Any suggestions?


You need some form of feedback control. Usually that means some kind of sensor giving position feedback. In software, you can compute the difference between the desired position and the actual position, and then adjust your position accordingly. The simplest way to do this is called PID control. See http://www.societyofrobots.com/programming_PID.shtml. Which sensor you will pick depends on your implementation requirements. For example, if you are allowed to modify your environment, you could put a 4 m line of white tape on the floor to guide the robot. With a photoresistor on either side of the robot's underside, you can follow the line fairly straightly. There are "photovore" tutorials eslewhere on this site. There are other ways to do this of course, but they're all probably more expensive. :)
There are 10 kinds of people in this world: those who can read binary, and those who can't.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,663
  • Helpful? 169
    • Society of Robots

Offline JesseWelling

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 707
  • Helpful? 0
  • Only You Can Build A Robot!
Re: Driving straight for 4 meters
« Reply #4 on: February 20, 2007, 05:04:20 PM »
You could also PID a compass heading.......

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
Re: Driving straight for 4 meters
« Reply #5 on: February 20, 2007, 06:48:58 PM »
i'm not convinced a gyro would be any more accurate than encoders (or any other method of ensuring the wheels were moving at the same speed such as dual differential drive).
gyros all have some element of drift.
which method would be more reliable depends on how smooth a surface you intend to drive on.

while a magnetic compass doesn't drift in the same way as the other suggested methods they are susceptible to metal in the surrounding area (or your friends teasing your bot with metal keys).

so in summary, it depends on the surface your bot has to travel on.
if it's a perfectly smooth playing field and you have the mechanical ability then i'd go with dual differential drive.
in 2nd place i'd put DC motors with encoders if you want to simplify the build.
(i've never played with stepper motors. anyone got any experience using them as main drive motors?)

if on the other hand you have to cross unpredictable terrain that might cause wheels to slip then i'd incorporate 2 or more of the above methods.
maybe a magnetic compass combined with a rate gyro. the gyro will only drift slowly so use the gyro when the bot is moving and may be passing metal objects but providing the 2 sensors agree, use the compass to calibrate the gyro.
or better still, combine all 3.
o, and add gps. i've always wanted an excuse to put gps on a bot.
and a trained monkey. monkeys can come in handy.

dunk.

Offline ed1380

  • Supreme Robot
  • *****
  • Posts: 1,478
  • Helpful? 3
Re: Driving straight for 4 meters
« Reply #6 on: February 20, 2007, 06:59:58 PM »
what if all he needs is to put a resistor on a motor. unequall motors strength
Problems making the $50 robot circuit board?
click here. http://www.societyofrobots.com/robotforum/index.php?topic=3292.msg25198#msg25198

Offline trigger

  • Full Member
  • ***
  • Posts: 115
  • Helpful? 0
  • It's an op amp, not a gun part.
Re: Driving straight for 4 meters
« Reply #7 on: February 20, 2007, 08:03:59 PM »
what if all he needs is to put a resistor on a motor. unequall motors strength

Won't work because that's still open-loop control. You need a feedback loop or else the slightest error will cause problems.
There are 10 kinds of people in this world: those who can read binary, and those who can't.

Offline JonHylands

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 562
  • Helpful? 3
  • Robot Builder/ Software Developer
Re: Driving straight for 4 meters
« Reply #8 on: February 21, 2007, 06:56:27 AM »
A gyro isn't going to drift very far in 4 meters...

- Jon

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,663
  • Helpful? 169
    • Society of Robots
Re: Driving straight for 4 meters
« Reply #9 on: February 21, 2007, 10:27:43 AM »
sounds like i need to write a tutorial about dead-reckoning someday soon, i reckon . . .

as dunk said, it very much depends on the terrain. but if you got perfect terrain, id vote for the gyro for simplicity . . .

the drift on the gyro should be a measurable constant, for a given 4m course. if you can test beforehand on that exact 4m course, then you can tweak to eliminate the drift.

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
Re: Driving straight for 4 meters
« Reply #10 on: February 21, 2007, 12:01:41 PM »
Quote
A gyro isn't going to drift very far in 4 meters...
the distance traveled doesn't really effect gyro drift.
the drift happens over time regardless of movement.
if a bot takes 10 mins to travel 4 meters then it will be hopelessly inaccurate.
if on the other hand it only takes a few seconds to travel that distance then yes, you won't get much drift.

it all depends on the level of accuracy required i suppose.
my point was that gyros don't magically solve all your problems when it comes to direction finding.

dunk.
(who has had limited success with gyros.)

Offline Hal9000

  • Supreme Robot
  • *****
  • Posts: 338
  • Helpful? 0
Re: Driving straight for 4 meters
« Reply #11 on: February 22, 2007, 08:20:38 AM »
sounds like i need to write a tutorial about dead-reckoning someday soon, i reckon . . .

as dunk said, it very much depends on the terrain. but if you got perfect terrain, id vote for the gyro for simplicity . . .

the drift on the gyro should be a measurable constant, for a given 4m course. if you can test beforehand on that exact 4m course, then you can tweak to eliminate the drift.

Dead reckoning would be awsome. Good shout! :)
"The truth is, you can't hide from the truth, cos the truth is all there is" - Handsome Boy Modeling School

Offline Brandon121233

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 320
  • Helpful? 0
  • "Genius is %1 inspiration and %99 perspiration"
Re: Driving straight for 4 meters
« Reply #12 on: March 01, 2007, 07:36:54 PM »
I think we are also missing a big part of info here, in regards to how accurate it has to be. If it only needs to go in a general straight direction there is a lot of room for error, but if you need to keep it in the cm or even mm accurate, then that would be much more complicated. And also is this a line folowing project or is it a "dosent matter where it goes as long as it goes straight" project?
Hell, there are no rules here—we're
   trying to accomplish something.

                                                                              —Thomas Edison

Offline Joe

  • Full Member
  • ***
  • Posts: 54
  • Helpful? 0
Re: Driving straight for 4 meters
« Reply #13 on: April 08, 2007, 12:59:01 PM »
This thread reminds me of the 1st robot I ever programmed. It was built by a previous student for a different task. It was small, about 6" X 6" X 8" and used servos for differential steering (skid steering) and wheel encoders. Being new to robotics, I struggled for months to get that thing to go straight using the feedback from the encoders. It nearly drove me insane. That PID tutorial would have been a godsend but that's pretty much what I ended up doing. Basically I spent extra months reinventing the wheel (no pun intended).

Anyway, in my case, the key things that finally got it to go straight were to use one wheel (left side) as the reference which remained at constant speed while constantly adjusting the other wheel (right side) to decrease the error (instead of trying to adjust both sides). I wish I could find a copy of that code, but there were variables that I tweaked, I think the main one was the number of encoder segments that the reference side would travel before correcting the other side. This value was around 3 I think. The encoders had 32 segments. Of course, 32 gives them poor resolution. Eventually I had to program it to count each loop in the program for each wheel and compare those counts (gasp) to give it high enough resolution to move in a straight line. Imagine going through this process with a deadline fast approaching and a team of people asking you if it works yet!

Offline Tsukubadaisei

  • Robot Overlord
  • ****
  • Posts: 293
  • Helpful? 0
Re: Driving straight for 4 meters
« Reply #14 on: April 14, 2007, 09:44:49 PM »
I did it once (about 5 meters) using a friend's robot. The robot initially had 4 stepper motors ( differential steering) and a few sensors. Instead of using the sensors I took 3 ultrasonic sensors that I had and connected to the mother board and used the walls to guide the robot. The motors themselves are very precise themselves but by keeping the distance from the wall constant using feed-foward and feedback you can draw a straight line. What I mean is that you must use some external element to guide your robot. Blind robots just can`t go forward in a straight line for long(unless they are perfectly symmetrical and their parts are in perfect condition). If you don't agree with me just try to do it yourself: close your eyes and try to walk a straight line for a few steps. Unless you work in a circus and know how to use your other senses to guide yourself you won't be able to do it. Give some vision to your robot so it can guide itself using something around it. Compasses, gyro or even encoders help a lot but still lack in the necessary precision. Blindly move a Robot over a straight line is usually a research topic for undergraduate and graduate students. This is d*** difficult.

If you are very rich use a GPS.
A.I.(yes those are my initials)

Offline Somchaya

  • Robot Overlord
  • ****
  • Posts: 180
  • Helpful? 0
  • You know it's cute!
Re: Driving straight for 4 meters
« Reply #15 on: April 14, 2007, 10:10:16 PM »
Hmm.. well using a GPS helps a lot in navigation, but if I'm not wrong, the resolution is around 2-3 meters, so it wouldn't help too much if the goal was to drive straight over a short distance..
Somchaya - Back after a year of misc things
http://whisker.scribblewiki.com

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,663
  • Helpful? 169
    • Society of Robots
Re: Driving straight for 4 meters
« Reply #16 on: April 16, 2007, 11:09:12 AM »
Quote
using a GPS helps a lot in navigation, but if I'm not wrong, the resolution is around 2-3 meters, so it wouldn't help too much if the goal was to drive straight over a short distance.

in robotics, as technology marches on, what is true one day becomes false the next

differential gps supposedly has accuracy within centimeters, but ive never tried it before . . .
from wikipedia:
"Differential Global Positioning System (DGPS) is an enhancement to Global Positioning System that uses a network of fixed ground based reference stations to broadcast the difference between the positions indicated by the satellite systems and the known fixed positions. These stations broadcast the difference between the measured satellite pseudoranges and actual (internally computed) pseudoranges, and receiver stations may correct their pseudoranges by the same amount."

an animated tutorial:
http://www.trimble.com/gps/dgps-how.shtml

more neat info:
http://www.oreillynet.com/pub/a/wireless/2000/12/29/two_gps.html

but i have been unable to find a place to buy an affordable system . . .

Offline Somchaya

  • Robot Overlord
  • ****
  • Posts: 180
  • Helpful? 0
  • You know it's cute!
Re: Driving straight for 4 meters
« Reply #17 on: April 16, 2007, 11:39:03 AM »
Cool.. I didn't know differential GPS could be used in this way.. The only time I've heard of dGPS prior to this was that you could use two GPS devices to reliably determine your orientation, assuming they used the same satellites and stuff..

Really, they should just get rid of the inaccuracies of GPS and give everyone the accurate position information they want, since people will just come up with ways to get around it :)
Somchaya - Back after a year of misc things
http://whisker.scribblewiki.com

Offline Tsukubadaisei

  • Robot Overlord
  • ****
  • Posts: 293
  • Helpful? 0
Re: Driving straight for 4 meters
« Reply #18 on: April 16, 2007, 07:43:04 PM »
That was what I was talking about. DGPS. My cellphone(W44S) has it but unfortunatelly I have no idea how to hack it. The precision is about 10cm.
A.I.(yes those are my initials)

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,663
  • Helpful? 169
    • Society of Robots
Re: Driving straight for 4 meters
« Reply #19 on: April 17, 2007, 08:03:07 AM »
Quote
Really, they should just get rid of the inaccuracies of GPS and give everyone the accurate position information they want, since people will just come up with ways to get around it
they got rid of the intentional inaccuracies back in 2000 because of DGPS :P

Offline Somchaya

  • Robot Overlord
  • ****
  • Posts: 180
  • Helpful? 0
  • You know it's cute!
Re: Driving straight for 4 meters
« Reply #20 on: April 17, 2007, 09:27:41 AM »
they got rid of the intentional inaccuracies back in 2000 because of DGPS :P

They did? Wow, I'm so out of touch :P Suddenly I feel an urge to buy a cheap GPS and put it on a robot for fun.. haha..

Edit: GPS shouldn't be "GPS system" hehe.
« Last Edit: April 17, 2007, 09:28:14 AM by Somchaya »
Somchaya - Back after a year of misc things
http://whisker.scribblewiki.com

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
Re: Driving straight for 4 meters
« Reply #21 on: April 17, 2007, 03:25:30 PM »
remember GPS reception is very poor indoors.

dunk.

Offline JonHylands

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 562
  • Helpful? 3
  • Robot Builder/ Software Developer
Re: Driving straight for 4 meters
« Reply #22 on: April 17, 2007, 07:00:16 PM »
They did? Wow, I'm so out of touch :P Suddenly I feel an urge to buy a cheap GPS and put it on a robot for fun.. haha..

Don't be in a big hurry. Selective Availability is the "system" they turned off back in 1990. That made the accuracy of the standard GPS signal go from 30 meters down to about 10 meters. If you have WAAS (which is further decoding from the satellite signal), you can get as good as 2 or 3 meters.

DGPS uses land-based transmit towers to broadcast corrections for the satellite signals. Most standard DGPS signals will get you down in the sub-meter range. Typically, if you want 10 cm accuracy, you have to pay big bucks ($5-10 thousand) for a very accurate DGPS system.

For the GPS you buy at Walmart or your local outdoors supply store, you're looking at WAAS accuracy as being as good as you'll get.

- Jon

Offline Somchaya

  • Robot Overlord
  • ****
  • Posts: 180
  • Helpful? 0
  • You know it's cute!
Re: Driving straight for 4 meters
« Reply #23 on: April 17, 2007, 07:07:36 PM »
Oh.. so those car navigation devices usually use the WAAS accuracy?

Haha, don't worry, I'm not intending to actually go out and buy a GPS any time soon, it's just one of those cool novelty sensors that would be fun to have that can be put on a robot..
Somchaya - Back after a year of misc things
http://whisker.scribblewiki.com

 


Get Your Ad Here