Sumukh Surya, Ahilya Chhetri, Arjun M, Sheldon Williamson
©SHUTTERSTOCK.COM/TRZMIEL
Learning power electronic circuits through simulation is one of the effective methods available for students and researchers to understand the subject effectively. This article aims at providing a panoramic view of different software tools used for simulating electrical circuits, enabling students to make an appropriate choice among various tools for a specific application. In this regard, a simple buck converter operating in the continuous conduction mode (CCM) is considered and realized using two different approaches, viz., coding and modeling using the Matrix Laboratory (MATLAB), Scientific Laboratory (Scilab), and LTspice (by Linear Technology) software tools. Symbolic object function (syms) and ordinary differential equation (ODE) solvers are used to solve coupled ODEs in MATLAB. Detailed analyses of the frequency response for constant voltage ${(}{G}_{\text{vd}}{)}$ and average current operations ${(}{G}_{\text{id}}{)}$ are carried out. Although Scilab is open source software, it provides the same accuracy as that of a licensed tool, such as MATLAB. Furthermore, the LTspice software tool is observed to provide a quicker frequency response when compared to MATLAB.
The rapidly growing technology industry has seen a prolific use of power electronics, especially in automotive and renewable systems. It is a crucial component of our energy infrastructure and essential for a variety of electricity-related applications. Ideally, only those devices and circuits that, in principle, achieve good reliability and high efficiency are preferred in power electronics designs. These characteristics are implemented by switching circuits, supplemented by energy storage devices. Thus, the analysis and design of power electronic devices play an important role before the implementation of actual systems.
Several studies have focused on the application aspect of hardware related to power electronic converters, which transform power from one form to another. However, analysis and design essentially require modeling and simulation. With regard to technology and management, models are used as a basis for simulations to develop data for decision making. Models represent physical, logical, entity processes, phenomena, or mathematical representations of systems, while a simulation is a process that uses these models as functional digital prototypes of actual systems to predict their actual performance. The flow cycle of modeling and simulation using basic elements is presented in Fig. 1.
Fig 1 The flow of modeling and simulation (Cetinkaya et al., 2021).
Power processing for a variety of applications and power levels ranging from a few milliwatts to hundreds of megawatts is possible through the extensive usage of power electronic systems. Typically, switching circuits comprising passive components, such as inductors, capacitors, and resistors; semiconductor switches; and diodes are used. Integrated circuits for control operations are also an important component of power electronic systems. Thus, the design and analysis of these systems pose a substantial challenge due to their complexity and size. Tools for modeling and simulation aid a design engineer in better comprehending the functionalities of circuits, which equips the designer to select proper topologies and circuit components in accordance with the specifications. Furthermore, they function as a tool for assessing the circuit performance while predicting changes in operating circumstances due to changes in the circuit component values.
Time domain simulations provide results based on discrete time interval integration. They are useful in handling power electronic interfaces, system dynamics, and transients. Numerical methods are applied depending on the tool used, which results in solutions using iterative techniques or direct methods. The accuracy and stability of solutions depend on the size of the selected timestep. Since digital computers can only simulate circuit phenomena at discrete time intervals or frequencies, truncation errors are common in simulations. The solutions in time domain simulations can diverge from their true results when an incorrect timestep is selected because the errors accumulate from step to step. Thus, frequency domain simulations are preferred, as they are robust and provide solutions to circuits at each individual frequency without the accumulation of truncation errors. Since frequency domain simulation tools often treat system nonlinearities, such as current sources, they require less computation time for harmonic evaluations than time domain simulations. However, handling fast transients, control interfaces, and system dynamics are slightly difficult for available frequency domain solution tools (Gole et al., 1997).
The modeling of power electronic converters is essential for understanding the system dynamics, and the simulation of converters plays a vital role before the hardware design. Table 1 lists some of the well-known model-based power electronics simulation tools used for plant, system, and mathematical modeling. A brief description of the advantages and disadvantages of the available software tools is also listed. Furthermore, a list of programming languages considered for mathematical coding is shown in Table 2.
Table 1. Features of model-based simulation tools.
Table 2. Programming languages and their offered features.
Rectifies, cycloconverters, dc–dc converters, and inverters are some of the commonly used power electronic converters. When switches are employed to regulate unregulated dc voltages using dc–dc converters, the converters are known as switch mode power supplies (SMPSs). Inductors, capacitors, and electronic switches are the main components of SMPSs, which are designed to never short-circuit or open-circuit the inductors or capacitors, respectively. For desired output voltages and currents, a smaller duty ratio can be obtained using synchronous converters, thus minimizing conduction losses. Studies have been conducted on the modeling of nonisolated and isolated converters (Surya and Arjun, 2021; Surya and Srividya, 2021) using MATLAB/Simulink, where a simple approach is presented, and the effect of step size is discussed. Using a similar approach, a comparative analysis of a dc–dc buck converter, modeled using the discussed model-based tools, was performed in this study.
The equivalent circuit diagram of a simple buck converter operating in CCM is shown in Fig. 2. Fig. 2(a) and (b) shows the equivalent circuit diagrams when the switch (MOSFET) is closed and opened, respectively. Since the converter uses two energy storage elements, there are two governing equations for solving the circuit. The two equations represent the volt and amp second balance equations, assuming ideal conditions and CCM, and are expressed as \begin{align*}{L} \frac{{di}_{L}}{dt} & = {V}_{g}{D}{-}{V}_{0} \tag{1} \\ {C} \frac{{dv}_{0}}{dt} & = {i}_{L}{-} \frac{{V}_{0}}{R} \tag{2} \end{align*}
Fig 2 The buck converter under operation. (a) An equivalent circuit diagram of an ideal buck converter. (b) An equivalent circuit diagram of the converter when the MOSFET is closed. (c) An equivalent circuit diagram of the converter when the MOSFET is open.
where ${di}_{L} / {dt}$ and ${dv}_{0} / {dt}$ represent the transients of the inductor current and capacitor voltage, respectively, and s is the switching function. Herein, (1) and (2) represent the mathematical model of the buck converter.
The design parameters for the buck converter under simulation are listed in Table 3.
Table 3. The buck converter design specification (Hart, 2011).
The L and C values were designed using (3) and (4) while considering the current and voltage ripples: \begin{align*}{L} & = {\left(\frac{{V}_{g}{-}{V}_{0}}{{\Delta}{i}_{L}{f}}\right)}{D} \tag{3} \\ {C} & = \frac{{1}{-}{D}}{{8}{L}{\left(\frac{{\Delta}{V}_{0}}{{V}_{0}}\right)}{f}_{s}^{2}}{.} \tag{4} \end{align*}
The specified buck converter was modeled and simulated using three different software tools, viz., Simulink, LTspice, and Xcos. Output voltage ${(}{V}_{0}{)}$ and inductor current were observed in each case, as shown in Fig. 3(a)–(c). The models simulated in Simulink and Xcos generated similar waveforms settling at approximately 20 V and 1 A. Since the buck converter modeled in LTspice was an average model, no transients were observed. An average model is a simulation model of the actual components that are available in LTspice. This model is used because LTspice allows a user to choose from available device models, define their own models, use third-party models from component manufacturers, or use third-party device library models. The average model for any dc–dc converter can be obtained by equating ${di}_{L} / {dt}$ and ${dv}_{0} / {dt} = {0}$, which helps in speeding up the simulation.
Fig 3 (a) The transient analysis using Xcos. (b) The transient analysis using Simulink. (c) The steady-state output voltage using LTspice.
The duty cycle (D) for a dc–dc converter under simulation can be obtained by comparing a sawtooth wave of high frequency with a dc signal. Based on the desired frequency, D in MATLAB can be generated using a built-in block known as the pulse generator. During closed-loop operations, a block known as the pulsewidth modulation dc–dc is used for generating D based on the error signal.
For this study, we used an Intel Core i5-8250U processor at 1.6 GHz, with 8 GB of random-access memory (RAM), running on the Windows 10 operating system. The simulation packages included MATLAB 2018a and 2021b, Scilab 6.1.1, and LTspice XVII. From the simulation results, we observed that MATLAB and Scilab provided accurate values to four decimal places.
Herein, the simulation time is the amount of time spent on simulating a model from ${t} = {0}$ to a time specified by the user. Conversely, real time is defined as the actual time taken by the software to generate the results. The real time was measured using a physical stopwatch with a least count of 1 s. Tables 4 and 5 provide insight into the manually measured real time taken by the software tools to provide the output voltage, inductor current results, and frequency response. For the simulation study, a fixed-type solver was used. The step size and the runtime were ${1}\,{\ast}\,{e}^{{-}{6}}$ and 0.05 s.
Table 4. The time taken by each software tool to provide the output voltage and inductor current.
Table 5. The time taken by each software tool to provide the frequency responses.
The frequency response of the converter was analyzed in MATLAB and LTspice, and the results are shown in Fig. 4(a)–(d). Similar results were obtained using the two softwares. At a frequency of approximately 795 Hz, a magnitude of approximately 48 dB was observed for the inductor current response. Similarly, at a frequency of approximately 794 Hz, a magnitude of approximately 54 dB was observed for the output voltage response. A positive phase margin is a necessary condition for stability in systems having a single crossover frequency. To maintain the overshoots and undershoots under control, a phase margin of approximately 45° is required (Erickson et al., 2007). Therefore, the simulation results suggest that the designed converter is stable for ${G}_{\text{id}}$ and ${G}_{\text{vd}}$ operations.
Fig 4 (a) The frequency response of inductor current to the duty ratio Gid in MATLAB. (b) The frequency response of output voltage to duty cycle Gvd in MATLAB. (c) The frequency response of Gid in LTspice. (d) The frequency response of Gvd in LTspice. Inf: infinity.
The governing equations of an ideal buck converter are a set of coupled ODEs, as shown in (1) and (2). Transient analysis of the converter can also be obtained by modeling (1) and (2) in MATLAB.
Syms and ODE are two methods to solve coupled ODEs in MATLAB. Syms lists the names of all symbolic scalar variables, functions, matrix variables, matrix functions, and arrays in the MATLAB workspace. In this article, the time taken by the two methods to solve the ODE was analyzed. The results are shown in Fig. 5. Two different versions of MATLAB (2018a and 2021b) were used for the purpose. The tic and toc commands were used to find the execution time for 11 runs. It was observed that the execution time changed every time the code was executed. This was due to the fact that internal processes run in the processing unit, and the user has no control over them.
Fig 5 Time versus the number of iterations.
From Fig. 5, it can be observed that syms takes more time to solve the ODEs. This was because syms solved the ODEs first and then assigned values to the variables. In addition, the first iteration took the maximum time for execution as the variables were initialized and assigned values. From the next iteration onward, the time taken gradually reduced as some amount of memory was stored in the cache. Since higher versions of MATLAB consume more RAM, they require more computation time.
Understanding the prospectus of a software tool is extremely important for any student to understand the subject. In this regard, an overview of various software tools that can be used for power electronics simulation is provided in this article by considering a simple buck converter operating in CCM as an example. Using a modeling approach, MATLAB and Scilab software tools were compared, where the former showed a faster response. On using the coding approach, the syms and ODE solvers were used to determine the output voltage and inductor current. ODE solvers provided faster results for lower versions of MATLAB software. Though Scilab requires more time for simulating circuits, it provides accurate results that are as good as those of MATLAB. However, LTspice is a better software tool for analyzing the frequency response of circuits, as it requires less time for execution. The nonlinear characteristics of switching elements are generally discussed using the methods of bifurcation. It is generally not recommended during the design phase, as the nonlinear characteristics are found to affect the stability.
• D. Cetinkaya, A. Verbraeck, and M. D. Seck, “Applying a model driven approach to component based modeling and simulation,†in Proc. IEEE Winter Simul. Conf., Dec. 2010, pp. 546–553, doi: 10.1109/WSC.2010.5679131.
• A. M. Gole et al., “Guidelines for modeling power electronics in electric power engineering applications,†IEEE Trans. Power Del., vol. 12, no. 1, pp. 505–514, Jan. 1997, doi: 10.1109/61.568278.
• “LTspice.†Analog Devices. Accessed: Dec. 20, 2022. [Online] . Available: https://www.analog.com/en/design-center/design-tools-and-calculators/ltspice-simulator.html
• Math. Graphics. Programming. MathWorks. 1994. [Online] . Available: https://in.mathworks.com/products/matlab.html
• Xcos. Scilab. 2023. [Online] . Available: https://www.SCILAB.org/software/xcos
• mfile2sci. Scilab. 1989. [Online] . Available: https://help.SCILAB.org/docs/5.3.3/en_US/mfile2sci.html
• E. S. de Almeida, A. C. Medeiros, and A. C. Frery, “How good are MatLab, Octave and Scilab for computational modelling?†Comput. Appl. Math., vol. 31, no. 3, pp. 523–538, 2012, doi: 10.1590/S1807-03022012000300005. [Online] . Available: https://www.scielo.br/j/cam/a/SvZxCZ8f8K8wq5kTdfCPqmK/?lang=en#
• S. Surya and M. N. Arjun, “Mathematical modeling of power electronic converters,†SN Comput. Sci., vol. 2, no. 4, pp. 1–9, May 2021, doi: 10.1007/s42979-021-00637-1.
• S. Surya and R. Srividya, “Isolated converters as LED drivers,†in Proc. Cogn. Informat. Soft Comput., P. K. Mallick, V. E. Balas, A. K. Bhoi, and A. F. Zobaa, Eds. Singapore: Springer, 2021, pp. 167–179.
• D. W. Hart and D. W. Hart, Power Electronics, vol. 166. New York, NY, USA: McGraw-Hill, 2011.
• R. W. Erickson and D. Maksimovic, Fundamentals of Power Electronics, 3rd ed. Cham, Switzerland: Springer Science & Business Media, 2007, p. 299.
Sumukh Surya (sumukhsurya@gmail.com) earned his M.Tech. degree in power electronics and drives from Manipal Institute of Technology, Manipal, 560030, India. He is a senior engineer at Bosch Global Software Technologies Pvt. Limited, Bangalore, India. His research interests include the modeling of power electronic converters, electric energy storage systems, and the development of battery management system algorithms for transportation electrification.
Ahilya Chhetri (ahilya9@gmail.com) earned her M.Tech. degree in power electronics and drives from Manipal Institute of Technology, Manipal, India. She is currently a technical editor, engineering and technology at Cactus Communications, Mumbai, 400093, India. Her current research interests include power electronics, electric vehicles, building/space management systems, and battery management systems.
Arjun M (arjunmudlapur@gmail.com) earned his Ph.D. degree in electrical engineering from the National Institute of Karnataka, Surathkal, Karnataka, in 2019. He is a technical specialist at BOsch Global Software Technologies Pvt. Limited, Bangalore, 560030, India. His research interests include switch mode power converters and photovoltaics.
Sheldon Williamson (sheldon.williamson@ontariotechu.ca) is a professor with the Department of Electrical, Computer, and Software Engineering and the director of the Smart Transportation Electrification and Energy Research Group, Faculty of Engineering and Applied Sciences, Ontario Tech University, Oshawa, ON LIG 0C5, Canada. His research interests include advanced power electronics, electric energy storage systems, and motor drives for transportation electrification. He holds the prestigious Natural Sciences and Engineering Research Council of Canada Research Chair in electric energy storage systems for transportation electrification.
Digital Object Identifier 10.1109/MPOT.2023.3285029