# Design of the Converter Prototype for Powering the Hydrogen Electrolyzer
## 3 Constant Current Source Control Algorithm
At the same time, during the debug mode, the processor will be suspended, and it is impossible to guarantee the current logic level of the control signals. Therefore, it is necessary to include the EMU_STOP event, which occurs during this interruption, among the fault conditions. The safe states of transistors are described in Figure 5:7  
When the transistor is turned off, the current in the circuit rapidly changes, creating overvoltage on the parasitic leakage inductance. This overvoltage creates voltage stress on circuit components, negatively affecting especially semiconductor elements. Therefore, RC snubbers, as seen in Figure 14, are assigned to the switching elements to absorb the energy accumulated in the stray inductance and turn it into heat when the transistor is switched on [18]. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Signal** & **Transistor** & **Safe State** \\ \hline EPWM1A & BUCK1 upper branch & 0 \\ EPWM1B & BUCK1 lower branch & 1 \\ EPWM2A & BUCK2 upper branch & 0 \\ EPWM2B & BUCK2 lower branch & 1 \\ EPWM3A & Inverter ACT 1 & 0 \\ EPWM3B & Inverter NULL 2 & 1 \\ EPWM5A & Inverter P\_UP & 0 \\ EPWM5B & Inverter L\_DOWN & 0 \\ EPWM7A & Inverter L\_UP & 0 \\ EPWM7B & Inverter P\_DOWN & 0 \\ \hline \hline \end{tabular} \({}^{1}\)Q2 in Figure 10. \({}^{2}\)Q1 in Figure 10.  
\end{table} 
Table 2: Control signal safe states. Figure 13: Control diagram flowchart. The leakage inductance \(L_{lk}\) must be determined to set the snubber parameters. One approach involves observing the change in overshoot frequency by adding a small capacitance \(C_{add}\) parallel to the MOSFET drain and source. The circuit resonates as a series LC circuit, with resonance frequencies fr\({}_{1}\) (without \(C_{add}\)) and \(f_{7}\) (with \(C_{add}\)). Substituting these into [PERSON]'s relation provides equations to calculate L\({}_{\rm{lk}}\) and C\({}_{\rm{oss}}\) (Equations (32)-(35)). Ideal damping allows for \(R_{s}\) and \(C_{s}\) to be derived (Equations (36) and (37)), with resistor power loss \(P_{Rs}\) expressed in Equation (38), dependent on switching frequency \(f_{sw}\) and current amplitude \(I\)[29; 30; 31]. \[f_{r1}=\frac{1}{2\pi\sqrt{L_{lk}C_{oss}}} \tag{32}\]  
\[f_{r2}=\frac{1}{2\pi\sqrt{L_{lk}(C_{oss}+C_{add})}} \tag{33}\]  
\[L_{lk}=\frac{f_{1}^{2}-f_{2}^{2}}{C_{add}\cdot f_{2}^{2}\cdot f_{1}^{2}}= \frac{(16.67\;{\rm MHz})^{2}-(12.82\;{\rm MHz})^{2}}{4\pi^{2}\;{\rm 20\;pF}(16.67\;{\rm MHz })^{2}.(12.82\;{\rm MHz})^{2}}\cong 28.6\;{\rm nH} \tag{34}\]  
\[C_{oss}=\frac{C_{add}\cdot f_{2}^{2}}{f_{1}^{2}-f_{2}^{2}}=\frac{220\;{\rm pF} \cdot(12.82\;{\rm MHz})^{2}}{(16.67\;{\rm MHz})^{2}-(12.82\;{\rm MHz})^{2}} \cong 320\;{\rm pF} \tag{35}\]  
\[R_{s}=\frac{1}{2}\sqrt{\frac{L_{lk}}{C_{lk}}}=\frac{1}{2}\sqrt{\frac{28.6\;{ \rm nH}}{320\;{\rm pF}}}\cong 15\Omega \tag{36}\]  
\[C_{s}=\frac{1}{2\pi f_{1}\cdot R_{s}}\cong 680\;{\rm pF} \tag{37}\]  
\[P_{Rs}=I^{2}\cdot L_{lk}\cdot\frac{f_{sw}}{f_{1}}^{2}=10{\rm A}^{2}\cdot 28.6 \;{\rm nH}\cdot\frac{(400\;{\rm kHz})^{2}}{16.67\;{\rm MHz}}=137{\rm mW} \tag{38}\]  
The total power loss of the designed converter is calculated to be 21.32 W (see Equation (39)) at the maximum converter load \(I_{out}\) = 20 A, \(I_{out}\) = 9 V. In this case, the efficiency is 89.4% according to Equation (40). The relatively low efficiency is caused by the required output parameters, i.e., low output voltage at a higher current value. At the same time, the device consists of a current source and an inverter to achieve the optimal shape of the output current for measuring the impact of the pulsed power supply of the electrolyzer. Since this is an advanced electrolyzer power supply idea, we are unaware of a similar device with which a comparison could be made. Maximizing efficiency will be the subject of future research. \[P_{TOT\_INV}=2\cdot P_{TOT\_{back}}+P_{TOT\_{Hbridge}}+P_{MCU\_{module}}=2 \cdot 3.933\;{\rm W}+12.882\;{\rm W}+50\;{\rm mW}=21.32\;{\rm W} \tag{39}\]  
Figure 13:0 Derivation of leakage inductance.