The distribution static compensator (DSTATCOM) provides fast control of active and reactive powers to enable load compensation, harmonics current elimination, voltage flicker mitigation, voltage and frequency regulation. This paper presents power quality improvement technique in the presence of grid disturbances and wind energy penetration using DSTATCOM with battery energy storage system. DSTATCOM control is provided based on synchronous reference frame theory. A modified IEEE 13 bus test feeder with DSTATCOM and wind generator is used for the study. Power quality events during grid disturbances such as feeder tripping and re-closing, voltage sag, swell and load switching have been studied in association with DSTATCOM. The power quality disturbances due to wind generator outage, synchronization and wind speed variations have also been investigated. The study has been carried out using MATLAB/SIMULINK and the simulation results are compared with real time results obtained by the use of real time digital simulator (RTDS) for validating the effectiveness of proposed methodology. The proposed method has been proved to be effective in improvement of power quality with all disturbances stated above. © 2016 Elsevier Ltd. All rights reserved.