Need help to realize ratio control in codesys - i am new to codesys
I am having an application where I need to simultaneously control 4 additives injection into a stream of hydrocarbon based on analyzer output how can I realize this. For example, if analyzer output is 40% then 25% of additive 1, 30% of additive 2, 20% of additive 3 and 25% of additive 4 needed to be added into the mainstream. The injection percentage of each additive can change based on analyzer output thus dosing percentage should be dynamic.
Voted best answer
You have 2 separate problems to deal with here ....
The easy part is the ratio .....
The easy part is the ratio .....
- You Just multiple the controller Output by the various Ratio's that you are trying to achieve. Your example isn't clear but Im Guessing that the Total Additives must be (100%) * The Analyzer Output of 40% * The Mainstream Flow. So its just (0.4 * 0.25 * Target Mainstream Flow) for Additive 1 etc. Its just simple arithmetic.
- **DO NOT** multiply the Ratio by the Actual Mainstream Flow You are dosing into - Use the SETPOINT of the mainstream flow. If you use the "MV" then your additive amounts will react to noise in the measurement of the mainstream flow. Use the SP because this will be stable. For a properly controlled loop, the SP = MV without process noise. Only if you have no setpoint should you use the *FILTERED* measurement. Filtering must be sufficient to remove all noise from the signal and will likely be several seconds ( But beware of anything with a filter time of more than 5 or 10 seconds, it is probably hiding other much more serious problems like faulty instrument installations or very badly tuned PID loops. )
- Is the Anlayzer *also* a controller ? Good, no problem. The problem of deadtime is handled by the control algorithm in the Analyzer. Just calculate the ratios.
- Is the Analyzer just a Measurement ? Does the "Controller" live in your PLC ? - Now you have a problem because you have to deal with the deadtime - which with analysers is typically very long and also very variable because you have a very slow sample rate. And you must *only* make a Additive rate change *once* after each analyzer result and wait for the next analyzer result before you make the next change. PID Controllers typically do not work well in this case - even if they are tuned for long deadtimes - because you do not have a continuous measurement. A better approach is to use a "P-Only" Controller that executes once , each time you get a new sample. (That's a complicated way of saying Output = P * (Measurement - SP))
Add new comment