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 / 12492
12491  |  12493
Subject: 
Advice on Rotation sensors and steering please.
Newsgroups: 
lugnet.robotics
Date: 
Thu, 21 Sep 2000 01:10:02 GMT
Original-From: 
Steve Baker <sjbaker1@airmail.netIHATESPAM>
Reply-To: 
[sjbaker1@]AntiSpam[airmail.net]
Viewed: 
676 times
  
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 has 3 Replies:
  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)
  Re: Advice on Rotation sensors and steering please.
 
Of course, for the back wheels you could join the two shafts in a differential and the difference of the two would appear in the rotation of the casing (don't forget some reverse gearing to make the sum zero for two motors going in the same (...) (24 years ago, 21-Sep-00, to lugnet.robotics)
  Re: Advice on Rotation sensors and steering please.
 
(...) I have run into "count loss" using the rotation sensors also. I found that anything above 40RPM is somewhat problematic. I imagine the exact numbers depend upon the size of the program you are running and how it is designed. But no matter what (...) (24 years ago, 21-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