Inverted Pendulum Control Program Specifications

 

At startup, the program will sense the position of the pendulum and attempt to make it upright. If, after a yet to be determined amount of time (measured in compute cycles), the pendulum still hasn't moved from the 30o position, the program will stop the car until the "go" button is pressed again. If at any point in time the pendulum goes to the 30o position, the program will try to right it for the yet to be determined amount of time and, if it doesn't right it, will then stop the car.

The controls problem is of the SISO (single input, single output) type. Using the position of the pendulum as the input, Y(t), where E(t) = (Set point) - Y(t), the control program will determine the output U(t). The output will be divided into two parts, the sign, positive or negative, and the magnitude, which will be expressed in percent. (No actual unit necessary, just a value from 0 to 100.) The sign will determine the direction the motor turns and the magnitude will determine the width of the pulse on the PWM output of the PIC chip.

The PID Control Equation

The optical encoder will require six inputs (it has six bits of resolution). The inputs will be in gray code so a look up table will be necessary to determine the actual pendulum position. (Need to discuss this and determine how it can be done. I know but I need to make sure they know. The table requires 64 memory locations.)

There will be a single push button to tell the car to start. This will require one input to the PIC.