Averaging Level Control to Reduce Off-Spec Material in a Continuous Pharmaceutical Pilot Plant

: The judicious use of buffering capacity is important in the development of future continuous pharmaceutical manufacturing processes. The potential beneﬁts are investigated of using optimal-averaging level control for tanks that have buffering capacity for a section of a continuous pharmaceutical pilot plant involving two crystallizers, a combined ﬁltration and washing stage and a buffer tank. A closed-loop dynamic model is utilized to represent the experimental operation, with the relevant model parameters and initial conditions estimated from experimental data that contained a signiﬁcant disturbance and a change in setpoint of a concentration control loop. The performance of conventional proportional-integral (PI) level controllers is compared with optimal-averaging level controllers. The aim is to reduce the production of off-spec material in a tubular reactor by minimizing the variations in the outlet ﬂow rate of its upstream buffer tank. The results show a distinct difference in behavior, with the optimal-averaging level controllers strongly outperforming the PI controllers. In general, the results stress the importance of dynamic process modeling for the design of future continuous pharmaceutical processes.


Introduction
Continuous manufacturing holds promise to improve the reliability and profitability of future pharmaceutical processes [1][2][3][4][5][6].Significant progress has been achieved to exploit continuous operation of various unit operations that are typically used in pharmaceutical processes .Furthermore, system-wide benefits may exist by, for example, exploiting material recycling and improved process control based on real-time understanding of the final product quality, as well as critical material attributes of streams within the process.Consequently, pharmaceutical companies are interested in the potential benefits of transforming the manufacturing of pharmaceutical products from a conventional batch-wise mode of operation to continuous flow mode [35].The role of process modeling is expected to increase significantly during this transition to enable improved design and operation [33,[36][37][38][39][40][41][42][43].
A key ingredient in enabling the reliable operation of continuous pharmaceutical manufacturing processes is the development of automated control strategies.In particular, judicious use of the buffering capacity of tanks is needed to avoid high concentrations of impurities in a small fraction of the produced tablets and to avoid sharp variations in flow rate propagating throughout the complete process.However, on the downside, extensive use of buffering capacity will lead to sluggish process behavior.Therefore, an appropriate design of automated control strategies around buffer tanks is of importance for the viability of continuous pharmaceutical manufacturing.
The aim of this paper is to identify the potential benefits of using optimal-averaging level control [44] over conventional proportional-integral (PI) feedback level control for an integrated continuous pharmaceutical pilot plant.The pilot plant was constructed within the Novartis-MIT Center for Continuous Manufacturing to produce a pharmaceutical product from start (raw materials for intermediate compounds) to finish (tablets in final dosage form) in a fully continuous fashion [45] and features several cascades of well-mixed tanks.The level of all tanks within the pilot plant were initially controlled with proportional (P)-feedback control only.A plant-wide dynamic model is used to investigate the potential benefits of replacing these level control loops with more advanced control strategies.The plant-wide dynamic model is presented in detail elsewhere [42] and has been extended with control loops in subsequent work [43].
The focus of this paper is on a characteristic sequence of unit operations within the continuous pharmaceutical pilot plant.A closed-loop model is used to simulate the behavior of the unit operations, including automated control loops with P-feedback control.The unknown parameters and initial conditions are estimated from experimental data, which includes the behavior of several level control loops and a concentration control loop in the presence of a significant disturbance and a setpoint change.The focus is on the main compounds in the system to obtain a realistic description of at least the overall mass balance, such that control strategies for buffering can be investigated.Subsequently, the closed-loop dynamic model is used to investigate the potential benefits of replacing the P-feedback level controllers with more extended controllers.First, we will focus on PI level controllers with tuning rules that specifically aim to achieve averaging level control (PI-ALC).Second, process simulations are investigated, where the conventional level controllers are replaced with optimal averaging level control (OALC).The advantage of OALC over conventional PI-ALC is that with OALC, flow optimality can be achieved for a known magnitude of an input disturbance.The results illustrate the importance of advanced control strategies to exploit systematically the buffering capacity of a cascade of buffer tanks in future continuous pharmaceutical processes.

Process Description and Control Structure
A schematic representation of the studied part of the integrated continuous pharmaceutical pilot plant is given in Figure 1.A detailed description of the design of the pilot plant is presented elsewhere [45].In this section, key elements are summarized that have a direct connection to the work presented in the present paper.An intermediate compound A is synthesized and dissolved in solvent S 1 upstream.Compound A is a reagent for the synthesis of an active pharmaceutical ingredient further downstream and is separated from solution via a cascade of two continuous crystallization steps followed by a continuous wash and filtration step.Supersaturation is generated in the crystallizers via cooling and addition of an anti-solvent (S 2 ) to the second crystallizer, which reduces the solubility of compound A four-fold [22].The temperature within the crystallizers is kept constant via thermostatic baths connected to the jackets of the crystallizers.Both crystallizers are equipped with level sensors (Omega LVCN414) that are calibrated to measure the total volume of the material in each crystallizer.The outlet flows of the crystallizers consist of a slurry with suspended crystals in mother liquor, which are largely separated in a continuous wash and filtration stage (W1).The purified slurry of compound A is collected in a buffer tank that can be used for dilution (D1) to which solvent can be added to dilute the slurry.The dilution tank is also equipped with a calibrated level sensor (Omega LVCN414) and an online density meter (Anton Paar DPRn 417) calibrated to measure the concentration of compound A in the tank.The outlet flow rate of the buffer tank is fed to a tubular reactor downstream for synthesis of a second intermediate compound.The variations in composition and flow rate of the material leaving the buffer tank have a significant impact on the performance of the reaction downstream.Therefore, to reduce the production of off-spec material in the complete process, a feedback concentration control loop is used to maintain the concentration of compound A in D1 close to a desired setpoint.The outlet flow rate of the buffer tank is manipulated to control the level in the tank.The variations in concentration and outlet flow rate should be minimized to maintain a constant residence time in the tubular reactor downstream.A Siemens SIMATIC PCS7 process control system was used for data archiving and implementation of the experimentally tested control loops.Such a control system allows for the flexible implementation of desired control strategies.
Figure 1.Process flowsheet of a section of a continuous pharmaceutical pilot plant that consists of two crystallizers in series (Cr1-2), a washing and filtration stage (W1), and a buffer tank that can be used for dilution (D1).The section has three automated feedback level control loops (LC1-3), two automated temperature control loops (TC1-2) and an automated feedback concentration control loop (CC1).The tuning of the P-only feedback level controllers of the crystallizers aims to provide both stability and flow filtering to damp out fluctuations in flow rate.Therefore, the gains of the level controllers of the crystallizers, as implemented in the pilot plant, are chosen, such that the outlet flow rate of a crystallizer is approximately at the maximum flow rate when the level in the crystallizer reaches an upper limit (V max ).In case a steady-state offset in level is not desired, integral action can be added.The following tuning rules are recommended for PI-ALC [46,47]: with, for our case: where K c is the controller gain, τ c is the controller integral time, V is the volume of the material in the tank and φ max is the maximum outlet flow rate.Equation (1) states that the outlet flow rate will be at a maximum value when the volume in a tank reaches the upper limit.Derivative controller action is not desired, due to the noisy signal from the level measurement devices.Finally, a scheme that utilizes OALC is investigated.When inlet flow measurements are available, the following optimal-averaging level controller can be used [44]: where φ i and φ o are the measured inlet flow rate and manipulated outlet flow rate, respectively, and V m represents a constraint on the maximum or minimum volume, depending on the direction of change of the volume, that should not be violated.The first term of Equation ( 4) minimizes the maximum change in outlet flow rate for a given flow imbalance, which has been augmented with equations for a PI controller.The latter does compromise on flow optimality, but also ensures that the steady state of the system will eventually move to a setpoint value, such that future disturbances can be mitigated effectively, as well.The reader is referred to McDonald et al. [44] for further details on the derivation of Equations ( 4) and ( 5).When inlet flow measurements are not available, a discrete-time optimal flow level controller could be utilized [48].In this particular pilot plant (Figure 1), measurements of the inlet flow rate of crystallizer Cr1 are not readily available, in contrast to the measurements of the inlet flow rate of crystallizer Cr2, which can be obtained from the volumetric pumps P1 and P2.The buffer tank D1 has two inlet flow rates, i.e., stream 4 from W1 and the solvent stream (pump P5).The latter flow rate is readily available from measurements, whereas the former can be obtained from the outlet of crystallizer Cr2 (pump P3) with the assumption that the performance of the filter (W1) does not change over time.For the application of OALC, level controller LC1 utilizes P control, as was implemented in the pilot plant, and level controllers LC2 and LC3 are extended according to the schemes described by Equations ( 1)-( 3) and, in separate simulations, by Equations ( 4) and ( 5).Note that OALC for a crystallizer is only suitable within a range in which the residence time of the crystallizer does not have a significant impact on the crystallizer performance, which calls for a conservative strategy when designing the continuous crystallization stage and for a limited allowable buffering capacity.The tuning of the optimal-averaging level controllers requires a trade-off between flow optimality and the speed at which the level of the tank moves towards the setpoint after a disturbance, which has to be selected based on the frequency and direction of the expected disturbances.For this case study, the settings as given by Equations ( 1)-( 3) are used as a reference for tuning the PI part of the OALC controller.In particular, the gain of the OALC controller has been taken two orders of magnitude smaller compared to the gain used for the PI-ALC controller, as given by Equation (1).Furthermore, the controller integral time has been taken as two orders of magnitude larger compared to the PI-ALC controller, as given by Equation ( 2).The aim is to assure that the PI part of Equation ( 4) does not dominate the behavior of the OALC controllers, but also that the system does move slowly to a setpoint somewhere in between the desired upper and lower limits of the tank.The resulting gains and controller integral times for the studied controllers are given in Table 1, including the nominal setpoints.Note that the setpoints for OALC correspond to the setpoints of the corresponding P level controllers, including steady-state offset.

Process Modeling and Parameter Estimation
A closed-loop simulation is utilized to evaluate the effectiveness of OALC for the continuous pharmaceutical pilot plant as described in the previous section.The model equations that are relevant for the network of unit operations illustrated in Figure 1 are extracted from a plant-wide dynamic model inspired by the experimental pilot plant, as described in detail elsewhere [42].The model contains component balances for all chemical species, moment balances to describe the dynamic evolution of the crystal size distribution and thermodynamic expressions related, for example, to solubilities.In general, the stream coming from the reactor upstream contains several impurities.However, the effect of impurities is expected to have a limited impact on the description of the overall mass balance, which is the main requirement for the present study.Therefore, the model has been simplified by considering only the component balances of the intermediate compound A and the solvents.Finally, the model has been extended with P-feedback control loops to mimic the closed-loop behavior of the pilot plant.
Several key parameters in the dynamic model were unknown and had to be estimated to ensure that the dynamic model gives an accurate description of the dynamic development of the key control objectives, i.e., the concentration of compound A in buffer tank D1 and the variations in the outlet flow rate of tank D1.Experimental data covering a period of 24 h of operation were used to estimate the unknown parameters.The time period started at t = 24 h, where t = 0 approximately corresponds to the start of the filling of the first crystallizer (Cr1).Consequently, the experimental data do not necessarily represent steady-state conditions.The experimental data contain at least one major disturbance, which was caused by blocking of the transfer line from the second crystallizer (Cr2) to the continuous washing and filtration stage (W1).Starting at t = 30.0h, a number of plugging events occurred within a period of 30 min, which temporarily prevented any flow from Cr2 to W1.Note that such blocking cannot be directly observed, as volumetric pumps are used to obtain flow rates.However, the onset of plugging can easily be determined by careful examination of the measurements of the level in the tanks, and plugging events have been implemented in the model by multiplying the outlet flow rate of Cr2 with a binary variable, whose value depends on the existence of plugging for the given time.Furthermore, a setpoint change in the feedback concentration control loop (CC1) was implemented experimentally at t = 26.7 h to increase the concentration of compound A in buffer tank D1, as indicated in Table 1.Note that such a change in setpoint reduces the solvent flow rate going into buffer tank D1, which impacts the level and, thus, outlet flow rate of the tank.
Table 1.Tuning parameters and setpoints of the studied controllers: P, implemented in the pilot plant (proportional only); PI-ALC, implemented in a process simulator (proportionalintegral tuned according to averaging level-control criteria); OALC, implemented in process simulator (optimal averaging level control).

Controller
Setpoint The available experimental data consist of the measured level in both crystallizers (Figure 2), the outlet flow rate of both crystallizers (Figure 3), the level in the buffer tank and the corresponding outlet flow rate (Figure 4) and the controlled concentration of compound A in buffer tank D1 with the corresponding flow rate of the solvent for dilution (Figure 5).Each data point represents the median value of a series of 30 measurements obtained within a period of 300 s.The dynamic model is implemented in JACOBIAN (RES Group, Inc.), which is a process simulator equipped with routines for parameter estimation.A maximum-likelihood objective function was used for the parameter estimation, with equal weight given to each data point.The input and output of the parameter estimation problem to fit the closed-loop dynamic model to the experimental data are presented in Table 2.These parameters characterize the properties of the material coming from the reactor upstream, the initial solid fraction in both crystallizers and the solid fraction of the slurry leaving the filter plate.The resulting dynamic model is well capable of describing the experimental data, including the dynamics during the main disturbance and the change in setpoint of the feedback concentration control loop, as illustrated in Figures 2-5.  1) for a period of 24 h describing experimentally measured data from level sensors (circles and diamonds) and a model-based computation (solid lines).The volume in each crystallizer is a controlled variable within an automated P-only feedback level control loop (LC1 and LC2).A number of plugging events occurred at t = 30.0h in the outlet tubing of crystallizer Cr2.  1) for a period of 24 h describing experimentally measured data obtained from volumetric pumps (circles and diamonds) and a model-based computation (solid lines).The outlet flow rate of each crystallizer is a manipulated variable within an automated P-only feedback level control loop (LC1 and LC2).A number of plugging events occurred at t = 30.0h in the outlet tubing of crystallizer Cr2.In the next section, the model is used to investigate the potential benefit of replacing each of two P level control loops with PI-ALC level control loops and OALC, which have both been implemented in the model-based process simulator in differentiated form, with the initial condition corresponding to the measured outlet flow rate at the beginning of the investigated time interval.The simulated scenario mimics, for the first 24 h, the operation of the pilot plant, including the observed disturbances.Subsequently, the simulation is extended for another 48 h to investigate via model-based simulations the performance of the controllers when a large and temporary step change in throughput would be implemented in the process.The disturbances observed during experimental operation of the pilot plant were significant as a flow rate came to a complete stop.However, since the disturbance was relatively short, the total amount of material that was blocked was limited.Even if the OALC controller takes no corrective action, the levels of tanks are not expected to cross the upper or lower boundary.Therefore, the simulation is extended beyond the experimental period to investigate the performance of the controllers in case the levels in the tanks approach a critical value to obtain broader insight.In particular, the following step changes in the flow rate of Stream 1 are implemented in the process simulator: where F 1 is the inlet flow rate of the first crystallizer.1) for a period of 24 h describing experimentally measured data (diamonds) obtained from a level sensor and a volumetric pump (P6) and a model-based computation (solid lines).The outlet flow rate of buffer tank D1 is a manipulated variable, and the level is a controlled variable within an automated P-only feedback level control loop (LC3).Note that a setpoint change of a concentration control loop constructed around buffer tank D1 (CC1) at t = 26.7 h caused the volume to drop and, furthermore, a number of plugging events occurred at t = 30.0h in the outlet tubing of crystallizer Cr2 upstream.Flow rate / ml min -1

Time / hours
Outlet flow rate D1 (computed) Outlet flow rate D1 (measured)  (A) and the flow rate of solvent added to tank D1 (see Figure 1) (B) for a period of 24 h describing experimentally measured data (diamonds) obtained from an online density meter and a volumetric pump (P5) and a model-based computation (solid lines).The outlet flow rate of buffer tank D1 is a manipulated variable, and the level is a controlled variable within an automated P-only feedback level control loop (LC3).Note that a setpoint change of a concentration control loop constructed around buffer tank D1 (CC1) caused the volume to drop, and furthermore, a number of plugging events occurred at t = 30.0h in the outlet tubing of crystallizer Cr2 upstream.Flow rate / ml min -1

Time / hours
Flow rate of S1 into D1 (computed) Flow rate of S1 into D1 (measured)

Results and Discussion
Figure 6 illustrates the dynamic development of the volume and the outlet flow rate of crystallizer Cr2 with P-feedback level control as implemented experimentally, with PI-ALC and with OALC.The difference in behavior is striking.Initially, after the first disturbance at t = 30.0h, the volume for all cases rises sharply as the outlet flow rate of the crystallizer ceases (Figure 6A).In the experimentally tested case, the controller increases the outlet flow rate significantly (Figure 6B), which causes the level to return to its steady-state value within approximately 2 h.The PI-ALC controller shows a similar behavior as the P-only controller with a peak value in the outlet flow rate that is slightly higher.However, for OALC, the automated level control loop utilizes the buffering capacity of the crystallizer and brings the volume of the tank only gradually back to the setpoint.As a result, the outlet flow rate of crystallizer Cr2 hardly changes after the first disturbance hits the system (Figure 6B), which will essentially eliminate any sustained impact of this disturbance downstream.The maximum volume of the crystallizer is not yet approached after the first disturbance, which warrants the full use of buffering capacity.When the second disturbance hits the system, at t = 72.0h, a different response can be observed.In this case, the volume of the crystallizer approaches the maximum allowable value, which results in a significant increase of the outlet flow rate in the case of OALC (Figure 6B).For all tested cases, the outlet flow rates increase temporarily with approximately 50% compared to their steady-state value.The behavior in the OALC case can be understood by the notion that the first term on the right-hand side of Equation ( 4) becomes dominant compared to the loosely-tuned PI part of the OALC controller when the volume approaches the upper or lower limit.In the case that only the PI part of the OALC controller would be used, the vessel would simply overflow.Note that the changes in flow rate in the case of OALC are slightly delayed compared to using only P control or PI-ALC, which causes the system to use more buffering capacity.In general, the simulation results clearly demonstrate the anticipated effectiveness of OALC to mitigate flow disturbances and to smooth changes in setpoints for the studied section of the pilot plant of a continuous pharmaceutical process.Figure 6.Dynamic development of the volume (A) and outlet flow rate of crystallizer Cr2 (B) as predicted by a dynamic model of the process illustrated in Figure 1.The former variable is a controlled variable, and the latter variable is the manipulated variable within an automated level control loop (LC2).The black solid line (triangles) describes the simulated behavior with P-only feedback control, as was done experimentally.The blue line (circles) is the predicted behavior if PI controllers are implemented with tuning tailored for ALC.The red line (diamonds) describes the predicted behavior if OALC is implemented.Figure 7 illustrates the dynamic development of the concentration of compound A in buffer tank D1 (controlled variable) and the flow rate of solvent into buffer tank D1 (manipulated variable) for the experimentally implemented P-feedback control for all level control loops and the expected behavior if PI-ALC or OALC were implemented for LC2 and LC3.Note that the concentration control loop itself is identical in all cases.Therefore, the behavior of all control schemes is identical in the first part of the time interval.The concentration control loop saturates at a minimum flow rate for the manipulated variable when the setpoint change is implemented and resumes to operate the closed loop when the concentration exceeds the setpoint.Since the schemes respond differently to the first disturbance occurring in the outlet flow rate of crystallizer Cr2, some differences can be observed after t = 30.0h.Initially, the concentration, and, thus, solvent flow rate, drops sharply for all schemes, which is caused by a blocked supply of slurry from crystallizer Cr2.With P level control and PI-ALC control, the accumulated material in crystallizer Cr2 is pushed out within a relatively short amount of time to the continuous filtration and washing, which causes the concentration in the buffer tank D1 to peak slightly (Figure 7A) and, consequently, the solvent flow rate to peak, as well (Figure 7B).If OALC were implemented in the plant around the crystallizer, Cr2, the accumulated material of compound A would be pushed out at a much slower pace, which would prevent a peak in concentration of compound A in the buffer tank D1 (Figure 7A) and solvent flow rate (Figure 7B), such that steady state is approached more rapidly in the first part of the tested time interval.The behavior of the concentration control loop strongly correlates to the outlet flow rates of the crystallizer upstream for all tested controllers (Figure 6B) towards the end of the simulated period when the second disturbance hits the system, i.e., around t = 70.0h.Note that the flow rate of solvent that is added to control the concentration of compound A also has a significant impact on the volume and, thus, on the behavior of the level control loop, of the buffer tank.
The influence of the combined effect of the disturbance upstream and the change in setpoint of the concentration control loop CC1 on the volume and outlet flow rate of buffer tank D1 is illustrated in Figure 8 for all investigated control schemes.The results show a significantly different behavior.In the case of P level control and PI-ALC, both the disturbance in flow rate from upstream and the setpoint change of the concentration control loop strongly affect the outlet flow rate of buffer tank D1.First, a sharp drop in the outlet flow rate can be observed when the change of setpoint is implemented at t = 26.7 h, which causes the inlet flow rate of the tank to decrease as a result of the decreased solvent flow rate set by the concentration control loop.Once the concentration reaches the new setpoint, the flow rate increases again to approach the new steady state.Secondly, a sharp decrease in outlet flow rate followed by a sharp increase in outlet flow rate can be observed around t = 30.0h, which is caused by the temporarily blocked transfer line from crystallizer Cr2 to the filtration and washing stage, W1.Note that such sharp changes in the outlet flow rate directly translate to variations in the residence time of tubular Reactor 2 downstream, which would impact the synthesis of the subsequent intermediate compound and impurities.The behavior of P-only level control and PI-ALC is comparable when the second disturbance hits the system at t = 72.0h, with the volume in the case of PI-ALC reaching a slightly higher value, because of the smaller controller gain in that case.(A) and the flow rate of solvent going into the buffer tank (B) as predicted by a dynamic model of the process illustrated in Figure 1.The former variable is a controlled variable, and the latter variable is the manipulated variable within an automated concentration control loop (CC1).The black line (triangles) describes P-feedback control implemented for crystallizer Cr2 and buffer tank D1, as was implemented experimentally.The blue line (circles) is the predicted behavior if PI-ALC feedback controllers are implemented for crystallizer Cr2 and buffer tank D1.The red line (diamonds) describes the predicted behavior if OALC were implemented for crystallizer Cr2 and buffer tank D1.The concentration control loop utilizes P-feedback control in all cases.The expected behavior is distinctively different if OALC were implemented.For OALC, the change in setpoint of the concentration control loop does not lead to a significant drop in outlet flow rate (Figure 8B).Instead, the buffering capacity of the tank is used by reducing the volume of the tank, and a slowly increasing volume can be observed once the concentration control loop reaches its new setpoint.A similar behavior occurs when the first disturbance from upstream around t = 30.0h causes the inlet flow rate of the tank to decrease, i.e., the volume of the material in the tank reduces significantly, while minimizing the changes in outlet flow rate.Once both inlet flow rates of buffer tank D1 are re-established at their nominal value, a gradual increase in volume to compensate for the offset can be observed until the second disturbance hits the system at t = 72.0h.In this last part of the investigated time period, application of OALC shows a significantly lower variation in the outlet flow rate of buffer tank D1 compared to the investigated conventional schemes.This different behavior can be understood from the more gradual supply of material from upstream units (Figure 6B) and the automated use of buffering capacity in buffer tank D1 (Figure 8A).Clearly, the significantly reduced variations in outlet flow rate with OALC combined with no expected additional impact on the concentration control loop (Figure 7A) would minimize the propagation of disturbances within the studied pilot plant of an integrated continuous pharmaceutical process.The central thought behind the application of OALC is to allow little control action in response to inlet disturbances when the volume of the material in a tank is sufficiently far from critical boundaries.Consequently, a more aggressive response is needed when inlet disturbances push the volume close to a critical boundary.The presented results clearly demonstrate this strong difference in behavior depending on the value of the measured volume.These observations raise the question of how to design the excess capacity of buffer tanks.Figure 9 illustrates the simulated process behavior for various allowable ranges in volume as defined by the upper and lower limit of the volume in crystallizer Cr2 and dilution tank D1.The results demonstrate that increasing the range in volume (orange squares in Figure 9) only has a modest effect on the variations in the outlet flow rate.However, upon reducing the range (blue circles in Figure 9), a distinctly different behavior can be observed with a significantly higher variation in outlet flow rate.In the latter case, the volume in the tank approaches the upper limit, and consequently, a peak value of the outlet flow rate comparable to what can be expected when applying conventional P level control or PI-ALC (Figure 8B) is observed.The results stress the attractiveness of introducing specific buffer tanks, without tight constraints on residence time and equipped with automated OALC, to damp out fluctuations in flow rate in future continuous pharmaceutical processes.In addition, exploiting an allowable range in residence time for processing units, such as crystallizers, can further strengthen automated control strategies to damp out fluctuations.

Conclusions
The presented dynamic model gives an accurate description of the closed-loop dynamic behavior of a section of a continuous pharmaceutical pilot plant involving continuous crystallization, filtration, washing and buffering of an intermediate pharmaceutical compound, at least for the studied conditions.The studied section involves three automated level control loops and one automated concentration control loop.The experimental data included a significant disturbance in the outlet flow rate of a crystallizer and a change in the setpoint of a concentration control loop around the buffer tank.Model-based simulations of the system in which two of the experimentally implemented proportional-only feedback level controllers are exchanged with optimal-averaging level controllers showed a clear benefit of using optimal-averaging level control to automatically exploit the buffering capacity of tanks within a continuous pharmaceutical process.The model-based simulations predict a significant reduction in the variation of the flow rate leaving the buffer tank for the experimentally observed disturbances, which would result in reduced variation of the residence time of a tubular reactor downstream.The performance of optimal averaging level control, at least for the investigated conditions, also strongly outperforms the performance in the case of conventional proportional-integral control with the values for the tuning parameters tailored for averaging level control.
In general, it is expected that dynamic process models will play an important role in the design of future continuous pharmaceutical processes by, for example, judicious design of buffer tanks within a plant, as illustrated in this work, or advanced model-predictive control strategies.

Figure 2 .
Figure 2. Dynamic development of the volume of crystallizers Cr1 and Cr2 (see Figure1) for a period of 24 h describing experimentally measured data from level sensors (circles and diamonds) and a model-based computation (solid lines).The volume in each crystallizer is a controlled variable within an automated P-only feedback level control loop (LC1 and LC2).A number of plugging events occurred at t = 30.0h in the outlet tubing of crystallizer Cr2.

Figure 3 .
Figure 3. Dynamic development of the outlet flow rates of crystallizers Cr1 and Cr2 (see Figure1) for a period of 24 h describing experimentally measured data obtained from volumetric pumps (circles and diamonds) and a model-based computation (solid lines).The outlet flow rate of each crystallizer is a manipulated variable within an automated P-only feedback level control loop (LC1 and LC2).A number of plugging events occurred at t = 30.0h in the outlet tubing of crystallizer Cr2.

Figure 4 .
Figure 4. Dynamic development of the volume (A) and outlet flow rate (B) of buffer tank D1 (see Figure1) for a period of 24 h describing experimentally measured data (diamonds) obtained from a level sensor and a volumetric pump (P6) and a model-based computation (solid lines).The outlet flow rate of buffer tank D1 is a manipulated variable, and the level is a controlled variable within an automated P-only feedback level control loop (LC3).Note that a setpoint change of a concentration control loop constructed around buffer tank D1 (CC1) at t = 26.7 h caused the volume to drop and, furthermore, a number of plugging events occurred at t = 30.0h in the outlet tubing of crystallizer Cr2 upstream.

Flow rate of stream 1 5 . 0 × 4 [ 2 . 8 × 10 − 6 , 8 . 3 × 10 − 4 ]Figure 5 .
Figure 5. Dynamic development of the concentration of compound A in buffer tank D1 (A) and the flow rate of solvent added to tank D1 (see Figure1) (B) for a period of 24 h describing experimentally measured data (diamonds) obtained from an online density meter and a volumetric pump (P5) and a model-based computation (solid lines).The outlet flow rate of buffer tank D1 is a manipulated variable, and the level is a controlled variable within an automated P-only feedback level control loop (LC3).Note that a setpoint change of a concentration control loop constructed around buffer tank D1 (CC1) caused the volume to drop, and furthermore, a number of plugging events occurred at t = 30.0h in the outlet tubing of crystallizer Cr2 upstream.
Conc. of A in D1 (computed) Conc. of A in D1 (measured)

Figure 7 .
Figure 7. Dynamic development of the concentration of compound A in the buffer tank D1 (A) and the flow rate of solvent going into the buffer tank (B) as predicted by a dynamic model of the process illustrated in Figure1.The former variable is a controlled variable, and the latter variable is the manipulated variable within an automated concentration control loop (CC1).The black line (triangles) describes P-feedback control implemented for crystallizer Cr2 and buffer tank D1, as was implemented experimentally.The blue line (circles) is the predicted behavior if PI-ALC feedback controllers are implemented for crystallizer Cr2 and buffer tank D1.The red line (diamonds) describes the predicted behavior if OALC were implemented for crystallizer Cr2 and buffer tank D1.The concentration control loop utilizes P-feedback control in all cases.

Figure 8 .
Figure 8. Dynamic development of the volume (A) and outlet flow rate of buffer tank D1 (B) as predicted by a dynamic model.The former variable is a controlled variable, and the latter variable is the manipulated variable within an automated level control loop (LC3).The black solid line (triangles) describes the simulated behavior for P-only feedback control, as was done experimentally.The blue line (circles) is the predicted behavior for PI-ALC.The red line (diamonds) describes the predicted behavior for OALC.

Figure 9 .
Figure 9. Dynamic development of the outlet flow rate of buffer tank D1 (A) and volume (B) as predicted by a dynamic model with OALC level control in crystallizer Cr2 and buffer tank D1 for various allowable ranges in volume.In the legend, ∆V = V max − V min , and the numbers in the legend are given in cubic meters.

Table 2 .
Input for parameter estimation and results.