inverted pendulum

hi, I need someone's help to control the position of the cart of an inverted pendulum, the pendulum is stand upright but the cart keep travelling to the right or left until it hits the end of travel depending whether residual error was to the right or left. i'm looking for a way to control position/acceleration of the pendulum. right now i'm reading the encoder as input and output is PWM to the stepper motor drive. tks

Standard engineering class project.

The standard test for a post should be: "is the information given in this enough for someone skilled in the art to reproduce the my project exactly and with it the issue I am seeing?"

This post utterly and totally fails this test.

don't get your post...

Ard_1:
don't get your post...

I think what he is trying to say is that you have not supplied enough information about your project for anyone to be of assistance to you.

Ard_1:
don't get your post...

So that makes two of us: I don't get yours.