## 2 Sensitivity-Based VPP Control Algorithm
### VPP Control Algorithm
\[\exists i\in\{1,2,\ldots,N\},\qquad V_{i}>V_{threshold} \tag{5}\]  
When an overvoltage condition occurs, the monitoring bus with the highest voltage above the threshold is selected as the primary control target, as specified in Equation (6). \[i^{*}=arg\;\text{max}\{V_{i}|V_{i^{*}}>V_{threshold}\} \tag{6}\]  
Figure 4: VPP control algorithm flowchart. The DER group associated with the prioritized bus \(i^{*}\) is activated for control, while the DER groups of all other buses are deactivated. This control activation is described in Equation (7). \[Control_{i^{*}}=1,\hskip 28.452756 ptControl_{i}=0,\hskip 28.452756 pt\forall i\
eq i ^{*} \tag{7}\]  
After controlling the voltage of bus \(i^{*}\), if another bus remains in an overvoltage state and its voltage exceeds \(V_{i^{*}}\), the control priority dynamically shifts to the new bus. The new prioritized bus, \(J^{*}\), is determined as shown in Equation (8). \[j^{*}=arg\max\{V_{j}|V_{j^{*}}>V_{threshold}\ and\ j\
eq i^{*}\} \tag{8}\]  
The control state is then updated according to Equation (9). \[Control_{j}=1,\hskip 28.452756 ptControl_{i^{*}}=0 \tag{9}\]  
The active power adjustment for each DER group is performed only for the bus with an active control state, as expressed in Equation (10). \[f(x)=\left\{ \begin{array}{cl}A_{djust},&if\ Control_{i}=1\\ 0,&otherwise\end{array} \right. \tag{10}\]  
The system is considered stabilized when the voltage at all monitoring buses falls below the overvoltage threshold, as defined in (11). \[Stabilized=\bigwedge_{i=1}^{N}(V_{i}\leq V_{threshold}) \tag{11}\]  
The proposed control strategy dynamically adjusts the control priority in real-time, ensuring that the DER group associated with the bus experiencing the highest overvoltage is prioritized for mitigation. As described in Equations (6) and (7), this approach ensures that the bus with the most critical voltage condition is addressed first. Furthermore, the dynamic priority adjustment in Equations (8) and (9) allows for seamless transitions between control targets if the voltage conditions change during operation. The active power adjustment described in Equation (10) ensures that only the targeted DER group is adjusted, avoiding unnecessary interventions in other buses. Finally, the stabilization criterion in Equation (11) guarantees that the system achieves voltage regulation across all monitoring buses. The same algorithm can also be applied to mitigate undervoltage conditions in VPP. In the case of undervoltage, the control strategy prioritizes the monitoring bus with the lowest voltage below the undervoltage threshold, \(V_{threshold\ low}\). The index of the prioritized bus, \(i^{*}\), is determined as shown in Equation (12). \[i^{*}=arg\ min\{V_{i}|V_{i}<V_{threshold\ low}\} \tag{12}\]  
Once the prioritized bus is identified, the DER group associated with this bus is activated to increase its voltage, while the control states of all other buses remain deactivated. The activation of the control state and the active power adjustment follow the same logic as described in Equations (7) and (10), respectively. Additionally, dynamic priority adjustment, as described in Equations (8) and (9), ensures that the control target shifts to another bus if it experiences a more severe undervoltage condition during the stabilization process. The system is considered stabilized when the voltage at all monitoring buses rises above the undervoltage threshold, as defined in Equation (13). \[Stabilized=\bigwedge_{i=1}^{N}(V_{i}\geq V_{threshold\ low}) \tag{13}\]