You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docusaurus/docs/Devices/electric_vehicle_v1g_mpc.md
+44-6Lines changed: 44 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,9 +4,9 @@ sidebar_position: 4
4
4
5
5
# Electric Vehicle V1G MPC
6
6
7
-
The electric vehicle (EV) is an important component of modern residential energy systems, contributing to power demand during charging, especially in highly electrified homes subject to Demand Response (DR) events. The Model Predictive Control (MPC) formulation for the EV optimizes charging to maintain a desired State of Charge (SoC) while respecting grid power constraints and user preferences, such as EV availability for charging. This section presents the EV MPC formulation in V1G mode (charging only), which uses a binary switch to control charging based on a branched profile indicating when the EV is connected. This approach enables efficient power allocation during service restoration, enhancing grid stability and integration with Home Energy Management Systems (HEMS).
7
+
The electric vehicle (EV) is an important component of modern residential energy systems, contributing to power demand during charging, especially in highly electrified homes subject to Demand Response (DR) events. The Model Predictive Control (MPC) formulation for the EV optimizes charging to maintain a desired State of Charge (SoC) while respecting grid power constraints and user preferences, such as EV availability for charging. This section presents the EV MPC formulation in V1G mode (charging only), which uses a continuous control variable to modulate charging power based on a branched profile indicating when the EV is connected. This approach enables efficient and flexible power allocation during service restoration, enhancing grid stability and integration with Home Energy Management Systems (HEMS).
8
8
9
-
The EV formulation uses a binary control variable to model the charging state (on/off), combined with a branched profile reflecting EV availability (e.g., when plugged in). This design balances user comfort by minimizing SoC deviations and ensures computational efficiency through a mixed-integer linear programming framework. The integration of charging efficiency and self-discharge improves model accuracy, while the branched profile allows the controller to adapt to user schedules, making it practical for residential applications.
9
+
The EV formulation uses a continuous control variable (0-1) to model the charging power modulation, combined with a branched profile reflecting EV availability (e.g., when plugged in). This design balances user comfort by minimizing SoC deviations and ensures computational efficiency through a linear programming framework, while providing precise power control. The integration of charging efficiency and self-discharge improves model accuracy, while the branched profile allows the controller to adapt to user schedules, making it practical for residential applications.
10
10
11
11
### Optimization Formulation
12
12
@@ -32,12 +32,12 @@ where:
32
32
- $ S^{EV-C}_{k} $ is the charging power at time $ k $.
33
33
- $ \Delta t $ is the duration of the time step (in hours).
34
34
35
-
Charging power is controlled by a binary switch and EV availability:
35
+
Charging power is controlled by a continuous variable and EV availability:
36
36
$$
37
37
S^{EV-C}_{k} = U^{EV}_{k} B_{k} S^{EV,\max}, \quad \forall k
38
38
$$
39
39
where:
40
-
- $ U^{EV}_{k} \in \{0, 1\} $ is the binary variable controlling the charging state at time $ k $.
40
+
- $ U^{EV}_{k} \in [0, 1] $ is the continuous variable controlling the charging power level at time $ k $.
41
41
- $ B_{k} \in \{0, 1\} $ is the branched profile indicating EV availability (1 if connected, 0 otherwise).
42
42
- $ S^{EV,\max} $ is the maximum charging power.
43
43
@@ -62,15 +62,52 @@ $$
62
62
X^{EV}_{T} \geq X^{EV}_{\text{final}}
63
63
$$
64
64
where $ X^{EV}_{\text{final}} $ is the required state of charge at the end of the horizon.
65
+
-**Power Ramping Constraints** (optional, for smoother transitions):
where $ R^{EV}_{\max} $ is the maximum allowed rate of change in the control variable between consecutive time steps. This constraint can be enabled or disabled via the `enable_ramping` parameter and helps ensure smoother power transitions, reducing stress on the battery and improving grid stability. The ramping rate typically ranges from 0.1 to 0.5 per time step.
65
70
66
71
The power allocated to the EV, which contributes to the global power constraint, is:
67
72
$$
68
73
S^{EV}_{k} = S^{EV-C}_{k}, \quad \forall k
69
74
$$
70
75
76
+
### Ramping Constraints for Smooth Power Transitions
77
+
78
+
The EV MPC implementation includes optional power ramping constraints that limit the rate of change in charging power between consecutive time steps. These constraints provide several benefits:
79
+
80
+
**Benefits of Ramping Constraints:**
81
+
-**Battery Health**: Gradual power changes reduce stress on the battery system
82
+
-**Grid Stability**: Smooth transitions minimize sudden load changes that could affect grid stability
83
+
-**User Comfort**: Reduced electrical noise and smoother operation
84
+
-**Hardware Protection**: Prevents rapid switching that could stress charging infrastructure
85
+
86
+
**Mathematical Implementation:**
87
+
The ramping constraints are implemented by limiting the change in the continuous control variable $ U^{EV}_{k} $ between consecutive time steps:
88
+
$$
89
+
U^{EV}_{k+1} - U^{EV}_{k} \leq R^{EV}_{\max}
90
+
$$
91
+
$$
92
+
U^{EV}_{k} - U^{EV}_{k+1} \leq R^{EV}_{\max}
93
+
$$
94
+
95
+
**Configuration Parameters:**
96
+
-`enable_ramping`: Boolean flag to enable/disable ramping constraints (default: `True`)
97
+
-`max_power_ramp_rate`: Maximum allowed rate of change per time step (default: `0.2`)
98
+
99
+
**Validation Results:**
100
+
Extensive testing has demonstrated that ramping constraints:
101
+
- Shape the entire optimization trajectory, not just individual transitions
102
+
- Work seamlessly with continuous control to provide precise power management
103
+
- Allow fractional switch values that represent optimal power modulation
104
+
- Maintain optimization effectiveness while ensuring smoother operation
105
+
106
+
The ramping constraints are particularly valuable in scenarios with frequent charging schedule changes or when grid stability is a priority. They can be easily disabled for applications where maximum charging flexibility is preferred over smooth transitions.
107
+
71
108
### Justification of the Formulation
72
109
73
-
The EV formulation uses a binary control variable to model the charging state (on/off), which reflects the practical reality that EVs typically charge at a fixed power when active. The branched profile $ B_{k} $ accounts for user schedules, ensuring that charging only occurs when the EV is connected—a critical aspect for residential applications where the vehicle may be unplugged during the day. The comfort penalty favors maintaining a desired residual energy state, ensuring the vehicle is ready for use while reducing demand peaks during DR events. The integration of charging efficiency and self-discharge improves model accuracy, while the mixed-integer linear formulation balances computational complexity with the need for precise control. This approach is well-suited for real-time optimization on embedded devices and facilitates integration with HEMS by respecting user priorities and grid constraints.
110
+
The EV formulation uses a continuous control variable (0-1) to model the charging power modulation, which provides flexible power allocation while maintaining computational efficiency through a linear programming framework. This continuous approach allows for precise power control and better integration with grid-level optimization, especially during demand response events where partial charging may be more beneficial than simple on/off control. The branched profile $ B_{k} $ accounts for user schedules, ensuring that charging only occurs when the EV is connected—a critical aspect for residential applications where the vehicle may be unplugged during the day. The comfort penalty favors maintaining a desired residual energy state, ensuring the vehicle is ready for use while reducing demand peaks during DR events. The integration of charging efficiency and self-discharge improves model accuracy, while the linear formulation ensures computational efficiency and fast convergence. This approach is well-suited for real-time optimization on embedded devices and facilitates integration with HEMS by respecting user priorities and grid constraints while providing smooth power modulation capabilities.
74
111
75
112
### Variable Definitions
76
113
@@ -82,8 +119,9 @@ Variables and parameters specific to the EV formulation are summarized in the fo
82
119
| $ S^{EV}_{k} $ | Power allocated to the EV at time $ k $ | W |
83
120
| $ X^{EV}_{k} $ | Residual energy (SoC) at time $ k $ | Wh |
84
121
| $ X^{d}_{EV} $ | Desired state of charge (constant) | Wh |
85
-
| $ U^{EV}_{k} $ |Binary variable for charging state at time $ k $ | - |
122
+
| $ U^{EV}_{k} $ |Continuous variable for charging power level at time $ k $ (0-1)| - |
86
123
| $ B_{k} $ | Branched profile (0 or 1) indicating EV availability at time $ k $ | - |
124
+
| $ R^{EV}_{\max} $ | Maximum allowed ramping rate for control variable | - |
0 commit comments