1 Introduction

Over the years, the restoration of good Power Quality (PQ) has played a crucial role in ensuring a secure level in distribution systems. PQ has been impacted by power electronics which results in disruptions such as harmonic distortion and voltage swell and sag. It has always been difficult to keep PQ at a respectable level [1, 2]. Poor power quality from PQ problems can cause higher losses, unfavorable device behavior, interference issues, and other problems. Facts devices and power electronic controlled renewable generating units like Wind, Solar, and Hybrid Wind-PV can aid in annihilating the power system issues in various aspects [3,4,5,6,7,8]. However, these devices may not be suitable for effectively addressing PQ issues. Active filters have limitations in their frequency range and require complex control systems. Several researchers have utilized Distribution Static Compensators (DSTATCOM), which have proven to be beneficial for a wide range of applications. DSTATCOM offers advantages such as voltage regulation, sinusoidal voltage maintenance, mitigation of voltage sag, load balancing, PQ improvement, and harmonics elimination [9,10,11,12,13,14]. However, these advantages may not cover various fault conditions, current limiting conditions, and variable supply frequencies. Considering both economic and technical feasibility, utilizing DSTATCOM for PQ mitigation through optimization procedures is a major contributing factor.

Average Unit Power Factor (AUPF), and Active Power Filters (APFs) are used in DSTATCOM to avoid PQ problems under balanced and static load conditions [15]. APFs can effectively handle PQ issues and provide advantages like grid phase/frequency estimation, but they entail a complex control system. SRF-based DSTATCOM is relatively easy to implement in ideal grid conditions, but the system is susceptible to voltage harmonics. Nowadays advanced intelligence techniques including machine learning and metaheuristic optimizers [16] have proven their utilities in power systems and other sectors [17,18,19,20] as well.

Literature papers focusing on PQ enhancement with FACTS devices in the distribution system using various techniques and aspects were examined in [21,22,23,24,25,26,27,28,29,30,31,32,33]. The utilization of DBN (Deep Belief Nets) and CNN (Convolutional Neural Networks) for the PQ improvement with the integration of DSTATCOM was illustrated by P. Sah and B.K. Singh [21]. Current distortion mitigation, voltage profile improvement, DSTATCOM reactive power control, and harmonics minimization were solved by the DBN and CNN techniques. Under various loading situations, the performance of single-stage solar PV systems was researched by T. Pidikiti et al. [22]. The operation of inverter control using the Takagi–Sugeno-Kang Fuzzy (TSKF) controller with the consideration of irregular solar irradiation was presented. In the investigation, the presented method gives a quick response over the conventional Proportional Integral (PI) controllers. A control approach and model for a hybrid system connected with a power grid have been presented by Kumar, S. et al. [23]. Using voltage and current controllers based on proportional integrals (PI), the control system produces a modulating signal that varies sidewise. Furthermore, the integration of a DSTATCOM at the coupling point satisfies the objectives of reactive power compensation. The implementation of DSTATCOM for PQ augmentation using weighted optimization has been described by Khadse, D. and Beohar, A. [24]. Research for assessing DSTATCOM allocation in distribution systems with innovative methods has been presented by Tolba, M.A. et al. [25]. With an ideal integration of inverter-based solar photovoltaic with and without DSTATCOM capabilities, Ebeed, M. et al. [26] have clarified the distribution network's security and reliability indices under variable load demand and PV output power.

The OPF (Optimal Power Flow) analysis with nonlinearities using an intelligent technique was illustrated by A. Amarendra et al. [27]. The utilized technique was the Yin-Yang Pair technique to enhance the searching behavior. Newton Raphson's (NR) approach was performed for OPF analysis with the integration of STATCOM, UPFC, and Interline Power Flow Controller (IPFC). The multi-objective function like deviation in voltage, fuel and investment cost minimization, and power loss reduction was obtained but %THD analysis is not included. The load compensation concept has been performed to acquire the DC bus voltage according to the grid requirement. The PQ was improved by optimization strategy to obtain the best-switching pulse of the converter for balanced and unbalanced systems but converter cost affects the system economically Khadse D, Beohar A [28]. The goal of Lone, R.A. et al. [29] was minimizing the power losses and enhancing the voltage profile, and voltage stability index in distribution networks. DG integration with the 3ϕ distribution system in the nonlinear load scenario was established by P.V.V. Satyanarayana et al. [30]. Using a hybrid optimization that incorporates the learning approaches Sujatha, B.C. et al. [31] have completed the optimal planning issue of energy sources and storage with DSTATCOM considering network reconfiguration. An optimization-based fractional order controller to control the DSTATCOM in bus system was demonstrated by Vali, A.K. et al. [32]. An efficient technique for enhancing distribution system performance through the simultaneous deployment of distributed generation (DG), optimal network reconfiguration, and remote-controlled sectionalized switches has been described by Alanazi, A. and Alanazi, T.I. [33].

To improve power quality and system efficiency, DSTATCOM deployment in distribution systems must be done as efficiently as possible.

1.1 Shortcomings in the existing state-of-the-art

Existing optimization techniques and traditional methods have exhibited certain drawbacks that necessitate further research. The salient points include:

  • Traditional techniques often rely on manual or heuristic approaches for DSTATCOM placement, which may not fully exploit the potential benefits or address complex system dynamics. These methods may overlook important factors such as load variations, network topology, and operational constraints, leading to suboptimal solutions.

  • Furthermore, traditional techniques may struggle to accommodate the nonlinear and time-varying nature of distribution systems, limiting their effectiveness in dynamic environments. They may also lack robustness and scalability, making them unsuitable for large-scale distribution networks or scenarios with diverse operating conditions.

  • The existing optimization techniques, while more sophisticated, may encounter challenges related to computational complexity, convergence speed, and solution optimality. Many optimization algorithms require extensive computational resources and time-consuming simulations, hindering their practical applicability for real-time or online implementation.

  • Additionally, these methods may suffer from convergence issues or provide solutions that are sensitive to initial conditions or algorithm parameters. Moreover, existing optimization techniques may not adequately consider uncertainties in system parameters, such as load variations, renewable energy generation, and network disturbances. This can lead to suboptimal or unreliable DSTATCOM placement strategies, compromising system performance and stability.

  • In summary, while traditional techniques and existing optimization methods have contributed valuable insights into DSTATCOM placement, there is a need for further research to overcome their limitations.

1.2 Research contributions

Addressing these drawbacks can lead to the development of more effective and robust optimization techniques that optimize DSTATCOM placement while considering the dynamic and uncertain nature of distribution systems. Hence to alleviate the above issues, a Multiple Complex Coefficient Filter (MCCF) with Prairie Dog Optimization (PDO) is utilized in the research work. PDO gives the perfect updating behavior, higher capability, and stronger performance over the other algorithms. The salient features include:

  • Unlike traditional techniques, which may suffer from sensitivity to changing operating conditions and complex control systems, the proposed approach combines Multiple Complex Coefficient Filter (MCCF) with Prairie Dog Optimization (PDO) algorithm for optimal placement of DSTATCOM. This integration offers a more efficient and effective solution, addressing the limitations of conventional methods.

  • The study includes a comprehensive evaluation using real-world simulations on the IEEE 34 bus test system, validating the practical applicability and robustness of our approach in improving power quality under fault conditions.

  • Overall, the work represents a significant advancement in power quality improvement, offering a novel and effective solution that surpasses existing methods in terms of efficiency, reliability, and practical applicability.

2 Modelling of the system under study

Figure 1 displays a single-line diagram of the system under study. Voltage Source Converter (VSC), filter, and load are components of the DSTATCOM. Figure 2 shows the schematic diagram of DSTATCOM, which consists of a VSC-based DSTATCOM linked to a 3ϕ AC power supply and a load with a source impedance [34,35,36]. The VSC AC output is connected to interacting inductors to lessen the ripple in the compensating currents.

Fig. 1
figure 1

Single-line diagram of the system under study

Fig. 2
figure 2

Schematic diagram for the PQ improvement using DSTATCOM

The VSC AC output is connected to interacting inductors to lessen the ripple in the compensating currents. To counteract the reactive power components and load current harmonics, DSTATCOM compensatory currents are injected.

The mathematical modeling for the DSTATCOM [37] and its parameters is formulated in the following: The equation for the DC bus capacitor voltage (\(V_{DC}\)) is represented.

$$V_{DC} = \frac{{2.8284V_{LL} }}{1.7320m}$$
(1)

where the modulation index is represented as ‘\(m\)’, AC double line output voltage is specified as \(V_{LL}\). DC bus capacitor (\(c_{DC}\)) is calculated using nominal and estimated DC bus voltage.

$$c_{DC} = K\,\frac{{2\left\{ {V_{ph} \left( {c.I} \right)t} \right\}}}{{\left\{ {\left( {V_{DC} } \right)^{2} - \left( {V_{DC1} } \right)^{2} } \right\}}}$$
(2)

where the minimum level of DC bus voltage is indicated as \(V_{DC1}\), the nominal value of DC voltage is specified as \(V_{DC}\), the overloading factor is represented as ‘\(c\)’, phase voltage is specified as \(V_{ph}\), phase current is represented as ‘\(I\)’, and the time taken for the recovery state of DC bus voltage is expressed as ‘\(t\)’, \(K\) represents a control variable that varies from 0.05 to 0.15. The AC inductance for DSTATCOM (\(l_{F}\)) is derived.

$$l_{F} = \frac{{1.7320\,m\,V_{DC} }}{{12cf_{S} I_{cr(p.p)} }}$$
(3)

where the current ripple is indicated as \(I_{cr(p.p)}\), switching frequency is specified as \(f_{S}\). For the 3ϕ source voltage (\(V_{sa}\), \(V_{sb}\), \(V_{sc}\)) the PCC voltage value for three-phase measurement (\(V_{pcc}\)) is formulated as:

$$V_{pcc} = \sqrt {\frac{{2\,\left( {V_{sa}^{2} + V_{sb}^{2} + V_{sc}^{2} } \right)}}{3}}$$
(4)

The in-phase unit prototype of PCC (\(U_{ai}\), \(U_{bi}\), \(U_{ci}\)) are equated as:

$$U_{ai} = \frac{{V_{a} }}{{V_{pcc} }}$$
(5)
$$U_{bi} = \frac{{V_{b} }}{{V_{pcc} }}$$
(6)
$$U_{ci} = \frac{{V_{c} }}{{V_{pcc} }}$$
(7)

where three-phase voltages are specified as \(V_{a}\), \(V_{b}\) and \(V_{c}\). The quadrature unit prototype of PCC (\(U_{aq}\), \(U_{bq}\), \(U_{cq}\)) are expressed as:

$$U_{aq} = \frac{{\left( { - U_{bi} + U_{ci} } \right)}}{1.7320}$$
(8)
$$U_{bq} = \frac{{1.7320U_{ai} + U_{bi} - U_{ci} }}{2.4493}$$
(9)
$$U_{cq} = \frac{{ - 1.7320U_{ai} + U_{bi} - U_{ci} }}{2.4493}$$
(10)

The equations for the DC power components are derived as:

$$P_{DC} = P_{load} - P_{o}$$
(11)
$$Q_{DC} = Q_{load} - Q_{o}$$
(12)

where the DC component's power is indicated as \(P_{DC}\) and \(Q_{DC}\), instantaneous load power is specified as \(P_{load}\) and \(Q_{load}\), oscillating power components are specified as \(P_{o}\) and \(Q_{o}\). The \(P_{load}\), \(Q_{load}\) are expressed as,

$$P_{load} = V_{pcc} \left( {I_{la} U_{ai} + I_{lb} U_{bi} + I_{lc} U_{ci} } \right)$$
(13)
$$Q_{load} = V_{pcc} \left( {I_{la} U_{aq} + I_{lb} U_{bq} + I_{lc} U_{cq} } \right)$$
(14)

2.1 Source current estimation for active power components

Figure 3 depicts the power components of the source current estimation. The Eqs. (1517) represent the source current equations related to active power component is expressed as \(I_{sp}\).

$$I_{sp} = \frac{2}{3}\frac{{P_{DC} }}{{V_{pcc} }}$$
(15)
$$I_{sp} = [K_{p} V_{e} + K_{i} \int {V_{e} dt} ]$$
(16)
$$V_{e} = V_{DC}^{*} - V_{DC}$$
(17)

where DC bus reference voltage is represented as \(V_{DC}^{*}\), error in PCC voltage amplitude is denoted as \(V_{e}\)\(K_{p} ,K_{i}\) represents PI controller gain parameters. \(I_{samplitude}\) (source current component amplitude) is derived as:

$$I_{samplitude} = [amplitude\,\,(I_{sp} ) + amplitude\,\,(I_{sq} )]$$
(18)

where the source current for the reactive power component is expressed as \(I_{sq}\). The active power component of reference source currents (\(I_{sai}^{*}\), \(I_{sbi}^{*}\), \(I_{sci}^{*}\)) are estimated in the following,

$$I_{sai}^{*} = I_{samplitude} *U_{ai}$$
(19)
$$I_{sbi}^{*} = I_{samplitude} *U_{bi}$$
(20)
$$I_{sci}^{*} = I_{samplitude} *U_{ci}$$
(21)
Fig. 3
figure 3

Source current estimation for active and reactive power components

2.2 Source current estimation for reactive power components

For reactive power components formulation, a similar methodology is adopted as that of active power components. The equations for the reference source current of reactive power components (\(I_{saq}^{*}\), \(I_{sbq}^{*}\), \(I_{scq}^{*}\)) are evaluated in the following [38, 39]:

$$I_{saq}^{*} = I_{s1amplitude} *U_{aq}$$
(22)
$$I_{sbq}^{*} = I_{s1amplitude} *U_{bq}$$
(23)
$$I_{scq}^{*} = I_{s1amplitude} *U_{cq}$$
(24)

where the amplitude of reference source currents is represented as \(I_{s1amplitude}\).

$$I_{sa}^{*} = I_{sai}^{*} + I_{saq}^{*}$$
(25)
$$I_{sb}^{*} = I_{sbi}^{*} + I_{sbq}^{*}$$
(26)
$$I_{sc}^{*} = I_{sci}^{*} + I_{scq}^{*}$$
(27)

In comparison with the source current, the extracted reference source currents and error differences are amplified. where, \(I_{sa1}^{*}\), \(I_{sb1}^{*}\) and \(I_{sc1}^{*}\) represents source currents in the reference value. \(I_{sa}^{{}}\), \(I_{sb}^{{}}\) and \(I_{sc}^{{}}\) represents source sensed currents. The error signal is represented as \(I_{sa}^{*} - I_{sa}^{{}}\).

3 Multiple Complex Coefficient Filter (MCCF) structure

The non-linear loads introduce higher quantities of load current into the system, resulting in sinusoidal distortion of the source side current. To address this issue, the MCCF approach is proposed to enhance PQ, offering a robust solution for heavily distorted conditions. MCCF offers distinct advantages, including rapid extraction of both components from the contaminated voltage and precise evaluation of harmonic components. Subsequently, PWM signals for the DSTATCOM are generated based on the MCCF output, enabling the generation of control signals aimed at minimizing error signals [40,41,42].

Figure 4 shows the structure of DSTATCOM. A single submodule of the MCCF is also displayed in Fig. 5. Two Module (TM) system is exhibited for the extraction of both sequences in the fundamental frequency when voltage is affected by the slight impact of harmonic distortion. The Eqs. (2830) for the unbalanced three-phase voltages (\(V_{s1} \left( t \right)\), \(V_{s2} \left( t \right)\), \(V_{s3} \left( t \right)\)) are expressed as:

$$V_{s1} \left( t \right) = \sum\nolimits_{h = 1}^{{h_{m} }} {v_{h}^{p} } \cos \left( {h\omega t + \phi_{h}^{p} } \right) + v_{h}^{n} \cos \left( {h\omega t + \phi_{h}^{n} } \right)$$
(28)
$$V_{s2} \left( t \right) = \sum\nolimits_{h = 1}^{{h_{m} }} {v_{h}^{p} } \cos \left( {h\omega t + \phi_{h}^{p} - \frac{2\pi }{3}} \right) + v_{h}^{n} \cos \left( {h\omega t + \phi_{h}^{n} + \frac{2\pi }{3}} \right)$$
(29)
$$V_{s3} \left( t \right) = \sum\nolimits_{h = 1}^{{h_{m} }} {v_{h}^{p} } \cos \left( {h\omega t + \phi_{h}^{p} - \frac{2\pi }{3}} \right) + v_{h}^{n} \cos \left( {h\omega t + \phi_{h}^{n} - \frac{2\pi }{3}} \right)$$
(30)

where the sequences' amplitudes with harmonic components of the polluted voltages in the grid are described as \(v_{h}^{p}\) and \(v_{h}^{n}\), phase angle with the harmonic component of contaminated voltages in the grid is expressed as \(\phi_{h}^{p}\) and \(\phi_{h}^{n}\).

Fig. 4
figure 4

Control structure of DSTATCOM synchronized using MCCF

Fig. 5
figure 5

A single submodule of the MCCF

Clarke's transformation is used to change the voltages from the "abc" frame to the "αβ" frame. Then the Eq. (31) for the voltages in ‘αβ’ frame (\(v_{\alpha 1} \left( t \right)\), \(v_{\beta 1} \left( t \right)\)) is derived as:

$$\left[ \begin{gathered} v_{\alpha } \left( t \right) \hfill \\ v_{\beta } \left( t \right) \hfill \\ \end{gathered} \right] = \left[ \begin{gathered} v_{\alpha }^{p} \left( t \right) + v_{\alpha }^{n} \left( t \right) \hfill \\ v_{\beta }^{p} \left( t \right) + v_{\beta }^{n} \left( t \right) \hfill \\ \end{gathered} \right] = \frac{2}{3}\left[ {\begin{array}{*{20}c} 1 & {\frac{ - 1}{2}} & {\frac{ - 1}{2}} \\ 0 & {\frac{\sqrt 3 }{2}} & {\frac{ - \sqrt 3 }{2}} \\ \end{array} } \right]\,\left[ \begin{gathered} V_{s1} \left( t \right) \hfill \\ V_{s2} \left( t \right) \hfill \\ V_{s3} \left( t \right) \hfill \\ \end{gathered} \right]$$
(31)

where the amplitude of both sequences contaminated grid voltages in the ‘αβ’ frame are specified as \(v_{\alpha }^{p} \left( t \right)\), \(v_{\beta }^{p} \left( t \right)\), \(v_{\alpha }^{n} (t)\) and \(v_{\beta }^{n} \left( t \right)\).

$$\begin{aligned}\left[v_\alpha^p\left(t\right)+v_\alpha^n\left(t\right)\right]=&\sum\nolimits_{h=1}^{h_m}v_{\alpha h}^p\left(t\right)+\sum\nolimits_{h=1}^{h_m}v_{\alpha h}^n\left(t\right) \\ =&\sum\nolimits_{h=1}^{h_m}v_h^p\cos\,\left(h\omega t+\phi_h^p\right)+\sum\nolimits_{h=1}^{h_m}v_h^n\cos\,\left(h\omega t+\phi_h^n\right)\end{aligned}$$
(32)
$$\begin{aligned}\left[v_\beta^p\left(t\right)+v_\beta^n\left(t\right)\right]&=\sum\nolimits_{h=1}^{h_m}v_{\beta h}^p\left(t\right)+\sum\nolimits_{h=1}^{h_m}v_{\beta h}^n\left(t\right)\\ &= \sum\nolimits_{h=1}^{h_m}v_h^p\sin\,\left(h\omega t+\phi_h^p\right)-\sum\nolimits_{h=1}^{h_m}v_h^n\sin\,\left(h\omega t+\phi_h^n\right)\end{aligned}$$
(33)

The amplitude of sequences corresponds to \(h^{th}\) harmonic component of contaminated grid voltages in the ‘αβ’ frame is specified as \(v_{\alpha h}^{p} \left( t \right)\), \(v_{\beta h}^p\left(t\right)\), \(v_{\alpha h}^{n} \left( t \right)\) and \(v_{\beta h}^{n} \left( t \right)\). Applying Park’s transformation, voltages are transformed from the ‘αβ’ frame to the ‘dq’ frame (\(v_{d} \left( t \right)\)\(v_{q} \left( t \right)\)) then the Eqs. (3436) is derived as:

$$\left[\begin{array}{l}v_d\left(t\right)\\v_q\left(t\right)\end{array}\right]=\left[\begin{array}{l}v_d^p\left(t\right)+v_d^n\left(t\right)\\v_q^p\left(t\right)+v_q^n\left(t\right)\end{array}\right]=\begin{bmatrix}\cos\left(\overset{\lower0.5em\hbox{$\smash{\scriptscriptstyle\frown}$}}{\theta }\right)&\sin\left(\overset{\lower0.5em\hbox{$\smash{\scriptscriptstyle\frown}$}}{\theta }\right)\\-\sin\left(\overset{\lower0.5em\hbox{$\smash{\scriptscriptstyle\frown}$}}{\theta }\right)&\cos\left(\overset{\lower0.5em\hbox{$\smash{\scriptscriptstyle\frown}$}}{\theta }\right)\end{bmatrix}\left[\begin{array}{l}v_\alpha\left(t\right)\\v_\beta\left(t\right)\end{array}\right]$$
(34)

where accurate phase angle estimation is denoted as \(\overset{\lower0.5em\hbox{$\smash{\scriptscriptstyle\frown}$}}{\theta }\) i.e.\(\,\overset{\lower0.5em\hbox{$\smash{\scriptscriptstyle\frown}$}}{\theta } = \mathop \omega \limits^{ \wedge } t + \mathop {\phi_{1}^{p} }\limits^{ \wedge }\), the amplitude of both sequences of grid voltages in the contaminated state in the ‘dq’ frame is specified as \(v_{d}^{p} \left( t \right)\), \(v_{q}^{p} \left( t \right)\), \(v_{d}^{n} \left( t \right)\) and \(v_{q}^{n} \left( t \right)\).

$$\begin{gathered} \left[ {v_{d}^{p} \left( t \right) + v_{d}^{n} \left( t \right)} \right] = \sum\nolimits_{h = 1}^{{h_{m} }} {v_{dh}^{p} \left( t \right)} + \sum\nolimits_{h = 1}^{{h_{m} }} {v_{dh}^{n} \left( t \right)} = \hfill \\ \,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\sum\nolimits_{h = 1}^{{h_{m} }} {v_{h}^{p} \cos \,\left( {\left( {h\omega - \mathop \omega \limits^{ \wedge } } \right)t + \phi_{h}^{p} - \mathop {\phi_{1}^{p} }\limits^{ \wedge } } \right) + } \sum\nolimits_{h = 1}^{{h_{m} }} {v_{h}^{n} \cos \,\left( {\left( {h\omega + \mathop \omega \limits^{ \wedge } } \right)t + \phi_{h}^{n} + \mathop {\phi_{1}^{p} }\limits^{ \wedge } } \right)} \hfill \\ \end{gathered}$$
(35)
$$\begin{gathered} \left[ {v_{q}^{p} \left( t \right) + v_{q}^{n} \left( t \right)} \right] = \sum\nolimits_{h = 1}^{{h_{m} }} {v_{qh}^{p} \left( t \right)} + \sum\nolimits_{h = 1}^{{h_{m} }} {v_{qh}^{n} \left( t \right)} = \hfill \\ \,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\sum\nolimits_{h = 1}^{{h_{m} }} {v_{h}^{p} \sin \,\left( {\left( {h\omega - \mathop \omega \limits^{ \wedge } } \right)t + \phi_{h}^{p} - \mathop {\phi_{1}^{p} }\limits^{ \wedge } } \right) + } \sum\nolimits_{h = 1}^{{h_{m} }} {v_{h}^{n} \sin \,\left( {\left( {h\omega + \mathop \omega \limits^{ \wedge } } \right)t + \phi_{h}^{n} + \mathop {\phi_{1}^{p} }\limits^{ \wedge } } \right)} \hfill \\ \end{gathered}$$
(36)

where both sequences correspond to harmonic components of contaminated voltages in the grid in the ‘dq’ frame and are specified as \(v_{dh}^{p} \left( t \right)\), \(v_{dh}^{n} \left( t \right)\), \(v_{qh}^{p} \left( t \right)\) and \(v_{qh}^{n} \left( t \right)\), \(\mathop {\phi_{1}^{p} }\limits^{ \wedge }\) denotes the estimated phase angle of the + ve sequence corresponding to the harmonic component of contaminated voltages in the grid.

Under quasi-locked condition (\(\mathop {\phi_{1}^{p} }\limits^{ \wedge } \approx \phi_{h}^{p}\) and \(\mathop \omega \limits^{ \wedge } \approx \omega\)), the Eq. (34) is rewritten in the following Eq. (37):

$$\left[ \begin{gathered} v_{d} \hfill \\ v_{q} \hfill \\ \end{gathered} \right] = \left[ \begin{gathered} v_{ddc} \hfill \\ v_{qdc} \hfill \\ \end{gathered} \right] + \left[ \begin{gathered} v_{dac} \hfill \\ v_{qac} \hfill \\ \end{gathered} \right]$$
(37)

where DC terms are represented as \(v_{ddc}\) and \(v_{qdc}\), and disturbance terms are denoted as \(v_{dac}\) and \(v_{qac}\). The controller merits are error mitigation and optimizing the efficiency to enhance the DSTATCOM dynamic response [43].

4 Optimal location of DSTATCOM

A DSTATCOM, a power electronics device, is employed to reduce investment costs, minimize Total Harmonic Distortion (THD), voltage variation, and so on. Determining the optimal location of the DSTATCOM under various conditions is crucial to ensure efficient performance and adequate investment in the distribution side. Previous studies have utilized methodologies like PSO, GA, Firefly algorithm, harmony search algorithm, etc., but these approaches have significant limitations. In this study, a heuristic approach is adopted to identify the most suitable placement for DSTATCOM in distribution networks across practical scenarios. Optimal positioning of the DSTATCOM leads to enhancements in the system's voltage profile, power quality, reduced power losses, as well as increased dependability and security.

4.1 Prairie Dog Optimization (PDO)

A thorough review of the literature on all popular optimization strategies was conducted. Numerous researchers have improved tried-and-true metaheuristic algorithms or created new ones that are inspired by nature, with varying degrees of success.

This method, which has not received much attention in the literature in the domain of distribution system PQ enhancement has several benefits over other methods. PDO method is superior to other commonly used optimization techniques in several ways, including better exploration and exploitation strategy balancing, greater capabilities, the ability to predict the global optimum for actual optimization problems, more steady convergence, etc. PDO takes its cues from prairie dog behavior in their native surroundings. Regarding prairie dogs, four actions are suggested, including the phases of exploitation and exploration [44]. Prairie Dog Optimization (PDO) was chosen over conventional algorithms due to its nature-inspired approach, simplicity, and effectiveness in exploring complex search spaces. Its strong exploration and exploitation capabilities make it ideal for multi-modal optimization problems. PDO has demonstrated superior performance across various applications, including engineering and machine learning. The DSTATCOM is best located using the PDO method to reduce power loss, improve harmonic distortion, and optimize voltage profile.

The flowchart of the PDO technique is depicted in Fig. 6. The following are the suggested algorithmic procedures:

  • Step 1: The PDO begins with initial inputs, including the number of DSTATCOMs and system parameters. The selection for the number of DSTATCOMs can range from 1 to the high number of system buses. Optimization variables involve deciding the placement of DSTATCOMs and their powers and frequencies.

  • Step 2: Once the placing of the DSTATCOM has been determined, load-flow calculations are performed to obtain the bus voltages at both types of frequencies. These calculations consider the presence and operation of the DSTATCOM and their impact on the system voltage profile. By considering the prairie dog populations as a measure of location, the load-flow analysis helps assess the voltage stability and overall system performance with the DSTATCOM in place.

  • Step 3: Each bus's THD and voltage fluctuations can be found using the calculated bus voltages. The OF is then computed and evaluated using these values. The OF offers a quantitative measurement of the system performance by taking into account the voltage changes and THD, enabling the assessment and comparison of various DSTATCOM sites. The idea is to locate the OF as low as possible to improve voltage stability and lower harmonic distortions in the system.

  • Step 5: In the PDO process, the ranking of prairie dogs should be used to determine the output, and the algorithm goes to the next iteration. This means that the algorithm continues to iterate until either the higher number of iterations is reached or the current global solution remains constant for a predetermined continued iteration. The Eq. (38) for the OF is given as:

    $$OF = \min \left\{ E \right\}$$
    (38)

where an error in terms of voltage improvement and power loss diminishment is represented as ‘\(E\)’. Prairie dog activities like burrowing and foraging are employed to supply PDO with inquisitive activity. The Prairie Dogs (PD) particular response into two distinct alert sounds is used to accomplish exploitation. For fulfilling the prairie dogs’ nutritious requirements and anti-predation capabilities, PD communication skills play a vital role. These two behaviors decide the converging criteria for finding better as well as near-optimal solutions. The Pseudocode for the PDO algorithm is presented in Table 1.

Fig. 6
figure 6

Flowchart of PDO technique

Table 1 Pseudocode for PDO algorithm

To provide the exploratory behavior for PDO, building activities of prairie dogs like foraging and burrowing are used. For the accomplishment of exploitation, the Prairie Dogs (PD) specific response into two unique alert sounds is utilized. For fulfilling the prairie dogs’ nutritious requirements and anti-predation capabilities, PD communication skills play a vital role. These two behaviors decide the converging criteria for finding better as well as near-optimal solutions.

5 Performance analysis under consideration

In this section, the optimal placement of DSTATCOM for PQ improvement using the proposed approach is discussed with simulation analysis.

The investigation is executed in the MATLAB platform with the IEEE 34 bus test system [53] using three-phase fault analysis. In general, the IEEE 34 bus system is more difficult to implement due to its unbalancing nature. It is more useful for large power applications. Therefore, it is believed that the DSTATCOM is located in the distribution system by the IEEE 34 bus test system. Figure 7 shows the IEEE 34 bus test system using DSTATCOM and fault location. Table 2 provides the DSTATCOM location as well as the fault. Table 3 provides the system parameters.

Fig. 7
figure 7

IEEE 34 bus system with DSTATCOM and fault location

Table 2 Location of DSTATCOM and fault
Table 3 Implementation parameters of the system

Figure 8 shows the three-phase voltage profile in normal conditions using the proposed method. From Fig. 8, it is clear that the voltage profile is improved at bus number 832 for all phases using the proposed method. The voltage is improved from 0.958 to 1.05 p.u. in phase ‘a’, from 0.96 to 1.04 p.u. in phase ‘b’, and from 0.956 to 1.048 p.u. in phase ‘c’.

Fig. 8
figure 8

Three-phase voltage profile using the proposed method

Analysis of the three-phase voltage profile with actual, fault and placement of DSTATCOM for phase ‘a’ are shown in Fig. 9. With this voltage profile improvement, the reduced power loss is exhibited. The actual value, with fault and with DSTATCOM of voltage profile using the proposed technique is 1.04p.u, 1.048p.u and 1.05p.u at bus number 832.

Fig. 9
figure 9

Analysis `of the three-phase voltage profile with actual, fault and placement of DSTATCOM for phase ‘a’

Figure 10 shows an analysis of the phase voltage profile with actual, with fault and placement of DSTATCOM for phase ‘b’. In each case, it depicts the voltage profile improvement (1.05p.u) with DSTATCOM at bus number 832 using the proposed approach. Thus, PQ in the system is improved by the proposed technique.

Fig. 10
figure 10

Analysis of three-phase voltage profile with actual, fault and placement of DSTATCOM for phase ‘b’

Analysis of the phase voltage profile with actual, fault, and placement of DSTATCOM for phase ‘c’ using the proposed technique are depicted in Fig. 11. In the case of DSTATCOM presence, the minimum voltage deviation (1.05 p.u) at bus 832 is achieved.

Fig. 11
figure 11

Analysis of three-phase voltage profile with actual, fault and placement of DSTATCOM for phase ‘c’

Harmonic analysis with fault and with DSTATCOM for phase ‘a’ is given in Fig. 12. The values for the second order with fault and with DSTATCOM using the proposed technique are 0.028% and 0.026%. The values for the fourth order with fault and with DSTATCOM using the proposed technique are 0.01% and 0.01%. The values for the sixth order with fault and with DSTATCOM using the proposed technique are 0.0058% and 0.0052%. The values for the eighth order with fault and with DSTATCOM using the proposed technique are 0.0052% and 0.005%. The values for the tenth order with fault and with DSTATCOM using the proposed technique are 0.005% and 0.0046%. The value for the twelfth order with fault and with DSTATCOM using the proposed technique is 0.0047% and 0.003%. The value for the fourteenth order with fault and with DSTATCOM using the proposed technique is 0.0047% and 0.003%. The values for the sixteenth order with fault and with DSTATCOM using the proposed technique are 0.0047% and 0.002%. In bus number 802 the harmonic waveform shows a considerable reduction from the 4th-order harmonics.

Fig. 12
figure 12

Harmonic analysis with fault and with DSTATCOM for phase ‘a’

Figure 13 shows the harmonic analysis with fault and with DSTATCOM for phase ‘b’. In bus number 802, the harmonic waveform shows a considerable reduction of harmonics (0.001%) from the 16th-order harmonics when compared with fault and with DSTATCOM. The value for fourth, sixth, eighth, tenth, twelfth, fourteenth, and sixteenth with DSTATCOM is 0.018%, 0.008%, 0.005%, 0.005%, 0.004%, 0.003%, 0.004% and 0.004%. In conclusion, in bus number 802, the harmonic waveform shows a considerable reduction from the 4th-order harmonics.

Fig. 13
figure 13

Harmonic analysis with fault and with DSTATCOM for phase ‘b’

Harmonic analysis with fault and with DSTATCOM for phase ‘c’ is given in Fig. 14. The harmonic orders with DSTATCOM using the proposed technique achieve 0.022%, 0.006%, 0.003%, 0.003%, 0.0038%, 0.002%, 0.002%, 0.002%.

Fig. 14
figure 14

Harmonic analysis with fault and with DSTATCOM for phase ‘c’

Figure 15 illustrates fitness in terms of active power loss analysis. In the graph, the OF is achieved with minimized error in terms of power loss reduction using the proposed technique.

Fig. 15
figure 15

Fitness in terms of active power loss analysis using the proposed method

Harmonics at source voltage in bus number 802 and bus number 806 are given in Table 4. The remaining buses have the regulators with those lines. The remaining lines do not have such harmful effects as bus 802 and bus 806. With DSTATCOM, the source voltage at phases ‘a’, ‘b’, and ‘c’ at bus 802 produces the harmonics like 0.15%, 0.12%, and 0.12%. With DSTATCOM, the source voltage at phases ‘a’, ‘b’, and ‘c’ at bus 806 produces the harmonics like 0.15%, 0.12%, and 0.12%.

Table 4 Harmonics at source voltage at bus number 802 and bus number 806

Harmonics at source current in bus 802 and bus 806 are given in Table 5. With DSTATCOM, the source current at phases ‘a’, ‘b’, and ‘c’ at bus 802 produces the harmonics like 0.12%, 0.32%, and 0.26%. With DSTATCOM, the source current at phases ‘a’, ‘b’, and ‘c’ at bus 806 produces the harmonics like 0.21%, 0.22%, and 0.38%.

Table 5 Harmonics at source current at bus number 802 and bus number 806

Loss analysis using various techniques is given in Table 6. The active power loss under fault with DSTATCOM for the proposed technique is 111.25 kW. The reactive power loss under fault with DSTATCOM for the proposed technique is 80.466KVar. The active and reactive power loss is minimal for the proposed approach when compared to other approaches. Statistical metrics of the proposed approach are shown in Table 7. The comparison of voltage profiles in optimally placing DSTATCOM in the distribution system is given in Table 8. Figure 16 shows the comparison of total loss in power with and without taking DSTATCOM into account. With DSTATCOM, the active power loss is down to 130 kW from 210 kW without it. Similarly, the reactive power loss decreases to 100 kVAr with DSTATCOM, compared to 145 kVAr without it.

Table 6 Loss analysis using various techniques
Table 7 Statistical metrics of the proposed approach
Table 8 Optimization results for the 34-bus system
Fig. 16
figure 16

Comparison of total power loss with DSTATCOM and without DSTATCOM

Objective function behavior is shown in Fig. 17 for both cases where the harmonics restriction is present and absent. The graph displays the value of the goal function has changed over the number of iterations.

Fig. 17
figure 17

Objective function's evolution a without voltage THD restriction b with voltage THD restriction

Simulation results of the IEEE 34 bus system are shown in Table 9. A thorough summary of the outcomes obtained by using the optimization method is given in Table 10. Findings obtained with the suggested method show greater reductions in power losses in comparison to the reference [48]. Moreover, the outcomes produced by the suggested algorithm outperform the maximum and average voltage deviations produced by the current method.

Table 9 Simulation results for the system parameters in the IEEE 34 bus system
Table 10 System sensitivity analysis in IEEE 34-bus system

6 Conclusion

This research presents an elitist approach to integrating DSTATCOM for enhancing PQ in the distribution system. Utilizing load flow and harmonic load flow analyses in the IEEE 34 bus system, the study demonstrates the superior performance of DSTATCOM in reducing harmonics. The optimal placement of DSTATCOM is highlighted as a key factor in achieving these improvements. The harmonics obtained for bus 802 and bus 806 after placement of DSTATCOM are within the standard limits. The findings demonstrate that by placing DSTATCOM at the ideal location, the suggested method reduces power losses, and harmonics, and improves voltage profile. The statistical metrics like standard deviation, minimum fitness, maximum fitness, and mean value of the proposed approach are 25.142, 111.25, 275.68, and 121.84. A thorough analysis was carried out using the MCCF-PDO approach to determine the best position for DSTATCOM integration in the IEEE 34 bus system. The algorithm's results indicate that, in comparison to the starting conditions, installing DSTATCOM devices on designated buses for both test systems produces notable gains. The average voltage deviation decreased by 10.5%, the maximum voltage deviation decreased by 9.7%, and the apparent power losses in the 34-bus system decreased by an astounding 21.2%. Notably, the test system maximum THD in voltage stayed within the 3% set limit, demonstrating adherence to legal requirements. These results highlight the MCCF-PDO technique performance and the chosen location's work to significantly improve power quality in the distribution systems under study.

6.1 Limitations and future work

In the future, hybrid optimization techniques may be used to further reduce THD and power losses in the distribution system through PQ enhancement with DSTATCOM. In terms of future research directions, the integration of advanced control algorithms and machine learning techniques is explored to further optimize the placement and operation of distribution static compensators in distribution systems. Additionally, the impact of emerging technologies such as renewable energy integration and smart grid solutions on power quality enhancement may be a key focus.