Pneumatic Inverted Pendulum

Summary of Pneumatic Inverted Pendulum


This project builds a pneumatic inverted pendulum: a cart driven by an air cylinder (proportional valve control) carries a 360° pendulum attached to a rotational encoder; a linear encoder measures cart position. Arduino reads both encoders, computes a control voltage, and sends it through a DAC0808 and LM324 amplifier to drive the proportional valve. Shared grounds are required for supplies; the flow control valve is unused. Encoders provide quadrature A/B signals; counts convert to radians and meters for angle and position calculations.

Parts used in the Pneumatic Inverted Pendulum:

  • Air compressor
  • Proportional valve
  • Air cylinder (pneumatic actuator)
  • Cart (aluminum box)
  • Carrier (guide for cart)
  • Rotational encoder S1-1250-250-I-N-D
  • Pendulum (attached to encoder shaft)
  • Linear encoder (black box with internal rotational encoder)
  • Arduino (data acquisition and control)
  • Digital-to-Analog Converter DAC0808
  • Operational amplifier LM324
  • +12V and -12V power supplies (for op amp)
  • Wiring and common ground connections

Construction

Mechanical structure

Pneumatic-Inverted-Pendulum
Compressed air comes from air compressor and goes in the proportional valve. Coming out from the proportional valve, there are two branches of air flow (one is compressor air, the other one is exhausted air) which connect to the air cylinder (pneumatic actuator). The pneumatic actuator connects to a cart (the aluminum box) where the pendulum is attached, and underneath the cart lies the carrier, which guides the cart along straight line. The rotational encoder is inside the cart, and its shaft is fastened throught the cart. The pendulum is attached to the shaft and is able to rotate 360 degrees. At the back side of the cart, a linear encoder is attached. For more detail please refer to VIDEO 1.

Note: the flow control valve is unused.

Control circuit board

Arduino is used as the data acquisition board and control unit. Signals from the linear encoder and rotational encoder are acquired into the Arduino, and then an output voltage is calculated, which will then control the proportional valve through a Digital Analog Converter and Operational Amplifier. The circuit schematic diagram is shown below:

Note that the “black green red yellow” in linear encoder diagram are just merely the color of wires. You might have different ones, but after watching VIDEO 3, it should be clear on how to use a linear encoder–the connection and programming are similar to rotational encoder. The operational amplifier should be connected to the +12 and -12 power supplies (not depicted). As noted above, if using separate power supplies, they must share a common ground.

Arduino

Visit arduino.cc to learn more.

Rotational encoder

The rotational encoder used in this project is S1-1250-250-I-N-D (more detail available in TABLE 1).

This encoder has 1250 counts per 360 degree (2*pi radians). Therefore, we have:

1250/(2*pi) = angle_count/alpha
Which gives us:

alpha = 0.00503*angle_count (unit: radian)
And the angular velocity could be estimated via

Alternatively, a moving average can be utilized, in which an array of the last x average values are stored, and the average of them is taken. This is more computationally heavy, but may filter out some of the noise.

How to read an encoder:

When you rotate the encoder’s shaft, there will be signals from Channels A and B. Channels A and B are square waves with the same amplitude and frequency, but offset by 90 degrees. Note that when rotating in a different direction at the rising edge of channel A, channel B signal will be different–say, if rotating clockwise results a low valve of channel B at the rising edge of channel A; then when rotating counterclockwise, at the rising edge of channel A, channel B will give a high valve.

Linear encoder

Inside the black box of the linear encoder, there is a rotational encoder. The black box travels along a track. Therefore, linear encoder and rotational encoder are the same thing–there are also channel A and B in linear encoder, and their signals are the same as rotational encoder. The stroke of air cylinder is 0.1512m, and the linear encoder results 2993 counts travelling that distance. So, we have:

2993/0.1512 = pos_count/x_c
Which gives us:

x_c = 0.0000505*pos_count (unit: meter)
And we could estimate cart velocity using

Digital-analog converter and operational amplifier

Pneumatic Inverted Pendulum schematic

The DAC in used is DAC0808, and the operational amplifier in used is LM324. Basically what Digital Analog Converter (DAC) does is: given a digital signal from Arduino, DAC outputs an analog signal, which is used to control proportional valve. But because the DAC’s output is current and has very little power, we need an amplifier to drive the proportional valve. DAC0808 is an 8-bit DAC, and we give VREF = 12V. If we want a 6.6V output, here is how to calculate the digital value for it:

For more detail: Pneumatic Inverted Pendulum

Quick Solutions to Questions related to the Pneumatic Inverted Pendulum:

  • How does compressed air reach the air cylinder?
    Compressed air from the air compressor goes into the proportional valve, which outputs two air branches that connect to the air cylinder.
  • Can the pendulum rotate fully?
    Yes, the pendulum is attached to the encoder shaft and is able to rotate 360 degrees.
  • What encoders are used to measure angle and position?
    A rotational encoder (S1-1250-250-I-N-D) measures angle and a linear encoder (which contains a rotational encoder inside) measures cart position.
  • How are encoder counts converted to physical units?
    Rotational encoder: alpha = 0.00503 * angle_count (radians). Linear encoder: x_c = 0.0000505 * pos_count (meters).
  • How is the proportional valve controlled electrically?
    Arduino calculates an output voltage, sends digital data to DAC0808, and the DAC output is amplified by LM324 to drive the proportional valve.
  • Does the project use the flow control valve?
    No, the flow control valve is unused.
  • How are encoder signals read regarding direction?
    Channels A and B produce quadrature square waves; the relative state at channel A rising edge indicates rotation direction via channel B level.
  • What power supplies are required for the operational amplifier?
    The LM324 op amp should be connected to +12V and -12V power supplies, and all supplies must share a common ground if separate.

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter
Scroll to Top