A compound pendulum consists of a physical mass which rotates about any point except its center of gravity. Such a system has a natural oscillatory response. This is corroborated by the open-loop response to a 2 volt step input as seen in the figure below.

You can see that even after 100 seconds have gone by, the pendulum is still oscillating more than +/- 2 degrees. This underscores the need for control methodologies to be implemented on the thrust tester to improve the system's transient response. Towards this, an encoder is mounted to the pivot point shaft to measure the angle subtended by the pendulum. Feeding this information back into the system allows for many different approaches to quickly stabilze the compound pendulum at a desired angle.
Back to the Table of Contents

From the free body diagram above, it can be seen that evaluating Newton's second law about the pivot point of the pendulum yields the following equation:

The open-loop transfer function of the plant can be found by taking the Laplace Transform of the second-order differential equation (and linearizing the sin(theta) term => sin(theta)=theta):

Therefore, the system's control block diagram is

Back to the Table of Contents
Unlike boolean logic which can have two possible values (on or off), fuzzy logic allows access to the areas in between. For example, if you want to control a cooling fan to regulate a room's temperature, it would be difficult if your fan had just two settings: off or high speed! However, if you had a controller which allowed for multiple speed settings (i.e. off, low speed, medium speed, high speed), it would make accomplishing such a task much easier. This is the basis behind fuzzy logic.
A fuzzy controller is comprised of three basic components: the fuzzifier, the rule base, and the de-fuzzifier as seen in the figure below.

Inputs enter the fuzzifier and are assigned a value ranging from 0 to 1 depending upon the input's degree of truth (with 1 being completely true and 0 being completely false). For example, if the input for our thrust tester system is the subtended angle (measured by an encoder) and you are trying to stabilize this at 20 degrees, then a plot of the truth values corresponding to the error would look like

As an example, if the angle was measured at 40 degrees, then the error would be -20 degrees. This would make the truth values of negative error (NE) and zero error (ZE) both equal to 0.5. The positive error (PE) variable would be assigned a value of 0. It can also be seen from the graph that as the error values on the x-axis approach 0, the truth values under the zero error category approach the completely true value of 1.0. To further increase the effectiveness of the controller, the derivative of the error should also be evaluated. Therefore, the system will be able to determine if the pendulum is moving further from or towards the desired angle at any instant (i.e. if the error is increasing, decreasing or remaining constant). Since the sampling time is on the order of milliseconds, the change in error will never be greater than a few degrees. As such, the bounds on the membership function is +/- 5 and is shown below.

The next step to designing a fuzzy controller is the rule base. The rule base contains IF-THEN statements which dictate the systems output. For example, one rule might be "If(the error is large) -- THEN(increase thrust). Below is the rule base used for the fuzzy controller I implemented:
Using the value from above of the error equal to -20 degrees and assuming the error is constant (i.e. errorDer=0), rules (2,5) have values of 0.50 and rules (1,3,4,6,7,8,9) have values of zero. AND statements in the rule base correspond to taking the minimum value of the two expressions. In rule 2, for example, NE=0.5 and SE=1.0. Thus the output of rule 2 is min(0.5,1.0), or 0.5.
Finally, the output of each rule is fed into the de-fuzzifier. Here, the most relevant rule is selected typically using one of three methods: maximum, average, or centroid. If the maximum method is applied, then rules 2 and 5 still apply since they have the same value (0.5). In this case, a weighted average should be computed between the outputs of rules 2 and 5 (low and nominal thrust). The final output must be converted back into a value which is interpretable by the system.
Download Power Point slides - fuzzyPPT.zip
Back to the Table of Contents
Choosing appropriate bounds on your membership functions is entirely up to the user. I created a simulation of the thrust tester in Simulink to make it easier to find the optimal values.



Back to the Table of Contents
The front and back panels of the Labview VI are shown below. Download the labview VIs by clicking on the following link - fuzzyLabview.zip.
Back to the Table of Contents
The plot shows the 2 Volt step response of the open loop system (blue) and the response under fuzzy control (pink). In both cases, the system stabilizes at around 44 degrees. However, the fuzzy controller has a much quicker settling time with slight overshoot. Videos of each experiment are also shown.
![]() Open-loop response to a 2V step |
![]() Stabilization using fuzzy logic controller |
![]() Stabilization after a disturbance |
The system parameters can be tuned to eliminate the overshoot - see figure below.

Back to the Table of Contents