Control of Electrodialysis Desalination Systems as Smart Loads in Microgrids with High Penetration of Renewable Generation

Water desalination systems connected to microgrids with high penetration of renewable energy generation are frequently used to promote the development of remote areas. These microgrids often have power quality and even stability problems. This work shows that electrodialysis desalination systems can be managed as smart loads, that is, they can contribute to the power balance and voltage regulation of the microgrid without neglecting its main function of water desalination. For this, a model of multiple inputs and multiple outputs for a desalination system is proposed where the variables to control are the treated water concentration and the active and reactive powers demanded by the desalination system. Based on this model, a control law is proposed that allows to face the complexity of the non-linear system in a simple and precise way. The proposed control guarantees the low salt concentration of the drinking water and favors the energy balance of the microgrid, allowing better control of the power quality and greater penetration of renewable energy generation.


Introduction
Microgrids allow the bidirectional flow of energy, favoring the integration of renewable sources of generation, energy saving, cost reduction, and increased flexibility in view of greater reliability [1]. Among others, their main components are distributed generation units DGU (particularly renewable energy systems), energy storage devices, smart loads provided with techniques for consumption management, and monitoring systems and power flow control both for operation in connection to the network and in isolation mode. Obviously, this last mode of operation (island mode) is the one that presents the most challenges from the point of view of the quality of the electric service [2]. In part, this is because the generation systems based on renewable energies have a very low or no mechanical inertia. The lack of this inertia hinders the balance of power both in normal conditions and against failures, boosting instability conditions. Although a proper control of the electronic converters of the DGUs allows emulating inertial behavior, their power range strongly restricts the inertia maximum value to emulate [3]. In addition, the balance between generation and load, on which the power quality of the microgrid depends, is strongly affected by the intermittency of renewable resources, such as photovoltaic or wind, and its availability at the time of greatest demand. An extreme case is that of microgrids with photovoltaic DGUs and where the predominant loads are electric car batteries chargers, in this case, the periods of generation and demand are almost opposite [4]. While the addition of storage devices mitigates the imbalance, different studies show that the required storage levels can be economically unfeasible today.
In this framework, the concepts of active demand management and smart loads that can contribute to the power balance are reinforced [5][6][7]. The active management of demand (also known as Demand Response DR) consists of a set of actions that encourage consumers to make rational use of energy demand. These actions correspond to the "short term" and can be activated both based on the power quality requirements and the supply price. Among other actions, the DR includes switching off and on lighting groups, adjusting levels of air conditioning systems, and stopping non-critical manufacturing processes. When these actions are carried out gradually over non-critical loads NCL (loads that can tolerate voltage variations in a wide range without prejudice to users), reference is made to smart loads SL [8]. An SL is a combination of a non-critical load (or a group of similar non-critical loads) and an electronic power interface that decouples the supply. In this way, the energy consumption of the load can be controlled depending on the voltage (for static loads) or on the frequency (for motorized loads). Thus, the joint control of the generation systems, storage systems and smart loads provide flexibility to the microgrid to guarantee the power balance without affecting the critical loads CL (i.e., those that require a strict voltage control and/or frequency) particularly if they correspond to priority loads (those whose connection must be guaranteed beyond possible faults).
Smart loads can also contribute to the damping necessary to avoid oscillatory behaviors in the microgrid due to loads that operate at constant power which have a destabilizing effect owing to its negative incremental impedance. [9] The aforementioned reinforces the importance of evaluating and classifying different types of loads that can act as smart loads and thus contribute effectively to the power quality of the microgrid. Different authors have evaluated the capability of some typical loads, to be operated as SL. Among others, [10] consider thermal systems as SL. In [11] it is studied how static loads and motors can be operated intelligently to contribute to primary control and even inertial response. In this line, the present work proposes a multivariable model for electrodialysis desalination processes and a control for operating them as smart loads and thus contribute to the power balance of the microgrid to which they are connected.

Electrodialysis desalination systems in microgrids
Water desalination systems connected to microgrids with high penetration of renewable energy generation are frequently used to promote the development of remote areas [12]. These microgrids often have power quality problems associated with the imbalance between generation and demand. Conventional tools to address power imbalances are: 1) during the hours of excess generation: a) to adjust the efficiency of energy conversion systems, b) to charge the storage systems, c) power curtailment, etc.
2) when the demand exceeds the generation: a) to use the energy available in the storage systems, b) to disconnect non-priority loads, c) start-up of reserve generation units, etc. Each of these actions has economic costs that must be evaluated for each microgrid.
The option DR and, in particular, the control of smart loads reinforce the sharing techniques of distributed generation providing flexibility to manage the microgrids. Then, it is convenient to evaluate what loads can operate as SL. This section evaluates how capable is a water desalination system to operate as a smart load. To this end, the two most important subsystems of the desalination process will be considered: the electrodialyzer (ED) and the pumping subsystem that feeds it. Figure 1a schematizes the operation of an electrodialyzer (ED) for water desalination where it is observed: the anode A, the cathode K and, among them, a series of membranes between which the water and the brine circulate (solution with a high concentration of salts). When applying a voltage between the electrodes A and K, the cations with positive charges move towards the cathode through a membrane MA with negative charge being retained between two membranes (since the membranes are selective in the sense that they only let one type of ion pass). In the same way, negatively charged ions move towards the anode through the membrane MA, being retained in the water that circulates between said anode and this membrane. As the flow of water progresses, the ions go through the membranes and remain outside the main channel. The directional selectivity of the membranes allows the desalinated water to be isolated from the brine. To describe the desalination process, a differential volume (h, dx, w) of water between two membranes is shown in Figure 1b. While water circulates in the direction x of the drawing, there is an ion flow in the normal direction to the membranes. This current causes a reduction of the salt concentration = − + in the length dx. The salt concentration of the drinking water is obtained by integrating dx along the length l. Then, the ion mass balance can be approximated

Electrodialysis process
where u is the flow rate per unit area, JM the mass flow, F the Faraday constant, I the current between membranes (electrodializer current), AM the effective area of the ion exchange membranes, the current efficiency that can express itself as a function of fluid velocity as where and are kinematic parameters that are adjusted polynomially.
From the previous equations, in Figure 2 the output concentration is plotted as a function of the voltage (with Q as parameter) and of the flow rate (with c0 and Ve as parameters). These curves show how the voltage at the input terminals can be managed to reject disturbances in the initial concentration and flow variations. [13] 2.

Pumping system
The pumping system plays an important role in the desalination process due to its energy consumption and also due to the effect that flow has on the salt concentration of the treated water. It basically consists of an induction motor (MI), the water pump and the power electronics for its control. If the motor works at constant magnetic flux, the torque Tm and motor power Pm result where ϕm is the magnetic flux in the air gap, ωsl the slip frequency, Lr the dispersion inductance, Rr the rotor resistance and p the number of pole pairs. Then, the dynamic equation of the pump results where the pump torque is a quadratic function of the pump speed Ωb ( ) where kb is the constant of the pump and ωp the angular frequency equivalent to the speed of the pump. Figure 2. a) Characteristic curves c-V with Q as parameter; b) and c) Characteristic curves c-Q with the initial concentration C0 and the voltage Ve as parameters.

Total power of the desalination system
The active y reactive powers demanded by the desalination system is the addition of the two electrodialysis and pumping subsystems

Control proposal for the desalination system as SL
Desalination systems are generally controlled to purify a daily volume of water with a salt concentration below a reference level cr. This must be ensured regardless of the salinity of the incoming salt water, its flow rate and the power quality of the electrical grid. In this work, the desalination system (electrodialyzer, pumping system, power converters) is controlled in a different way to meet a more complex goal. The desalination system is considered as a potential smart load to guarantee the stability of the microgrid to which it is connected. That is, the input power of the desalination system is regulated according to the state of the power balance of the microgrid, but always preserving the quality of the desalinated water (c<cr).
In this context, the desalination system is seen as a multivariable system with three inputs and three outputs, where the variables to be controlled are: 1) concentration c; 2) desalination system power PT; 3) QT reactive power at the input of the desalination system. Figure 3 shows the proposed control scheme. It corresponds to a decentralized control with three control loops (with feedback of the states and integral action on the errors). The upper loop corresponds to the concentration control. The other two to the active and reactive powers of the complete system. Through a droop curve ("positive droop"), variations in power consumption PT are stated to help the balance between generation and load. The positive slope of this droop curve P-f (active power -frequency) indicates the degree of participation of the electrodialysis system in the active management of microgrid loads. The control of the AC/DC converters that regulates the voltage on the electrodialyzer and AC/AC of the pumping system is controlled incorporates the control of reactive power in its input terminals to collaborate in this way in the regulation of the microgrid voltage. To define the degree of reactive power contribution of the load to the network, the reference Qr can also be defined from a positive slope droop curve Q-Vg (reactive power -voltage).
For decentralized control, it is considered that: 1) vector control techniques in electronic drives allow decoupling the active power control from the reactive power; 2) the open-loop system has a strong coupling between the pumping system (flow rate) and the output concentration (c). The power of the pump is controlled through its speed which affects the flow with a cubic law. In turn, flow affects concentration as indicated in Figure 2., also non-linearly. Since the concentration loop only includes electrical variables, its controller can be designed to present a rapid response compared to the pump dynamics. Thus, the speed of the pump (hence its flow) can be seen as a slow disturbance for the concentration loop, allowing the loops to be considered decoupled in high frequency. Then, an integral action of the decentralized controller guarantees the concentration in cr value faced quasi-constant flow changes concerning the dynamics of the concentration loop.
The reference of the second loop corresponds to the total power PT of the desalination system (motor-pump + electrodialyizer) and is defined from a droop curve that determines the Active Demand Management. That is to say, 1) when the grid frequency falls, the power reference of the desalination system (motor-pump + electrodialyzer) is reduced according to the droop curve resulting in a reduction in the speed of rotation of the pump which reduces the flow rate of water sent to the electrodialyzer; 2) at a lower flow through the electrodialyzer, the level of salt concentration of the potable water is unnecessarily reduced below the required value, which enables (through the upper loop) to reduce the voltage of the electrodialyzer to reduce its power, but always guaranteeing output concentration.
The previous actions reduce both the power of the pumping system and that of the desalination system, preserving the concentration tolerated at the outlet of the electrodialyzer. Said power reduction tends to contribute to the restoration of the network balance while preserving the power quality for critical loads.

Concentration control
As discussed in the previous section, in this proposal, the total power control PT is exercised through the converter of the pumping system that sees the power of the electrodialyzer as a soft disturbance (disturbance that contributes to the control of the total power). The converter itself also controls the reactive power of the pumping system Qp (part of QT). The control of this converter is done through classic vector control techniques. On the other hand, the electrodialyzer converter is responsible for concentration control and contributes to the total reactive power in QED.
Because the control of the pumping system can be carried out by conventional techniques, in this section we focus our attention on the control of the electrodialyzer converter, that is to say, the concentration c and QED. This loop must guarantee water quality beyond the flow changes resulting from the requirements for the power balance. The action on the electrodialyzer is exerted through an AC-DC converter (Fig. 4) that responds to the following equations: where va, vb, vc are the network voltages and the voltages va1, vb1, vc1 are established from the state of the switches.
. Thus, while the states of the swi switch can take the values 0 (open switch) and 1 (closed switch), the ui signals can take values 1 and -1 which is more convenient for the purposes of the analysis. Using the transformations in the Appendix, the dynamic equations of the currents in a reference frame dq rotating at the grid frequency ωe are The relative degree 1 of the switching functions is a necessary condition to reach the sliding mode on the surfaces si = 0. The surface s1 = 0 is intended for getting the concentration of salts in the drinking water to converge to the reference cr. it is included in the surface s1 to reach zero steady-state error beyond the value of the flow rate Q involved in the DR. The selection of feedback constants ki can be done to assign closed-loop dynamics [14] under the assumption of a rapid dynamic between ie and ve. The rate over s2 = 0 requires the converter to operate with a unity power factor. The PED power is controlled together with Pp to ensure the PT power imposed by the droop by the AC/AC converter. Control surfaces can be rewritten as where ( ) (20) From this change, the problem of sliding mode (SM) remains in terms of reaching two surfaces Sdq = 0 for currents id and iq, where the reference for id is obtained from an external loop of the concentration control. In terms of sd and sq, the switching that guarantees the SM is a problem already solved in the literature [15] that is reduced to propose the following switching strategy: and D is defined in the Appendix. This switching strategy guarantees the SM in the region of the state plane that it verifies ( ) The equation (23) shows the convenience of choosing the ve /L ratio to enlarge the region of attraction.
The swi states of the switches are obtained from the transformation of the ui signals:

Analysis and discussion
In section 2 it was shown that a desalination system can operate with variable flow without affecting the salt concentration of the outlet water. For this, it is necessary to act on the input voltage not only to reject disturbances in the concentration of the input saltwater but also as a function of the flow. Although that the variable flow operation affects the liters of water treated per unit of time, this is not an impediment for this type of operation since the production is integrated over time through its storage in distribution tanks. Indeed, traditionally desalination systems are sized to guarantee daily or weekly water production. Based on the foregoing, this work has proposed to operate desalination systems based on electrodialysis as smart loads that, without neglecting their main function of desalinating water, can provide control actions that contribute not only to the stability but also to improving the quality of power of the microgrid to which they are connected.
Beyond the potential of these systems to be operated as intelligent loads, a multi-objective control is required to allow it. Control with these characteristics differs substantially from the conventional SISO control for constant flow and presents important challenges due to the non-linear characteristics of the system, where now three variables are controlled. The MIMO control proposal based on concepts of sliding modes allows overcoming, in a simple way, the complexity of the non-linear problem and the disturbances due to the uncertainty of the initial salinity of the water to be processed. Indeed, the control surfaces proposed for the control by sliding modes not only guarantee the quality of the treated water but also make it possible to contribute to the active power balance of the microgrid and to regulate its voltage from the reactive power control. Figure 6 shows the benefits of operating the desalination system as SL. In part a) of the figure you can see in a thin line the profile of available power in a micro-network (conventional generation of base, wind and solar energy) and in thick line the demand, observing that between 14.45 and 19.45 hours demand exceeds available power. Part b) of the figure shows the power consumed by the desalination system operating as SL, guaranteeing that at no time the power demanded exceeds the available energy (Fig. 6c). Finally, it can be seen in the lower part of the figure that the concentration of drinking water is not affected by the reduction in power consumption.

Conclusions
Desalination processes and alternative energies are allowing developing remote regions where 1) only saltwater is available and 2) the supply of electrical energy is non-existent or is carried out through weak networks. Frequently, they are integrated to microgrids that must face power imbalances problems without affecting critical loads. In this context, the incorporation of storage systems and the operation noncritical load according to the demand (demand response) provide flexibility for the microgrid control. A particular way to implement demand response ideas is through smart load concepts. In this context, this paper has demonstrated the viability of electrodialysis desalination processes to operate as smart loads, i.e. to contribute to the balance of power in a microgrid, without affecting the quality of the treated water. Un MIMO model was proposed to this end where the controlled variables are the output concentration, the consumed power and the input reactive power. For this, a MIMO model was proposed where the controlled variables are the output concentration, the consumed power, and the input reactive power. The model shows that the system can be managed at variable flow and voltage to regulate the concentration, unlike the conventional way in which they are operated, i.e. as constant power loads. But the model also reflects the non-linear complexity of the MIMO system, whose control as smart loading represents a challenge. The proposed control scheme, based on sliding mode control concepts, shows a simple and precise way to address the complexity of system control. Although the quantification of the technical effect of the proposal must be done on each microgrid, it can be affirmed that the control of desalination systems (as well as other loads) as smart loads contributes to improving the power balance. Hence, correctly controlled, they have the capability of assisting to the power quality of the microgrid. Additionally, smart management of the electrodialysis desalination systems also can reduce investment in energy storage systems required for conventional microgrid assistance and/or increasing the penetration of alternative energy generation systems.