The circuitry in this system relies on op-amp circuits in order to build a proportional-differential (PD) controller. All op-amps are powered at the rails with +/- 20V. A second simple manual controller using a potentiometer can also be used by flipping a switch to change the source of the motor control circuit. The full control circuit is shown in the diagram below.

PD Controller

The first step in the PD controller is a difference amplifier. Two potentiometers are used as voltage dividers connected to +20V and ground to provide the voltage signals into the amplifier. The difference amplifier measures the voltage difference between a potentiometer connected to the pendulum and a second potentiometer set on the circuit. The difference amplifier is calibrated to output 0 V when the pendulum is vertically balanced. This circuit uses a unity gain and the signal is fed into a buffer to avoid the latter stages pulling down on the difference amplifier.

The signal from the buffer is sent to parallel op-amp circuits, the first of which is an inverting amplifier. A 10K potentiometer is placed in series with a 10K resistor on the negative feedback to provide variable gains. This gain is calibrated to push the motor at full power when the cart reached the angle at which recovery becomes virtually impossible. A 100 ohm resistor was chosen resulting in a kp range of 100 to 200. The second paralell circuit is a differentiating amplifier used to help predict the response necessary and avoid the pendulum reaching the point of no return. Once again, a 10K potentiometer is placed in series with a 10K resistor to allow variable gain. In the process of tuning, a 100 microfarad capacitor is found to have an acceptable range of gains. The kd ranges from 1 to 2. The proportional and differential signals from above are fed into a summer with a unity gain which provides the control signal that will be fed into the motor control circuit.

Manual Controller

Tha manual controller is used to show the difficulty of the process the PD controller is attempting.A 10K potentiometer is used as a voltage divider with +/- 20V at either end. Turning the knob of the potentiometer allows the user to change the voltage reaching the motor and, therefore the speed at which it is moving.

Motor Control Circuit

The motor control circuit takes advantage of an op-amp with NPN and PNP transistors to create a current amplifier without the deadband of a standard push-pull circuit. Flyback diodes are included to avoid burning out the circuit. A capacitor was previously included but created problems with maintaining the bidirectional motion of the cart.

Implementation

The circuit was built using a solderless breadboard so that components could be easily changed if gains were not properly set. Also, four 7.5' wires were twisted together to connect the control circuit to the cart (ground, +20V to potentiometer, motor signal, potentiometer signal). A control panel was created consisting of 3 knobs for the manual control potentiometer and the potentiometers that control the gains. Also, a motor on/off switch and a switch to connect the manual or PD control circuits is included.

Control Panel

Control Circuit

Circuit Parts List

Part Qty. Source
10K Potentiometer 4 Jameco
10K Potentiometer 1 Lab
Potentiometer Knob 3 Jameco
741 Op-Amp 6 Lab
10K Resistor 9 Lab
100 Ohm Resistor 1 Lab
100 microfarad Capacitor 1 Lab
Toggle Switch (On/Off) 1 Lab
Toggle Switch (PD/Manual) 1 Radio Shack
NPN Transistor 1 Lab
PNP Transistor 1 Lab
Solderless Breadboard 2 Jameco
Control Panel Housing 1 Machine Shop