The document presents a STATCOM control scheme for improving power quality in a grid-connected wind energy generation system. A battery energy storage system is integrated with the STATCOM to help stabilize the grid during fluctuations in wind power. The control scheme is simulated in MATLAB/Simulink. Results show the STATCOM is able to maintain unity power factor at the point of common coupling, reducing harmonics to below 0.01% and frequency oscillations to less than 1%. This allows the system to meet power quality standards while supporting the wind generator and loads on the grid.