Older blog entries for dwhall (starting at number 1)

Snaggletooth: Through experiment, I found that the ADC encoder software is unable to sample the encoders fast enough (as a background task) to work properly. It reaches about 0x12 ticks/sec then reflects and starts giving smaller tick-per- second values for increasing speed in typical ADC-sample- aliasing fashion. A solution involving comparators and a hardware interrupts is pending.

In the meantime, I wired up a homebrew ultrasonic emitter/detector pair. The emitter uses an LM386 amplifier, and is pretty loud, despite being inaudible. I can determine the loudness because it takes my 3"-thick Physics book to eliminate crosstalk between the emitter and detector in order to get reliable measurements. Range was 5 inches min to 3 feet max. Resolution was nice... about 0.1" per count.

I also started using Larry Barello's AvrX RTOS for the AVR. I've used it before on another project, but this is the first time for Snaggletooth. The motor control system (with velocity measurement) is on a separate task. For the record, AvrX works great! Work on the motor control system is pending the new digital encoders.

21 Oct 2002 (updated 22 Oct 2002 at 15:12 UTC) »

Snaggletooth: Shaft encoders are IR reflectance-based sensors mouted inside the gearbox of both servo motors. The sensors read black/white marks painted on the penultimate drive gear. Encoder ticks come in via ADC. Wrote software to count encoder ticks.

Highlights: 100% PWM on a slightly discharged battery yields about 24 ticks per second. 25% PWM yields about 9 tps.

Next: Write feedback-based motor speed control routines. Long term: move to digital encoder sensors.

Share this page