An integral control scheme is used to optimize a method for generating turbulent fluctuations for DNS and LES of wall-bounded flows. Similar to previous investigations, the method employs a series of control planes in which a body force is applied to the wall-normal momentum equation that amplifies and shapes velocity fluctuations seeded into the flow towards a target resolved shear-stress profile. The focus of the current work is on a methodology for specifying the controller gains and ensuring numerical stability without the introduction of criteria that override the control commands in order to prevent unphysical effects. The first method used to analyze the control process is based on identification of a linear model formed from the openloop response of the shear stress to random inputs at the control planes. Optimal gains for the controller are specified based on the location of the poles of the linear model in the closedloop configuration. The second method consists of measuring the response of the non-linear system to preset gain values and incrementally increasing the gains until the onset of numerical instabilities. The schemes have been tested using computations of turbulent channel flow at Reynolds numbers based on friction velocity and channel halrwidth of 400 and 5000. Simulation results obtained using both methods show that using the second approach the resolved shear stress reaches the target levels at the control planes, without ad hoc tuning of the control parameters. The predicted optimal gain values at the control planes are sensitive to the stirring force used to create fluctuations. In addition, the magnitude of the stirring force also affects rms values of the velocity fluctuations downstream of the control planes.