Need help to realize ratio control in codesys - i am new to codesys
Voted best answer
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))