Today I worked with Andy on the next big step of the project, which is correlating our motor-controlled valve with actual air flow rates. In other words, when controlling the motor, we need to move up one rung on the ladder of abstraction, so that instead of just controlling the motor’s position or the number of steps it takes, we need to be able to specify parameters like a desired “flow rate” and a “time duration” and have the motor take care of the rest, via software that we create for this purpose.
However, the meat of our experiment will probably not be in adjusting flow rate and time duration. We already know these variables are likely to be set at 70 Liters/minute sustained for 4 seconds. The interesting stuff is going to happen when we start to control the speed and acceleration of the motor, like how long it should take to ramp-up to the desired flow rate (i.e. how fast the valve is opening), and how fast the motor should be turning at each moment during the ramp-up (i.e. the acceleration “curve” of the ramp-up). Andy has already given us some acceleration curves to investigate, namely linear, logarithmic, sigmoid, and step.
This can be accomplished in several ways, some more sophisticated than others. We have a digital flow meter at our disposal (TSI 4000 Series, Model 4043 E) with an 8-pin output plug designed to be connected to a computer. See photos below.
- One option would be to use absolute measurements. We take measurements to correlate how far the motor has turned with how fast the air is flowing, and then build equations from that to control the motor, i.e. X steps = Y L/min.
- Another option would a system of real-time feedback, where the software is monitoring the flow rate in real-time and adjusting the motor accordingly in order to achieve the desired parameters. This solution is obviously superior in an ideal world, but we might discover that uncontrollable factors like lag-time between readings make it impractical.
I believe we are going to try the real-time option first and see how it performs. The work we did today was related to this. We do not have the required cable to connect the flow meter to a computer, but Andy pointed out that a better solution might be to connect the flow meter directly to the Arduino. We would connect the two analog pins in the flow meter’s 8-pin plug (pins 3 and 4, named AnalogOutput[+] and AnalogGround[-] respectively) to the analog-input pins on the Arduino.
The AnalogOutput[+] pin on the flow meter produces a voltage that varies directly with the flow rate, and we were able to determine with a multimeter that the voltage varies approximately 0.5V every 10 L/min. Ex: 0V=0L/m, 0.5V=10L/m, 1.0V=20L/m, 1.5V=30L/m, 2.0V=40L/m, etc.
So the presumed equation for converting voltage to flow rate is: F = 20(V), where F is flow rate in L/m, and V is voltage.
The next step is to actually connect the analog pins of the flow meter to the Arduino, and then use the Arduino to measure the voltage at each flow rate and compare the results with that of the multimeter.