## 3 Self-Triggered Control for Islanded Microgrids under DoS Attacks
### Improved Ternary Self-Triggered Control Law Under DoS Attacks
**Remark 3:**_In the secondary control framework of microgrids, communication networks can be implemented by means of wired technologies such as RS-232, ModBus, and Power-Line Communication, or wireless technologies such as Wi-Fi and ZigBee. For a successful information exchange between agents, the protocols for data transmission such as TCP/IP and IEC 61850 are also needed [34]. Assumption 1 does not require the agents to detect the occurrence of the attack in real-time, but it needs agents to know the communication failure at triggering time instant is caused by DoS attacks. This is a general assumption in the attack-resilient control scheme [20; 21; 32]. In wireless communication networks, statistical metrics such as signal strength consistency, packet send ratio (PSR), and packet delivery ratios (PDR) can be adopted to detect radio interference induced DoS attacks [29]. In wired communication networks, computationally low-cost machine learning methods, such as SVM and neural networks, can detect DoS attacks according to the abnormal traffic features with high accuracy [30; 35]. The abovementioned detection algorithms are not difficult to apply in microgrid systems, since the local microcontroller of DGs has powerful computing capacity._  
The triggering conditions are defined as \(S_{1}(t)\) and \(S_{2}(t)\), and can be expressed as follows  
\[\left\{\begin{array}{l}S_{1}(t)=\left\{ \begin{array}{l}(i,\ j)\in\Xi: \theta^{ij}(t)=0\right\}\\ S_{2}(t)=\left\{\begin{array}{l}(i,\ j)\in\Xi:\ \delta^{ij}(t):0\to 1 \end{array}\right\}\end{array} \right. \tag{10}\]  
where \(S_{1}(t)\) indicates that when clock variable \(\theta^{ij}(t)\) reaches 0, there will be a communication attempt between neighboring agents \(i\) and \(j\); \(S_{2}(t)\) is the ACK-based mechanism induced triggering condition and indicates that when the sleep period of DoS attacks is detected, agents \(i\) and agent \(j\) can successfully exchange information as well. Define \(dev^{ij}=x_{j}^{AVE}-x_{i}^{AVE}\) as the relative state difference between the agents \(i\) and \(j\), and the function \(sign_{\varepsilon}\big{(}dev^{ij}\big{)}\in\{-Y,0,Y\}\) can be expressed as  
\[sign_{\varepsilon}\big{(}dev^{ij}\big{)}=\left\{\begin{array}{l}Ysign\big{(} dev^{ij}\  
\[u^{ij}(t)=\left\{ \begin{array}{ll}\delta^{ij}(t)\text{sign}_{\varepsilon}\big{(} \text{{dev}}^{ij}\big{)},&\text{if }\left\{(i,\ j)\in S_{1}(t)\ \wedge\ \delta^{ij}(t)=1\right\}\text{or }(i,\ j)\in S_{2}(t)\\ 0,&\text{if }(i,\ j)\in S_{1}(t)\ \wedge\ \delta^{ij}(t):1\to 0\end{array} \right. \tag{12}\]  
\[\theta^{ij}(t)=\left\{ \begin{array}{ll}f^{ij}(x(t)),&\text{if }\left\{(i,\ j)\in S_{1}(t)\ \wedge\ \delta^{ij}(t)=1\right\}\text{or }(i,\ j)\in S_{2}(t)\\ 0,&\text{if }(i,\ j)\in S_{1}(t)\ \wedge\ \delta^{ij}(t):1\to 0\end{array} \right. \tag{13}\]  
where  
\[f^{ij}(x(t))=\left\{ \begin{array}{ll}\frac{|\text{dev}^{ij}|}{2Y\big{(}d_{ 1}+d_{2}\big{)}},&\text{if }|\text{dev}^{ij}|\geq\varepsilon\\ \frac{\varepsilon}{2Y\big{(}d_{1}+d_{2}\big{)}},&\text{otherwise}\end{array} \right. \tag{14}\]  
Equations (12)-(14) suggest that the control input \(u^{ij}(t)\) and the clock variable \(\theta^{ij}(t)\) is updated synchronously according to the relative state difference \(\text{dev}^{ij}\) when the communication link \((i,\ j)\in\Xi\) works in normal condition and \(\theta^{ij}(t)\) reaches 0, or when the sleep period of attacks is detected by the ACK-based monitoring mechanism. When \(\theta^{ij}(t)\) reaches 0 and the communication attempts are denied by the jamming period of attack, the control signal \(u^{ij}(t)\) is set to 0. According to the above analysis, the successful communication time instants between agents \(i\) and \(j\) are discrete, and can be represented as  
\[t_{k+1}^{ij}=\left\{ \begin{array}{ll}t_{k}^{ij}+f^{ij}\Big{(}x\Big{(}t_{k}^ {ij}\Big{)}\Big{)},&\text{if }\delta^{ij}\Big{(}t_{k}^{ij}\Big{)}=1\\ t_{\delta^{ij}_{l}(t):0\to 1}^{ij},&\text{if }\delta^{ij}\Big{(}t_{k}^{ij} \Big{)}=0\end{array} \right.