1. Pre-reading

Before class starts, chew on this idea of a 4th generation of the Internet (socially-connected devices, the 3rd is social networks): http://drmarty.blogspot.com/2010/04/socially-connected-machines.html

2. Review

2.1. Rotary incremental encoders

The Wikipedia page about incremental encoders is a good review of

Jason Sachs: How to Estimate Encoder Velocity Without Making Stupid Mistakes: Part 1. This article focuses more on velocity instead of position, but he includes lots of tips, tricks, and gotchas interleaved with his entertaining writing style.

2.2. Bouncing contacts

Our EN12 encoders are just contacts, so all things about what happens when two metal surfaces touch each other with non-zero velocity applies.

A classic Jack Ganssle set of articles:

But how fast is fast enough? I didn’t know so I wired a switch to [a devboard and did the experiment]

Take 30 seconds and imagine what that experiment’s code would look like on your MSP430.


Max Mayfield for EE Journal:

More!:

3. Project 3

HOW DO YOU READ THE FINE ENCODER so that your code can make sense of the input signals?

Your observations from watching the signals on the AD2 scope + digital input are critical to addressing this problem. There are lots of good resources

  • When there is scraping / bouncing / gnastiness at an edge, the other signal is constant.

Notice this behavior in the following captures. Also see howthe real(ity) waveform captured by the 'scope is interpreted by the LVCMOS 3V3 type logic inputs of the AD2.

encoder bouncing1


encoder bouncing2


encoder bouncing3


encoder bouncing4


encoder bouncing5


Repeatedly reading the A,B signals needs to be done quick enough to not miss an edge.

How fast of rotation do you want to support?

then compute the (shortest) time between edges.

4. Bonus

The other articles in the series are also good.


Notice how I link to EmbeddedRelated.com quite often? The site doesn’t waste your time.

ok, can’t stop:

More of an electronics and signal processing thing, but we frequently have RC low-pass filters in embedded systems: R1C1R2C2: The Two-Pole Passive RC Filter