This paper describes the design and implementation of a discrete controller for grid-connected voltage-source inverters with an LCL filter usually found in wind power generation systems. First, a theorem that relates the controllability of the discrete dynamic equation of the inverter with LCL filter and the sampling frequency is derived. Then, a condition to obtain a partial state feedback controller robust to grid impedance uncertainties and based on linear matrix inequalities is proposed. This controller guarantees the stability and damping of the LCL filter resonance for a large set of grid conditions without requiring self-tuning procedures. Finally, an internal model controller is added to ensure asymptotic reference tracking and disturbance rejection, significantly reducing the impact of grid background voltage distortion on the output currents. Experimental results are presented to support the theoretical analysis and to demonstrate the system performance.