Monday, February 6, 2012

Arduino Controlled Pneumatic Servo



For an upcoming project I needed a pneumatic ram with a closed loop control system so I could position it accurately. Didn't have the budget for an off the shelf solution, so I bodged one together with an ardunio, a couple air solenoid valves, and a pair of potentiometers.

How it works is one potentiometer is the target while the other is mounted to the ram. The arduino code compares the two, figures out the direction that the ram needs to move to match them up, it then cycles the solenoid valves on and off accordingly. Once the values match, it turns both valves on, more or less locking the ram in place. The target pot can also be replaced with any analog input.

For the rest of the hardware I am using a pair of clippard mouse valves and an arduino UNO. The valves work well, 10ms response time and very low power consumption you need a transistor and diode to hook them up to the Arduino, look up the solenoid tutorial. The ram is a double acting one. Also It works best if you have an adjustable inline flow restrictor on the incoming air stream. It allows you to fine tune the rate of fill so the servo is less twitchy.

The big secret on this was to mount a wheel onto the knob of one potentiometer, this wheel has a string wrapped around it that is tied to the end of the ram. When the ram extends, it pulls the string, spins the pot and tada you now have the rams position. You need a second string with a spring attached to roll the wheel back and keep everything taut. To work out the diameter of the wheel just take your rams stroke and multiply by PI to get your radius. Keep in mind that your pot might not turn 360 degrees, mine was 270 so factor that into your calculations. Best to make it a bit oversize anyway, worst case is that you lose some resolution if its too large, if its too small the ram will destroy the pot or break the string when it runs out of room. In this case the wheel is made of birch plywood, with a groove turned into it on the lathe to guide the string.

Circuit diagram and breadboard:




I drew these up with Fritzing, which is an awesome open source electrical diagram program. (I have no connections to the project, just a happy downloader)

Pneumatic servo Arduino code:



8 comments:

Keith from Canada said...

If you want to increase both accuracy and precision, try swapping out your pots for Hall effect sensors.

Dave Newton said...

(+1 for Hall effect sensors, also just blogged about recently.)

I'm wondering where you got the piston, and what you're using as an air source--I need essentially the same thing.

superUnknown said...

Well done! This is one of the ways we feed back HYDRAULIC cylinder position on underground mining jumbos. Not super acurate, but very simple and robust.

Even simpler (fewer parts) is to use a flow meter to measure the volume of fluid in the cylinder. Tougher for air, but do-able.

Thanks for sharing!

KeithFromCanada said...

Here's another high-precision option.

greg lavoie said...

hey david if you didn't already know instructables is having a Arduino competition on right now might be worth looking in to:
http://www.instructables.com/contest/arduino2012/

Unknown said...

This is great , how about 3 pneumatic servos , how can would you control that , i'm trying to build a pneumatic arm, and i think this can work for me , can you give me an idea for it, thanks a lot.
(sorry for my english)
eg.154145@gmail.com

LSG Industrial & Office Products, Inc. said...

Great Work David! I wonder how did you make it? If you are looking or cylinders, valves and actuators visit us at Pneumatics Philippines

Unknown said...
This comment has been removed by the author.