1 Introduction

The purpose of a well-designed grounding grid is to provide safety to humans within the vicinity of grounded equipment and dissipate the fault currents without exceeding the safety limits [1]. Grounding grid consists of parallel conductors that may be equally or unequally spaced. The voltage profile of the equally spaced grid is clearly convex with many meshes; for this reason, the equally spaced grids may be overdesigned toward the center and underdesigned toward the edges [2]. Unequally spaced design for grids provides a solution to enhance the performance and decreases the establishment cost. Several methods have been introduced for calculating the optimum spaces between the grid conductors. The empirical formulas and optimization techniques represent most of these methods.

Several empirical formulas based on different approaches were introduced [3,4,5,6,7]. It has several disadvantages such as the need for human experience, and they never cover the entire search space over the grid area. Most of these approaches introduce a relationship between the distance from a given conductor to the next one and the distance between the same conductor and the previous conductor. Different relationships such as sequential multiplicative, sequential power [3], and optimal compression ratio (OCR) [4,5,6] were used for this purpose. The OCR depends on a target function of touch voltage which must reach the minimum value.

Optimization techniques have been used to solve the mentioned above problems. The optimization techniques can decrease the overall time for the analysis [8]. In this context, genetic algorithms optimization technique (GA) was adapted with different computational approaches to reduce the cost of grounding grids while the safety restrictions are satisfied [9,10,11]. In addition, PSO was adapted with the combined integration method to investigate the optimal pattern for the grid design [12]. Optimization techniques are not only used for unequally spaced grids but also with equally spaced grids. IEEE Std 80 was used to design the equally spaced grounding grid from the cost point of view [13,14,15,16]. Hybridization between GA and pattern search (PS) techniques has also been proposed to find the optimum design of grounding grids [17, 18]. The optimization techniques give more accurate results compared with empirical formulas. On the other hand, they require a significant effort and time for complicated type of grids.

Some researchers have studied equal and unequal grounding grids to find the optimal design, compression ratio, or optimal spacing using software such as Electrical Transient Analyzer Program (ETAP) [3, 19, 20] and Current Distribution Electromagnetic Field Grounding Soil Structure Analysis Software (CDEGS) [21, 22]. These software packages offer a wide range of capabilities, including computing grounding resistance, touch, and step voltages in stratified soil. Grounding rods and stratified soil are considered as two main parameters that affect the grid performance. Therefore, many researchers have studied the grid characteristics with varying length, depth, diameter, number, resistivity, and location [23,24,25,26,27,28,29].

Obtaining an optimization formula has been presented in a previous trial [30], which based on the method obtained from paper [31] to decrease GPR by numerous calculations using the computational program, without employ any of the optimization methods.

In this paper, the authors present a new optimization formula to calculate the conductor’s locations as percentage of the side length by depending on the optimization technique results. Therefore, the proposed method in this paper is very simple and has the advantages of optimization techniques.

2 The proposed methodology

The optimum design of grids can be expressed as a search for suitable spaces between the parallel conductors that meet the minimum value of grounding resistance, touch or step voltages.

The PSO technique has been suggested to search for the optimum design. PSO inspired by the social behavior of animal’s swarms and highly dependent on stochastic processes. PSO is considering a simple algorithm. It is written in a few lines of code, and it seems to lie somewhere between GA and evolutionary programming [32].

Selecting the number of particles is not a straightforward procedure. It mainly depends on the complexity of the case under study. Therefore, in many cases it can be determined by using trial-and-error methods. In this study, 50 particles were sufficient. The stopping criteria for the optimization program are that the whole particle converge to the global best with an accepted tolerance. Therefore, PSO has been suggested for this work as the particles results during the iterations are more near to the optimum solution compared with GA and this reducing the number of iterations and time [16]; also GA uses the non-improving designs in the random selection process. Therefore, it takes more iteration [8].

The search for the optimum design can be achieved through adapting particle swarm optimization technique (PSO) [32] with the combined integration matrix method (CIMM) [33].

CIMM is used to calculate the potential of any point in the ground due to any buried current carry conductor. This method considers the mutual effect due to any nearby current carrying conductor. CIMM coded in an m-file by the authors for calculating grounding resistance, touch, and step voltages. The coded program results were compared with ETAP 12.6, and IEEE Std. 80, and all results were very close to each other. The computational time depends on the number of conductors, which translate to a number of segments in the program. Usually, it takes between a few minutes to several hours depending on the number of conductors.

PSO assumes the initial number of solutions (particles). Each solution is a proposed pattern for the grids consisting of some parallel conductors in the horizontal two-dimensional space. The distances between the conductors in each pattern are assumed randomly. Through an iterating process, PSO selects the most suitable solution, which has the minimum value to be the leading solution. Other solutions try to modify or update their inter distances to be like the leader. They are moving with zero velocity at the beginning and update each iteration according to Eq. (1). All weights in Eq. (1) are selected by trial-and-error method. Finally, all patterns overlapped with the same distances between the conductors. The accuracy of particle’s results must not exceed 0.001 m from the global best position. The particles position update is subjected to Eq. (2). Figure 1 shows the PSO vectorial diagram.

$$ \begin{gathered} v_{i} \left( {t + 1} \right) = \omega *v_{i} \left( t \right) + {\text{rand}}1*\left( {P_{{{\text{best}}i}} \left( t \right) - X_{i} \left( t \right)} \right) \hfill \\ \quad \quad\quad \quad \quad\quad +\, {\text{rand}}2{*}\left( {G_{{{\text{best}}}} \left( t \right) - X_{i} \left( t \right)} \right) \hfill \\ \end{gathered} $$
(1)
$$ X_{i} \left( {t + 1} \right) = X_{i} \left( t \right) + v_{i} \left( {t + 1} \right) $$
(2)

where \({X}_{i}(t)\) is the particle current position; \({X}_{i}(t+1)\) is the particle updated position; \({P}_{\mathrm{best}i}(t)\) is the particle historical local best position; \({G}_{\mathrm{best}}(t)\) is the historical global best position for all swarm; \(\mathrm{rand}1\mathrm{ and rand}2\) are the random numbers between 0 and 1; and ω is the inertia weight.

Fig. 1
figure 1

Vectorial diagram of the PSO particles updates

The updates of conductor’s locations for all particles are shown in Fig. 2 for grid with area 40m by 40m that has four conductors in each direction. Figure 2a shows the locations of the conductors for 20 particles (for simplicity) that assumed randomly. Figure 2b shows the locations of the conductors after 33% of the total number of iterations. Figure 2c shows the locations of the conductors after 66% of the total number of iterations. Figure 2d shows the locations of the conductors after reaching the best solution. Through these figures, it can be clarified that all particles converge to the best solution.

Fig. 2
figure 2

The particles updates during the iterations. a Particles randomly locations as the first assumptions, b Particles update after 33% of total number of iterations, c Particles update after 66% of total number of iterations, d Particles update after the last iteration

3 Optimization patterns

A MATLAB m-file was created to adapt PSO with CIMM to search for the best location of conductors inside the grid area with taking into consideration the boundary conductor’s locations fixed at 0, side length along y-axis Ly and x-axis Lx.

The optimization study was started with grid, which has number of conductors along x-axis (Nx) equal 4, and the same number along y-axis (Ny). The grid was buried in uniform soil with resistivity = 200 Ω m, grid current = 1000 A without rods, and with changing the grid area from (Lx = 40 m and Ly = 40 m) to (Lx = 100 m and Ly = 100 m). PSO has searched for only two conductor’s locations along x-axis and another two conductors along y-axis.

Objective function has been adjusted to optimize one value at a time. At the beginning, the objective function was adapted to get minimum value of grounding resistance and then changed to get the minimum value of touch voltage and finally was adapted to get the minimum value of step voltage.

The results of conductor’s locations with changing the grid area and objective function for grid size (Nx = 4, and Ny = 4) are shown in Table 1. The results are tabulated as a percentage of the side length (Xc/Lx) where c is the number of conductor (0, 1, 2,…) and Lx is the side length along x-axis. Also, the average value over multiple areas is computed to obtain one value for the grid size.

Table 1 The optimization results with changing the grid area for grid (Nx = 4, Ny = 4)

The same procedures were repeated with changing the grid size up to Nx = 10, and Ny = 10.

At this level, each grid size has three patterns (grounding resistance, touch voltage, and step voltage patterns).

To reach a single pattern, grid size from (Nx = 6, and Ny = 6), to (Nx = 8, and Ny = 8) studied as an example.

Table 2 shows the optimized locations for conductors inside each size. Figure 3 shows the location of conductors for each pattern for grid size (Nx = 7, and Ny = 7), and it can be concluded that, the grounding resistance pattern, which will be called from now on, the basic pattern is somewhere between the other patterns (auxiliary patterns). Therefore, it is possible to reach acceptable results when using the basic pattern in the design.

Table 2 The conductor’s distribution of grid size from (Nx = 6, and Ny = 6), to (Nx = 8, and Ny = 8)
Fig. 3
figure 3

The conductor’s locations for basic and auxiliary patterns for grid Nx = 7, Ny = 7

Table 3 shows the results of the grids performance using the basic pattern and comparing them with the results of auxiliary patterns. The comparison in Table 3 gives an acceptable result from using the basic pattern. The deviation in the results was calculated according to Eq. (3).

$$ {\text{Deviation}}\% = \frac{{\left( {{\text{Result}}\left( {{\text{Basic}}\;{\text{pattern}}} \right) - {\text{Result}}\left( {{\text{Auxiliary}}\;{\text{pattern}}} \right)} \right) \times 100 }}{{{\text{Result}} \left( {{\text{Basic}}\;{\text{pattern}}} \right) }} $$
(3)
Table 3 Comparison of touch and step voltages by using auxiliary and basic patterns

4 Experimental measurements

Experimental work on full size grid is costly and difficult to done, so the studying of the grounding grids generally depends on the models with different scaling factor. It is a well-known technique [4, 34], and it is used for determining the potential profile over the grids.

The scale model, which used in this study, was electrolytic tank with dimensions (80 × 60 × 60 cm3). It is a glass made; both sides and bottom were covered with aluminum sheets as a return electrode. The tank was filled with tap water (represents the homogenous soil), and it is resistivity controlled by adding sodium chloride salt. The water resistivity was measured in certified laboratory. The voltage along the main diagonal is measured using probe. The full experimental setup is shown in Figs. 4, 5.

Fig. 4
figure 4

Experimental layout

Fig. 5
figure 5

Experimental measurements actual photograph

To simulate the grounding grids, a scaling factor of (1/133.33) was chosen. The measurements were done on grid model with area (Lx = 20m, Ly = 20m), total number of conductors (Nx = 5, Ny = 5), immersed in water with resistivity = 633Ω m, grid current = 533 A, for equally and unequally spacing conductors (designed by the basic pattern). The measured points have been selected inside the grid meshes along the main diagonal and the points coordinates indicated in Tables 4 and 5.

Table 4 Voltage profile in volts along the main diagonal for the equally spaced grounding grid (area = 20 × 20 m2 − Nx = 5, Ny = 5)
Table 5 Voltage profile in volts along the main diagonal for the unequally spaced grounding grid (area = 20 × 20 m2 − Nx = 5, Ny = 5)

The measured voltages of equally and unequally spaced models are given in Tables 4 and 5, respectively. The measured values are multiplied by the scaling factor and compared with the calculated values.

From the obtained results, it is noticed that the unequally spaced design by using the basic pattern gives better performance than the equally spaced design, and the experimental results were very close to the calculated values and the maximum deviation was 3.5%.

5 Closed-form solution for the optimum pattern

From the above discussion, it is noticeable that the basic pattern can be used as an optimized pattern to improve the grid performance. The optimized grid will have fully optimized grounding resistance and partially optimized step and touch voltages.

The next step in this paper is to exploit the basic pattern results to find a closed-form formula that can give the optimum location of conductor within any grounding grid without using optimization or experimental techniques.

First step: Numbering the conductors.

Figure 6 shows the numbering of conductors for a fictitious grid where the conductors are numbered from 0 to n. L is the side length of the grid; and Lc is the distance apart between the conductor 0 and conductor c.

Fig. 6
figure 6

The variables of the formula

Second step: Optimization formula variables.

(Lc%) is the percentage of Lc to the total side length, and (c/n) is the conductor order, which equal to the conductor number divided by (n).

Third step: Basic pattern data.

The optimization results of the basic pattern for grids from (Nx = 2, Ny = 2) to (Nx = 10, Ny = 10) are given in Table 6. Figure 7 summarizes all the data from Table 6 between Lc% and the conductor order (c/n).

Table 6 \({L}_{\mathrm{c}}\%\) with changing the number of conductors
Fig. 7
figure 7

Results curve fitting

Fourth step: Curve fitting.

The curve in Fig. 7 looks like a continuous function. Therefore, it is possible to use curve-fitting technique to get a formula that characterizes this trend. Equation (4) constructed from fitting the curve by the means of MATLAB program, and the formula constants are mentioned in Table 7. The equation gives direct places of the conductors.

Table 7 The formula constants

This formula is used for obtaining the grid conductor’s locations of the first half along two axes, and the rest of conductors can be calculated, as the conductors are symmetrical on both sides of the grid centers. This equation can be used to get the relative distance of any conductor with number c.

$$ {\text{Relative}}\;{\text{distance}} L_{{\text{c}}} {\text{ \% }} = \mathop \sum \limits_{i = 0}^{k} \alpha_{i} \frac{c}{n} $$
(4)

where αi is a set of constants whose number and values are determined based on the order of the polynomial equation used. In this study, the curve shown in Fig. 7 is based on ninth-order polynomial equation.

Formula can be used when knowing the number of parallel conductors and the grid area. The results of simulation example to demonstrate the enhancement in the grid performance due to using the optimization formula are shown in Table 8 which shows the values of grounding resistance, touch, and step voltages for grid of Example B1 in IEEE Std. 80 [1] with given data (soil resistivity = 400Ω m, depth = 0.5 m, area = 70 × 70 m2, grid current = 1908 A). The results given in that table are for equally spaced grid design and the grid designed by the new optimization formula. This optimization formula is used to calculate the locations of all conductors along x-axis as well as for y-axis.

Table 8 The grid parameter’s values after improving the grid performance

From the results of Table 8, we can conclude that the design of the optimization formula has decreased the maximum touch voltage to a value less than the permissible limits.

6 Effect of grounding rods

Calculations of three different configurations are carried out to investigate the effect of adding rods on the grid performance. The grid model after optimization in Sect. 5 is provided with driven rods, and each one is 3 m length and 25 mm diameter at the locations shown in Fig. 8. The soil resistivity = 400 Ω m. Table 9 shows the results of adding the driven rods for the three cases. It is noticed that as given in that table adding four driven rods enhances the grid performance, while increasing the number of rods has no significant effect in case under study.

Fig. 8
figure 8

Location of rods added to an optimized grid

Table 9 Effect of driven rods on the grid performance

Also, with considering the tolerable touch, and step voltages calculated with the equation presented in IEEE Std. 80 [1], the obtained results show that the equally spaced grounding grids does not achieve the safe design. Using the optimized unequal design achieves the safe design for the grid with no extra cost, and adding the rods makes it safer. Deviation percentages from the tolerable values are also computed in Table 9.

7 Effect of the stratified soil

To investigate the effect of the stratified soil on the optimized grid performance without rods, the following cases in Table 10 have been suggested. The study includes varying the soil upper layer thickness and its resistivity. ETAP software package has been used for calculating GPR, touch, and step voltage, the optimized grid model in Sect. 5 has buried at depth 0.5 m. Table 11 shows the results with changing the soil structure, and it is noticed that GPR, maximum touch, and step voltages value for the grid buried in soil with ρ1 > ρ2 are lower than the soil with ρ1 < ρ2; also GPR value is changing with varying the upper layer thickness with small value.

Table 10 Stratified soil specifications
Table 11 Effect of the stratified soil on the grid performance

8 Conclusions

The main conclusions through this paper can be summarized as follows:

It is difficult to obtain a single pattern that can provide the minimum values for resistance, step, and touch voltages. Therefore, the grounding resistance pattern was introduced as a basic pattern.

Optimization formula has been proposed to calculate the conductor’s locations inside the grid area. This formula has initiated from the basic pattern. It is valid for grids buried in uniform soil, without driven rods, for square and rectangular shapes. When both the side length and the number of conductors are given, the location of each conductor as percentage of the side length can be calculated.

In case of adding driven rods and presence of stratified soil, it was noticed that the adding driven rods enhance the grid performance, while increasing the number of rods has no significant effect. Stratified soil effect depends on the resistivity of the different soil layers. The optimized pattern was verified experimentally. The maximum deviation was 3.5%.