Angular position measuring

Planning to built an inverted pendulum. However, don't know how to measure the angular position of the pendulum (even not sure if measuring the angular position is the best option to control such a system).

Using a gyroscope sounds good but just wanted to get your opinions.
What would your solution be ?

MEMS gyroscopes measure angular rates of rotation, not a position.
Old mechanical gyros measure position against the reference frame they were locked in.

You may try MEMS accelerometers - they give you a position (tilt) against the Earth's center of gravity (but only when they are still or move without any acceleration).

For playing with inverted pendulum you most probably need both - gyro and accelerometer - and you have to do some kind of data fusing. The simplest approach could be the accelerometer used as tilt meter, but any nonlinear movement will introduce an acceleration added to the tilt.

Seems like you could just a potentiometer at fulcrum instead of using a gyro or accelerometer. Much simpler and probably more accurate.

A potentiometer would probably be easiest if you can find one that's durable enough and allows continuous rotation.

A couple links for fairly inexpensive encoders:

http://www.usdigital.com/products/encoders/absolute/rotary
http://www.cui.com/Product/Components/Encoders/Absolute_Encoders/Modular/AMT203-V

There are also ICs (e.g. AS5030) that will sense the rotational position of a magnet placed over them. Offhand I can't seem to find any retail breakouts for them. The least expensive option but also the most difficult to implement.

They use expensive precision pots at ESIEE, near Paris, for their inverted pendulums in the embedded systems lab.

Chagrin:
A potentiometer would probably be easiest if you can find one that's durable enough and allows continuous rotation.

A couple links for fairly inexpensive encoders:

http://www.usdigital.com/products/encoders/absolute/rotary
http://www.cui.com/Product/Components/Encoders/Absolute_Encoders/Modular/AMT203-V

There are also ICs (e.g. AS5030) that will sense the rotational position of a magnet placed over them. Offhand I can't seem to find any retail breakouts for them. The least expensive option but also the most difficult to implement.

Do I need an encoder as I am using potentiometer ?

zoom:

Chagrin:
A potentiometer would probably be easiest if you can find one that's durable enough and allows continuous rotation.

Do I need an encoder as I am using potentiometer ?

No, you just need an encoder or a pot. Personally I've never seen a potentiometer used for continuous rotation and would expect them to be expensive; encoders seem better suited to this type of purpose.

I don't see why you would need a "continuous rotation" pot for an inverted pendulum.

You don't!

You might also look into hall effect sensors if you want your inverted pendulum to run for long periods of time, and don't want to worry about a potentiometer wearing out.