Friday, 18 October 2013

Accurate-ish Pneumatic Cylinder Positioning with Adafruit flow meter, Dangerous Prototypes ATX breakout and MSP430 LaunchPad.


MSP430 and flow meter for actuator positioning.
Terse: 99.7% Accurate! Score another win for cheapskates in cramped garages everywhere! Here's a little set up to check the viability of dirt cheap pneumatic cylinder positioning.

Progress on the hydraulic bartending robot!

I was doubtful that a ten dollar plastic flow meter would allow us to get within a half mile repeatability for cylinder positioning.

After a few stumbles with solenoid voltage spikes, sticky turbines and noisy compressors; initial shop testing proves that we can easily achieve 5mm accuracy on a 2000mm stroke.

The initial run cycled to a pre-set 457mm stroke length every 5 seconds. The actual strokes were bell curve distribution from  454 to 460 with the mean spot on 457mm.
The test ran for about 30 minutes (360 cycles) before the flow meter crapped out.

The 43oh didn't get a pulse count from the flow meter, so it kept the air solenoid valve open. The piston slammed up against the gland at full speed; scared the ever livin shit out of me!  I'm not sure why the flow meter seized up, but nothing a little disassembly and percussive adjustment couldn't fix.

Prior to getting the test running, I had troubles with the Dangerous Prototypes ATX breakout. Every time a solenoid would de-energize the ATX would shut down. With the help of the Dangerous Prototypes forum members I stumbled upon my rookie mistake: installing snubber diodes too far from the solenoids.

Relay Board, Adafruit flow meter and 43oh 
The set up is simple. Install an Adafruit flow meter into the cylinder port, get the LaunchPad/Arduino/Pi to energise a 12VDC solenoid coil connected to the ATX breakout. Air flows from the compressor, through the flow meter, extending the cylinder. When the LaunchPad counts the pre-determined number of pulses it de-energises the solenoid valve and the cylinder stops moving. After a brief pause to measure the stroke length, the reverse solenoid energises and retracts the cylinder.

Watch the YT for more cylinder choochin' fun!

43oh powrd!


  1. excellent work! Love the flow meter. Any chance of posting your code? What did you use to put it together? Code composer?

  2. Thanks, glad you like! This was just the first test run; much more to come.
    Code composer? Nah, just the Energia edge detect sketch. Sooper simple: pin high until flow count is X then pin low, reverse pin high delay pin low; just a quick test.

  3. Is there any further reading you would recommend on this?

    pneumatic cylinder

  4. We pneumatic products manufacture several products, including solenoid valves,air control valves, piston air cylinder, Pneumatic Air Filter and some pneumatic accessories. Most of goods are exported to USA, Europe and Asia. And they are widely used on electronic, pharmaceutical, food processing, packaging, medical and automotive industries. Visit:

  5. Really impressed together with your writing abilities as well as with the format for your weblog. Anyway stay up the excellent high quality writing, it is uncommon to see a nice blog like this one today.
    Plastic Flow Meter