This paper proposes a scheme for improving the mixing in the boundary layer of pressure-driven membrane systems such as reverse osmosis and ultrafiltration. Through application of an external electric field, a flow of ions in the vicinity of the membrane surface will be generated, creating simultaneous electro-osmotic flow that should reduce the concentration polarization on the membrane surface. The objective of feedback design for this system is to determine the voltage (and waveform) required to produce an electric field that can effectively increase mixing in the vicinity of the membrane wall. This paper uses a mixing index in terms of a measure of spatial gradients of the perturbation velocities, which describes the mixing caused by both length stretching and vortices. An optimal control problem is defined and a control strategy is developed to achieve mixing enhancement and improve energy efficiency. The efficacy of the feedback scheme is validated by Computational Fluid Dynamics (CFD) simulations. The control law presented in this paper shows the desired waveforms for such applications.