Automatic Distributed Voltage Control Algorithm in Smart Grids Applications