In the graphic below, please note the 5-ported, 2 position valve schematic at the top of the drawing. It has one of its two cylinder port lines plumbed each into the top of the oil tanks, marked as A & B on the drawing.
Here is more information on 5-ported, 2 position air valves in case you need more information on them.
Each oil tank has a line plumbed to supply oil from the tank to one of the ports on the cylinder at the bottom of the drawing. Each of those lines has a flow control in it.
The air over oil system will use compressed air under pressure introduced into the air tanks via the 5/2 air valve to pressurize and drive oil into a cylinder port and then into the cylinder.
Oil is not compressible. The flow controls in the lines to the cylinder will meter the oil as it exits each cylinder port, ensuring a smooth, consistent stroke every cycle, regardless of the normal fluctuations in the compressed air supply.
Check with the air cylinder vendor to ensure that their cylinder can be used in an air-oil application. Most can. The pressures generated in an air/oil system are usually well within the safety factors for typical pneumatic cylinders.
You can use a hydraulic cylinder of course, but if the pneumatic cylinder works, it will be less costly than an equivalent hydraulic cylinder.
Each of the oil tanks must contain enough oil to fill the cylinder during a complete stroke (an extension or retraction) without completely emptying the tank.
The air valve is connected to the air/oil tanks, one working port to each tank.
The air lines are connected from the valve port to the fitting on the top of each air / oil tank.
The compressed air fills the top of the air / oil pressure tank, and then exerts force on the oil in that tank.
That oil then flows through the line to the cylinder port, causing the cylinder rod or carriage to extend or retract depending on which port it flows to.
The flow controls, one installed on each of the cylinder lines, will operate by restricting the flow of oil out of the cylinder, thereby dampening the flow of the oil resulting in a smooth, consistent stroking of the cylinder rod.
When the air valve is shifted in the other direction, the air flows down the other valve line to the other air / oil tank, and the cycle repeats.
Each time the valve shifts, the oil being driven into the cylinder from one tank pushes the cylinder piston towards the other end of the cylinder, and that piston drives the oil on the other side back up the line to the other air / oil tank.
A properly installed air over oil system as described will provide the cylinder stroke speed and consistency that you desire for your application.
Depending on the cylinder cycle speed, each time the valve shifts, a minute amount of oil may exhaust with the air. A re-classifier should be plumbed to the valve's exhaust port(s). This device will strip the exhaust air of oil for re-use or disposal.
Trying to drive an air - oil system at too high a speed could cause the oil to boil in the tank generating a significant amount of air bubbles in the oil, which will affect the systems control of cylinder speed and stroke time. It's best to run the circuit at the slowest effective and acceptable speed for the application.