1 Introduction

The 48 V DC supply for consumer electronics has been regarded as a viable solution to power basic consumer loads like LED lights, BLDC fans, television sets, etc. [1]. In addition, it is used by E-rickshaws/tuk-tuks that are employed as last mile connectivity for the mobility of the masses in developing nations. Furthermore, 48 V DC is getting standardized as the low operating voltage of LVDC-MG for the integration of photovoltaic panels and battery banks since it becomes easier, efficient, and economical [2, 3]. Tuk-tuks/E-rickshaws interfaced with a bi-directional power electronic converter can easily interact with a LVDC-MG to absorb the surplus power by charging the battery bank or enacting a portable power source which contributes toward stability.

Bi-directional converters like buck boost converter are predominantly used to satisfy the need for a modular low-cost approach. However, under high step up/step down demands, they experience significant drops in efficiency and quick deterioration of battery life due to the presence of a discontinuous current with a high current ripple. A number of non-isolated bi-directional converters with significant buck boost capabilities have been reported in [4,5,6,7]. However, these configurations have increased switch counts and capacitors that significantly complicate the system. The authors of [8] proposed a bi-directional converter with the control being executed through a complicated and costly fuzzy controller. Moreover, cascading and multilevel architectures for obtaining a wide operating range affects the system efficiency and have complex control designs. Bi-directional converter topologies based on galvanic isolation provided by transformer like dual active bridge (DAB) and resonant converters like CLLC with high gain capabilities overcome the drawback of a discontinuous input current and a limited operating range [9,10,11]. However, these topologies are complex and bulky. Moreover, the bi-directional operation of a converter is hindered by the low relative impedance imposed on the current when flowing from a high voltage to the low-voltage side, which results in a peak current across the transformer, and possible saturation of the transformer core.

Under practical cases where batteries with different SoC’s are stacked together, the battery with the lowest SoC tends to load the healthy batteries, which results in the need for additional equalizer/balancer circuits that increase the cost and complexity of converter. Multiport topologies [12] allow battery stacking based on the number of inputs on a single converter with a simpler solution. The authors of [13,14,15] presented multiport topologies for electric vehicles and photovoltaic applications. However, the multiport converters fail in optimizing the power utilization from individual input sources with a limited operating band. In addition, under different SoC conditions or input conditions, the above discussed converters (both non-isolated and isolated) are incapable of charging batteries stacks at different rates.

The magnetically coupled inductors utilized in impedance source converters that are capable of providing additional boosting during intermittent operation provide a wide operating range without deteriorating the efficiency [16,17,18]. Architecture using coupled inductors for energy storage and transfer allows for a power dense and modular solution. T-source network and Z-source network suffer from discontinuous operation and lack bi-directional operation capability [16, 18]. The quasi-Z-network, provides a continuous input current, but still remains unidirectional in operation [17]. Thus, the auxiliary boosting capability of an impedance converter together with the possibility of bi-directional operation and fast dynamics has yet to be explored.

Different SoC and SoH conditions of an individual battery in a battery stack significantly hinders the efficiency of the system. Thus, there is a demand for a battery equalizer circuit. This paper proposes a bi-directional impedance converter based on a board EV-charger for bi-directional power transaction with LVDC-MG as shown in Fig. 1. The presented converter provides auxiliary boost capabilities by operating under shoot through operations, which ensures efficient operations during intermittent conditions. Moreover, its multi-input architecture allows for the stacking of the batteries of tuk-tuk/E-rickshaws, so they can operate with batteries of different characteristics by adequately regulating the battery charging/discharging current through control switches. The converter provides a continuous charging and discharging current profile at a low ripple with a low voltage/duty stress across the switches. The converter for bi-directional operation is simulated in the MATLAB Simulink environment and experimentally validated with the control implemented on a 16-bit fixed point DSP micro-controller (µC). The control algorithm of the proposed converter is able to individually control the charging/discharging rates of the battery stack.

Fig. 1
figure 1

Proposed converter

2 Operation modes

The operation of the proposed converter shown in Fig. 1 can be classified under two operating modes: discharging mode (batteries to LVDC-MG) and charging mode (LVDC-MG to batteries).

2.1 Discharging mode

Under this mode of operation, as shown in Fig. 2, the switches S1 and S2 control the discharging rate of the battery stacks. The switches S3, S4, S5, and S6 are turned off, with the body diodes of the switches providing the conducting paths.

Fig. 2
figure 2

Discharging operating modes: a only S1 is ON; b only S2 is ON; c S1 and S2 are OFF; d S1 and S2 are ON

The discharging mode is further subdivided, based on the switching states; (1) switch S1 or S2 is ON; (2) switches S1 and S2 are both OFF; (3) switches S1 and S2 are both ON. When one switch S1 is in conduction state, as shown in Fig. 2a, the impedance capacitor (CS) is charged through the differential current of the input current and the current through the inductor L2. The body diode of switch S3 is off while the body diode of switch S4 provides the return path for the current. The current toward LVDC-MG is supported by the discharging capacitor C2. For the time cycle where only S2 is conducting, as shown in Fig. 2b, the LVDC-MG side current is supported by the capacitor C3. When both the switches are off, as shown in Fig. 2c, the input inductor L2 charges rapidly while the energy stored in the inductor L1 is fed to the grid. The shoot through state allowing auxiliary boost capability, as shown in Fig. 2d, is observed under the simultaneous switching of S1 and S2, while the capacitors C2 and C3 feed the load demand.

2.2 Charging mode

The charging mode of operation, as shown in Fig. 3, is governed by the switches S3 and S4, while the switches S1 and S2 are turned OFF. The switches S5 and S6 are completely ON for this operating mode to provide the continuous charging current.

Fig. 3
figure 3

Charging operating modes: a only S3 is ON; b only S4 is ON; c S3 and S4 are ON

The operating duty of the switches S3 and S4 is maintained over 50% to provide continuous charging current to the battery. The charging states can be divided into: (1) S3 or S4 is ON, as shown in Fig. 3a and Fig. 3b; (2) both S3 and S4 are ON, as shown in Fig. 3c. When either S3 or S4 is turned on, the converter operates in the buck mode. The inductors L1/L4 charge while the inductor L2 discharges through the battery. The body diodes of the switches S1/S2 provide the return path for the current. A distinct advantage of the proposed converter is that the impedance capacitor acts as a pseudo source, where the capacitor charges to a voltage equal to the battery voltage, and it discharges the supporting inductors L1/ L3, which levels the current from LVDC-MG. When both of the switches S3 and S4 are ON, the inductors L1/L3 discharge, which charges the inductors L2/L4, respectively. The capacitor CS charges during this interval. The current across the coupled inductor and the capacitors for both the charging and discharging modes, is shown in Fig. 4.

Fig. 4
figure 4

Operating waveform: a discharging mode (D < 0.5); b discharging mode (D > 0.5); c charging mode

3 Converter analysis

3.1 Current mode converter analysis

The steady state current analysis for the proposed impedance converter, for both the discharging mode and charging mode, is based on the current second balance across the capacitor.

3.1.1 Discharging mode

During the discharging mode, the converter is capable of operating both in the normal mode with an operating duty of less than 50%, and the shoot through mode with an operating duty of more than 50%. With reference to Fig. 2, the converter analysis based on the switching states for the discharging mode can be subdivided into: (1) S1 or S2 is ON (1), (2); (2) S1 and S2 are both OFF (2) i.e., the normal operating mode; (3) S1 and S2 are both ON, i.e., the shoot through mode (4). The capacitors CS, C2, and C3 are given as below, where IC is the circulating current.

$${I}_{CS}={I}_{L1}-{I}_{in};\quad {I}_{C2}={I}_{O};\quad {I}_{C3}={I}_{O}+{I}_{C}-{I}_{L1}$$
(1)
$${I}_{CS}={I}_{L1}-{I}_{in};\quad {I}_{C2}={I}_{O}-{I}_{L1};\quad {I}_{C3}={I}_{O}$$
(2)
$${I}_{CS}={I}_{L1}-{I}_{in};\quad {I}_{C2}={I}_{O}-{I}_{L1};\quad {I}_{C3}={I}_{C}+{I}_{C2}$$
(3)
$${I}_{CS}={I}_{L1}-{I}_{in};\quad {I}_{C2}={I}_{O};\quad {I}_{C3}={I}_{O}$$
(4)

Solving (1), (2), and (3) yields \({I}_{in}={I}_{L1}\) and \({I}_{o}=\left(1-d\right){I}_{L1}\). Thus, the relation between the input and output current of the converter under normal operation is given by:

$${I}_{o}=\left(1-d\right){I}_{in}$$
(5)

Similarly, (1), (2), and (4) yield \({I}_{in}={I}_{L1}\) and \({I}_{O}=\frac{d}{\left(4d-1\right)}{I}_{L1}\). In addition, the transfer function for the input and output current for shoot through operation is given by:

$${I}_{O}=\frac{d}{\left(4d-1\right)}{I}_{in}$$
(6)

3.1.2 Charging mode

The capacitor currents for the switching states of S3 being ON, S4 being ON, and S3 and S4 both being ON are given by (7), (8), and (9), respectively.

$${I}_{CS}={I}_{L2}-{I}_{L1};\quad {I}_{C2}={I}_{L1}-{I}_{O};\quad {I}_{C3}={I}_{C}+{I}_{C2}$$
(7)
$${I}_{CS}={I}_{L2}-{I}_{L1};\quad {I}_{C2}=-{I}_{O};\quad {I}_{C3}={I}_{C}+{I}_{C2}+{I}_{L1}$$
(8)
$${I}_{CS}={I}_{L2}-{I}_{L1}; \quad{I}_{C2}={I}_{L1}-{I}_{O}$$
(9)

Solving (7), (8), and (9) yields \({I}_{O}=\frac{\left(3d-1\right)}{\left(4d-1\right)}{I}_{L1}\) and \({I}_{in}={I}_{L1}\). The transfer function for the grid current and charging current during the charging mode is given by:

$${I}_{O}=\frac{\left(3d-1\right)}{\left(4d-1\right)}{I}_{in}$$
(10)

Based on the analysis under the discharging mode under normal conditions, the inductors and capacitors are designed as follows:

$${L}_{1}=\frac{{V}_{B1}d}{\left(n+1\right)f\Delta {I}_{L1}},{ L}_{2}=\frac{n{V}_{B1}d}{\left(n+1\right)f\Delta {I}_{L1}},{ L}_{3}=\frac{{V}_{B2}d}{\left(n+1\right)f\Delta {I}_{L3}},{L}_{4}=\frac{n{V}_{B2}d}{\left(n+1\right)f\Delta {I}_{L3}}$$
(11)
$${C}_{2}=\frac{{V}_{O}d}{R\Delta {V}_{C2}f}{C}_{3}=\frac{{V}_{O}d}{R\Delta {V}_{C3}f}$$
(12)

3.2 Voltage mode converter analysis

3.2.1 Discharging mode

With reference to Fig. 2, the converter analysis based on the switching states for the discharging mode can be subdivided into: (1) S1 or S2 is ON (13) and (14); (2) S1 and S2 are both OFF (15); (3) S1 and S2 are both ON (16).

$${V}_{L2}+{V}_{L1}-{V}_{L3}-{V}_{L4}={V}_{B1}+{V}_{B2}-\frac{{V}_{O}}{2}; {V}_{L2}=n{V}_{L1};{ V}_{L4}=n{V}_{L3}$$
(13)
$${V}_{L2}+{V}_{L1}-{V}_{L3}-{V}_{L4}={V}_{B1}+{V}_{B2}-\frac{{V}_{O}}{2}; {V}_{L2}=n{V}_{L1}; {V}_{L4}=n{V}_{L3}$$
(14)
$${V}_{L2}+{V}_{L1}-{V}_{L3}-{V}_{L4}={V}_{B1}+{V}_{B2}-{V}_{O}; {V}_{L2}=n{V}_{L1}; {V}_{L4}=n{V}_{L3}$$
(15)
$${V}_{L2}+{V}_{L1}-{V}_{L3}-{V}_{L4}={V}_{B1}+{V}_{B2}; {V}_{L2}=n{V}_{L1}; {V}_{L4}=n{V}_{L3}$$
(16)

Taking the voltage second balance for the normal operation mode, the input output transfer function can be given as:

$${V}_{O}=\frac{1}{\left(1-d\right)}\left({V}_{B1}+{V}_{B2}\right)$$
(17)

where d1 = d2 = d and dO = 2(0.5–d). The transfer function for the shoot through mode is given as:

$${V}_{O}=\frac{\left(4d-1\right)}{d}\left({V}_{B1}+{V}_{B2}\right)$$
(18)

where d1 = d2 = d and dS = 2(0.5–d).

3.2.2 Charging mode

For the charging operation, the switches S3 and S4 are the governing switches controlling the charging rate. The switches S5 and S6 are turned ON for the complete cycle. For continuous charging of the battery stacks, the operating duty of the switches S3 and S4 is above 50%. Therefore, the steady state analysis during the charging mode can be analyzed for: (1) S3 or S4 is ON (19), (20); (2) S3 and S4 are both ON (21).

$${V}_{L3}+{V}_{L4}-{V}_{L2}-{V}_{L1}={V}_{B1}+{V}_{B2}-\frac{{V}_{O}}{2}; {V}_{L2}=n{V}_{L1}; {V}_{L4}=n{V}_{L3}$$
(19)
$${V}_{L3}+{V}_{L4}-{V}_{L2}-{V}_{L1}={V}_{B1}+{V}_{B2}-\frac{{V}_{O}}{2}; {V}_{L2}=n{V}_{L1}; {V}_{L4}=n{V}_{L3}$$
(20)
$${V}_{L3}+{V}_{L4}-{V}_{L2}-{V}_{L1}={V}_{B1}+{V}_{B2}-{V}_{O}; {V}_{L2}=n{V}_{L1}; {V}_{L4}=n{V}_{L3}$$
(21)

The transfer function can be given as:

$$\left({V}_{B1}+{V}_{B2}\right)=\frac{\left(3d-1\right)}{\left(4d-1\right)}{V}_{O}$$
(22)

where d3 = d4 = d and dsh = 2(d–0.5).

4 Control algorithm

The control algorithm for the proposed converter during the charging and discharging modes is shown in Figs. 5 and 6, respectively. During the power transaction from the battery stacks installed in the E-rickshaw to the LVDC grid, i.e., the discharging mode, the control algorithm governs the gating of the switches S1 and S2. The switches S3, S4, S5, and S6 are in the OFF state. The discharging current reference for the battery is compared to the actual current, and the error is passed through the PI controller. The controller is based on the feed forward of the steady state duty cycle to make the controller robust to variations. Under different battery SoC states, the control logic enables the secondary control loop governing the operating duty of the switches depending upon the difference of the battery SoCs. The secondary control loop results in different operating duties of the switches, which allows for independent discharging rates for the batteries.

Fig. 5
figure 5

Control algorithm for the discharging mode

Fig. 6
figure 6

Control algorithm for the charging mode

During the charging mode, the control parameters remain the same as the observed for the discharging mode. The charging rate of the battery stacks can be controlled based on the present battery SoC conditions, which is similar to the discharging mode. The charging rate is governed by the switches S3 and S4, while the switches S1 and S2 are in the off state. Moreover, the switches S5 and S6 remain in the conducting state during the charging mode. The operating duty of the switches is governed so that the battery with the lowest SoC charges at a faster rate. With different charging rates, when the SoCs of two batteries equalize, the batteries charge at similar rates. For continuous charging of the batteries, the operating duty of the switches S3 and S4 is maintained above 50%. A unified controller is utilized for configuring the charging and discharging profile of the batteries in contrast to the complicated fuzzy logic control proposed in [8].

5 Stability analysis

The state space analysis for the proposed converter under both V2G mode and G2V mode is formulated below for balanced conditions with L1 = L3, L2 = L4, and C2 = C3. Under balance conditions, the circulating current (IC) is taken as 0. For the discharging mode with an operating duty of less than 0.5, the state space matrices for the switching states based on the KVL and KCL equations for S1 and S2 conduct alone (23), (24), and S1 and S2 are OFF (25).

$$\mathrm{AON}1=\left[\begin{array}{cccc}0& 0& 0& \frac{-1}{{2\mathrm{L}}_{1}(\mathrm{n}+1)}\\ 0& 0& \frac{-1}{{2\mathrm{L}}_{2}}& \frac{-\mathrm{n}}{{2\mathrm{L}}_{2}(\mathrm{n}+1)}\\ \frac{1}{{\mathrm{C}}_{\mathrm{s}}}& \frac{-1}{{\mathrm{C}}_{\mathrm{s}}}& 0& 0\\ \frac{-1}{{\mathrm{C}}_{2}}& 0& 0& \frac{2}{{\mathrm{RC}}_{2}}\end{array}\right] ;\quad\mathrm{ BON}1=\left[\begin{array}{c}\frac{1}{{\mathrm{L}}_{1}(\mathrm{n}+1)}\\ \frac{\mathrm{n}}{{\mathrm{L}}_{2}(\mathrm{n}+1)}\\ 0\\ 0\end{array}\right]$$
(23)
$$\mathrm{AON}2=\left[\begin{array}{cccc}0& 0& 0& \frac{-1}{{2\mathrm{L}}_{1}(\mathrm{n}+1)}\\ 0& 0& \frac{-1}{{2\mathrm{L}}_{2}}& \frac{-\mathrm{n}}{{2\mathrm{L}}_{2}(\mathrm{n}+1)}\\ \frac{1}{{\mathrm{C}}_{\mathrm{s}}}& \frac{-1}{{\mathrm{C}}_{\mathrm{s}}}& 0& 0\\ \frac{-1}{{\mathrm{C}}_{2}}& 0& 0& \frac{2}{{\mathrm{RC}}_{2}}\end{array}\right] ;\quad\mathrm{ BON}2=\left[\begin{array}{c}\frac{1}{{\mathrm{L}}_{1}(\mathrm{n}+1)}\\ \frac{\mathrm{n}}{{\mathrm{L}}_{2}(\mathrm{n}+1)}\\ 0\\ 0\end{array}\right]$$
(24)
$$\mathrm{AOFF}=\left[\begin{array}{cccc}0& 0& 0& \frac{-1}{{\mathrm{L}}_{1}(\mathrm{n}+1)}\\ 0& 0& \frac{-1}{{2\mathrm{L}}_{2}}& \frac{-\mathrm{n}}{{\mathrm{L}}_{2}(\mathrm{n}+1)}\\ \frac{1}{{\mathrm{C}}_{\mathrm{s}}}& \frac{-1}{{\mathrm{C}}_{\mathrm{s}}}& 0& 0\\ \frac{-1}{{\mathrm{C}}_{2}}& 0& 0& \frac{2}{{\mathrm{RC}}_{2}}\end{array}\right] ;\quad\mathrm{ BOFF}=\left[\begin{array}{c}\frac{1}{{\mathrm{L}}_{1}(\mathrm{n}+1)}\\ \frac{\mathrm{n}}{{\mathrm{L}}_{2}(\mathrm{n}+1)}\\ 0\\ 0\end{array}\right]$$
(25)

With the state space variables, \({X = \left[\begin{array}{cccc}{I}_{L1}& {I}_{L2}& {V}_{CS}& {V}_{C2}\end{array}\right]}^{T}\) and \(Y\hspace{0.17em}=\hspace{0.17em}\left[{V}_{B1}\right]\). The state space averaging for the converter is computed based on X’ = AX + Fd, with A = D[AON1] + D[AON2] + (1-2D)[AOFF] and F = [AON1 + AON2-2AOFF]X + [BON1 + BON2-2BOFF]Y.

$$\mathrm{A }=\left[\begin{array}{cccc}0& 0& 0& \frac{\mathrm{d}-1}{{\mathrm{L}}_{1}(\mathrm{n}+1)}\\ 0& 0& \frac{-1}{{2\mathrm{L}}_{2}}& \frac{\mathrm{n}(\mathrm{d}-1)}{{\mathrm{L}}_{2}(\mathrm{n}+1)}\\ \frac{1}{{\mathrm{C}}_{\mathrm{s}}}& \frac{-1}{{\mathrm{C}}_{\mathrm{s}}}& 0& 0\\ \frac{-1}{{\mathrm{C}}_{2}}& 0& 0& \frac{2}{{\mathrm{RC}}_{2}}\end{array}\right]\quad\mathrm{ and\quad F }= \left[\begin{array}{c}\frac{{\mathrm{V}}_{\mathrm{C}2}}{{\mathrm{L}}_{1}(\mathrm{n}+1)}\\ \frac{{\mathrm{nV}}_{\mathrm{C}2}}{{\mathrm{L}}_{2}(\mathrm{n}+1)}\\ 0\\ 0\end{array}\right]$$
(26)
$$\frac{\widehat{{\mathrm{I}}_{\mathrm{L}1}}}{\widehat{\mathrm{d}}}=\frac{\left(\mathrm{s}-\frac{2}{{\mathrm{RC}}_{2}}\right)\left(\frac{1}{{\mathrm{L}}_{1}\left(1+\mathrm{n}\right)}\right)\left({\mathrm{s}}^{2}-\frac{1}{2{\mathrm{C}}_{\mathrm{s}}{\mathrm{L}}_{2}}\right){\mathrm{V}}_{2}}{-\frac{\left(\frac{\left(1-\mathrm{d}\right)}{{\mathrm{L}}_{1}\left(1+\mathrm{n}\right)}\right)\left({\mathrm{s}}^{2}-\frac{1}{2{\mathrm{C}}_{\mathrm{s}}{\mathrm{L}}_{2}}\right)}{{\mathrm{C}}_{2}}+\left(\mathrm{s}-\frac{2}{{\mathrm{RC}}_{2}}\right)\left({\mathrm{s}}^{3}-\frac{\mathrm{s}}{2{\mathrm{C}}_{\mathrm{s}}{\mathrm{L}}_{2}}\right)}$$
(27)

The transfer function for small variation in the current \(\widehat{{\mathrm{I}}_{\mathrm{L}1}}\) and the duty \(\widehat{d}\) is computed using \(\frac{\widehat{x}}{\widehat{d}}={[SI-A]}^{-1}\) (27). For shoot through, the state space matrices for S1 ON and S2 ON remain the same as AON1, BON1 and AON2, BON2 (23) and (24), respectively. The space matrix is given by (28).

$$\mathrm{ASH}=\left[\begin{array}{cccc}0& 0& 0& 0\\ 0& 0& \frac{-1}{{2\mathrm{L}}_{2}}& 0\\ \frac{1}{{\mathrm{C}}_{\mathrm{s}}}& \frac{-1}{{\mathrm{C}}_{\mathrm{s}}}& 0& 0\\ 0& 0& 0& \frac{2}{{\mathrm{RC}}_{2}}\end{array}\right] ;\quad\mathrm{ BSH}=\left[\begin{array}{c}\frac{1}{{\mathrm{L}}_{1}(\mathrm{n}+1)}\\ \frac{\mathrm{n}}{{\mathrm{L}}_{2}(\mathrm{n}+1)}\\ 0\\ 0\end{array}\right]$$
(28)

The averaging of the state space matrices is based on the relations A = D[AON1] + D[AON2] + (2D-1)[ASH] and F = [AON1 + AON2 + 2ASH]X + [BON1 + BON2 + 2BSH]Y, given by:

$$\mathrm{A}=\left[\begin{array}{cccc}0& 0& 0& \frac{-\mathrm{D}}{{\mathrm{L}}_{1}(\mathrm{n}+1)}\\ 0& 0& \frac{1-4\mathrm{D}}{2{\mathrm{L}}_{2}}& \frac{-\mathrm{Dn}}{{\mathrm{L}}_{2}(\mathrm{n}+1)}\\ \frac{-1+4\mathrm{D}}{{\mathrm{C}}_{\mathrm{S}}}& \frac{1-4\mathrm{D}}{{\mathrm{C}}_{\mathrm{S}}}& 0& 0\\ \frac{-2\mathrm{D}}{{\mathrm{C}}_{2}}& 0& 0& \frac{-2+8\mathrm{D}}{{\mathrm{RC}}_{2}}\end{array}\right]\mathrm{ and\quad F}=\left[\begin{array}{c}\frac{{-\mathrm{V}}_{\mathrm{C}2}+4{\mathrm{V}}_{\mathrm{B}1}}{{\mathrm{L}}_{1}(\mathrm{n}+1)}\\ \frac{{-\mathrm{nV}}_{\mathrm{C}2}+4{\mathrm{nV}}_{\mathrm{B}1}}{{\mathrm{L}}_{2}(\mathrm{n}+1)}-\frac{{2\mathrm{V}}_{\mathrm{s}}}{{\mathrm{L}}_{2}}\\ \frac{4({\mathrm{I}}_{\mathrm{L}1}-{\mathrm{I}}_{\mathrm{L}2})}{{\mathrm{C}}_{\mathrm{s}}}\\ \frac{-{2\mathrm{I}}_{\mathrm{L}1}}{{\mathrm{C}}_{2}}+\frac{8{\mathrm{V}}_{\mathrm{C}2}}{{\mathrm{RC}}_{2}}\end{array}\right]$$
(29)
$$\frac{\widehat{{\mathrm{I}}_{\mathrm{L}1}}}{\widehat{\mathrm{d}}}=\frac{\left({\mathrm{s}}^{2}-\frac{\left(16{\mathrm{d}}^{2}-8\mathrm{d}+1\right)}{2{\mathrm{C}}_{\mathrm{s}}{\mathrm{L}}_{2}}\right)}{\left(\frac{-4{\mathrm{d}}^{2}\left({\mathrm{s}}^{2}- \frac{1-8\mathrm{d}+16{\mathrm{d}}^{2}}{2{\mathrm{C}}_{\mathrm{s}}{\mathrm{L}}_{2}}\right)}{{2{\mathrm{C}}_{2}\mathrm{L}}_{1}\left(1+\mathrm{n}\right)}+\left(\mathrm{s}+\frac{2-8\mathrm{d}}{{\mathrm{RC}}_{2}}\right)\left({\mathrm{s}}^{3}-\frac{\mathrm{s}\left(16{\mathrm{d}}^{2}-8\mathrm{d}+1\right)}{2{\mathrm{C}}_{\mathrm{s}}{\mathrm{L}}_{2}}\right)\right)}\left(\frac{\frac{4\mathrm{d}}{{\mathrm{C}}_{2}}\left(-{\mathrm{I}}_{\mathrm{L}1}+4\frac{{\mathrm{V}}_{2}}{\mathrm{R}}\right)}{{2\mathrm{L}}_{1}\left(1+\mathrm{n}\right)}+\frac{\left(\mathrm{s}+\frac{2\left(1-4\mathrm{d}\right)}{{\mathrm{RC}}_{2}}\right)\left(\frac{-{\mathrm{V}}_{2}+4{\mathrm{V}}_{\mathrm{B}1}}{{\mathrm{L}}_{1}\left(1+\mathrm{n}\right)}\right)}{1}\right)$$
(30)

The transfer function of the current \(\widehat{{\mathrm{I}}_{\mathrm{L}1}}\) and the duty \(\widehat{d}\) is given by (30) above.

The state space matrices for the charging mode with the variables X = \({\left[\begin{array}{ccc}{I}_{L1}& {I}_{L2}& {V}_{CS}\end{array}\right]}^{T}\) and \(Y = \left[{V}_{C2}\right]\) for the switching state S3 or S4 being ON (31), (32), and S3 or S4 being ON (33) are:

$$\mathrm{ACON}1=\left[\begin{array}{ccc}0& 0& \frac{1}{{2\mathrm{L}}_{1}(\mathrm{n}+1)}\\ 0& 0& \frac{\mathrm{n}}{{2\mathrm{L}}_{2}(\mathrm{n}+1)}\\ \frac{-1}{{\mathrm{C}}_{\mathrm{s}}}& \frac{1}{{\mathrm{C}}_{\mathrm{s}}}& 0\end{array}\right];\quad\mathrm{ BCON}1=\left[\begin{array}{c}\frac{1}{{2\mathrm{L}}_{1}(\mathrm{n}+1)}\\ \frac{\mathrm{n}}{{2\mathrm{L}}_{2}(\mathrm{n}+1)}\\ 0\end{array}\right]$$
(31)
$$\mathrm{ACON}2=\left[\begin{array}{ccc}0& 0& \frac{1}{{2\mathrm{L}}_{1}(\mathrm{n}+1)}\\ 0& 0& \frac{\mathrm{n}}{{2\mathrm{L}}_{2}(\mathrm{n}+1)}\\ \frac{-1}{{\mathrm{C}}_{\mathrm{s}}}& \frac{1}{{\mathrm{C}}_{\mathrm{s}}}& 0\end{array}\right];\quad\mathrm{ BCON}2=\left[\begin{array}{c}\frac{1}{{2\mathrm{L}}_{1}(\mathrm{n}+1)}\\ \frac{\mathrm{n}}{{2\mathrm{L}}_{2}(\mathrm{n}+1)}\\ 0\end{array}\right]$$
(32)
$$\mathrm{ACSH}\hspace{0.17em}=\hspace{0.17em}\left[\begin{array}{ccc}0& 0& \frac{1}{{2\mathrm{L}}_{1}(\mathrm{n}+1)}\\ 0& 0& \frac{\mathrm{n}}{{2\mathrm{L}}_{2}(\mathrm{n}+1)}\\ \frac{-1}{{\mathrm{C}}_{\mathrm{s}}}& \frac{1}{{\mathrm{C}}_{\mathrm{s}}}& 0\end{array}\right];\quad\mathrm{ BCSH}=\left[\begin{array}{c}\frac{-1}{{2\mathrm{L}}_{1}(\mathrm{n}+1)}\\ \frac{-\mathrm{n}}{{2\mathrm{L}}_{1}(\mathrm{n}+1)}\\ 0\end{array}\right]$$
(33)

The state space averaging is based on A = D[ACON1] + D[ACON2] + (2D-1)[ACSH] and F = [ACON1 + ACON2 + 2ACSH]X + [BCON1 + BCON2 + 2BCSH]Y, and is given by (24).

$$\mathrm{A}=\left[\begin{array}{ccc}0& 0& \frac{4\mathrm{d}-1}{{2\mathrm{L}}_{2}(\mathrm{n}+1)}\\ 0& 0& \frac{\mathrm{n}\left(4\mathrm{d}-1\right)}{{2\mathrm{L}}_{1}(\mathrm{n}+1)}\\ \frac{1-4\mathrm{d}}{{\mathrm{C}}_{\mathrm{s}}}& \frac{-\left(1-4\mathrm{d}\right)}{{\mathrm{C}}_{\mathrm{s}}}& 0\end{array}\right]\quad\mathrm{ and\quad F}=\left[\begin{array}{c}\frac{{2\mathrm{V}}_{\mathrm{S}}}{{\mathrm{L}}_{1}(\mathrm{n}+1)}\\ \frac{{2\mathrm{nV}}_{\mathrm{S}}}{{\mathrm{L}}_{1}(\mathrm{n}+1)}\\ \frac{-4({\mathrm{I}}_{\mathrm{L}1}-{\mathrm{I}}_{\mathrm{L}2})}{{\mathrm{C}}_{\mathrm{s}}}\end{array}\right]$$
(34)
$$\frac{\widehat{{\mathrm{I}}_{\mathrm{L}1}}}{\widehat{\mathrm{d}}}=\left(\frac{1}{{\mathrm{s}}^{3}+\frac{\mathrm{s}\left(16{\mathrm{d}}^{2}-8\mathrm{d}+1\right)}{2{\mathrm{C}}_{\mathrm{S}}}\left(\frac{1}{{\mathrm{L}}_{1}\left(1+\mathrm{n}\right)}-\frac{2}{{\mathrm{L}}_{2}\left(1+\mathrm{n}\right)}\right)}\right)\left(\frac{\frac{4\mathrm{s}\left({\mathrm{I}}_{\mathrm{L}2}-{\mathrm{I}}_{\mathrm{L}1}\right)\left(4\mathrm{d}-1\right)}{{2{\mathrm{C}}_{\mathrm{s}}\mathrm{L}}_{1}\left(1+\mathrm{n}\right)}}{1}+\frac{\frac{4\mathrm{n}\left(16{\mathrm{d}}^{2}-8\mathrm{d}+1\right){\mathrm{V}}_{\mathrm{s}}}{{2{\mathrm{C}}_{\mathrm{S}}\mathrm{L}}_{1}\left(1+\mathrm{n}\right)}}{{2\mathrm{L}}_{2}\left(1+\mathrm{n}\right)}+\frac{4{\mathrm{V}}_{\mathrm{s}}\left({\mathrm{s}}^{2}-\frac{\mathrm{n}\left(16{\mathrm{d}}^{2}-8\mathrm{d}+1\right){\mathrm{V}}_{\mathrm{s}}}{{2{\mathrm{C}}_{\mathrm{S}}\mathrm{L}}_{2}\left(1+\mathrm{n}\right)}\right)}{{2\mathrm{L}}_{1}\left(1+\mathrm{n}\right)}\right)$$
(35)

The transfer function in reference to small variations in the parameters IL1 and d is given by (35).

Bode plots for the discharging and charging states are as shown in Fig. 7a and b, respectively. From these plots, the crossover frequency of the converter is 39 kHz with a positive phase margin and an infinite gain margin, which confirms the stable operation of the converter in the charging and discharging modes. The stability is further verified via Nyquist stability criteria for both the discharging and charging modes of operation as shown in Fig. 8. An ideal system is considered with the system parameters specified in Table 1. The Nyquist contour encircles the right half of the s plane for all of the operating modes as shown in Fig. 8, which affirms the stability of the controller under both operating modes.

Fig. 7
figure 7

Stability plot: a discharging mode; b charging mode

Fig. 8
figure 8

Nyquist: a discharging (normal); b discharging (shoot); c charging

Table 1 Simulation parameters

6 MATLAB-based simulation

The presented grid interfaced bi-directional converter is designed and simulated in MATLAB Simulink. Two 12 V/17 Ah lead acid batteries representing an E-rickshaw/tuk-tuk are stacked as the multi-input supply of the impedance converter interfaced with a 48 V LVDC grid. The converter parameters are shown in Table 1.

The dynamic response of the converter under a transition from V2G to G2V is shown in Fig. 9. In addition, Fig. 9a shows the dynamics of the input side, i.e., the input voltage (VIN), the impedance capacitor voltage (VS), the battery stack currents (IB1 and IB2), and the SoC of the batteries (SoC1/SoC2). The grid voltage (VG) and the grid current (IO) along with the common mode current (IC) are shown in Fig. 9b. Initially, both of the batteries with the same SoC of 80%, discharge at a constant rate of 3.4 A. The cumulative battery voltage at the input and the impedance capacitor is maintained at 24.2 V. The LVDC grid maintained at 48 V is fed by a continuous current of 1.65 A. At t = 0.5 s, the controller transits from the discharging mode to the charging mode. The voltage across the capacitor is now governed by the grid increase to 25.3 V. The battery is charged at a fixed rate equivalent to C/5, i.e., 3.4 A. The charger draws 1.95 A from the grid. The initial SoCs of the batteries are considered to be equal. Hence, the common mode current is averaged to 0 as shown in Fig. 9b. The zoomed profiles of the converter dynamics during both the discharging state and the charging state are shown in Figs. 10 and 11, respectively. The current ripple across the battery in the discharging state is 0.4 A. Meanwhile, the ripples in the grid current and the common mode current are 0.1 A and 0.2 A, respectively. During the charging mode, the ripple of 0.4 A is maintained across the battery stacks with ripples of 0.1 A and 0.2 A in IG and IC, respectively.

Fig. 9
figure 9

Discharge to charge mode: i input and capacitor voltages (VIN and VC); ii battery currents (IB1 and IB2); iii SoCs (SoC1 and SoC2); iv grid voltage (VG); v grid current (IG); vi converter current (IC)

Fig. 10
figure 10

Discharging mode dynamics: i input and capacitor voltages (VIN and VC); ii battery currents (IB1 and IB2); iii SoCs (SoC1 and SoC2); iv grid voltage (VG); v grid current (IG); vi converter current (IC)

Fig. 11
figure 11

Charging mode dynamics: i input and capacitor voltages (VIN and VC); ii battery currents (IB1 and IB2); iii SoCs (SoC1 and SoC2); iv grid voltage (VG); v grid current (IG); vi converter current (IC)

The responses of converter with the batteries at different SoCs charging at different rates are shown in Fig. 12. The initial SoCs of the two batteries are maintained at 80% for battery 1 and at 79.5% for battery 2. The battery with its SoC at 79.5% initially charges at a constant current of 3.5 A, so that a balance among the batteries can be achieved. Meanwhile, the second battery with its SoC at 80% charges at a current of 3.4 A. As the gradient in SoCs of the two batteries is reduced, the charging current of battery 2 is reduced. The capacitor voltage is maintained at 25.3 V and the converter draws 1.9 A from the LVDC grid to charge the batteries. When the two batteries have different SoCs, an average common mode current of 0.1 A is observed. The dynamic response of the converter for batteries with different SoCs discharging at different rates is shown in Fig. 13. The initial SoCs of battery 1 and battery 2 are considered to be 80% and 80.5%, respectively. Battery 2 being healthier discharges at 3.5 A, and battery 1 discharges at 3.4 A. The grid is fed by a constant current of 1.6 A. The impedance capacitor voltage is kept equal to the input voltage of 24.5 V. The common mode current is observed to be − 0.1 A. When the difference in the SoCs is reduced, the discharging current of battery 2 is reduced. The difference in the charging and discharging rates of the batteries with respect to their SoC is given in Fig. 14.

Fig. 12
figure 12

Responses for charging at different SoC values: i SoCs (SoC1 and SoC2); ii battery currents (IB1 and IB2); iii converter current

Fig. 13
figure 13

Responses for discharging at different SoC values: i SoCs (SoC1 and SoC2); ii battery currents (IB1 and IB2; iii converter current

Fig. 14
figure 14

Different SoCs: a charging; b discharging

7 Experimental verification

A prototype of the proposed bi-directional impedance source converter was experimentally validated. 12 V/7 Ah batteries are taken at the input side of the converter to represent the battery stacks of E-rickshaws/tuk-tuks. The 48 V grid is maintained through 4, 12 V/17 Ah batteries. The control is embedded in a 16-bit DSP micro-controller (dsPIC33FJ16GS502), which ensures its low cost. The analog sampling at 600 Hz is triggered through the timer module. The PI controller works on the principle of repeated error correction. The dynamic response of the developed prototype for a transition from V2G to G2V isshown in Fig. 15. The voltage parameters corresponding to the converter i.e., the grid voltage (VG), the impedance capacitor voltage (VS), and the battery voltages (VB1 and VB2) are shown in Fig. 15a. The converter output current (IOUT) and the battery currents (IB1 and IB2) are shown in Fig. 15b. Initially, both of the batteries discharge at 2.9 A. The terminal voltage of both batteries is maintained at 14 V, and the grid voltage is 48 V. The voltage across the impedance capacitor is 24.5 V, and the converter feeds 1.5 A to the LVDC µG. At t = 12 s, the converter transits from the discharging mode to the charging mode, with the grid voltage increasing to 51 V (battery stack) feeding 1A to the converter. The converter charges the battery at a current of 1 A, with the battery voltages at 12 V. The impedance capacitor voltage increases to 26.5 V due to a reverse power flow. Figure 16 exhibits the converter response for the input side batteries discharging at different SoCs, where the voltages across battery 1 and battery 2 are 12 and 14 V, respectively. The LVDC µG and the impedance capacitor voltage are maintained at 48 and 24.5 V, respectively. Battery 2, which is at higher SoC, discharges at a higher rate of 3 A, while battery 1 discharges at a rate of 2.7 A. It can be observed thatthe slope of the discharging current of battery 2 gradually decreases when the difference in the voltages is reduced. To affirm the capability of the converter, the responses with the batteries charging at different SoCs are shown in Fig. 17. The battery voltages of battery 1 and battery 2 are kept at 12.5 and 12 V, respectively. Battery 2, which is at a lower SoC, charges at a current of 1.1 A, while battery 1 charges at 900 mA. The µG and the impedance capacitor voltage are maintained at 48 V and 25.5 V, respectively.

Fig. 15
figure 15

Discharge to charge: i grid voltage (VG); ii capacitor voltage (VS); iii battery voltage (VB1); iv battery voltage (VB2); v converter current (IO); vi battery current (IB1); vii battery current (IB2)

Fig. 16
figure 16

Discharging at different SoC values: i grid voltage (VG); ii capacitor voltage (VS); iii battery voltage (VB1); iv battery voltage (VB2); v converter current (IO); vi battery current (IB1); vii battery current (IB2)

Fig. 17
figure 17

Charging at different SoC values: i grid voltage (VG); ii capacitor voltage (VS); iii battery voltage (VB1); iv battery voltage (VB2); v converter current (IO); vi battery current (IB1); vii battery current (IB2)

A comparison is drawn between the conventional bi-directional buck boost converter and the proposed impedance converter as shown in Fig. 18. For a low input voltage of 18.5 V, which represents the deep discharge condition, the operating duty for the proposed impedance converter is significantly less than that of conventional buck boost converter. With a higher battery voltage, the impedance converter for an output of 48 V operates at a duty that is significantly less than that of the buck boost converter, which reduces the loss and stress across the converter. Figure 19a, b depicts the gain curvesof the proposed converter (taking VB1 = VB2) for both the boost and buck operations in comparison to the conventional low-cost converter as shown in Table 2.

Fig. 18
figure 18

Performance comparison between a buck boost converter and an impedance converter

Fig. 19
figure 19

Gain curve: a buck mode; b boost mode

Table 2 Comparison

Figure 19a, b affirms the superior buck and boost curves of the proposed converter in comparison to conventional non-isolated bi-directional converters. For a duty greater than 0.5 in the boost mode, the gain of the proposed converter is linear when the duty increases. Meanwhile, the remaining converters enter the unstable operating region. The comparison further demonstrates the superior and wide operating range of the impedance converter over conventional bi-directional converters by virtue of the impedance network providing an auxiliary boost.

These simulation and hardware results affirm the converter operation, and validate the proposed control algorithm. The impedance converter being bi-directional, power dense, and modular provides a low-cost alternative to the present on-board chargers for E-rickshaws/tuk-tuks. Converters with the ability to individually control the charging / discharging rates of connected battery stacks ensure healthy battery stacks for prolonged periods of time.

8 Conclusion

Simulation and hardware results affirmed the bi-directional functionality and wide operating capability of the proposed impedance converter. These results also demonstrated the proposed multiport converters capability in terms of configurable charging and discharging of the connected battery stacks based on the state of charge (SoC) of individual batteries, which significantly reduces battery degradation. Control over an individual battery from a simple control algorithm allows for flexibility in the control of modular power-dense low-ripple converters, which allows for the direct coupling of converters with a low-voltage DC grid.