01-30-2013 04:23 PM
Thank you again for spending so much time on my post and please forgive my ignorance.
The reason I first come up with PID is because we have a control system and the value which is pH has to be adjusted to a set point value, PID is the only thing we learn in college, to be honest, just one semester course and I am ME student, not EE....
So Mr. nathand, in our case, what knd of VI do you suggest us to start with? If PID and PWM is not suitable for us, how should we control the pH within 24hrs?
Best,
Yi
01-30-2013 04:52 PM
If you said "PID" because it's the only thing you were taught in college but you don't really understand how it works, then it won't be of much use to you.
I am confused about some parts of your project. You wrote that the valve will be open only for 5 seconds once per hour. There's not much to control there. Will you vary the length of time that the valve is open, or will it always be 5 seconds? How often do you take a pH reading? Does it matter what the pH is, or do you only care that it's acid, neutral, or basic? It sounds like your control is as simple as evaluating the acidity. If it's acid, open the base valve for 5 seconds, then measure again an hour later. If it's basic, open the acid valve instead. Is that correct? If that's all you're doing, there's no need for a more complicated control algorithm.
01-30-2013 05:04 PM - edited 01-30-2013 05:06 PM
Thank you Mr. nathand,
Here is the detailed info about this project if you have time to take a look and offer some suggestion. Sorry for not posting out at the beginning...
That 5 seconds is actually our estimation, not a final decision. the time for opening valves have to be tested experimentally.
The system will consist of a tank of 25 gallons of an electrolyte that is normally a natural solution. You will be required to pump a small quantity of the electrolyte from the tank on a continuous basis and periodically monitory the chemistry of the electrolyte. The continuous pumping should be at a rate of about one pint per hour. The electrolyte chemistry must be checked every 24 hours and corrected if necessary. If a correction is required to the chemistry the correcting reagent should be metered out over a period of several hours to give the correction time to mix into the system before the next measurement is taken.
The system must be able to self calibrate for at least 10 years and have a working life of 10 years. The correcting reagent should last at least 10 years. The volume taken up by the whole monitoring system should be no greater than 19” X 23” X 4”.
The following items must be measured:
Based upon these requirements you will need to pick the appropriate reagents.
We will add more details as we develop the problem.
01-30-2013 05:16 PM
This is an interesting problem, particularly for a ME - I would have expected this as a ChemE problem.
In any case, you know the volume of the tank, so from the pH measurement you can calculate how much acid or base needs to be added to achieve the desired pH level. You will know the concentration of your acid and base solutions (at least I hope so), so you can calculate what volume needs to be added. I assume you will also measure the flow rate from the valve. With this information you should be able to add the correct amount of acid or base, and you just need to figure out how to do that slowly.
01-30-2013 05:30 PM - edited 01-30-2013 05:34 PM
Thank you Mr. nathand.
Here is another problem. Yes, calculate the desired amount of reagents(HCL, NH3) to be dispensed to the system is what we thought of at the beginning; the problem is the company doesnt give us any info about the flowing fluid of the battery because they said it's under NDA. It's hard to guess if the fluid is a buffer like human blood whose pH cannot be easily changed even you drink 500mL juice whose pH is 2
We take this project just for senior design for college.
For the flow rate, we proposed to buy a pump which offers a extremely slow flow rate. So we just assume the flow rate is guaranteed by the pump and we dont put it into our control system.
For the VI code, what's your suggestion? Suppose, for example, the 24hr measuring moment arrives and the pH is 8, now the DAQ detects it and asks HCL valve to open for 5 seconds for example and shut off.......now, wait for several hours(according to the requirements) and the new pH is 7.5, this time, the DAQ detects it and still ask the valves to open 5 seconds?
So, should we build a VI which can turn on valves for a certain amount of time based on measured pH? like:
pH=8, valve on for 5 secons
pH=7.8, valve on for 4 seconds
pH=7.6 valve on for 2 seconds and so on...
I very appreciate your time for looking into my case.
Best,
Yi
01-30-2013 05:40 PM
I can't tell you what to do here - it's your project, and in any case I don't know. I do think you can make some guess over time at how much acid or base to add to effect a certain change in pH, by tracking the history in your software. So if one day you read a pH of 6 and you add 10mL of base to raise the pH and the next measurement you read a pH of 8, then the next time you read a pH of 6 you can use that historical data to determine that you should add less base. I do think you want to use proportional control - the amount of acid or base that you add should be related to how far the pH is from the desired value.
01-30-2013 05:54 PM - edited 01-30-2013 06:02 PM
Thanks Mr. nathand,
So labview PID module can help us? (just set I and D gain to 0?)
Just for the final hint:)
The input is analog voltage from pH probe, the output is digital which control how long a valve has to be opened.
How do we correlate their relationship? controlling the time as you mentioned previously? If so, what kind of algorithm?
Or any outside reading sources, video, references will be helpful
Best,
Yi
01-30-2013 06:07 PM
@godpaul wrote:
So labview PID module can help us? (just set I and D gain to 0?)
I wouldn't bother with the PID toolkit for proportional control only. It's only subtraction and multiplication.
@godpaul wrote:
The input is analog voltage from pH probe, the output is digital which control how long a valve has to be opened.
How do we correlate their relationship? controlling the time as you mentioned previously? If so, what kind of algorithm?
I don't understand the question. The output of what? The output of a proportional controller is a number. It's up to you to determine what that number means, based on your gain. Ideally you would either conduct some experiments to determine the relationship between the pH and the amount of acid or base added or determine it through knowledge of the chemistry, but if neither option is available then you'll have to start with some reasonable guess (for example assume it's not a buffer) and then make your algorithm smart enough to compensate as it takes more measurements.
01-30-2013 06:28 PM
Ok Mr. nathand, Thank you for your sugestion. I will try and hopefully to get something and let you take a look at it.
Best,
Yi
01-30-2013 06:32 PM
Yi,
nathand has given you some good advice. I recommend that before you try to write any more code or consider any equipment, that you run some calculations. You have the total volume, the types of reagents, and some constraints on reagent flow. Using pencil and paper, start with a tank pH of 6.5. Calculate how much reagent will be necessary to bring that back to 7.0. Then calculate what your pH readings woudl be at various timse after you start adding the reagent assuming different mixing rates. This is something that any engineering student should be able to do because it only involves volumes and ratea and not the chemistry. Repeat for other starting values and perhaps other reagent flow rates.
After you have some numbers, then you can plan your apparatus and program.
Lynn
Master's degree and 40 years of experience, including teaching senior projects.