Energy Efficient Control of a gy Smart Grid with Sustainable Homes b d Di ib i Ri k based on Distributing Risk Prof. Brian C Williams with support from Masahiro Ono, with support from Masahiro Ono, and Wesley Graybill 8th CMU Electricity Conference March 14th, 2012 Motivation: High Penetration of Renewables Electrical grid must prepare for high penetration of renewables. Challenge: Wind and solar are undispatchable, intermittent, and unpredictable. d d bl Key Elements of Approach 1. Increase controllability on demand side through – Flexible specifications of user needs and preferences, and – goal‐directed optimal planning. 2. Improve robustness to uncertainty in supply and demand through g – risk‐constrained planning and – distributed risk markets. distributed risk markets. 3. Reduce labor, hence adoption barriers, by automating by automating – Inference of expected user and environmental behavior, and – model d l acquisition of physical plant and customer behaviors iii f h i l l d b h i . Architecture: Risk‐constrained, Goal‐directed Grid Control Key Technologies Risk allocation Goal‐direction Framework Market‐based Non‐dispatchable Resource allocation supply l (solar, wind) Dispatchable supply (Micro‐CHP, biomass) Demand Micro-grid Micro grid Contingent power dispatch ~24 hr time scale Goal‐directed p demand response (buildings & E‐cars) Goal‐directed Demand Response p • Today: Demand y is inelastic, supply adapts. pp y p • Goal: introduce flexibility in meeting demand. • Approach: A h – Acquire descriptions of the consumer’s intended activities, constraints and preferences. – Exploit flexibility in activity descriptions to reduce p y y p • overall energy consumption, • peak demand, and peak demand, and • risk of failing to support important consumer activities. 5 Testbed: Connected Sustainable Home Federico Casalegno (PI), MIT Mobile Experience Lab Federico Casalegno (PI) MIT Mobile Experience Lab • • • • Goal: Optimally control HVAC, window opacity, washer/dryer, e‐car. Objective: Minimize energy cost. Uncertainty: Solar input, outside temp, energy supply, occupancy. Risk: Resident goals not satisfied; occupant uncomfortable. 6 Example Goals: Description of Resident Activities Description of Resident Activities “Maintain Maintain room temperature after waking up until I go to work. No temperature constraints while I’m at work, but when I gget home, maintain room temperature p until I ggo to sleep. Maintain a comfortable sleeping temperature while I sleep. Cook dinner within at least an hour of arriving home, andd at least l 3 hours h before b f bed. b d Also, Al dry d my clothes l h before b f morning. I need to use my car to drive to and from work, so make sure it is fully charged by morning. morning It’s It s acceptable if my clothes aren’t ready by morning or if the house is a p degrees g too cold, but myy car absolutelyy needs to be couple ready to use before I leave for work.” 7 Example Goals: Description of Resident Activities Description of Resident Activities “Maintain Maintain room temperature after waking up until I go to work. No temperature constraints while I’m at work, but when I gget home, maintain room temperature p until I ggo to sleep. Maintain a comfortable sleeping temperature while I sleep. Also, dry my clothes before morning. I need to use my car to drive d i to andd from f work, k so make k sure it i is i fully f ll charged by morning. It’s acceptable if my clothes aren’t ready by morning or if the house is a couple degrees too cold, but my car absolutely needs to be ready to use before I leave ffor work.” 8 Example Goals: Description of Resident Activities Description of Resident Activities “Maintain Maintain room temperature after waking up until I go to work. No temperature constraints while I’m at work, but when I gget home, maintain room temperature p until I ggo to sleep. Maintain a comfortable sleeping temperature while I sleep. Also, dry my clothes before morning. I need to use my car to drive d i to andd from f work, k so make k sure it i is i fully f ll charged by morning. It’s acceptable if my clothes aren’t ready by morning or if the house is a couple degrees too cold, but my car absolutely needs to be ready to use before I leave ffor work.” 9 Example Goals: Description of Resident Activities Description of Resident Activities “Maintain Maintain room temperature after waking up until I go to work. No temperature constraints while I’m at work, but when I gget home, maintain room temperature p until I ggo to sleep. Maintain a comfortable sleeping temperature while I sleep. Also, dry my clothes before morning. I need to use my car to drive d i to andd from f work, k so make k sure it i is i fully f ll charged by morning. It’s acceptable if my clothes aren’t ready by morning or if the house is a couple degrees too cold, but my car absolutely needs to be ready to use before I leave ffor work.” 10 Example Goals: Description of Resident Activities Description of Resident Activities “Maintain Maintain room temperature after waking up until I go to work. No temperature constraints while I’m at work, but when I gget home, maintain room temperature p until I ggo to sleep. Maintain a comfortable sleeping temperature while I sleep. Also, dry my clothes before morning. I need to use my car to drive d i to andd from f work, k so make k sure it i is i fully f ll charged by morning. It’s acceptable if my clothes aren’t ready by morning or if the house is a couple degrees too cold, but my car absolutely needs to be ready to use before I leave ffor work.” 11 Flexibility Available to Control • When activities are performed. p • When to charge/discharge batteries. g / g • Which activities to shed (when supply is low). Which activities to shed (when supply is low). 12 Encoding: Qualitative State Plan (QSP) [24 hours] Wake up [1‐3 hour] Maintain room temperature [7‐9 hours] Go to work Home from work Maintain room temperature “Maintain room temperature after waking up until I go to work. No temperature constraints while I’m at work, but when I get home, maintain room temperature until I go to sleep. Maintain a comfortable f bl sleeping l temperature while hl I sleep.” 13 [7‐8 hours] [6‐8 hours] Go to sleep Maintain comfortable sleeping temperature Wake up Encoding: Qualitative State Plan (QSP) [24 hours] Wake up [1‐3 hour] Maintain room temperature [7‐9 hours] Go to work Home from work [7‐8 hours] [6‐8 hours] Maintain room temperature Go to sleep Maintain comfortable sleeping temperature … “Maintain room temperature after waking up until I go to work. No temperature constraints while I’m at work, but when I get home, maintain room temperature until I go to sleep. Maintain a comfortable f bl sleeping l temperature while hl I sleep.” … 14 Wake up Encode the Qualitative State Plan and Dynamics within a Model-Predictive Controller min J(X,U) J(X U) H(xT ) U Cost function Cos u c o (e (e.g. g fuel ue co consumption) su p o ) st s.t. Dynamics (Discrete time) Constraints xt 11 Axt But 0 t T 1 T N M h xt g t 0 i 0 j 0 iT t ij t Mixed Logic or Integer X x0 xt T State vector (e.g. position of vehicle) U u0 ut 1 Control inputs T 15 pSulu Results [24 hours] Wake up Wake p up Maintain room temperature 16 Go to work Home H from work Maintain room temperature Go to sleep Maintain comfortable sleeping temperature Energy Savings: Optimal Control • 42.8% savings in winter over PID • 15.3%, 16.8%, and 4.4% in spring, summer, autumn Energy Savings: Flexibility • Reduction in energy consumption by considering resident id t fl flexibility. ibilit • 10.4%, 1.6%, 1.6%, and 0.7% in the winter, spring, summer, and autumn. Testbed: Connected Sustainable Home Federico Casalegno (PI), MIT Mobile Experience Lab Federico Casalegno (PI) MIT Mobile Experience Lab • • • • Goal: Optimally control HVAC, window opacity, washer/dryer, e‐car. Objective: Minimize energy cost. Uncertainty: Solar input, outside temp, energy supply, occupancy. Risk: Resident goals not satisfied; occupant uncomfortable. 19 Managing Uncertainty and Risk • • 20% usage rate – XeroxisPARC Responsive Environment must study, 1993. Occupancy Uncertain Controller take Each room has a different occupancy profile. profile Occupancy probability risk. Late lunch @ 2pm 100% Crazy night workers Max occupancy rate @ 5pm 0% 12am 6am 12pm 6pm CSAIL students cannot wake up early 12am Control Decisions Imply Risk • When should a controller take risk? – Risk at time t : δt – Acceptable risk over time horizon: ∆ t 0 or pt T t pt : Occupa ancy pro obability δt : Risk a allocated d at t t1 100% δt= 0 δt = pt 0% 12am 6am 12pm 6pm 12am Approach: Risk Allocation with Masahiro Ono Framework : – Chance-constrained Stochastic Optimization. Optimization Methods: – Iterative te at e Risk s Allocation ocat o ((IRA)) algorithm. – Market-based Market based Iterati Iterative e Risk Allocation (MIRA) algorithm. 22 Example: Race Car Path Planning Planned Path Actual Path Goal Walls Start 23 Example: Race Car Path Planning Planned Path Actual Path Goal Walls • C Cannott guarantee t 100% safety. • Driver wants a probabilistic guarantee: P(crash) < 0.1% Chance constraint. Start 24 Chance‐Constrained Optimal Planning minT J (u1:T ) u1:T U st s.t. Stochastic dynamics T 1 Convex function Cost function (e.g. fuel consumption) ( g p ) xt 1 Axt But wt t 00 wt ~ N (0, t ) x0 ~ N ( x0 , x , 0 ) 25 Assumption: Δ < 0.5 iT i Pr ht xt g t 1 t 1 i 1 T N Chance constraint Chance constraint Risk bound (Upper bound of the probability of failure) probability of failure) Example: Race Car Path Planning Planned Path Actual Path Safety Margin Walls Safety Margin n Goal • C Cannott guarantee t 100% safety. • Driver wants a probabilistic guarantee: P(crash) < 0.1% Chance constraint. Start • Approach: design safety margin. 26 Iterative Risk Allocation (IRA) Algorithm • Starts from a suboptimal risk allocation. • Improves the risk allocation through iteration. iteration Iteration 27 Iterative Risk Allocation Algorithm Algorithm IRA No gap = Constraint is active 1 2 3 G Goal 4 Best available path given the safety margin 5 Safety margin Start 6 Gap = constraint is inactive 28 Initialize with arbitrary risk allocation. Loop Compute p the best ppath for the current risk allocation. Decrease risk where a constraint t i t is i inactive. i ti Increase risk where a constraint is active. End loop Iterative Risk Allocation Algorithm Algorithm IRA 1 2 3 G Goal 4 5 Safety margin Start 6 29 Initialize with arbitrary risk allocation. Loop Compute p the best ppath for the current risk allocation. Decrease risk where a constraint t i t is i inactive. i ti Increase risk where a constraint is active. End loop Iterative Risk Allocation Algorithm Algorithm IRA 1 2 3 G Goal 4 5 Safety margin Start 6 30 Initialize with arbitrary risk allocation. Loop Compute p the best ppath for the current risk allocation. Decrease risk where a constraint t i t is i inactive. i ti Increase risk where a constraint is active. End loop Robust-IRA- MPC for Dynamic Window Solar heat input Outside temperature Comfortab C ble range Ro oom Temp perature 6am 12pm 6pm Heat the room using sunlight sunlight… Optimal temperature …so so that the temperature will stay within the comfortable range WITHOUT using heaters in the night 31 Application: Building Control (a) First Iteration 30°C Active 25°C 22°C 22 C 20°C 18°C Home Asleep 5°C 0 am (b) Second Iteration Active Away Home Home Asleep Away Home Inactive 8 am 12 pm 5 pm 12 pm 0 am 8 am 12 pm 5 pm 12 pm : Safety S f t margin i : Optimal plan at current iteration : Optimal plan at previous iteration Take risk of violating resident constraints where largest energy savings are possible. Robust-IRA-MPC Results Margin protects against uncertainty 33 Results Improvement in Comfort • Deterministic control (Sulu): 30% comfort violations. i l ti • Risk-sensitive control (p-Sulu): near 0% violations. ((Sub)Urban ) Scale Sustainability y • Heterogeneous connected homes with different energy sources. • Symmetric energy exchange between houses. houses • Challenge: – How to distribute energy optimally, – while limiting the risk of an energy gy shortage, g , – without centralized control. Allocation between Risk‐coupled Agents p g Operator I i i min J ( U ) 1:I 1:I specifies U U System’ss risk bound: System risk bound: 0.1% s.t. Risk is distributed among agents + 0.04% Multi‐agent i 1 I N i iT i i Pr hn X g n 1 i 1 n 1 0.06% Decomposed, deterministic RA reformulation min 1:I 1:I U U , i1::NI s.t. Risk is distributed among constraints 1 1 0.02% 1 2 0.01% 1 3 0.01% 0.01% 2 1 2 2 0.02% 37 2 3 0.03% I i i J ( U ) i 1 hniT X i g ni mni ni i n I Ni i n i 1 n 1 Allocation between Risk‐coupled Agents p g Operator I i i min J ( U ) 1:I 1:I specifies U U System’ss risk bound: System risk bound: 0.1% Risk is distributed among agents 0.04% + Multi‐agent s.t. i 1 I N i iT i i Pr hn X g n 1 i 1 n 1 0.06% Decomposed, deterministic reformulation min 1:I 1:I U U , i1::NI • Need to optimize risk allocation between p agents since they have different sensitivities to risk. s.t. I i i J ( U ) i 1 i n I Individual risk bounds System’s risk bound 38 hniT X i g ni mni ni Ni i n i 1 n 1 Market‐based Iterative Risk Allocation Operator supplies risk Operator specifies System’ss risk bound: System risk bound: 0.1% Risk is distributed among agents 0.04% + 0.06% Agents consume risk 39 Individual Demands risk for bounds risk System’s Supply risk of bound risk • Treat each agent as an i d independent d d decision maker. k • Agents communicate through market. g y p • Find a globally optimal solution through iteration. Approach is economically • Approach is economically inspired (tâtonnement): – Risk Risk is a resource is a resource traded in a traded in a market. – Each agent has a demand Each agent has a demand for risk for risk as a function of the price of risk. Based on Dual Decomposition Risk taken by Decentralized the i’th agent Optimization Centralized Optimization ((decomposed, p , deterministic form)) 1:I min 1:I U U s.t. , i1::NI I J (U i i i’th agent: t (Primal) (P i l) i i i min J ( U ) pD i i i ) U U ,1:N i 1 I T x i t 1 i 1 t 1 I N Ax Bu i i t i i 1 n 1 I N i i n i n xti1 Ai xti B i uti t 1 N h X g m iT n s.t. i t Dual variable T = Price of risk hniT X i g ni mni ni i n n 1 Ni for risk D i ni Demand from i’th agent i i n n 1 i 1 n 1 Market (Dual) Convex optimization I *i D ( p) i 1 40 Root finding problem 41 Market-based Contingent Power Dispatch • Two kinds of energies are traded in a market: Prob bability de ensity – Nominal power – Contingent power Predicted load Micro-grid Load (kW) Mean: 300kW =Nominal N i l power Standard deviation: 50kW = Contingent power Key Elements of Approach 1. Increase flexibility on demand side through – flexible specifications of user needs and preferences, and – goal‐directed optimal planning. 2. Improve robustness to uncertainty in supply and demand through g – risk‐constrained planning, and – Distributed risk markets. Distributed risk markets. 3. Reduce labor, hence adoption barriers, by automating – Inference of expected user behavior, and Inference of expected user behavior and – Models of environment and plant. Questions?