EnviroSim is pleased to announce the latest issue of “The BioWin Advantage” e-tech newsletter 11.1 : Using BioWin Controller for Time-based Aeration Control.
Introduction
This BioWin Advantage serves as a “how to” guide when creating complex user defined control strategies. A number of tools such as timers and counters are demonstrated; these should be useful to users wanting to develop their own controllers. It does not make a comparison between the efficacy of each control strategy discussed and does not seek to establish the superiority of any one control strategy.
Many wastewater treatment plants (WWTPs) use time-based aeration control strategies to reduce operating costs associated with diffused aeration while remaining in compliance with treatment performance requirements. In this issue of BioWin Advantage we explore several time-based aeration control strategies using BioWin Controller, including:
- Time-based ammonia control:
Fixed DO setpoint and ammonia limit with minimum and maximum aerated and unaerated periods.
- Stepped ammonia control using timed blower cycles:
Fixed DO setpoint and floating ammonia limit with minimum and maximum aerated and unaerated periods during each blower cycle.
- Ammonia and NOX control:
Fixed DO setpoint, turning aeration on / off based on fixed effluent ammonia and NOX concentrations.
- Smart ammonia and NOX control:
Floating DO setpoint, turning aeration on / off based on floating reactor ammonia and nitrate concentrations.
We will implement each of the above control strategies in a BioWin plant model and evaluate the blower requirements and treatment performance associated with each strategy.
The BioWin model “Nitrification CSTR.bwc” will be used in each example. This model represents a simple activated sludge (AS) treatment process that receives typical North-American medium-strength municipal wastewater. Aeration is provided to a single continuous stirred-tank reactor (CSTR). A sufficient amount of variability is included in the influent flows and loads to provide a strong controller response. The process flowsheet is shown below.
Some pertinent design features of the system are listed in the table below.
In each of the controller examples above we will make use of user-defined constants, variables, and controllers. Before we discuss each control strategy and describe how to implement it using BioWin Controller, we will describe some important control concepts about using Dummy Variables that are not described in the Controller Help manual. The Controller Help manual provides essential background to this article and may be accessed under Help > Contents & Index.
Using Dummy Variables
Using Dummy Variables to Record Time
Let’s explore how to use a dummy variable to keep track of the amount of time that has passed in a dynamic simulation.
- Open the file “Nitrification CSTR.bwc” and launch BioWin Controller. Click Add under the Controller list. Enter the desired name for your controller (g. Time Keeper) and click OK.
- Select the User Defined Controller option as your Controller Type. Then click Select manipulated variable… to bring up the Select Manipulated Variable
- In the Select Manipulated Variable popup window, click Add to add a user defined variable and name it Time. Click OK. (An alternative way to add a User defined variable is via Project | Variables, as explained in the Controller Help manual).
- In the Define Variable window, the new Time variable should appear highlighted blue in the Variables list on the left. Check the box next to Dummy variable. Dummy variables can be used to store the manipulated variable of a controller. Add some text in Notes to describe this variable. Click Close.
- In the Select Manipulated Variable window, select the newly added user defined Time variable at the bottom of the window so that it is highlighted blue. Click OK.
- Define the function that will be used to keep track of the amount of time that has passed in the dynamic simulation. Right-click in the white space of the text box under Controller formula. From the pop-up window left-click Variable to open the Variable Selection Left-click on the Time variable in the User defined variables section. Click OK.
- In the Controller formula text box, [User defined variable.Time] should appear. Next, enter + by right-clicking in the text box, selecting Operator and then +. Right-click again in the Controller formula text box and select Enter number 1 and click OK. The time keeping function is now complete. The value of the Dummy Variable Time will be increased by a value of 1 each time a control interval passes.
- The next step is to define the units of the dummy variable Time. To record the amount of time in minutes, the Control interval must be set to 1 minute(s). The Dummy Variable Time will start at zero at the beginning of a new dynamic simulation and then increase by 1 minute as each control interval passes. Similarly, to record the amount of time passed in hours, set the Control interval to 1 hour(s). Check the box next to Unlimited upper bound.
- Let’s test the Time Keeper Open Controller Explorer by clicking on the Explorer icon (shown by the arrow in Figure 12, below) on the toolbar or going to View | Explorer. Expand the Time Keeper tree and click States. The Controller output currently has a value of 0.00. Close Explorer.
- Run a 1-day dynamic simulation in BioWin while keeping BW Controller open. Open Explorer in BW Controller and drill down to Time Keeper | States. The Controller output now shows a value of 1440 (minutes), or one day. This confirms that we’ve set up the Time Keeper controller correctly. This Time variable may also be used in the control logic of other controllers that you create. Save this Controller file as “Time Keeping.bcf”.
Using Dummy Variables to Define and Record a Cycle time
Let’s explore how to use a dummy variable to keep track of the time that has passed within a defined cycle recurring in a dynamic simulation.
- Open the file “Nitrification CSTR.bwc” and launch BioWin Controller. Set up the same Time Dummy variable as described in the previous section with a control interval of 1 minute. Next, create a constant called t_cycle by clicking Add in the Constants grouping (shown in Figure 14, below) or by going to Project | Constants. Click OK to close the Constant Name window. In this example, we will use a cycle time of 60 minutes. In the Define Constant window, type “60” under Value and add a note to define t_cycle [g. Cycle time (minutes)].
- Next, create a User Defined Controller called Time Keeper with the controller formula shown in the image below. The controller formula uses an “If” statement which is created by right-clicking in the Controller formula text box and selecting Function… from the pop-up window. Further information on using Functions is provided in the Controller Help manual. This formula states that if Time is greater than or equal to the defined cycle time minus 1 (e. t_cycle – 1), then Time will be reset to 0; otherwise Time will be incremented by 1 as each control interval passes. Therefore, Time will start at 0 at the beginning of each cycle and increase to a value of t_cycle – 1 (i.e. 59) at the start of the last control interval of each cycle.
- Let’s test the Time Keeper Run a 30-minute dynamic simulation in BioWin while keeping BW Controller open. In the Dynamic simulation window, simulate from project start date (e.g. 07 Jan 2013 00:00) until 07 Jan 2013 00:30. Keep the simulation paused. Open Controller Explorer to view the state value of the Time Keeper controller (e.g. 30 minutes). Next, continue the dynamic simulation until 07 Jan 2013 01:00). Open Controller Explorer and drill down to view the state value of Time Keeper (e.g. 0 minutes). Time has been reset to zero at the start of the second hour. Save this Controller file as “Cycle Time Keeping.bcf”
Using Dummy Variables to Record Blower Stop-start Cycles
We can also use a Dummy Variable to record the number of times a blower goes from an “on” state to “off” state and vice versa. This may be useful when evaluating the impact of a controller strategy on blower asset health. Consider the scenario outlined below. The number of blowers in service depends on the total aeration demand in the CSTR:
Airflow requirement, Q (m3/d) | Blowers in service |
Q < 10 000 | A, B |
10 000 <= Q < 12 500 | A, B, C |
12 500 <= Q < 15 000 | A, B, C, D |
Q >= 15 000 | A, B, C, D, E |
Before we explain this example, we will provide a brief note about setting up and controlling multiple blowers:
In a BioWin plant model we assign one or more aerated reactors to a blower air supply group. Large full-plant models may have several blower air supply groups servicing groups of aerated reactors. For example, we may have one blower air supply group for the aerobic activated sludge reactors and another blower air supply group for the aerobic digesters. We use blower air supply groups to assess the total aeration demand, power, cost, etc. for each group of aerated elements. A blower air supply group may by serviced by one or more blowers; however, we cannot track the number blowers in service in BioWin. Instead, this is done using BioWin Controller. Our “Nitrification CSTR.bwc” model has only one aerated reactor and hence only one blower air supply group. This blower air supply group is serviced by blowers A, B, C, D and E, and the number of blowers in service depends on the required airflow rate.
- Open the file “Nitrification CSTR.bwc” and launch BioWin Controller. Blowers A and B are always in service whereas blowers C, D and E are sometimes in service. To track the number of times blowers C, D and E go in and out of service, we will use 6 Dummy variables. Each of these three blowers will have a variable tracking “off” to “on” and a variable tracking “on” to “off”. Go to Project | Variables and click Add to add the Dummy variables C_OnCount and C_OffCount to represent the number of times blower C turns on and off, respectively. Do the same for the remaining blowers (D and E), as shown in the figure below. Click Close to close the Define Variable window.
- In the BioWin Controller window add a PI Controller and name it Blower Controller. Configure the controller input/output and parameters as shown in Figure 19, below. We assume the blowers may deliver any airflow rate between 2,500 and 17,500 m3/h; airflow rate changes are not constrained to predefined steps.
- Next, add a User defined controller called C_OnCounter. Select the Dummy variable C_OnCount as the manipulated variable. Right-click in the empty Controller formula text box, select Function… and then select the If function from the Functions Under the Parameters group, select IfTrue. In the Definition – IfTrue text box input [User defined variable.C_OnCount]+1. The [User defined variable.C_OnCount] is input by right-clicking in the text box, selecting Variable…, and then from the Select Variable window selecting the User Defined Variable C_OnCount.
- Select the IfFalse parameter and under the Definition – IfFalse text box input [User defined variable.C_OnCount]. We will create the definition for the condition parameter Cond in the next step using a delay function. Click OK. The partially-complete C_OnCounter Controller formula should appear as shown in the figure below.
- In the C_OnCounter controller formula, move the cursor to the “condition” position after “If(“. Then, right-click in the white space in the Controller formula text box, select Function… and select the Delay function from the Functions Select the Variable parameter under the Parameters group. Right-click in the Definition – Variable text box and select Variable…. In the Select Variable window under Elements and controllers select CSTR. Under Variable type at the top of this window select Element specific, then under Variables select Air flow rate, as shown in the figure below. Click OK.
- In the Create Function window under the Parameters group, select Control Interval (minutes). Enter “5” in the Definition – Control Interval (minutes) text box. In the Parameters group select Delay (# of Control Intervals) and in the Definition – Delay (# of Control Intervals) text box enter “1”. Click OK. The purpose of the Delay function is to retrieve the value of the CSTR airflow rate specified at x control intervals in the past, where x is an integer. More information on the Delay function can be found in the BioWin Controller User Manual.
- Figure 22, below, shows the completed formula for the C_OnCount Finish defining the condition of the “if” statement as shown in Figure 22 using Variables, Operators and Numbers as appropriate. Set the Control interval to the same control interval used by the Blower Controller defined earlier. The C_OnCount controller will first check if the CSTR air flow rate from 5 minutes ago was less than 10,000 m3/h and the current CSTR air flow rate is greater than or equal to 10,000 m3/h. If so, this implies that blower C would have gone from an “Off” state to an “On” state, so the value of is increased by 1. If not, the value of C_OnCount remains unchanged.
- Repeat steps 3 to 7 to create the remaining controllers described in the table, below. Save this controller file as “Blower Cycles.bcf”.
- Let’s observe this controller in action. Minimize (but do not close) BW Controller, open the BioWin Album (ctrl+A) and go to tab “DO Airflow NH3”. Three colour bands have been set up to represent ranges in required total airflow in the CSTR. Blower C will come online when the required airflow rate exceeds 10,000 m3/h, Blower D when it exceeds 12,500 m3/h, and Blower E when it exceeds 15,000 m3/h. The maximum airflow rate is 17,500 m3/h.
- In BioWin set the data interval to 5 minutes. Run a steady-state simulation from seed, followed by a 1-day dynamic simulation from project start date from current values. This will produce the plot shown in Figure 23, below. BioWin calculated a steady-state airflow rate of 13,849 m3/h to achieve specified DO setpoint of 2 mgO2/L in the CSTR. When the dynamic simulation is started from current values, the PI type Blower Controller measures the DO concentration in the CSTR and manipulates the airflow rate to maintain a DO setpoint of 2 mgO2/L in the CSTR. During the first control interval of the dynamic simulation the calculated airflow rate to achieve a DO setpoint of 2 mgO2/L was 86,250m3/h. This is far greater than the steady-state airflow rate; the reason being that over the first several minutes the airflow rate varies widely as the Blower Controller hunts for the required airflow rate to satisfy the new aeration requirements.
- Open BW Controller Explorer to view the current state of any of the OnCounter or OffCounter Over the 1-day dynamic simulation Blower E went offline 3 times, as indicated by the arrows in Figure 23 (above), hence the state value of E_OffCounter is 3.
Time-based Ammonia Control
Let’s explore how to use BioWin Controller to manipulate the airflow rate based on the aeration time and the ammonia concentration in the reactor.
In this example aeration must be turned on when the ammonia concentration in the CSTR is greater than or equal to 4 mgN/L and must be turned off when it is less than 4 mgN/L. In addition, unaerated periods must be at least 50 minutes but must not exceed 80 minutes. Aerated periods must be at least 90 minutes but must not exceed 120 minutes. For example, if the ammonia concentration drops below 4 mg/L, aeration can only stop once the reactor has been aerated for 90 minutes (i.e. minimum aeration time).
Open the file “Nitrification CSTR.bwc” and launch BioWin Controller. Open the controller file “Time-based NH3 Control.bcf". Let’s explore this controller file that has already been set up for us. This .bcf file uses three user-defined controllers and one PI controller. Two of the user-defined controllers, Air On Timer and Air Off Timer, will define the respective aerated and unaerated time periods using Dummy Variables. The third user-defined controller, Ammonia FB controller, controls the Upper Bound of the PI type controller, Blower Controller. The Blower Controller is the same as in the previous section (Using Dummy Variables to Record Blower Stop-start Cycles).
Let’s first explore the Air On Timer controller. The controller formula is shown in Figure 25, below. The “if” statement is structured “if A and B or C and D then value if true, otherwise value if false”:
A: Unaerated time that has passed is equal to zero (t_airOff = 0). The unaerated phase has yet to begin thus we are still in the aerated phase.
AND
B: The amount of time that aeration has been on (t_airOn) is less than the minimum aerated period (t_airOnMin),
OR
C: The ammonia concentration in the CSTR [CSTR.N – NH3] is greater than or equal to 4 mgN/L)
AND
D: The amount of time that aeration has been on (t_airOn) is less than the maximum aerated period (t_airOnMax).
If we are in an aerated phase and conditions A and B or C and D are met, aeration will continue for another control interval (i.e. another minute). If we are in an aerated phase and neither condition A and B nor C and D are met, the aerated phase will end (i.e. the value of t_airOn will be set to zero).
The Air Off Timer controller formula is structured similar to that of Air On Timer. The controller formula of Air Off Timer is shown in Figure 26, below. The “if” statement is structured “if E and F or G and H then value if true, otherwise value if false”:
E: Aerated time that has passed is equal to zero (t_airOn = 0). The aerated phase has yet to begin thus we are still in the unaerated phase.
AND
F: The amount of time that aeration has been off (t_airOff) is less than the minimum unaerated period (t_airOffMin),
OR
G: The ammonia concentration in the CSTR [CSTR.N – NH3] is less than 4 mgN/L)
AND
H: The amount of time that aeration has been off (t_airOff) is less than the maximum unaerated period (t_airOffMax).
If we are in an unaerated phase and conditions E and F or G and H are met, aeration will remain off for another control interval (i.e. another minute). If we are in an unaerated phase and neither condition A and B nor C and D are met, aeration will turn on (i.e. the value of t_airOff will be set to zero).
The PI type Blower controller is shown in Figure 27, below. It is the same as the Blower Controller presented in the previous section except that it has a lower bound of 0 and upper bound of 50,000 m3/h. We assume the blowers may deliver any airflow rate between 0 and 50,000 m3/h; airflow rate changes are not constrained to predefined steps.
The user-defined Ammonia FB controller is shown in Figure 28, below. If the current aeration time (t_airOn) is greater than zero, the Blower controller Upper Bound is set at 50,000 m3/h, otherwise the Upper Bound of the Blower controller will be set to zero. When t_airOn is greater than zero, we are in an aerated period. When t_airOn equals zero we are in an unaerated period and the airflow is kept off by setting the airflow rate Upper bound to zero.
We set the Ammonia FB controller to manipulate the Blower controller Upper bound instead of the Blower controller DO setpoint. As we will discuss in the next example, setting the Blower controller DO setpoint to zero does not mean the airflow rate will immediately become zero. The Blower controller must manipulate the airflow rate to achieve the specified DO setpoint of zero imposed by the Ammonia FB controller. This takes time and will depend on the dynamic oxygen demand as well as the Blower Controller parameters (proportional gain, reset time, etc.).
To test the performance of this controller we ran a steady-state simulation from seed, followed by a 1-day dynamic simulation from project start date from current values. The predicted DO concentration, airflow rate and ammonia concentration in the CSTR are plotted in Figure 29, below. An analysis of the plots confirms that the control strategy is being obeyed; the aerated and unaerated periods remain within the defined minimum and maximum durations and aeration turns on when the ammonia concentration increases to 4 mgN/L. At the start of each aerated period, it takes some time before the DO concentration reaches the Blower controller setpoint of 2 mgO2/L.
A further improvement to this controller could also be made by adding controllers that keep track of the number of stop-start cycles experienced during the operation of the blower(s), as is described in the preceding section (Using Dummy Variables to Record Blower Stop-Start Cycles). This would allow us to assess the impact of this control strategy and its controller parameters on blower asset health.
The dynamic simulation was then run from last steady-state from project start date for 90-days, (i.e. the duration of the variable influent itinerary). The DO concentration, airflow rate and ammonia concentration in the CSTR are plotted in Figure 30, below. The DO concentration often exceeds the Blower controller setpoint of 2 mgO2/L. The airflow rate regularly increases to around 35,000 m3/h and occasionally exceeds 40,000 m3/h.
The effluent ammonia and NOX concentrations are plotted in Figure 31, below. The effluent ammonia and NOX concentrations were around 2 mgN/L and 3 mgN/L, respectively. In mid-February the effluent ammonia and NOX concentrations increased above 4 mgN/L and 18 mgN/L, respectively. These effluent spikes correspond to the time when a relatively high influent TKN load passed through the plant.
Stepped Ammonia Control Using Timed Blower Cycles and Upper Bound Airflows
Let’s explore how to use BioWin Controller to manipulate aeration based on blower cycle times and the reactor ammonia concentration.
In this example the maximum airflow rate is set at 25,000 m3/h if the ammonia concentration in the CSTR is at least 3.5 mgN/L. The maximum airflow rate is set at 17,500 m3/h if the ammonia concentration is between 2 and 3.5 mgN/L. Aeration is turned off if the ammonia concentration is less than 2 mgN/L. Furthermore, this controller includes blower cycle times with minimum and maximum aerated and unaerated periods to support nitrification and denitrification, respectively. Within each 60-minute blower cycle the CSTR must be aerated for a minimum of 10 minutes and a maximum of 50 minutes and unaerated for a minimum of 10 minutes.
Open the file “Nitrification CSTR.bwc” and launch BioWin Controller. Open the controller file “Stepped NH3 Control Using Timed Blower Cycles and Upper Bound Airflow.bcf”. Let’s explore this controller file that has already been set up for us.
The user-defined constant t_cycle represents one blower cycle, i.e. 60 minutes. The user-defined dummy variable Time keeps track of the time. Constant t_cycle and variable Time are used by the user-defined controller Time Keeper. The controller formula shown in Figure 32 (below) states that Time will be increased by 1 control interval (i.e. 1 minute) as long as the current value of Time is less than t_cycle – 1 (i.e. 59 minutes). When Time reaches 59 minutes, it will be reset to zero on the next control interval.
The next controller in the Controller list is the PI type controller, Blower Controller, that adjusts the airflow rate to achieve the desired DO setpoint in the CSTR. This Blower Controller is the same as that presented in Figure 27 in the previous section except that it uses a reset time of 5 minutes instead of 1 minute.
The user-defined controllers Air On Timer and Air Off Timer set the respective aerated and unaerated time periods within a blower cycle. We assume that we are in an unaerated period when the Blower Controller upper bound is zero, and we are in an aerated period when the Blower Controller upper bound is greater than zero.
Controller Air On Timer uses dummy variable t_AirOn to keep track of the aerated time. The control formula shown in Figure 33, below, states that when Time reaches t_cycle -1 (i.e. 59 minutes), t_AirOn must be reset to zero (i.e. the aeration period must end) on the next control interval. When Time is less than 59 minutes, if the Blower Controller upper bound is greater than zero, t_AirOn must increase by 1 control interval (i.e. 1 minute), else t_AirOn must remain at its current value (i.e. the aeration period ends and the unaerated period begins within the same blower cycle).
Controller Air Off Timer uses dummy variable t_AirOff to keep track of the unaerated time. The control formula shown in Figure 34, below, states that when Time reaches t_cycle -1 (i.e. 59 minutes), t_AirOff must be reset to zero (i.e. the unaerated period must end) on the next control interval. When Time is less than 59 minutes, if the Blower Controller upper bound equals zero, t_AirOff must increase by 1 control interval (i.e. 1 minute), else t_AirOff must remain at its current value (i.e. the unaerated period ends and the aerated period begins within the same blower cycle).
Lastly, let’s review the user-defined controller Ammonia FB Controller which manipulates the upper bound of Blower Controller, as shown in Figure 35, below. The controller formula is rather complex so we will break it into several parts.
The condition of the opening “if” statement checks whether the current aerated time is less than the maximum 50 minutes or greater than the minimum 10 minutes. If either of these conditions are satisfied, another conditional “if” statement is entered. If neither of these conditions are satisfied (i.e. current aerated time has reached the maximum of 50 minutes and the current unaerated time is less than 10 minutes), set the Blower Controller airflow rate upper bound to zero.
If(([User defined variable.t_AirOn]<50) or ([User defined variable.t_AirOff]>10),<if True>,0)
The “<if True>” portion of the opening “if” statement (above) contains a conditional “if” statement, stating that if the current ammonia concentration in the CSTR is at least 3.5 mgN/L, set the Blower Controller airflow rate upper bound to 25,000 m3/h:
If([CSTR.N – NH3]>=3.5,25000,
If the current ammonia concentration in the CSTR is less than 3.5 mgN/L but greater than 2 mgN/L or the aerated time is less than 10 minutes, then set the Blower Controller airflow rate upper bound to 17,500 m3/h. Otherwise, if the current ammonia concentration in the CSTR is less than 2 mgN/L and the current aerated time is greater than the minimum aerated time of 10 minutes, set the Blower Controller airflow rate upper bound to zero (i.e. turn off aeration).
If(([CSTR.N - NH3]>=2) or ([User defined variable.t_AirOn]<10),17500,0)
To apply an airflow rate upper bound greater than zero within the current blower cycle, the total aerated time must be less than 50 minutes or the total unaerated time must be greater than 10 minutes. We use or instead of and in the first “if” statement because it is not possible for the total aerated time to be less than 50 minutes and the total unaerated time to be greater than 10 minutes at every control interval. For instance, at the start of a blower cycle t_AirOff>10 is false whilst t_AirOn<50 is true. After ten control intervals t_AirOff>10 may be true or false while t_AirOn<50 is remains true.
The “Nitrification CSTR.bwc” model was simulated at steady-state. The “Stepped NH3 Control Using Timed Blower Cycles and Upper Bound Airflow.bcf” was then applied and the model was dynamically simulated for 1 day from last steady-state. The time-series plots of DO Concentration, airflow rate and ammonia concentration in the CSTR are presented in Figure 36, below. Aeration is shut off (i.e. airflow rate is zero) at least once an hour, confirming that there is at least one unaerated period during each blower cycle.
A further improvement to this controller would be to add controllers that keep track of the number of stop-start cycles experienced during the operation of the blower(s), as is described in the section “Using Dummy Variables to Record Blower Stop-Start Cycles”. This would allow us to assess the impact of this control strategy and its controller parameters on blower asset health.
Compared to the previous exampling using time-based ammonia control, the blowers are turning on and off more frequently, which may negatively impact blower asset health. However, reducing blower runtime is a key way to save energy and lower operating costs at the plant. In addition, the DO concentration reaches zero at least once an hour, providing opportunity for denitrification within each blower cycle.
The same model was then dynamically simulated with the same control file from last steady-state from project start date for 90 days (i.e. the duration of the variable influent itinerary), as shown below in Figure 37. Although the DO setpoint of the Blower Controller is 2 mgO2/L during aerated periods, the predicted DO concentration is much lower for most of the simulation. The airflow rate upper bound of 17,500 m3/h (applied when the CSTR ammonia concentration is between 2 and 3.5 mgN/L) is preventing the DO from reaching the 2 mgO2/L setpoint. When the ammonia concentration exceeds 3.5 mgN/L, the airflow rate increases to the upper bound 25,000 m3/h, as intended.
Overall the DO concentration in this example is lower than in the previous example, resulting in nitrite accumulation on days when the influent TKN load is high. The overall airflow rate is much lower in this example compared to the previous example using time-based ammonia control. This translates to reduced aeration power and cost.
Figure 38 shows the effluent ammonia and NOX concentrations over the 90-day dynamic simulation using stepped ammonia control with timed blower cycles. The effluent ammonia is roughly 2.5 mgN/L except on 3 days when it exceeds 4 mgN/L. This is similar to the effluent ammonia response in the previous example using time-based ammonia control. The plant denitrifies well as the effluent NOX concentration remains below 1.5 mgN/L except over a few days in mid-February when it spikes to 20 mgN/L. The mid-February effluent NOX spikes are similar in both examples (i.e. 18 mgN/L in previous example and 20 mgN/L in this example). However, in this example the NOX spike consists mainly of Nitrite, whilst the previous example consisted mainly of Nitrate. Apart from this mid-February spike, the effluent NOX concentration in this example is lower than that in the previous example using time-based ammonia control. The overall DO concentration is lower in this example, providing more opportunity for denitrification.
As mentioned previously, we turn off aeration by setting the Blower Controller airflow rate upper bound to zero, instead of the DO setpoint to zero. Setting the Blower controller DO setpoint to zero does not mean the airflow rate will immediately become zero. The Blower controller must manipulate the airflow rate to achieve the specified zero DO setpoint imposed by the Ammonia FB controller. This takes time and will depend on the dynamic oxygen demand as well as the Blower Controller parameters (proportional gain, reset time, etc.).
Below we will show the problematic effects of controlling DO setpoint instead of the airflow rate upper bound of the Blower controller used in the preceding example. If we were to use the same list of controllers (i.e. Time Keeper, Blower controller, Air On Timer, Air Off Timer, Ammonia FB Controller), but instead modified the Blower controller such that a DO setpoint of 2mgO2/L is used if the ammonia concentration in the CSTR is at least 3.5mgN/L. If the ammonia concentration is between 2 and 3.5mgN/L, then aeration must be provided with a DO setpoint defined using the linear relationship K*N + C, where K = 0.75 mg O2/mgNH3-N, C = -0.8 mgO2/L and N is the current ammonia concentration in the CSTR. If the ammonia concentration is less than 2mgN/L, then aeration must be turned off by setting the DO setpoint to zero.
We will also assume that we are in an unaerated period when the Blower Controller DO setpoint is zero, and we are in an aerated period when the Blower Controller DO setpoint is greater than zero.
The time-series plots of DO Concentration, airflow rate and ammonia concentration in the CSTR are presented in Figure 40, below. Neither the DO concentration nor the airflow rate ever reaches zero over the 90-day simulation. Therefore, the CSTR is continuously aerated, which is costly and may result in less denitrification than desired. Although the controller strategy applies a DO setpoint of zero under certain conditions, it is never quite reached.
Ammonia and NOX Control
Let’s explore how to use BioWin Controller to manipulate aeration based on fixed effluent ammonia and NOX concentrations.
In this example we apply a strategy where aeration is turned on when the effluent NOX concentration is less than or equal to 8 mgN/L. If the effluent NOX concentration is greater than 8 mgN/L and the effluent ammonia concentration is less than 1.5 mgN/L then aeration must be turned off, otherwise aeration must remain on.
Open the file “Nitrification CSTR.bwc” and launch BioWin Controller. Open the controller file “NH3 and NOx Control.bcf”. Let’s explore this controller file that has already been set up for us.
This controller file has two controllers, Blower Controller and Ammonia NOX Controller. The PI type Blower Controller manipulates the airflow rate to maintain a DO setpoint of 2 mgO2/L in the CSTR. The controller input/output and parameters are the same as those presented in Figure 26 for the time-based ammonia control example except that the reset time is 5 minutes.
The user-defined Ammonia NOX Controller sets the airflow rate upper bound of the Blower Controller to either zero or 50,000 m3/h. The controller formula is presented in Figure 41.
The “Nitrification CSTR.bwc” model was simulated at steady-state. The “NH3 and NOx Control.bcf” was then applied and the model was dynamically simulated for 1 day from last steady-state. The time-series plots of DO Concentration, airflow rate and ammonia concentration in the CSTR are presented in Figure 42, below. Compared to the previous three control examples, aeration is shut off much less frequently over 1 day. This may be more desirable for maintaining blower asset health. However, the blower runtime is longer in this example compared to the previous two, which translates to a higher aeration energy demand and operating cost for the plant. The DO concentration reaches zero a few times over the day, providing some opportunity for denitrification.
The same model was then dynamically simulated with the same control file from last steady-state from project start date for 90 days (i.e. the duration of the variable influent itinerary), as shown below in Figure 43. During the aerated periods, the predicted DO concentration remains close to the Blower Controller DO setpoint of 2 mgO2/L. Although the airflow rate upper bound is 50,000 m3/h, the predicted airflow rate remains below 27,000 m3/h. The overall airflow rate using this control strategy is higher than the previous example using stepped ammonia control and timed blower cycles, but is lower than the first example using time-based ammonia control.
The effluent ammonia and NOX concentrations are plotted in Figure 44, below. The effluent ammonia varies widely between approximately 0.5 and 6 mgN/L.
Smart Ammonia and NOX Control
Let’s explore how to use BioWin Controller to manipulate aeration based on floating ammonia and nitrate concentrations in the reactor by using a strategy similar to the STAR Control® philosophy proposed by Thornberg et al. (1993).
The strategy is based on two parts:
- On/off aeration with a novel approach for switching; and
- Varying DO setpoint during aerated phases depending on ammonia concentration.
The strategy is to control on/off aeration as illustrated in Figure 45, below. The x-axis represents the reactor nitrate concentration and the y-axis is the reactor ammonia concentration. At any time the current reactor NO3 and NH3 concentration are represented by an operating point in the x-y space. Aeration must turn on when the operating point (intersecting CSTR NO3 and ammonia concentrations) lies on or above the upper (purple) line and aeration turns off when the operating point lies on or below the lower (orange) line. We represent each of these lines using linear relationships, as shown in Figure 45. The aim of the strategy is to keep the operating point between the two lines irrespective of the initial starting point. However, the interesting outcome of the strategy is that the operating point moves towards the lower left; that is, both low ammonia and NO3 concentration.
As an example, assume the initial nitrate and ammonia concentrations are 3 mgN/L and 3.7 mgN/L, respectively, as shown by the operating point (black dot) in Figure 46, below. Aeration is turned on and the CSTR nitrifies, causing the ammonia concentration to decrease while the nitrate concentration increases. This path that the operating point follows is shown by the black line in Figure 46. When the ammonia concentration falls below the orange line (i.e. below about 2.3 mgN/L), aeration is shut off. At this time the nitrate concentration is approximately 8.5 mgN/L. Without any airflow, the DO concentration rapidly decreases and the CSTR denitrifies, lowering the nitrate concentration. The black line shown in Figure 46 pivots toward the left. With no aeration, the ammonia concentration increases as soluble organic nitrogen is ammonified and influent ammonia accumulates. Eventually the operating point crosses back over the purple line (at approximate nitrate and ammonia concentrations of 6 and 2.45 mgN/L, respectively) and aeration is turned on again. These controller actions are repeated until the ammonia concentration settles in at a value between 1 and 1.5 mgN/L and the nitrate concentration decreases to almost zero.
The second part of the control strategy is how the DO setpoint is specified when aeration is on. The DO setpoint is calculated as a function of the reactor ammonia concentration, as shown in Figure 47, below. The DO setpoint is 0.5 mgO2/L when the reactor ammonia concentration is between 0 and 1 mgN/L and 2 mgO2/L when the ammonia concentration exceeds 2.5 mgN/L. As reactor ammonia concentrations increases from 1 to 2.5 mgN/L, the DO setpoint ramps up from 0.5 to 2.0 mg/L. The rationale here is that, when ammonia concentration is higher then the nitrification rate should not be limited by DO. However, if the ammonia concentration is low, then the DO setpoint can be lowered to save on aeration energy input and to increase the potential for SND (simultaneous nitrification-denitrification). If the limitation on nitrification rate causes ammonia concentration to increase, the DO setpoint automatically increases – in essence the approach is self-correcting.
Open the file “Nitrification CSTR.bwc” and launch BioWin Controller. Open the controller file “Smart NH3 and NOx Control.bcf”. Let’s explore this controller file that has already been set up for us.
This controller file has the same PI type Blower Controller as previously shown in Figure 27 for the time-based ammonia control example except that it uses a reset time of 5 minutes.
User-defined constants have been set up to represent the slopes and y-intercepts of the relationships shown in Figures 45 and 47, above. Two user-defined controllers, Air On Crit and Air Off Crit, calculate the ammonia concentrations at which aeration must be turned on and off, respectively, depending on the reactor nitrate concentration. The ammonia concentrations calculated by Air On Crit and Air Off Crit are stored in the respective dummy variables AirOnCrit and AirOffCrit.
The Air On Crit controller uses the relationship shown by the purple line in Figure 45 for “Air On Criteria” to calculate the ammonia concentration at which aeration must be turned on, depending on the reactor nitrate concentration. This controller uses the user-defined constants AerationSlope, AirOffIntercept, and AerationHysterisis. AerationSlope is assigned a value of 0.167, AirOffIntercept a value of 1 mgN/L, and AerationHysterisis a value of 0.5 mgN/L. The AerationHysterisis represents the vertical “distance” between the purple and orange lines in Figure 45.
The Air Off Crit controller uses the relationship shown by the orange line in Figure 45 for “Air Off Criteria” to calculate the ammonia concentration at which aeration must be turned off, depending on the reactor nitrate concentration.
The user-defined DO Controller implements the scheme shown in Figure 47, and calculates the DO setpoint using the function shown in Figure 50, and this DO setpoint is applied in the Blower Controller.
Dummy variable AirOnTripped is used to track when the “Air On Criteria” in Figure 45 is met. The user-defined controller Air On Trip manipulates the dummy variable AirOnTripped. The controller formula shown in Figure 51, below, states that if the reactor ammonia concentration lies above or on the purple line in Figure 45, then aeration must be turned on (i.e. the value of AirOnTripped must be set to 1). If the reactor ammonia concentration lies on or below the orange line in Figure 45, then aeration must be turned off (i.e. the value of AirOnTripped must be set to 0). If neither of these conditions are met (i.e. the reactor ammonia concentration is between the purple and orange lines), then AirOnTripped remains unchanged.
The user-defined Aeration Controller manipulates the Blower Controller airflow rate upper bound. The Aeration Controller formula shown in Figure 52, below, applies airflow rate upper bounds of 50,000 and 0 m3/h when the respective “Air On Criteria” and “Air Off Criteria” shown in Figure 45 are met. It also checks the value of AirOnTripped and applies airflow rate upper bounds of 50,000 and 0 m3/h when AirOnTripped equals 1 and 0, respectively.
In the BioWin album of “Nitrification CSTR.bwc” we have added a General plot to tab “NH3 NO3” graphing the CSTR nitrate and ammonia concentrations on the X and Y axes, respectively. This plot was generated by right-clicking on an empty Album page, clicking Chart…, and then going to the General plot tab, as shown in Figure 53, below. At the top of this window, beside Element name, we selected “CSTR”. Under the State variables list we selected N-Nitrate and then clicked the button Add selected ------->. We then selected N-Ammonia and clicked the button Add selected ------->. We then un-checked the box next to “Current values plot”, selected a point type plot, and the clicked the Plot selected… button.
The “Nitrification CSTR.bwc” model was simulated at steady-state. This implies continuous aeration, so the ammonia concentration is low, the nitrate concentration is high. The “Smart NH3 and NOx Control.bcf” was then applied and the model was dynamically simulated for 1 day from last steady-state. The time-series plots of DO Concentration, airflow rate and ammonia concentration in the CSTR are presented in Figure 54, below. Aeration is turned on and off at least once an hour. However, it only shuts off for a few minutes at a time and is therefore on most of the time. This directly impacts blower power demand and hence plant operating costs. The DO concentration reaches zero at least once per hour. However, it only remains at zero for a few minutes at a time, thereby limiting opportunity for denitrification.
The same model was then dynamically simulated using the ammonia and NOX control strategy, starting from the steady-state solution for 90 days (i.e. the duration of the variable influent itinerary). The time-series plot of CSTR nitrate and ammonia concentrations is provided in Figures 55, 56 and 57, below, showing the controller response and reactor concentrations during the dynamic simulation. In Figures 55 and 56 the operating point is plotted as a scatter plot and time series plot, respectively, over the first day of the 90-day dynamic simulation with the black arrows showing how the reactor changes from its initial state (produced from the steady-state simulation with continuous aeration) where the nitrate concentration is high and the ammonia concentration is low to a state where both the ammonia and nitrate concentrations are low.
From Figure 55 (above) we can see that the controller is operating as intended because most of the (x,y) points representing reactor nitrate and ammonia concentrations remain between the purple “Air On Criteria” and orange “Air Off Criteria” lines superimposed on the plot. Furthermore, the majority of these points lie below respective nitrate and ammonia concentrations of 2.5 and 2.5 mgN/L. It is worth noting that when observing the operating point over the full 90-day simulation there are a several instances where the operating point lies well outside the region between the purple and orange lines. These reactor conditions may arise at the start of the dynamic simulation or when there is a noticeable change in the influent TKN load that causes a dramatic and sudden shift in the reactor nitrate and ammonia concentrations, causing the controller to adjust between two very different model conditions. Figure 57 shows the DO concentration, airflow rate and ammonia concentration in the CSTR over the full 90-day simulation. The predicted DO concentration mostly remains under 1 mgO2/L. Although the airflow rate upper bound is 50,000 m3/h, the predicted airflow rate remains below 25,000 m3/h. The overall airflow rate using this control strategy is similar to the previous example using simple ammonia and NOX control. This controller responds well to variations in influent ammonia loads as the CSTR ammonia concentration remains below 3 mgN/L, except during the mid-February spike.
Figure 58 shows the effluent ammonia and NOX concentrations over the 90-day dynamic simulation. Compared to the other three time-based aeration control strategies, this “smart” control strategy maintains the lowest effluent ammonia concentrations. However, the effluent ammonia peaks to a similar value (around 6 mgN/L) in mid-February when the plant receives the high influent TKN load. Although the effluent NOX remains below 5 mgN/L over most of the 90 days, it spikes above 40 mgN/L over a few days in mid-February. This spike is mostly comprised of nitrite (e.g. 38 mgNO2-N/L and 4 mgNO3-N/L). Of all control examples, this is the highest value of the mid-February effluent NOX spike.
Conclusion
In this edition of the BioWin Advantage we explored and tested four different time-based aeration control strategies using BioWin Controller. The four time-based aeration control strategies varied in complexity from more simple time-based ammonia control to “smart” ammonia and NOX control. Each control strategy successfully reduced aeration requirements while remaining in compliance with treatment performance requirements.
We also demonstrated how to use a controller to monitor changes in state or user-defined variables, such as using controllers to monitor the frequency at which blowers are being turned on and off to determine the impact of a control strategy on blower asset health.
We trust that you found this technical topic both interesting and informative. Please feel free to contact us at support@envirosim.com (Subject: The BioWin Advantage) with your comments on this article or suggestions for future articles.
Thank you, and good modelling.
From the EnviroSim Team
References
Thornberg, D. E.; Nielsen, M. K.; Andersen, K. L. (1993). Nutrient Removal: On-line measurements and control strategies. Wat. Sci. Tech. Vol. 28, No. 11-12, 549-560.