% Three phase 5-Level Cascaded H-Bridge Converter (CHB)
% Author: Amir Ostadrahimi
\documentclass [border=5pt]{standalone}
\usepackage{tikz}
\usepackage[american,cuteinductors,smartlabels]{circuitikz} % A package to draw electrical networks with TikZ
%-- the dimensions of the elements can be changed here
\ctikzset{bipoles/thickness=0.7}
\ctikzset{grounds/thickness=0.8}
\ctikzset{bipoles/length=1.1cm}
\ctikzset{bipoles/resistor/width=.7}
\ctikzset{bipoles/resistor/height=.25}
\ctikzset{bipoles/diode/height=.7}
\ctikzset{bipoles/diode/width=.7}
\ctikzset{tripoles/thickness=.7}
\ctikzset{bipoles/vsourceam/height/.initial=.7}
\ctikzset{bipoles/vsourceam/width/.initial=.7}
\ctikzset{bipoles/battery1/height=.4}
\ctikzset{bipoles/vsourceam/width/.initial=.7}
\tikzstyle{every node}=[font=\small]
\tikzstyle{every path}=[line width=0.9 pt, line cap=round, line join=round]
% difining new colors
\definecolor{MatlabBlue}{rgb}{0 0.4470 0.7410} % define the blue color of the Matlab
%
% defining distances between elements--- One can change the dimension fo the converter by changing these distances:
\newcommand\IHD{1.2} %Horizontal distance between IGBTs in a cell
\newcommand\IVD{0.2} %Vertical distance between IGBTs in a cell
\newcommand\VSD{0.9} %distance of the voltage source
\newcommand\VCD{0.3} %Vertical Cell Distance between cells
\newcommand\GL{1.5} %GL means ground connection length
\newcommand\HPD{3.6} %HPD stands for Horizontal Phase distance
\newcommand\fillsize{1} %fillsize
\begin{document}
\begin{circuitikz}