When its famous marble quarries closed in the 1980s, Rutland, Vermont, lost hundreds of jobs and its once-thriving economy fell into decline. Foreclosures, unemployment, population loss, heroin addiction, and other ills plagued the town of about 16,500 residents.

But Rutlanders dreamed of a brighter future—literally.

In this far northeast corner of the country, which is known more for its environmental consciousness than its sun, many Rutland residents developed a keen interest in solar energy. They soon found a strong supporter in Mary Powell, the CEO of Green Mountain Power, the local electrical utility.

Powell, a refugee from the world of banking, is an unconventional executive who earned her degree in arts and music, works behind a standing desk, founded a company selling reflective wear for pets, and has a pet pig named Oddball.

She has long been obsessed with meeting her customers’ needs and desires, and since what the customers wanted in Rutland was solar power, Powell was determined to deliver it. Her quest to do so has put Green Mountain—and Rutland—on the front lines of a fundamental shift in the country’s electrical grid and power generation system.

Under CEO Mary Powell, Green Mountain Power built the biggest solar farm in Vermont.

Over the last decade solar panels have spread across the landscape, thanks to rapid technological advances, renewable-friendly policies, new regulations to combat climate change, and a booming global market. Solar power now supplies clean electricity to millions of homes, schools and businesses nationwide.

But as rooftop solar and other forms of distributed electricity generation spread further, it poses critical new challenges for utilities and grid managers.

The electrical grid was designed and built in the last century to manage one-way, high-speed electricity flow from big power plants. But in a few short years it could contend with large volumes of excess electricity sent back to the grid from homegrown solar power and small wind turbines.

What’s more, when the sun ducks behind a cloud or when a stiff breeze dies, solar or wind energy drops off rapidly. As rooftop solar and wind power proliferate, this intermittency could make it harder for utilities to ensure a reliable supply of electricity. Today they do that by quickly firing up, speeding, or slowing a spinning turbine at a central power plant. Controlling countless dispersed solar panels and wind turbines is not so easy.

For these reasons—and to improve the electrical system’s performance—efforts are underway to modernize the grid. The federal government, states, utilities, and transmission system operators have all launched major efforts to transform the grid, with distributed solar as a central component. In 2015 the Obama administration called for Congress to invest an unprecedented $3.5 billion over ten years to modernize the grid and prepare it for higher levels of renewable energy, including an influx of distributed solar. New York State’s ambitious Renewing the Energy Vision (REV) offers incentives for companies to come up with innovative business models that profit from the spread of rooftop solar and other forms of distributed renewable generation.

And while some utilities around the country have tried to curtail the growth of rooftop solar because they view the growth of distributed generation as a threat to their business, other utilities have supported it. But few have worked harder at phasing in distributed solar than Green Mountain Power, and it uses the town of Rutland, Vermont, to prove it works.

There, the utility launched an ambitious plan to scale up solar generation and pilot the responsive, interconnected grid technologies needed to create a leaner and cleaner electricity system. This meant installing solar panels to provide a massive amount of the community’s power. It also meant building a self-contained solar-powered microgrid—a section of the grid that can disconnect from the larger grid to keep electricity flowing even when storms cause regional blackouts.

Ironically, Rutland’s microgrid and distributed solar generation harken back to the past, when massive transmission systems were not yet possible, and electricity was generated and delivered locally.

“It’s a bit of back to the future,” Powell said. “Back to the future, new and improved.”

Here comes the sun

People have used solar power for centuries, constructing dwellings to take advantage of the sun’s warmth and using glass to concentrate sunlight to start fires. Early solar cells were developed in the late 1800s, and in 1954 Bell Labs produced the first photovoltaic (PV) panel that could produce electricity from sunlight.

After decades of development, solar PV began reaching a mass market in the 1990s as technological advances made solar panels more efficient, and policy changes and market forces spurred the young industry to grow. In 1991, Germany implemented a policy that paid rooftop solar panel owners retail rates for the electricity they supplied to the grid. Rooftop solar exploded in that country. Chinese manufacturers stepped up their efforts to meet the new demand, becoming the world’s leading solar panel manufacturer.

Today solar PV provides about 7 percent of Germany’s electricity consumption, and up to 50 percent on sunny weekend days. And technological advances and economies of scale helped drive prices down worldwide. In the United States, for example, the cost of installing residential solar plummeted from more than $9 a watt in 2007 to $4 in 2014, according to the U.S. Department of Energy. This is inexpensive enough that in about 20 states—especially states like Hawaii and California with sunny weather and high energy costs—solar energy has achieved grid parity, meaning that solar costs no more than other forms of energy. Barring major changes in rate structure or incentives, grid parity is expected to spread nationwide by 2020, according to a February report from GTM Research. This could persuade even more Americans to go solar.

Some energy analysts and utilities worry that cheaper solar PV and other distributed generation could trigger a death spiral for utilities, in which customers draw less electricity from the grid, reducing revenues, and forcing utilities to raise rates. This could push more customers into the arms of competing retail energy suppliers, and motivate more people to generate their own energy, reducing utility revenues further.

Some utilities are making preemptive strikes to preserve their revenue under their traditional business model, including proposing surcharges on customers who install solar panels. But a few, including Green Mountain, have embraced the changes.

“The revolution is coming,” Powell said. “Do you want to resist it, do you want to follow it, do you want to be part of it, or do you want to accelerate it? We’re accelerating it.”

Solar plus storage

Green Mountain’s first foray into solar occurred in 2007, when it built a 200-kilowatt solar farm on a brownfield in Berlin, Vermont, a village just outside the state capital, Montpelier. It was the biggest solar farm in Vermont.

A few years later, it shattered that record. In partnership with the solar developer groSolar and using state and federal funding, Green Mountain built a massive solar installation called Stafford Hill on a landfill in Rutland. It went online last summer with 7,700 solar panels that can generate 2.5 megawatts of electricity—15 times more than the utility’s first solar farm, and enough to power about 3,000 homes, or more than a third of Rutland’s total.

Stafford Hill was more than a solar farm—it was part of the country’s first microgrid powered entirely by solar. A microgrid is a small networked section of the grid that can generate its own electricity from distributed generation—solar panels, wind turbines, combined heat and power, geothermal installations, or biodigesters—and can be disconnected from the larger grid to operate autonomously.

Microgrids can benefit utilities by feeding excess electricity they generate into the larger grid for the utility to use. And unlike the old-fashioned grid, which typically stores relatively little energy, they can use that excess energy to charge banks of batteries to draw on later.

To help Rutland’s microgrid function autonomously, for example, Green Mountain stocked it with enough lithium-ion and lead-acid batteries to store up to 3.5 megawatt-hours’ worth of electricity from Stafford Hill’s solar panels and release it at night or on cloudy days.

Microgrids can also boost a town’s disaster resilience. Rutland’s microgrid includes a section of town with the local high school, which serves as an emergency shelter in a region that’s frequently buffeted by severe storms and suffered massive outages in 2011 during Hurricane Irene.

Not your father’s grid

When too much electricity flows onto a traditional grid from rooftops all over town, solar’s natural variability can trigger voltage fluctuations. These flickers in the electricity delivered to customers can interfere with the functioning of electronics, appliances, and industrial equipment.

What’s more, distributed solar causes sharp bursts or drops in electricity when it’s working normally, but those large fluctuations can cause problems on a traditional grid, causing sections of the grid to be automatically disconnected as a safety measure. If a grid depends on solar generation to meet its overall energy demands, such tripping could cause unnecessary electricity shortfalls.

“The grid is like a wave pool,” explained Benjamin Gaddy, director of technology development at the Clean Energy Trust, a Chicago business accelerator. “The question is how do you verify that the new wave of power you’re adding to the existing wave doesn’t knock that wave out of balance.”

The answer is the smart grid.

The traditional grid involves wires and analog equipment delivering electricity to objects that consume it. The smart grid uses Internet of Things technology to add a layer of intelligence. It enables equipment on the grid—smart meters, smart appliances, sensors, batteries, solar panels, smart inverters—to continually collect data on electricity flow, supply and demand, and equipment performance; to communicate with each other, often wirelessly; and to analyze data and coordinate their actions based on their shared virtual intelligence.

“The term smart basically refers to data,” said Mohammad Shahidehpour, director of the Robert W. Galvin Center for Electricity Innovation at the Illinois Institute of Technology. “When we say smart, there’s no smartness physically in the grid. What makes it smart is [that] you provide data to the participants to make smart decisions.”

That may sound simple, but the amount of data is staggering. “There’s terabytes of data coming in, some people even say petabytes,” said Jacob Pereira, a senior analyst with the firm IHS Technology who focuses on the electrical grid and smart meters. “It’s really hard to analyze, hard to collate. It adds an incredible amount of complexity to the grid.”

Networked nodes

Much of the new data in the electrical system is crunched by countless microprocessors located in pieces of equipment, or nodes, all over the grid. A 5-megawatt feeder circuit on a section of the grid with 50 percent solar penetration could have 500 active nodes providing data, the Department of Energy noted. Nodes include sensors, controllers, capacitors, frequency and voltage regulators attached to the wires; smart appliances like dishwashers, thermostats, batteries, electric vehicles, and smart meters in homes; and smart inverters attached to solar panels.

Sophisticated computer programs in these nodes almost instantaneously process that data. This allows the equipment at these nodes to act autonomously on signals that they get from the utility or from other nodes on the smart grid.

The nodes can also send data through wires or wirelessly to the distribution system operator, which is a central nerve center, usually run by a utility, where staff monitors automated functions. This helps the utility keep tabs in real time on system demand, and know exactly how much energy must be fed onto the distribution grid from the high-voltage transmission lines.

When overall system demand is high, the system operator can reduce electricity demand by reaching into smart homes–a key component of the smart grid–and remotely turning appliances off or ratcheting them down. It can also tap batteries to contribute electricity to the grid. And when overall system demand is low, smart-home components soak up electricity— by charging batteries or electric vehicles or by heating water, for example.

The smart grid offers another key benefit: fewer power plants being built, which cuts pollution and saves ratepayers money. “The [electrical] system is tremendously overbuilt and most of that capacity is underutilized,” explained Erik Birkerts, CEO of the Clean Energy Trust, which helps many smart-grid-related startups. Cutting energy use at peak demand times, such as hot summer afternoons, reduces the need to build expensive “peaker plants”—natural-gas-fired power plants that are fired up only occasionally to meet peak demand.

Although the technology and products that make up the smart grid have been developing at a rapid clip over the past decade, the smart grid as a whole is still very much a work in progress. Utilities around the country are still providing their customers smart meters, a crucial piece of the smart grid. Start-up companies are developing new software to manage the smart grid’s components or help consumers change their behavior based on smart-meter data. Software developers and grid managers are still working to develop algorithms and programs to wrangle all the data.

But cutting-edge smart-grid technologies alone will not be enough to facilitate a big influx of distributed solar and other renewables and forge a clean, smart electrical system. That will also require new policies.

A sunny outlook

As Green Mountain Power built out the Stafford Hill solar plant and the nearby microgrid, it also took its clean-energy commitment into territory that utilities often avoid: It crafted a policy that encouraged customers to generate their own power. Individuals and companies who installed solar panels on their homes or businesses, as well as some farmers who used biodigesters to turn cow manure into electricity, were all paid retail rates for power they generated and sent back to the grid.

Green Mountain, like many utilities around the country, has also crafted policies to smarten up the grid, and it has gone farther than most. It’s subsidizing the installation of energy storage and smart appliances at customers’ homes. And this year it became the first utility in the country to offer its customers Tesla Powerwall batteries to lease or buy. Customers receive reduced rates if they allow the utility to draw energy from the battery when the grid needs it. Such batteries have given distributed solar a boost by letting homeowners store up to 6 kWh of solar-generated electricity. That’s enough to power a home through an evening, so it draws less electricity from the grid and cuts the homeowner’s energy bill.

Federal investments in solar energy and microgrids could ultimately make distributed solar cheaper, which might convince other utilities to follow Green Mountain’s lead. The Department of Energy’s SunShot program aims to slash the per-watt price of solar installations by 75 percent from about $4 right now down to $1 by 2020, in large part by improving solar PV technology and mass production. For example, a $1.1 million DOE Sunshot grant to the University of Illinois at Chicago and partner institutions will fund development of cadmium telluride PV cells that could be twice as efficient as conventional PV at turning sunlight into electricity.

States and cities are investing as well. New York State is running a $40 million competition to spur the development of community microgrids, and in 2015 the state awarded $100,000 each to 83 applicants around the state for feasibility studies. Winners of the next round will collectively receive $8 million in awards to develop engineering designs and business plans.

And utilities nationwide, including in larger cities, have undertaken solar and microgrid efforts of their own. In Texas, Austin Energy is leveraging $4.3 million from the U.S. Department of Energy to phase in energy storage technology to reserve excess electricity until it’s needed. It’s also developing new software that aggregates rooftop solar power into a virtual power plant that reduces the need to build a real one. In Chicago, ComEd, Chicago’s local utility, is planning a microgrid in Bronzeville, a historic, mostly low-income neighborhood on the city’s South Side.

But not everyone is on board and supporting the phase-in of solar and a smarter grid. Regulators in Wisconsin, Nevada, and other states have let utilities pay those with rooftop solar wholesale rather than retail rates for the electricity they feed into the grid, and charge high monthly fees for grid upkeep. Experts say this could chill solar.

But overall the momentum is in the other direction. The Obama Administration’s Clean Power Plan, if it survives court challenges, would mandate a 32 percent reduction in U.S. carbon emissions below 2005 levels by 2030. Along with other federal air-pollution rules that mandate expensive pollution controls on power plants, it would drive up the cost of fossil-fuel-fired power and make renewables more competitive.

And many major cities, including New York, Chicago, Milwaukee and San Diego are promoting solar, microgrids and other energy innovations as a way to lure employers who value clean, reliable electricity.

That is what has happened in Rutland, Vermont. The city’s new grid provides clean, reliable energy—and it has helped boost the town’s economy and attract 20 new businesses, Powell and local officials said. These include the solar companies groSolar, Next Sun, and SunCommon; an independent book-seller; and a regional chain of electronics stores.

Rutland’s Downtown Merchants Row also hosts Green Mountain’s Energy Innovation Center, an interactive museum of sorts with displays about energy and regular talks by energy experts. Since becoming a clean energy hub, “We were able to do things we otherwise would not be able to do to better the quality of life, to better the jobs market, to really transform the community,” Rutland mayor Chris Louras has said.

And even though the energy issues of a small Vermont town may differ from those in most cities, the lessons learned in Rutland can translate nationwide, Powell said. Utilities everywhere should appreciate the business case Green Mountain has made for embracing a new energy model, and people anywhere are likely to welcome immediate, concrete impacts on a local level, including reliable clean power, an economic boost, and cutting-edge technology.

In fact, it may be those impacts, more than anything else, that drive an energy revolution.

Kari Lydersen is a Chicago-based reporter and author who writes about science, energy, and the environment.