I'm using an accelerometer and gyroscope to detect the angle and tilt rate on my two-wheeled cart-pole robot. Is there an optimal height to place the sensors? Should I place them closer to the bottom (near the wheels), the middle (near the center of mass), or the top? Justification for the optimal choice would be appreciated.
The gyroscope placement shouldn't make any difference since the rotation rate will be the same everywhere (assuming your robot is rigid enough).
The accelerometer will pick up the rigid body acceleration of the robot as well as virtual accelerations from centripetal and coriolis effects, plus gravity of course. If you are intending on using the accelerometer to track the gravity vector then you will want to minimize those virtual accelerations by placing the accelerometer closer to the centre of mass. You could potentially take advantage of the centripetal and coriolis effects to help determine the rotation rate, but I would suggest trying the simpler approach first.
Note that if you place the sensors on a pole that is flexible then you will pick up elastic deformation as well, with the effect getting worse as you place them further up high. (A long-winded way of saying watch out for vibration!)