Incremental rotary encoder

I am looking for incremental rotary encoder for inverted pendulum project, maybe somebody can give advices which one to use, how precisios it should be?

Maybe there is better way to messure angel of pendulum without using encoder?

https://www.youtube.com/watch?v=MWJHcI7UcuE

High resolution optical encoder

For your purpose, I think you should use a high resolution optical encoder. Here is a link to such product as an example,

http://www.servo2go.com/product.php?ID=100139

The classic approach to this

The classic approach to this uses a resistive potentiometer, which has a lot of resolution.

If all you need is deviation from vertical, maybe an LED / phototransistor and a wedge-shaped moving part would give you a value that goes through some + and - position??

 

Magnetic encoder

i suggest you this link http://www.rls.si/default.asp?prod=am256 . They also send sample of the breakout board of the chip and a magnet.