Subject:
|
Re: Advice on Rotation sensors and steering please.
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Thu, 21 Sep 2000 14:36:26 GMT
|
Viewed:
|
610 times
|
| |
| |
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 direction. Over an hour's operation that would give you a very
accurate "difference" and save you one input.
Good luck, Jerry
In lugnet.robotics, sjbaker1@airmail.net writes:
> 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.
|
|
Message has 1 Reply: | | Re: Advice on Rotation sensors and steering please.
|
| (...) Yes - but it doesn't tell me the distance travelled - I need that too. Still, I guess that using one sensor in the differential for steering and one on *one* of the wheels for distance would work better. I guess that the fact that the (...) (24 years ago, 21-Sep-00, to lugnet.robotics)
|
Message is in Reply To:
| | Advice on Rotation sensors and steering please.
|
| 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 (...) (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
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
Active threads in Robotics
|
|
|
|