Level Platform

Is there a way with a Vex Cortex to ensure a platform is level?

I’d like the platform to be level front to back and left to right. The platform might not start level, so I’m looking for a way to auto level.

Is there a level sensor? If there is, I could use one left/right and another front/back.

I thought of the Gyroscope, but that won’t work, since that only shows change.

Thanks for the input.

The gyro would work, it does show the degrees off from the start position, or you could take a quadrature encoder and hang a small weight from it to hang down, and take the difference from the start position.

I’ve never personally used the VEX accelerometer, so I’m not sure how noisy it is, but an accelerometer can be used to detect if a thing is level, I have a digital level app on my phone that uses the phone’s accelerometer for basically the same purpose

http://www.digikey.com/en/articles/techzone/2011/may/using-an-accelerometer-for-inclination-sensing

Also the accelerometer, how well I don’t know, but it will give an absolute reading in three axis and you can calculate the angle of the platform (assuming it is stationary, a bit more difficult if it is also moving).

Since your platform may not start level I would consider a potentiometer with a pendulum along with an accelerometer to level it since my experience with gyroscopes and accelerometers is that they will assume the starting position is zero. If you use the debugging console to determine the potentiometer reading when it is perfectly level and then adjust the lift to that number and zero the accelerometer at that point. You would not want to use the pendulum and potentiometer during continued game play due to the swinging of it when moving. I am sure JPearman and other community members can help you hit this one out of the park.