To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 12496
12495  |  12497
Subject: 
Re: Advice on Rotation sensors and steering please.
Newsgroups: 
lugnet.robotics
Date: 
Thu, 21 Sep 2000 13:00:10 GMT
Viewed: 
479 times
  
The solution is to float the motor. There is code in the NQC tutorial for
this. It works very well. the file is 9_rotation.nqc  I will E mail it if
you do not have the file.

--
Bob Fay
rfay@we.mediaone.net

The Shop
http://users5.50megs.com/bobfay

http://www.geocities.com/Heartland/Bluffs/7900/
"Andy Gombos" <lego-robotics@crynwr.com> wrote in message
news:39C9482A.9EBCB1BC@yahoo.com...
In my experience setting the motor to off has worked best. Constantly • check
for differences in the counts. I was only using 2 sensors, and after 500 • or
so steps(about 15 ft), there was only a 1 count differenece. The main • factor
in determining what happens is if the robot is perfectly straight or not. • 1
mm of non-straightness can lead to almost 1 foot of deviation at the end,
relative to your reference line.

Andy

Steve Baker wrote:

OK - so I am now the proud owner of three rotation sensors.

I've built a really basic two-wheeled robot with a caster at
the back for the purposes of getting in some programming experience
with these things.  Each wheel has a rotation sensor (connected via
a gear train so I can play with the sensitivity)- each has it's own
motor.

I'm using NQC.

So, step one - steer in a straight line.  Since two motors picked
at random don't go at anything like the same speed, I need to correct
for that.

Here is some pseudo-code:

   zero both sensors
   both motors full speed forwards

   while ( true )
   {
     if ( sensor1 < sensor2 ) {
       full speed wheel-1 ;
       slow down wheel-2 ;
     } else {
     if ( sensor2 < sensor1 ) {
       slow down wheel-1 ;
       full speed wheel-2 ;
     } else
       full speed on both wheels ;

     Wait(1);
   }

...well, this (and MANY variations on this) fail miserably for a
variety of reasons. So I have some *basic* questions:

* I heard that the rotation sensor can lose count if it rotates too
  fast for software to keep up.  Can anyone give me an idea of what
  a 'sensible' rate is?  I guess it's a compromise between precision
  and risk of count lossage.

* In the pseudo-code, I have 'slow down wheel-N'.  There seems to be
  a suprising variety of ways to do that..although there isn't actually
  a 'speed' control! :

     + I can set the motor output to 'Off'.
     + I can momentarily apply 'OnRev'
     + I can reduce the 'power' from 7 to something
       smaller...either suddenly or gradually.
     + I can 'float' the motor output.
     + I can do a combination of these things.

  Which of these things works best?  Does the choice depend on the wheel
  size/tyre type/gearing/robot weight - or this there simply 'one best
  way' ?

* The rotation sensor counts the total rotation measured in 22.5 degree
  steps - right?  If we drive more than 32767 steps, it'll wrap around • to
  -32768 steps or something - right?

Once I can get it to go in a straight line, I'll go on to figure out
how much I can accellerate/decellerate without tyre slippage, then write
code for turning, reversing, collision recovery, etc.

* Has anyone ever written an RCX emulator?  It would be nice to be able
  to debug my code on the PC where I could print out variables and such.
  With the limited 'byte code' that NQC uses, it seems like this • wouldn't
  be so hard to do.

--
Steve Baker   HomeEmail: <sjbaker1@airmail.net>
              WorkEmail: <sjbaker@link.com>
              HomePage : http://web2.airmail.net/sjbaker1
              Projects : http://plib.sourceforge.net
                         http://tuxaqfh.sourceforge.net
                         http://tuxkart.sourceforge.net
                         http://prettypoly.sourceforge.net









Message is in Reply To:
  Re: Advice on Rotation sensors and steering please.
 
In my experience setting the motor to off has worked best. Constantly check for differences in the counts. I was only using 2 sensors, and after 500 or so steps(about 15 ft), there was only a 1 count differenece. The main factor in determining what (...) (24 years ago, 20-Sep-00, to lugnet.robotics)

8 Messages in This Thread:




Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR