|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Vex navigation with ultrasonic and encoders
I'm a 3 year veteran FLL coach and I am starting to investigate what Vex has to offer "out of the box". I've been working with the Starter Kit and added tank treads, encoders, and the ultrasonic sensor. I'm using MPLAB for code development and the libraries installed with easyC. I'm trying to test the envelope of the encoders and sonic sensor to see what they can and can't do using the routines provided in the easyC libraries.
With the encoders hooked directly to the motors running at top speed, if start the encoders, start the motors, execute a while (count < 100) loop, stop the counting, stop the motors, I find the the ending counts are 104 and 106. At that rate, can the encoders achieve single count resolution? Could be skipped counts and I'm looking into whether I can improve things by adjusting the code. With the ultrasonic sensor, I find that it works pretty well if it faces a smooth, flat, solid surface but gets pretty "iffy" with anything else (hand, leg, cat, etc.). Is this typical? I also noticed that the "cone" of sensitivity is pretty narrow. I was hoping for about 20-30 degrees but its more like 10-15. I suspect I would need to use several to cover a wide enough area to track a moving person/robot/cat. If anyone has been spent time to characterize the limitations of the sensors I would really enjoy reading an overview of what they have learned. If not, I will be writing one later once I have more experience with them. |
|
#2
|
|||
|
|||
|
Re: Vex navigation with ultrasonic and encoders
In Easy C I found there is some latency with the encoder value assignment. In other words there probably will be a couple of clicks between a right and left read. Alternate the encode read oder to compensate. With the sonar sensor you get the time for the first returned wave. To cover a larger area and gather more info on the robot world mount the sonar sensor on a servo and read step read step thru the servo's range. This works very well for IR sensors. You can differentiate between a furniture leg and a wall.
|
|
#3
|
||||
|
||||
|
Re: Vex navigation with ultrasonic and encoders
Quote:
We're just starting to work more seriously with the encoders, so I'll wait a while to comment on those. |
|
#4
|
||||
|
||||
|
Re: Vex navigation with ultrasonic and encoders
Thanks,
I'm going to lock the encoder shafts and try to get a good characterization of the latency between reads. My first thought is that I will probably have to read left, read right, read left and then compare the average of left with the value of right if my goal is to match motor speeds. Also, dropping the speed when it gets close to the destination value might reduce the overrun. Sweeping the sensor with a servo sounds like a fun next step. Set up an array, record the sensor values, then identify the position and value of the smallest (closest) reading to get the heading. |
|
#5
|
||||
|
||||
|
Re: Vex navigation with ultrasonic and encoders
Short update - I'm having fun with the ultrasonic sensor but I'm surprised at how long it takes to get a reading. I've mounted the sensor on a axle which is turned by a servo motor like the old WWII radar dishes. I pan it through 180 degrees measuring the bearig and distance of the closest echo measured. It can pick up a liter pop bottle at about 2 feet away pretty well but its range drops off quickly for anything smaller or less solid. To scan without gaps it needs to take readings at about every 15 degrees. Just stepping through the locations without taking readings is pretty quick (a second or two) but when taking readings it pauses noticeably at each point so the scan takes around 8 - 10 seconds. It can find and approach a stationary pop bottle but wouldn't keep up with someone walking a couple of paces ahead or a slow moving robot. Oh well, it will still have its uses but not for what I was hoping for. If anyone figures out how to get better performance, please let us know.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| VEX UltraSonic and Encoder SOLD OUT... | Chris_Elston | Electrical | 5 | 09-01-2006 13:22 |
| VEX Optical Shaft encoders in FRC | sanddrag | FIRST Tech Challenge | 8 | 04-10-2005 07:52 |