A Slug Flow Platform with Multiple Process Analytics Facilitates Flexible Reaction Optimization

Abstract Flow processing offers many opportunities to optimize reactions in a rapid and automated manner, yet often requires relatively large quantities of input materials. To combat this, the use of a flexible slug flow reactor, equipped with two analytical instruments, for low‐volume optimization experiments are reported. A Buchwald–Hartwig amination toward the drug olanzapine, with 6 independent optimizable variables, is optimized using three different automated approaches: self‐optimization, design of experiments, and kinetic modeling. These approaches are complementary and provide differing information on the reaction: pareto optimal operating points, response surface models, and mechanistic models, respectively. The results are achieved using <10% of the material that would be required for standard flow operation. Finally, a chemometric model is built utilizing automated data handling and three subsequent validation experiments demonstrate good agreement between the slug flow reactor and a standard (larger scale) flow reactor.


Control Software
XAMControl is a SCADA software designed for industrial automation.It allows for direct communication with actuators and sensors utilizing different field bus protocols as well as OPC UA communication with various DCS systems.The process is visualized u sing XAMControl Iris (Figure S4), which allows for the display of real-time process data and manual process control.XAMControl allows for PLC integration using graphical programming (Figure S5) and the C# programming language.All recorded data is stored in a cloud repository and can be accessed using XAMControl Iris or exported as .csvfiles.

Process Description
After receiving the start signal, the software reads out a file containing the parameters, those parameters are stored internally by the control software.The control software heats the reactor to the temperature specified in the parameter file.Upon reaching the specified temperature, the setpoints of the pumps are determined, to form a reaction slug in accordance with the ratios specified in the parameter file, with the mixing flow rate (set for the system prior to starting experiments).The control software then calculates the times that the pumps should be turned on for.The pumps are started up and, after a delay to ensure that they have reached the correct flow rate, the signal to inject the first gas bubble is sent.Once the desired amount of reaction mixture has been introduced into the reactor, the software sends the signal to inject the second gas bubble.The software then sets the solvent pump to a flow rate that allows for the desired residence time in the heated reactor to be achieved.Upon passing through the reactor, the control software switches a VICI 6-port valve to transport the reaction slug to the analytics pathway, first reaching the FTIR (ReactIR 15, Mettler Toledo).The software receives the result of the FTIR detector using a folder watch system (ProcessLink, S-PACT).When the reaction slug is detected by the FTIR, the software waits a defined time period for the reaction mixture to enter the injection valve of the UHPLC (Nexera X2, Shimadzu).Upon entering the injection valve, the software sends a signal that triggers the injection into the UHPLC.After the UHPLC analysis has concluded, the LabSolutions software (Shimadzu) exports the concentration results as a .csvfile.This file is read by XAMControl and the concentrations of the analytes are calculated.These concentration values can be processed further.
In the example shown in Figure S3, the concentrations are used to calculate the objective values of a self-optimization algorithm, which are then written to an output file.This file is read by a Matlab script and used to calculate the parameters for the next experiment.Matlab then writes the newly calculated parameters to the parameter file to initiate the next experiment.

Figure S3
. Flowchart of the process implemented in XAMControl.

External file handling
To ease the labor-intensive process of building FTIR models using the large amount of data gathered, the data was automatically sorted into folders and tagged with process parameters, reactor outputs and compound results using XAMControl and a Python script according to the flowchart shown in Figure S6.

Optimization Algorithm Software
The optimization algorithm TS-EMO was adapted from Schweidtmann et al. [1] with minor changes.The alterations include a file exchange interface between the SCADA software (XAMControl) and the Matlab interface.Further, a Matlab script was developed to automatically generate and execute Latin hypercube sampling.These initial experiments were sorted in order of increasing temperature to reduce the experimental time.This process is shown in Figure S7

Online UHPLC General Details and Method:
The UHPLC-DAD (Shimadzu, Nexera X2) was comprised of a degassing unit (DGU-403ASR), two solvent delivery units (LC-30AD), a thermostated column oven (CTO-20AC), a diode array detector (SPD-M30A) and a control unit (CBM-20A).The analysis was carried out using a reversed-phase column (Phenomenex Luna Omega C18 (50 x 2.1 mm, particle size 1.6µm, pore size 100 Å)) at 45 °C using a total flow rate of 1 mL/min.The sample was introduced by an internal injection valve (10 nL, 20000 psi, Cheminert Nanovolume, Part# C84U-6674-.01EUH), which was triggered by the CBM-20A controller.Compounds were eluted with the following gradient: 30% solvent B held for 6 seconds.The amount of B was increased to 50% over 42 seconds, held at 50% for 24 seconds, followed by an increase to 100% over 30 seconds and a final hold at 100% for 30 seconds.The column was then equilibrated at 30% for 48 seconds.The mobile phases A (water/acetonitrile 9+1 v/v +0.1% TFA) and B (acetonitrile + 0.1% TFA) were prepared using HPLC grade ingredients purchased from VWR. Resulting in the chromatogram shown in Figure S8.

Figure S8 Example chromatogram of the reaction mixture at a wavelength of 254 nm
5-point calibration of the reactants and product against internal standard was carried out using online injections.The internal standard used was biphenyl The calibration curves are shown in Figure S9, Figure S10, Figure S11 and Figure S12.The anime and aryl halide starting materials were calibrated at 300 nm.The product was calibrated at 341 nm.For biphenyl (internal standard), the absorbance at 254 nm was used.

Process integration:
Online UHPLC integration was accomplished using a UHPLC internal sample injector (10 nL, 20000 psi, Cheminert Nanovolume, Part# C84U-6674-.01EUH), controlled using the Shimadzu LabSolutions Software.The chromatographic method engaged the injection valve automatically upon receiving the start signal from the HiTec Zang LabVision software.This start signal was in turn triggered by a processed FTIR measurement.
After each analysis the processed UHPLC data was automatically exported into a .csvfile using the Shimadzu LabSolutions software (Version 5.97 SP1) containing information about retention times, areas of analytes and the chromatograms at 254 nm and 300 nm.This file was read by XAMControl and the data contained within was processed further.

Impurities:
A number of impurities have been identified in the process.These impurities are shown in Figure S13 and Figure S14.For the nitrobenzene impurity, the amount was quantified using the calibration curve.The other impurities were quantified as aliquots of the missing mass balance.Inline FTIR Spectra were recorded using a Mettler Toledo ReactIR 15 FTIR (Figure S15), equipped with a flow cell (Mettler Toledo, Micro Flow Cell DS SiComp).The acquisition time was 5 sec per data point and the spectra were recorded between 600 cm -1 and 4000 cm -1 using a resolution of 4 cm -1 .Before use, the MCT detector was allowed to warm to room temperature, then cooled with liquid N2.
It was ensured that the peak height was between 18000 and 24000 and that the signal to noise ratio was above 5000.

Process Integration:
The process stream was connected to the flow cell using a sampling system (Figure S23) utilizing a remote-controlled VICI 6-port valve.

Figure S15. Photograph of ReactIR 15 flow cell setup.
Data processing by integration: Spectra were pretreated by reducing the wave number range to 2150 cm -1 to 2250 cm -1 and the whole range was integrated using PEAXACT integration resulting in spectra as shown in Figure S16.The resulting integration model was used to determine UHPLC injection timing.

Figure S16. Processed and integrated example FTIR spectrum.
Data Analysis using PLS: Workflow for PLS regression: The acquired and pre-sorted spectra from the self-optimization run were loaded into PEAXACT, assigned labels and grouped into different levels.

All spectra underwent the same pretreatment conditions:
Wave number range was reduced to 600 cm -1 to 3500 cm -1 , rubber band baseline correction, 1 st order derivative (filter length = 5) resulting in spectra as shown in Figure S17.

Determining of Reactor Parameters
To determine viable conditions for the segmented flow regime a range of parameters was examined (Table S2).This was carried out according to the following procedure using the setup shown in Figure S21: The Knauer AZURA P 4.1S HPLC pumps were charged with the stock solutions and the segmented flow controller was tested using the parameters in Table S2.The streams were combined using a 7-way PEEK mixing unit (IDEX P-151, 83 µL i.V.) with one of the ports blocked with a PEEK stopper.The combined streams entered the remote-controlled 6-port valve to form the reaction slug.The slug then passed through the unheated reactor coil for the specified residence time, before entering the FTIR, the flow rate of the stream was reduced to 0.05 mL/min to allow for a large number of FTIR spectra to be collected.After the FTIR the stream passed through a BPR (Zaiput BPR-10, 8 bar) and into a collection vessel.
Table S2.Conditions tested for segmented flow regime.
Mixing flow rate (mL/min) 0.4 1.0 1.75 Reaction slug volume (µL) 100 300 500 Residence time (min) 5.0 7.5 10.0 The following FTIR traces (Figure S22) were obtained by tracking peak height at the following wavenumbers:    HPLC Pumps were primed with their respective solutions and the slug flow system was initiated.For the self-optimization an implementation of the TS-EMO algorithm, adapted from Schweidtmann et al., [1] was used.For the DoE/Kinetic experiments a custom batch scheduler written in Python was used.

Reactor inputs and reactor outputs
During the self-optimization, DoE and kinetic experiments there is a number of fixed reactor inputs and a number of varied reactor inputs.Additionally, some variables are calculated based on varied inputs.Reactor outputs are measured by UHPLC or FTIR or calculated based on the measured outputs.

DoE Experiments
During the DoE experiments, four variables were varied to construct a reduced factorial design with additional face points: ratio of reagent 1 (amine) to starting material, temperature of the reactor, ratio of reagent 2 (DBU) to starting material and mol % of reagent 3 (Pd(OAc)2).The concentration of the starting material was fixed at 0.328 mol/L.The residence time was fixed at 6.5 minutes.The boundaries of the adjusted variables are shown in Table S5.DoE results are shown in Table S6 as well as from Figure S27 to  S7.The models were fit using main, square and interaction terms.

Kinetic Experiments
During the kinetic experiments six sets of conditions (Table S8) were examined at residence times of 0.5 min, 1 min, 2 min, 4 min, 8 min, 12 min: Table S9.Results from the kinetic study performed using information from the DoE to decide boundary conditions.The adjusted variables were the ratio of Amine starting material to ArBr starting material, concentration of ArBr starting material, the temperature of the reactor, the equivalents of base and the mol % of catalyst.Each set of conditions was measured at 6 different residence times.

Figure
Figure S1 Schematic overview of the automated modular continuous flow platform at the Kappe Lab. Green represents the physical world, blue represents the digital world.

Figure S2 .
Figure S2.Photograph of the automated modular continuous flow platform at the Kappe Lab.

Figure
Figure S4 Process visualization in XAMControl for the segmented flow system.The lab equipment and PAT can be monitored and controlled from this view

Figure S6 .
Figure S6.Flowchart of the file handling Python script.

Figure
Figure S7.A flowchart of the Self-Optimization algorithm implemented in Matlab.

Figure S10 .Figure
Figure S10.Calibration curve for the online UHPLC analysis of 1-bromo-2-nitrobenzene at a wavelength of 300 nm.
Figure S13.Zoomed-in chromatogram showing minor impurities in the process, unlabeled peaks exceeding plot area are in order of retention time: PhCl, product and biphenyl.

Figure S14 .
Figure S14.Chromatogram from Figure S13 zoomed in to focus on region between 2.0-2.5 min.

Figure
Figure S18.FTIR PLS model Predicted vs. True plot of the amine starting material.green: calibration model, blue: validation data.

Figure S19 .
Figure S19.FTIR PLS model Predicted vs. True plot of the ArBr starting material.

Figure S23 .
Figure S23.Detailed flow setup of the slug flow reactor platform for the Buchwald-Hartwig coupling towards 3.The Buchwald-Hartwig coupling was carried out in a Uniqsis coil reactor using 1/16" PFA tubing.The flow scheme is shown in FigureS23.Both the solvent feed was equipped with a pressure sensor (Keller, PAA 35XHTC).The feeds were delivered using five Knauer AZURA P 4.1S HPLC pumps.The streams were combined using a 7-way mixing unit (IDEX P-151, 83 µL i.V.) with one of the ports blocked with a PEEK stopper and additionally mixed using a glass bead mixing unit.The combined streams entered the remotecontrolled 6-port valve (VICI C2V-2346EUHA) to form the reaction slug.The valve was connected as shown in FigureS24.N2 gas was delivered using a mass flow controller (El-Flow Select, Bronkhorst).The waste port of the valve was connected to a membrane-based BPR (Zaiput, BPR-10) set to 8 bar.After passing through the valve, the reaction slug passed through an unheated spacer of 1/16" PFA tubing (0.51 mL) before entering the coil heater.After passing through the coil heater, the stream entered a second remote-controlled 6-port valve (VICI C2V-2346EUHA).We assumed that the cooling effectively quenched the reaction.The valve was connected as shown in FigureS25.The reaction slug entered the loop in valve 2 (position 1) and upon switching the valve to position 1 was transferred to a separate flow system fed by a SyrDos2 syringe pump equipped with a pressure sensor (Keller, PAA 35XHTC).The reaction slug passed through 0.1 mm i.d.PTFE tubing into the flow cell (Mettler Toledo, Micro Flow Cell DS SiComp) of the FTIR (Mettler Toledo, ReactIR 15), then the sample injector of the UHPLC (Shimadzu, Nexera X2).Upon exiting the injection valve, the reaction slug was transported to a membrane-based BPR (Zaiput, BPR-10, set to 8 bars) in 1/16" PFA tubing and collected after passing through the BPR.

Figure S31 .
Impurities determined during DoE experiments are shown in Table

Figure S27 .
Figure S27.Summary of fit for all models.R² is a measure of how well the model fits the data points, Q² is a measure of how well the model can predict data which is not part of its initial dataset, Reproducibility is a measure of experimental error.

Figure S31 .
Figure S31.Response contour plot of the nitrobenzene impurity (response in mM).

Figure S33 .
Figure S33.Response surface plot for unidentified impurity b (response as fraction of total HPLC area (area% / 100).

Figure S44 .Figure S45 .
Figure S44.Product concentration as determined by FTIR and UHPLC over time using conditions 2, inputs chosen based on DoE results.Baseline correction has been applied to FTIR data.

Table S1 .
Concentrations of calibration levels in mol/L.

Table S4
Results from the self-optimization experiments using a Latin hypercube (LHC) as the initial data set.The adjusted variables were amine (2) loading, concentration of ArBr (1), residence time in the reactor, reaction temperature, DBU loading and catalyst loading.The objectives were space-time yield, yield and cost.

Table S5 .
Lower and upper boundaries for the 4 variables varied in the DoE experiments

Table S6 .
Results from the DoE study performed using the information from the self-optimization to decide on boundary conditions.The adjusted variables were the ratio of amine starting material to ArBr starting material, the temperature of the reactor, the equivalents of base and the mol % of catalyst.Calculated objectives were yield, space-time yield and cost.

Table S7
Unidentified impurities in DoE experiment series in area % (only considering unidentified impurities) areas at 254 nm, as well as the associated missing mass balance for that experiment.

Table S8 .
Conditions used in kinetic experiments.

Table S11 .
Results of kinetic model predictions for self-optimization experiment results, compared with the experimentally-measured values,showing the calculated residual for each result.RMSE = 34.9mM.

Table S12 .
Results of kinetic model predictions for DoE results, compared with the experimentally-measured values, showing the calculated residual for each result.RMSE = 25.0 mM.Figure S43.Product concentration as determined by FTIR and UHPLC over time using conditions 1, inputs chosen based on selfoptimization results.Baseline correction has been applied to FTIR data.