**Part 3**

**Power Systems Applications** 

34 MATLAB/Book4

152 MATLAB for Engineers – Applications in Control, Electrical Engineering, IT and Robotics

processing data represented in different forms such as plane data, 3D (rectangular and

The examples of working codes given in the chapter allow wide range of investigators and, in the first place, PhD and master students, to start quickly the solution of their own original

Joannopoulos, J., Meade, R. & Winn, J. (1995). *Photonic Crystals: Molding the Flow of Light*,

Lourtioz, J.-M., Benisty, H. & Berger, V. (2005). *Photonic Crystals, Towards Nanoscale Photonic*

Sukhoivanov, I. & Guryev, I. (2009). *Photonic crystals – physics and practical modeling*, Optical

Taflove, A. & Hagness, S. (2005). *Computational Electrodynamics: The Finite-Difference*

triangular mesh) data, the data represented by several files.

URL: *http://www.comsol.com*

*Devices*, Springer-Verlag.

URL: *http://www.rsoftdesign.com/*

sciences, 1 edn, Springer, Berlin.

Princeton University Press, Princeton.

URL: *http://www.mathworks.com/help/techdoc/*

URL: *http://ab-initio.mit.edu/wiki/index.php/Meep\_manual*

URL: *http://ab-initio.mit.edu/wiki/index.php/MPB\_manual*

Sakoda, K. (2001). *Optical Properties of Photonic Crystals*, Springer-Verlag.

*Time-Domain Method*, 3 edn, Artech House, Norwood, MA.

problems.

**10. References** *COMSOL* (2011).

*MATLAB manual* (2011).

*MEEP* (2011).

*MPB* (2011).

*RSoft* (2011).

**7** 

*Italy* 

**MATLAB Co-Simulation Tools for** 

Modern electronic devices could be thought as the collection of elementary subsystems, each one requiring a regulated supply voltage in order to perform the desired function. Actually, in a system board you can find as many as ten separate voltage rails, each one rated for a maximum current and current slew-rate. If the available energy source is not suitable for the specific application, a power supply system is required to convert energy from the available input form to the desired output. Since power-up, power-down sequences and recovery from multiple fault conditions are usually offered, monitoring and sequencing the voltage rails is quite complex and a central power management controller is used. The design of the power management system is a key step for a successful conclusion of the overall design. The cost, size and volume of the electronic device are heavily affected by the power supply performances. The proliferation of switching converters throughout the electronic industry is a matter of fact. Unlike linear regulators, switching converters are suitable for both reducing and increasing the unregulated input voltage and efficiency can be as high as 97%. Classification of switching power supplies is mainly based on the available input energy form and the desired output: AC-AC cycle conversion: alternate input, alternate output; AC-DC rectification: alternate input, continuous output; DC-AC inversion: continuous input, alternate output; DC-DC conversion: continuous input, continuous output. Several topologies are well suited to perform the required conversion (Erikson et al., 2001; Pressman et al., 2009). Independently of the specific topology, the architecture of a power supply system can be generalized as shown in Fig.1. A power section and a control section are highlighted. The switching converter is included in the power section while the feedback network and protection circuits for safe operation are collected in the control system. Mainly because of the growing interest in digital controllers, a power supply system can be modelled as a complex system, quite often involving both digital and analog subsystems. If compared to their analog counterparts, digital controllers offer lower power consumption, higher immunity to components aging and higher and higher design flexibility. The control algorithm is often described at a functional level using hardware description language, as VHDL or Verilog. ASICs or FPGA based controllers are usually integrated by the means of sophisticated simulation, synthesis and verification tools. Time to market is heavily reduced by the means of powerful simulation environments and accurate system modelling. Achieving high accuracy models for mixed-mode systems is quite difficult. Specific simulation tools are available on the market, each one oriented to a specific

**1. Introduction** 

**Power Supply Systems Design** 

Valeria Boscaino and Giuseppe Capponi

*University of Palermo* 

### **MATLAB Co-Simulation Tools for Power Supply Systems Design**

Valeria Boscaino and Giuseppe Capponi *University of Palermo Italy* 

#### **1. Introduction**

Modern electronic devices could be thought as the collection of elementary subsystems, each one requiring a regulated supply voltage in order to perform the desired function. Actually, in a system board you can find as many as ten separate voltage rails, each one rated for a maximum current and current slew-rate. If the available energy source is not suitable for the specific application, a power supply system is required to convert energy from the available input form to the desired output. Since power-up, power-down sequences and recovery from multiple fault conditions are usually offered, monitoring and sequencing the voltage rails is quite complex and a central power management controller is used. The design of the power management system is a key step for a successful conclusion of the overall design. The cost, size and volume of the electronic device are heavily affected by the power supply performances. The proliferation of switching converters throughout the electronic industry is a matter of fact. Unlike linear regulators, switching converters are suitable for both reducing and increasing the unregulated input voltage and efficiency can be as high as 97%. Classification of switching power supplies is mainly based on the available input energy form and the desired output: AC-AC cycle conversion: alternate input, alternate output; AC-DC rectification: alternate input, continuous output; DC-AC inversion: continuous input, alternate output; DC-DC conversion: continuous input, continuous output. Several topologies are well suited to perform the required conversion (Erikson et al., 2001; Pressman et al., 2009). Independently of the specific topology, the architecture of a power supply system can be generalized as shown in Fig.1. A power section and a control section are highlighted. The switching converter is included in the power section while the feedback network and protection circuits for safe operation are collected in the control system. Mainly because of the growing interest in digital controllers, a power supply system can be modelled as a complex system, quite often involving both digital and analog subsystems. If compared to their analog counterparts, digital controllers offer lower power consumption, higher immunity to components aging and higher and higher design flexibility. The control algorithm is often described at a functional level using hardware description language, as VHDL or Verilog. ASICs or FPGA based controllers are usually integrated by the means of sophisticated simulation, synthesis and verification tools. Time to market is heavily reduced by the means of powerful simulation environments and accurate system modelling. Achieving high accuracy models for mixed-mode systems is quite difficult. Specific simulation tools are available on the market, each one oriented to a specific

MATLAB Co-Simulation Tools for Power Supply Systems Design 157

values, often higher than 100A, are required. VRMs supply highly dynamic loads exhibiting current slew rates as high as 1000A/μs. Today, in distributed power architectures, individual POL converters usually draw power from a 12V intermediate power bus. Lowering the core voltage results in a very narrow duty cycle of the 12V-input converter, worsening the converter efficiency and load transient response. The best topology for VRM applications features tight voltage regulation, very fast transient response, high-current handling capabilities and high efficiency. Modern technology advances constantly prompt electronics researchers to meet all requirements investigating innovative solutions. The evolution from a classical buck topology to multiphase architectures is described to better understand the great

The buck topology and the MOSFET gate drive signal are shown in Fig.2. The gate signal period is always referred to as the converter switching period T. The duty-cycle D is defined as the ratio between the MOSFET on-time and the switching period. Since one terminal of the power MOSFET is tied to the high-side of the input voltage rail, the MOSFET is also called high-side MOSFET. The steady-state analysis is here performed assuming constant

On the rising edge of the gate drive signal, the high-side MOSFET is turned on. The inductor is now series connected between the input and output rails and the diode is reverse biased. During the MOSFET on-time, the inductor current slope is constant and it can be expressed

> ��� <sup>=</sup> ��� � ���� �

> > ���� <sup>=</sup> ����� �

On the falling edge of the gate drive signal, the MOSFET is turned off. The inductor opposes the current break trying to maintain the previously established current. The voltage polarity across it immediately reverses. Since the right terminal of the inductor is tied to the output rail, the cathode voltage of the diode D is driven toward negative values. When zero crossing occurs, the diode D is forced into conduction clamping the cathode node to ground. The inductor voltage is now reversed and full inductor current flows through the diode D. The inductor is now connected in parallel to the output voltage rail. During the OFF-time,

(1)

(2)

advantages brought by multiphase architectures.

the input voltage and the output voltage during a switching period.

Fig. 2. The buck converter topology and gate drive signal.

the slope of the inductor current is given by:

as:

abstraction level. Circuit simulation software as *Powersim PSIM* and *Orcad Pspice* are the most common choice for circuit modelling. In (Basso, 2008), the design and simulation of switchmode power supplies is deeply analyzed and simulation tips in several environments are proposed. ASIC simulation and verification tools as Xilinx ISE/Modelsim or Aldec Active-HDL are available to implement the digital controller by the VHDL or VERILOG source code. Since the interaction between subsystems is the most common source of faults, testing separately analog and digital subsystems by the means of different verification tools is a severe mistake. Matlab is a powerful simulation environment for mixed-mode systems modelling and simulation, providing several tools for system co-simulation (Pop, 2010; Kaichun et al., 2010). The Matlab suite offers co-simulation tools for *PSIM*, *Modelsim* and *Active-HDL* simulation environments. Ideally, modelling the power converter by a circuit implementation in PSIM environment and the digital controller by the VHDL code in *Xilinx ISE* or *Active-HDL* environment allows the designer to test the composite system in Matlab environment using co-simulation procedures. Unfortunately, the use of several co-simulation tools in the same Simulink model heavily reduces the processing speed. As an example, in this chapter the Simulink model of a multiphase dc-dc converter for VRMs applications is described. The control system is described by VHDL language and the controller model is implemented in *Active-HDL* environment. For the highest processing speed, an alternative modelling technique for the power section is proposed by the means of elementary library blocks, avoiding *PSIM* co-simulation and not affecting the accuracy of behavioural simulations. As shown by simulation results, the high accuracy relies in the opportunity to match the system behaviour both within the switching event and during long-time events such as load transients and startup. The great potential of the co-simulation procedure for mixed-mode systems is highlighted by the comparison between simulation and experimental results.

Fig. 1. Power supply system architecture.

#### **2. Multiphase dc-dc converters for VRM applications**

The evolution in microprocessor technology poses new challenges for power supply design. The end of 2009 marked the birth of 32nm technology for semiconductor devices, and 22nm is expected to be reached in the 2011-2012 timeframe. The next generation of computer microprocessors will operate at significantly lower voltages and higher currents than today's generation in order to decrease the power consumption and increase the processing speed. Within several years, Intel cores are expected to operate on a 0.8V supply voltage. Highquality power is delivered to the microprocessor by a point-of-load (POL) converter, also known as voltage regulator module (VRM), which is located on the motherboard next to the load. Embedded POL converters are designed to supply a tight regulated output voltage in the 0.8 – 1.2V range. Due to integration advances and increasing clock frequencies, high current

abstraction level. Circuit simulation software as *Powersim PSIM* and *Orcad Pspice* are the most common choice for circuit modelling. In (Basso, 2008), the design and simulation of switchmode power supplies is deeply analyzed and simulation tips in several environments are proposed. ASIC simulation and verification tools as Xilinx ISE/Modelsim or Aldec Active-HDL are available to implement the digital controller by the VHDL or VERILOG source code. Since the interaction between subsystems is the most common source of faults, testing separately analog and digital subsystems by the means of different verification tools is a severe mistake. Matlab is a powerful simulation environment for mixed-mode systems modelling and simulation, providing several tools for system co-simulation (Pop, 2010; Kaichun et al., 2010). The Matlab suite offers co-simulation tools for *PSIM*, *Modelsim* and *Active-HDL* simulation environments. Ideally, modelling the power converter by a circuit implementation in PSIM environment and the digital controller by the VHDL code in *Xilinx ISE* or *Active-HDL* environment allows the designer to test the composite system in Matlab environment using co-simulation procedures. Unfortunately, the use of several co-simulation tools in the same Simulink model heavily reduces the processing speed. As an example, in this chapter the Simulink model of a multiphase dc-dc converter for VRMs applications is described. The control system is described by VHDL language and the controller model is implemented in *Active-HDL* environment. For the highest processing speed, an alternative modelling technique for the power section is proposed by the means of elementary library blocks, avoiding *PSIM* co-simulation and not affecting the accuracy of behavioural simulations. As shown by simulation results, the high accuracy relies in the opportunity to match the system behaviour both within the switching event and during long-time events such as load transients and startup. The great potential of the co-simulation procedure for mixed-mode systems is highlighted

by the comparison between simulation and experimental results.

**2. Multiphase dc-dc converters for VRM applications** 

The evolution in microprocessor technology poses new challenges for power supply design. The end of 2009 marked the birth of 32nm technology for semiconductor devices, and 22nm is expected to be reached in the 2011-2012 timeframe. The next generation of computer microprocessors will operate at significantly lower voltages and higher currents than today's generation in order to decrease the power consumption and increase the processing speed. Within several years, Intel cores are expected to operate on a 0.8V supply voltage. Highquality power is delivered to the microprocessor by a point-of-load (POL) converter, also known as voltage regulator module (VRM), which is located on the motherboard next to the load. Embedded POL converters are designed to supply a tight regulated output voltage in the 0.8 – 1.2V range. Due to integration advances and increasing clock frequencies, high current

Fig. 1. Power supply system architecture.

values, often higher than 100A, are required. VRMs supply highly dynamic loads exhibiting current slew rates as high as 1000A/μs. Today, in distributed power architectures, individual POL converters usually draw power from a 12V intermediate power bus. Lowering the core voltage results in a very narrow duty cycle of the 12V-input converter, worsening the converter efficiency and load transient response. The best topology for VRM applications features tight voltage regulation, very fast transient response, high-current handling capabilities and high efficiency. Modern technology advances constantly prompt electronics researchers to meet all requirements investigating innovative solutions. The evolution from a classical buck topology to multiphase architectures is described to better understand the great advantages brought by multiphase architectures.

The buck topology and the MOSFET gate drive signal are shown in Fig.2. The gate signal period is always referred to as the converter switching period T. The duty-cycle D is defined as the ratio between the MOSFET on-time and the switching period. Since one terminal of the power MOSFET is tied to the high-side of the input voltage rail, the MOSFET is also called high-side MOSFET. The steady-state analysis is here performed assuming constant the input voltage and the output voltage during a switching period.

Fig. 2. The buck converter topology and gate drive signal.

On the rising edge of the gate drive signal, the high-side MOSFET is turned on. The inductor is now series connected between the input and output rails and the diode is reverse biased. During the MOSFET on-time, the inductor current slope is constant and it can be expressed as:

$$s\_{on} = \frac{Vin - Vout}{L} \tag{1}$$

On the falling edge of the gate drive signal, the MOSFET is turned off. The inductor opposes the current break trying to maintain the previously established current. The voltage polarity across it immediately reverses. Since the right terminal of the inductor is tied to the output rail, the cathode voltage of the diode D is driven toward negative values. When zero crossing occurs, the diode D is forced into conduction clamping the cathode node to ground. The inductor voltage is now reversed and full inductor current flows through the diode D. The inductor is now connected in parallel to the output voltage rail. During the OFF-time, the slope of the inductor current is given by:

$$s\_{off} = \frac{-Vout}{L} \tag{2}$$

$$(Vin - Volt) \cdot T\_{on} = -Vout \cdot T\_{off} \tag{3}$$

$$\text{Vout} = \text{Vin} \cdot \frac{T\_{on}}{T\_{on} + T\_{off}} \tag{4}$$

$$
\Delta I\_L = \frac{V \text{in} - V \text{out}}{L} \cdot T\_{on} = \frac{-V \text{out}}{L} \cdot T\_{off} = \frac{V \text{in} (1 - D)D}{L} T \tag{5}
$$

$$\frac{\Delta IL}{2} \ll I\_{out} \tag{6}$$

$$q = \frac{1}{2} \frac{\Delta I\_L}{2} \frac{T}{2} \tag{7}$$

$$
\Delta V = \frac{q}{\mathcal{C}} = \frac{\Delta I\_L T}{8\mathcal{C}} \tag{8}
$$

$$
\Delta V\_{out,max} = \Delta I \cdot \sqrt{\frac{L}{C}} + \text{ }Rc \cdot \Delta I \tag{9}
$$

MATLAB Co-Simulation Tools for Power Supply Systems Design 161

A dead-time is required to avoid the simultaneous conduction of high-side and low-side MOSFETs. During the dead time, neither the low-side nor the high side MOSFET is on. When the high-side MOSFET is turned off, the inductor opposes the current break forcing the low-side MOSFET body-diode into conduction. Over the entire dead time the full inductor current flows through the body diode itself. At the end of the dead time, the lowside MOSFET is turned on, the body diode is bypassed by the active MOSFET channel and the inductor current flows through the low-side MOSFET channel. During the dead time, classical and synchronous topologies are exactly alike. It would be advisable a further reduction of both the diode threshold voltage and the dead time in order to limit power losses. A Schottky diode is often integrated in parallel to power MOSFET: the body diode will be bypassed by the Schottky diode over the entire dead time lowering the effective threshold voltage. A minimization of the low-side body-diode conduction time is required to take advantage from synchronous rectification. Sophisticated dead-time control algorithms are usually implemented by synchronous MOSFET drivers. If a single buck converter topology were employed in high-current applications, a large amount of outputfilter and on-board decoupling capacitance would be required to achieve the expected transient response. The size and cost of the voltage regulator would increase as well. Multiphase converters are widely used. Ripple cancellation and improved transient response are only a few advantages of multi-phase architectures. A detailed analysis of multiphase converters is reported in (Miftakhutdinov, 2001). In N-modules architecture, N identical buck converters are connected in parallel to the load resulting in a heavy reduction of the output ripple. Smaller inductances are allowed thus improving the transient response. Note that increasing the number of modules emphasizes the advantages of a multiphase architecture. Gate drive signals are interleaved to take full advantage from the multiphase architecture. Assume that each channel operates at a switching frequency fsw. Under steadystate conditions, the phase shift between gate drive signals of each module depend on the number of interleaved channels. If an N-channels architecture is considered, assume that the control signal sequence is Phase 1, 2,.., N. The interleaved technique requires a 360°/N phase shift between two following channels. The maximum number of channel is limited by

Fig. 7. The synchronous buck topology and MOSFETs gate drive signals.

the relationship:

Fig. 6. The converter waveforms under a large-signal transient.

The optimization of steady-state and dynamic performances leads to a trade-off in the choice of the inductor value. As will be further discussed, the inductor value is usually chosen to meet steady-state requirements and dynamic performances are improved by the control algorithm.

As shown by (4), the buck converter reduces the dc input voltage by the means of switching elements. Power loss due to switches is ideally zero. Yet, switches are not ideal. Further, switching losses cannot be neglected. The inductor current flows through the MOSFET during the on-time and through the diode during the OFF time. Conduction losses are proportional to the forward voltage drop across the active elements. The MOSFET forward voltage drop is lower than the diode threshold voltage. In a buck converter, conduction losses are mainly due to the freewheeling diode.

In high-current low-voltage applications, synchronous rectification is widely used to improve efficiency. As shown in Fig.7, the diode D is replaced by a MOSFET featuring a very low forward voltage drop. The rectification function, typically performed by diodes, is now achieved by the means of a MOSFET which is driven synchronously with the high-side MOSFET. For this reason, the added MOSFET is sometimes referred to as the synchronous rectifier MOSFET. Since the rectifier MOSFET source terminal is tied to the low-side of the input voltage rail, the MOSFET is also called low-side MOSFET. If compared with classical topology, synchronous rectification heavily reduces conduction losses improving efficiency. During the conduction time of the high-side (on time) the low-side is off and vice versa.

Fig. 6. The converter waveforms under a large-signal transient.

losses are mainly due to the freewheeling diode.

control algorithm.

The optimization of steady-state and dynamic performances leads to a trade-off in the choice of the inductor value. As will be further discussed, the inductor value is usually chosen to meet steady-state requirements and dynamic performances are improved by the

As shown by (4), the buck converter reduces the dc input voltage by the means of switching elements. Power loss due to switches is ideally zero. Yet, switches are not ideal. Further, switching losses cannot be neglected. The inductor current flows through the MOSFET during the on-time and through the diode during the OFF time. Conduction losses are proportional to the forward voltage drop across the active elements. The MOSFET forward voltage drop is lower than the diode threshold voltage. In a buck converter, conduction

In high-current low-voltage applications, synchronous rectification is widely used to improve efficiency. As shown in Fig.7, the diode D is replaced by a MOSFET featuring a very low forward voltage drop. The rectification function, typically performed by diodes, is now achieved by the means of a MOSFET which is driven synchronously with the high-side MOSFET. For this reason, the added MOSFET is sometimes referred to as the synchronous rectifier MOSFET. Since the rectifier MOSFET source terminal is tied to the low-side of the input voltage rail, the MOSFET is also called low-side MOSFET. If compared with classical topology, synchronous rectification heavily reduces conduction losses improving efficiency. During the conduction time of the high-side (on time) the low-side is off and vice versa.

Fig. 7. The synchronous buck topology and MOSFETs gate drive signals.

A dead-time is required to avoid the simultaneous conduction of high-side and low-side MOSFETs. During the dead time, neither the low-side nor the high side MOSFET is on. When the high-side MOSFET is turned off, the inductor opposes the current break forcing the low-side MOSFET body-diode into conduction. Over the entire dead time the full inductor current flows through the body diode itself. At the end of the dead time, the lowside MOSFET is turned on, the body diode is bypassed by the active MOSFET channel and the inductor current flows through the low-side MOSFET channel. During the dead time, classical and synchronous topologies are exactly alike. It would be advisable a further reduction of both the diode threshold voltage and the dead time in order to limit power losses. A Schottky diode is often integrated in parallel to power MOSFET: the body diode will be bypassed by the Schottky diode over the entire dead time lowering the effective threshold voltage. A minimization of the low-side body-diode conduction time is required to take advantage from synchronous rectification. Sophisticated dead-time control algorithms are usually implemented by synchronous MOSFET drivers. If a single buck converter topology were employed in high-current applications, a large amount of outputfilter and on-board decoupling capacitance would be required to achieve the expected transient response. The size and cost of the voltage regulator would increase as well. Multiphase converters are widely used. Ripple cancellation and improved transient response are only a few advantages of multi-phase architectures. A detailed analysis of multiphase converters is reported in (Miftakhutdinov, 2001). In N-modules architecture, N identical buck converters are connected in parallel to the load resulting in a heavy reduction of the output ripple. Smaller inductances are allowed thus improving the transient response. Note that increasing the number of modules emphasizes the advantages of a multiphase architecture. Gate drive signals are interleaved to take full advantage from the multiphase architecture. Assume that each channel operates at a switching frequency fsw. Under steadystate conditions, the phase shift between gate drive signals of each module depend on the number of interleaved channels. If an N-channels architecture is considered, assume that the control signal sequence is Phase 1, 2,.., N. The interleaved technique requires a 360°/N phase shift between two following channels. The maximum number of channel is limited by the relationship:

$$(1 - D) > N \cdot D \tag{10}$$

MATLAB Co-Simulation Tools for Power Supply Systems Design 163

Fig. 9. High-side MOSFETs gate drive signals.

Fig. 10. Inductor current waveforms under steady-state conditions.

Fig. 11. Equivalent inductor current under steady-state conditions.

������ <sup>=</sup> ��� − ����

according to the equation:

Within the time interval [0, DTsw/4] the slope of the equivalent current is given by:

� <sup>−</sup> (�−�)

The equivalent slope is positive during the first subinterval. During the second subinterval [DTsw/4,Tsw/4] all modules are driven OFF. The equivalent current slope is negative

����

� <sup>=</sup> ���(� − ��) �

(12)

where N is the number of channel and D is the duty-cycle. A key feature of multiphase architecture is now highlighted: the ripple frequency of the output voltage is N-times the switching frequency of each power module. The equivalent switching frequency is higher and higher than the effective switching frequency of each module. The designed multiphase converter features a 4-modules architecture, as shown in Fig.8. Inductors and capacitors are modelled including the parasitic equivalent series resistance. Assume that the control sequence is Phase 1,2,3,4. Interleaved gate drive signals are shown in Fig.9. Fig.10 shows the inductor current waveforms for each buck channel. As shown in Fig.11, the equivalent current is defined as:

$$IL\_{eq} = \Sigma\_{l=1}^{n} IL\_l = IL\_1 + IL\_2 + IL\_3 + IL\_4 \tag{11}$$

Ripple cancellation derives from the interleaving technique. The steady-state analysis is carried on within a fundamental Tsw/4 time interval. Within a Tsw/4 period, only one module could be driven in the ON state, the others are constantly OFF. For example, from 0 to Tsw/4 modules 2, 3 and 4 are constantly OFF while the first module (phase 1) is driven in the ON state during the subinterval [0, DTsw/4]. No matter which phase is active in the ON state, the fundamental period of the output waveforms is Tsw/4 since we have assumed identical modules.

Fig. 8. Multiphase architecture.

where N is the number of channel and D is the duty-cycle. A key feature of multiphase architecture is now highlighted: the ripple frequency of the output voltage is N-times the switching frequency of each power module. The equivalent switching frequency is higher and higher than the effective switching frequency of each module. The designed multiphase converter features a 4-modules architecture, as shown in Fig.8. Inductors and capacitors are modelled including the parasitic equivalent series resistance. Assume that the control sequence is Phase 1,2,3,4. Interleaved gate drive signals are shown in Fig.9. Fig.10 shows the inductor current waveforms for each buck channel. As shown in Fig.11, the equivalent

Ripple cancellation derives from the interleaving technique. The steady-state analysis is carried on within a fundamental Tsw/4 time interval. Within a Tsw/4 period, only one module could be driven in the ON state, the others are constantly OFF. For example, from 0 to Tsw/4 modules 2, 3 and 4 are constantly OFF while the first module (phase 1) is driven in the ON state during the subinterval [0, DTsw/4]. No matter which phase is active in the ON state, the fundamental period of the output waveforms is Tsw/4 since we have assumed

���� = ∑ ��� �

current is defined as:

identical modules.

Fig. 8. Multiphase architecture.

(���) ���� (10)

��� = ��� � ��� � ��� � ��� (11)

Fig. 9. High-side MOSFETs gate drive signals.

Fig. 10. Inductor current waveforms under steady-state conditions.

Fig. 11. Equivalent inductor current under steady-state conditions.

Within the time interval [0, DTsw/4] the slope of the equivalent current is given by:

$$s\_{eq.on} = \frac{Vin - Vout}{L} - (N - 1)\frac{Vout}{L} = \frac{Vin(1 - ND)}{L} \tag{12}$$

The equivalent slope is positive during the first subinterval. During the second subinterval [DTsw/4,Tsw/4] all modules are driven OFF. The equivalent current slope is negative according to the equation:

$$s\_{eq,off} = -N \frac{Vout}{L} \tag{13}$$

MATLAB Co-Simulation Tools for Power Supply Systems Design 165

*COMP\_OUT* is generated by the error amplifier which includes the adder and the *COMP* block. A type-2 compensation action is digitally implemented to ensure system stability. The error signal is then converted to analog and compared to the current sense signal of each

The gate drive interleaved technique is digitally implemented by the *Switching logic* subsystems. The master module is the Phase 1, the others slave. Fig.13 shows the switching logic algorithm for the master power module. A clock signal at the switching frequency is synchronously derived from the system clock. The switch-on of the high-side MOSFET is triggered by the rising-edge of the switching clock Ck1. The high-side MOSFET switch-off is

A digital counter generates a switching clock for each slave module which is synchronous with the master switching clock and phase-shifted according to the interleaved technique. The sense signal Vc2,i reproduces the instantaneous inductor current of the *i-th* power module. RC networks are used to sense the instantaneous inductor current of each power

power module Vc2,i.

Fig. 12. Schematic block diagram of the linear controller.

triggered by the rising-edge of the corresponding PWM signal.

Fig. 13. Switching logic for the master module.

The equivalent current ripple is given by:

$$
\Delta I\_{L,eq} = \frac{V \text{in} (1 - ND) D}{L} T\_{\text{sw}} = \frac{\Delta IL \text{ (1 - ND)}}{(1 - D)} \tag{14}
$$

As (14) states, in a multiphase architecture the current ripple is cancelled. If compared with classical buck converters, the current ripple is reduced by (1-ND)/(1-D). Moreover, the equivalent switching frequency as seen by the power load is N times the operating switching frequency of each power module.

Note that (14) could be expressed as:

$$
\Delta I\_{L,eq} = \frac{V \text{in} (1 - ND) D}{L} T\_{sw} = \frac{V \text{in} (1 - ND) DN \cdot N}{N \cdot N \, L} T\_{sw} = \frac{V \text{in}, eq (1 - Deq) Deq}{Leq} T\_{sw, eq} \tag{15}
$$

where N is the number of modules and ��� = � � �� ���� �� = � � ���, ��� = � � � ���� �� = ��� � . 

By comparing (15) and (5), conclusions are drawn: a N-modules architecture is equivalent to a buck converter operating at fsw,eq switching frequency, Deq duty-cycle, supplied by Vin,eq input voltage and featuring Leq inductance. Then, if compared with a buck converter fed by the same input voltage rail and supplying the same voltage bus, the multiphase architecture features higher switching frequency, higher duty-cycle and lower inductance. Both steadystate and dynamic performances of the switching regulator take a great advantage from these interesting properties. With regards to steady-state performances, tight voltage regulation could be achieved thanks to the ripple cancellation effect. Dynamic performances are greatly improved by the reduction of the equivalent inductor under load transients. The steady-state and dynamic performances of multiphase converters are affected by the duty cycle value. A narrow duty cycle results in a poor ripple cancellation. Hence, a larger inductance should be selected to keep tight voltage regulation worsening the transient response. If a wide input-output voltage range is considered, a proper design of passive components is not yet suitable for speeding up the system performances. Multiphase architectures achieving a duty cycle extension by the means of coupled inductors are frequently proposed in literature.

Otherwise, unconventional control algorithms are proposed to speed up the transient response not affecting the passive components design.

#### **3. The control system**

A survey of the control algorithm is given to highlight the system complexity and high accuracy of simulation results. Authors suggest (Boscaino et al., 2009) for further details. A linear-non-linear digital controller oriented to IC implementation, improving both steadystate and transient response is presented. A schematic block diagram of the linear loop is shown in Fig.12.

A Pulse Width Modulation (PWM) current-mode control is implemented. Two 10 bits/2V ADCs and a 12 bits /5V DAC are included in the analog-digital interface. The output voltage is converted to digital and compared to a reference voltage Vref. The error signal

As (14) states, in a multiphase architecture the current ripple is cancelled. If compared with classical buck converters, the current ripple is reduced by (1-ND)/(1-D). Moreover, the equivalent switching frequency as seen by the power load is N times the operating

By comparing (15) and (5), conclusions are drawn: a N-modules architecture is equivalent to a buck converter operating at fsw,eq switching frequency, Deq duty-cycle, supplied by Vin,eq input voltage and featuring Leq inductance. Then, if compared with a buck converter fed by the same input voltage rail and supplying the same voltage bus, the multiphase architecture features higher switching frequency, higher duty-cycle and lower inductance. Both steadystate and dynamic performances of the switching regulator take a great advantage from these interesting properties. With regards to steady-state performances, tight voltage regulation could be achieved thanks to the ripple cancellation effect. Dynamic performances are greatly improved by the reduction of the equivalent inductor under load transients. The steady-state and dynamic performances of multiphase converters are affected by the duty cycle value. A narrow duty cycle results in a poor ripple cancellation. Hence, a larger inductance should be selected to keep tight voltage regulation worsening the transient response. If a wide input-output voltage range is considered, a proper design of passive components is not yet suitable for speeding up the system performances. Multiphase architectures achieving a duty cycle extension by the means of coupled inductors are

Otherwise, unconventional control algorithms are proposed to speed up the transient

A survey of the control algorithm is given to highlight the system complexity and high accuracy of simulation results. Authors suggest (Boscaino et al., 2009) for further details. A linear-non-linear digital controller oriented to IC implementation, improving both steadystate and transient response is presented. A schematic block diagram of the linear loop is

A Pulse Width Modulation (PWM) current-mode control is implemented. Two 10 bits/2V ADCs and a 12 bits /5V DAC are included in the analog-digital interface. The output voltage is converted to digital and compared to a reference voltage Vref. The error signal

���� �

� ��� <sup>=</sup> ��� (� � ��)

���� ��� <sup>=</sup> ���� ��(� � ���)���

(13)

(� � �) (14)

��� ������ (15)

� � ���� �� =

������� = ��

������ <sup>=</sup> ���(� � ��)�

� ��� <sup>=</sup> ���(� � ��)�� � �

where N is the number of modules and ��� = � � �� ���� �� = � � ���, ��� = �

The equivalent current ripple is given by:

switching frequency of each power module. Note that (14) could be expressed as:

������ <sup>=</sup> ���(� � ��)�

frequently proposed in literature.

**3. The control system** 

shown in Fig.12.

response not affecting the passive components design.

��� � .  *COMP\_OUT* is generated by the error amplifier which includes the adder and the *COMP* block. A type-2 compensation action is digitally implemented to ensure system stability. The error signal is then converted to analog and compared to the current sense signal of each power module Vc2,i.

Fig. 12. Schematic block diagram of the linear controller.

The gate drive interleaved technique is digitally implemented by the *Switching logic* subsystems. The master module is the Phase 1, the others slave. Fig.13 shows the switching logic algorithm for the master power module. A clock signal at the switching frequency is synchronously derived from the system clock. The switch-on of the high-side MOSFET is triggered by the rising-edge of the switching clock Ck1. The high-side MOSFET switch-off is triggered by the rising-edge of the corresponding PWM signal.

Fig. 13. Switching logic for the master module.

A digital counter generates a switching clock for each slave module which is synchronous with the master switching clock and phase-shifted according to the interleaved technique. The sense signal Vc2,i reproduces the instantaneous inductor current of the *i-th* power module. RC networks are used to sense the instantaneous inductor current of each power module. As shown in Fig.14, a RC filter is connected across the low-side MOSFET of each power module. The capacitor voltage Vc2 is the sense signal for current-mode control implementation.

Fig. 14. Current sense network.

The period T=rsCs is fixed according to the equation:

$$D\_{\text{max}}T\_{\text{sw}} \ll T \tag{16}$$

MATLAB Co-Simulation Tools for Power Supply Systems Design 167

Fig. 15. Dynamic response under load transients. At the top the load current step, at the

ref is the variable reference voltage, Vref is a fixed reference voltage, Io is the load

current and Rc is the equivalent series resistor of the output capacitor. The DC set point of the output voltage changes accordingly to the output current, as shown in Fig.16. At steadystate, the output voltage is forced by the AVP technique to the variable reference voltage, instead of a fixed value Vref . Under high-load conditions, the DC set point drops in the lower part of the allowable tolerance window. The maximum tolerance window is now

The technique results in added margin to handle load transients. Since the load current is equal to the average inductor current, the AVP technique is implemented by sensing the

Fig. 16. The dynamic response to a load current step with Adaptive Voltage Positioning.

A non-linear control is introduced to speed-up the transient response not affecting steady-state performances. During transients, the non-linear control modifies a few linear loop parameters, as the reference voltage or the duty-cycle. Since the converter output voltage is the only nonlinear loop input, the proposed technique can be efficiently applied to each power supply

<sup>ᇱ</sup> ൌ ܸ െ ܫܴܿ) 21 (

οܸ௨௧ǡ௫ ൌ οܫǡ௫ܴܿ (22)

ݒ

bottom, the output voltage waveforms are shown.

average inductor current of the master phase.

where, *v*'

given by:

where Tsw is the switching period and Dmax the maximum operating duty-cycle. The charge and discharge of the capacitor C2 within the switching period reproduces the charge and discharge of the inductor L. The average value of the sense signal is given by:

$$
\overline{V\_{c2}} = Volut + \overline{I\_L} R\_L \tag{17}
$$

where �� is the average inductor current and RL the ESR of the inductor L. The superimposed ripple is given by:

$$
\Delta V\_{c2} = R\_v \Delta I\_L \tag{18}
$$

where ΔIL is the inductor current ripple and Rv the virtual sensing resistor which is given by:

$$R\_v = \frac{L}{r\_s \mathcal{L}\_s} \tag{19}$$

The current-mode control is implemented by the Vc2 sense signal. A detailed analysis of the proposed current-sensing technique, including design guidelines is reported in (Boscaino et al., 2008).

Another RC network featuring a lower cut-off frequency is connected across the switching node of the master phase. The sense capacitor voltage Vc1 reproduces the average inductor current. Vc1 is converted to digital and feeds the *AVP* subsystem which implements the wellknown Adaptive Voltage Positioning (AVP) technique. Fig.15 shows the output voltage and the load current waveforms under a load current step without AVP. The maximum tolerance window on the output voltage is given by:

$$
\Delta V\_{\text{out,max}} = 2 \cdot \Delta I\_{o,max} Rc \tag{20}
$$

With the AVP technique, the reference voltage becomes a function of the load current according to the following equation.

module. As shown in Fig.14, a RC filter is connected across the low-side MOSFET of each power module. The capacitor voltage Vc2 is the sense signal for current-mode control

where Tsw is the switching period and Dmax the maximum operating duty-cycle. The charge and discharge of the capacitor C2 within the switching period reproduces the charge and

where ΔIL is the inductor current ripple and Rv the virtual sensing resistor which is given

The current-mode control is implemented by the Vc2 sense signal. A detailed analysis of the proposed current-sensing technique, including design guidelines is reported in (Boscaino et

Another RC network featuring a lower cut-off frequency is connected across the switching node of the master phase. The sense capacitor voltage Vc1 reproduces the average inductor current. Vc1 is converted to digital and feeds the *AVP* subsystem which implements the wellknown Adaptive Voltage Positioning (AVP) technique. Fig.15 shows the output voltage and the load current waveforms under a load current step without AVP. The maximum

With the AVP technique, the reference voltage becomes a function of the load current

�� <sup>=</sup> � ����

discharge of the inductor L. The average value of the sense signal is given by:

where �� is the average inductor current and RL the ESR of the inductor L.

������� � � (16)

��� = ���� � ���� (17)

���� = ����� (18)

��������� = � � ��������� (20)

(19)

implementation.

Fig. 14. Current sense network.

The superimposed ripple is given by:

by:

al., 2008).

The period T=rsCs is fixed according to the equation:

tolerance window on the output voltage is given by:

according to the following equation.

Fig. 15. Dynamic response under load transients. At the top the load current step, at the bottom, the output voltage waveforms are shown.

$$
\upsilon\_{ref}' = V\_{ref} - I\_o R \varepsilon \tag{21}
$$

where, *v*' ref is the variable reference voltage, Vref is a fixed reference voltage, Io is the load current and Rc is the equivalent series resistor of the output capacitor. The DC set point of the output voltage changes accordingly to the output current, as shown in Fig.16. At steadystate, the output voltage is forced by the AVP technique to the variable reference voltage, instead of a fixed value Vref . Under high-load conditions, the DC set point drops in the lower part of the allowable tolerance window. The maximum tolerance window is now given by:

$$
\Delta V\_{out,max} = \Delta I\_{o,max} Rc \tag{22}
$$

The technique results in added margin to handle load transients. Since the load current is equal to the average inductor current, the AVP technique is implemented by sensing the average inductor current of the master phase.

A non-linear control is introduced to speed-up the transient response not affecting steady-state performances. During transients, the non-linear control modifies a few linear loop parameters, as the reference voltage or the duty-cycle. Since the converter output voltage is the only nonlinear loop input, the proposed technique can be efficiently applied to each power supply system independently of the specific converter topology and linear loop architecture. Thanks to the AVP technique, load transients are detected by an instantaneous drop of the output voltage, and the increasing or decreasing load current transient is detected by monitoring the output voltage drop in terms of sign and width. Two different non-linear control actions are implemented: under a load current increase (*case a*) or decrease (*case b*). The reference voltage (*case a*) or the duty-cycle (*case b*) is modified by the non-linear control loop. Under increasing load current steps, the non-linear control loop acts on the reference voltage advancing the linear loop action. Two auxiliary signals, VVAR and VLOOP, are defined: VVAR is the output voltage value related to the new steady-state condition while VLOOP is the output voltage ripple during transient referred to VVAR value, as shown in Fig.17.

$$V\_{LOAD} = Volt - V\_{VAR} \tag{23}$$

MATLAB Co-Simulation Tools for Power Supply Systems Design 169

Under a load current decrease, the non-linear control loop modifies the duty-cycle signal, as shown in Fig.18. All modules are simultaneously turned off to allow the inductor current to decrease as fast as possible. Turning off all modules allows the fastest transient response. Unfortunately, the system is driven towards a loop upsetting and thus to an increase, instead of a reduction, of the output voltage over-and-under shoots. Then, a fixed duty-cycle is forced to all modules according to the interleaved technique. Known the VVAR value, the new steady-state duty-cycle is evaluated and forced by the non-linear subsystem to maintain a regulated output voltage during linear loop resettling. The false steady-state

> ��� <sup>=</sup> ���� + ���� ���

> > �� <sup>=</sup> ��� ��

��� <sup>=</sup> ���� <sup>+</sup> (������� � ����)�� ���

Fig. 18. The output voltage and the forced duty-cycle value under a load current decrease.

The duty-cycle value is evaluated by the non linear controller by the means of fixed parameters and the VVAR value which is obtained by monitoring the output voltage. The difference between the output voltage and VVAR is monitored and compared to the maximum steady-state output voltage ripple VOUT\_STEADY. If the condition (30) is

���� � ���� � ������������ (30)

module, RL the inductor parasitic resistance and Vin the converter input voltage.

continuously verified over a fixed TFSS time, the non-linear control action ends.

Further design guidelines could be found in (Boscaino et al. 2009, 2010).

where Vout is the regulated output voltage, �� is the average inductor current of a single

(27)

(28)

(29)

period is a tunable parameter to achieve high design flexibility.

From (27), defining the KR constant as:

the forced DNL value is obtained:

$$
\sigma'\_{ref} = V\_{ref} - V\_{LOAD} \tag{24}
$$

In order to achieve the fastest transient response, the gain factor KNL is introduced. Hence, *v*'REF is given by:

$$v\_{ref}' = V\_{ref} - K\_{NL}V\_{LOAD} \tag{25}$$

The KNL value is designed by the frequency response analysis to ensure the fastest effective gain under transients avoiding loop instabilities. Under transients, the difference between the output voltage and VVAR is monitored and compared with the maximum steady-state output voltage ripple VOUT\_STEADY. If the condition (26) is continuously verified over TSTEADY time, the non-linear control action ends.

$$\text{Vout} - V\_{VAR} < \Delta V\_{OUT\\_STEADY} \tag{26}$$

Fig. 17. Non linear control signals under a load current increase.

Under a load current decrease, the non-linear control loop modifies the duty-cycle signal, as shown in Fig.18. All modules are simultaneously turned off to allow the inductor current to decrease as fast as possible. Turning off all modules allows the fastest transient response. Unfortunately, the system is driven towards a loop upsetting and thus to an increase, instead of a reduction, of the output voltage over-and-under shoots. Then, a fixed duty-cycle is forced to all modules according to the interleaved technique. Known the VVAR value, the new steady-state duty-cycle is evaluated and forced by the non-linear subsystem to maintain a regulated output voltage during linear loop resettling. The false steady-state period is a tunable parameter to achieve high design flexibility.

$$D\_{NL} = \frac{Vout + \overline{I\_L}R\_L}{Vin} \tag{27}$$

where Vout is the regulated output voltage, �� is the average inductor current of a single module, RL the inductor parasitic resistance and Vin the converter input voltage. From (27), defining the KR constant as:

$$K\_R = \frac{4R\_L}{Rc} \tag{28}$$

the forced DNL value is obtained:

168 MATLAB for Engineers – Applications in Control, Electrical Engineering, IT and Robotics

system independently of the specific converter topology and linear loop architecture. Thanks to the AVP technique, load transients are detected by an instantaneous drop of the output voltage, and the increasing or decreasing load current transient is detected by monitoring the output voltage drop in terms of sign and width. Two different non-linear control actions are implemented: under a load current increase (*case a*) or decrease (*case b*). The reference voltage (*case a*) or the duty-cycle (*case b*) is modified by the non-linear control loop. Under increasing load current steps, the non-linear control loop acts on the reference voltage advancing the linear loop action. Two auxiliary signals, VVAR and VLOOP, are defined: VVAR is the output voltage value related to the new steady-state condition while VLOOP is the output voltage

In order to achieve the fastest transient response, the gain factor KNL is introduced. Hence,

The KNL value is designed by the frequency response analysis to ensure the fastest effective gain under transients avoiding loop instabilities. Under transients, the difference between the output voltage and VVAR is monitored and compared with the maximum steady-state output voltage ripple VOUT\_STEADY. If the condition (26) is continuously verified over TSTEADY

ܸைை ൌ ܸݐݑ െ ܸோ (23)

<sup>ᇱ</sup> ൌ ܸ െ ܸைை (24)

<sup>ᇱ</sup> ൌ ܸ െ ܭேܸைை (25)

ܸݐݑ െ ܸோ ൏ οܸை̴்ௌ்ா (26)

ripple during transient referred to VVAR value, as shown in Fig.17.

*v*'REF is given by:

time, the non-linear control action ends.

ݒ

ݒ

Fig. 17. Non linear control signals under a load current increase.

$$D\_{NL} = \frac{V\_{VAR} + (Vout\_{I=0} - V\_{VAR})K\_R}{Vin} \tag{29}$$

The duty-cycle value is evaluated by the non linear controller by the means of fixed parameters and the VVAR value which is obtained by monitoring the output voltage. The difference between the output voltage and VVAR is monitored and compared to the maximum steady-state output voltage ripple VOUT\_STEADY. If the condition (30) is continuously verified over a fixed TFSS time, the non-linear control action ends.

$$Vout - V\_{VAR} < \Delta V\_{OUT\\_STEADY} \tag{30}$$

Further design guidelines could be found in (Boscaino et al. 2009, 2010).

Fig. 18. The output voltage and the forced duty-cycle value under a load current decrease.

MATLAB Co-Simulation Tools for Power Supply Systems Design 171

Fig. 19. Top level model

a state vector as:

Fig. 20. The State-Space block and the parameter box.

A continuous large-signal model of the buck converter is derived and implemented by the state-space block. The Parasitic components of passive elements as the DC resistance of the inductor (DCR) and the capacitor equivalent series resistor (Rc) are included. Assuming identical MOSFETs, the model accounts for the MOSFET equivalent resistance Rds,on. Define

��(�)�����(�)

��(�)� (32)

�(�) � ���(�)

#### **4. Co-simulation set-up**

Active-HDL provides an interface to MATLAB/Simulink simulation environment which allows co-simulation of functional blocks described by using hardware description languages. The digital controller is tested on a FPGA device. A specific co-simulation procedure should be activated in order to make each VHDL design unit available in Simulink libraries. The VHDL code and signal timing are tested as well. High-accuracy simulation results are obtained heavily reducing experimental fault conditions. The cosimulation procedure features automatic data type conversion between Simulink and Active HDL and simulation results could be displayed in both simulation environments. All VHDL entities are collected in an Active HDL workspace. A MATLAB m-file is generated for each VHDL entity. By right clicking on a VHDL entity, select the option "Generate Block Description for Simulink". The procedure is repeated for each VHDL entity of current Workspace. After generating the m-files, the *Active-HDL Blockset* is available in the Simulink library browser. The *Active-HDL Co-Sim* and *HDL Black-Box* elements are used for system cosimulation. The *Active-HDL Co-Sim* element must be included in the Simulink top level model. The block allows the designer to fix co-simulation parameters. In order to simulate a VHDL entity as an integral part of the current model, a *HDL Black-Box* block should be added and associated to the corresponding m-file by the configuration box. When the model is completed, running simulation from Simulink starts the co-simulation. The connection to the Active-HDL server will be opened and all *HDL Black-Boxes* simulated with the Active-HDL simulator. Input and output waveforms can be analyzed both in Simulink and Aldec environment while internal signal waveforms can be analyzed in Aldec environment only.

#### **5. MATLAB/Simulink model**

The top level model is shown in Fig.19. The power section includes the *Multiphase converter* and the *Current-sense* subsystems. In the *A/D converter* subsystem, the Analog-to-Digital interface is modelled by Simulink library elements. The controller is modelled in Aldec Active-HDL environment and each design unit is included in the *Controller* subsystem. The *Active-HDL Co-Sim* block is added to the top level model.

#### **5.1 The power section model**

The power section includes the multiphase converter and current-sense filters. A fourmodule interleaved synchronous buck converter is connected to the power load. The power section is modelled by Simulink library elements in order to achieve the highest processing speed. The use of several co-simulation tools is avoided, keeping at the same time the highest accuracy. In this paragraph, the Simulink model of the multiphase converter based on a continuous-time large-signal model is described. The proposed modelling technique could be efficiently extended to each switching converter.

In Simulink environment, the State-Space block models a system by its own state-space equations:

$$\begin{aligned} \dot{\mathfrak{X}} &= A\mathfrak{x} + Bu \\ \mathfrak{y} &= \mathfrak{C}\mathfrak{x} + Du \end{aligned} \tag{31}$$

where **x** is the state vector, **u** the input vector and **y** the output vector.

According to (31), the block is fed by the input vector *u* and the output vector *y* is generated. As shown in Fig.20, the designer could enter the matrix coefficients in the parameter box.

Fig. 19. Top level model

Active-HDL provides an interface to MATLAB/Simulink simulation environment which allows co-simulation of functional blocks described by using hardware description languages. The digital controller is tested on a FPGA device. A specific co-simulation procedure should be activated in order to make each VHDL design unit available in Simulink libraries. The VHDL code and signal timing are tested as well. High-accuracy simulation results are obtained heavily reducing experimental fault conditions. The cosimulation procedure features automatic data type conversion between Simulink and Active HDL and simulation results could be displayed in both simulation environments. All VHDL entities are collected in an Active HDL workspace. A MATLAB m-file is generated for each VHDL entity. By right clicking on a VHDL entity, select the option "Generate Block Description for Simulink". The procedure is repeated for each VHDL entity of current Workspace. After generating the m-files, the *Active-HDL Blockset* is available in the Simulink library browser. The *Active-HDL Co-Sim* and *HDL Black-Box* elements are used for system cosimulation. The *Active-HDL Co-Sim* element must be included in the Simulink top level model. The block allows the designer to fix co-simulation parameters. In order to simulate a VHDL entity as an integral part of the current model, a *HDL Black-Box* block should be added and associated to the corresponding m-file by the configuration box. When the model is completed, running simulation from Simulink starts the co-simulation. The connection to the Active-HDL server will be opened and all *HDL Black-Boxes* simulated with the Active-HDL simulator. Input and output waveforms can be analyzed both in Simulink and Aldec environment while internal signal waveforms can be analyzed in Aldec environment only.

The top level model is shown in Fig.19. The power section includes the *Multiphase converter* and the *Current-sense* subsystems. In the *A/D converter* subsystem, the Analog-to-Digital interface is modelled by Simulink library elements. The controller is modelled in Aldec Active-HDL environment and each design unit is included in the *Controller* subsystem. The

The power section includes the multiphase converter and current-sense filters. A fourmodule interleaved synchronous buck converter is connected to the power load. The power section is modelled by Simulink library elements in order to achieve the highest processing speed. The use of several co-simulation tools is avoided, keeping at the same time the highest accuracy. In this paragraph, the Simulink model of the multiphase converter based on a continuous-time large-signal model is described. The proposed modelling technique

In Simulink environment, the State-Space block models a system by its own state-space

ൌ ሶ

ൌ

According to (31), the block is fed by the input vector *u* and the output vector *y* is generated. As shown in Fig.20, the designer could enter the matrix coefficients in the parameter box.

(31)

**4. Co-simulation set-up** 

**5. MATLAB/Simulink model** 

**5.1 The power section model** 

equations:

*Active-HDL Co-Sim* block is added to the top level model.

could be efficiently extended to each switching converter.

where **x** is the state vector, **u** the input vector and **y** the output vector.

Fig. 20. The State-Space block and the parameter box.

A continuous large-signal model of the buck converter is derived and implemented by the state-space block. The Parasitic components of passive elements as the DC resistance of the inductor (DCR) and the capacitor equivalent series resistor (Rc) are included. Assuming identical MOSFETs, the model accounts for the MOSFET equivalent resistance Rds,on. Define a state vector as:

$$\mathbf{x}(t) = \begin{vmatrix} \boldsymbol{\varkappa}\_1(t) \\\\ \boldsymbol{\varkappa}\_2(t) \end{vmatrix} = \begin{vmatrix} \boldsymbol{\iota}\_L(t) \\\\ \boldsymbol{\nu}\_c(t) \end{vmatrix} \tag{32}$$

$$\mathbf{y}(t) = \begin{bmatrix} \mathbf{y}\_1(t) \\\\ \mathbf{y}\_2(t) \end{bmatrix} = \begin{bmatrix} i\_L(t) \\\\ v\_{out}(t) \end{bmatrix} \tag{33}$$

$$\begin{cases} L\dot{\boldsymbol{x}}\_{1}(t) + Rc\mathcal{C}\dot{\boldsymbol{x}}\_{2}(t) = -\dot{R}\_{L}\boldsymbol{x}\_{1}(t) - \boldsymbol{x}\_{2}(t) + l\dot{m} \\\\ \left(R\boldsymbol{c} + R\right)\mathcal{C}\dot{\boldsymbol{x}}\_{2}(t) = R\boldsymbol{x}\_{1}(t) - \boldsymbol{x}\_{2}(t) \end{cases} \tag{34}$$

$$
\begin{bmatrix} L & RcC \\ 0 & (Rc + R)C \end{bmatrix} \mathfrak{x}(t) = \begin{bmatrix} R\_L & -1 \\ R & -1 \end{bmatrix} \mathfrak{x}(t) + \begin{bmatrix} 1 \\ 0 \end{bmatrix} Vin \tag{35}
$$

$$\mathbf{x}(t) = \begin{bmatrix} \frac{R\_L R c + R \{R\_L + R c\}}{\{R c + R\} L} & -\frac{R}{\{R c + R\} L} \\ \frac{R}{\{R c + R\} C} & -\frac{1}{\{R c + R\} C} \end{bmatrix} \mathbf{x}(t) + \begin{bmatrix} 1 \\ 0 \\ 0 \end{bmatrix} V \text{in} \tag{36}$$

$$\begin{cases} L\dot{\boldsymbol{x}}\_{1}(t) + Rc\mathcal{C}\dot{\boldsymbol{x}}\_{2}(t) \stackrel{\cdot}{=} -R\_{L}\boldsymbol{x}\_{1}(t) - \boldsymbol{x}\_{2}(t) \\\\ \{R\boldsymbol{c} + R\}\mathcal{C}\dot{\boldsymbol{x}}\_{2}(t) = R\boldsymbol{x}\_{1}(t) - \boldsymbol{x}\_{2}(t) \end{cases} \tag{37}$$

$$
\begin{bmatrix} L & Rc\mathcal{C} \\ 0 & (Rc+R)\mathcal{C} \end{bmatrix} \mathfrak{X}(t) = \begin{bmatrix} R\_L & -1 \\ R & -1 \end{bmatrix} \mathfrak{x}(t) \tag{38}
$$

$$
\dot{\mathbf{x}}(t) = \begin{bmatrix}
\frac{R\_L R c + R (R\_L + R c)}{(R c + R)L} & -\frac{R}{(R c + R)L} \\
R & -\frac{1}{(R c + R)C} \end{bmatrix} \mathbf{x}(t) \tag{39}
$$

$$\begin{cases} \begin{aligned} \boldsymbol{\chi}\_{1}(t) &= \boldsymbol{\chi}\_{1}(t) \\ \boldsymbol{\chi}\_{2}(t) &= \frac{RcR}{R+Rc} \boldsymbol{\chi}\_{1}(t) + \frac{R}{R+Rc} \boldsymbol{\chi}\_{2}(t) \end{aligned} \tag{40}$$

$$\mathbf{y}(t) = \begin{bmatrix} 1 & 0\\ \frac{RRc}{R+Rc} & \frac{R}{R+Rc} \end{bmatrix} \mathbf{x}(t) \tag{41}$$

$$\mathbf{x}(\mathbf{t}) = \mathbf{A\_{on}} \cdot \mathbf{x}(\mathbf{t}) + \mathbf{b\_{on}} \cdot u(\mathbf{t})$$

$$\mathbf{y}(\mathbf{t}) = \mathbf{C\_{on}} \cdot \mathbf{x}(\mathbf{t}) + \mathbf{d\_{on}} \cdot u(\mathbf{t}) \tag{42}$$

$$\mathcal{A}\_{on} = \begin{bmatrix} \frac{R\_L R c + R (R\_L + R c)}{(R c + R)L} & -\frac{R}{(R c + R)L} \\ & R & 1 \\ \hline \overline{(R c + R)C} & -\frac{1}{(R c + R)C} \end{bmatrix} \tag{43}$$

$$\mathbf{b}\_{\text{on}} = \begin{bmatrix} 1 \\ \hline \\ 0 \end{bmatrix} \tag{44}$$

$$\mathbf{C\_{on}} = \begin{bmatrix} 1 & 0 \\ \frac{\text{RRc}}{\text{R} + \text{Rc}} & \frac{\text{R}}{\text{R} + \text{Rc}} \end{bmatrix} \tag{45}$$

$$\mathbf{d}\_{\rm on} = \begin{bmatrix} 0 \\ 0 \end{bmatrix} \tag{46}$$

$$\mathbf{x}(\mathbf{t}) = \mathbf{A}\_{\rm off} \cdot \mathbf{x}(\mathbf{t}) + \mathbf{b}\_{\rm off} \cdot u(\mathbf{t})$$

$$\mathbf{y}(\mathbf{t}) = \mathbf{C}\_{\rm off} \cdot \mathbf{x}(\mathbf{t}) + \mathbf{d}\_{\rm off} \cdot u(\mathbf{t}) \tag{47}$$

$$\mathbf{A}\_{on} = \begin{bmatrix} \frac{R\_L R c + R \{R\_L + R c\}}{\{R c + R\} L} & -\frac{R}{\{R c + R\} L} \\ & \frac{R}{\{R c + R\} C} & -\frac{1}{\{R c + R\} C} \end{bmatrix} \tag{48}$$

$$\mathbf{b}\_{\rm off} = \begin{bmatrix} \mathbf{0} \\ \mathbf{0} \end{bmatrix} \tag{49}$$

$$\mathbf{C\_{off}} = \begin{bmatrix} 1 & 0 \\ \frac{\text{RRc}}{\text{R} + \text{Rc}} & \frac{\text{R}}{\text{R} + \text{Rc}} \end{bmatrix} \tag{50}$$

$$\mathbf{d}\_{\rm off} = \begin{bmatrix} 0 \\ 0 \end{bmatrix} \tag{51}$$

$$\mathbf{A} \mathbf{=} \mathbf{A}\_{\mathrm{ON}} \mathbf{=} \mathbf{A}\_{\mathrm{OFF}}$$

$$\mathbf{C} \mathbf{=} \mathbf{C}\_{\mathrm{ON}} \mathbf{=} \mathbf{C}\_{\mathrm{OFF}}$$

$$\mathbf{b}\_{\mathrm{OFF}} = \mathbf{0}$$

$$\mathbf{d}\_{\rm ON} = \mathbf{d}\_{\rm OFF} = \mathbf{0} \tag{52}$$

$$q(t) = \begin{cases} 1\,\,during\,\,the\,\,\,ON\,\,time\\ 0\,\,during\,\,the\,\,\,OFF\,\,time \end{cases} \tag{53}$$

$$u(t) = q(t) \cdot V \text{in} \tag{54}$$

$$\mathbf{x}(\mathbf{t}) = \mathbf{A} \cdot \mathbf{x}(\mathbf{t}) + \mathbf{b} \cdot Vm \cdot q(\mathbf{t})$$

$$\mathbf{y}(\mathbf{t}) = \mathbf{\dot{C}} \cdot \mathbf{x}(\mathbf{t}) \tag{55}$$

$$\mathbf{x}(t) = \begin{bmatrix} i\_{L1}(t) \\ i\_{L2}(t) \\ i\_{L3}(t) \\ i\_{L4}(t) \\ v\_c(t) \end{bmatrix} \tag{56}$$

The output vector is defined as:

$$\mathbf{y}(t) = \begin{bmatrix} \iota\_{L1}(t) \\ \iota\_{L2}(t) \\ \iota\_{L3}(t) \\ \iota\_{L4}(t) \\ \upsilon\_{out}(t) \end{bmatrix} \tag{57}$$

MATLAB Co-Simulation Tools for Power Supply Systems Design 177

Fig. 25 shows the Simulink model of the multiphase converter. The input voltage and scalar components of the q vector are the model inputs. The *Mux* block multiplexes scalar components into the input vector **u**. The *Demux* block generates the scalar components of

Fig. 25. Simulink model of a four-module buck converter. Inductor currents are the output

State -Space x' = Ax+Bu y = Cx+Du

Demux

Vout 5 Vsw4 4 Vsw3 3 Vsw2 2 Vsw1 1

Demux

Demux

Demux

Vout 5

> ILeq 6

IL 4 4

IL3 3

IL 2 2

IL 1 1

The proposed model could be adapted to the designer requirements. For example, in Fig.26 another implementation is shown. Besides the inductor current signals and the output voltage, the switching node voltages Vsw of each module are also included in the output vector. Further, the equivalent inductor current instead of the inductor currents as well as switching node voltages are available outside the subsystem. The equivalent current is

> State -Space x' = Ax+Bu y = Cx+Du

obtained as the sum of inductor currents by the means of *Adder* blocks.

Mux

Mux

Fig. 26. Simulink model of the multiphase converter.

Mux

Mux

the output vector **y**(t).

Product 4

Product 1

Product 3

Product 4

Product 3

Q 4 5

Q 3 4

Q 2 3

Q 1 2 Vdc 1

Product 2

Product 1

Product 2

vector components.

Q 4 5

Q 3 4

Q 2 3

Q 1 2 Vdc 1

The state-space model is obtained:

$$\mathbf{x}(\mathbf{t}) = \mathbf{A} \cdot \mathbf{x}(\mathbf{t}) + \mathbf{b} \cdot Vm \cdot \mathbf{q}(t)$$

$$\mathbf{y}(\mathbf{t}) = \mathbf{\dot{C}} \cdot \mathbf{x}(\mathbf{t})\tag{58}$$

where:

1 1 1 1 1 11 2 2 2 2 2 22 3 3 3 3 3 33 () () () () () () () () () () () () () () ( *C C C C C C C C CC C C CC C C C C CC CC C C C CC C C RR RR R R RR RR RR R LR R LR R LR R LR R LR R RR RR RR R R RR RR R LR R LR R LR R LR R LR R RR RR RR RR R R RR R A LR R LR R LR R LR R LR R* + + − − −− + + + ++ + + −− − − − + + + ++ + + <sup>=</sup> − −− −− + + + ++ 4 4 4 4 4 44 ) () () () () () 1 () () () () () *C C C C C C C C C CC C C C CC RR RR RR RR RR R R R LR R LR R LR R LR R LR R RR R R CR R CR R CR R CR R CR R* + + − − −− − + + + ++ <sup>−</sup> + + + ++ (59)

$$B = \begin{bmatrix} \frac{1}{L\_1} & 0 & 0 & 0\\ 0 & \frac{1}{L\_2} & 0 & 0\\ 0 & 0 & \frac{1}{L\_3} & 0\\ 0 & 0 & 0 & \frac{1}{L\_4} \end{bmatrix} \tag{60}$$

$$C = \begin{bmatrix} 1 & 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 \\ \frac{RR\_C}{R + R\_C} & \frac{RR\_C}{R + R\_C} & \frac{RR\_C}{R + R\_C} & \frac{RR\_C}{R + R\_C} & \frac{R}{R + R\_C} \end{bmatrix} \tag{61}$$

$$\mathbf{q}(t) = \begin{bmatrix} q\_1(t) \\ q\_2(t) \\ q\_3(t) \\ q\_4(t) \end{bmatrix} \tag{62}$$

� � � � � ���(�) ���(�) ���(�) ���(�) ����(�)� � � � �

�(�)� =���(�) � � � ��� � �(�) �

1 1 1 11

+ + − − −− + + + ++

*RR RR R R RR RR RR R LR R LR R LR R LR R LR R RR RR RR R R RR RR R LR R LR R LR R LR R LR R RR RR RR RR R R RR R*

*C C C C C*

*C C CC C*

*CC C C C CC C C*

*RR R R*

1

*L*

*B*

 

=

*C*

*C C*

*RR RR*

2

=

*L*

*A LR R LR R LR R LR R LR R*

+ + <sup>=</sup> − −− −− + + + ++

*C C C C C*

2 2 2 22

+ + −− − − − + + + ++

3 3 3 33

4 4 4 44

() () () () (

+ + − − −− − + + + ++ <sup>−</sup> + + + ++

3 3

*C C C CC*

*C C C CC*

() () () () ()

() () () () ()

() () () () ()

*RR RR RR RR RR R R R LR R LR R LR R LR R LR R*

*C C C CC*

*C C C CC*

() () () () ()

3

*L*

+++++

� � � � � ��(�) ��(�) ��(�) ��(�) � � � � �

*RR RR*

01000 00100 00010 00001

> *C C*

�(�) =

*RR RR*

*C C*

4

*L*

*CR R CR R CR R CR R CR R*

2 2

�(�) =���(�) � (58)

4 4

 

*C C*

*RR R*

*C*

*RR RR*

(57)

)

 (59)

(60)

(61)

(62)

*C*

1

�(�) =

The output vector is defined as:

The state-space model is obtained:

1 1

where:

Fig. 25 shows the Simulink model of the multiphase converter. The input voltage and scalar components of the q vector are the model inputs. The *Mux* block multiplexes scalar components into the input vector **u**. The *Demux* block generates the scalar components of the output vector **y**(t).

Fig. 25. Simulink model of a four-module buck converter. Inductor currents are the output vector components.

The proposed model could be adapted to the designer requirements. For example, in Fig.26 another implementation is shown. Besides the inductor current signals and the output voltage, the switching node voltages Vsw of each module are also included in the output vector. Further, the equivalent inductor current instead of the inductor currents as well as switching node voltages are available outside the subsystem. The equivalent current is obtained as the sum of inductor currents by the means of *Adder* blocks.

Fig. 26. Simulink model of the multiphase converter.

MATLAB Co-Simulation Tools for Power Supply Systems Design 179

Fig. 28. The Controller subsystem.

Fig. 29. The non-linear controller.

#### **5.2 The sense network**

Current sense filters are modelled by their own Laplace transfer function using the *Transfer Function* block. In the parameter box the coefficients of the Laplace function are entered. The *low-pass filter* subsystem of the master phase is shown in Fig.27. Low-pass filter subsystems are fed by the switching node voltage of the corresponding power module.

Fig. 27. Current-sense filters of the master module.

#### **5.3 The digital controller model**

The digital controller is modelled as the collection of VHDL entities, each one described by the VHDL code in Active-HDL environment. By the co-simulation procedure, each design unit is added to the Simulink model and simulated among the others. The Simulink model of the *Controller* subsystem is shown in Fig.28. Two subsystems are highlighted: the *Non\_linear\_controller* and the *Linear\_Controller.* VHDL entities are collected in the *Controller*  subsystem. The 6.25MHz system clock is derived from the 50MHz clock signal available from the FPGA device by the means of a digital clock divider, described in the *clock\_div* entity. VHDL entities are linked in Simulink environment. Note that modelling the digital controller by multiple entities is a unique choice of the designer. Instead of modelling the controller by a unique VHDL entity, authors suggest a multiple entities approach to monitor internal signal of the FPGA controller in Simulink environment. The co-simulation procedure allows the designer to test the VHDL code, including timing between entities. The digital controller is thus tested as closely as possible to the effective FPGA implementation.

Each VHDL entity accomplishes a specific task of the digital controller: soft-start, protection circuits for safe operation, adaptive voltage positioning and the strictly-named controller implementing the sophisticated control algorithm, as shown in Fig.29. The co-simulation procedure as well as the proposed modelling approach allows the designer to test each available function by behavioural simulations, thus reducing the risk of experimental fault conditions.

In the *Linear Controller*, the error signal is converted to analog by the DAC subsystem and then compared to the analog saw-tooth within the PWM generator. The interleaved technique is digitally implemented. Fig.30 shows the switching logic subsystem of the master phase. The *f1\_sim* VHDL entity is fed by the master phase PWM signal and nonlinear control signals. The unit generates the q-signal for the master module. The digital counter which generates the switching clocks (*SwCk*) of all slave modules is modelled by the *acc\_sint* VHDL unit.

Current sense filters are modelled by their own Laplace transfer function using the *Transfer Function* block. In the parameter box the coefficients of the Laplace function are entered. The *low-pass filter* subsystem of the master phase is shown in Fig.27. Low-pass filter subsystems

The digital controller is modelled as the collection of VHDL entities, each one described by the VHDL code in Active-HDL environment. By the co-simulation procedure, each design unit is added to the Simulink model and simulated among the others. The Simulink model of the *Controller* subsystem is shown in Fig.28. Two subsystems are highlighted: the *Non\_linear\_controller* and the *Linear\_Controller.* VHDL entities are collected in the *Controller*  subsystem. The 6.25MHz system clock is derived from the 50MHz clock signal available from the FPGA device by the means of a digital clock divider, described in the *clock\_div* entity. VHDL entities are linked in Simulink environment. Note that modelling the digital controller by multiple entities is a unique choice of the designer. Instead of modelling the controller by a unique VHDL entity, authors suggest a multiple entities approach to monitor internal signal of the FPGA controller in Simulink environment. The co-simulation procedure allows the designer to test the VHDL code, including timing between entities. The digital controller is thus tested as closely as possible to the effective FPGA

Each VHDL entity accomplishes a specific task of the digital controller: soft-start, protection circuits for safe operation, adaptive voltage positioning and the strictly-named controller implementing the sophisticated control algorithm, as shown in Fig.29. The co-simulation procedure as well as the proposed modelling approach allows the designer to test each available function by behavioural simulations, thus reducing the risk of experimental fault

In the *Linear Controller*, the error signal is converted to analog by the DAC subsystem and then compared to the analog saw-tooth within the PWM generator. The interleaved technique is digitally implemented. Fig.30 shows the switching logic subsystem of the master phase. The *f1\_sim* VHDL entity is fed by the master phase PWM signal and nonlinear control signals. The unit generates the q-signal for the master module. The digital counter which generates the switching clocks (*SwCk*) of all slave modules is modelled by the

are fed by the switching node voltage of the corresponding power module.

Fig. 27. Current-sense filters of the master module.

**5.3 The digital controller model** 

implementation.

conditions.

*acc\_sint* VHDL unit.

**5.2 The sense network** 

Fig. 28. The Controller subsystem.

Fig. 29. The non-linear controller.

MATLAB Co-Simulation Tools for Power Supply Systems Design 181

The available *Quantizer* block allows the user to set the voltage resolution while the number

The S*aturation* block is thus cascaded to the *Quantizer* in order to set the full scale range. The

where Vres is the voltage resolution and Nlev the number of levels. The discrete output of the *Saturation* block should be coded. In order to simulate the ADC coding, the *Gain* block is cascaded to the saturation block. The output of the ADC model is the equivalent decimal

<sup>K</sup> <sup>=</sup> FS

The C*onversion Delay* block accounts for the input-output delay of the modelled A/D

The Simulink model of the digital-to-analog converter is shown in Fig.32. The subsystem is fed by a digital signal and generates a discrete analog signal. The maximum value of the

where Nbit,dac is the converter bit resolution. The maximum value of the output voltage is equal to the DAC full scale voltage. The digital-to-analog converter is modelled by a gain

> K��� <sup>=</sup> FS��� 2��������

In order to model the full scale range of the converter, a *Saturation* block is cascaded with the

The PWM comparator is fed by the analog error signal and the analog current sense signal. The analog comparator model is shown in Fig.33. An adder block is used as the input stage of the comparator. The *Relay* block models the non-linearity of the comparator. The Relay block allows its output to switch between two specified values. The state of the relay is obtained by comparing the input signal to the specified thresholds, the *Switch-off point and the Switch-on point* parameters. When the relay is on, it remains on until the input drops below the value of the *Switch-off point* parameter. When the relay is off, it remains off until the input exceeds the value of the *Switch-on point* parameter. The parameter box allows the

2���� ∙ (2���� − 1) (64)

2���� (65)

���� = 2�������� − 1 (66)

analog 1

(67)

High = V��� ∙ N��� <sup>=</sup> FS

where Nbit is the bit resolution and FS the full scale voltage.

number of the binary vector. The conversion gain is given by:

gain block. Saturation levels are equal to the full scale range.


Fig. 32. The Simulink model of a digital-to-analog converter.

DAC Gain Saturation

Conversion Delay digital

of levels is yet unlimited.

converter.

factor Kdac:

input signal is given by:

**5.5 PWM comparator model** 

1

high-level saturation limit is given by:

Fig. 30. The Switching Logic model of the master module.

#### **5.4 Analog-digital interface**

Co-simulation features are to be well-understood before implementing a mixed-mode model. ALDEC and Simulink automatically code common signals. In ALDEC environment signals are coded as signed binary vectors. The output of each HDL block is thus a binary vector. Simulink automatically codes binary vectors by the equivalent decimal number. HDL block inputs are Simulink signals thus coded as decimal numbers. ALDEC environment codes decimal numbers as the equivalent signed binary vector. The Simulink model should account for binary-decimal data conversion. Digital to analog converters and analog to digital converters are introduced in the Simulink model.

The A/D converter section includes two A/D converters, each modelled as shown in Fig.31 by the means of elementary blocks of Simulink libraries.

Fig. 31. The A/D converter model

The input signal is sampled at the clock frequency by the *Triggered Zero-Order Hold* block. Since in the Simulink library browser only an ideal symmetrical *Quantizer* block is provided, a non-ideal A/D converter model is achieved by adding the horizontal shift. The horizontal shift constant is given by:

$$\mathcal{C} = \frac{\text{FS}}{\text{Z}^{\text{Nbit} + 1}} \tag{63}$$

Co-simulation features are to be well-understood before implementing a mixed-mode model. ALDEC and Simulink automatically code common signals. In ALDEC environment signals are coded as signed binary vectors. The output of each HDL block is thus a binary vector. Simulink automatically codes binary vectors by the equivalent decimal number. HDL block inputs are Simulink signals thus coded as decimal numbers. ALDEC environment codes decimal numbers as the equivalent signed binary vector. The Simulink model should account for binary-decimal data conversion. Digital to analog converters and

The A/D converter section includes two A/D converters, each modelled as shown in Fig.31

The input signal is sampled at the clock frequency by the *Triggered Zero-Order Hold* block. Since in the Simulink library browser only an ideal symmetrical *Quantizer* block is provided, a non-ideal A/D converter model is achieved by adding the horizontal shift. The horizontal

FS

<sup>2</sup>������ (63)

C =

Fig. 30. The Switching Logic model of the master module.

analog to digital converters are introduced in the Simulink model.

by the means of elementary blocks of Simulink libraries.

**5.4 Analog-digital interface** 

Fig. 31. The A/D converter model

shift constant is given by:

where Nbit is the bit resolution and FS the full scale voltage.

The available *Quantizer* block allows the user to set the voltage resolution while the number of levels is yet unlimited.

The S*aturation* block is thus cascaded to the *Quantizer* in order to set the full scale range. The high-level saturation limit is given by:

$$\text{High} = \text{V}\_{\text{res}} \cdot \text{N}\_{\text{lev}} = \frac{\text{FS}}{\text{2^{Nbit}}} \cdot (\text{2^{Nbit}} - 1) \tag{64}$$

where Vres is the voltage resolution and Nlev the number of levels. The discrete output of the *Saturation* block should be coded. In order to simulate the ADC coding, the *Gain* block is cascaded to the saturation block. The output of the ADC model is the equivalent decimal number of the binary vector. The conversion gain is given by:

$$\mathbf{K} = \frac{\mathbf{F}\mathbf{S}}{2^{\mathbf{N}\text{bit}}} \tag{65}$$

The C*onversion Delay* block accounts for the input-output delay of the modelled A/D converter.

The Simulink model of the digital-to-analog converter is shown in Fig.32. The subsystem is fed by a digital signal and generates a discrete analog signal. The maximum value of the input signal is given by:

$$V \text{max} = 2^{N\_{\text{bit,dac}}} - 1 \tag{66}$$

where Nbit,dac is the converter bit resolution. The maximum value of the output voltage is equal to the DAC full scale voltage. The digital-to-analog converter is modelled by a gain factor Kdac:

$$\mathbf{K\_{dac}} = \frac{\mathbf{F\_{disc}}}{\mathbf{Z^{N\_{bit,dac}}}} \tag{67}$$

In order to model the full scale range of the converter, a *Saturation* block is cascaded with the gain block. Saturation levels are equal to the full scale range.

Fig. 32. The Simulink model of a digital-to-analog converter.

#### **5.5 PWM comparator model**

The PWM comparator is fed by the analog error signal and the analog current sense signal. The analog comparator model is shown in Fig.33. An adder block is used as the input stage of the comparator. The *Relay* block models the non-linearity of the comparator. The Relay block allows its output to switch between two specified values. The state of the relay is obtained by comparing the input signal to the specified thresholds, the *Switch-off point and the Switch-on point* parameters. When the relay is on, it remains on until the input drops below the value of the *Switch-off point* parameter. When the relay is off, it remains off until the input exceeds the value of the *Switch-on point* parameter. The parameter box allows the

MATLAB Co-Simulation Tools for Power Supply Systems Design 183

Fig. 35. Steady-state waveforms under 115A load current. At the top the output voltage, at

Fig. 36. Dynamic response to a 0-120A load current step without the non-linear control. At the top the output voltage, at the bottom the equivalent current waveforms are shown.

Fig. 37. Dynamic response to a 120A-0 load current step without the non-linear control. At the top the output voltage, at the bottom the equivalent current waveforms are shown.

the bottom the equivalent current waveforms are shown.

end user to set a specified value for both on and off conditions. In this model, the output value is equal to "1" in the on-state, "0" in the off-state.

Fig. 33. The Simulink model of the PWM comparator.

#### **6. Simulation results**

A 12V/1V@120A four-module buck converter has been designed and modelled in Simulink-Aldec mixed environment. Each power module operates at 250kHz switching frequency. Simulation results are shown to highlight the high accuracy of the modelling approach. Steady-state waveforms under 1A load are shown in Fig.34. At the top the output voltage waveform, at the bottom the equivalent inductor current is shown. The proposed modelling approach allows the designer to simulate the system behaviour within the switching period achieving high accuracy results. The output voltage ripple and the current ripple are accurately modelled. The DC set point of the output voltage is fixed at the nominal value. The output voltage, at the top, and the equivalent current, at the bottom, under 115A load are shown in Fig.35. The DC set point is fixed at 0.96V at full load due to the implemented AVP technique.

The system is tested under load current transients to evaluate the non-linear control performances. Under a 0-120A load current step, if the non linear controller is disabled the system behaviour shown in Fig.36 is obtained. Under a 120A -0 load current step, if the non linear controller is disabled the system behaviour shown in Fig.37 is obtained. The output voltage, at the top, and the equivalent current, at the bottom, are shown. Note that the proposed design approach accurately models the system behaviour within the switching period as well as under large-signal transients.

Fig. 34. Steady-state waveforms under 1A load current. At the top the output voltage, at the bottom the equivalent current waveforms are shown.

end user to set a specified value for both on and off conditions. In this model, the output

Relay 1

Out 1 1

A 12V/1V@120A four-module buck converter has been designed and modelled in Simulink-Aldec mixed environment. Each power module operates at 250kHz switching frequency. Simulation results are shown to highlight the high accuracy of the modelling approach. Steady-state waveforms under 1A load are shown in Fig.34. At the top the output voltage waveform, at the bottom the equivalent inductor current is shown. The proposed modelling approach allows the designer to simulate the system behaviour within the switching period achieving high accuracy results. The output voltage ripple and the current ripple are accurately modelled. The DC set point of the output voltage is fixed at the nominal value. The output voltage, at the top, and the equivalent current, at the bottom, under 115A load are shown in Fig.35. The DC set point is fixed at 0.96V at full load due to the implemented

The system is tested under load current transients to evaluate the non-linear control performances. Under a 0-120A load current step, if the non linear controller is disabled the system behaviour shown in Fig.36 is obtained. Under a 120A -0 load current step, if the non linear controller is disabled the system behaviour shown in Fig.37 is obtained. The output voltage, at the top, and the equivalent current, at the bottom, are shown. Note that the proposed design approach accurately models the system behaviour within the switching

Fig. 34. Steady-state waveforms under 1A load current. At the top the output voltage, at the

value is equal to "1" in the on-state, "0" in the off-state.

Fig. 33. The Simulink model of the PWM comparator.


+ 1

period as well as under large-signal transients.

bottom the equivalent current waveforms are shown.

**6. Simulation results** 

AVP technique.

Fig. 35. Steady-state waveforms under 115A load current. At the top the output voltage, at the bottom the equivalent current waveforms are shown.

Fig. 36. Dynamic response to a 0-120A load current step without the non-linear control. At the top the output voltage, at the bottom the equivalent current waveforms are shown.

Fig. 37. Dynamic response to a 120A-0 load current step without the non-linear control. At the top the output voltage, at the bottom the equivalent current waveforms are shown.

MATLAB Co-Simulation Tools for Power Supply Systems Design 185

(Boscaino et al., 2010). The high accuracy of the proposed design approach is here discussed by the comparison of simulation and experimental results. Experimental waveforms in Fig.40 show the system behaviour under 120A load current square-wave obtained by disabling the non-linear control (a), and by enabling the non-linear control (b). Ch1 shows the output voltage (200mV/div), Ch3 shows the master module inductor current (10A/div)

The great potential of the proposed design approach relies in the performance evaluation of the designed controller. Under load transients, the recovery time as well as the percentage of drop reduction due to the non linear control accurately matches experimental results. The system behaviour is perfectly matched by simulation results. Evaluating system performances by simulation or experimental results leads to the same conclusions. A detail of Fig.40 under the rising edge of the load current square wave is shown in Fig.41: (a) the linear controller response, (b) the non-linear controller response. As shown by experimental results, under the load current rising-edge, the under-shoot of the output voltage is reduced

A detail of Fig.40 under the falling edge of the load current square wave is shown in Fig.42: at the left the linear controller response, at the right the non-linear controller response. By comparing experimental waveforms in Fig.42 the output voltage over-shoot under a load current falling edge is reduced by 28%. Under both transients, the recovery time is reduced by 25%.

(a)

(b)

Fig. 40. System behaviour under a 115A width load current square wave. Ch1 shows the output voltage (200mV/div), Ch3 shows the master module inductor current (10A/div) and Ch4 shows the load current (60A/div). (a) The non-linear control is disabled. (b) The non-

and Ch4 shows the load current (60A/div).

by 29%.

linear controller is enabled.

Fig.38 and 39 show the dynamic response to a 0-120A and 120A-0 load current step, respectively, obtained by enabling the non-linear controller.

Fig. 38. Dynamic response to a 0-120A load current step with the non-linear control. At the top, the output voltage. At the top the output voltage, at the bottom the equivalent current waveforms are shown.

Fig. 39. Dynamic response to a 120A-0 load current step with the non-linear control. At the top the output voltage, at the bottom the equivalent current waveforms are shown.

As shown by simulation results, the non linear controller ensures a reduction of the output voltage over- and-under-shoots during large-signal transients. Under the rising edge of the load current step, the output voltage under-shoot is reduced by 22%. Under the falling edge of the load current step, the output voltage over-shoot is reduced by 26%. The recovery time is reduced by 24%. The instantaneous output voltage change due to the capacitor ESR is included. Note that the instantaneous drop is not affected by the non-linear control.

#### **7. Experimental results**

A laboratory prototype has been realized to test the efficiency of the non-linear control algorithm. Experimental validation of the non linear control algorithm has been proposed in

Fig.38 and 39 show the dynamic response to a 0-120A and 120A-0 load current step,

Fig. 38. Dynamic response to a 0-120A load current step with the non-linear control. At the top, the output voltage. At the top the output voltage, at the bottom the equivalent current

Fig. 39. Dynamic response to a 120A-0 load current step with the non-linear control. At the

As shown by simulation results, the non linear controller ensures a reduction of the output voltage over- and-under-shoots during large-signal transients. Under the rising edge of the load current step, the output voltage under-shoot is reduced by 22%. Under the falling edge of the load current step, the output voltage over-shoot is reduced by 26%. The recovery time is reduced by 24%. The instantaneous output voltage change due to the capacitor ESR is

A laboratory prototype has been realized to test the efficiency of the non-linear control algorithm. Experimental validation of the non linear control algorithm has been proposed in

top the output voltage, at the bottom the equivalent current waveforms are shown.

included. Note that the instantaneous drop is not affected by the non-linear control.

respectively, obtained by enabling the non-linear controller.

waveforms are shown.

**7. Experimental results** 

(Boscaino et al., 2010). The high accuracy of the proposed design approach is here discussed by the comparison of simulation and experimental results. Experimental waveforms in Fig.40 show the system behaviour under 120A load current square-wave obtained by disabling the non-linear control (a), and by enabling the non-linear control (b). Ch1 shows the output voltage (200mV/div), Ch3 shows the master module inductor current (10A/div) and Ch4 shows the load current (60A/div).

The great potential of the proposed design approach relies in the performance evaluation of the designed controller. Under load transients, the recovery time as well as the percentage of drop reduction due to the non linear control accurately matches experimental results. The system behaviour is perfectly matched by simulation results. Evaluating system performances by simulation or experimental results leads to the same conclusions. A detail of Fig.40 under the rising edge of the load current square wave is shown in Fig.41: (a) the linear controller response, (b) the non-linear controller response. As shown by experimental results, under the load current rising-edge, the under-shoot of the output voltage is reduced by 29%.

A detail of Fig.40 under the falling edge of the load current square wave is shown in Fig.42: at the left the linear controller response, at the right the non-linear controller response. By comparing experimental waveforms in Fig.42 the output voltage over-shoot under a load current falling edge is reduced by 28%. Under both transients, the recovery time is reduced by 25%.

Fig. 40. System behaviour under a 115A width load current square wave. Ch1 shows the output voltage (200mV/div), Ch3 shows the master module inductor current (10A/div) and Ch4 shows the load current (60A/div). (a) The non-linear control is disabled. (b) The nonlinear controller is enabled.

MATLAB Co-Simulation Tools for Power Supply Systems Design 187

tools. For the highest processing speed, a modelling technique for the power section is proposed. The digital subsystems are described by VHDL source code and verified by Aldec/Simulink co-simulation tool, allowing the test of the VHDL code and timing between separate entities. As an application, the model of a multiphase dc-dc converter for VRM applications is described. Thanks to the available co-simulation tool, all provided functions such as soft-start, protection algorithms for safe operation and adaptive voltage positioning are accurately modelled and verified during behavioural simulations. As shown by simulation results, the proposed model matches the system behaviour both within the switching period and during load transients. The design approach allows the designer to simulate the system behaviour as closely as possible to the effective behaviour, modelling and testing the "effective" controller. The controller performances are evaluated by simulation and experimental results leading to the same conclusions. Authors suggest the co-simulation tool for mixed-mode system and complex architectures. Actually, the IC implementation of the proposed controller in BCD6S technology is carried on. A central unit for signal processing is introduced. Mathematical operations are time-multiplexed in order to speed up the input-output delay in the control loop. The co-simulation tool is already

Authors would like to thank ST Microelectronics for supporting this research activity.

Vol.39, No. 12, (December 2008), pp. 1852-1859, ISSN:0026-2692.

*Motion,* ISBN: 978-142444987-3, Pisa, Italy, June 2010.

Science, ISBN 0-7923-7270-0, USA.

Basso, C. (2008). *Switch-mode Power Supplies*, McGraw Hill, ISBN 978-0-07-150859-0,

Boscaino, V., Livreri, P., Marino, F. & Minieri, M. (2008). Current-Sensing Technique for

Boscaino, V., Livreri, P., Marino, F. & Minieri, M. (2009). Linear-non-linear digital control for

Erickson, R. & Maksimovic, D. (2001). *Fundamentals of Power Electronics (2nd ed),* Springer

Kaichun, R. et al. (October 2010). Matlab Simulations for Power Factor Correction

Miftakhutdinov, R. (June 2001). Optimal Design of Interleaved Synchronous Buck Converter

*Conference,* ISBN 0-7803-7067-8, Vancouver, BC, Canada, June 2001.

*Energy Systems,* Vol.29, No.1, (March, 2009), pp. 38-47, ISSN: 10783466. Boscaino, V., Gaeta, Capponi, G. & M., Marino, F. (2010). Non-linear digital control

Current-Mode Controlled Voltage Regulator Modules. *Microelectronics Journal*,

dc/dc converters with fast transient response. *International Journal of Power and* 

improving transient response: Design and test on a multiphase VRM, *Proceedings of the International Symposium on Power Electronics, Electrical Drives, Automation and* 

of Switching Power, In: *Matlab -Modelling, Programming and Simulations*, Emilson Pereira Leite, pp. 151-170, Scyio, ISBN 978-953-307-125-1, Vukovar,

at High Slew-Rate Load Current Transients. IEEE *Power Electronics Specialists* 

used to test the efficiency of the implemented solution.

**9. Acknowledgements** 

**10. References** 

USA.

Croatia.

Fig. 41. System behaviour under the load current rising-edge. Ch1 shows the output voltage (50mV/div, AC coupling), Ch3 shows the master module inductor current (10A/div) and Ch4 shows the load current (60A/div). At the left, the non-linear control is disabled. At the right, the non-linear controller is enabled.

Fig. 42. System behaviour under the load current falling-edge. Ch1 shows the output voltage (50mV/div, AC coupling), Ch3 shows the master module inductor current (10A/div) and Ch4 shows the load current (60A/div). At the left, the non-linear control is disabled. At the right, the non-linear controller is enabled.

#### **8. Conclusion**

In this chapter, a high-accuracy design approach for power supply systems is proposed. Mixed-mode systems are modelled in Simulink environment using powerful co-simulation tools. For the highest processing speed, a modelling technique for the power section is proposed. The digital subsystems are described by VHDL source code and verified by Aldec/Simulink co-simulation tool, allowing the test of the VHDL code and timing between separate entities. As an application, the model of a multiphase dc-dc converter for VRM applications is described. Thanks to the available co-simulation tool, all provided functions such as soft-start, protection algorithms for safe operation and adaptive voltage positioning are accurately modelled and verified during behavioural simulations. As shown by simulation results, the proposed model matches the system behaviour both within the switching period and during load transients. The design approach allows the designer to simulate the system behaviour as closely as possible to the effective behaviour, modelling and testing the "effective" controller. The controller performances are evaluated by simulation and experimental results leading to the same conclusions. Authors suggest the co-simulation tool for mixed-mode system and complex architectures. Actually, the IC implementation of the proposed controller in BCD6S technology is carried on. A central unit for signal processing is introduced. Mathematical operations are time-multiplexed in order to speed up the input-output delay in the control loop. The co-simulation tool is already used to test the efficiency of the implemented solution.

#### **9. Acknowledgements**

Authors would like to thank ST Microelectronics for supporting this research activity.

#### **10. References**

186 MATLAB for Engineers – Applications in Control, Electrical Engineering, IT and Robotics

(a)

(b)

Fig. 41. System behaviour under the load current rising-edge. Ch1 shows the output voltage (50mV/div, AC coupling), Ch3 shows the master module inductor current (10A/div) and Ch4 shows the load current (60A/div). At the left, the non-linear control is disabled. At the

Fig. 42. System behaviour under the load current falling-edge. Ch1 shows the output voltage (50mV/div, AC coupling), Ch3 shows the master module inductor current (10A/div) and Ch4 shows the load current (60A/div). At the left, the non-linear control is disabled. At the

In this chapter, a high-accuracy design approach for power supply systems is proposed. Mixed-mode systems are modelled in Simulink environment using powerful co-simulation

right, the non-linear controller is enabled.

right, the non-linear controller is enabled.

**8. Conclusion** 


**8** 

*Italy* 

**High Accuracy Modelling of** 

Valeria Boscaino and Giuseppe Capponi

This chapter proposes a modelling approach based on the PSIM/Simulink co-simulation toolbox for hybrid power supplies, featuring high accuracy. Hybrid source performances are fully tested during behavioural simulations. The importance of high-accuracy modelling is investigated and modelling guidelines for both power sources and load are given for further applications. The Simulink model is analyzed and the efficiency of the proposed approach is

In the last few years, hybrid power supplies are investigated for a wide variety of application areas: two primary sources are coupled to take advantages of both, overcoming their drawbacks. The growing interest in hybrid sources is mainly due to the spread of fuel cells. Fuel cells are renewable energy sources, fed by an external fuel and thus potentially infinite source of energy. The fuel cell supplies power until the fuel is supplied to, thus ensuring potentially infinite life cycle to each power load. Automotive, residential and portable electronics are only a few examples of fuel cells application areas. Powering a portable electronic device by a fuel cell is still a challenge for the scientific world. With the aid of fuel cells, the full portability is achieved: electronics devices could be recharged by simply replacing the fuel cartridge instead of being connected to the power grid. Further, fuel cells ensure the highest energy density allowing higher and higher device run time. Yet, portable devices feature a pulsed power consumption profile which depends on the user-selected function. The required peak power is usually higher and higher than the average power. Since the response of fuel cells to instantaneous power demands is relatively poor, innovative solutions are investigated to take full advantage from the fuel cell use. The goal is to couple the fuel cell with a high power density component. The instantaneous peak power is supplied by the high power density component while the average power is supplied by the fuel cell itself. Specific power management algorithms for active power sharing are required. Life-cycle and transient response are directly controlled thus leading to a close dependence of the power management control algorithms on the related application and power load. In the last few years, authors experienced the importance of accurate modelling of both power source and load to evaluate the system performances since the simulation step. The efficiency of power management algorithms is ensured by the high accuracy of source, power load and power

verified by the comparison between simulation and experimental results.

**1. Introduction** 

management system modelling.

**Hybrid Power Supplies** 

*University of Palermo* 


### **High Accuracy Modelling of Hybrid Power Supplies**

Valeria Boscaino and Giuseppe Capponi *University of Palermo Italy* 

#### **1. Introduction**

188 MATLAB for Engineers – Applications in Control, Electrical Engineering, IT and Robotics

Pop, O. & Lungu, S. (October 2010). Modelling of DC-DC Converters, In: *Matlab -Modelling,* 

Pressman, A. & Billings, K. (2009). *Switching Power Supply Design* (*3rd ed*.), McGraw Hill,

953-307-125-1, Vukovar, Croatia.

ISBN 978-0-07-148272-1, USA.

*Programming and Simulations*, Emilson Pereira Leite, pp. 125-150, Scyio, ISBN 978-

This chapter proposes a modelling approach based on the PSIM/Simulink co-simulation toolbox for hybrid power supplies, featuring high accuracy. Hybrid source performances are fully tested during behavioural simulations. The importance of high-accuracy modelling is investigated and modelling guidelines for both power sources and load are given for further applications. The Simulink model is analyzed and the efficiency of the proposed approach is verified by the comparison between simulation and experimental results.

In the last few years, hybrid power supplies are investigated for a wide variety of application areas: two primary sources are coupled to take advantages of both, overcoming their drawbacks. The growing interest in hybrid sources is mainly due to the spread of fuel cells.

Fuel cells are renewable energy sources, fed by an external fuel and thus potentially infinite source of energy. The fuel cell supplies power until the fuel is supplied to, thus ensuring potentially infinite life cycle to each power load. Automotive, residential and portable electronics are only a few examples of fuel cells application areas. Powering a portable electronic device by a fuel cell is still a challenge for the scientific world. With the aid of fuel cells, the full portability is achieved: electronics devices could be recharged by simply replacing the fuel cartridge instead of being connected to the power grid. Further, fuel cells ensure the highest energy density allowing higher and higher device run time. Yet, portable devices feature a pulsed power consumption profile which depends on the user-selected function. The required peak power is usually higher and higher than the average power. Since the response of fuel cells to instantaneous power demands is relatively poor, innovative solutions are investigated to take full advantage from the fuel cell use. The goal is to couple the fuel cell with a high power density component. The instantaneous peak power is supplied by the high power density component while the average power is supplied by the fuel cell itself. Specific power management algorithms for active power sharing are required. Life-cycle and transient response are directly controlled thus leading to a close dependence of the power management control algorithms on the related application and power load. In the last few years, authors experienced the importance of accurate modelling of both power source and load to evaluate the system performances since the simulation step. The efficiency of power management algorithms is ensured by the high accuracy of source, power load and power management system modelling.

High Accuracy Modelling of Hybrid Power Supplies 191

Simulink model and linked to the PSIM netlist file by the block parameter box. The *SimCoupler* block now behaviours as a Simulink subsystem showing input and output ports as specified in the corresponding PSIM schematic: the Simulink output nodes are the subsystem input ports and the Simulink input nodes are the subsystem output ports. The PSIM schematic is simulated as an integral part of the active Simulink model. The efficiency of the Simulink-based modelling technique is shown by the comparison between simulation

Hybrid power sources have received a great deal of attention in the last few years and they are considered the most promising source of energy for portable applications. Two basic sources are coupled: a high energy density and a high power density source. The goal is to optimize the power and energy performances of the composite power source. Each basic source supplies the load current under a specific working condition, as steady-state or transient, according to its own stand-alone performances. The high energy density source, i.e. fuel cell, supplies the load current under steady-state. Simultaneously, under a load transient the high power density component, i.e. battery or supercapacitor, supplies the load with the difference between the instantaneous and the steady-state load current. The controller is accurately designed to correctly manage the power flow between primary sources and load. If properly controlled, the hybrid source is neither influenced by the transient response of the high energy density source nor by the running time of the high power density source. If compared with stand-alone basic sources, the hybrid source shows

longer running time, faster transient response, higher power and energy density.

electronics, weapon systems, as well as for industrial applications.

as a battery charger, leading to a decrease in system cost and weight.

In literature, battery-ultracapacitor or fuel cell-battery power supply systems are presented (Gao &Dougal, 2003; Alotto et al., 2008). Coupling a battery and an ultracapacitor yields higher specific power than a battery-alone source and higher specific energy than an ultracapacitor-alone source. In the meantime higher running time is achieved. Research on battery/ultracapacitor hybrids has been actively carried out for electric vehicles, portable

In literature hybrids are classified in active and passive sources. Direct coupling is a passive hybrids feature while in active hybrids a DC-DC converter is interposed between the two basic sources. Several advantages are brought by the DC/DC converter. A detailed comparative analysis of a battery/supercapacitor hybrid in passive and active configuration is reported in (Gao & Dougal, 2003). The active hybrid configuration ensures an increase in power capability, a better regulation of the output voltage, a minimization of the current ripple and a reduction of the system weight and volume. If a capacitor based hybrid is considered, since the voltage of the two basic sources may be different, the capacitor array size could be designed independently of the other primary source. The DC-DC converter plays an important role in regulating the output voltage and making the voltage of the two basic sources independent of each other. The active hybrids ensure higher power capability than passive hybrids since the power sharing is directly controlled by the switching converter. Further, in active hybrids the output voltage is independent of the discharge curve of its stand-alone sources. In battery-based hybrids, the DC/DC converter can also act

Yet, all described hybrid systems are designed and tested with regular pulsed load, featuring a square wave current profile. The frequency and width of the current profile are

and experimental results.

**2. Hybrid power supply architectures** 

The choice of a powerful simulation environment is a key step for a successful conclusion of the overall design process. The power consumption profile of the specific load device should be deeply analyzed to ensure proper control algorithms. Load emulators best fit designers' requirements. During behavioural simulations, emulators allow the designer to virtually use the load device reproducing the effective power consumption profile. Hence, no assumptions are made on the load power consumption profile while designing the power management algorithms avoiding the risk of experimental failures.

Fuel cell modelling is a critical step since fuel cells are non linear devices whose performances are heavily affected by temperature, fuel pressure and voltage-current operating conditions. Since electro-chemical, physical and geometrical parameters are not readily available to applications engineers, a black-box approach is usually preferred to an analytical one. Both steady-state and dynamic behaviour should be accurately modelled in order to design an efficient power supply design. In this chapter, an accurate modelling approach is proposed.

As an application, a fuel cell – supercapacitor hybrid power supply for portable applications is designed and tested. The proposed system supplies a Digital Still Camera (DSC). Like any other portable device, the digital still camera behaviours as a pulsed load. Unlike the others, the power consumption profile features three possible standby modes (playback, photography and movie mode), each one requiring a specific average current value. The load power consumption profile is closely dependent on the user-selected function and thus unpredictable. Consequently, the DSC represents the worst-case portable device for hybrid power supply design and optimization. Note that accurate modelling is required for testing purposes only. Useful information about the DSC state is reproduced by sampling the supply voltage. The power load, a Fujifilm S5500 Digital Still Camera is modelled in Simulink environment with the aid of the *Stateflow* toolbox. A user-interactive interface is provided. During behavioural simulations, the designer is able to select a specific DSC function and the corresponding power consumption profile is emulated. The fuel cell is modelled in Simulink environment. The architecture and modelling technique is suitable for each fuel cell type and power level. The proposed fuel cell model has been implemented by authors in several simulation environments like PSIM, Simulink and PSPICE and further implementations are readily available in literature. Yet, authors suggest the Simulink implementation to achieve low-complexity, high accuracy and the highest processing speed. On the basis of the Simulink model, a FPGA-based fuel cell emulator has been realized. With the aid of the fuel cell emulator, preliminary tests could be performed saving hydrogen reserve. A circuit implementation of the analog controller in PSIM environment is proposed. PSIM by Powersim Inc. is a circuit simulation software oriented to power electronics systems. Furthermore, a Matlab/PSIM co-simulation tool allows behavioural simulation in a mixed environment. In the basic package, PSIM consists of two programs: PSIM Schematics, full-featured schematic-entry program and SIMVIEW, advanced waveforms viewer software. As soon as the PSIM schematic is built, the designer is able to start the co-simulation procedure. In PSIM Elements/Control Library, the *SimCoupler Module* is provided for Matlab/Simulink co-simulation. Simulink input and output nodes are available. The Simulink input nodes receive values from Simulink and behaviour as voltage sources while the output nodes send values to Simulink. Input and output nodes can be placed in the PSIM schematics according to co-simulation requirements. After generating the circuit netlist in PSIM environment, the PSIM procedure for system cosimulation is completed. In Simulink, the *SimCoupler* block can be added to the existing

The choice of a powerful simulation environment is a key step for a successful conclusion of the overall design process. The power consumption profile of the specific load device should be deeply analyzed to ensure proper control algorithms. Load emulators best fit designers' requirements. During behavioural simulations, emulators allow the designer to virtually use the load device reproducing the effective power consumption profile. Hence, no assumptions are made on the load power consumption profile while designing the power

Fuel cell modelling is a critical step since fuel cells are non linear devices whose performances are heavily affected by temperature, fuel pressure and voltage-current operating conditions. Since electro-chemical, physical and geometrical parameters are not readily available to applications engineers, a black-box approach is usually preferred to an analytical one. Both steady-state and dynamic behaviour should be accurately modelled in order to design an efficient power supply design. In this chapter, an accurate modelling

As an application, a fuel cell – supercapacitor hybrid power supply for portable applications is designed and tested. The proposed system supplies a Digital Still Camera (DSC). Like any other portable device, the digital still camera behaviours as a pulsed load. Unlike the others, the power consumption profile features three possible standby modes (playback, photography and movie mode), each one requiring a specific average current value. The load power consumption profile is closely dependent on the user-selected function and thus unpredictable. Consequently, the DSC represents the worst-case portable device for hybrid power supply design and optimization. Note that accurate modelling is required for testing purposes only. Useful information about the DSC state is reproduced by sampling the supply voltage. The power load, a Fujifilm S5500 Digital Still Camera is modelled in Simulink environment with the aid of the *Stateflow* toolbox. A user-interactive interface is provided. During behavioural simulations, the designer is able to select a specific DSC function and the corresponding power consumption profile is emulated. The fuel cell is modelled in Simulink environment. The architecture and modelling technique is suitable for each fuel cell type and power level. The proposed fuel cell model has been implemented by authors in several simulation environments like PSIM, Simulink and PSPICE and further implementations are readily available in literature. Yet, authors suggest the Simulink implementation to achieve low-complexity, high accuracy and the highest processing speed. On the basis of the Simulink model, a FPGA-based fuel cell emulator has been realized. With the aid of the fuel cell emulator, preliminary tests could be performed saving hydrogen reserve. A circuit implementation of the analog controller in PSIM environment is proposed. PSIM by Powersim Inc. is a circuit simulation software oriented to power electronics systems. Furthermore, a Matlab/PSIM co-simulation tool allows behavioural simulation in a mixed environment. In the basic package, PSIM consists of two programs: PSIM Schematics, full-featured schematic-entry program and SIMVIEW, advanced waveforms viewer software. As soon as the PSIM schematic is built, the designer is able to start the co-simulation procedure. In PSIM Elements/Control Library, the *SimCoupler Module* is provided for Matlab/Simulink co-simulation. Simulink input and output nodes are available. The Simulink input nodes receive values from Simulink and behaviour as voltage sources while the output nodes send values to Simulink. Input and output nodes can be placed in the PSIM schematics according to co-simulation requirements. After generating the circuit netlist in PSIM environment, the PSIM procedure for system cosimulation is completed. In Simulink, the *SimCoupler* block can be added to the existing

management algorithms avoiding the risk of experimental failures.

approach is proposed.

Simulink model and linked to the PSIM netlist file by the block parameter box. The *SimCoupler* block now behaviours as a Simulink subsystem showing input and output ports as specified in the corresponding PSIM schematic: the Simulink output nodes are the subsystem input ports and the Simulink input nodes are the subsystem output ports. The PSIM schematic is simulated as an integral part of the active Simulink model. The efficiency of the Simulink-based modelling technique is shown by the comparison between simulation and experimental results.

#### **2. Hybrid power supply architectures**

Hybrid power sources have received a great deal of attention in the last few years and they are considered the most promising source of energy for portable applications. Two basic sources are coupled: a high energy density and a high power density source. The goal is to optimize the power and energy performances of the composite power source. Each basic source supplies the load current under a specific working condition, as steady-state or transient, according to its own stand-alone performances. The high energy density source, i.e. fuel cell, supplies the load current under steady-state. Simultaneously, under a load transient the high power density component, i.e. battery or supercapacitor, supplies the load with the difference between the instantaneous and the steady-state load current. The controller is accurately designed to correctly manage the power flow between primary sources and load. If properly controlled, the hybrid source is neither influenced by the transient response of the high energy density source nor by the running time of the high power density source. If compared with stand-alone basic sources, the hybrid source shows longer running time, faster transient response, higher power and energy density.

In literature, battery-ultracapacitor or fuel cell-battery power supply systems are presented (Gao &Dougal, 2003; Alotto et al., 2008). Coupling a battery and an ultracapacitor yields higher specific power than a battery-alone source and higher specific energy than an ultracapacitor-alone source. In the meantime higher running time is achieved. Research on battery/ultracapacitor hybrids has been actively carried out for electric vehicles, portable electronics, weapon systems, as well as for industrial applications.

In literature hybrids are classified in active and passive sources. Direct coupling is a passive hybrids feature while in active hybrids a DC-DC converter is interposed between the two basic sources. Several advantages are brought by the DC/DC converter. A detailed comparative analysis of a battery/supercapacitor hybrid in passive and active configuration is reported in (Gao & Dougal, 2003). The active hybrid configuration ensures an increase in power capability, a better regulation of the output voltage, a minimization of the current ripple and a reduction of the system weight and volume. If a capacitor based hybrid is considered, since the voltage of the two basic sources may be different, the capacitor array size could be designed independently of the other primary source. The DC-DC converter plays an important role in regulating the output voltage and making the voltage of the two basic sources independent of each other. The active hybrids ensure higher power capability than passive hybrids since the power sharing is directly controlled by the switching converter. Further, in active hybrids the output voltage is independent of the discharge curve of its stand-alone sources. In battery-based hybrids, the DC/DC converter can also act as a battery charger, leading to a decrease in system cost and weight.

Yet, all described hybrid systems are designed and tested with regular pulsed load, featuring a square wave current profile. The frequency and width of the current profile are

High Accuracy Modelling of Hybrid Power Supplies 193

closely related to the actual mode: 180mA for playback mode, 330mA for photography mode and 440mA for movie mode. Each available function requires a pulsed current over the entire function run time. The load current profile under turning-on in playback mode is shown at the left in Fig.1. At the end of function transient, the required load current is strictly constant at 180mA. Yet, during the transient, the peak current reaches 486mA and the run time is equal to 1.24s. The load current profile under the zoom function in playback mode is shown at the right in Fig.1. The transient time is equal to 88.4ms and the peak current reaches 351mA. The average current value over the function transient time is equal to 269mA. If compared with turning-on in playback mode, the transient time is quite short and the peak current value is quite similar to the average current value. Hence, the zoom

Fig. 1. At the left, the DSC current profile under turning-on in playback mode (100mA/div) is shown. Time base is set to 200ms/div. At the right, the DSC current profile under zoom

The load current profile under turning-on the DSC in photography mode is shown at the left in Fig.2. At the end of transient the current is constant at 330mA which is the standby current of the photography mode. Yet, under function running, the load current reaches a 611mA peak value and the transient time is equal to 4.6s. The load current profile required for taking picture without flash is shown at the right in Fig.2. The transient time is equal to 2.9s. The peak current value is equal to 716mA and the average current over the transient time is equal to 443mA. The load current under movie mode selection is shown at the left in

(100mA/div) is shown. Time base is set to 500ms/div. At the right, the DSC current profile under taking picture without flash (100mA/div) is shown. Time base is set at 500ms/div.

Fig. 2. At the left, the DSC current profile under turning-on in photography mode

function in playback mode (100mA/div) is shown. Time base is set at 20ms/div.

function is not critical for the hybrid power supply.

usually assumed as design ratings by control algorithms, even if these assumptions are not verified by commercial devices. If tested with commercial devices, these algorithms would lead to an accidental turning-off or alternatively to a weak optimization of the hybrid power source in terms of both running time and power capability. A fuel cell/supercapacitor active hybrid system supplying a digital still camera is presented. A buck converter is interposed between the primary sources. The specific load device affects system ratings and the architecture of the hybrid source but not the control algorithm. Even under stress, an accidental turning-off is avoided. A high-accuracy model is proposed for both power sources and load. The importance of modelling is confirmed by the comparison between simulation and experimental results.

#### **3. The importance of measurements**

The importance of accurate modelling is extensively analyzed in literature. A detailed analysis of several modelling techniques is reported in (Liu, 1993). Measurement-based models are here proposed for both power source and load. Critical features are accurately highlighted and characterized by well-defined measurements. Designers accurately plan the measurement stage to achieve the best accuracy as well as the lowest complexity. Since the modelling approach can be efficiently applied to other devices, performed measurements are described for further applications. The model accuracy is closely related to the experimental setup. The goal is to minimize the difference between the experimental and simulated response to the same input which is usually referred to as the model error. The least the model error, the more efficient the model is. Under ideal conditions, the error is null and the model perfectly matches the effective behaviour of the device under test (DUT). A source of error relies in the model architecture. For example, a highly non-linear device is usually modelled by a linear model leading to an intrinsic source of error. Further, the model error is affected by the accuracy of measures since the model parameters are estimated from a finite and noisy data set. The proposed models are based on high-accuracy measurements and a non-linear model is proposed despite of the model complexity. Tunable parameters are provided for further applications.

#### **3.1 Measurements on the load device**

The digital camera behaviours as a pulsed load whose power consumption profile highlights two critical features: the power consumption profile is unpredictable since it depends on the user-selected function and the peak power is usually higher and higher than the average power drawn by the power supply. The power source life cycle and fuel consumption as well as the tolerance window on the output voltage are only a few performance indicators of the hybrid power supply. Hence, a complete analysis is performed to identify critical working conditions. The goal is to reproduce the power consumption profile of the load device and its correlation with the running function. The proposed model allows the designer to virtually use the digital camera during behavioural simulations. The designer is able to select a function obtaining the required consumption profile. The supply current of the digital camera has been monitored under function running. Experimental data are stored in look-up-tables and included in the Simulink model. Samples of measures are here discussed. The DSC features three stand-by modes of operation playback, photography and movie mode. Each mode can be maintained indefinitely active even if no function is running. The standby current is constant and

usually assumed as design ratings by control algorithms, even if these assumptions are not verified by commercial devices. If tested with commercial devices, these algorithms would lead to an accidental turning-off or alternatively to a weak optimization of the hybrid power source in terms of both running time and power capability. A fuel cell/supercapacitor active hybrid system supplying a digital still camera is presented. A buck converter is interposed between the primary sources. The specific load device affects system ratings and the architecture of the hybrid source but not the control algorithm. Even under stress, an accidental turning-off is avoided. A high-accuracy model is proposed for both power sources and load. The importance of modelling is confirmed by the comparison between

The importance of accurate modelling is extensively analyzed in literature. A detailed analysis of several modelling techniques is reported in (Liu, 1993). Measurement-based models are here proposed for both power source and load. Critical features are accurately highlighted and characterized by well-defined measurements. Designers accurately plan the measurement stage to achieve the best accuracy as well as the lowest complexity. Since the modelling approach can be efficiently applied to other devices, performed measurements are described for further applications. The model accuracy is closely related to the experimental setup. The goal is to minimize the difference between the experimental and simulated response to the same input which is usually referred to as the model error. The least the model error, the more efficient the model is. Under ideal conditions, the error is null and the model perfectly matches the effective behaviour of the device under test (DUT). A source of error relies in the model architecture. For example, a highly non-linear device is usually modelled by a linear model leading to an intrinsic source of error. Further, the model error is affected by the accuracy of measures since the model parameters are estimated from a finite and noisy data set. The proposed models are based on high-accuracy measurements and a non-linear model is proposed despite of the model complexity.

The digital camera behaviours as a pulsed load whose power consumption profile highlights two critical features: the power consumption profile is unpredictable since it depends on the user-selected function and the peak power is usually higher and higher than the average power drawn by the power supply. The power source life cycle and fuel consumption as well as the tolerance window on the output voltage are only a few performance indicators of the hybrid power supply. Hence, a complete analysis is performed to identify critical working conditions. The goal is to reproduce the power consumption profile of the load device and its correlation with the running function. The proposed model allows the designer to virtually use the digital camera during behavioural simulations. The designer is able to select a function obtaining the required consumption profile. The supply current of the digital camera has been monitored under function running. Experimental data are stored in look-up-tables and included in the Simulink model. Samples of measures are here discussed. The DSC features three stand-by modes of operation playback, photography and movie mode. Each mode can be maintained indefinitely active even if no function is running. The standby current is constant and

simulation and experimental results.

**3. The importance of measurements** 

Tunable parameters are provided for further applications.

**3.1 Measurements on the load device** 

closely related to the actual mode: 180mA for playback mode, 330mA for photography mode and 440mA for movie mode. Each available function requires a pulsed current over the entire function run time. The load current profile under turning-on in playback mode is shown at the left in Fig.1. At the end of function transient, the required load current is strictly constant at 180mA. Yet, during the transient, the peak current reaches 486mA and the run time is equal to 1.24s. The load current profile under the zoom function in playback mode is shown at the right in Fig.1. The transient time is equal to 88.4ms and the peak current reaches 351mA. The average current value over the function transient time is equal to 269mA. If compared with turning-on in playback mode, the transient time is quite short and the peak current value is quite similar to the average current value. Hence, the zoom function is not critical for the hybrid power supply.

Fig. 1. At the left, the DSC current profile under turning-on in playback mode (100mA/div) is shown. Time base is set to 200ms/div. At the right, the DSC current profile under zoom function in playback mode (100mA/div) is shown. Time base is set at 20ms/div.

The load current profile under turning-on the DSC in photography mode is shown at the left in Fig.2. At the end of transient the current is constant at 330mA which is the standby current of the photography mode. Yet, under function running, the load current reaches a 611mA peak value and the transient time is equal to 4.6s. The load current profile required for taking picture without flash is shown at the right in Fig.2. The transient time is equal to 2.9s. The peak current value is equal to 716mA and the average current over the transient time is equal to 443mA. The load current under movie mode selection is shown at the left in

Fig. 2. At the left, the DSC current profile under turning-on in photography mode (100mA/div) is shown. Time base is set to 500ms/div. At the right, the DSC current profile under taking picture without flash (100mA/div) is shown. Time base is set at 500ms/div.

High Accuracy Modelling of Hybrid Power Supplies 195

transfer function by a dynamic admittance which is connected in parallel with the steady-state model. The equivalent resistance of the steady-state model is then connected in parallel to the dynamic impedance. If the operating condition changes, the equivalent resistance of the steady-state model changes and the model is able to fit the dynamic behaviour of the stack under test. Experimental results validate the modelling technique. For further details, please refer to (Boscaino et al., 2009b). The Bode plot of the impedance magnitude is shown in Fig.5. On y-axis a linear scale is used. Since the system square wave response analysis shows no time constant lower than 1µsec, the magnitude of the transfer function is assumed constant for high

frequency values.

Fig. 4. Average iso-thermal steady-state curves.

Fig. 5. Bode plot of the impedance magnitude.

Measurements are performed up to 200kHz. Temperature effects on the fuel cell performance are included in the fuel cell model. Further, the model reproduces the stack temperature as a

Fig.3. The peak current value is equal to 669mA and the transient time is equal to 430ms. At the right, the load current under the zoom function in movie mode is shown. The transient time is 630ms long and the current reaches a 691mA peak value. Only a few examples are shown. The load current profile of each available function is monitored and collected data are stored to be used in the DSC model. Critical functions for the hybrid power supplies are identified by the transient time and the current peak value. The worst-case function features the highest current peak value and the longest transient time. The power management system should prevent an excessive supercapacitor discharge under the worst-case.

Fig. 3. At the left, the DSC current profile under the transition from photography to movie mode (100mA/div) is shown. Time base is set to 100ms/div. At the right, the DSC current profile under zoom function in movie mode (100mA/div) is shown. Time base is set at 100ms/div.

#### **3.2 Measurements on the fuel cell**

A measurement-based fuel cell model is proposed. The model matches the steady-state and dynamic behaviour of the stack under test, including temperature effects. The stack is accurately characterized to achieve high-accuracy. Even if a 10W, 9V Proton Exchange Membrane (PEM) fuel cell stack is tested, the model can be efficiently applied to each fuel cell type and power level. Steady-state measurements are performed. Iso-thermal steady-state V-I curves are measured at several temperature values ranging from 20°C to 40°C by 5°C step. Experimental data are collected and averaged over multiple measures. Average iso-thermal steady-state curves are plotted in Fig.4. A current limit is shown for each steady-state curve. If the fuel cell current overcomes the limit a flooding event occurs: hydrogen is not enough to produce the required current. Hence, water is sucked into the stack obstructing the membrane pores. A flooding event leads to an instantaneous voltage drop and the device is immediately turned-off. The limit is a function of the operating temperature since the reaction speed increase with increasing temperature. The fuel cell current is directly controlled by the power management system avoiding the flooding risk. The frequency response analysis is performed to model the dynamic behaviour of the stack under test. The impedance function is measured under linear conditions. A sinusoidal current is forced and the magnitude of the sinusoidal voltage is measured. The stack non-linearity is neglected while measuring the transfer function. Non-linear effects of operating temperature are neglected by performing measurements at a fixed temperature value of 30°C. Further, the steady-state curve nonlinearity is neglected by a small-signal approximation. The average current value is fixed at 600mA and a sinusoidal signal of 200mAp-p is forced. In the fixed current region, at 30°C, the non-linearity of the steady-stare curve could be neglected. The goal is to model the impedance

Fig.3. The peak current value is equal to 669mA and the transient time is equal to 430ms. At the right, the load current under the zoom function in movie mode is shown. The transient time is 630ms long and the current reaches a 691mA peak value. Only a few examples are shown. The load current profile of each available function is monitored and collected data are stored to be used in the DSC model. Critical functions for the hybrid power supplies are identified by the transient time and the current peak value. The worst-case function features the highest current peak value and the longest transient time. The power management

system should prevent an excessive supercapacitor discharge under the worst-case.

 Fig. 3. At the left, the DSC current profile under the transition from photography to movie mode (100mA/div) is shown. Time base is set to 100ms/div. At the right, the DSC current profile under zoom function in movie mode (100mA/div) is shown. Time base is set at

A measurement-based fuel cell model is proposed. The model matches the steady-state and dynamic behaviour of the stack under test, including temperature effects. The stack is accurately characterized to achieve high-accuracy. Even if a 10W, 9V Proton Exchange Membrane (PEM) fuel cell stack is tested, the model can be efficiently applied to each fuel cell type and power level. Steady-state measurements are performed. Iso-thermal steady-state V-I curves are measured at several temperature values ranging from 20°C to 40°C by 5°C step. Experimental data are collected and averaged over multiple measures. Average iso-thermal steady-state curves are plotted in Fig.4. A current limit is shown for each steady-state curve. If the fuel cell current overcomes the limit a flooding event occurs: hydrogen is not enough to produce the required current. Hence, water is sucked into the stack obstructing the membrane pores. A flooding event leads to an instantaneous voltage drop and the device is immediately turned-off. The limit is a function of the operating temperature since the reaction speed increase with increasing temperature. The fuel cell current is directly controlled by the power management system avoiding the flooding risk. The frequency response analysis is performed to model the dynamic behaviour of the stack under test. The impedance function is measured under linear conditions. A sinusoidal current is forced and the magnitude of the sinusoidal voltage is measured. The stack non-linearity is neglected while measuring the transfer function. Non-linear effects of operating temperature are neglected by performing measurements at a fixed temperature value of 30°C. Further, the steady-state curve nonlinearity is neglected by a small-signal approximation. The average current value is fixed at 600mA and a sinusoidal signal of 200mAp-p is forced. In the fixed current region, at 30°C, the non-linearity of the steady-stare curve could be neglected. The goal is to model the impedance

100ms/div.

**3.2 Measurements on the fuel cell** 

transfer function by a dynamic admittance which is connected in parallel with the steady-state model. The equivalent resistance of the steady-state model is then connected in parallel to the dynamic impedance. If the operating condition changes, the equivalent resistance of the steady-state model changes and the model is able to fit the dynamic behaviour of the stack under test. Experimental results validate the modelling technique. For further details, please refer to (Boscaino et al., 2009b). The Bode plot of the impedance magnitude is shown in Fig.5. On y-axis a linear scale is used. Since the system square wave response analysis shows no time constant lower than 1µsec, the magnitude of the transfer function is assumed constant for high frequency values.

Fig. 4. Average iso-thermal steady-state curves.

Fig. 5. Bode plot of the impedance magnitude.

Measurements are performed up to 200kHz. Temperature effects on the fuel cell performance are included in the fuel cell model. Further, the model reproduces the stack temperature as a

High Accuracy Modelling of Hybrid Power Supplies 197

analysis in Simulink environment too, the output voltage is considered as a Simulink

The fuel cell model is shown in Fig.8. The stack voltage is generated as a function of the fuel cell current. The room temperature is introduced as an external parameter. The steady-state and dynamic sections are highlighted. The steady-state behaviour, including temperature effects, is modelled by the *Steady-state Section*. The dynamic section models the transient response by the means of an admittance which is connected in parallel to the steady-state model. Hence, the parallel connection is modelled by feeding the *Dynamic Section* by the output voltage and introducing a current node at the input of the *Steady-State Section*. By the means of data stores, the fuel cell voltage is stored as an output of the *Steady-State Section* and then read by the *Dynamic Section* as an input signal. The *Steady-State Current* is obtained

The steady-state section is modelled as shown in Fig.9. Note that the stack temperature is quite different from the room temperature. The room temperature is an external signal while the stack temperature is reproduced as a function of the fuel cell current by the temperature subsystem. The steady-state subsystem reproduces the stack voltage as a function of the fuel cell current *i* and the reconstructed temperature value *T*. The steadystate subsystem is modelled as shown in Fig.10. The steady-state voltage at a temperature *T*

FC Current 1

> FC Voltage 1

Data Store Write FC\_Voltage

> Stack Voltage 1

Steady -State Section

Stack Voltage

Steady -state Subsystem

Steady -state Current Room Temperature

Data Store Memory FC\_Voltage

Add

Room temperature 2

 V(i,T)=V(i,Tref)+c(i,T-Tref) (1) where *V(i,Tref)* is the steady-state voltage at a nominal temperature of 30°C under a current *i* and *c(i,T-Tref)* is the voltage correction term accounting for a temperature *T* which is

Temperature

Stack Voltage Room Temperature

Temperature

Steady -state Current

Temperature Subsystem

Steady -state Current

Room Temperature

by adding the *Dynamic Current* to the external fuel cell current.

Dynamic Section

Stack Voltage Dynamic Current

Output Node.

**4.1 The fuel cell model** 

Fig. 8. The fuel cell model.

Data Store Read FC\_Voltage

under a current *i* is given by:

different from the nominal one.

Steady -state Current 1

Fig. 9. The steady-state section model.

2

function of the fuel cell current. The thermal response of the fuel cell is monitored as shown in Fig.6. Thermal measurements are performed by monitoring the current profile and the corresponding temperature profile.

Fig. 6. At the top, the thermal response of the fuel cell stack. At the bottom, the corresponding current waveform.

#### **4. The simulink model**

A fuel cell – supercapacitor hybrid power supply is designed. The active hybrid source is modelled by a PSIM schematic as well as the power management control system. The primary source and the power load are modelled in Simulink environment. The top level model is shown in Fig.7. The *SimCoupler* block simulates the power management system implemented by a PSIM schematic which is fed by the fuel cell voltage and the load current signals and generates the output voltage of the hybrid supply.

Fig. 7. Hybrid power supply model.

The fuel cell current is sensed within the PSIM schematic. The fuel cell current signal feeds the fuel cell subsystem by the means of data stores. In order to enable the signal analysis in Simulink environment too, the output voltage is considered as a Simulink Output Node.

#### **4.1 The fuel cell model**

196 MATLAB for Engineers – Applications in Control, Electrical Engineering, IT and Robotics

function of the fuel cell current. The thermal response of the fuel cell is monitored as shown in Fig.6. Thermal measurements are performed by monitoring the current profile and the

Fig. 6. At the top, the thermal response of the fuel cell stack. At the bottom, the

FC Voltage

Load Current

signals and generates the output voltage of the hybrid supply.

FC Current

Room temperature

FC model

A fuel cell – supercapacitor hybrid power supply is designed. The active hybrid source is modelled by a PSIM schematic as well as the power management control system. The primary source and the power load are modelled in Simulink environment. The top level model is shown in Fig.7. The *SimCoupler* block simulates the power management system implemented by a PSIM schematic which is fed by the fuel cell voltage and the load current

The fuel cell current is sensed within the PSIM schematic. The fuel cell current signal feeds the fuel cell subsystem by the means of data stores. In order to enable the signal

DSC model FC\_current

SimCoupler PSIM Schematic

> Data Store Memory

Vout

Output Voltage

Data Store Write

FC\_current

IFC

LoadCurrent

VFC

corresponding temperature profile.

corresponding current waveform.

Fig. 7. Hybrid power supply model.

**4. The simulink model** 

Data Store Read

Constant 25

FC\_current

The fuel cell model is shown in Fig.8. The stack voltage is generated as a function of the fuel cell current. The room temperature is introduced as an external parameter. The steady-state and dynamic sections are highlighted. The steady-state behaviour, including temperature effects, is modelled by the *Steady-state Section*. The dynamic section models the transient response by the means of an admittance which is connected in parallel to the steady-state model. Hence, the parallel connection is modelled by feeding the *Dynamic Section* by the output voltage and introducing a current node at the input of the *Steady-State Section*. By the means of data stores, the fuel cell voltage is stored as an output of the *Steady-State Section* and then read by the *Dynamic Section* as an input signal. The *Steady-State Current* is obtained by adding the *Dynamic Current* to the external fuel cell current.

Fig. 8. The fuel cell model.

The steady-state section is modelled as shown in Fig.9. Note that the stack temperature is quite different from the room temperature. The room temperature is an external signal while the stack temperature is reproduced as a function of the fuel cell current by the temperature subsystem. The steady-state subsystem reproduces the stack voltage as a function of the fuel cell current *i* and the reconstructed temperature value *T*. The steadystate subsystem is modelled as shown in Fig.10. The steady-state voltage at a temperature *T* under a current *i* is given by:

$$\mathbf{V}(\mathbf{i}, \mathbf{T}) = \mathbf{V}(\mathbf{i}, \mathbf{T} \mathbf{r} \mathbf{e}) + \mathbf{c}(\mathbf{i}, \mathbf{T} \mathbf{-T} \mathbf{r} \mathbf{e}) \tag{1}$$

where *V(i,Tref)* is the steady-state voltage at a nominal temperature of 30°C under a current *i* and *c(i,T-Tref)* is the voltage correction term accounting for a temperature *T* which is different from the nominal one.

Fig. 9. The steady-state section model.

High Accuracy Modelling of Hybrid Power Supplies 199

The type of function is selected by the parameters box. The shift by 1 of the logarithmic argument is modelled by the *Bias* block. The shift constant is introduced by the block parameter box. Very complex functions, such as the logarithmic or exponential function are

> Math Function

B -K-

Math Function

ln

eu

Exp term 1

D -K-

Add1

Ln term 1

> Voltage Correction 1

The correction subsystem accounts for temperature effects. The subsystem is fed by the

According to (1) a set of average correction curves is obtained. If a point of the iso-thermal correction curve at the temperature *T* is selected, the x-axis coordinate equals the fuel cell current *i* and the y-axis coordinate the correction term *c(i,T-Tref)*. The correction subsystem is modelled by a bi-dimensional polynomial fitting of the average correction curves. A thirdorder polynomial is chosen for current-fitting while a fourth-order polynomial is chosen for temperature fitting. The correction curve at a temperature *T1* is fitted as a function of current

Product 3

Product 2

Product 1

�(�� ��) ����(��) � �� � ��(��) � �� � ��(��)������(��)��� (3)

stack temperature and the fuel cell steady-state current, as shown in Fig.13.

I^3 I^2 I

1/C -K-

> Bias u+1

readily implemented by elementary blocks.

Steady -state Current

1

Steady -state Current

1

Fig. 12. The exponential and logarithmic subsystems.

Coefficients Generator

Steady -state Current 2

3rd order coefficient

2nd order coefficient

1st order coefficient

Zero-order coefficient

1/E -K-

Fig. 13. The correction subsystem model.

Temperature

by the polynomial law:

Temperature 1

Fig. 10. The steady-state subsystem model.

The term *V(i,Tref)* is the output signal of the so-called I*so-thermal steady-state subsystem* while the correction term is generated by the *Correction subsystem*. No matter how many and which the involved physical, geometrical and chemical parameters are, the iso-thermal steady-state curve at the reference temperature is fitted by the law:

$$V(l, TFf) = A - B \cdot \ln\left(1 + \frac{l}{c}\right) - D \cdot e^{\frac{l}{E}} \tag{2}$$

where A,B,C,D,E are the iso-thermal steady-state model parameters. Model parameters are obtained by fitting the experimental data with the aid of the *Curve Fitting Tool* which is available in MATLAB environment. The *Iso-thermal steady-state subsystem* is shown in Fig.11. The subsystem is fed by the Steady-state current and reproduces the stack voltage at the reference temperature of 30°C. The A parameter is modelled by the *constant* block. Exponential and logarithmic terms are generated by the subsystems shown in Fig.12. According to (2), parameters B, C, D and E are modelled by proper *Gain* blocks which are introduced in the signal chain. The gain value is entered by the parameter box. Exponential and logarithmic functions are implemented by *Math Function* blocks which are readily available in the Simulink library browser.

Fig. 11. The iso-thermal steady-state subsystem model.

Voltage Correction

The term *V(i,Tref)* is the output signal of the so-called I*so-thermal steady-state subsystem* while the correction term is generated by the *Correction subsystem*. No matter how many and which the involved physical, geometrical and chemical parameters are, the iso-thermal

Iso-thermal Steady -state Subsystem

Steady -state Current Stack Voltage

Correction Subsystem

where A,B,C,D,E are the iso-thermal steady-state model parameters. Model parameters are obtained by fitting the experimental data with the aid of the *Curve Fitting Tool* which is available in MATLAB environment. The *Iso-thermal steady-state subsystem* is shown in Fig.11. The subsystem is fed by the Steady-state current and reproduces the stack voltage at the reference temperature of 30°C. The A parameter is modelled by the *constant* block. Exponential and logarithmic terms are generated by the subsystems shown in Fig.12. According to (2), parameters B, C, D and E are modelled by proper *Gain* blocks which are introduced in the signal chain. The gain value is entered by the parameter box. Exponential and logarithmic functions are implemented by *Math Function* blocks which are readily

Ln Subsystem

Exp Subsystem

Steady -state Current Exp term

Steady -state Current Ln term

�

A

����� �

� (2)

Stack Voltage 1

Add1

Stack Voltage 1

Add

�(�� ����) � � � � � �� �� � �

Fig. 10. The steady-state subsystem model.

Steady -state Current 2

Temperature 1

available in the Simulink library browser.

Steady -state Current 1

Fig. 11. The iso-thermal steady-state subsystem model.

steady-state curve at the reference temperature is fitted by the law:

Temperature

Steady -state Current

The type of function is selected by the parameters box. The shift by 1 of the logarithmic argument is modelled by the *Bias* block. The shift constant is introduced by the block parameter box. Very complex functions, such as the logarithmic or exponential function are readily implemented by elementary blocks.

Fig. 12. The exponential and logarithmic subsystems.

The correction subsystem accounts for temperature effects. The subsystem is fed by the stack temperature and the fuel cell steady-state current, as shown in Fig.13.

Fig. 13. The correction subsystem model.

According to (1) a set of average correction curves is obtained. If a point of the iso-thermal correction curve at the temperature *T* is selected, the x-axis coordinate equals the fuel cell current *i* and the y-axis coordinate the correction term *c(i,T-Tref)*. The correction subsystem is modelled by a bi-dimensional polynomial fitting of the average correction curves. A thirdorder polynomial is chosen for current-fitting while a fourth-order polynomial is chosen for temperature fitting. The correction curve at a temperature *T1* is fitted as a function of current by the polynomial law:

$$\mathcal{L}\{\mathbf{i}, T\_1\} = \mathcal{L}\_0\{T\_1\} \cdot \mathbf{i}^0 + \mathcal{L}\_1\{T\_1\} \cdot \mathbf{i}^1 + \mathcal{L}\_2\{T\_1\} \cdot \mathbf{i}^2 + \mathcal{L}\_3\{T\_1\} \cdot \mathbf{i}^3 \tag{3}$$

$$\begin{aligned} \mathcal{C}\_{0} &= \mathcal{C}\_{0,0} + \mathcal{C}\_{0,1} \left( T\_{1} - T\_{ref} \right) + \mathcal{C}\_{0,2} \left( T\_{1} - T\_{ref} \right)^{2} + \mathcal{C}\_{0,3} \left( T\_{1} - T\_{ref} \right)^{3} + \mathcal{C}\_{0,4} \left( T\_{1} - T\_{ref} \right)^{4} \\ \mathcal{C}\_{1} &= \mathcal{C}\_{1,0} + \mathcal{C}\_{1,1} \left( T\_{1} - T\_{ref} \right) + \mathcal{C}\_{1,2} \left( T\_{1} - T\_{ref} \right)^{2} + \mathcal{C}\_{1,3} \left( T\_{1} - T\_{ref} \right)^{3} + \mathcal{C}\_{1,4} \left( T\_{1} - T\_{ref} \right)^{4} \\ \mathcal{C}\_{2} &= \mathcal{C}\_{2,0} + \mathcal{C}\_{2,1} \left( T\_{1} - T\_{ref} \right) + \mathcal{C}\_{2,2} \left( T\_{1} - T\_{ref} \right)^{2} + \mathcal{C}\_{2,3} \left( T\_{1} - T\_{ref} \right)^{3} + \mathcal{C}\_{2,4} \left( T\_{1} - T\_{ref} \right)^{4} \\ \mathcal{C}\_{3} &= \mathcal{C}\_{3,0} + \mathcal{C}\_{3,1} \left( T\_{1} - T\_{ref} \right) + \mathcal{C}\_{3,2} \left( T\_{1} - T\_{ref} \right)^{2} + \mathcal{C}\_{3,3} \left( T\_{1} - T\_{ref} \right)^{3} + \mathcal{C}\_{3,4} \left( T\_{1} - T\_{ref} \right)^{4} \end{aligned} \tag{4}$$

$$a\frac{dT}{dt} = -(T - T\_{room}) + g \cdot i + d \cdot i^2 \tag{5}$$

$$T(t) = T\_0 \cdot e^{-\frac{t}{a}} + \frac{1}{a} \cdot e^{-\frac{t}{a}} \cdot \int\_0^t T\_{room}(t) \cdot e^{\frac{\tau}{a}} \cdot d\tau + \frac{g}{a} \cdot e^{-\frac{t}{a}} \cdot \int\_0^t l(\tau) \cdot e^{\frac{\tau}{a}} \cdot d\tau + \frac{1}{a} \cdot \int\_0^t e^{-\frac{t}{a}} \cdot l(\tau) \cdot e^{-\frac{\tau}{a}} \cdot d\tau$$

$$+ \frac{d}{a} \cdot e^{-\frac{t}{a}} \cdot \int\_0^t l^2(\tau) \cdot e^{\frac{\tau}{a}} \cdot d\tau \tag{6}$$

According to (5), the thermal response to a current step is given by:

$$T(t) = T\_0 + (T\_{room} - T\_0 + g \cdot I + d \cdot I^2) \left(1 - e^{-\frac{t}{a}}\right) \tag{7}$$

High Accuracy Modelling of Hybrid Power Supplies 203

by the *Stateflow* toolbox which is available in Simulink library browser. The model is based on a Fujifilm S5500 digital still camera. Main sections of the DSC model are highlighted in Fig.18: *User Interface*, *Mux* and *DSC subsystem.* Manual switches are included in the *User Interface* section. Each manual switch is labelled by a specific DSC function. By acting on a manual switch, the designer generates events for the state-machine thus running the corresponding function. Scalar events are collected by the *Mux* subsystem into *DSC subsystem* input vector. In the *DSC subsystem*, the state-machine and the output section are

The state-machine receives events and conditions. The event immediately triggers a state transition. Under the clock rising-edge conditions are verified thus enabling a state transition. Events and conditions are generated in the User-Interface subsystem as shown in

DSC subsystem

Mux

Events

Movie mode

Photography/ playback mode

Load Current 1

Load Current

Scope

Manual switches are collected within the subsystems. Take a look to the *Conditions* subsystem shown in Fig.20. Photography or playback mode is selected by double-clicking on the corresponding manual switch. A condition for the state-machine is generated by the manual switch. If the condition is true, corresponding to the logic value 1, the state-machine is driven toward the Photography Mode. Otherwise, the system is driven towards the Playback Mode. Even though events are generated instead of conditions, the Events subsystem features a similar architecture, as shown in Fig.21. End-user actions on the digital camera selector switch are marked as conditions while actions on buttons are marked as events. Each manual switch within the Events subsystems emulates a physical button of the digital camera under test. As shown Fig.22, the *DSC subsystem* is modelled by a state

modelled.

Fig.19.

Fig. 18. MATLAB/Simulink DSC model.

Movie mode

Turning on clock Zoom

User Interface

Photography/Playback mode

Taking picture/recording movie Viewing stored pictures Multiframe playback Bracketing Erasing frames Flash selection Play movie

diagram and an output section.

where I is the current step final value, Troom is the room temperature and To the initial temperature condition. A current step towards zero current leads to a thermal transient whose final value is the environment temperature Troom. According to (5), the thermal response to a current step towards zero current value is given by:

$$T(t) = T\_0 + (T\_{room} - T\_0) \left(1 - e^{-\frac{t}{a}}\right) \tag{8}$$

By fitting the thermal response to a current step towards zero value, the *a* parameter is obtained. The thermal response to the rising and falling-edge of a current step is monitored, obtaining *g* and *d* parameters.

As discussed, the dynamic subsystem models the impedance which is dynamically connected in parallel to the steady-state model. The approximated impedance transfer function is modelled by the *Transfer Function* library block, as shown in Fig.17. The dynamic voltage is obtained by subtracting the constant term of the steady-state model to the stack voltage. The dynamic current is generated by the transfer function block Y(s). The analysis of the model accuracy yields a maximum voltage error value of 0.2V, comparable to experimental data scattering. The thermal model error is limited to 1°C. Authors suggest (Boscaino et al., 2009b) for further details.

Fig. 17. The dynamic section model.

#### **4.2 The DSC model**

The load emulator is modelled in Simulink environment. Thanks to the powerful *Stateflow* toolbox a user-interactive model is implemented. During behavioural simulation, the designer is able to select a DSC function emulating the effective load device. The effective power consumption pattern corresponding to the actual user-selected function is generated by the load model. The designer is able to reproduce a random usage of the electronic load device.

No assumptions are made about the load current profile during behavioural simulations. System performances are already evaluated by computer simulations saving hydrogen reserve for preliminary tests and avoiding the risk of experimental fault conditions. The hybrid source life-cycle and fuel consumption could be tested as well as system stability and dynamic response.

The load device is modelled by a state machine: user-selections are modelled as events and the available functions are modelled as the finite states. The state-machine is implemented

�(�) � �� <sup>+</sup> (����� � �� +���+����) �� � ���

where I is the current step final value, Troom is the room temperature and To the initial temperature condition. A current step towards zero current leads to a thermal transient whose final value is the environment temperature Troom. According to (5), the thermal

�(�) � �� <sup>+</sup> (����� � ��) �� � ���

By fitting the thermal response to a current step towards zero value, the *a* parameter is obtained. The thermal response to the rising and falling-edge of a current step is monitored,

As discussed, the dynamic subsystem models the impedance which is dynamically connected in parallel to the steady-state model. The approximated impedance transfer function is modelled by the *Transfer Function* library block, as shown in Fig.17. The dynamic voltage is obtained by subtracting the constant term of the steady-state model to the stack voltage. The dynamic current is generated by the transfer function block Y(s). The analysis of the model accuracy yields a maximum voltage error value of 0.2V, comparable to experimental data scattering. The thermal model error is limited to 1°C. Authors suggest

The load emulator is modelled in Simulink environment. Thanks to the powerful *Stateflow* toolbox a user-interactive model is implemented. During behavioural simulation, the designer is able to select a DSC function emulating the effective load device. The effective power consumption pattern corresponding to the actual user-selected function is generated by the load model. The designer is able to reproduce a random usage of the

Add 1

No assumptions are made about the load current profile during behavioural simulations. System performances are already evaluated by computer simulations saving hydrogen reserve for preliminary tests and avoiding the risk of experimental fault conditions. The hybrid source life-cycle and fuel consumption could be tested as well as system stability and

The load device is modelled by a state machine: user-selections are modelled as events and the available functions are modelled as the finite states. The state-machine is implemented

�� (7)

�� (8)

Dynamic Current 1

Y(s)

num (s) den (s)

According to (5), the thermal response to a current step is given by:

response to a current step towards zero current value is given by:

obtaining *g* and *d* parameters.

(Boscaino et al., 2009b) for further details.

Fig. 17. The dynamic section model.

Constant A

Stack Voltage 1

**4.2 The DSC model** 

electronic load device.

dynamic response.

by the *Stateflow* toolbox which is available in Simulink library browser. The model is based on a Fujifilm S5500 digital still camera. Main sections of the DSC model are highlighted in Fig.18: *User Interface*, *Mux* and *DSC subsystem.* Manual switches are included in the *User Interface* section. Each manual switch is labelled by a specific DSC function. By acting on a manual switch, the designer generates events for the state-machine thus running the corresponding function. Scalar events are collected by the *Mux* subsystem into *DSC subsystem* input vector. In the *DSC subsystem*, the state-machine and the output section are modelled.

Fig. 18. MATLAB/Simulink DSC model.

The state-machine receives events and conditions. The event immediately triggers a state transition. Under the clock rising-edge conditions are verified thus enabling a state transition. Events and conditions are generated in the User-Interface subsystem as shown in Fig.19.

Manual switches are collected within the subsystems. Take a look to the *Conditions* subsystem shown in Fig.20. Photography or playback mode is selected by double-clicking on the corresponding manual switch. A condition for the state-machine is generated by the manual switch. If the condition is true, corresponding to the logic value 1, the state-machine is driven toward the Photography Mode. Otherwise, the system is driven towards the Playback Mode. Even though events are generated instead of conditions, the Events subsystem features a similar architecture, as shown in Fig.21. End-user actions on the digital camera selector switch are marked as conditions while actions on buttons are marked as events. Each manual switch within the Events subsystems emulates a physical button of the digital camera under test. As shown Fig.22, the *DSC subsystem* is modelled by a state diagram and an output section.

High Accuracy Modelling of Hybrid Power Supplies 205

Movie Playback 10

play Movie 0

Take pictures / Record movies 4

Shutter Button Select miniature

1

CLOCK


1

Output Selector

Output Section

State Machine Output Signals

Erase frame 8

> Load Current 1

Out1

Miniature 6

clock 2

Erase frame 1

Flash 9

Select flash

out

en1

en2

en3

Mux

en4

en5

A set of look-up tables (LUT) is included in the output section, as shown in Fig.23. Each LUT stores the current profile of a DSC function. The state diagram generates five control signals which are multiplexed in a control vector by the *Mux* block. In the output section, a decoder is fed by the control vector and generates the enable signals for LUTs. Only one enable signal at once is active. If a function is selected by user, the corresponding state in the state diagram is active and then the corresponding LUT in the output section is enabled and

Fig. 21. Events.

0

1

0

1

View pictures

BRACKETING

Events 1

T/W Zoom

Power -Switch

1

0

1

0

Bracketing 7

0

0

1

1

1

0

Viewing Stored Pictures 5

Zoom 3

Turning -on 1

Fig. 22. The DSC subsystem.

Filmato

Movie mode 3

Phorography / playback mode 2

mod

State Machine

Fig. 19. The user-interface subsystem.

Fig. 20. Conditions.

Fig. 21. Events.

Multiframe playback 6

Conditions

Photo/Playback mode

Movie mode

Taking picture / recording movie

4

Movie mode 12

Photography / Playback mode

11

Fig. 19. The user-interface subsystem.

Events

Take pictures/ Record movies

Viewing Stored Pictures

Play movie 10 Flash selection 9 Erasing frames 8 Bracketing 7

Viewing stored pictures

5

Zoom 3 clock 2 Turning on 1

Turning-on

clock

Zoom

Miniature

Bracketing

Erase frame

Movie Playback

Flash

Fig. 20. Conditions.

Fig. 22. The DSC subsystem.

A set of look-up tables (LUT) is included in the output section, as shown in Fig.23. Each LUT stores the current profile of a DSC function. The state diagram generates five control signals which are multiplexed in a control vector by the *Mux* block. In the output section, a decoder is fed by the control vector and generates the enable signals for LUTs. Only one enable signal at once is active. If a function is selected by user, the corresponding state in the state diagram is active and then the corresponding LUT in the output section is enabled and

High Accuracy Modelling of Hybrid Power Supplies 207

The active hybrid source and the power management system are modelled in PSIM environment. The stack current is directly controlled to improve dynamic performances. The fuel cell load is levelled by the power management system. The supercapacitor meets the load transient power demand, required for each function running while the fuel cell supplies the standby current of each available mode of the digital camera: playback, photography and movie mode. The equivalent fuel cell load is rather constant except for mode transitions of the DSC. Since the standby current required by the DSC depends on the selected mode of operation, a multiple steady-state control is applied. The fuel cell current is limited to the required stand-by current. Hence, the information about the actual DSC mode is required by the control system. The information is derived by a digital subsystem by

Fig.26 shows the PSIM top level model. The DC-DC converter and supercapacitor bank are included in the *Hybrid Source* subsystem. The *Control System* is fed by the output voltage and the current sense signal. The output of the controller feeds the *Driver* subsystem which drives the synchronous buck MOSFETs. The Simulink model of the fuel cell reproduces the fuel cell voltage by sampling the fuel cell instantaneous current. In PSIM circuit, the fuel cell voltage is considered an input node from Simulink while the fuel cell current signal is an input signal for the Simulink model. Since Simulink input and output nodes behaviour as voltage sources, the fuel cell current is converted to a voltage signal by a current controlled voltage source which is included in the *Hybrid source* subsystem. The DSC model reproduces the current profile corresponding to the user-selected function. The load current signal is thus obtained by the *Load Current* Simulink input node. Since Simulink input nodes behaviour as voltage sources in PSIM schematics, the signal is converted to a current signal

monitoring the output voltage and comparing the last few samples.

by the means of a voltage controlled current source.

Fig. 25. The ON state architecture.

**4.3 PSIM schematic** 

sequentially read. The output bus is connected to the active LUT output by the multiport switch which is driven by the output selector signal.

Fig. 23. The output section.

The state machine is modelled by the Stateflow toolbox. Only one state at once is enabled. Three standby modes of operation are available: playback, photography and movie mode. Each one could be maintained indefinitely active even if no function is selected by user. Each mode allows the user to select a limited number of functions. For example, under photography mode taking picture, bracketing, taking picture with flash are available while stored pictures could be viewed if the DSC is in playback mode only. Then, the state machine is intrinsically hierarchical. Fig.24 shows a schematic block diagram of the state machine. Under system start-up, the DSC is driven towards the OFF state by the default transition. No function is available in the OFF state and the output current is null. By double-clicking on the power switch button, the on\_switch event is generated and the DSC is driven towards the ON state. The ON-state architecture is shown in Fig.25. Within the ON state, a decision point is set. The position of the mode selector enables playback or photography mode. Note that for the DSC under test, the movie mode is selected by acting on two manual selectors: the first is set on photography mode and the latter selects movie mode. The model reflects the operation of the DSC under test. Within each state, available functions are modelled as states. Authors suggest (Boscaino et al., 2008) for further details.

Fig. 24. A schematic block diagram of the DSC state machine.

sequentially read. The output bus is connected to the active LUT output by the multiport

The state machine is modelled by the Stateflow toolbox. Only one state at once is enabled. Three standby modes of operation are available: playback, photography and movie mode. Each one could be maintained indefinitely active even if no function is selected by user. Each mode allows the user to select a limited number of functions. For example, under photography mode taking picture, bracketing, taking picture with flash are available while stored pictures could be viewed if the DSC is in playback mode only. Then, the state machine is intrinsically hierarchical. Fig.24 shows a schematic block diagram of the state machine. Under system start-up, the DSC is driven towards the OFF state by the default transition. No function is available in the OFF state and the output current is null. By double-clicking on the power switch button, the on\_switch event is generated and the DSC is driven towards the ON state. The ON-state architecture is shown in Fig.25. Within the ON state, a decision point is set. The position of the mode selector enables playback or photography mode. Note that for the DSC under test, the movie mode is selected by acting on two manual selectors: the first is set on photography mode and the latter selects movie mode. The model reflects the operation of the DSC under test. Within each state, available functions are modelled as states. Authors suggest (Boscaino et al., 2008) for further details.

switch which is driven by the output selector signal.

Fig. 24. A schematic block diagram of the DSC state machine.

Fig. 23. The output section.

Fig. 25. The ON state architecture.

#### **4.3 PSIM schematic**

The active hybrid source and the power management system are modelled in PSIM environment. The stack current is directly controlled to improve dynamic performances. The fuel cell load is levelled by the power management system. The supercapacitor meets the load transient power demand, required for each function running while the fuel cell supplies the standby current of each available mode of the digital camera: playback, photography and movie mode. The equivalent fuel cell load is rather constant except for mode transitions of the DSC. Since the standby current required by the DSC depends on the selected mode of operation, a multiple steady-state control is applied. The fuel cell current is limited to the required stand-by current. Hence, the information about the actual DSC mode is required by the control system. The information is derived by a digital subsystem by monitoring the output voltage and comparing the last few samples.

Fig.26 shows the PSIM top level model. The DC-DC converter and supercapacitor bank are included in the *Hybrid Source* subsystem. The *Control System* is fed by the output voltage and the current sense signal. The output of the controller feeds the *Driver* subsystem which drives the synchronous buck MOSFETs. The Simulink model of the fuel cell reproduces the fuel cell voltage by sampling the fuel cell instantaneous current. In PSIM circuit, the fuel cell voltage is considered an input node from Simulink while the fuel cell current signal is an input signal for the Simulink model. Since Simulink input and output nodes behaviour as voltage sources, the fuel cell current is converted to a voltage signal by a current controlled voltage source which is included in the *Hybrid source* subsystem. The DSC model reproduces the current profile corresponding to the user-selected function. The load current signal is thus obtained by the *Load Current* Simulink input node. Since Simulink input nodes behaviour as voltage sources in PSIM schematics, the signal is converted to a current signal by the means of a voltage controlled current source.

High Accuracy Modelling of Hybrid Power Supplies 209

The output current signal is obtained by a voltage controlled current source connected in parallel to the output resistance of the OTA. The compensation action is implemented by the RfCf network. Under steady-state condition, the inductor current is below the current limit and hence the cathode node of the diode D is tied to high-level. The diode D is turned-off. Under load transients, the inductor current tries to overcome the current limit, the cathode voltage is tied to lower level thus turning-on the diode D. By a proper design of the control

Fig. 27. The hybrid source model.

Fig. 28. The control subsystem.

Fig. 26. The PSIM schematic.

Fig.27 shows the active hybrid source. The Fuel cell is connected in series with a buck converter and the supercapacitor bank. Even under the worst-case scenario, the supercapacitor should supply the load current under function transients avoiding any accidental turning-off of the electronic device. The supercapacitor value has been designed to ensure a negligible supercapacitor discharge under the worst-case obtaining a 4.6F value. The load nominal voltage is 6V while turning-off voltage is 4.2V. Since the maximum value of the supercapacitor voltage is 2.5V, three supercapacitors are connected in series to match the load nominal voltage. Two parallel branch of Maxwell PC5 and PC10 supercapacitors are connected. A charge balancing circuit is provided on the experimental prototype. Low ESR capacitors are necessary to limit the output voltage ripple avoiding high inductance values. A sense resistor is introduced to sense the instantaneous inductor current waveform generating the Vsense signal.

The control loop architecture is shown in Fig.28. The output voltage is controlled by a Pulse Width Modulation (PWM) control loop. The load levelling function is implemented by a current loop. If a DSC function is selected, the current loop limits the fuel cell current at the standby current value of the actual DSC mode of operation. For example, if bracketing is selected the DSC is in photography mode. The buck inductor current and hence the fuel cell current is limited at the photography standby current value by the current control loop. The pulsed current is supplied by the supercapacitor bank over the entire function runtime. Then, under function running the current loop is active and the current loop action must prevail over the voltage one. Further, the control loop should detect the mode of operation of the power load. The voltage reference subsystem detects the actual DSC mode generating the corresponding voltage reference of the current loop.

Error amplifiers are implemented as Transconductance Operational Amplifiers (OTA). The OTAs are modelled by elementary blocks of PSIM libraries. The differential input is modelled by an adder, the OTA gain is modelled by a multiplier and the linearity range is modelled by a signal limiter.

Fig.27 shows the active hybrid source. The Fuel cell is connected in series with a buck converter and the supercapacitor bank. Even under the worst-case scenario, the supercapacitor should supply the load current under function transients avoiding any accidental turning-off of the electronic device. The supercapacitor value has been designed to ensure a negligible supercapacitor discharge under the worst-case obtaining a 4.6F value. The load nominal voltage is 6V while turning-off voltage is 4.2V. Since the maximum value of the supercapacitor voltage is 2.5V, three supercapacitors are connected in series to match the load nominal voltage. Two parallel branch of Maxwell PC5 and PC10 supercapacitors are connected. A charge balancing circuit is provided on the experimental prototype. Low ESR capacitors are necessary to limit the output voltage ripple avoiding high inductance values. A sense resistor is introduced to sense the instantaneous inductor current waveform

The control loop architecture is shown in Fig.28. The output voltage is controlled by a Pulse Width Modulation (PWM) control loop. The load levelling function is implemented by a current loop. If a DSC function is selected, the current loop limits the fuel cell current at the standby current value of the actual DSC mode of operation. For example, if bracketing is selected the DSC is in photography mode. The buck inductor current and hence the fuel cell current is limited at the photography standby current value by the current control loop. The pulsed current is supplied by the supercapacitor bank over the entire function runtime. Then, under function running the current loop is active and the current loop action must prevail over the voltage one. Further, the control loop should detect the mode of operation of the power load. The voltage reference subsystem detects the actual DSC mode generating

Error amplifiers are implemented as Transconductance Operational Amplifiers (OTA). The OTAs are modelled by elementary blocks of PSIM libraries. The differential input is modelled by an adder, the OTA gain is modelled by a multiplier and the linearity range is

Fig. 26. The PSIM schematic.

generating the Vsense signal.

modelled by a signal limiter.

the corresponding voltage reference of the current loop.

Fig. 27. The hybrid source model.

Fig. 28. The control subsystem.

The output current signal is obtained by a voltage controlled current source connected in parallel to the output resistance of the OTA. The compensation action is implemented by the RfCf network. Under steady-state condition, the inductor current is below the current limit and hence the cathode node of the diode D is tied to high-level. The diode D is turned-off. Under load transients, the inductor current tries to overcome the current limit, the cathode voltage is tied to lower level thus turning-on the diode D. By a proper design of the control loop parameters, if the diode is turned-on the current loop action prevails over the voltage one. The interface diode turns on under the condition:

$$I\_I \cdot R\_0 \le R\_0 \cdot I\_V - V\_Y \tag{9}$$

High Accuracy Modelling of Hybrid Power Supplies 211

two, decrease by one and keep constant the reference voltage. The subsystem decides which action should be performed on the voltage reference. The new voltage reference bits are determined by the old reference bits and by the action bits. The reference bits feed a digitalto-analog converter which outputs the analog voltage reference value. The proposed algorithm reproduces information about the DSC state by monitoring the charge and discharge profile of the supercapacitor bank. The PWM control technique is implemented within the *Driver* subsystem shown in Fig.30. The error signal is compared with the external saw-tooth voltage Vramp and the PWM signal is generated. The PWM signal and the clock signal feed the D flip-flop with asynchronous reset input which generates the driver signal for both MOSFET gates of the buck converter. Authors suggest (Boscaino et al., 2009a) for

further details.

Fig. 29. The reference subsystem.

Fig. 30. The driver subsystem.

where Vγ is the diode threshold voltage, *II* is the current OTA output signal, *Iv* is the voltage OTA output signal. The turn on condition can be expressed as:

$$g\_{m,l} \cdot e\_l \cdot R\_0 \le g\_{m,V} \cdot e\_V \cdot R\_0 - V\_\chi \tag{10}$$

where *eV* and *eI* are the voltage and current differential input signal, respectively, while *gm,I* and *gm,V* are the current and voltage OTA gains, respectively.

The current loop action should prevail over the voltage loop action even if the voltage loop is completely upset so ensuring the load levelling function. Hence, assuming the total upset of the voltage loop, the worst-case diode turning-on condition is given by:

$$\mathbf{e}\_{m,l} \cdot \mathbf{e}\_{l} \cdot \mathbf{R}\_0 \le \mathbf{R}\_0 \cdot \mathbf{I}\_{LM} - \mathbf{V}\_{\mathbf{Y}} \tag{11}$$

where ILIM is the voltage loop OTA maximum output current and *eI* is the desired tolerance on current control. The tolerance is fixed at one half of the steady-state inductor current ripple to achieve a peak current control. The OTA gain of the current loop is designed to verify the (11). Under a load transient, the load current ILOAD exceeds the reference value IL,th. Hence, the inductor current is limited to IL,th and the current I=ILOAD-IL,th is supplied by the supercapacitor until the end of transient. Consequently, under a load transient the fuel cell current is maintained constant for hybrid power source optimization: the fuel cell supplies a constant load except for reference value changes. The OTA gain of the voltage loop is chosen by frequency domain analysis to ensure system stability and an adequate bandwidth.

The operating mode of the power load is detected by the reference subsystem by sampling the output voltage only. The reference subsystem is able to detect mode transitions neglecting function transients. Under function transients, the reference voltage is kept constant while under mode transients the voltage reference is adapted to the new mode of operation. Unlike mode transients, function transients feature a limited run time. The subsystem clock period is longer than the highest runtime and hence the control loop is insensitive to function transients.

Fig.29 shows the reference subsystem model which is implemented by logic gates. The output voltage sample is compared with two threshold levels, which are accurately designed to prevent an excessive discharge. Information about the instantaneous charge state of the supercapacitor bank is obtained. The output voltage sample is coded by the logic signals up, mid and down: up is active if the output voltage is over both levels, mid if the sample is in the middle, down if the output voltage is lower than the lowest level. By comparing the two last samples of binary signals, the charge process is monitored and the DSC mode is detected.

Four possible steady-states, coded by s1 and s2 bits, are provided: 240mA, corresponding to DSC playback mode standby power consumption, 390mA, corresponding to DSC photography mode standby power consumption, 480mA, corresponding to DSC movie mode standby power consumption, 700mA, corresponding to a safety state. If an excessive supercapacitor discharge occurs, the safety state will prevent any accidental DSC turningoff. Four possible actions, coded by *a* and *b* bits, are provided: increase by one, increase by

loop parameters, if the diode is turned-on the current loop action prevails over the voltage

where Vγ is the diode threshold voltage, *II* is the current OTA output signal, *Iv* is the voltage

where *eV* and *eI* are the voltage and current differential input signal, respectively, while *gm,I*

The current loop action should prevail over the voltage loop action even if the voltage loop is completely upset so ensuring the load levelling function. Hence, assuming the total upset

where ILIM is the voltage loop OTA maximum output current and *eI* is the desired tolerance on current control. The tolerance is fixed at one half of the steady-state inductor current ripple to achieve a peak current control. The OTA gain of the current loop is designed to verify the (11). Under a load transient, the load current ILOAD exceeds the reference value IL,th. Hence, the inductor current is limited to IL,th and the current I=ILOAD-IL,th is supplied by the supercapacitor until the end of transient. Consequently, under a load transient the fuel cell current is maintained constant for hybrid power source optimization: the fuel cell supplies a constant load except for reference value changes. The OTA gain of the voltage loop is chosen by frequency domain analysis to ensure system stability and an adequate

The operating mode of the power load is detected by the reference subsystem by sampling the output voltage only. The reference subsystem is able to detect mode transitions neglecting function transients. Under function transients, the reference voltage is kept constant while under mode transients the voltage reference is adapted to the new mode of operation. Unlike mode transients, function transients feature a limited run time. The subsystem clock period is longer than the highest runtime and hence the control loop is

Fig.29 shows the reference subsystem model which is implemented by logic gates. The output voltage sample is compared with two threshold levels, which are accurately designed to prevent an excessive discharge. Information about the instantaneous charge state of the supercapacitor bank is obtained. The output voltage sample is coded by the logic signals up, mid and down: up is active if the output voltage is over both levels, mid if the sample is in the middle, down if the output voltage is lower than the lowest level. By comparing the two last samples of binary signals, the charge process is monitored and the

Four possible steady-states, coded by s1 and s2 bits, are provided: 240mA, corresponding to DSC playback mode standby power consumption, 390mA, corresponding to DSC photography mode standby power consumption, 480mA, corresponding to DSC movie mode standby power consumption, 700mA, corresponding to a safety state. If an excessive supercapacitor discharge occurs, the safety state will prevent any accidental DSC turningoff. Four possible actions, coded by *a* and *b* bits, are provided: increase by one, increase by

ܫூ ή ܴ ܴ ή ܫ െ ܸఊ (9)

݃ǡூ ή ݁ூ ή ܴ ݃ǡ ή ݁ ή ܴ െ ܸఊ (10)

݃ǡூ ή ݁ூ ή ܴ ܴ ή ܫூெ െ ܸఊ (11)

one. The interface diode turns on under the condition:

OTA output signal. The turn on condition can be expressed as:

and *gm,V* are the current and voltage OTA gains, respectively.

bandwidth.

insensitive to function transients.

DSC mode is detected.

of the voltage loop, the worst-case diode turning-on condition is given by:

two, decrease by one and keep constant the reference voltage. The subsystem decides which action should be performed on the voltage reference. The new voltage reference bits are determined by the old reference bits and by the action bits. The reference bits feed a digitalto-analog converter which outputs the analog voltage reference value. The proposed algorithm reproduces information about the DSC state by monitoring the charge and discharge profile of the supercapacitor bank. The PWM control technique is implemented within the *Driver* subsystem shown in Fig.30. The error signal is compared with the external saw-tooth voltage Vramp and the PWM signal is generated. The PWM signal and the clock signal feed the D flip-flop with asynchronous reset input which generates the driver signal for both MOSFET gates of the buck converter. Authors suggest (Boscaino et al., 2009a) for further details.

Fig. 29. The reference subsystem.

Fig. 30. The driver subsystem.

High Accuracy Modelling of Hybrid Power Supplies 213

turning-on function. Take a look to the evolution of the system from start-up till the end of transient. At the top, the pulsed current load and the inductor current, at the bottom the output voltage waveforms are shown. Under start-up conditions, the system starts at the lowest threshold value corresponding to the playback mode (240mA). Yet, the digital camera is turned-on in photography mode corresponding to a higher current limit (390mA). The fuel cell supplies the standby current of the playback mode while the pulsed current is supplied by the supercapacitor bank, as shown in Fig.33.The turning-on function in photography mode lasts 4.6s. Until the effective mode of operation is detected, the inductor current is limited to the playback mode current threshold, as shown in Fig.33. In the intermediate part of the function transient the main peak of the load current is entirely supplied by the supercapacitor, as shown in Fig.34. The supercapacitor bank is constantly discharged. Even under stress, the output voltage does not drop below the turning-off limit, which is equal to 4.2V, thanks to an accurate design of the power stage. Fig.35 shows the system behaviour under the last part of the turning on function, corresponding to the lens movement. The inductor current is already limited at the playback mode current limit. At the end of turning-on in photography mode, the actual mode of operation is detected by the reference subsystem as shown by Fig.36. The inductor current limit is increased up to the photography mode standby current value. No function is actually selected by the end-user. The standby current of the photography mode is supplied by the fuel cell thus interrupting the supercapacitor discharge. The safety state is not reached since no excessive discharge

Fig. 32. At the top the inductor current, at the bottom the diode current waveforms under

Experimental results under turning-on in photography mode are shown in Fig.37. The output voltage (C1, 1V/div), the load current (C2, 200mA/div) and the inductor current (C3, 200mA/div) are shown. Time base is fixed at 2s/div. As shown by simulation results, the system does not detect the actual mode of operation until the end of transient. Hence, the transient current is supplied by the supercapacitor bank while the standby current is supplied by the fuel cell. Then, the actual mode is detected and the current limit is

has been detected by the reference subsystem.

current limitation.

increased.

#### **5. Simulation and experimental results**

The efficiency and accuracy of the proposed simulation set-up is confirmed by the comparison between simulation and experimental results. Simulation results accurately match experimental ones. The output voltage profile depends not only on the selected function but above all on the "history" of the power supply system since the turning-on. Yet, the system is tested since the simulation step with the effective load consumption profile. Long-time simulation tests are performed to show the robustness of the power management algorithms. The system prevents any accidental turning-off of the digital still camera improving the hybrid source performances. The hybrid source features the same dynamic response of the supercapacitor bank under pulsed current profile, the life cycle is closely related to the hydrogen reserve and quite independent of the supercapacitor state of charge. After all, the hybrid source features the high power capability of the supercapacitor bank and the high energy capability of the fuel cell. The performances of the hybrid source are not affected by drawbacks of both primary sources. The inductor current and the output voltage waveforms under no-load conditions are shown in Fig.31. The output voltage is controlled by the voltage loop while the current loop is not active.

Fig. 31. At the top the inductor current, at the bottom the output voltage waveforms under no-load conditions.

The inductor current and the interface diode current waveforms under current loop limitation are shown in Fig.32 the current limit is fixed at 240mA, corresponding to the playback mode of operation. When the inductor current overcomes the 210mA limit, the interface diode is forced into conduction. The tolerance on the current control is 30mA within the tolerance window of 40mA designed by (11).

Simulation results under turning-on in photography mode are shown to better understand the efficiency of the designed control algorithm. Turning-on in photography mode is a critical transient since the transient time is quite long and peak current value is higher and higher than the average value. Figures from 33 to 36 show the system behaviour under the

The efficiency and accuracy of the proposed simulation set-up is confirmed by the comparison between simulation and experimental results. Simulation results accurately match experimental ones. The output voltage profile depends not only on the selected function but above all on the "history" of the power supply system since the turning-on. Yet, the system is tested since the simulation step with the effective load consumption profile. Long-time simulation tests are performed to show the robustness of the power management algorithms. The system prevents any accidental turning-off of the digital still camera improving the hybrid source performances. The hybrid source features the same dynamic response of the supercapacitor bank under pulsed current profile, the life cycle is closely related to the hydrogen reserve and quite independent of the supercapacitor state of charge. After all, the hybrid source features the high power capability of the supercapacitor bank and the high energy capability of the fuel cell. The performances of the hybrid source are not affected by drawbacks of both primary sources. The inductor current and the output voltage waveforms under no-load conditions are shown in Fig.31. The output voltage is

Fig. 31. At the top the inductor current, at the bottom the output voltage waveforms under

The inductor current and the interface diode current waveforms under current loop limitation are shown in Fig.32 the current limit is fixed at 240mA, corresponding to the playback mode of operation. When the inductor current overcomes the 210mA limit, the interface diode is forced into conduction. The tolerance on the current control is 30mA

Simulation results under turning-on in photography mode are shown to better understand the efficiency of the designed control algorithm. Turning-on in photography mode is a critical transient since the transient time is quite long and peak current value is higher and higher than the average value. Figures from 33 to 36 show the system behaviour under the

**5. Simulation and experimental results** 

no-load conditions.

controlled by the voltage loop while the current loop is not active.

within the tolerance window of 40mA designed by (11).

turning-on function. Take a look to the evolution of the system from start-up till the end of transient. At the top, the pulsed current load and the inductor current, at the bottom the output voltage waveforms are shown. Under start-up conditions, the system starts at the lowest threshold value corresponding to the playback mode (240mA). Yet, the digital camera is turned-on in photography mode corresponding to a higher current limit (390mA). The fuel cell supplies the standby current of the playback mode while the pulsed current is supplied by the supercapacitor bank, as shown in Fig.33.The turning-on function in photography mode lasts 4.6s. Until the effective mode of operation is detected, the inductor current is limited to the playback mode current threshold, as shown in Fig.33. In the intermediate part of the function transient the main peak of the load current is entirely supplied by the supercapacitor, as shown in Fig.34. The supercapacitor bank is constantly discharged. Even under stress, the output voltage does not drop below the turning-off limit, which is equal to 4.2V, thanks to an accurate design of the power stage. Fig.35 shows the system behaviour under the last part of the turning on function, corresponding to the lens movement. The inductor current is already limited at the playback mode current limit. At the end of turning-on in photography mode, the actual mode of operation is detected by the reference subsystem as shown by Fig.36. The inductor current limit is increased up to the photography mode standby current value. No function is actually selected by the end-user. The standby current of the photography mode is supplied by the fuel cell thus interrupting the supercapacitor discharge. The safety state is not reached since no excessive discharge has been detected by the reference subsystem.

Fig. 32. At the top the inductor current, at the bottom the diode current waveforms under current limitation.

Experimental results under turning-on in photography mode are shown in Fig.37. The output voltage (C1, 1V/div), the load current (C2, 200mA/div) and the inductor current (C3, 200mA/div) are shown. Time base is fixed at 2s/div. As shown by simulation results, the system does not detect the actual mode of operation until the end of transient. Hence, the transient current is supplied by the supercapacitor bank while the standby current is supplied by the fuel cell. Then, the actual mode is detected and the current limit is increased.

High Accuracy Modelling of Hybrid Power Supplies 215

Fig. 35. Simulation results under turning-on in photography mode. At the top the pulsed load current and the inductor current, at the bottom the output voltage waveforms during at

Fig. 36. Simulation results after turning on in photography mode. At the top the pulsed load current and the inductor current, at the bottom the output voltage waveforms are shown. The DSC state is detected and the current threshold is increased to allow the supercapacitor

recharge.

the end of function transient are shown. The actual state is not yet detected.

Fig. 33. Simulation results under turning-on in photography mode. At the top the pulsed load current and the inductor current, at the bottom the output voltage waveforms at the beginning of function transient are shown. The system starts at playback mode current limit and the actual state is not yet detected.

Fig. 34. Simulation results under turning-on in photography mode, intermediate part of function transient. At the top the pulsed load current and the inductor current, at the bottom the output voltage waveforms during the peak power consumption are shown. The DSC state is not yet detected.

Fig. 33. Simulation results under turning-on in photography mode. At the top the pulsed load current and the inductor current, at the bottom the output voltage waveforms at the beginning of function transient are shown. The system starts at playback mode current limit

Fig. 34. Simulation results under turning-on in photography mode, intermediate part of function transient. At the top the pulsed load current and the inductor current, at the bottom the output voltage waveforms during the peak power consumption are shown. The DSC

and the actual state is not yet detected.

state is not yet detected.

Fig. 35. Simulation results under turning-on in photography mode. At the top the pulsed load current and the inductor current, at the bottom the output voltage waveforms during at the end of function transient are shown. The actual state is not yet detected.

Fig. 36. Simulation results after turning on in photography mode. At the top the pulsed load current and the inductor current, at the bottom the output voltage waveforms are shown. The DSC state is detected and the current threshold is increased to allow the supercapacitor recharge.

High Accuracy Modelling of Hybrid Power Supplies 217

In Fig.39 simulation results under bracketing function are shown. At the top, the pulsed load current and the buck inductor current are shown. At the bottom, the output voltage is shown. The inductor current which is a scaled version of the fuel cell current is limited at the photography stand-by current limit over the entire transient time. The fuel cell supplies the standby current of the actual DSC mode of operation while the supercapacitor bank supplies the instantaneous peak power. The output voltage is affected by the supercapacitor discharge. Yet, any accidental turning-off is avoided thanks to the accurate design of the power stage. Further, if no-function is selected by user the supercapacitor bank will be recharged driving back the system to the nominal working

Fig. 39. Simulation results under bracketing function. At the top the pulsed load current and

Fig.40 shows simulation results under bracketing function. In this case, the system has not yet detected the actual mode of operation of the DSC. At the top the pulsed load current and the inductor current, at the bottom the output voltage waveforms are shown. The system is still in playback mode and the inductor current is limited to 240mA, lower and lower than the actual standby current. This is the worst-case for bracketing function. The fuel cell supplies the playback mode current while the supercapacitor is heavily discharged supplying both the pulsed current and the difference between the photography and playback standby currents. Yet, the discharge is not yet critical for the DSC working. Note that this condition is closely related to the history of

Experimental results under bracketing function are shown in Fig.41. The output voltage (C1, 1V/div), the load current (C2, 200mA/div) and the inductor current (C4, 200mA/div) are shown. The time base is fixed at 500ms/div. Note the high accuracy of simulation results. The DSC current profile is accurately reproduced allowing the designer to test the control algorithms as closely as possible to the effective system behaviour. Since specific hybrid source features as life-cycle and transient response are directly controlled, high accuracy

the inductor current, at the bottom the output voltage waveforms are shown.

conditions.

the system.

Note that the instant at which the reference subsystem detects the actual DSC mode of operation is not related to the transient itself but above all on the history of the system since the start-up condition. Experimental results under turning-on in photography mode in the worst-case are shown in Fig.3**7**. In this case, the actual mode of operation is detected after the end of transient. In Fig. 38, the actual mode of operation is detected before the end of transient. The discharge of the supercapacitor is thus limited to the beginning of the function transient.

Fig. 37. Experimental results under turning on in photography mode. The DSC state is detected at the end of function transient. On C1 the output voltage (1V/div), on C2 the load current (200mA/div), on C3 the inductor current (200mA/div) are shown. Time base is set at 2s/div.

Fig. 38. Experimental results under turning on in photography mode. In this case the actual mode is detected before the end of transient. On C1 the output voltage (1V/div), on C2 the load current (200mA/div), on C3 the inductor current (200mA/div) are shown. Time base is set at 2s/div.

Note that the instant at which the reference subsystem detects the actual DSC mode of operation is not related to the transient itself but above all on the history of the system since the start-up condition. Experimental results under turning-on in photography mode in the worst-case are shown in Fig.3**7**. In this case, the actual mode of operation is detected after the end of transient. In Fig. 38, the actual mode of operation is detected before the end of transient. The discharge of the supercapacitor is thus limited to the beginning of the

Fig. 37. Experimental results under turning on in photography mode. The DSC state is detected at the end of function transient. On C1 the output voltage (1V/div), on C2 the load current (200mA/div), on C3 the inductor current (200mA/div) are shown. Time base is set

Fig. 38. Experimental results under turning on in photography mode. In this case the actual mode is detected before the end of transient. On C1 the output voltage (1V/div), on C2 the load current (200mA/div), on C3 the inductor current (200mA/div) are shown. Time base is

function transient.

at 2s/div.

set at 2s/div.

In Fig.39 simulation results under bracketing function are shown. At the top, the pulsed load current and the buck inductor current are shown. At the bottom, the output voltage is shown. The inductor current which is a scaled version of the fuel cell current is limited at the photography stand-by current limit over the entire transient time. The fuel cell supplies the standby current of the actual DSC mode of operation while the supercapacitor bank supplies the instantaneous peak power. The output voltage is affected by the supercapacitor discharge. Yet, any accidental turning-off is avoided thanks to the accurate design of the power stage. Further, if no-function is selected by user the supercapacitor bank will be recharged driving back the system to the nominal working conditions.

Fig. 39. Simulation results under bracketing function. At the top the pulsed load current and the inductor current, at the bottom the output voltage waveforms are shown.

Fig.40 shows simulation results under bracketing function. In this case, the system has not yet detected the actual mode of operation of the DSC. At the top the pulsed load current and the inductor current, at the bottom the output voltage waveforms are shown. The system is still in playback mode and the inductor current is limited to 240mA, lower and lower than the actual standby current. This is the worst-case for bracketing function. The fuel cell supplies the playback mode current while the supercapacitor is heavily discharged supplying both the pulsed current and the difference between the photography and playback standby currents. Yet, the discharge is not yet critical for the DSC working. Note that this condition is closely related to the history of the system.

Experimental results under bracketing function are shown in Fig.41. The output voltage (C1, 1V/div), the load current (C2, 200mA/div) and the inductor current (C4, 200mA/div) are shown. The time base is fixed at 500ms/div. Note the high accuracy of simulation results. The DSC current profile is accurately reproduced allowing the designer to test the control algorithms as closely as possible to the effective system behaviour. Since specific hybrid source features as life-cycle and transient response are directly controlled, high accuracy

High Accuracy Modelling of Hybrid Power Supplies 219

Fig. 41. Experimental results under bracketing function. The output voltage (C1, 1V/div), the load current (C2, 200mA/div), the buck inductor current (C4, 200mA/div) are shown.

Fig. 42. Simulation results under zoom function in playback mode. At the top, the pulsed load current and the inductor current, at the bottom the output voltage waveforms are

Time base is set to 500ms/div.

shown.

modelling is a key step to achieve high-efficiency power management control algorithms. As expected by the performed behavioural simulations, experimental results confirm the high efficiency of the implemented algorithms.

Fig. 40. Simulation results under bracketing function. The actual mode is not yet detected and the playback mode current limit is active. At the top the pulsed load current and the inductor current, at the bottom the output voltage waveforms are shown.

Simulation results under zoom function in playback mode are shown in Fig.42. At the top, the pulsed load current and the buck inductor current are shown. At the bottom, the output voltage is shown. The zoom function is not a critical function for the hybrid power supply. The inductor current is limited at the playback mode threshold. At the end of the transient time, the output voltage reaches again the nominal value. The net discharge of the supercapacitor bank could be neglected under the selected function running. The fuel cell supplies the standby current of the actual DSC mode of operation while the supercapacitor bank supplies the instantaneous peak power.

Fig.43 shows simulation results under multiple execution of zoom function in playback mode. At the top, the pulsed load current and the inductor current, at the bottom the output voltage waveforms are shown. In this case, the system has previously detected an excessive discharge of the supercapacitor bank. The current limit has been previously increased up to the movie mode threshold to allow a fast recharge. Yet, zoom function is actually selected by user and repeated several times. Note that in this case, the recharge is supplied by the fuel cell itself. The net recharge current is equal to the difference between the limited inductor current and the load current.

Experimental results under zoom function are shown in Fig.44. The output voltage (C1, 1V/div), the load current (C2, 200mA/div) and the inductor current (C3, 100mA/div) are shown. Time base is set to 20ms/div. As expected by simulation results, the output voltage is not affected by the zoom running.

218 MATLAB for Engineers – Applications in Control, Electrical Engineering, IT and Robotics

modelling is a key step to achieve high-efficiency power management control algorithms. As expected by the performed behavioural simulations, experimental results confirm the

Fig. 40. Simulation results under bracketing function. The actual mode is not yet detected and the playback mode current limit is active. At the top the pulsed load current and the

Simulation results under zoom function in playback mode are shown in Fig.42. At the top, the pulsed load current and the buck inductor current are shown. At the bottom, the output voltage is shown. The zoom function is not a critical function for the hybrid power supply. The inductor current is limited at the playback mode threshold. At the end of the transient time, the output voltage reaches again the nominal value. The net discharge of the supercapacitor bank could be neglected under the selected function running. The fuel cell supplies the standby current of the actual DSC mode of operation while the supercapacitor

Fig.43 shows simulation results under multiple execution of zoom function in playback mode. At the top, the pulsed load current and the inductor current, at the bottom the output voltage waveforms are shown. In this case, the system has previously detected an excessive discharge of the supercapacitor bank. The current limit has been previously increased up to the movie mode threshold to allow a fast recharge. Yet, zoom function is actually selected by user and repeated several times. Note that in this case, the recharge is supplied by the fuel cell itself. The net recharge current is equal to the difference between the limited inductor

Experimental results under zoom function are shown in Fig.44. The output voltage (C1, 1V/div), the load current (C2, 200mA/div) and the inductor current (C3, 100mA/div) are shown. Time base is set to 20ms/div. As expected by simulation results, the output voltage

inductor current, at the bottom the output voltage waveforms are shown.

high efficiency of the implemented algorithms.

bank supplies the instantaneous peak power.

current and the load current.

is not affected by the zoom running.

Fig. 41. Experimental results under bracketing function. The output voltage (C1, 1V/div), the load current (C2, 200mA/div), the buck inductor current (C4, 200mA/div) are shown. Time base is set to 500ms/div.

Fig. 42. Simulation results under zoom function in playback mode. At the top, the pulsed load current and the inductor current, at the bottom the output voltage waveforms are shown.

High Accuracy Modelling of Hybrid Power Supplies 221

In this chapter, a high accuracy simulation set-up for hybrid power supplies is proposed. As an example, a fuel cell-supercapacitor hybrid power supply for a digital still camera is designed and tested. The system is modelled and tested in Simulink environment with the aid of *SimCoupler Module* for PSIM/Matlab co-simulation. The power management controller is implemented in PSIM environment while the fuel cell and the power load are accurately modelled by the means of Simulink library elements. A laboratory prototype has been realized and tested. Simulation results accurately match experimental results, highlighting the high efficiency of the proposed technique. The proposed modelling approach is suitable for each power supply system thanks to the powerful tools available in Matlab suite. Thanks to the powerful modelling approach, the need of a warm-up phase is highlighted since the simulation step. The fuel cell temperature has to be increased up to 40°C before the system start-up. Authors are working on an innovative power management system which overcomes this drawback by controlling the fuel cell temperature under start-up

Authors would like to thank ST Microelectronics for supporting the research activity.

Alotto, P., Guarnieri, M. & Moro, F. (2008). Modelling and control of fuel cell-battery

Boscaino, V., Capponi G., Livreri, P. & Marino, F. (2008). Measurement-based load

Boscaino, V., Capponi G. & Marino, F.(2009a). Experimental test on a fuel cell-

Boscaino, V., Capponi, G. & Marino, F. (2009b). A steady-state and dynamic fuel cell

Gao L., & Dougal, R.A. (2003). Active Power Sharing in Hybrid Battery/Capacitor Power

hybrid power systems for portable electronics. *Proceedings of IEEE Universities Power Engineering Conference,* ISBN: 978-1-4244-3294-3, Padova, Italy, December

modelling for power supply system design, *Proceedings of IEEE International Conference on Control and modelling for Power Electronics,* ISBN: 978-1-4244-2550-1,

supercapacitor hybrid power supply for a digital still camera, *Proceedings of IEEE Universities Power Engineering Conference,* ISBN: 978-1-4244-6823-2, Glasgow,

model including temperature effects. *Proceedings of IEEE International Conference on Industrial Electronics,* ISBN: 978-1-4244-4648-3, Porto, Portugal, November

Sources. *Proceedings of Applied Power Electronics Conference and Exposition,* ISBN: 0-7803-

**6. Conclusion** 

conditions.

**7. Acknowledgement** 

2008.

2009.

**8. References** 

The modelling approach is still a key design tool.

Zürich, Switzerland, August 2008.

7768-0, Miami, Florida, February *2003.* 

Scotland, Sept. 2009.

Fig. 43. Simulation results under zoom function in playback mode. The current limit is higher than the playback mode threshold to allow a fast recharge of the supercapacitor bank. At the top, the pulsed load current and the inductor current, at the bottom the output voltage waveforms are shown.

Fig. 44. Experimental results under zoom function in playback mode. The output voltage (C1, 1V/div), the load current (C2, 200mA/div), the buck inductor current (C3, 100mA/div) are shown. Time base is set to 20ms/div.

### **6. Conclusion**

220 MATLAB for Engineers – Applications in Control, Electrical Engineering, IT and Robotics

Fig. 43. Simulation results under zoom function in playback mode. The current limit is higher than the playback mode threshold to allow a fast recharge of the supercapacitor bank. At the top, the pulsed load current and the inductor current, at the bottom the output

Fig. 44. Experimental results under zoom function in playback mode. The output voltage (C1, 1V/div), the load current (C2, 200mA/div), the buck inductor current (C3, 100mA/div)

voltage waveforms are shown.

are shown. Time base is set to 20ms/div.

In this chapter, a high accuracy simulation set-up for hybrid power supplies is proposed. As an example, a fuel cell-supercapacitor hybrid power supply for a digital still camera is designed and tested. The system is modelled and tested in Simulink environment with the aid of *SimCoupler Module* for PSIM/Matlab co-simulation. The power management controller is implemented in PSIM environment while the fuel cell and the power load are accurately modelled by the means of Simulink library elements. A laboratory prototype has been realized and tested. Simulation results accurately match experimental results, highlighting the high efficiency of the proposed technique. The proposed modelling approach is suitable for each power supply system thanks to the powerful tools available in Matlab suite. Thanks to the powerful modelling approach, the need of a warm-up phase is highlighted since the simulation step. The fuel cell temperature has to be increased up to 40°C before the system start-up. Authors are working on an innovative power management system which overcomes this drawback by controlling the fuel cell temperature under start-up conditions.

The modelling approach is still a key design tool.

#### **7. Acknowledgement**

Authors would like to thank ST Microelectronics for supporting the research activity.

### **8. References**


**9** 

Cornelis Jan Kikkert *James Cook University* 

> *Queensland Australia*

**Calculating Radiation from Power Lines for** 

The cost of electricity charged to consumers in Australia is predominantly set by state governments and does not vary depending on the actual cost that the electricity retailer has to pay the generators. This does not encourage users to reduce power at times of peak demand and the ratio between the peak demand and the average demand is growing. In the long term, user pays principle must apply and the cost of electricity charged will need to vary depending on the actual cost of production. This requires a communication system to be produced firstly to determine the date and time electricity is used, so that the usage and actual cost can be matched, and secondly to inform the consumer of the actual cost of electricity, so that appropriate actions can be taken, like turning off air conditioners when

There are two ways that such a communication system can be developed. Firstly it can use the PLC for carrying the communication signals. Secondly the communication systems can be carried by third party suppliers. The WiMAX radio system currently being rolled out in Australia in Victoria and mobile phone based systems are examples of such systems. Using PLC has the advantage that the communication system is fully under the control of the

In addition it is possible for the electricity supplier to use their power lines to provide BPL, giving internet access to customers, by putting communication signals up to 80 MHz onto the power lines. The frequency range used and bandwidth required for BPL is very different

When a power line is used for transmitting communication signals, signal power is lost through electromagnetic radiation. This may cause interference to other users. There is a concern about the amount of radiation from power lines (ACMA 2005, 2007), with amateur radio operators claiming BPL creates excessive levels of radiation. Unfortunately much of the amateur radio literature does not distinguish between BPL and PLC. The second loss factor is resistive losses, which due to the skin depth causes an increasing attenuation with frequency. The Matlab® program described in this paper and the results obtained from this program provide a rigorous basis for determining both the resistive losses and the radiation obtained from power lines. Electricity distribution companies and other communication providers can use this data to determine the feasibility of power line communications in their region. SWER power lines are used in remote areas and are single phase lines where the ground is relied upon for the return path. As these power lines can be up to 300 km long, there is a

electricity company and no fees need to be paid to third party operators.

than that for PLC and the radiation losses are very different for BPL and PLC.

**1. Introduction** 

the cost per kW becomes high.

**Power Line Communications** 

Lin, C.J., Chen, A.Y.T., Chiou, C.Y., Huang, C.H., Chiang, H.D. , Wang, J.C. & Fekih-Ahmed, L.(1993). Dynamic load models in power systems using the measurement approach. *IEEE Transactions on Power Systems*, vol. 8, no. 1, (February 2003), pp. 309–315, ISSN: 0885-8950.

### **Calculating Radiation from Power Lines for Power Line Communications**

Cornelis Jan Kikkert *James Cook University Queensland Australia* 

#### **1. Introduction**

222 MATLAB for Engineers – Applications in Control, Electrical Engineering, IT and Robotics

Lin, C.J., Chen, A.Y.T., Chiou, C.Y., Huang, C.H., Chiang, H.D. , Wang, J.C. & Fekih-Ahmed,

309–315, ISSN: 0885-8950.

L.(1993). Dynamic load models in power systems using the measurement approach. *IEEE Transactions on Power Systems*, vol. 8, no. 1, (February 2003), pp.

> The cost of electricity charged to consumers in Australia is predominantly set by state governments and does not vary depending on the actual cost that the electricity retailer has to pay the generators. This does not encourage users to reduce power at times of peak demand and the ratio between the peak demand and the average demand is growing. In the long term, user pays principle must apply and the cost of electricity charged will need to vary depending on the actual cost of production. This requires a communication system to be produced firstly to determine the date and time electricity is used, so that the usage and actual cost can be matched, and secondly to inform the consumer of the actual cost of electricity, so that appropriate actions can be taken, like turning off air conditioners when the cost per kW becomes high.

> There are two ways that such a communication system can be developed. Firstly it can use the PLC for carrying the communication signals. Secondly the communication systems can be carried by third party suppliers. The WiMAX radio system currently being rolled out in Australia in Victoria and mobile phone based systems are examples of such systems. Using PLC has the advantage that the communication system is fully under the control of the electricity company and no fees need to be paid to third party operators.

> In addition it is possible for the electricity supplier to use their power lines to provide BPL, giving internet access to customers, by putting communication signals up to 80 MHz onto the power lines. The frequency range used and bandwidth required for BPL is very different than that for PLC and the radiation losses are very different for BPL and PLC.

> When a power line is used for transmitting communication signals, signal power is lost through electromagnetic radiation. This may cause interference to other users. There is a concern about the amount of radiation from power lines (ACMA 2005, 2007), with amateur radio operators claiming BPL creates excessive levels of radiation. Unfortunately much of the amateur radio literature does not distinguish between BPL and PLC. The second loss factor is resistive losses, which due to the skin depth causes an increasing attenuation with frequency.

> The Matlab® program described in this paper and the results obtained from this program provide a rigorous basis for determining both the resistive losses and the radiation obtained from power lines. Electricity distribution companies and other communication providers can use this data to determine the feasibility of power line communications in their region.

> SWER power lines are used in remote areas and are single phase lines where the ground is relied upon for the return path. As these power lines can be up to 300 km long, there is a

Calculating Radiation from Power Lines for Power Line Communications 225

2 2 2 2

For a very long wire antenna, such as a power line, the magnitude and phase of the current I0 and Eθ at a position along the line is iteratively determined by considering the radiation and resistive line losses up to that point. This is then be used to determine Eθ caused by the elementary doublet at that point. At a point along the line, the Eθ vector from the elementary doublet is added to the cumulative Eθ vector, to produce the new cumulative Eθ vector. For a

If the conductor is not in free space, but is a single power line, a distance h above an ideal groundplane, then equal and opposite image current will be induced below the groundplane. That changes the radiation pattern, so that the radiation is no longer

above the ground. If this is used for power line communication signals up to 1 MHz, then the power line is far less than a quarter wavelength above the ground. The far-field electric field for an elementary doublet a distance h above a perfectly conducting ground plane will

> <sup>0</sup> 2 2 120 sin( ) ( , ) (2 ( ( )) ( ( )) *jkr h h I le E E jSin Cos Sin Cos*

The radiation pattern from the elementary doublet will then have a null along the conductor (θ=0), as it had for the free space conductor and in addition it will have a null along the groundplane (ϕ=90°) and a maximum perpendicular to the groundplane (θ = ϕ = 90°). The field in this direction depends on 2h, the separation between the line and the return path. For SWER lines, the ground plane is not a perfectly conducting plane and the distance of the ground return path below the ground level is given by Carson's equation (Carson, 1926,

> 2( <sup>2</sup> *D h <sup>s</sup>*

a SWER line we replace the line separation 2h in equation (6) by D in equation (7).

where h is the height of the SWER line above ground, ρs is the soil resistivity. To use this for

At 50 Hz the return path is typically 1km below ground and at 100 kHz it is about 36 m below ground. In both cases the return path distance is still much less than a quarter wavelength, so no additional nulls appear in the field from the elementary doublet. Since the effective line spacing varies, the line capacitance and characteristic impedance also

Equation (6) can also be used to determine the radiation from overhead power lines where the PLC signals are applied in a differential form on two conductors with a line separation

From knowing the skin depth, the diameter of the conductor and its conductivity, the resistance of conductor for the elementary doublet length can be calculated. Knowing the current flowing through the elementary doublet, the resistive losses can then be calculated.

ϕ π

 π

. A Medium Voltage (11 kV to 33 kV) single power line is typically 7 m

*r*

− = = − (6)

0

*F* ρ

π μ  θ

λλ

= + (7)

= = (5)

 θ

ϕ

 π

 θθ

, so that (5) can be used to

ϕ

0 0 <sup>0</sup> <sup>1</sup> <sup>P</sup> ( ) sin( ) ( ) sin( ) <sup>2</sup> <sup>240</sup> *rad Er d Er d*

 θθ

π

η

evaluate the radiated power.

ϕ

θ ϕ

θ

Wang & Liu, 2001, Deri & Tevan, 1981):

change with frequency.

of *2h*.

independent of

be:

π

line in free space, the cumulative fields are independent of

π

λ

θ

significant economic incentive to read the power meter for those customers remotely since a 600 km trip on dirt roads is likely to cost more than the customer's electricity bill. To achieve this JCU has been carrying out a research project for the Queensland electricity retailer ERGON for developing a PLC communication system for SWER lines.

#### **2. Fundamental principles**

#### **2.1 Line radiation theory**

The existing travelling wave model of a long wire antenna (Balanis, 1997, Walter, 1970 and Ulaby, 1994) assumes that the antenna is less than 10 λ long and the current along the line is constant, implying that no power is lost in radiation. Neither of these assumptions apply for power lines, so that a radiation model based on fundamental equations had to be developed.

The power radiated for an infinitesimal current element, also called an elementary doublet is described in most antenna books. The model presented in this paper cascades many of these infinitesimal current element models to make up the whole transmission line. The power radiated by a small length of conductor of length *l* in the far field, is dependent on the current in the conductor, I0, and is shown in (Balanis, 1997) to be:

$$\mathbf{P}\_{rad} = \eta \frac{\pi}{\mathfrak{B}} \left(\frac{lI\mathfrak{s}}{\mathcal{A}}\right)^2 \tag{1}$$

where η0 = 120 π, is the λ wavelength. Antenna radiation patterns for long wire antenna Because the line is long, I0 will not be constant. Three factors affect I0:


Using the conventional spherical coordinates r, θ and ϕ, the far-field electric field Eθ and the far-field magnetic field Hϕ for this elementary doublet is given by (Balanis 1997) as:

$$E\_{\theta} = \frac{j\eta\_0 k I\_0 l e^{-jkr} \sin(\theta)}{4\pi r} = \frac{j\eta\_0 I\_0 l e^{-jkr} \sin(\theta)}{2\lambda r} = \frac{j60\pi I\_0 l e^{-jkr} \sin(\theta)}{\lambda r} \tag{2}$$

$$H\_{\varphi} = \frac{j k I\_0 l e^{-jkr} \sin(\theta)}{4\pi r} = \frac{j I\_0 l e^{-jkr} \sin(\theta)}{2\lambda r} \tag{3}$$

where the wave number, k = 2π/λ. Note that since the current I0 has a magnitude and phase, both Eθ and Hϕ are complex quantities.

$$\mathbf{P}\_{rad} = \frac{1}{2} \text{Re} \left( \oint\_{s} E\_{\theta} \times H\_{\phi} ds \right) \tag{4}$$

The far-field power radiated is obtained by integrating the Poynting vector over a closed surface, chosen to be a sphere of radius r, where r is much larger than the wavelength and the length of the power line dimensions as shown in equation (4). For an elementary doublet in free space, the inner integrand is independent of ϕ, resulting in a constant of 2*π* for that integration, so that:

significant economic incentive to read the power meter for those customers remotely since a 600 km trip on dirt roads is likely to cost more than the customer's electricity bill. To achieve this JCU has been carrying out a research project for the Queensland electricity retailer

The existing travelling wave model of a long wire antenna (Balanis, 1997, Walter, 1970 and Ulaby, 1994) assumes that the antenna is less than 10 λ long and the current along the line is constant, implying that no power is lost in radiation. Neither of these assumptions apply for power lines, so that a radiation model based on fundamental equations had to be

The power radiated for an infinitesimal current element, also called an elementary doublet is described in most antenna books. The model presented in this paper cascades many of these infinitesimal current element models to make up the whole transmission line. The power radiated by a small length of conductor of length *l* in the far field, is dependent on

3

where η0 = 120 π, is the λ wavelength. Antenna radiation patterns for long wire antenna

1. I0 is reduced by dissipation due to series resistance. This series resistance varies with

Using the conventional spherical coordinates r, θ and ϕ, the far-field electric field Eθ and the

0 0 0 0 <sup>0</sup> sin( ) sin( ) 60 sin( )

 θ

λλ

 λ

= == (2)

 π

> θ

= = (3)

*rrr*

0 0 sin( ) sin( ) 4 2

*r r*

*E H ds* θ ϕ

ϕ

 = × 

θ

where the wave number, k = 2π/λ. Note that since the current I0 has a magnitude and phase,

*s*

The far-field power radiated is obtained by integrating the Poynting vector over a closed surface, chosen to be a sphere of radius r, where r is much larger than the wavelength and the length of the power line dimensions as shown in equation (4). For an elementary doublet

− −

−− −

far-field magnetic field Hϕ for this elementary doublet is given by (Balanis 1997) as:

*jkr jkr jkr j kI le j Ile j Ile <sup>E</sup>*

*jkr jkr jkI le jI le <sup>H</sup>*

π

<sup>1</sup> P Re 2 *rad*

4 2

θη

π *l I* η

 <sup>=</sup> 

2

(1)

 θ

(4)

, resulting in a constant of 2*π* for that

*o*

λ

ERGON for developing a PLC communication system for SWER lines.

the current in the conductor, I0, and is shown in (Balanis, 1997) to be:

Because the line is long, I0 will not be constant. Three factors affect I0:

frequency due to the skin depth varying with frequency. 2. I0 is altered in phase, along the line, due to wave propagation.

3. I0 is progressively reduced because power is radiated.

π

ϕ

in free space, the inner integrand is independent of

θ

both Eθ and Hϕ are complex quantities.

integration, so that:

η P

*rad*

**2. Fundamental principles** 

**2.1 Line radiation theory** 

developed.

$$P\_{nd} = \frac{\pi}{2\eta\_0} \int\_0^{2\pi} \left| \mathbf{E}(\theta) \right| r^2 \sin(\theta) d\theta = \frac{1}{240} \int\_0^{2\pi} \left| \mathbf{E}(\theta) \right| r^2 \sin(\theta) d\theta \tag{5}$$

For a very long wire antenna, such as a power line, the magnitude and phase of the current I0 and Eθ at a position along the line is iteratively determined by considering the radiation and resistive line losses up to that point. This is then be used to determine Eθ caused by the elementary doublet at that point. At a point along the line, the Eθ vector from the elementary doublet is added to the cumulative Eθ vector, to produce the new cumulative Eθ vector. For a line in free space, the cumulative fields are independent of ϕ, so that (5) can be used to evaluate the radiated power.

If the conductor is not in free space, but is a single power line, a distance h above an ideal groundplane, then equal and opposite image current will be induced below the groundplane. That changes the radiation pattern, so that the radiation is no longer independent of ϕ. A Medium Voltage (11 kV to 33 kV) single power line is typically 7 m above the ground. If this is used for power line communication signals up to 1 MHz, then the power line is far less than a quarter wavelength above the ground. The far-field electric field for an elementary doublet a distance h above a perfectly conducting ground plane will be:

$$\mathrm{E}(\theta,\varphi) = \mathrm{E}\_{\theta}(2j\mathrm{Sim}(\frac{\pi\mathfrak{L}\mathfrak{h}}{\lambda}\mathrm{Cos}(\varphi)) = -\frac{120\pi I\_0le^{-jkr}\sin(\theta)}{\lambda r}\mathrm{Sim}(\frac{\pi\mathfrak{L}\mathfrak{h}}{\lambda}\mathrm{Cos}(\varphi))\tag{6}$$

The radiation pattern from the elementary doublet will then have a null along the conductor (θ=0), as it had for the free space conductor and in addition it will have a null along the groundplane (ϕ=90°) and a maximum perpendicular to the groundplane (θ = ϕ = 90°). The field in this direction depends on 2h, the separation between the line and the return path. For SWER lines, the ground plane is not a perfectly conducting plane and the distance of the ground return path below the ground level is given by Carson's equation (Carson, 1926, Wang & Liu, 2001, Deri & Tevan, 1981):

$$D = 2(h + \sqrt{\frac{\rho\_s}{2\pi F \mu\_0}})\tag{7}$$

where h is the height of the SWER line above ground, ρs is the soil resistivity. To use this for a SWER line we replace the line separation 2h in equation (6) by D in equation (7).

At 50 Hz the return path is typically 1km below ground and at 100 kHz it is about 36 m below ground. In both cases the return path distance is still much less than a quarter wavelength, so no additional nulls appear in the field from the elementary doublet. Since the effective line spacing varies, the line capacitance and characteristic impedance also change with frequency.

Equation (6) can also be used to determine the radiation from overhead power lines where the PLC signals are applied in a differential form on two conductors with a line separation of *2h*.

From knowing the skin depth, the diameter of the conductor and its conductivity, the resistance of conductor for the elementary doublet length can be calculated. Knowing the current flowing through the elementary doublet, the resistive losses can then be calculated. Knowing the current flowing into the present elementary doublet and keeping the characteristic impedance of the line fixed at the value for the operating frequency, the current I0 flowing into the next elementary doublet can determined by subtracting the cumulated power lost in radiation and the cumulated resistive losses from the input power to the present elementary doublet as shown in (8).

$$I\_0 = \sqrt{\frac{I\_{in}^2 Z\_0 - P\_{rad} - P\_{res}}{Z\_0}}\tag{8}$$

Calculating Radiation from Power Lines for Power Line Communications 227

To avoid calculation Kelvin-Bessel functions and considering that the conductor is made up of several strands with a steel core and aluminium cladding, equation (9) can be

2 2

where *Rcdc* is the DC resistance of the whole conductor, if it were made from aluminium only, *RWdc* is the actual DC resistance of the whole conductor and *as* is the radius of each strand. At high frequencies the resistance is determined by the skin depth in the aluminium cladding and the low frequency asymptote is the actual DC resistance of the whole steel core bundled conductor. If a conductor is made up of solid steel or solid aluminium, then *RCdc* = *RWdc*. The difference between (9) and (13) for Steel Cored Galvanized Zinc (SCGZ) conductors is less than 3.4% for frequencies above 3 kHz. For Aluminium conductors, the error is less than 3.4% for frequencies above 30 kHz. Equation (9) cannot be applied to SCAC conductors, so that equation (13) is an acceptable equation for all conductors at PLC

+

δ

<sup>4</sup> / <sup>10</sup> *e i <sup>D</sup> L Log L mH km*

where *L* is the inductance of the line, *Li* is the internal inductance, *D* is the distance between the conductor and the one carrying the return path. For SWER lines, this is given by equation (7). *K* is a constant, where *K* = 2 if the transmission line consists of a conductor

<sup>2</sup> /

μ

*<sup>r</sup> Li a* μ μ

=

*K a*

above a ground plane and *K* = 1 if the transmission line consists of a balanced line.

36 ( ) *r e <sup>K</sup> C F km <sup>D</sup> Log a*

ε=

*<sup>L</sup> <sup>Z</sup>*

For SWER lines, three types of conductors are commonly used. The oldest lines use Steel Core Galvanised Zinc (SCGZ) cables. These are basically fencing wire and typically have 3 strands, each of 2.75 mm diameter (Olex, 2006). The DC resistance at 20 °C is 11 Ω. The zinc coating is very thin and it's thickness is not adequately specified and varies with age. As a

4 *Cdc S*

The line inductance for a line, can similarly be approximated to:

*R a R R* δ

2

= + (13)

(14)

(16)

*<sup>C</sup>* <sup>=</sup> (17)

= + (15)

*Wdc*

approximated to:

frequencies.

**3. Matlab® implementation 3.1 Transmission line parameters** 

result these lines are modelled as steel lines.

This process of adding an elementary doublet, calculating the resulting cumulative Eθ , cumulative radiated power, resistive losses and evaluating the current I0 flowing into the next elementary doublet, is repeated to determine the Eθ and the power radiated and the resistive losses for the whole line. The accuracy of this model has been verified by the authors (Reid & Kikkert, 2008) by comparing its results for short line lengths with those from standard equations.

#### **2.2 Transmission line parameters**

To calculate the resistive losses and radiation losses, accurate transmission line parameters need to be used. The fundamental equations for transmission line parameters are shown in (Johnson, 1950). Those equations have been used by the author (Kikkert & Reid, 2009) to derive the line parameters for power lines.

In a conductor, most of the current flows in the outer layer of the conductor, with a thickness of the skin depth (δ). The equation for the resistance of the line is given by equation (9) (Johnson 1950):

$$R = \frac{\rho}{\sqrt{2\pi a \delta}} \frac{ber(q)\frac{d}{dq}bei(q) - bei(q)\frac{d}{dq}ber(q)}{\left\{\frac{d}{dq}bei(q)\right\}^2 + \left\{\frac{d}{dq}ber(q)\right\}^2} \quad \Omega \;/\ m \tag{9}$$

where *ber* and *bei* are Kelvin-Bessel functions (Johnson 1950), *a* is the conductor radius, ρ is the resistivity of the conductor in ohm-meters, *q* is an intermediate constant and δ is the skin depth, *F* is the frequency in Hz and µ is the magnetic permeability (4π x 10-7 in free space), as given by equations (10) and (11).

$$
\rho = \sqrt{2} \frac{a}{\delta} \qquad \delta = \sqrt{\frac{\rho}{\pi \mu F}} \tag{10}
$$

$$R\_{dc} = \frac{\rho}{\pi a^2} \quad \Omega \text{ / } m \tag{11}$$

At high frequencies Fig 3.10 of (Johnson, 1950) shows equation (9) becomes approximately:

$$R = R\_{dc} \frac{a}{2\mathcal{S}} \tag{12}$$

Knowing the current flowing into the present elementary doublet and keeping the characteristic impedance of the line fixed at the value for the operating frequency, the current I0 flowing into the next elementary doublet can determined by subtracting the cumulated power lost in radiation and the cumulated resistive losses from the input power

> 2 0

*in rad res IZ P P <sup>I</sup> Z*

This process of adding an elementary doublet, calculating the resulting cumulative Eθ , cumulative radiated power, resistive losses and evaluating the current I0 flowing into the next elementary doublet, is repeated to determine the Eθ and the power radiated and the resistive losses for the whole line. The accuracy of this model has been verified by the authors (Reid & Kikkert, 2008) by comparing its results for short line lengths with those

To calculate the resistive losses and radiation losses, accurate transmission line parameters need to be used. The fundamental equations for transmission line parameters are shown in (Johnson, 1950). Those equations have been used by the author (Kikkert & Reid, 2009) to

In a conductor, most of the current flows in the outer layer of the conductor, with a thickness of the skin depth (δ). The equation for the resistance of the line is given by

*d d ber q bei q bei q ber q dq dq R m*

*<sup>a</sup> d d bei q ber q dq dq*

where *ber* and *bei* are Kelvin-Bessel functions (Johnson 1950), *a* is the conductor radius,

depth, *F* is the frequency in Hz and µ is the magnetic permeability (4π x 10-7 in free space),

δ

<sup>2</sup> *R m dc* / *a* ρ

At high frequencies Fig 3.10 of (Johnson, 1950) shows equation (9) becomes approximately:

2 *dc <sup>a</sup> R R*

δ

π

the resistivity of the conductor in ohm-meters, *q* is an intermediate constant and

2 *a <sup>q</sup> <sup>F</sup>*

δ

2 2

ρ

= = (10)

= Ω (11)

<sup>=</sup> (12)

 πμ

() () () () / <sup>2</sup> () ()

− = Ω + 

0

− − <sup>=</sup> (8)

(9)

δ

ρis

is the skin

0

to the present elementary doublet as shown in (8).

from standard equations.

equation (9) (Johnson 1950):

as given by equations (10) and (11).

**2.2 Transmission line parameters** 

derive the line parameters for power lines.

ρ

π δ To avoid calculation Kelvin-Bessel functions and considering that the conductor is made up of several strands with a steel core and aluminium cladding, equation (9) can be approximated to:

$$R = \sqrt{\frac{R\_{\rm Cdc}{}^2 a\_S^2}{4\delta} + R\_{\rm Vdc}{}^2} \tag{13}$$

where *Rcdc* is the DC resistance of the whole conductor, if it were made from aluminium only, *RWdc* is the actual DC resistance of the whole conductor and *as* is the radius of each strand. At high frequencies the resistance is determined by the skin depth in the aluminium cladding and the low frequency asymptote is the actual DC resistance of the whole steel core bundled conductor. If a conductor is made up of solid steel or solid aluminium, then *RCdc* = *RWdc*. The difference between (9) and (13) for Steel Cored Galvanized Zinc (SCGZ) conductors is less than 3.4% for frequencies above 3 kHz. For Aluminium conductors, the error is less than 3.4% for frequencies above 30 kHz. Equation (9) cannot be applied to SCAC conductors, so that equation (13) is an acceptable equation for all conductors at PLC frequencies.

The line inductance for a line, can similarly be approximated to:

$$L\_i = \frac{\mu\_r \mu\_0}{\sqrt{\frac{a^2}{4\delta^2} + 1}}\tag{14}$$

$$L = \frac{4}{10K} \mathcal{L} \text{log}\_e \left(\frac{D}{a} + L\_i\right) \text{ } mH \text{ } / \text{km} \tag{15}$$

where *L* is the inductance of the line, *Li* is the internal inductance, *D* is the distance between the conductor and the one carrying the return path. For SWER lines, this is given by equation (7). *K* is a constant, where *K* = 2 if the transmission line consists of a conductor above a ground plane and *K* = 1 if the transmission line consists of a balanced line.

$$\mathbf{C} = \frac{2K\varepsilon\_r}{3\hbar \mathrm{Log}\_\epsilon \left(\frac{D}{a}\right)} \quad \mu\mathrm{F} \text{ / km} \tag{16}$$

$$Z = \sqrt{\frac{L}{C}}\tag{17}$$

#### **3. Matlab® implementation**

#### **3.1 Transmission line parameters**

For SWER lines, three types of conductors are commonly used. The oldest lines use Steel Core Galvanised Zinc (SCGZ) cables. These are basically fencing wire and typically have 3 strands, each of 2.75 mm diameter (Olex, 2006). The DC resistance at 20 °C is 11 Ω. The zinc coating is very thin and it's thickness is not adequately specified and varies with age. As a result these lines are modelled as steel lines.

Calculating Radiation from Power Lines for Power Line Communications 229

if SWER == 'y'; %if 'y' SWER Line, use Carson for line separation, if 'n' have balanced line

Cl = Er/(36.0\*log(LineSep/RadC)); %Line capacitance nF/m = uF/km Line in free

The evaluation of equation (6) is the core of the Matlab® program that is used to calculate the resulting Eθ fields for these cascaded line segments, using (2) to (3) and the intermediate equations shown in Reed & Kikkert, 2008. For a single line in space, the field is constant with respect to ϕ and equations (2) to (5) can be used to determine the radiation pattern and the radiated power. For a line above ground, equation (6) needs to be used and integration over both ϕ and θ need to be done. A 10 km line at 100 kHz is 3.33 wavelengths long and as

Doubling the signal frequency, doubles the electrical length of the line and thus the number of lobes in the radiation pattern, and requires a halving of the angular interval for the determination of the radiated power for integrating equation (6) for E over θ and ϕ. In addition, the line has twice the number of elementary doublets, thus requiring 8 times number of calculations to be done. It is thus critical to get the optimum electrical line length for the elementary doublet and the optimum angular increment to obtain good accuracy, while minimising the number of calculations required. The initial work for this topic was done using a elementary doublet length of 0.01 λ or 0.1 km, whichever is the smallest, to ensure a high level of accuracy, so that for a 10 km line at 100 kHz, 299 line segments are used and at 100 MHz, 299980 line segments are used. For the results presented here the length for the elementary doublet is chosen to be 1/64 wavelength or 0.1 km, whichever is the smallest, since simulations showed that reducing the length below the 1/64 wavelength starts to affect the accuracy and 0.1 km is required since the printing of results are done at

0.1 km intervals. This then results in 200 elementary doublets for the line of figure 1.

The initial work for this topic was done at the 3600 angular intervals regardless of the signal frequency, to ensure that accurate fields were obtained for a 100 km long line at 100 kHz. It was found that one quarter of the number of elementary doublets used results in an accurate measure of radiated power, resulting in 50 angular intervals. The integration of the fields in the θ direction is done over the whole 0 to 360 degree region, and those in the ϕ direction only need to be done if from 0 to 90 degrees, due to symmetry. If the angular increment in the θ and ϕ directions are to be the same, then the number of angles is to be divisible by 4.

RealZo = Mu0\*c; %Single line characteristic impedance in free space 376 ohm

Cl = Er\*K1/(36.0\*log(LineSep/RadL)); %Line Capacitance nF/m SWER line

 K1=2.0; %for SWER K1=2 Line with Groundplane, like SWER line LineSep= 2.0\*(h+sqrt(RhoS/(twopi\*Freq\*Mu0))); %Carson's depth

LineSep = 2.0\*h; %Line separation for differential line configuration

Lkm = (4\*log(LineSep/RadL)+MuR\*Lr)/(K1\*10); %inductance (mH)/km

RealZo = sqrt(1.0e6\*Lkm/Ckm); % Real part of Z for resistive losses.

K1=1.0; %for SWER K1=2 Balanced line.

Ckm = Cl\*1000.0; %line capacitance per km

else

else

space end;

end;

**3.2 Radiated power** 

shown in figure 1, has 14 main lobes.

Most SWER lines have a high current backbone, which then feeds many lower current spurs. The newer spurs use Steel Core Aluminium Clad (SCAC) cables. Typically these cables have 3 strands, each of 2.75 mm diameter (Olex, 2006), with an aluminium area of 5.91 mm2 and a total area of 17.28 mm2. The DC resistance at 20 °C is 4.8 Ω. The high power backbone typically uses Sultana (Olex, 2006) cables, which consist of 4 strands of Aluminium wires of 3 mm diameter around a galvanised steel core of 3 wires of 3 mm diameter. The DC resistance at 20 °C is 0.897 Ω. Since the conductivity of the steel is much less than the aluminium, these lines are modelled as pure aluminium conductors. Other power line conductor configurations are used in practice. They can be incorporated by simply specifying the correct wire diameter, the diameter of the whole conductor, the number of strands and for composite conductors, the area of Aluminium and the area of steel. In addition the conductivity and the permeability of the cable is also required. Those variables are listed at the start of the Matlab® program, the relevant ones for a SCAC conductor are as follows:

RhoC= 2.82e-8; %resistivity of conductor 2.82e-8 for Al, 1.74e-7 for steel RhoS= 30.0 ; %resistivity of soil typical 30 DiaC= 2.75e-3; %diameter of conductor strand in m for default 2.75mm ALArea=5.91; %Area of Aluminium in conductor SCAC LineArea=17.82; %Conductor Area SCAC NSC=3; %number of conductor strands default 3 DiaL=5.9e-3; %Nominal Line Diameter m, 5.9 mm for SCGZ, SCAC Er=4.5; %Dielectric constant for the spacing between conductors. 4.5 for SWER from measurements RadC = DiaC/2.0; %conductor radius for skin depth and resistance RadL = DiaL/2.0; %Line radius for capacitance and inductance Mu0=4.0\*pi\*1.0e-7; %mu0 for free space MuR=1.0; % Mur=70 for steel (SCGZ), 1 for Aluminium (SCAC and Sultana) MuC = Mu0\*MuR;

Rdc = RhoC\*1000.0/(NSC\*pi\*RadC\*RadC);

RdcW = Rdc\*LineArea/ALArea ; %DC resistance of Aluminium part of the line.

For SCGZ conductors, the above values are changed to the SCGZ values. For SCGZ and pure aluminium conductors, the last line above is simply changed to:

RdcW = Rdc; %DC resistance of Aluminium part of the line or Steel for a SCGZ line.

The Matlab® program uses these line parameters to calculates the skin depth using equation (10) and uses that together with equations (11) and (13) to determine the actual line resistance. The line inductance and characteristic impedance of the line is calculated using equations from (Johnson, 1950) and Carson's Depth equation (7) as needed. The transmission line impedance, is then used to determine the resistive losses of the transmission line and using equation (8) is used to determine the current flowing into the next elementary doublet. The relevant equations are:

SkinDepth = sqrt(2.0\*RhoC/(twopi\*Freq\*MuC)); %Johnson 1950, pp 74

Rs = (sqrt(Rdc\*Rdc\*RadC\*RadC/(4.0\*SkinDepth\*SkinDepth)+RdcW\*RdcW));

%Line resistance per km asymptote at actual DC resistance of line (RdcW).

Lr = 1.0/(sqrt(RadL\*RadL/(4.0\*SkinDepth\*SkinDepth)+1)); % internal inductance if FreeSpace == 'y'; %if 'y' Line in Free Space if 'n' line with groundplane or balanced transmission line.

```
 RealZo = Mu0*c; %Single line characteristic impedance in free space 376 ohm 
else 
if SWER == 'y'; %if 'y' SWER Line, use Carson for line separation, if 'n' have balanced line 
 K1=2.0; %for SWER K1=2 Line with Groundplane, like SWER line 
 LineSep= 2.0*(h+sqrt(RhoS/(twopi*Freq*Mu0))); %Carson's depth 
 Cl = Er*K1/(36.0*log(LineSep/RadL)); %Line Capacitance nF/m SWER line 
 else
 K1=1.0; %for SWER K1=2 Balanced line. 
 LineSep = 2.0*h; %Line separation for differential line configuration 
 Cl = Er/(36.0*log(LineSep/RadC)); %Line capacitance nF/m = uF/km Line in free 
space 
 end;
 Lkm = (4*log(LineSep/RadL)+MuR*Lr)/(K1*10); %inductance (mH)/km 
 Ckm = Cl*1000.0; %line capacitance per km 
 RealZo = sqrt(1.0e6*Lkm/Ckm); % Real part of Z for resistive losses. 
end;
```
#### **3.2 Radiated power**

228 MATLAB for Engineers – Applications in Control, Electrical Engineering, IT and Robotics

Most SWER lines have a high current backbone, which then feeds many lower current spurs. The newer spurs use Steel Core Aluminium Clad (SCAC) cables. Typically these cables have 3 strands, each of 2.75 mm diameter (Olex, 2006), with an aluminium area of 5.91 mm2 and a total area of 17.28 mm2. The DC resistance at 20 °C is 4.8 Ω. The high power backbone typically uses Sultana (Olex, 2006) cables, which consist of 4 strands of Aluminium wires of 3 mm diameter around a galvanised steel core of 3 wires of 3 mm diameter. The DC resistance at 20 °C is 0.897 Ω. Since the conductivity of the steel is much less than the aluminium, these lines are modelled as pure aluminium conductors. Other power line conductor configurations are used in practice. They can be incorporated by simply specifying the correct wire diameter, the diameter of the whole conductor, the number of strands and for composite conductors, the area of Aluminium and the area of steel. In addition the conductivity and the permeability of the cable is also required. Those variables are listed at the start of the Matlab® program, the relevant ones for a SCAC

RhoC= 2.82e-8; %resistivity of conductor 2.82e-8 for Al, 1.74e-7 for steel

DiaC= 2.75e-3; %diameter of conductor strand in m for default 2.75mm

Er=4.5; %Dielectric constant for the spacing between conductors. 4.5 for SWER from

DiaL=5.9e-3; %Nominal Line Diameter m, 5.9 mm for SCGZ, SCAC

RadC = DiaC/2.0; %conductor radius for skin depth and resistance RadL = DiaL/2.0; %Line radius for capacitance and inductance

pure aluminium conductors, the last line above is simply changed to:

SkinDepth = sqrt(2.0\*RhoC/(twopi\*Freq\*MuC)); %Johnson 1950, pp 74 Rs = (sqrt(Rdc\*Rdc\*RadC\*RadC/(4.0\*SkinDepth\*SkinDepth)+RdcW\*RdcW)); %Line resistance per km asymptote at actual DC resistance of line (RdcW). Lr = 1.0/(sqrt(RadL\*RadL/(4.0\*SkinDepth\*SkinDepth)+1)); % internal inductance if FreeSpace == 'y'; %if 'y' Line in Free Space if 'n' line with groundplane or balanced

MuR=1.0; % Mur=70 for steel (SCGZ), 1 for Aluminium (SCAC and Sultana)

RdcW = Rdc\*LineArea/ALArea ; %DC resistance of Aluminium part of the line.

For SCGZ conductors, the above values are changed to the SCGZ values. For SCGZ and

RdcW = Rdc; %DC resistance of Aluminium part of the line or Steel for a SCGZ line. The Matlab® program uses these line parameters to calculates the skin depth using equation (10) and uses that together with equations (11) and (13) to determine the actual line resistance. The line inductance and characteristic impedance of the line is calculated using equations from (Johnson, 1950) and Carson's Depth equation (7) as needed. The transmission line impedance, is then used to determine the resistive losses of the transmission line and using equation (8) is used to determine the current flowing into the

ALArea=5.91; %Area of Aluminium in conductor SCAC

conductor are as follows:

measurements

MuC = Mu0\*MuR;

transmission line.

RhoS= 30.0 ; %resistivity of soil typical 30

LineArea=17.82; %Conductor Area SCAC

Mu0=4.0\*pi\*1.0e-7; %mu0 for free space

Rdc = RhoC\*1000.0/(NSC\*pi\*RadC\*RadC);

next elementary doublet. The relevant equations are:

NSC=3; %number of conductor strands default 3

The evaluation of equation (6) is the core of the Matlab® program that is used to calculate the resulting Eθ fields for these cascaded line segments, using (2) to (3) and the intermediate equations shown in Reed & Kikkert, 2008. For a single line in space, the field is constant with respect to ϕ and equations (2) to (5) can be used to determine the radiation pattern and the radiated power. For a line above ground, equation (6) needs to be used and integration over both ϕ and θ need to be done. A 10 km line at 100 kHz is 3.33 wavelengths long and as shown in figure 1, has 14 main lobes.

Doubling the signal frequency, doubles the electrical length of the line and thus the number of lobes in the radiation pattern, and requires a halving of the angular interval for the determination of the radiated power for integrating equation (6) for E over θ and ϕ. In addition, the line has twice the number of elementary doublets, thus requiring 8 times number of calculations to be done. It is thus critical to get the optimum electrical line length for the elementary doublet and the optimum angular increment to obtain good accuracy, while minimising the number of calculations required. The initial work for this topic was done using a elementary doublet length of 0.01 λ or 0.1 km, whichever is the smallest, to ensure a high level of accuracy, so that for a 10 km line at 100 kHz, 299 line segments are used and at 100 MHz, 299980 line segments are used. For the results presented here the length for the elementary doublet is chosen to be 1/64 wavelength or 0.1 km, whichever is the smallest, since simulations showed that reducing the length below the 1/64 wavelength starts to affect the accuracy and 0.1 km is required since the printing of results are done at 0.1 km intervals. This then results in 200 elementary doublets for the line of figure 1.

The initial work for this topic was done at the 3600 angular intervals regardless of the signal frequency, to ensure that accurate fields were obtained for a 100 km long line at 100 kHz. It was found that one quarter of the number of elementary doublets used results in an accurate measure of radiated power, resulting in 50 angular intervals. The integration of the fields in the θ direction is done over the whole 0 to 360 degree region, and those in the ϕ direction only need to be done if from 0 to 90 degrees, due to symmetry. If the angular increment in the θ and ϕ directions are to be the same, then the number of angles is to be divisible by 4.

Calculating Radiation from Power Lines for Power Line Communications 231

 for Theta=1:1:NumTh %Loop to consider all angles Theta 0-360 Eed\_M(Theta) = 60\*pi\*edL\*I\*sinarr(Theta)\*sin(EedPhi);

 Etp(Theta)=complex(E\_RE(Theta),E\_IM(Theta)); %Total E field Esum(Theta)=Esumd(Theta)+Etp(Theta); %Progressive sum

% Calculate the radiated & dissipated power and attenuation

E\_squared(Theta)= (real(Esum(Theta))\*real(Esum(Theta)) +

\*dtheta)/240); %Integration 360 deg, 240 = 4x60

PdissN = Pdiss/Pin; %Resistive Loss, normalise wrt input.

 for Phi=1:1:NumPhi %Loop to consider all angles Phi (0-90) for Theta=1:1:NumTh %Loop to consider all angles Theta 0-360

Eed\_M(Theta,Phi) = 60\*pi\*edL\*I\*sinarr(Theta)\*sin(EedPhi(Phi)); % eqn (6)

imag(Esum(Theta))\*imag(Esum(Theta)))';

Pdiss = Pdiss + I\*I\*ResistperSegment;

%calculate current at output of dipole.

% more code writing to file, plotting etc.

I = 0; %No more current left all dissipated.

for Theta=1:1:NumTh %Loop to consider all angles Theta

%Field of elementary doublet of length edL, eqn (6), complex variable.

edL\_Ph=twopi\_edL\*(segment-1); %Phase of I in current edL segment.

Esumd(Theta)= Esum(Theta); %store current value for next iteration

PowerRadiated = (PowerRadiated +E\_squared(Theta)\*abs(sinarr(Theta))

PRadN = PowerRadiated/Pin; %Radiated power, normalise wrt input.

I2 = (Pin - PowerRadiated - Pdiss)/RealZo; %Current into next segment

AttenuationResulting = 20\*log10(I/Io); %cumulative total attenuation of the line

For a line above a ground plane, a 3 dimensional integration, with θ and ϕ must be made. Here the axis origin is at the groundplane and the maximum radiated field of the elementary doublet is perpendicular to the groundplane. The 3 dimensional field is calculated by adding another loop with a variable Phi, around the code for evaluation E(θ)

 E\_RE(Theta)= cos(edL\_Ph\*(cosarr(Theta)-1))\*Eed\_M(Theta); % real E\_ field E\_IM(Theta)=-sin(edL\_Ph\*(cosarr(Theta)-1))\*Eed\_M(Theta); % imag E\_ field

for segment=1:1:N %N is number of segments

if I>0

end;

end;

end;

 if I2>0 I = sqrt(I2);

else

end;

as shown as follows:

end;

if I>0

 Pout = I\*I\*RealZo/Pin; end; %Exit if no current left.

 PowerRadiated=0; for Theta=1:1:NumTh

Fig. 1. Radiation pattern for 10 km long conductor in free space at 100 kHz.

As a result 52 angular intervals are required. This gives the same accuracy to 5 decimal places compared with 3600 angular intervals. To produce nice looking plots, as shown in figure 1, a minimum of 256 angles are used. The relevant code is shown below:

% N is the number of elementary douplets making up the

NumTh=4\*round(N/16); %number of angles per circle same as N by 4 as default.

if (NumTh > 3600) NumTh = 3600; end; %Limit to 0.1 degree.

if (NumTh < 256 ) NumTh = 256; end; %Limit to 256 for good looking plots

dtheta=twopi/NumTh; %delta theta for a vector of angles and for integration 360 deg

For long power lines, the radiation pattern has many narrow lobes, as a result many angular intervals are required for the Matlab® evaluation of the radiation patterns. To avoid having to calculate sine and cosine for the same angles over and over again, these sine and cosine values are stored in an array, thus speeding up the calculations. This is done as follows:

% COMPUTE ANGLES, SINE OF ANGLES AND COSINE OF ANGLES

```
for angle=1:NumTh
```

```
 angles(angle)=dtheta*(angle-1) + 0.5*dtheta; %array of angles 
 sinarr(angle)=sin(angles(angle)); %array of Sine used for both Theta and Phi 
 cosarr(angle)=cos(angles(angle)); %array of Cos used for both Theta and Phi 
end;
```
For a line in free space, this array is then used to calculate the cumulative E(θ) due to the elementary doublet length (dipL) having been added to E(θ) as shown below. This Esum(Theta) is the cumulative E(θ) and can then be used to calculate the cumulative radiated power as follows:

```
for segment=1:1:N %N is number of segments 
 if I>0
 for Theta=1:1:NumTh %Loop to consider all angles Theta 0-360 
 Eed_M(Theta) = 60*pi*edL*I*sinarr(Theta)*sin(EedPhi); 
 %Field of elementary doublet of length edL, eqn (6), complex variable. 
 end;
 edL_Ph=twopi_edL*(segment-1); %Phase of I in current edL segment. 
 for Theta=1:1:NumTh %Loop to consider all angles Theta 
 E_RE(Theta)= cos(edL_Ph*(cosarr(Theta)-1))*Eed_M(Theta); % real E_ field 
 E_IM(Theta)=-sin(edL_Ph*(cosarr(Theta)-1))*Eed_M(Theta); % imag E_ field 
 Etp(Theta)=complex(E_RE(Theta),E_IM(Theta)); %Total E field 
 Esum(Theta)=Esumd(Theta)+Etp(Theta); %Progressive sum 
 Esumd(Theta)= Esum(Theta); %store current value for next iteration 
 end;
 % Calculate the radiated & dissipated power and attenuation 
 PowerRadiated=0; 
 for Theta=1:1:NumTh
 E_squared(Theta)= (real(Esum(Theta))*real(Esum(Theta)) + 
 imag(Esum(Theta))*imag(Esum(Theta)))'; 
 PowerRadiated = (PowerRadiated +E_squared(Theta)*abs(sinarr(Theta)) 
 *dtheta)/240); %Integration 360 deg, 240 = 4x60 
 end;
 Pdiss = Pdiss + I*I*ResistperSegment; 
 PdissN = Pdiss/Pin; %Resistive Loss, normalise wrt input. 
 PRadN = PowerRadiated/Pin; %Radiated power, normalise wrt input. 
 %calculate current at output of dipole. 
 I2 = (Pin - PowerRadiated - Pdiss)/RealZo; %Current into next segment 
 if I2>0
 I = sqrt(I2); 
 else
 I = 0; %No more current left all dissipated. 
 end; 
 AttenuationResulting = 20*log10(I/Io); %cumulative total attenuation of the line 
 Pout = I*I*RealZo/Pin; 
 end; %Exit if no current left. 
 % more code writing to file, plotting etc. 
end;
```
For a line above a ground plane, a 3 dimensional integration, with θ and ϕ must be made. Here the axis origin is at the groundplane and the maximum radiated field of the elementary doublet is perpendicular to the groundplane. The 3 dimensional field is calculated by adding another loop with a variable Phi, around the code for evaluation E(θ) as shown as follows:

```
if I>0
```
230 MATLAB for Engineers – Applications in Control, Electrical Engineering, IT and Robotics

Fig. 1. Radiation pattern for 10 km long conductor in free space at 100 kHz.

figure 1, a minimum of 256 angles are used. The relevant code is shown below:

if (NumTh < 256 ) NumTh = 256; end; %Limit to 256 for good looking plots

% COMPUTE ANGLES, SINE OF ANGLES AND COSINE OF ANGLES

 sinarr(angle)=sin(angles(angle)); %array of Sine used for both Theta and Phi cosarr(angle)=cos(angles(angle)); %array of Cos used for both Theta and Phi

For a line in free space, this array is then used to calculate the cumulative E(θ) due to the elementary doublet length (dipL) having been added to E(θ) as shown below. This Esum(Theta) is the cumulative E(θ) and can then be used to calculate the cumulative

angles(angle)=dtheta\*(angle-1) + 0.5\*dtheta; %array of angles

NumTh=4\*round(N/16); %number of angles per circle same as N by 4 as default.

dtheta=twopi/NumTh; %delta theta for a vector of angles and for integration 360 deg For long power lines, the radiation pattern has many narrow lobes, as a result many angular intervals are required for the Matlab® evaluation of the radiation patterns. To avoid having to calculate sine and cosine for the same angles over and over again, these sine and cosine values are stored in an array, thus speeding up the calculations. This is done as follows:

% N is the number of elementary douplets making up the

for angle=1:NumTh

radiated power as follows:

end;

if (NumTh > 3600) NumTh = 3600; end; %Limit to 0.1 degree.

As a result 52 angular intervals are required. This gives the same accuracy to 5 decimal places compared with 3600 angular intervals. To produce nice looking plots, as shown in

```
 for Phi=1:1:NumPhi %Loop to consider all angles Phi (0-90) 
 for Theta=1:1:NumTh %Loop to consider all angles Theta 0-360 
 Eed_M(Theta,Phi) = 60*pi*edL*I*sinarr(Theta)*sin(EedPhi(Phi)); % eqn (6)
```
Calculating Radiation from Power Lines for Power Line Communications 233

long lines at high frequency. Since the separation between the line and the return path is far less than a quarter wavelength for signals below 1 MHz, and as a result the dependence of the E fields has little dependence on ϕ. The radiated power derived from the field along the line and perpendicular to the ground plane can be used as an accurate measure of the radiated power of the power line. The accurate 3 D radiated power was calculated for many different frequencies, line lengths and line heights above ground. As a result, the radiated

PowerRadiated = PowerRad2D\*(0.5+0.65\*power(LineSepe,1.8)); PowerRad2D is the power obtained from the 2D field, LineSepe is the line separation in wavelengths. When the line separation is less than half a wavelength, the error due to the above approximation is better than 0.01%. A 2D calculation for the radiated power can thus be used reducing the calculation time by several orders of magnitude without loss of

> 1.8 <sup>2</sup> ( , ) ( ) (0.5 0.65 ) *rad rms rad rms <sup>h</sup> P P*

As a result of (18) the above Matlab® code can also be used for long lines above ground, or to find the radiation of overhead power lines with the PLC signals driven on two conductors

The main Matlab® program is over 500 lines long, but only the core parts of the code have

Figure 2 shows the field pattern from a 100 km long straight line, with the left figure being in free space and the right figure obtained from a SWER line 7 m above ground. The maximum gain for the free space line is 52.9 dB, while the maximum gain for the SWER line

Fig. 2. Radiation Straight line, 100 kHz, 100 km long. Left free space, max gain 52.9 dB and

= ×+ ∗

λ

(18)

 θ

power for all these variations can accurately be determined as follows:

θϕ

accuracy. The 3D radiated power is thus:

in a balanced fashion.

**4. Wobble** 

been described in this section.

Right SWER line max gain 21.6 dB.

```
 end;
 end;
 edL_Ph=twopi_edL*(segment-1); %Phase of I in current edL segment. 
 for Phi=1:1:NumPhi %Loop to consider all angles Phi (0-90) 
 for Theta=1:1:NumTh %Loop to consider all angles Theta 
 E_RE(Theta,Phi)= cos(edL_Ph*(cosarr(Theta)-1))*Eed_M(Theta,Phi); % real E 
 E_IM(Theta,Phi)=-sin(edL_Ph*(cosarr(Theta)-1))*Eed_M(Theta,Phi); % imag E 
 Etp(Theta)=complex(E_RE(Theta),E_IM(Theta)); %Total E field 
 Esum(Theta,Phi)=Esumd(Theta,Phi)+Etp(Theta,Phi); %Progressive sum 
 Esumd(Theta,Phi)= Esum(Theta,Phi); %store current value for next iteration 
 end;
 end;
 % Calculate the radiated & dissipated power and attenuation 
 PowerRadiated=0; 
 for Phi=1:1:NumPhi %Loop to consider all angles Phi (0-90) 
 for Theta=1:1:NumTh
 E_squared(Theta,Phi)= (real(Esum(Theta,Phi))*real(Esum(Theta,Phi)) + 
 imag(Esum(Theta,Phi))*imag(Esum(Theta,Phi)))'; 
 PowerRadiated = (PowerRadiated + E_squared(Theta,Phi)*abs(sinarr(Theta)) 
 *dtheta)/240); %Integration 360 deg 240 = 6x60
 end;
 if Phi == 1
 PowerRad2D=PowerRadiated; % same as for 2D plot. 
 end;
 end;
 PowerRadiated=2*PowerRadiated*dtheta/pi; %note dtheta=dphi 3D radiated power 
 RadN2D = PowerRad2D*(0.5+0.65*power(LineSepe,1.8))/Pin; 
 % derived from 2D plot, same value 
 % as 3D plot. allows 2D calculations to be used for lines with groundplane. 
 Pdiss = Pdiss + I*I*ResistperSegment; 
 PdissN = Pdiss/Pin; %Resistive Loss, normalise wrt input. 
 PRadN = PowerRadiated/Pin; %Radiated power, normalise wrt input. 
 %calculate current at output of dipole. 
 I2 = (Pin - PowerRadiated - Pdiss)/RealZo; %Current into next segment 
 if I2>0
 I = sqrt(I2); 
 else
 I = 0; %No more current left all dissipated. 
 end;
 AttenuationResulting = 20*log10(I/Io); %cumulative total attenuation of the line 
 Pout = I*I*RealZo/Pin; 
end; %Exit if no current left. 
% more code writing to file, plotting etc.
```
The 3D calculation for a 10 km SWER line with a 100 kHz PLC signal takes a few minutes on a fast PC. The same calculations for a 300 kHz PLC signal take several hours and the calculations for a 1 MHz PLC signal are expected to take several weeks, since less than 1% of the calculations were done overnight. It is thus nearly impossible to evaluate the fields from long lines at high frequency. Since the separation between the line and the return path is far less than a quarter wavelength for signals below 1 MHz, and as a result the dependence of the E fields has little dependence on ϕ. The radiated power derived from the field along the line and perpendicular to the ground plane can be used as an accurate measure of the radiated power of the power line. The accurate 3 D radiated power was calculated for many different frequencies, line lengths and line heights above ground. As a result, the radiated power for all these variations can accurately be determined as follows:

$$\text{PowerR radiated} = \text{PowerRad2D\*(0.5+0.65^\* \text{power(LineSeepe,1.8)});}$$

PowerRad2D is the power obtained from the 2D field, LineSepe is the line separation in wavelengths. When the line separation is less than half a wavelength, the error due to the above approximation is better than 0.01%. A 2D calculation for the radiated power can thus be used reducing the calculation time by several orders of magnitude without loss of accuracy. The 3D radiated power is thus:

$$P\_{nul}(\theta,\varphi)\_{rms} = P\_{nul}(\theta)\_{rms} \times (0.5 + 0.65 \times \left(\frac{2h}{\mathcal{X}}\right)^{1.8}) \tag{18}$$

As a result of (18) the above Matlab® code can also be used for long lines above ground, or to find the radiation of overhead power lines with the PLC signals driven on two conductors in a balanced fashion.

The main Matlab® program is over 500 lines long, but only the core parts of the code have been described in this section.

#### **4. Wobble**

232 MATLAB for Engineers – Applications in Control, Electrical Engineering, IT and Robotics

edL\_Ph=twopi\_edL\*(segment-1); %Phase of I in current edL segment.

 E\_RE(Theta,Phi)= cos(edL\_Ph\*(cosarr(Theta)-1))\*Eed\_M(Theta,Phi); % real E E\_IM(Theta,Phi)=-sin(edL\_Ph\*(cosarr(Theta)-1))\*Eed\_M(Theta,Phi); % imag E

 Esum(Theta,Phi)=Esumd(Theta,Phi)+Etp(Theta,Phi); %Progressive sum Esumd(Theta,Phi)= Esum(Theta,Phi); %store current value for next iteration

E\_squared(Theta,Phi)= (real(Esum(Theta,Phi))\*real(Esum(Theta,Phi)) +

PowerRadiated = (PowerRadiated + E\_squared(Theta,Phi)\*abs(sinarr(Theta))

PowerRadiated=2\*PowerRadiated\*dtheta/pi; %note dtheta=dphi 3D radiated power

% as 3D plot. allows 2D calculations to be used for lines with groundplane.

PRadN = PowerRadiated/Pin; %Radiated power, normalise wrt input.

I2 = (Pin - PowerRadiated - Pdiss)/RealZo; %Current into next segment

AttenuationResulting = 20\*log10(I/Io); %cumulative total attenuation of the line

The 3D calculation for a 10 km SWER line with a 100 kHz PLC signal takes a few minutes on a fast PC. The same calculations for a 300 kHz PLC signal take several hours and the calculations for a 1 MHz PLC signal are expected to take several weeks, since less than 1% of the calculations were done overnight. It is thus nearly impossible to evaluate the fields from

 for Phi=1:1:NumPhi %Loop to consider all angles Phi (0-90) for Theta=1:1:NumTh %Loop to consider all angles Theta

% Calculate the radiated & dissipated power and attenuation

for Phi=1:1:NumPhi %Loop to consider all angles Phi (0-90)

imag(Esum(Theta,Phi))\*imag(Esum(Theta,Phi)))';

\*dtheta)/240); %Integration 360 deg 240 = 6x60

PowerRad2D=PowerRadiated; % same as for 2D plot.

RadN2D = PowerRad2D\*(0.5+0.65\*power(LineSepe,1.8))/Pin;

PdissN = Pdiss/Pin; %Resistive Loss, normalise wrt input.

% derived from 2D plot, same value

Pdiss = Pdiss + I\*I\*ResistperSegment;

%calculate current at output of dipole.

% more code writing to file, plotting etc.

I = 0; %No more current left all dissipated.

Etp(Theta)=complex(E\_RE(Theta),E\_IM(Theta)); %Total E field

 end; end;

 end; end;

 end; if Phi == 1

 end; end;

if I2>0

else

end;

I = sqrt(I2);

 Pout = I\*I\*RealZo/Pin; end; %Exit if no current left.

PowerRadiated=0;

for Theta=1:1:NumTh

Figure 2 shows the field pattern from a 100 km long straight line, with the left figure being in free space and the right figure obtained from a SWER line 7 m above ground. The maximum gain for the free space line is 52.9 dB, while the maximum gain for the SWER line

Fig. 2. Radiation Straight line, 100 kHz, 100 km long. Left free space, max gain 52.9 dB and Right SWER line max gain 21.6 dB.

Calculating Radiation from Power Lines for Power Line Communications 235

of the fields cancelling as new elementary doublets are added. Figure 5 shows that the wobble increases the radiated power significantly and on average, the radiated power keeps increasing as the distance increases. For short lines, less than 3 km, the lobes of radiation are broad and the wobble is small compared to the beamwidth, so that the straight line and the line with wobble result in virtually the same radiation. For long lines the wobble is comparable to or larger than the beamwidth of the radiation pattern lobes and the difference between the radiation from the straight line and the line with wobble becomes larger.

Fig. 4. Radiation line with 50 mrad wobble, 100 kHz, 100 km long. Left free space, max gain

49.8 dB and right SWER line max gain 18.4 dB.

Fig. 5. a. Radiation loss for a 100 kHz signal on a 100 km long line.

is 21.6 dB. The radiation patterns look the same, so that the SWER line has 31.4 dB less peak radiated power than the free space line. The total radiated power from the SWER line is 32.4 dB less for the SWER line than the free space line.

Practical power-lines are not absolutely straight. Any small bends, as the line direction changes to follow the terrain, has a major impact on the radiation pattern. Figure 3 shows the effect of the radiation loss as the change in line direction, called *wobble* in this paper, is varied every 0.1 km by a random angle with the standard deviation indicated. Figure 3 is for a 1 km long SWER line with a 1 MHz carrier frequency. If the wobble is comparable to the spacing between the side lobes, large changes in attenuation can result.

For the radiation results presented in the rest of this chapter, a 50 mrad wobble is used as that reasonably represents the power line geometry, has sufficient randomness and results in a sufficient increase in radiation, while avoiding the rapid changes in attenuation associated with a larger wobble. Including the wobble, results in a significantly increase in radiated power. The average results for figure 3 are obtained from 10 simulations at each value of wobble.

Fig. 3. Radiation loss of a SWER line with bends.

Figure 4 shows the radiated power for a line in free space and a SWER line when wobble is applied. The right graph of figure 2, shows the radiation patterns of a 100 km long straight SCAC SWER line with a 100 kHz carrier frequency, the right graph of figure 4 shows the corresponding radiation pattern of a SWER line with a 50 mrad wobble. The line with wobble has a 0.0415% radiation loss and the straight line has a 0.0118% radiation loss. The wobble will thus increase the radiated power by close to 4 times. The free space straight line has a radiation loss of 20.7%, while the line with wobble has lost all its input power after 90.5 km with a radiation loss of 60% and a resistive loss of 40%. Figure 5a shows these radiation losses versus distance for these four lines. It is interesting to note that for very long straight lines, the radiated power decreases as the line becomes longer. This is due to some

is 21.6 dB. The radiation patterns look the same, so that the SWER line has 31.4 dB less peak radiated power than the free space line. The total radiated power from the SWER line is

Practical power-lines are not absolutely straight. Any small bends, as the line direction changes to follow the terrain, has a major impact on the radiation pattern. Figure 3 shows the effect of the radiation loss as the change in line direction, called *wobble* in this paper, is varied every 0.1 km by a random angle with the standard deviation indicated. Figure 3 is for a 1 km long SWER line with a 1 MHz carrier frequency. If the wobble is comparable to the

For the radiation results presented in the rest of this chapter, a 50 mrad wobble is used as that reasonably represents the power line geometry, has sufficient randomness and results in a sufficient increase in radiation, while avoiding the rapid changes in attenuation associated with a larger wobble. Including the wobble, results in a significantly increase in radiated power. The average results for figure 3 are obtained from 10 simulations at each

Figure 4 shows the radiated power for a line in free space and a SWER line when wobble is applied. The right graph of figure 2, shows the radiation patterns of a 100 km long straight SCAC SWER line with a 100 kHz carrier frequency, the right graph of figure 4 shows the corresponding radiation pattern of a SWER line with a 50 mrad wobble. The line with wobble has a 0.0415% radiation loss and the straight line has a 0.0118% radiation loss. The wobble will thus increase the radiated power by close to 4 times. The free space straight line has a radiation loss of 20.7%, while the line with wobble has lost all its input power after 90.5 km with a radiation loss of 60% and a resistive loss of 40%. Figure 5a shows these radiation losses versus distance for these four lines. It is interesting to note that for very long straight lines, the radiated power decreases as the line becomes longer. This is due to some

32.4 dB less for the SWER line than the free space line.

Fig. 3. Radiation loss of a SWER line with bends.

value of wobble.

spacing between the side lobes, large changes in attenuation can result.

of the fields cancelling as new elementary doublets are added. Figure 5 shows that the wobble increases the radiated power significantly and on average, the radiated power keeps increasing as the distance increases. For short lines, less than 3 km, the lobes of radiation are broad and the wobble is small compared to the beamwidth, so that the straight line and the line with wobble result in virtually the same radiation. For long lines the wobble is comparable to or larger than the beamwidth of the radiation pattern lobes and the difference between the radiation from the straight line and the line with wobble becomes larger.

Fig. 4. Radiation line with 50 mrad wobble, 100 kHz, 100 km long. Left free space, max gain 49.8 dB and right SWER line max gain 18.4 dB.

Fig. 5. a. Radiation loss for a 100 kHz signal on a 100 km long line.

Calculating Radiation from Power Lines for Power Line Communications 237

inductance changes significantly with frequency. As a result of both of these effects, the characteristic impedance of the SWER line varies from 565 Ω at 50 Hz to 270 Ω at 100 kHz.

Figure 7 also shows the radiated power, expressed as a resistance. Below 300 kHz, the radiation is negligible, but at 5 MHz the same power is lost in radiation as in resistive losses. The radiation losses increase proportionally to the frequency2.77. Figure 8 shows the same plots for a SCAC conductor. Comparing figures 7 and 8 shows that the corner frequency

The parameters for a 3/2.75 SCAC SWER line obtained from the Matlab® program are shown in figure 8. The line resistance increases significantly with frequency. Despite the earth return path depth (7) varying from close to 2 km at 10 Hz to 16 m at 10 MHz, the characteristic impedance of the SWER line only varies from 344 Ω at 50 Hz to 258 Ω at 100 kHz. Figure 8 also shows the difference between the resistance of the line of it were a pure Aluminium line and the resistance of the SCAC line. Above 1 MHz all the current is carried in the Aluminium cladding. Figure 8 also shows the radiated power, expressed as a resistance. Below 300 kHz, the radiation is negligible, but at 1.5 MHz the same power is lost in radiation as in resistive losses. Equation (18) shows that the radiation losses increase proportionally to the frequency raised to the power 2.77. Comparing figures 7 and 8 show

Figure 9 shows the line losses for a 3/2.75 SCGZ SWER line. For frequencies below 1 MHz, the radiation losses are very small in comparison to the resistive losses. For a to 10 km line and 100 kHz, the radiated power is 0.008% and for lower frequencies it is smaller. As a result radiation is negligible for all CENELEC-A (9 kHz to 95 kHz) frequencies. The resistive losses for SCGZ lines are such that for a 70 km SWER line a 33 dB attenuation results. This is

where the line resistance starts to increase is much lower for the SCGZ conductors.

that the resistive losses of the SCGZ line are much higher than the SCAC line.

still well below the typical dynamic range of PLC modems.

Fig. 6. Measurements and model comparison.

Figure 5b shows the resistive loss corresponding to the radiation loss of figure 5a. Having a high radiation loss, results in a smaller current flowing along the line and thus less resistive (I2 R) losses. The radiation losses from SWER line are so small that the resistive loss with and without wobble is nearly the same.

Fig. 5. b. Resistive loss for a 100 kHz signal on a 100km long line.

#### **5. Results**

#### **5.1 SWER Lines**

The first line type for which results are presented is a 3/2.75 SWER line consisting of either an aluminium clad steel (SCAC) or a galvanised steel (SCGZ) cable with three 2.75 mm diameter strands. The SWER line is typically 7 m above ground with the earth return distance varying according to equation (7). The author has made measurements on an 18 km long SCGZ SWER line SWER line (Kikkert & Reid 2009) at Mt Stewart station, 100 km west of Charters Towers in North Queensland, Australia. A comparison between the SWER line measurements and the results from the model presented here, using equations (7) to (17) and including the ground pad and earth return path resistance is shown in figure 6. It can be seen that there is a remarkable agreement, thus verifying the schematic model of the line using equations (7) to (17) and the corresponding Matlab® code in section 3.1.

The parameters for a 3/2.75 SCGZ SWER line obtained from the Matlab® program are shown in figure 7. The line resistance increases significantly with frequency. The earth return path depth (7) varies from close to 2 km at 10 Hz to 16 m at 10 MHz. Due to the current being carried in the steel conductor for SCGZ lines, the inductance varies with frequency. For aluminium or copper conductors, the internal inductance of equation (14) is negligible, so that the inductance is mainly governed by the external inductance. For steel conductors, with μr typically being 70, the internal inductance is larger, so that the

Figure 5b shows the resistive loss corresponding to the radiation loss of figure 5a. Having a high radiation loss, results in a smaller current flowing along the line and thus less resistive

R) losses. The radiation losses from SWER line are so small that the resistive loss with and

(I2

**5. Results** 

**5.1 SWER Lines** 

without wobble is nearly the same.

Fig. 5. b. Resistive loss for a 100 kHz signal on a 100km long line.

The first line type for which results are presented is a 3/2.75 SWER line consisting of either an aluminium clad steel (SCAC) or a galvanised steel (SCGZ) cable with three 2.75 mm diameter strands. The SWER line is typically 7 m above ground with the earth return distance varying according to equation (7). The author has made measurements on an 18 km long SCGZ SWER line SWER line (Kikkert & Reid 2009) at Mt Stewart station, 100 km west of Charters Towers in North Queensland, Australia. A comparison between the SWER line measurements and the results from the model presented here, using equations (7) to (17) and including the ground pad and earth return path resistance is shown in figure 6. It can be seen that there is a remarkable agreement, thus verifying the schematic model of the line

The parameters for a 3/2.75 SCGZ SWER line obtained from the Matlab® program are shown in figure 7. The line resistance increases significantly with frequency. The earth return path depth (7) varies from close to 2 km at 10 Hz to 16 m at 10 MHz. Due to the current being carried in the steel conductor for SCGZ lines, the inductance varies with frequency. For aluminium or copper conductors, the internal inductance of equation (14) is negligible, so that the inductance is mainly governed by the external inductance. For steel conductors, with μr typically being 70, the internal inductance is larger, so that the

using equations (7) to (17) and the corresponding Matlab® code in section 3.1.

inductance changes significantly with frequency. As a result of both of these effects, the characteristic impedance of the SWER line varies from 565 Ω at 50 Hz to 270 Ω at 100 kHz.

Fig. 6. Measurements and model comparison.

Figure 7 also shows the radiated power, expressed as a resistance. Below 300 kHz, the radiation is negligible, but at 5 MHz the same power is lost in radiation as in resistive losses. The radiation losses increase proportionally to the frequency2.77. Figure 8 shows the same plots for a SCAC conductor. Comparing figures 7 and 8 shows that the corner frequency where the line resistance starts to increase is much lower for the SCGZ conductors.

The parameters for a 3/2.75 SCAC SWER line obtained from the Matlab® program are shown in figure 8. The line resistance increases significantly with frequency. Despite the earth return path depth (7) varying from close to 2 km at 10 Hz to 16 m at 10 MHz, the characteristic impedance of the SWER line only varies from 344 Ω at 50 Hz to 258 Ω at 100 kHz. Figure 8 also shows the difference between the resistance of the line of it were a pure Aluminium line and the resistance of the SCAC line. Above 1 MHz all the current is carried in the Aluminium cladding. Figure 8 also shows the radiated power, expressed as a resistance. Below 300 kHz, the radiation is negligible, but at 1.5 MHz the same power is lost in radiation as in resistive losses. Equation (18) shows that the radiation losses increase proportionally to the frequency raised to the power 2.77. Comparing figures 7 and 8 show that the resistive losses of the SCGZ line are much higher than the SCAC line.

Figure 9 shows the line losses for a 3/2.75 SCGZ SWER line. For frequencies below 1 MHz, the radiation losses are very small in comparison to the resistive losses. For a to 10 km line and 100 kHz, the radiated power is 0.008% and for lower frequencies it is smaller. As a result radiation is negligible for all CENELEC-A (9 kHz to 95 kHz) frequencies. The resistive losses for SCGZ lines are such that for a 70 km SWER line a 33 dB attenuation results. This is still well below the typical dynamic range of PLC modems.

Calculating Radiation from Power Lines for Power Line Communications 239

radiation losses are the same, but the resistive losses are significantly smaller. A 300 km SCAC SWER line at 100 kHz has a 37 dB attenuation, similar to that of a 70 km SCGZ line.

Fig. 9. SCGZ SWER line losses versus frequency.

Fig. 10. SCAC SWER line losses versus frequency.

Fig. 7. Steel Core Galvanized Zinc (SCGZ) conductor per km transmission line parameters.

Fig. 8. Steel Core Aluminium Clad (SCAC) conductor per km transmission line parameters.

Figure 10 shows the corresponding line losses for a 3/2.75 SCAC SWER line. Comparing figures 9 and 10, show that for a 3/2.75 SCAC line the resistive losses are much lower. The

Fig. 7. Steel Core Galvanized Zinc (SCGZ) conductor per km transmission line parameters.

Fig. 8. Steel Core Aluminium Clad (SCAC) conductor per km transmission line parameters. Figure 10 shows the corresponding line losses for a 3/2.75 SCAC SWER line. Comparing figures 9 and 10, show that for a 3/2.75 SCAC line the resistive losses are much lower. The radiation losses are the same, but the resistive losses are significantly smaller. A 300 km SCAC SWER line at 100 kHz has a 37 dB attenuation, similar to that of a 70 km SCGZ line.

Fig. 9. SCGZ SWER line losses versus frequency.

Fig. 10. SCAC SWER line losses versus frequency.

Calculating Radiation from Power Lines for Power Line Communications 241

interference as the radiated power is very small. However figures 7 to 11 show that SCAC SWER lines, SCGZ SWER lines and MV or LV three phase overhead power lines, where one phase is used for PLC and the earth path is used for the return path, are unsuitable for communication signals above 500 kHz, as the radiation losses will be significant, so that interference to other services in the MF band such as AM broadcast transmissions, may

The second type of transmission line considered in this paper is the typical traditional open wire low voltage overhead (LVOH) line consisting of four All-Aluminium Conductor (AAC) cables each with 7 strands of 4.75 mm diameter mounted on a crossarm. The line consists of two sets of wires with a 550 mm spacing and a larger spacing between these sets of wires to accommodate the power pole. The results presented here are for a set of wires with a 550 mm spacing, which is typical in Australia for the outer sets of 240 V LVOH conductors

occur.

on a crossarm.

of the SWER line.

**5.2 Overhead lines mounted on a crossarm** 

Fig. 12. LV overhead line on crossarm parameters versus frequency.

The parameters for the overhead line are shown in figure 12. The characteristic impedance of the line is 522 Ω and is virtually independent of frequency. There are only small variations of line inductance and capacitance with frequency. The plot for radiation in figure 12 corresponds to equation (20) and the OHL radiation curve fit in figure 14. For PLC applications, the signal is coupled onto these lines in a differential manner, and no ground return is used. Figure 13 shows that, the radiation losses of this line are much less than that

#### **5.1.1 SWER line radiation resistance**

The Matlab® program described in this chapter, prints the calculated normalised cumulative radiation and resistive losses every 100 m along the SWER line. Taking the difference between these cumulative results and averaging these for a line length of 30 km or when the total losses are less than half the input power, whichever is the shorter distance, allows a per km radiation resistance to be determined as a function of frequency. To ensure that the SWER line configuration is identical as the frequency is varied using different Matlab® program runs, the seed for the random wobble is initialised to the same value at the start of each run. Figure 11 shows the resulting radiation resistance for SCGZ and SCAC conductors for a SWER line 7 m above ground and a 50 mrad wobble every 100 m. Despite the resistive losses being very different, the per km radiation losses are nearly the same. Figure 11 also shows a least square error fit as follows:

$$R\_{rad} = 1.35 \times 10^{-16} \times Frequency^{2.77} \quad \text{ $\Omega/km$ } \tag{19}$$

Fig. 11. SCAC SWER line resistances versus frequency.

Figure 11 shows that despite the coefficients of equation 21 being non-integer values, equation (19) gives a good approximation of the results obtained by the Matlab® program. At high frequencies, the radiation losses become quite high and within a short distance, all the input power is lost in resistive and radiation losses.

Figures 10 and 11 shows that for SCAC SWER line at 2 MHz, the radiation losses are equal to the resistive losses. For larger frequencies the radiation losses increase rapidly, causing a very high line attenuation. Since PLC transmissions by Electricity Utilities use frequencies below 150 kHz, figures 7 to 11, show that such PLC transmissions will not cause any

interference as the radiated power is very small. However figures 7 to 11 show that SCAC SWER lines, SCGZ SWER lines and MV or LV three phase overhead power lines, where one phase is used for PLC and the earth path is used for the return path, are unsuitable for communication signals above 500 kHz, as the radiation losses will be significant, so that interference to other services in the MF band such as AM broadcast transmissions, may occur.

#### **5.2 Overhead lines mounted on a crossarm**

240 MATLAB for Engineers – Applications in Control, Electrical Engineering, IT and Robotics

The Matlab® program described in this chapter, prints the calculated normalised cumulative radiation and resistive losses every 100 m along the SWER line. Taking the difference between these cumulative results and averaging these for a line length of 30 km or when the total losses are less than half the input power, whichever is the shorter distance, allows a per km radiation resistance to be determined as a function of frequency. To ensure that the SWER line configuration is identical as the frequency is varied using different Matlab® program runs, the seed for the random wobble is initialised to the same value at the start of each run. Figure 11 shows the resulting radiation resistance for SCGZ and SCAC conductors for a SWER line 7 m above ground and a 50 mrad wobble every 100 m. Despite the resistive losses being very different, the per km radiation losses are nearly the same.

<sup>16</sup> 2.77 *Rrad* 1.35 10 *Frequency km* / <sup>−</sup> =× × Ω (19)

**5.1.1 SWER line radiation resistance** 

Figure 11 also shows a least square error fit as follows:

Fig. 11. SCAC SWER line resistances versus frequency.

the input power is lost in resistive and radiation losses.

Figure 11 shows that despite the coefficients of equation 21 being non-integer values, equation (19) gives a good approximation of the results obtained by the Matlab® program. At high frequencies, the radiation losses become quite high and within a short distance, all

Figures 10 and 11 shows that for SCAC SWER line at 2 MHz, the radiation losses are equal to the resistive losses. For larger frequencies the radiation losses increase rapidly, causing a very high line attenuation. Since PLC transmissions by Electricity Utilities use frequencies below 150 kHz, figures 7 to 11, show that such PLC transmissions will not cause any The second type of transmission line considered in this paper is the typical traditional open wire low voltage overhead (LVOH) line consisting of four All-Aluminium Conductor (AAC) cables each with 7 strands of 4.75 mm diameter mounted on a crossarm. The line consists of two sets of wires with a 550 mm spacing and a larger spacing between these sets of wires to accommodate the power pole. The results presented here are for a set of wires with a 550 mm spacing, which is typical in Australia for the outer sets of 240 V LVOH conductors on a crossarm.

Fig. 12. LV overhead line on crossarm parameters versus frequency.

The parameters for the overhead line are shown in figure 12. The characteristic impedance of the line is 522 Ω and is virtually independent of frequency. There are only small variations of line inductance and capacitance with frequency. The plot for radiation in figure 12 corresponds to equation (20) and the OHL radiation curve fit in figure 14. For PLC applications, the signal is coupled onto these lines in a differential manner, and no ground return is used. Figure 13 shows that, the radiation losses of this line are much less than that of the SWER line.

Calculating Radiation from Power Lines for Power Line Communications 243

conductor is 11.4 mm in diameter and the spacing between the centres of the conductors is 14.9 mm. The cable type is XDAB22AA004 from (Olex, 2008). The parameters of this line is shown in figure 15. The radiation resistance shown in figure 15 corresponds to equation (21)

Comparing equations (19), (20) and (21), shows that for OHL on crossarm and ABC liones, the radiation resistance increases with the third power of frequency, while for SWER lines the radiation resistance increases with the frequency raised to the power 2.77. The difference is due to the earth return path and thus the effective line separation for SWER lines changing with frequency as shown by Carson's equation (7). Because the effective line separation is much larger for SWER lines, the radiation from SWER lines is much larger than

Figure 16 shows the losses for ABC conductors for 1 km and 10 km ABC lines. The corresponding figures for the SWER and OHL on crossarm conductors are figures 9, 10 and

Comparing the resistive, conductor, losses for OHL on crossarm and ABC conductors in figure 14, shows that at low frequency ABC conductors have a higher resistance than OHL on crossarm conductors but at high frequencies ABC conductors have a lower resistance. This is because the ABC conductors have 19 strands in the conductor, while the Moon conductor (Olex, 2008) used for the OHL on crossarm conductor has 7 strands. As a result the skin effect is less severe for ABC conductors. The calculations presented here have not considered that the 19 strands of the ABC conductors are compressed and that this will reduce the conductor surface available at high frequencies and thus increase the line resistance above the value calculated. Unfortunately the extent of this increase is not presented in any cable

13. Comparing these figures show that ABC conductors have very little radiation.

manufacturer's catalogue, since the main application for these lines is at 50 or 60 Hz.

<sup>24</sup> <sup>3</sup> *R F rad* 3.0 *requency k* / *m* <sup>−</sup> =× Ω (21)

and the least curve fit for ABC in figure 14. For ABC lines, this corresponds to:

Fig. 14. LV overhead line resistances versus frequency.

those for the OHL and ABC lines.

Figure 14 shows the radiation and line resistance versus frequency for OHL and ABC lines as obtained from the Matlab® program described in this chapter. The least square error fit for frequencies above 1 kHz for OHL on crossarm conductors is:

Fig. 13. LV overhead line line on crossarm losses versus frequency.

$$R\_{rad} = 2.38^{-21} \times Frequency^3 \quad \text{ $\Omega$  / km} \tag{20}$$

The radiation resistance and the line resistance are the same at just above 20 MHz, so that these lines can be used at more than 10 times the frequency of SWER lines. If the PLC signal is coupled onto the all three phase lines in a common mode, i.e. the PLC signals is coupled onto all the lines in-phase, the neutral line is not connected to the PLC signal and the ground is used for a return path, then similar radiation losses to SWER lines are obtained. For a 10 km line, at 2 MHz, less than 0.05% of the input power is radiated and the line can thus be used for transmitting communication signals at those frequencies.

Broadband over Power Lines (BPL) uses signals in the frequency Range 525 kHz to 80 MHz. Field trials (ACMA 2007, ACMA 2009) have been carried out in Australia. The tests at Queanbean (ACMA2009) used frequencies in the range of 2.5 MHz to 22.8 MHz. Figure 13 shows that at 20 MHz and a 1 km line length, 15% of the power is lost in radiation while 25% is lost in resistive losses. BPL is thus not a suitable system to be used on LVOH lines. PLC signals using the CENELEC A band of 35 to 95 kHz for smart metering can be applied on these lines without any significant interference to existing radio services.

#### **5.3 Aerial bundled conductors**

The final type of transmission line considered is an Aerial Bundled Conductor (ABC), consisting of four insulated, compacted aluminium cables grouped together with common insulation. Each conductor is made up of 19 strands, 2.52 mm in diameter. Each compacted

Figure 14 shows the radiation and line resistance versus frequency for OHL and ABC lines as obtained from the Matlab® program described in this chapter. The least square error fit

for frequencies above 1 kHz for OHL on crossarm conductors is:

Fig. 13. LV overhead line line on crossarm losses versus frequency.

used for transmitting communication signals at those frequencies.

**5.3 Aerial bundled conductors** 

on these lines without any significant interference to existing radio services.

The radiation resistance and the line resistance are the same at just above 20 MHz, so that these lines can be used at more than 10 times the frequency of SWER lines. If the PLC signal is coupled onto the all three phase lines in a common mode, i.e. the PLC signals is coupled onto all the lines in-phase, the neutral line is not connected to the PLC signal and the ground is used for a return path, then similar radiation losses to SWER lines are obtained. For a 10 km line, at 2 MHz, less than 0.05% of the input power is radiated and the line can thus be

Broadband over Power Lines (BPL) uses signals in the frequency Range 525 kHz to 80 MHz. Field trials (ACMA 2007, ACMA 2009) have been carried out in Australia. The tests at Queanbean (ACMA2009) used frequencies in the range of 2.5 MHz to 22.8 MHz. Figure 13 shows that at 20 MHz and a 1 km line length, 15% of the power is lost in radiation while 25% is lost in resistive losses. BPL is thus not a suitable system to be used on LVOH lines. PLC signals using the CENELEC A band of 35 to 95 kHz for smart metering can be applied

The final type of transmission line considered is an Aerial Bundled Conductor (ABC), consisting of four insulated, compacted aluminium cables grouped together with common insulation. Each conductor is made up of 19 strands, 2.52 mm in diameter. Each compacted

<sup>21</sup> <sup>3</sup> *Rrad* 2.38 *Frequency km* / <sup>−</sup> =× Ω (20)

Fig. 14. LV overhead line resistances versus frequency.

conductor is 11.4 mm in diameter and the spacing between the centres of the conductors is 14.9 mm. The cable type is XDAB22AA004 from (Olex, 2008). The parameters of this line is shown in figure 15. The radiation resistance shown in figure 15 corresponds to equation (21) and the least curve fit for ABC in figure 14. For ABC lines, this corresponds to:

$$R\_{rad} = 3.0^{-24} \times Frequency^3 \quad \text{ $\Omega$  / km} \tag{21}$$

Comparing equations (19), (20) and (21), shows that for OHL on crossarm and ABC liones, the radiation resistance increases with the third power of frequency, while for SWER lines the radiation resistance increases with the frequency raised to the power 2.77. The difference is due to the earth return path and thus the effective line separation for SWER lines changing with frequency as shown by Carson's equation (7). Because the effective line separation is much larger for SWER lines, the radiation from SWER lines is much larger than those for the OHL and ABC lines.

Figure 16 shows the losses for ABC conductors for 1 km and 10 km ABC lines. The corresponding figures for the SWER and OHL on crossarm conductors are figures 9, 10 and 13. Comparing these figures show that ABC conductors have very little radiation.

Comparing the resistive, conductor, losses for OHL on crossarm and ABC conductors in figure 14, shows that at low frequency ABC conductors have a higher resistance than OHL on crossarm conductors but at high frequencies ABC conductors have a lower resistance. This is because the ABC conductors have 19 strands in the conductor, while the Moon conductor (Olex, 2008) used for the OHL on crossarm conductor has 7 strands. As a result the skin effect is less severe for ABC conductors. The calculations presented here have not considered that the 19 strands of the ABC conductors are compressed and that this will reduce the conductor surface available at high frequencies and thus increase the line resistance above the value calculated. Unfortunately the extent of this increase is not presented in any cable manufacturer's catalogue, since the main application for these lines is at 50 or 60 Hz.

Calculating Radiation from Power Lines for Power Line Communications 245

all the input power is lost before the end of a 30 km line. The low level of radiation losses will ensure that no significant interference to other services will occur. ABC lines can thus be used for transmitting BPL signals at frequencies up to 100 MHz, however the resistive losses

Similar results will apply for underground cables, where all the active conductors are bundled together in one cable. BPL can thus safely be used on ABC lines and underground cables. The success of BPL on those lines will primarily depend on economic rather that

PLC signals using the CENELEC A band for smart metering can be applied on these lines

The radiation from power lines cannot be determined from expressions from long wire antennae, since those expressions assume that the signal current in the power line is constant, the power line is straight and its length is less than 5 wavelengths. None of these assumptions are true for powerlines and as a result the radiation patterns and the radiated power must be determined from first principles using a Matlab® program. This program can be used to determine the radiated power from both SWER lines and overhead power

The results presented here show that SWER line result in little radiation for frequencies below 100 kHz, typical overhead lines mounted on a crossarm have little radiation for frequencies up to 2 MHz and bundled conductors have little radiation at frequencies up to

All lines can thus be used for the 9-95 kHz CENELEC A frequency band to permit PLC communication for smart-metering and network control. Conventional overhead lines mounted on crossarms will cause significant interference levels for signal frequencies above 2 MHz and should not be used for BPL. Bundled conductors, ABC and underground, can be used for BPL applications, with little radiation, but with significant resistive losses at high

The author would like to thank ERGON ENERGY for their support in providing the funding for this research. The author would also like to thank the technical and academic staff at James Cook University, for their assistance and encouragement in this work. The author would like to acknowledge Mr. Geoffrey Reid for his contribution to writing the

ACMA "ACA Field Report Country Energy BPL Trial Queanbeyan NSW – February 2005"

Balanis, A., Antenna theory: analysis and design. 2nd edition ed. 1997: John Wiley & Sons,

%20feb202005%20final%20public%20 report.pdf., 23 October 2009

Walter, C.H., Travelling Wave Antennas. 1970 ed. 1965: Dover Publications. 429.

ACA URL: http://www.acma.gov.au/webwr /lib284/queanbeyan %20trial

lines where the PLC signals are coupled to 2 lines in a differential mode.

prevent great distances being reached.

without any significant interference to existing services.

technical matters.

**6. Conclusion** 

100 MHz.

frequencies.

**8. References** 

Inc.

**7. Acknowledgment** 

Matlab code for calculating the radiated fields.

Fig. 15. Aerial Bundled Conductor line parameters versus frequency.

Fig. 16. Aerial Bundled Conductor line losses versus frequency.

Figure 16 shows that for frequencies below 100 MHz, the radiation losses are less than 2% of the input power. However the resistive losses are such that for frequencies above 20 MHz, all the input power is lost before the end of a 30 km line. The low level of radiation losses will ensure that no significant interference to other services will occur. ABC lines can thus be used for transmitting BPL signals at frequencies up to 100 MHz, however the resistive losses prevent great distances being reached.

Similar results will apply for underground cables, where all the active conductors are bundled together in one cable. BPL can thus safely be used on ABC lines and underground cables. The success of BPL on those lines will primarily depend on economic rather that technical matters.

PLC signals using the CENELEC A band for smart metering can be applied on these lines without any significant interference to existing services.

### **6. Conclusion**

244 MATLAB for Engineers – Applications in Control, Electrical Engineering, IT and Robotics

Fig. 15. Aerial Bundled Conductor line parameters versus frequency.

Fig. 16. Aerial Bundled Conductor line losses versus frequency.

Figure 16 shows that for frequencies below 100 MHz, the radiation losses are less than 2% of the input power. However the resistive losses are such that for frequencies above 20 MHz, The radiation from power lines cannot be determined from expressions from long wire antennae, since those expressions assume that the signal current in the power line is constant, the power line is straight and its length is less than 5 wavelengths. None of these assumptions are true for powerlines and as a result the radiation patterns and the radiated power must be determined from first principles using a Matlab® program. This program can be used to determine the radiated power from both SWER lines and overhead power lines where the PLC signals are coupled to 2 lines in a differential mode.

The results presented here show that SWER line result in little radiation for frequencies below 100 kHz, typical overhead lines mounted on a crossarm have little radiation for frequencies up to 2 MHz and bundled conductors have little radiation at frequencies up to 100 MHz.

All lines can thus be used for the 9-95 kHz CENELEC A frequency band to permit PLC communication for smart-metering and network control. Conventional overhead lines mounted on crossarms will cause significant interference levels for signal frequencies above 2 MHz and should not be used for BPL. Bundled conductors, ABC and underground, can be used for BPL applications, with little radiation, but with significant resistive losses at high frequencies.

### **7. Acknowledgment**

The author would like to thank ERGON ENERGY for their support in providing the funding for this research. The author would also like to thank the technical and academic staff at James Cook University, for their assistance and encouragement in this work. The author would like to acknowledge Mr. Geoffrey Reid for his contribution to writing the Matlab code for calculating the radiated fields.

#### **8. References**


Walter, C.H., Travelling Wave Antennas. 1970 ed. 1965: Dover Publications. 429.

**10** 

*Domaine Universitaire* 

*France* 

**Automatic Modelling Approach for Power Electronics Converters: Code Generation** 

*Grenoble INP/ Grenoble Electrical Engineering Laboratory (G2Elab) ENSE3* 

Modelling and simulation are useful for the analysis and design process of power electronics systems. Power electronics models of static converters are used for component

In this context, average models are a good compromise between complexity, computation time and acceptable accuracy for system simulation. So, the development of averaging methods has been a topic of interest for the power electronic community for over three

The modelling of simple DC/DC structures is easy on the continuous conduction mode (Bass & Sun, 1998; Maksimovic et al., 2001; Maranesi & Riva, 2003; Rajagopalan, 1987; Webster & Ngo, 1992). However, the modelling complexity increases with the number of switches and the nature of the operating mode (the state sequences separated by the switch commutations). In this context, average operating analysis is becoming more and more complicated and the modelling requires skilful handling of complicated mathematical

In the literature, several automatic averaged modelling techniques have been developed however they have many limitations. As (Sun & Grostollen, 1997) that proposes a package for the modelling of PWM structures, in hard or soft switching, but the modelling is only for power electronics structures alone. The automatic modelling of a three-phase electrical machine with static converter is not possible. So, the environment of the static converter is

In the Electrical Engineering Laboratory (G2Elab), (Verdiere et al., 2003) proposes a new software architecture for the average modelling of power electronics structures, but this software is limited to the treatment of DC/DC converters in the continuous conduction

The same problem as (Sun & Grostollen, 1997), the automatic coupling of converter with electrical machine is not considered. Finally, the computing technologies used to the

decades (Chetty, 1982; Middlebrook & Cuk, 1976; Sun & Grostollen, 1992).

limited, e.g. the load can not be a three-phase synchronous machine.

mode, the classic average model is only obtained automatically.

topological analyze of electrical circuit (e.g. Macsyma) are not up to date.

sizing, for control adjustment or behaviour simulation.

expressions which is generally time consuming.

**1. Introduction**

**(C S Function, Modelica, VHDL-AMS)** 

**and MATLAB/Simulink Simulation** 

Asma Merdassi, Laurent Gerbaud and Seddik Bacha


## **Automatic Modelling Approach for Power Electronics Converters: Code Generation (C S Function, Modelica, VHDL-AMS) and MATLAB/Simulink Simulation**

Asma Merdassi, Laurent Gerbaud and Seddik Bacha *Grenoble INP/ Grenoble Electrical Engineering Laboratory (G2Elab) ENSE3 Domaine Universitaire France* 

#### **1. Introduction**

246 MATLAB for Engineers – Applications in Control, Electrical Engineering, IT and Robotics

Ulaby, F.T., Fundamentals of Applied Electromagnetics. Fifth Edition. 1994: Pearson

Johnson, W.C., Transmission Lines and Networks. International Student Edition, 1950,

Reid, G. D. and C. J. Kikkert, "Radiation from a single wire earth return power line",

Kikkert, C, J, and G. Reid, Radiation and Attenuation of Communication Signals on Power

Carson, J.R., Wave propagation in overhead wires with ground return. Bell Systems

Wang,Y., Liu, S. "A Review of Methods for Calculation of Frequency-dependent Impedance

Deri, A.,Tevan, G., "The Complex Ground Return Plane: A Simplified Model for

Olex, Areal cable catalogue, March 2008 http://storage.baselocation.com/ olex.com.au/ Media/Docs/Aerial-Catalogue-b8c9b2b7-c2b0-42a2-a5a6-6c4d000f3df5.pdf

Lines. 7th International Conference on Information, Communications and Signal

of Overhead Power Transmission Lines." 2001 Proc. Natl. Sci. Counc. ROC(A) Vol

Homogeneous and Multi-layer Earth Return." IEEE Transactions on Power

EEEvolution Symposium, Cairns 28-30 July 2008

Processing, ICICS 2009, 7-10 December 2009, Macau.

Apparatus and Systems, Vol. PAS-100, No. 8. August 1981.

Prentice Hall. 456.

Technical Journal, 1926. 5.

25, No. 6, 2001. pp. 329-338

McGraw-Hill.

Modelling and simulation are useful for the analysis and design process of power electronics systems. Power electronics models of static converters are used for component sizing, for control adjustment or behaviour simulation.

In this context, average models are a good compromise between complexity, computation time and acceptable accuracy for system simulation. So, the development of averaging methods has been a topic of interest for the power electronic community for over three decades (Chetty, 1982; Middlebrook & Cuk, 1976; Sun & Grostollen, 1992).

The modelling of simple DC/DC structures is easy on the continuous conduction mode (Bass & Sun, 1998; Maksimovic et al., 2001; Maranesi & Riva, 2003; Rajagopalan, 1987; Webster & Ngo, 1992). However, the modelling complexity increases with the number of switches and the nature of the operating mode (the state sequences separated by the switch commutations). In this context, average operating analysis is becoming more and more complicated and the modelling requires skilful handling of complicated mathematical expressions which is generally time consuming.

In the literature, several automatic averaged modelling techniques have been developed however they have many limitations. As (Sun & Grostollen, 1997) that proposes a package for the modelling of PWM structures, in hard or soft switching, but the modelling is only for power electronics structures alone. The automatic modelling of a three-phase electrical machine with static converter is not possible. So, the environment of the static converter is limited, e.g. the load can not be a three-phase synchronous machine.

In the Electrical Engineering Laboratory (G2Elab), (Verdiere et al., 2003) proposes a new software architecture for the average modelling of power electronics structures, but this software is limited to the treatment of DC/DC converters in the continuous conduction mode, the classic average model is only obtained automatically.

The same problem as (Sun & Grostollen, 1997), the automatic coupling of converter with electrical machine is not considered. Finally, the computing technologies used to the topological analyze of electrical circuit (e.g. Macsyma) are not up to date.

Automatic Modelling Approach for Power Electronics Converters:

Classic Average Model (Large Signal Average Model)

**1**. Data

**input**

Small Signal Average Model

Equivalent Average Generator

> Generalized Average Model

> > **output**

Fig. 2).

E

Fig. 1. Steps of modelling

Code Generation (C S Function, Modelica, VHDL-AMS) and MATLAB/Simulink Simulation 249

file

**2.1** Topological analysis • Analysis of circuit

• Extraction of branches and nodes • Building of the incidence matrix •Building of the reduced incidence matrix

**2.2** State matrices

matrix nodes/branches and then calculate the reduced incidence matrix.

D1

T1

Fig. 2. Incidence matrix of a boost converter

**3**

**1 2 4**

• Welsh algorithm

**2.3** Building of several models • building of exact model • building of average models

Thus knowing the topology of any electrical circuit, it is possible to express the incidence

In the incidence matrix, the rows correspond to nodes and the columns to the branches (see

C R

**Incidence matrix** <sup>L</sup>

Structure of the converter

and control NetList file

**2. Steps of modelling**

• Extraction of reduced matrices for every configuration. •Building of a complete state matrices for every configuration

• Classification of components (link, branch, non-fed,...)

Extraction of a Analysis of simulation

Switching mode

Components

D1 T1 E C R L

1 0 0 -1 0 0 1 2 1 -1 0 0 0 -1 3 0 1 1 -1 1 0 4 -1 0 0 1 -1 0

Nodes

The originality of this chapter consists to improve, on one hand, the work of (Sun & Grostollen, 1997) and (Verdiere et al., 2003), by proposing a new automatic methodology deals with several models (average and exact models) for DC/DC, DC/AC and AC/AC converters, and on other hand, by modelling converters with or without their environment (e.g. electrical machines). The particularities of this approach are the generation of models in different forms: C S-Function, VHDL-AMS, Modelica and the automatic treatment of the static converters in the continuous and discontinuous conduction mode. In this chapter, only results for the continuous conduction mode are presented.

In the first part of this chapter, the modelling approach is explained and the main steps of this modelling are detailed. A causal approach for the modelling of static converters of a power electronics applications independently of their environment (i.e its sources and loads) is also presented.

In the second part, the implementation in the software tool (AMG for Average Model Generator) dedicated to this automatic building is described. The code generation in C Sfunction, VHDL-AMS and Modelica is illustrated for a boost converter.

In the last part, several applications results are presented and implemented in several software (e.g Matlab/Simulink), among them a resonant converter, a three phase inverter coupled with a three-phase machine and a multi-level converter.

#### **2. Modelling approach**

The modelling approach in the software tool AMG is defined by using an a priori on the static converter behaviour and considering some hypothesis (ideal switches OFF "open circuit" and ON "short circuit", linear and invariant passive components and perfect sources).

Every model is entirely made in an automatic way from a topological description of the static converter. This description is carried out from a Netlist file extracted by using simulation software (i.e PSpice) and a dedicated simplified component library is used.

The user must define the commutation mode (i.e the cyclic sequence of switched configurations in an operating period) and the switch control sequence of the static converter to be modelled, mainly the control links of switches. The switch control and the operating mode are deduced from the analysis of the studied static converter, e.g., by using simulation software (i.e Portunus, Psim, PSpice, Simplorer, Saber, etc.). These data information given by the user are introduced into the software tool AMG.

The approach of the automatic building includes three important steps:


Steps of modelling are presented in Fig. 1.

#### **2.1 Topological analysis**

An electrical circuit can be represented by a directed graph. The edges of this graph then connect the nodes of the circuit pairs. It is therefore possible to extract a tree of this graph corresponding to a subset of edges covering all nodes in the graph, but not forming mesh. The topological analysis is to automatically determine a tree from a simple description of the topology of the circuit. This method has been tested and used in different works (Delaye et al., 2004).

Fig. 1. Steps of modelling

The originality of this chapter consists to improve, on one hand, the work of (Sun & Grostollen, 1997) and (Verdiere et al., 2003), by proposing a new automatic methodology deals with several models (average and exact models) for DC/DC, DC/AC and AC/AC converters, and on other hand, by modelling converters with or without their environment (e.g. electrical machines). The particularities of this approach are the generation of models in different forms: C S-Function, VHDL-AMS, Modelica and the automatic treatment of the static converters in the continuous and discontinuous conduction mode. In this chapter,

In the first part of this chapter, the modelling approach is explained and the main steps of this modelling are detailed. A causal approach for the modelling of static converters of a power electronics applications independently of their environment (i.e its sources and loads)

In the second part, the implementation in the software tool (AMG for Average Model Generator) dedicated to this automatic building is described. The code generation in C S-

In the last part, several applications results are presented and implemented in several software (e.g Matlab/Simulink), among them a resonant converter, a three phase inverter

The modelling approach in the software tool AMG is defined by using an a priori on the static converter behaviour and considering some hypothesis (ideal switches OFF "open circuit" and ON "short circuit", linear and invariant passive components and perfect

Every model is entirely made in an automatic way from a topological description of the static converter. This description is carried out from a Netlist file extracted by using simulation software (i.e PSpice) and a dedicated simplified component library is used. The user must define the commutation mode (i.e the cyclic sequence of switched configurations in an operating period) and the switch control sequence of the static converter to be modelled, mainly the control links of switches. The switch control and the operating mode are deduced from the analysis of the studied static converter, e.g., by using simulation software (i.e Portunus, Psim, PSpice, Simplorer, Saber, etc.). These data

only results for the continuous conduction mode are presented.

function, VHDL-AMS and Modelica is illustrated for a boost converter.

information given by the user are introduced into the software tool AMG. The approach of the automatic building includes three important steps:

2. the extraction of the state matrixes for each configuration of the static converter,

An electrical circuit can be represented by a directed graph. The edges of this graph then connect the nodes of the circuit pairs. It is therefore possible to extract a tree of this graph corresponding to a subset of edges covering all nodes in the graph, but not forming mesh. The topological analysis is to automatically determine a tree from a simple description of the topology of the circuit. This method has been tested and used in different works (Delaye et

coupled with a three-phase machine and a multi-level converter.

is also presented.

**2. Modelling approach** 

1. the analysis of the circuit,

**2.1 Topological analysis** 

al., 2004).

3. the building of the global state model. Steps of modelling are presented in Fig. 1.

sources).

Thus knowing the topology of any electrical circuit, it is possible to express the incidence matrix nodes/branches and then calculate the reduced incidence matrix.

In the incidence matrix, the rows correspond to nodes and the columns to the branches (see Fig. 2).

Fig. 2. Incidence matrix of a boost converter

Automatic Modelling Approach for Power Electronics Converters:

reduced state system is obtained (Kuo-Peng et al., 1997).

The equations (1) and (2) are written as (3) and (4):

*u* : the input vector (the external sources) (size[p]).

**2.2 State matrices** 

*Where:* 

*x* :the state vector (size[n])

*Y t*( ) : the output vector (size[q])

*A* : the state matrix (size [n,n]). *B* : the input matrix (size[n,p]). *C* : the output matrix (size[q,n]). *D* : the feedforward matrix (size[q,p]).

**2.3 Building of the several models** 

Code Generation (C S Function, Modelica, VHDL-AMS) and MATLAB/Simulink Simulation 251

The state matrices of the static converter are extracted for each configuration from their simplified nodes equations. By combining the equations of voltage-current relations, a

> *bc bc e ml ml j d V V V A B dt I I I*

*e e bc mj j ml I V V C D V I <sup>I</sup>*

*dx Ax Bu*

*bc ml V*

*e j V <sup>u</sup> <sup>I</sup>* =

*e mj I <sup>Y</sup> <sup>V</sup>* <sup>=</sup>

The global global state model of the converter is made from the state equations for each configuration of the static converter. It consists in extracting the state system for each possible topology of circuit in order to create the converter model. The approach focuses on exact and average models (classic average model, equivalent average model, generalized average model and small signal average model). The models are generated according to the

*x I* <sup>=</sup>

*dt*

= ⋅ +⋅ (1)

=⋅ +⋅ (2)

= ⋅+⋅ (3)

*Y Cx Du* = ⋅+ ⋅ (4)

(6)

(5)

(7)

After, this matrix is reduced for each state, according to the conduction state of switches. A switch at state ON is considered as "short-circuit": the lines corresponding to its nodes are added or subtracted (to keep a resulting line with only 0, 1 and -1). A switch at state OFF is considered as an "open circuit": the switch column is suppressed.

Fig. 3. The reduced incidence matrix for a boost converter (for case 1 and case 2)

Welsh algorithm is used to extract the relations between the voltages *U* and currents *I* of the circuit (Rajagopalan, 1987). It separates links components and branches variables:


So, Kirchhoff laws and relations between, on the one hand, the branches voltage and current and on the other hand, between links voltage and current are easily deduced.

We propose also a new extension of the Welsh algorithm that offers the possibility to deduce:


Finally, the topological analysis offers a first set of circuit equations in the form of relations between on the one hand, the branch current (*Ib*) and the link current (*Im*) and on the other hand, the branch voltage (*Vb*) and the link voltages (*Vm*).

#### **2.2 State matrices**

250 MATLAB for Engineers – Applications in Control, Electrical Engineering, IT and Robotics

After, this matrix is reduced for each state, according to the conduction state of switches. A switch at state ON is considered as "short-circuit": the lines corresponding to its nodes are added or subtracted (to keep a resulting line with only 0, 1 and -1). A switch at state OFF is

**Reduced incidence matrix for case1 Reduced incidence matrix for case2**


> 0.0 1.0 -1.0 0.0 1.0 -1.0 1.0 -1.0 -1.0 0.0 0.0 1.0 E C R L

Boost converter Case2: D1 OFF & T1 ON

considered as an "open circuit": the switch column is suppressed.

1.0 -1.0 1.0 0.0 0.0 1.0 -1.0 -1.0 -1.0 0.0 0.0 1.0 E C R L

resistors, the inductors and the sources.

resistors, the inductors and the sources.

resistors, the inductors and the sources.

deduce:


capacitors, the resistors and the inductors.

hand, the branch voltage (*Vb*) and the link voltages (*Vm*).

Fig. 3. The reduced incidence matrix for a boost converter (for case 1 and case 2)

circuit (Rajagopalan, 1987). It separates links components and branches variables:

and on the other hand, between links voltage and current are easily deduced.

Welsh algorithm is used to extract the relations between the voltages *U* and currents *I* of the





So, Kirchhoff laws and relations between, on the one hand, the branches voltage and current

We propose also a new extension of the Welsh algorithm that offers the possibility to

Finally, the topological analysis offers a first set of circuit equations in the form of relations between on the one hand, the branch current (*Ib*) and the link current (*Im*) and on the other

Boost converter Case1 : D1 ON & T1 OFF The state matrices of the static converter are extracted for each configuration from their simplified nodes equations. By combining the equations of voltage-current relations, a reduced state system is obtained (Kuo-Peng et al., 1997).

$$
\frac{d}{dt} \begin{bmatrix} V\_{hc} \\ I\_{ml} \end{bmatrix} = A \cdot \begin{bmatrix} V\_{bc} \\ I\_{ml} \end{bmatrix} + B \cdot \begin{bmatrix} V\_e \\ I\_j \end{bmatrix} \tag{1}
$$

$$
\begin{bmatrix} I\_c \\ V\_{mj} \end{bmatrix} = \mathbf{C} \cdot \begin{bmatrix} V\_{hc} \\ I\_{ml} \end{bmatrix} + D \cdot \begin{bmatrix} V\_e \\ I\_j \end{bmatrix} \tag{2}
$$

The equations (1) and (2) are written as (3) and (4):

$$\frac{d\mathbf{x}}{dt} = A \cdot \mathbf{x} + B \cdot \mathbf{u} \tag{3}$$

$$Y = \mathbb{C} \cdot \mathfrak{x} + D \cdot \mathfrak{u} \tag{4}$$

*Where:* 

*x* :the state vector (size[n])

$$\mathbf{x} = \begin{bmatrix} V\_{hc} \\ I\_{ml} \end{bmatrix} \tag{5}$$

*u* : the input vector (the external sources) (size[p]).

$$
\mu = \begin{bmatrix} V\_e \\ I\_\dagger \end{bmatrix} \tag{6}
$$

*Y t*( ) : the output vector (size[q])

$$Y = \begin{bmatrix} I\_e \\ V\_{mj} \end{bmatrix} \tag{7}$$


#### **2.3 Building of the several models**

The global global state model of the converter is made from the state equations for each configuration of the static converter. It consists in extracting the state system for each possible topology of circuit in order to create the converter model. The approach focuses on exact and average models (classic average model, equivalent average model, generalized average model and small signal average model). The models are generated according to the

Automatic Modelling Approach for Power Electronics Converters:

′ : the state matrix for the *ith* configuration (size [n,n]).

Note that *p* switching functions can describe *2p* configurations.

The average value of the kth harmonic is defined by equation (11).

*T* : the switching period.

*Ai*

*Bi*

Where:

*Where:* 

*x* : the state vector (size [n]).

*x* : the state vector (size [n]).

*Bi* : input matrix (size [n,n]) *ui* : the vector control (size [n,1]). *bi, d:* other input matrixes (size [n,1]).

**2.3.2 The average model** 

*A*: the global state matrix (size [n,n]).

**3. Causality of the static converter** 

′ : the input matrix (size [n,p]). *e* : the external sources (size [p]).

Code Generation (C S Function, Modelica, VHDL-AMS) and MATLAB/Simulink Simulation 253

By assembling these *N* equations, considering the continuous character of the state variable (vector x) and by assigning a discrete switching function *u t <sup>i</sup>*( ) 0,1 ∈{ } or {−1,1} , representing both the operating mode and the control, the global behaviour of the static

1

*dx Ax u B x b d*

*i*

<sup>1</sup> () () *t T*

2

<sup>π</sup> ω =

*T x pour*

Fourier series. It's average is made on a sliding window and not on the static interval. AMG deals with the following types of static converters: DC/DC, DC/AC and AC/AC. It allows the automatic average modelling. In the literature, the following average models (classic average model, equivalent average generator, generalized average model and smallsignal average model) are well known and presented in the papers (Chen & Sun, 2005;

Etxeberria-Otadui et al., 2002; Verdiere et al., 2003 & Sanders et al., 1990).

*t xt x e d T*

() 0 0

τ = τ<

( ) *<sup>k</sup> x t* represents the harmonic coefficient of range k in the decomposition of the complex

For the models of loads or sources that can not be simply described by a circuit representation, a Netlist or graphical approach is limited. So, it is useful to carry out models

+

*k*

*p*

( )

*jk*

= ⋅+ ⋅ ⋅+ + (10)

− ωτ = τ⋅ τ (11)

*ii i*

*N*: the number of topologies (configurations) that happen during the switching period *T*.

*it* : the commutation instant between configuration *i* and configuration *i+1*

converter is formulated as the bilinear equation (10) (Sun & Grostollen, 1992).

*dt* <sup>=</sup>

nature of the power conversion (DC/DC, AC/DC) and the operating mode (continuous conduction or discontinuous conduction).

A Comparison between several models generated by AMG is presented in table 1 (Merdassi et al., 2010).


Table 1. Comparison between the models generated by AMG

#### **2.3.1 The exact model**

The exact model represents the starting point to any average modelling operation (Bacha et al., 1994). Regarding the state of the various switches, the converter can be considered as a variable structure system with *N* possible configurations during a given commutation period *T*.

The state equation of each configuration of index *i* ( *i N* = 1,.., ) is defined by equation (8) in a corresponding time interval <sup>1</sup> [ ,] *i i tt t* ∈ <sup>−</sup> .

$$\frac{d\mathbf{x}}{dt} = A\_i' \cdot \mathbf{x} + B\_i' \cdot \mathbf{e} \tag{8}$$

*Where:* 

$$\sum\_{i=1}^{N} t\_i - t\_{i-1} = T \tag{9}$$

*T* : the switching period.

252 MATLAB for Engineers – Applications in Control, Electrical Engineering, IT and Robotics

nature of the power conversion (DC/DC, AC/DC) and the operating mode (continuous

A Comparison between several models generated by AMG is presented in table 1 (Merdassi

**Models Domain of validity Results Limitations** 






The exact model represents the starting point to any average modelling operation (Bacha et al., 1994). Regarding the state of the various switches, the converter can be considered as a variable structure system with *N* possible configurations during a given commutation

The state equation of each configuration of index *i* ( *i N* = 1,.., ) is defined by equation (8) in a

*i i dx Ax Be*

1

*tt T* <sup>−</sup>

*i i*

= ⋅+ ⋅ ′ ′ (8)

− = (9)

*dt*

1

*i*

=

*N*

Table 1. Comparison between the models generated by AMG

model



> - Model of reduced dimension



> -Discontinuous conduction - Alternatives variables




conduction or discontinuous conduction).

**Exact model**  (Etxeberria-Otadui et al., 2002)

**Classic average model** (Middlebrook & Cuk, 1976)

**Small signal average model**  (Bacha et al., 1994; Kanaan et al., 2005)

**Equivalent average generator**  (Sun & Grostollen, 1997)

**Generalized average model**  (Sanders et al., 1990 ; Petitclair et al.,1996)

corresponding time interval <sup>1</sup> [ ,] *i i tt t* ∈ <sup>−</sup> .

**2.3.1 The exact model** 

period *T*.

*Where:* 

et al., 2010).

*N*: the number of topologies (configurations) that happen during the switching period *T*.

*x* : the state vector (size [n]).

*it* : the commutation instant between configuration *i* and configuration *i+1*

*Ai* ′ : the state matrix for the *ith* configuration (size [n,n]).

*Bi* ′ : the input matrix (size [n,p]).

*e* : the external sources (size [p]).

By assembling these *N* equations, considering the continuous character of the state variable (vector x) and by assigning a discrete switching function *u t <sup>i</sup>*( ) 0,1 ∈{ } or {−1,1} , representing both the operating mode and the control, the global behaviour of the static converter is formulated as the bilinear equation (10) (Sun & Grostollen, 1992).

Note that *p* switching functions can describe *2p* configurations.

$$\frac{d\mathbf{x}}{dt} = \mathbf{A} \cdot \mathbf{x} + \sum\_{i=1}^{p} u\_i \cdot \left(\mathbf{B}\_i \cdot \mathbf{x} + b\_i\right) + d\tag{10}$$

Where:

*x* : the state vector (size [n]).

*A*: the global state matrix (size [n,n]).

*Bi* : input matrix (size [n,n])

*ui* : the vector control (size [n,1]).

*bi, d:* other input matrixes (size [n,1]).

#### **2.3.2 The average model**

The average value of the kth harmonic is defined by equation (11).

$$\left\{\mathbf{x}(t)\right\}\_{k} = \frac{1}{T} \int\_{t}^{t+T} \mathbf{x}(\tau) \cdot e^{-j k \text{or} \mathbf{\tau}} d\tau \tag{11}$$

*Where:* 

$$\begin{cases} \mathbf{u} = \frac{2\pi}{T} \\ x(\pi) = 0 \quad pour \quad \pi < 0 \end{cases}$$

( ) *<sup>k</sup> x t* represents the harmonic coefficient of range k in the decomposition of the complex Fourier series. It's average is made on a sliding window and not on the static interval.

AMG deals with the following types of static converters: DC/DC, DC/AC and AC/AC. It allows the automatic average modelling. In the literature, the following average models (classic average model, equivalent average generator, generalized average model and smallsignal average model) are well known and presented in the papers (Chen & Sun, 2005; Etxeberria-Otadui et al., 2002; Verdiere et al., 2003 & Sanders et al., 1990).

#### **3. Causality of the static converter**

For the models of loads or sources that can not be simply described by a circuit representation, a Netlist or graphical approach is limited. So, it is useful to carry out models

Automatic Modelling Approach for Power Electronics Converters:

i V

i V

converter Voltage

applies voltage imposed current

source

Applies voltage Imposed current

Fig. 5. Causality of a static converter

The following outputs are formulated:

equation is especially interesting for coupling models.

converter.

**4. Implementation** 

V

V

the causality of capacitors and inductors are defined (see Fig.5).

<sup>i</sup> <sup>i</sup>

Static converter

applies current Imposed voltage

Static

<sup>i</sup> <sup>i</sup>

C L

This approach proposes to generate automatically its models (exact and/or average) according to the nature of the state variables. However, to associate the generated model with other models, thanks to the static converter environment characterisation, the generated model has to give an expression for every complementary energetic variable of the equivalent sources that are connected to the converter. In this way, the current across

*eI* : the sub-vector of the current in the voltage sources at the interface of the static converter. *Vmj* : the sub-vector of the voltage on the current sources at the interface of the static

Finally, models are obtained by using equation (2). This representation form of state

AMG is implemented by using Java and Maple programming. Only symbolic treatments are in Maple. The building of the state matrixes *Ai, Bi, Ci* and *Di* for every configuration (indexed *i*) is developed in Java by equations (1) and (2). The building of the exact and the

Static converter

Applies current Imposed voltage

Static <sup>C</sup> converter <sup>L</sup>

voltage sources and the voltage through current sources have to be formulated.

Code Generation (C S Function, Modelica, VHDL-AMS) and MATLAB/Simulink Simulation 255

By considering the integral causality, defined as the preferential causality in Bond Graph,

V

applies current Imposed voltage

Current source

Applies current Imposed voltage

V

i V

i V

Static converter

applies voltage Imposed curent

> Static converter

Static converter

Applies voltage Imposed current

> Static converter

of static converters without the description of their environment, by using only knowledge on the connection points of the converter with its environment. Then, the obtained models of the static converters are introduced into the global application.

Two possibilities are proposed: the static converter model is either oriented or non oriented, i.e. causal or non causal (Allain et al., 2009).

#### **3.1 Oriented model**

The global model of the static converter is described in a block (e.g. a C S-Function of Matlab/Simulink). Then, it is connected with the other blocks of the system. In this approach, the static converter is considered as a causal model, i.e. the solving sequence of its equations is imposed. So, the model has inputs and outputs.

The figure 4 illustrates this causality in the meaning of block representation and Bond Graph representation for a single-phase voltage inverter.

Fig. 4. Example of causality aspect for a single-phase voltage inverter

#### **3.2 Non oriented model**

The causality of the static converter can be determined by respecting the definition given in Bond Graph representation (Karnopp et al., 1990), but applied in the electrical domain. The model can be described in a non causal modelling language, e.g. VHDL-AMS, Verilog or Modelica (for the analog part). This means that the model equations are not oriented. Then the model of the static converter is connected to the models of the components thanks to the modelling language. Finally, the compilers of such languages manage automatically the causality (so the solving sequence of the model equations) at the start of the simulation running.

Practically, the static converter environment is defined with equivalent sources. Thus, a voltage source or a current source is imposed at every connection point (Mohan et al., 1989). However, in power electronics, according to their value, inductors may be compared to current sources whereas capacitors are compared to voltages sources.

In the viewpoint of ordinary differential equation solving, the integral causality requires a numerical integration to get the state variables, i.e. the currents across the inductor and the voltages through the capacitors. So, for the external connection of the static converter, current sources (respectively voltage sources) can be used to represent inductors or inductive phenomena (respectively capacitors or capacitive phenomena).

By considering the integral causality, defined as the preferential causality in Bond Graph, the causality of capacitors and inductors are defined (see Fig.5).

Fig. 5. Causality of a static converter

254 MATLAB for Engineers – Applications in Control, Electrical Engineering, IT and Robotics

of static converters without the description of their environment, by using only knowledge on the connection points of the converter with its environment. Then, the obtained models

Two possibilities are proposed: the static converter model is either oriented or non oriented,

The global model of the static converter is described in a block (e.g. a C S-Function of Matlab/Simulink). Then, it is connected with the other blocks of the system. In this approach, the static converter is considered as a causal model, i.e. the solving sequence of its

The figure 4 illustrates this causality in the meaning of block representation and Bond Graph

The causality of the static converter can be determined by respecting the definition given in Bond Graph representation (Karnopp et al., 1990), but applied in the electrical domain. The model can be described in a non causal modelling language, e.g. VHDL-AMS, Verilog or Modelica (for the analog part). This means that the model equations are not oriented. Then the model of the static converter is connected to the models of the components thanks to the modelling language. Finally, the compilers of such languages manage automatically the causality (so the solving sequence of the model equations) at the start of the simulation

Practically, the static converter environment is defined with equivalent sources. Thus, a voltage source or a current source is imposed at every connection point (Mohan et al., 1989). However, in power electronics, according to their value, inductors may be compared to

In the viewpoint of ordinary differential equation solving, the integral causality requires a numerical integration to get the state variables, i.e. the currents across the inductor and the voltages through the capacitors. So, for the external connection of the static converter, current sources (respectively voltage sources) can be used to represent inductors or

Single-phase Voltage inverter

Block representation

*IDC*

*vAC*

*vAC*

*UDC iAC*

*UDC*

Static converter

Bond graph representation

*IDC iAC*

of the static converters are introduced into the global application.

equations is imposed. So, the model has inputs and outputs.

representation for a single-phase voltage inverter.

AC load *iAC vAC*

Fig. 4. Example of causality aspect for a single-phase voltage inverter

current sources whereas capacitors are compared to voltages sources.

inductive phenomena (respectively capacitors or capacitive phenomena).

i.e. causal or non causal (Allain et al., 2009).

**3.1 Oriented model** 

*IDC*

**3.2 Non oriented model** 

*UDC*

running.

This approach proposes to generate automatically its models (exact and/or average) according to the nature of the state variables. However, to associate the generated model with other models, thanks to the static converter environment characterisation, the generated model has to give an expression for every complementary energetic variable of the equivalent sources that are connected to the converter. In this way, the current across voltage sources and the voltage through current sources have to be formulated.

The following outputs are formulated:

*eI* : the sub-vector of the current in the voltage sources at the interface of the static converter.

*Vmj* : the sub-vector of the voltage on the current sources at the interface of the static converter.

Finally, models are obtained by using equation (2). This representation form of state equation is especially interesting for coupling models.

#### **4. Implementation**

AMG is implemented by using Java and Maple programming. Only symbolic treatments are in Maple. The building of the state matrixes *Ai, Bi, Ci* and *Di* for every configuration (indexed *i*) is developed in Java by equations (1) and (2). The building of the exact and the

Automatic Modelling Approach for Power Electronics Converters:

LIBRARY ieee; USE ieee.ALL; use ieee.math\_real.all;

GENERIC( R1:real; L1:real; C1:real ); PORT (

);


BEGIN

ENTITY hacpar\_Exact IS

Quantity h1:in real; Quantity U1:in real; Quantity VC1:out real; Quantity iL1:out real

Fig. 8. The exact model for a boost converter in VHDL-AMS

model hacpar\_Exact

InputReal h1; InputReal U1; Real VC1; Real iL1; equation

end hacpar\_Exact ;

Fig. 9. The exact model for a boost converter in Modelica

**5. Applications in Matlab/Simulink**

**5.1 Application 1: A resonant converter** 

END ENTITY hacpar\_Exact ;

iL1'dot== (-VC1 + VC1 \* h1 + U1) / L1; END ARCHITECTURE arch\_hacpar\_Exact ;

Code Generation (C S Function, Modelica, VHDL-AMS) and MATLAB/Simulink Simulation 257


ARCHITECTURE arch\_hacpar\_Exact OF hacpar\_Exact IS

VC1'dot== -(VC1 - iL1 \* R1 + iL1 \* R1 \* h1) / C1 / R1;

external connector InputReal = input Real; parameter Real R1(fixed=false)=0.5 ; parameter Real L1(fixed=false)=0.5 ; parameter Real C1(fixed=false)=0.5 ;

der(VC1)= -(VC1 - iL1 \* R1 + iL1 \* R1 \* h1) / C1 / R1;

Many examples of converters are implemented in Matlab/Simulink. The results are presented for several applications on the continuous conduction mode among them a resonant converter, a three phase inverter coupled with a three-phase machine (modelled by a three-phase resistor-inductor load). Finally, a multi-level converter is also taken as an

The static converter has been modelled by AMG. The studied structure has an alternative level so the generalized average model is generated for the alternative and the continuous

der(iL1)= (-VC1 + VC1 \* h1 + U1) / L1;

example to show the interest of using AMG for big power electronic structure.

state variables. The equivalent average generator is also tested for this application.



average models (equations (10) and (11)) by a symbolic approach is made in Maple (Merdassi et al., 2008).

Fig. 6. Implementation in Java and Maple

In this section, an example of the generated C-S function, Modelica and VHDL-AMS code are presented for a boost converter.

Fig. 7. The average model for a boost converter in C S-Function

average models (equations (10) and (11)) by a symbolic approach is made in Maple

State matrices Ai , Bi

NetList File

Reduced incidence matrices

Java implementation

Kirchoff laws

Circuit equations

Matrices Ci , Di

Fig. 6. Implementation in Java and Maple

Fig. 7. The average model for a boost converter in C S-Function

are presented for a boost converter.

Maple implementation

Building of the average models

Models generated in :

C S-Function)

VHDL-AMS


In this section, an example of the generated C-S function, Modelica and VHDL-AMS code


> - Modelica

Building of the exact model

(Merdassi et al., 2008).

```
LIBRARY ieee;
USE ieee.ALL;
use ieee.math_real.all;
 ENTITY hacpar_Exact IS
GENERIC(
 R1:real;
 L1:real;
 C1:real
);
PORT (
 Quantity h1:in real;
 Quantity U1:in real;
 Quantity VC1:out real;
 Quantity iL1:out real
);
 END ENTITY hacpar_Exact ;
ARCHITECTURE arch_hacpar_Exact OF hacpar_Exact IS
BEGIN
VC1'dot== -(VC1 - iL1 * R1 + iL1 * R1 * h1) / C1 / R1;
iL1'dot== (-VC1 + VC1 * h1 + U1) / L1;
END ARCHITECTURE arch_hacpar_Exact ;
```
Fig. 8. The exact model for a boost converter in VHDL-AMS

```
model hacpar_Exact
external connector InputReal = input Real;
parameter Real R1(fixed=false)=0.5 ;
parameter Real L1(fixed=false)=0.5 ;
parameter Real C1(fixed=false)=0.5 ;
 InputReal h1;
 InputReal U1;
 Real VC1;
 Real iL1;
equation
der(VC1)= -(VC1 - iL1 * R1 + iL1 * R1 * h1) / C1 / R1;
der(iL1)= (-VC1 + VC1 * h1 + U1) / L1;
end hacpar_Exact ;
```
Fig. 9. The exact model for a boost converter in Modelica

#### **5. Applications in Matlab/Simulink**

Many examples of converters are implemented in Matlab/Simulink. The results are presented for several applications on the continuous conduction mode among them a resonant converter, a three phase inverter coupled with a three-phase machine (modelled by a three-phase resistor-inductor load). Finally, a multi-level converter is also taken as an example to show the interest of using AMG for big power electronic structure.

#### **5.1 Application 1: A resonant converter**

The static converter has been modelled by AMG. The studied structure has an alternative level so the generalized average model is generated for the alternative and the continuous state variables. The equivalent average generator is also tested for this application.

Automatic Modelling Approach for Power Electronics Converters:

**Exact model**

**Equivalent average generator**

**Current IL1 (A)**

average model is better suited for the converter.

δ =5)

**Generalized average model**

Generalized average model

Fig. 12. Implementation of the models for a resonant converter in Matlab/Simulink

**Generalized average model**

**Exact model**

Exact model

**time (s)**

Fig. 13. Extraction of the current amplitude of IL1 from the generalized average model (for

We can notice that, on the one hand, the average equivalent generator is not accurate for this example because it is not adapted to the converter operating in the continuous conduction mode. In fact, the equivalent average generator eliminates some dynamics of the system especially in the discontinuous conduction mode (cf. table 1). On the other hand, the classic

Code Generation (C S Function, Modelica, VHDL-AMS) and MATLAB/Simulink Simulation 259

#### **5.1.1 Definition of the control**

The mode and the control are deducted from a classic simulation of the structure to be studied in simulation software (e.g Portunus). In the example, these signals will be known as *h1* that controls (MOS1, MOS8) and *h2* that controls (MOS3, MOS6). Their complementary <sup>1</sup> *h* and 2 *h* respectively control (MOS7, MOS2) and (MOS5, MOS4).

Fig. 10. Control associated to the switching cells

Fig. 11. Full wave control: *h1* et *h2* between [-1,1]

Square control signals are used for the switch control *h1* and *h2*. These signals are periodical and characterized by a 0.5 duty cycle and the phase shifting ( δ ) between the control *h1* and *h2*.

#### **5.1.2 Simulation in Matlab/Simulink**

The generalized average model allows to get the amplitude and the phase of alternative state variables. They are deduced from the real and imaginary expression of IL1.

In Fig. 13 and Fig. 14, the amplitude of the current inductor IL1 is shown for several values of delta ( δ ).

Finally, we remark that the envelope of the current inductor IL1 illustrates the good concordance between the model generated automatically and the real model.

For the continuous state variable (the voltage VC2), the classical average model, the exact model and the equivalent average generator are generated as shown on Fig. 15.

The mode and the control are deducted from a classic simulation of the structure to be studied in simulation software (e.g Portunus). In the example, these signals will be known as *h1* that controls (MOS1, MOS8) and *h2* that controls (MOS3, MOS6). Their complementary

IL1 VC2

*h*2

Square control signals are used for the switch control *h1* and *h2*. These signals are periodical and characterized by a 0.5 duty cycle and the phase shifting ( δ ) between the control *h1* and

The generalized average model allows to get the amplitude and the phase of alternative

In Fig. 13 and Fig. 14, the amplitude of the current inductor IL1 is shown for several values

Finally, we remark that the envelope of the current inductor IL1 illustrates the good

For the continuous state variable (the voltage VC2), the classical average model, the exact

state variables. They are deduced from the real and imaginary expression of IL1.

concordance between the model generated automatically and the real model.

model and the equivalent average generator are generated as shown on Fig. 15.

2 *h*

<sup>1</sup> *h* and 2 *h* respectively control (MOS7, MOS2) and (MOS5, MOS4).

*h*1

1*h*

Fig. 10. Control associated to the switching cells

δ

Fig. 11. Full wave control: *h1* et *h2* between [-1,1]

**5.1.2 Simulation in Matlab/Simulink** 

*h2*.

of delta ( δ ).

**5.1.1 Definition of the control** 

Fig. 12. Implementation of the models for a resonant converter in Matlab/Simulink

Fig. 13. Extraction of the current amplitude of IL1 from the generalized average model (for δ =5)

We can notice that, on the one hand, the average equivalent generator is not accurate for this example because it is not adapted to the converter operating in the continuous conduction mode. In fact, the equivalent average generator eliminates some dynamics of the system especially in the discontinuous conduction mode (cf. table 1). On the other hand, the classic average model is better suited for the converter.

Automatic Modelling Approach for Power Electronics Converters:

sources to define its environment to connect to it.

*h*1 *h*2 *h*3

*h*1 *h*2 *h*3

Fig. 16. Three phase voltage inverter coupled with synchronous machine

<sup>π</sup> the phase shifting angle between the controls *h1, h2* and *h3*.

voltage on the current sources according to the equation (4).


inverse Park's transforms have been added in the machine model.

In the same way, the voltage drop applied in the phase is a function of:

application, full wave control and Pulse Width Modulation (PWM) are applied.

**Currents sources Voltage sources**

**5.2.1 Definition of the control** 

MOS6.

<sup>δ</sup> <sup>=</sup> <sup>2</sup> 3

and IU2) as a function of:



**5.2.2 Simulation in Matlab/Simulink** 

Code Generation (C S Function, Modelica, VHDL-AMS) and MATLAB/Simulink Simulation 261

As explained above, AMG needs basic assumptions on the external equivalent electrical

In this static converter, each commutation cell is an inverter legs. For, one leg when a switch is controlled to be ON the other one is OFF. As a consequence, the inverter needs only three control signals corresponding to the upper switch of the switching cell (MOS1, MOS3 and MOS5). These signals will be known as *h1, h2* and *h3*, respectively controls MOS1, MOS3 and MOS5. So, their complementary 1 2 *h h*, and 3 *h* respectively controls MOS2, MOS4 and

(c)

Here, for the average model, each control signal is a full wave control one. For this

For the full wave control, signals are periodical and characterized by a 0.5 duty cycle and

A C S-function is obtained. It contains equations of currents in the voltage sources and the

Analyzing the code (C S-Function), we can see the expression of the DC bus current (i.e. IU1

The model has been mixed with the equations of a three phase RL circuit (see Fig. 18) and three-phase synchronous machine which model is a Park Model. Park's transforms and

(b)

synchronous machine

ROTOR

Rotor axis (f) STATOR

θ

Stato (a)

Fig. 14. Extraction of the current amplitude of IL1 from the generalized average model ( for δ = 0)

Fig. 15. Exact model, equivalent average generator and classic average model of the voltage VC2

#### **5.2 Application 2: A three-phase voltage inverter**

In this section, a voltage inverter feeding an electrical machine is studied. The proposed structure operates in continuous conduction mode, i.e., every switch commutation is controlled.

As explained above, AMG needs basic assumptions on the external equivalent electrical sources to define its environment to connect to it.

#### **5.2.1 Definition of the control**

260 MATLAB for Engineers – Applications in Control, Electrical Engineering, IT and Robotics

Exact model

**time (s)**

Fig. 14. Extraction of the current amplitude of IL1 from the generalized average model ( for

Equivalent average generator

Equivalent

**5.2 Application 2: A three-phase voltage inverter** 

average generator Exact model

**time (s)** Fig. 15. Exact model, equivalent average generator and classic average model of the voltage

In this section, a voltage inverter feeding an electrical machine is studied. The proposed structure operates in continuous conduction mode, i.e., every switch commutation is

**Courant dans l'inductance iL1(A)**

Classic average Exact model model

**Current IL1(A)**

**Voltage VC2 (V)**

δ = 0)

VC2

controlled.

Generalized average model

**Modèle Moyen Généralisé**

Generalized average model

**Temps (sec)**

Classic average model

**Modèle exact**

Exact model

In this static converter, each commutation cell is an inverter legs. For, one leg when a switch is controlled to be ON the other one is OFF. As a consequence, the inverter needs only three control signals corresponding to the upper switch of the switching cell (MOS1, MOS3 and MOS5). These signals will be known as *h1, h2* and *h3*, respectively controls MOS1, MOS3 and MOS5. So, their complementary 1 2 *h h*, and 3 *h* respectively controls MOS2, MOS4 and MOS6.

Fig. 16. Three phase voltage inverter coupled with synchronous machine

Here, for the average model, each control signal is a full wave control one. For this application, full wave control and Pulse Width Modulation (PWM) are applied.

For the full wave control, signals are periodical and characterized by a 0.5 duty cycle and

<sup>δ</sup> <sup>=</sup> <sup>2</sup> 3 <sup>π</sup> the phase shifting angle between the controls *h1, h2* and *h3*.

A C S-function is obtained. It contains equations of currents in the voltage sources and the voltage on the current sources according to the equation (4).

Analyzing the code (C S-Function), we can see the expression of the DC bus current (i.e. IU1 and IU2) as a function of:


In the same way, the voltage drop applied in the phase is a function of:


#### **5.2.2 Simulation in Matlab/Simulink**

The model has been mixed with the equations of a three phase RL circuit (see Fig. 18) and three-phase synchronous machine which model is a Park Model. Park's transforms and inverse Park's transforms have been added in the machine model.

Automatic Modelling Approach for Power Electronics Converters:

VmjI1== -0.3e1 / 0.8e1 \* U1 \* h1 + U1 \* h1 \* h3 / 0.8e1 - 0.3e1 / 0.8e1 \* U1 + U1 \* h3 / 0.8e1 + U1 \* h1 \* h2 \* h3 / 0.8e1 + U1 \* h1 \* h2 / 0.8e1 + U1 \* h2 \* h3 / 0.8e1 + U1 \* h2 / 0.8e1 + U2 \* h3 / 0.8e1 + 0.3e1 / 0.8e1 \* U2 - U2 \* h1 \* h3 / 0.8e1 - 0.3e1 / 0.8e1 \* U2 \* h1 + U2 \* h2 / 0.8e1 - U2 \* h2 \* h3 / 0.8e1 - U2 \* h1 \* h2 / 0.8e1 + U2 \* h1 \* h2 \* h3 /

**Equations generated by AMG**

Vmj2== U1 \* h1 \* h2 \* h3 / 0.8e1 + U1 \* h1 \* h3 / 0.8e1 - 0.3e1 / 0.8e1 \* U1 \* h2 - 0.3e1 / 0.8e1 \* U1 + U1 \* h2 \* h3 / 0.8e1 + U1 \* h3 / 0.8e1 + U1 \* h1 \* h2 / 0.8e1 + U1 \* h1 / 0.8e1 + U2 \* h1 / 0.8e1 - U2 \* h1 \* h2 / 0.8e1 + 0.3e1 / 0.8e1 \* U2 - 0.3e1 / 0.8e1 \* U2 \* h2 + U2 \* h3 / 0.8e1 - U2 \* h2 \* h3 / 0.8e1 - U2 \* h1 \* h3 / 0.8e1 + U2 \* h1 \* h2 \* h3 / 0.8e1;

0.8e1;

..................................................

**Implementation in S-Function**

Fig. 18. Implementation in Matlab/Simulink: 3-phase RL load

VC3 VC2 VC1

Fig. 19. One leg of the three phase multi-level circuit converter

*h*1 *h*2

*h*1

Vs

iL1

*h*3

*h*4

*h*2

*h*3

*h*4

Simulation results: currents in the inductors

Code Generation (C S Function, Modelica, VHDL-AMS) and MATLAB/Simulink Simulation 263

/\* Equations of RL added\*/

dI1\_dt= (double) (Vmj1-(R4\*I1)) / L1; dI2\_dt = (double)(Vmj2-(R5\*I2))/ L2; dI3\_dt = (double) (Vmj3-(R6\*I3)) / L3;

Fig. 17. Exact model for a three phase voltage inverter (in Matlab/Simulink C S-Function)

The interest of the AMG tool becomes obvious by looking at the equation generated for this very basic power converter structure. One can easily imagine the difficulty to build such a model without modelling tool, for more complex structures, such a multi-level converter.

#### **5.3 Application 3: A multi-level converter**

A multi-level converter is taken as an example to show the interest of using AMG for big power electronic structure.

#### **5.3.1 Definition of the control**

For this application, the static converter legs are supposed perfectly balanced. In this example, only the model of one leg is generated by AMG.

The switch commutations are controlled by the signals: *h1, h2, h3* and *h4* and their complementary values.

Each control signal is a pulse wave modulation. Each switching cell is control by the same sinusoidal modulation but with a π 2 phase displacement of its triangular waveform compared to the one of the switching cell where it is imbricated.

#### **5.3.2 Simulation in Matlab/Simulink**

The exact model of the current IL1 generated in C S-function (e.g Matlab/Simulink) is compared to the classical simulation from electrical software (e.g Portunus).

By using the exact model generated by AMG, simulation results represent the perfect behaviour of the multi-level converter. The same results are given with a comparison between the current IL1 obtained automatically (from the exact model by AMG) and the one obtained from the classical simulation (e.g Portunus). Finally, the automatic modelling approach is also approved for a complicated structure.

Fig. 17. Exact model for a three phase voltage inverter (in Matlab/Simulink C S-Function) The interest of the AMG tool becomes obvious by looking at the equation generated for this very basic power converter structure. One can easily imagine the difficulty to build such a model without modelling tool, for more complex structures, such a multi-level converter.

A multi-level converter is taken as an example to show the interest of using AMG for big

For this application, the static converter legs are supposed perfectly balanced. In this

The switch commutations are controlled by the signals: *h1, h2, h3* and *h4* and their

Each control signal is a pulse wave modulation. Each switching cell is control by the same sinusoidal modulation but with a π 2 phase displacement of its triangular waveform

The exact model of the current IL1 generated in C S-function (e.g Matlab/Simulink) is

By using the exact model generated by AMG, simulation results represent the perfect behaviour of the multi-level converter. The same results are given with a comparison between the current IL1 obtained automatically (from the exact model by AMG) and the one obtained from the classical simulation (e.g Portunus). Finally, the automatic modelling

**5.3 Application 3: A multi-level converter** 

example, only the model of one leg is generated by AMG.

approach is also approved for a complicated structure.

compared to the one of the switching cell where it is imbricated.

compared to the classical simulation from electrical software (e.g Portunus).

power electronic structure.

complementary values.

**5.3.1 Definition of the control** 

**5.3.2 Simulation in Matlab/Simulink** 

Fig. 18. Implementation in Matlab/Simulink: 3-phase RL load

Fig. 19. One leg of the three phase multi-level circuit converter

Automatic Modelling Approach for Power Electronics Converters:

control and the mode, by analyzing classical simulation.

the future to extend it to AC/DC and DC/AC converters.

**7. Acknowledgment**

July 1994 , pp 493-510.

pp 1359 – 1365.

N°3, pp 295-299.

**8. References** 

causality. This aspect is especially very interesting for coupling models.

C6E2-SIMPA2 on the simulation and modelling of mechatronic systems.

*Power Electronics*, 6th Workshop, 19-22 July 1998, pp I IV.

*IECON'02*, 5-8 Nov. 2002, Vol.2, pp 864 - 869.

Code Generation (C S Function, Modelica, VHDL-AMS) and MATLAB/Simulink Simulation 265

AMS language. Indeed, models in such a language are easy to use in the power electronics simulation software like Matlab/Simulink, Portunus, Simplorer, Amesim, Dymola. This also allows to connect the generated model with others by managing automatically the model

Intrinsically, for the average modelling, AMG supposes an a priori on the behaviour of the studied static converters. In this way, the user must understand and analyze the behaviour of the static converter to study. It should also be interesting to extract automatically the

A specific methodology for the treatment of the discontinuous conduction mode is also proposed with AMG but not presented in this chapter. However, this automatic treatment requires some knowledge about the converter operating in discontinuous conduction mode. Nowadays, it is only automatically applied for DC/DC converters so it will be interesting in

This work has been supported by the French association ANR, in the context of the project

Allain, L.; Merdassi, A.; Gerbaud, L. & Bacha, S. (2009). Automatic modelling of Power

Bass, R.M. & Sun, J. (1998). Using symbolic computation for power electronics, *Computers in* 

Chen, M. & Sun, J. (2005). A General Approach to Averaged Modelling and Analysis of

Chetty, P. R. K. (1982). Current injected equivalent circuit approach to modelling and

Delaye, A.; Albert, L.; Gerbaud, L. & Wurtz, F. (2004). Automatic generation of sizing

Kanaan, H. Y.; Al-Haddad, K & Fnaiech, F. (2005). Modelling and control of three-

*IEEE Proc. Electric Power Applications*, pp. 551-557, May 2005.

*In Proceddings of the Modelica Conference*, Como Italy, September 2009. Bacha, S.; Brunello, M. & Hassan, A. (1994). A general large signal model for DC-DC

Electronic Converter, Average model construction and Modelica model generation,

symmetric switching converters, *Electric Machines and Power Systems*, Vol 22, N° 4,

Active-Clamped Converters, Applied Power Electronics Conference and Exposition, *in Proceedings of the Twentieth Annual IEEE* ,Volume 2, 6-10 March 2005,

analysis of current programmed switching DC-to-DC converters (discontinuous inductor conduction mode), *IEEE Transactions. on Industry Applications*, Vol. IA-18,

models for the optimization of electromagnetic devices using reluctances networks, *IEEE Transactions on Magnetics*, Volume 40, Issue2, Part 2, March 2004, pp.830-833. Etxeberria-Otadui, I.; Manzo, V.; Bacha, S. & Baltes, F. (2002). Generalized average

modelling of FACTS for real time simulation in ARENE, *in Proceedings of IEEE-*

phase/switch/level fixed-frequency PWM rectifier: state-space averaged model,

Fig. 20. Comparison between the current IL1 from the exact model (from i.e Matlab/Simulink) and the classical reference model (from i.e Portunus)

Fig. 21. Results of simulation of the exact model generated by AMG

#### **6. Conclusion**

This chapter proposes an automatic modelling process that allows to obtain different models of static converter according to the nature of the power conversion and the state variables. Every model is entirely made in an automatic way by the AMG software, from a description of the structure (here a Netlist file generated by PSpice), the commutation mode (cyclic sequence of switched configurations) and the switch control sequence of the static converter to model. This descriptive information is given by the AMG user.

The automatic generation is useful, especially for complex static converter structures. The generated models are also automatically translated into C-S Function, Modelica and VHDL-

AMS language. Indeed, models in such a language are easy to use in the power electronics simulation software like Matlab/Simulink, Portunus, Simplorer, Amesim, Dymola. This also allows to connect the generated model with others by managing automatically the model causality. This aspect is especially very interesting for coupling models.

Intrinsically, for the average modelling, AMG supposes an a priori on the behaviour of the studied static converters. In this way, the user must understand and analyze the behaviour of the static converter to study. It should also be interesting to extract automatically the control and the mode, by analyzing classical simulation.

A specific methodology for the treatment of the discontinuous conduction mode is also proposed with AMG but not presented in this chapter. However, this automatic treatment requires some knowledge about the converter operating in discontinuous conduction mode. Nowadays, it is only automatically applied for DC/DC converters so it will be interesting in the future to extend it to AC/DC and DC/AC converters.

#### **7. Acknowledgment**

This work has been supported by the French association ANR, in the context of the project C6E2-SIMPA2 on the simulation and modelling of mechatronic systems.

#### **8. References**

264 MATLAB for Engineers – Applications in Control, Electrical Engineering, IT and Robotics

**time (s)** Fig. 20. Comparison between the current IL1 from the exact model (from i.e Matlab/Simulink)

This chapter proposes an automatic modelling process that allows to obtain different models of static converter according to the nature of the power conversion and the state variables. Every model is entirely made in an automatic way by the AMG software, from a description of the structure (here a Netlist file generated by PSpice), the commutation mode (cyclic sequence of switched configurations) and the switch control sequence of the static converter

The automatic generation is useful, especially for complex static converter structures. The generated models are also automatically translated into C-S Function, Modelica and VHDL-

Vs exact model (V) IL1 exact model (A)

Fig. 21. Results of simulation of the exact model generated by AMG

to model. This descriptive information is given by the AMG user.

**6. Conclusion** 

IL1 faithfull model IL1 exact model

**time(s)**

**Current IL1 (A)**

and the classical reference model (from i.e Portunus)


**11** 

*México* 

**PV Curves for Steady-State Security** 

Most of the problem solutions oriented to the analysis of power systems require the implementation of sophisticated algorithms which need a considerable amount of calculations that must be carried out with a digital computer. Advances in software and hardware engineering have led to the development of specialized computing tools in the area of electrical power systems which allows its efficient analysis. Most of the computational programs, if not all of them, are developed under proprietary code, in other words, the users does not have access to the source code, which limits its usage scope. These programs are considered as black boxes that users only need to feed the required input data to obtain the results without knowing anything about the details of the inner program structure. In the academic or research areas this kind of programs does not fulfill all needs that are required hence it is common the usage of programming tools oriented to the scientific computing. These tools facilitate the development of solution algorithms for any engineering problem, by taking into account the mathematical formulations which define the solution of the proposed problem. Besides, it is also common that most of these programs are known as script or interpreted languages, such as MATLAB, Python and Perl. They all have the common feature of being high level programming languages that usually make use of available efficient libraries in a straightforward way. MATLAB is considered as a programming language that has become a good option for many researchers in different science and engineering areas because of it can allow the creation, manipulation and operation of sparse or full matrices; it also allows to the user the programming of any mathematical algorithm by means of an ordered sequence of commands (code) written into an ascii file known as script files. These files are portable, i.e. they can be executed in most of

software versions in any processor under the operating systems Linux or windows.

The main objective of this chapter consists in presenting an efficient alternative of developing a script program in the MATLAB environment; the program can generate characteristic curves power vs. voltage (PV curves) of each node in a power system. The curves are used to analyze and evaluate the stability voltage limits in steady state, and they are calculated by employing an algorithm known as continuous load flows, which are a variation of the Newton-Raphson formulation for load flows but it avoids any possibility of singularity during the solution process under a scenario of continuous load variation. To illustrate the application of this analysis tool, the 14-node IEEE test system is used to

**1. Introduction** 

Ricardo Vargas, M.A Arjona and Manuel Carrillo

**Assessment with MATLAB** 

*División de Estudios de Posgrado e Investigación* 

*Instituto Tecnológico de la Laguna* 


### **PV Curves for Steady-State Security Assessment with MATLAB**

 Ricardo Vargas, M.A Arjona and Manuel Carrillo *Instituto Tecnológico de la Laguna División de Estudios de Posgrado e Investigación México* 

#### **1. Introduction**

266 MATLAB for Engineers – Applications in Control, Electrical Engineering, IT and Robotics

Karnopp, D.C.; Margolis, D.L. & Rosenberg, R.C. (1990). System dynamics: a unified

Kuo-Peng P.; Sdowski, N.; Bastos, J.P.A.; Carlson, R. & Batistela, N.J. (1997). A General

Maksimovic, D.; Stankovic, A.M.; Thottuvelil, V.J. & Verghese, G.C. (2001). Modeling and

Maranesi, P.G. & Riva, M. (2003). Automatic modelling of PWM DC-DC converters, *IEEE* 

Merdassi, A.; Gerbaud, L. & Bacha, S. (2008). A New Automatic Average Modelling Tool

Merdassi, A.; Gerbaud, L. & Bacha, S. (2010). Automatic generation of average models for

Petitclair, P.; Bacha, S. & Rognon, J.p. (1996). Averaged modelling and nonlinear control of

Rajagopalan, V. (1987). Computer-aided analysis of power electronic systems, New York,

Sun, J. & Grostollen, H. (1992). Averaged Modeling of switching power converters:

Sun, J. & Grostollen, H. (1997). Symbolic Analysis Methods for Averaged Modelling of

Verdiere, F.; Bacha, S. & Gerbaud, L. (2003). Automatic modelling of static converter

Webster, R. & Ngo, K.D.T. (1992). Computer-based symbolic circuit analysis and simulation,

Method for Coupling Static Converters with Electromagnetic Structures, *IEEE* 

simulation of power electronic converters, *Proceedings of the IEEE*, Vol. 89, Issue 6,

for Power Electronics Systems, *IEEE Power Electron. Specialists Conference*, Greece

power electronics systems in VHDL-AMS and Modelica modelling languages, *Journal of Modelling and Simulation of Systems (JMSS),* Vol.1, Iss.3, pp. 176-186. Middlebrook, R.D. & Cuk, S. (1976). A general unified approach to modelling switching converter power tages, *IEEE Power Specialists Conference*, pp 18-34, 1976. Mohan, N.; Underland, T.M. & Robbins, W.P. (1989). Power Electronics: Converters,

Applications and Design, 1ere Ed : ISBN: 0 471 61342 82eme :ISBN 0 471 505374,

an ASVC (advanced static VAr compensator), *Power Electronics Specialists* 

Reformulation and theoretical basis, *Power Electronics Specialists Conference PESC*

Switching Power Converters, *IEEE Transactions on Power Electronics*, Vol 12, n° 3, pp

approach, *John Wiley and Sons,* 2nd edition.

*Power Electron.* Letters, Vol.1, N°4.

Rhodes, 15-19 June 2008 pp:3425- 3431.

*Conference*, *27th Annual IEEE*, pp: 753 - 758 vol.1.

*Record.,* 23rd Annual IEEE, pp.1165-1172.

averaged models*, EPE,* Toulouse, pp 1-9.

*in Conference Proceedings APEC*, pp. 772-779.

pp 898 – 912.

1989.

537-546.

Marcel Dekker Inc.

*Transactions on. Magnetics*., Vol.33, N°2, March1997.

Most of the problem solutions oriented to the analysis of power systems require the implementation of sophisticated algorithms which need a considerable amount of calculations that must be carried out with a digital computer. Advances in software and hardware engineering have led to the development of specialized computing tools in the area of electrical power systems which allows its efficient analysis. Most of the computational programs, if not all of them, are developed under proprietary code, in other words, the users does not have access to the source code, which limits its usage scope. These programs are considered as black boxes that users only need to feed the required input data to obtain the results without knowing anything about the details of the inner program structure. In the academic or research areas this kind of programs does not fulfill all needs that are required hence it is common the usage of programming tools oriented to the scientific computing. These tools facilitate the development of solution algorithms for any engineering problem, by taking into account the mathematical formulations which define the solution of the proposed problem. Besides, it is also common that most of these programs are known as script or interpreted languages, such as MATLAB, Python and Perl. They all have the common feature of being high level programming languages that usually make use of available efficient libraries in a straightforward way. MATLAB is considered as a programming language that has become a good option for many researchers in different science and engineering areas because of it can allow the creation, manipulation and operation of sparse or full matrices; it also allows to the user the programming of any mathematical algorithm by means of an ordered sequence of commands (code) written into an ascii file known as script files. These files are portable, i.e. they can be executed in most of software versions in any processor under the operating systems Linux or windows.

The main objective of this chapter consists in presenting an efficient alternative of developing a script program in the MATLAB environment; the program can generate characteristic curves power vs. voltage (PV curves) of each node in a power system. The curves are used to analyze and evaluate the stability voltage limits in steady state, and they are calculated by employing an algorithm known as continuous load flows, which are a variation of the Newton-Raphson formulation for load flows but it avoids any possibility of singularity during the solution process under a scenario of continuous load variation. To illustrate the application of this analysis tool, the 14-node IEEE test system is used to

PV Curves for Steady-State Security Assessment with MATLAB 269

integrating solution algorithms for economic dispatch, calculation and plotting of PV curves, testing of methods with distributed slacks, static var compensator (SVC) models, transmission lines, generators, etc. It is also an important tool in power system research, making the PTL more complete for the analysis or studies oriented to the operation and

As any other simulation program (commercial or free), the PTL requires of information data as input, it is needed for the analysis process. The information can be given as a data file that contains basic information to generate the base study case: the base power of the system, nodal information (number of nodes, voltages, load powers and generation power), machine limits, system branches, SVC information (if applies). The simulation program PTL can handle two file extensions: cdf (standardized IEEE format) and ptl (proposed PTL format).

The input information for carrying out the search of the solution process, as the related data to the problem results of the load flow problem (for generating the base case) are stored in defined data structures (e.g. Dat\_Vn, Dat\_Gen, Dat\_Lin, Dat\_Xtr). These structures allow easily the data extraction, by naming each field in such a way that the programming becomes intuitive and each variable can be easily identified with the corresponding physical variable of the problem. An example with two structures used in the PTL program is shown in Table 1. The MATLAB structures are composed of non-primitive variable types that allow storing different data types in a hierarchical way with the same entity (García et al., 2005). They are formed by data containers called fields, which can be declared by defining the structure

name and the desired field considering its value, e.g. Dat\_Vn.Amp=1.02.

Fig. 1. GUI of the PTL program.

control of electric power systems.

**2.1 Data input details** 

**2.2 Simulator description** 

generate the PV curves. The code presented allows any modification throughout its script file and therefore it can be used for future power system studies and research.

The formulation of the load flow problem is firstly presented to obtain the PV curves, there are some issues that need to be taken into account in the algorithm oriented to the solution of load flows such as: mathematical formulation of the load flow, its adaptation to the Newton-Rhapson method and the implementation of the continuation theory to the analysis of load flows. It is also presented the necessary programming issues to the development of the script that plots the PV curves, the recommendations that are needed in the creation, manipulation and operation of sparse matrices, the use of vector operations, triangular decompositions techniques (that used in the solution of the set on linear equations) and finally the reading of ascii files and Graphical User Interface (GUI) development are also given.

#### **1.1 Antecedents**

Nowadays there are commercial programs which have been approved and used for the electric utilities in the analysis of electric power systems. Simulation programs as the Power World Simulator (PWS) (PowerWorld Corporation, 2010) and PSS (Siemens, 2005) are some of the most popular in the control and planning of a power system, and some of them are adopted by universities, e.g. PWS, because of its elegant interface and easy usage. Most of them have friendly user interfaces. On the other hand, a bachelor or graduate student, who want to reproduce or test new problem formulations to the solution of power system problems, need a simulation tool suitable for the generation of prototype programs. The code reutilization is important for integrating in a modular form, new functions required for the power system analysis (Milano, 2010). Commercial programs does not fulfill these requirements and therefore a search for alternatives is usually carry out, such as a new programming language or for the scientific language MATLAB. It is possible to find open source projects in several websites, which are usually named as "Toolbox" by their authors, and they cover a vast diversity of topics as: load flows, transient stability analysis, nodal analysis, and electromagnetic transients. Some of most relevant projects and its authors are: PSAT by Federico Milano (Milano, 2006), MatPower by Zimmerman, Carlos E. Murillo-Sánchez and Deqiang Gan (Zimmerman et al., 2011), PST by Graham Rogers, Joe H. Chow and Luigi Vanfretti (Graham et al., 2009) and MatEMTP by Mahseredjian, J. Alvarado and Fernando L. (Mahseredjian et al., 1997).

Similar projects have been developed at the Instituto Tecnológico de la Laguna (ITL) and they have been the basis for several MSc theses which have been integrated into the power system program PTL (figure 1). These projects have made possible the incorporation of new applications making a more flexible and robust program for the steady-state analysis of an electric power system.

#### **2. Conceptual design of the PTL simulator**

In spite of the foundation of the PTL program, i.e. being an integration of several graduate projects at the ITL, its design offers an interface which permits an intuitive user interaction and at the same time it has a dynamic performance which is able to solve load flow problems for any electric network regardless the node number. It offers the feature of showing the information graphically and numerically and besides it generates a report of the activities performed and exports files with data for making stability studies. The above PTL features make it a simulation program suitable for investigations because it allows

generate the PV curves. The code presented allows any modification throughout its script

The formulation of the load flow problem is firstly presented to obtain the PV curves, there are some issues that need to be taken into account in the algorithm oriented to the solution of load flows such as: mathematical formulation of the load flow, its adaptation to the Newton-Rhapson method and the implementation of the continuation theory to the analysis of load flows. It is also presented the necessary programming issues to the development of the script that plots the PV curves, the recommendations that are needed in the creation, manipulation and operation of sparse matrices, the use of vector operations, triangular decompositions techniques (that used in the solution of the set on linear equations) and finally the reading of

Nowadays there are commercial programs which have been approved and used for the electric utilities in the analysis of electric power systems. Simulation programs as the Power World Simulator (PWS) (PowerWorld Corporation, 2010) and PSS (Siemens, 2005) are some of the most popular in the control and planning of a power system, and some of them are adopted by universities, e.g. PWS, because of its elegant interface and easy usage. Most of them have friendly user interfaces. On the other hand, a bachelor or graduate student, who want to reproduce or test new problem formulations to the solution of power system problems, need a simulation tool suitable for the generation of prototype programs. The code reutilization is important for integrating in a modular form, new functions required for the power system analysis (Milano, 2010). Commercial programs does not fulfill these requirements and therefore a search for alternatives is usually carry out, such as a new programming language or for the scientific language MATLAB. It is possible to find open source projects in several websites, which are usually named as "Toolbox" by their authors, and they cover a vast diversity of topics as: load flows, transient stability analysis, nodal analysis, and electromagnetic transients. Some of most relevant projects and its authors are: PSAT by Federico Milano (Milano, 2006), MatPower by Zimmerman, Carlos E. Murillo-Sánchez and Deqiang Gan (Zimmerman et al., 2011), PST by Graham Rogers, Joe H. Chow and Luigi Vanfretti (Graham et al., 2009) and MatEMTP by Mahseredjian, J. Alvarado and

Similar projects have been developed at the Instituto Tecnológico de la Laguna (ITL) and they have been the basis for several MSc theses which have been integrated into the power system program PTL (figure 1). These projects have made possible the incorporation of new applications making a more flexible and robust program for the steady-state analysis of an

In spite of the foundation of the PTL program, i.e. being an integration of several graduate projects at the ITL, its design offers an interface which permits an intuitive user interaction and at the same time it has a dynamic performance which is able to solve load flow problems for any electric network regardless the node number. It offers the feature of showing the information graphically and numerically and besides it generates a report of the activities performed and exports files with data for making stability studies. The above PTL features make it a simulation program suitable for investigations because it allows

file and therefore it can be used for future power system studies and research.

ascii files and Graphical User Interface (GUI) development are also given.

**1.1 Antecedents** 

Fernando L. (Mahseredjian et al., 1997).

**2. Conceptual design of the PTL simulator** 

electric power system.

Fig. 1. GUI of the PTL program.

integrating solution algorithms for economic dispatch, calculation and plotting of PV curves, testing of methods with distributed slacks, static var compensator (SVC) models, transmission lines, generators, etc. It is also an important tool in power system research, making the PTL more complete for the analysis or studies oriented to the operation and control of electric power systems.

#### **2.1 Data input details**

As any other simulation program (commercial or free), the PTL requires of information data as input, it is needed for the analysis process. The information can be given as a data file that contains basic information to generate the base study case: the base power of the system, nodal information (number of nodes, voltages, load powers and generation power), machine limits, system branches, SVC information (if applies). The simulation program PTL can handle two file extensions: cdf (standardized IEEE format) and ptl (proposed PTL format).

#### **2.2 Simulator description**

The input information for carrying out the search of the solution process, as the related data to the problem results of the load flow problem (for generating the base case) are stored in defined data structures (e.g. Dat\_Vn, Dat\_Gen, Dat\_Lin, Dat\_Xtr). These structures allow easily the data extraction, by naming each field in such a way that the programming becomes intuitive and each variable can be easily identified with the corresponding physical variable of the problem. An example with two structures used in the PTL program is shown in Table 1.

The MATLAB structures are composed of non-primitive variable types that allow storing different data types in a hierarchical way with the same entity (García et al., 2005). They are formed by data containers called fields, which can be declared by defining the structure name and the desired field considering its value, e.g. Dat\_Vn.Amp=1.02.

PV Curves for Steady-State Security Assessment with MATLAB 271

An electric power system is formed with elements that can be represented for its equivalent circuit RLC, and with components as load and generating units which cannot be represented as basic elements of an electrical network, they are represented as nonlinear elements. However, the analysis of an electrical power system starts with the formulation of a referenced nodal system and it describes the relationship between the electrical variables

where **I**BUS is a *n*×1 vector whose components are the electrical net current injections in the *n* network nodes, **V**BUS is a *n*×1 vector with the nodal voltages measured with respect to the referenced node and **Y**BUS is the *n*× *n* nodal admittance matrix of the electrical network; it has the properties of being symmetric and squared, and it describes the network topology. In a real power system, the injected currents to the network nodes are unknown; what it is commonly known is the net injected power *Sk*. Conceptually, *Sk* is the net complex power injected to the *k*-th node of the electrical network, and it is determined by the product of

currents at the node *k*, that is, the *k*-th elements of vectors **V***BUS* y *BUS* **I** in (1). Once the *Ik* is

,

where , Y*k m* is the element (*k,m*) of **Y***BUS* matrix in (1). *Sk* can also be represented for its real

where *Pk* and *Qk* are the net active and reactive power injected at node *k* of the system,

where the variables *Gen Pk* and *Gen Qk* represent the active and reactive powers respectively. They are injected at node *k* for a generator and the variables *Load Pk* and *Load Qk* represent the

> ( ) cos sin *<sup>k</sup> <sup>j</sup><sup>θ</sup> V Ve V j kk k k k* == + θ

active and reactive Powers, respectively of a load connected to the same node.

By representing the nodal voltages in polar form, we have:

and each element of the admittance matrix **Y***BUS* as,

1 V YV *km m n*

=

*m*

and imaginary components such as it is shown in the following expression:

\*

=⋅ =⋅ , for *k*= 1,2,…..n (2)

*S P jQ kk k* = + , for *k*= 1,2,…..n (3)

*Gen Load PP P kk k* = − (4)

*Gen Load QQ Q kk k* = − (5)

*Y G km km km* = + *jB* (7)

(6)

 θ

calculated using (1), the net complex power *Sk* can be expressed as:

*k kk k*

*S VI* <sup>∗</sup>

**I YV** *BUS BUS BUS* = ⋅ (1)

\*), where *Vk* and *Ik* are the voltages and nodal

(voltages and currents) as it is stated by the second Kirchhoff´s law or nodal law.

**3.1 Power flow equations** 

voltage (*Vk*) and the current conjugate (*Ik*

respectively. They are defined as:


Table 1. Example of the information handled in the PTL.

#### **2.3 Output information**

The PTL program displays the results obtained from the load flow execution in a boxlist (uicontrol MATLAB) with a defined format: nodal information, power flows in branches and generators. It gives the option of printing a report in Word format with the same information. In addition, it has the option of generating a file with the extension f2s which is oriented for stability studies and it contains all necessary information for the initialization of the state machine variables by using the results of the current power flow solution.

The definition of the conceptual simulation program PTL is presented as a recommendation by taking into account the three basic points that a simulation program must include: to be completely functional, to be general for any study case and to facilitate its maintenance; in other words it must allow the incorporation of new functions for the solution of new studies, such that it allows its free modification as easy as possible.

#### **3. Load flows**

In a practical problem, the knowledge of the operating conditions of an electric power system is always needed; that is, the knowledge of the nodal voltage levels in steady-state under loaded and generating conditions and the availability of its transmission elements are required to evaluate the system reliability. Many studies focused to the electric power systems start from the load flow solution which is known as "base case", and in some cases, these studies are used to initialize the state variables of dynamic elements of a network (generators, motors, SVC, etc) to carry out dynamic and transient stability studies. Another study of interest, that it also requires starting from a base case, is the analysis of the power system security that will be discussed in next sections.

The mathematical equations used to solve this problem are known as power flow equations, or network equations. In its more basic form, these equations are derived considering the transmission network with lumped parameters under lineal and balanced conditions, similarly as the known operating conditions in all nodes of the system (Arrillaga, 2001).

#### **3.1 Power flow equations**

270 MATLAB for Engineers – Applications in Control, Electrical Engineering, IT and Robotics

Ang Phase angle of voltages

V\_Rem\_bus Voltage information Pgen Generated active power Qgen Generated reactive power

NumNG Generation and load nodes

Pmin Minimum limit of generator active power Pmax Maximum limit of generator active power Qmin Minimum limit of generator reactive power Qmax Maximum limit of generator reactive power

The PTL program displays the results obtained from the load flow execution in a boxlist (uicontrol MATLAB) with a defined format: nodal information, power flows in branches and generators. It gives the option of printing a report in Word format with the same information. In addition, it has the option of generating a file with the extension f2s which is oriented for stability studies and it contains all necessary information for the initialization of the state machine variables by using the results of the current power flow

The definition of the conceptual simulation program PTL is presented as a recommendation by taking into account the three basic points that a simulation program must include: to be completely functional, to be general for any study case and to facilitate its maintenance; in other words it must allow the incorporation of new functions for the solution of new

In a practical problem, the knowledge of the operating conditions of an electric power system is always needed; that is, the knowledge of the nodal voltage levels in steady-state under loaded and generating conditions and the availability of its transmission elements are required to evaluate the system reliability. Many studies focused to the electric power systems start from the load flow solution which is known as "base case", and in some cases, these studies are used to initialize the state variables of dynamic elements of a network (generators, motors, SVC, etc) to carry out dynamic and transient stability studies. Another study of interest, that it also requires starting from a base case, is the analysis of the power

The mathematical equations used to solve this problem are known as power flow equations, or network equations. In its more basic form, these equations are derived considering the transmission network with lumped parameters under lineal and balanced conditions, similarly as the known operating conditions in all nodes of the system (Arrillaga, 2001).

Structure Field Description

Table 1. Example of the information handled in the PTL.

studies, such that it allows its free modification as easy as possible.

system security that will be discussed in next sections.

Dat\_Gen

**2.3 Output information** 

solution.

**3. Load flows** 

Dat\_Vn Amp Voltage magnitude

Nslack Slack node

An electric power system is formed with elements that can be represented for its equivalent circuit RLC, and with components as load and generating units which cannot be represented as basic elements of an electrical network, they are represented as nonlinear elements. However, the analysis of an electrical power system starts with the formulation of a referenced nodal system and it describes the relationship between the electrical variables (voltages and currents) as it is stated by the second Kirchhoff´s law or nodal law.

$$\mathbf{I}\_{BLS} = \mathbf{Y}\_{BLS} \cdot \mathbf{V}\_{BLS} \tag{1}$$

where **I**BUS is a *n*×1 vector whose components are the electrical net current injections in the *n* network nodes, **V**BUS is a *n*×1 vector with the nodal voltages measured with respect to the referenced node and **Y**BUS is the *n*× *n* nodal admittance matrix of the electrical network; it has the properties of being symmetric and squared, and it describes the network topology.

In a real power system, the injected currents to the network nodes are unknown; what it is commonly known is the net injected power *Sk*. Conceptually, *Sk* is the net complex power injected to the *k*-th node of the electrical network, and it is determined by the product of voltage (*Vk*) and the current conjugate (*Ik* \*), where *Vk* and *Ik* are the voltages and nodal currents at the node *k*, that is, the *k*-th elements of vectors **V***BUS* y *BUS* **I** in (1). Once the *Ik* is calculated using (1), the net complex power *Sk* can be expressed as:

$$\mathbf{S}\_{k} = \mathbf{V}\_{k} \cdot \mathbf{I}\_{k}^{\ \ \text{\textquotedblleft}} = \mathbf{V}\_{k} \cdot \left(\sum\_{m=1}^{n} \mathbf{Y}\_{k,m} \mathbf{V}\_{m}\right)^{\ \ \text{\textquotedblleft}}, \text{ for } k = 1, 2, ..., \text{n} \tag{2}$$

where , Y*k m* is the element (*k,m*) of **Y***BUS* matrix in (1). *Sk* can also be represented for its real and imaginary components such as it is shown in the following expression:

$$S\_k = P\_k + jQ\_k \quad \text{for } k = 1, 2, \dots \text{n} \tag{3}$$

where *Pk* and *Qk* are the net active and reactive power injected at node *k* of the system, respectively. They are defined as:

$$P\_k = P\_k^{Gen} - P\_k^{Loal} \tag{4}$$

$$Q\_k = Q\_k^{Gen} - Q\_k^{Load} \tag{5}$$

where the variables *Gen Pk* and *Gen Qk* represent the active and reactive powers respectively. They are injected at node *k* for a generator and the variables *Load Pk* and *Load Qk* represent the active and reactive Powers, respectively of a load connected to the same node. By representing the nodal voltages in polar form, we have:

$$V\_k = V\_k e^{j\theta\_k} = V\_k \left(\cos\theta\_k + j\sin\theta\_k\right) \tag{6}$$

and each element of the admittance matrix **Y***BUS* as,

$$Y\_{km} = G\_{km} + jB\_{km} \tag{7}$$

PV Curves for Steady-State Security Assessment with MATLAB 273

The nature of the load flow problem formulation requires the simultaneous solution of a set of nonlinear equations; therefore it is necessary to apply a numerical method that guarantees a unique solution. There are methods as the Gauss-Seidel and Newton-Rhapson, in the work presented here, the load flow problem is solved with the Newton-Raphson (NR)

The NR method is robust and has a fast convergence to the solution. The method has been

[ ] 1 2 ( ) ( ), ( ), , ( ) *<sup>T</sup>*

[ ] 1 2 ,,, *<sup>T</sup>*

The numerical methods used to solve (11) are focused to determine a recursive formula *k k* <sup>+</sup><sup>1</sup> **x xx** = +Δ . The solution algorithm is based in the iterative application of the above formula starting from an initial estimate <sup>0</sup> **x** , until a convergence criterion is achieved

The Newton-Raphson method can be easily explained when it is applied to an equation of a single state variable (Arrillaga, 2001). A geometrical illustration of this problem is shown in

where **fx** ( ) is a *n*×1 vector that contains the *n* equations to be solved ( ) 0 *<sup>i</sup> f* **x** = , *i=1,n*,

**fx 0** ( ) = (11)

*<sup>n</sup>* **fx x x x** = *ff f* (12)

is a small numerical value, and the vector *<sup>k</sup>* **x** is an approximation to

*<sup>n</sup>* **x** = *xx x* (13)

**3.3 Solution of the nonlinear equations by the Newton-Rhapson method** 

applied to the solution of nonlinear equations that can be defined as,

and **x** is a *n*×1 vector that contains the state variables, *<sup>i</sup> x* , *i=1,n*,

ε

Fig. 2. Geometric interpretation of the NR algorithm.

(Arrillga, 2001).

max( ) *<sup>k</sup>* Δ < **x** ε, where

figure 2.

the solution <sup>∗</sup> **x** of (11).

generators. Therefore this node compensates the unbalance between the active power between loads and generating units as specified in the PQ and PV nodes (Arrillaga, 2001).

Using the above expressions in (2), it results,

$$S\_k = V\_k e^{j\theta\_k} \cdot \left(\sum\_{m=1}^n \left(G\_{km} + jB\_{km}\right) V\_m e^{j\theta\_m}\right)^\* = V\_k \cdot \left(\sum\_{m=1}^n V\_m \left(G\_{km} + jB\_{km}\right) \left(\cos\theta\_{km} + j\sin\theta\_{km}\right)\right)^\* \tag{8}$$
 
$$\text{for } k=1,2,...,n \tag{8}$$

where θ θθ *km k m* = − . By separating the real and imaginary parts as it is suggested in (3), it is obtained the following,

$$P\_k = V\_k^2 G\_{kk} + V\_k \sum\_{\substack{m=1 \\ m \neq n}}^n V\_m \left( G\_{km} \text{Cov}(\theta\_k - \theta\_m) + B\_{km} \text{Sim}(\theta\_k - \theta\_m) \right) \text{ for } k = 1, 2, ..., n \tag{9}$$

$$Q\_k = -V\_k^2 B\_{km} + V\_k \sum\_{\substack{m=1 \\ m \neq n}}^n V\_m \left( G\_{km} \text{Cov}(\theta\_k - \theta\_m) - B\_{km} \text{Cov}(\theta\_k - \theta\_m) \right), \text{for } k = 1, 2, ..., n \tag{10}$$

The equations (9) and (10) are commonly known as Power flow equations and they are needed for solving the load flow problem (Arrillaga, 2001). By analyzing these equations it can be clearly seen that each system node *k* is characterized for four variables: active power, reactive power, voltage magnitude and angle. Hence it is necessary to specify two of them and consider the remaining two as state variables to find with the solution of both equations.

#### **3.2 Bus types in load flow studies**

In an electrical power network, by considering its load flow equations, four variables are defined at each node, the active and reactive powers injected at node *Pk* and *Qk* , and the magnitude and phase voltage at the node *Vk* y θ *<sup>k</sup>* . The latter two variables determine the total electrical state of the network, then, the objective of the load flow problem consists in determining these variables at each node. The variables can be classified in controlled variables, that is, its values can be specified and state variables to be calculated with the solution of the load flow problem. The controlled or specified variables are determined by taking into account the node nature, i.e. in a generator node, the active power can be controlled by the turbine speed governor, and the voltage magnitude of the generator node can be controlled by the automatic voltage regulator (AVR). In a load node, the active and reactive power can be specified because its values can be obtained from load demand studies. Therefore, the system nodes can be classified as follows:


1 1

( ) <sup>2</sup>

( ) <sup>2</sup>

θθ

The equations (9) and (10) are commonly known as Power flow equations and they are needed for solving the load flow problem (Arrillaga, 2001). By analyzing these equations it can be clearly seen that each system node *k* is characterized for four variables: active power, reactive power, voltage magnitude and angle. Hence it is necessary to specify two of them and consider the remaining two as state variables to find with the solution of both equations.

In an electrical power network, by considering its load flow equations, four variables are defined at each node, the active and reactive powers injected at node *Pk* and *Qk* , and the

total electrical state of the network, then, the objective of the load flow problem consists in determining these variables at each node. The variables can be classified in controlled variables, that is, its values can be specified and state variables to be calculated with the solution of the load flow problem. The controlled or specified variables are determined by taking into account the node nature, i.e. in a generator node, the active power can be controlled by the turbine speed governor, and the voltage magnitude of the generator node can be controlled by the automatic voltage regulator (AVR). In a load node, the active and reactive power can be specified because its values can be obtained from load demand

• *Generator node PV*: It is any node where a generator is connected; the magnitude voltage and generated active power can be controlled or specified, while the voltage phase

• *Slack node* (Compensator): In a power system at least one of the nodes has to be selected and labeled with this node type. It is a generating node where it cannot be specified the generated active power as in the PV node, because the transmission losses are not known beforehand and thus it cannot be established the balance of active power of the loads and

angle and the reactive power are the unknown state variables (Arrillaga, 2001). • *Load node PQ*: It is any node where a system load is connected; the active and reactive consumed powers are known or specified, while the voltage magnitude and its phase

angle are the unknown state variables to be calculated (Arrillaga, 2001).

θ

θθ

*k k kk k m km k m km k m*

*k k km k m km k m km k m*

*P V G V V G Cos B Sin*

*Q V B V V G Cos B Cos*

= =

*m m*

*n n <sup>j</sup><sup>θ</sup> <sup>j</sup><sup>θ</sup>*

1

1

= ≠

= ≠

*n*

*m m n*

**3.2 Bus types in load flow studies** 

magnitude and phase voltage at the node *Vk* y

studies. Therefore, the system nodes can be classified as follows:

*n*

*m m n*

( ) ( )( )

 =⋅ + =⋅ + +

*k m* sin

*km k m* = − . By separating the real and imaginary parts as it is suggested in (3), it is

() ()

= + −+ − for *k*= 1,2,…..*n* (9)

() ()

=− + −− − , for *k*= 1,2,…..*n* (10)

 θθ

> θθ

*k k km km m k m km km km km*

for *k*= 1,2,…..*n* (8)

*S V e G jB V e V V G jB cos j*

\* \*

θ

*<sup>k</sup>* . The latter two variables determine the

 θ

Using the above expressions in (2), it results,

where θ  θθ

obtained the following,

generators. Therefore this node compensates the unbalance between the active power between loads and generating units as specified in the PQ and PV nodes (Arrillaga, 2001).

#### **3.3 Solution of the nonlinear equations by the Newton-Rhapson method**

The nature of the load flow problem formulation requires the simultaneous solution of a set of nonlinear equations; therefore it is necessary to apply a numerical method that guarantees a unique solution. There are methods as the Gauss-Seidel and Newton-Rhapson, in the work presented here, the load flow problem is solved with the Newton-Raphson (NR) (Arrillga, 2001).

The NR method is robust and has a fast convergence to the solution. The method has been applied to the solution of nonlinear equations that can be defined as,

$$\mathbf{f}(\mathbf{x}) = \mathbf{0} \tag{11}$$

where **fx** ( ) is a *n*×1 vector that contains the *n* equations to be solved ( ) 0 *<sup>i</sup> f* **x** = , *i=1,n*,

$$\mathbf{f}(\mathbf{x}) = \begin{bmatrix} f\_1(\mathbf{x}), f\_2(\mathbf{x}), \dots, f\_n(\mathbf{x}) \end{bmatrix}^T \tag{12}$$

and **x** is a *n*×1 vector that contains the state variables, *<sup>i</sup> x* , *i=1,n*,

$$\mathbf{x} = \begin{bmatrix} \mathbf{x}\_{1}, \mathbf{x}\_{2}, \dots, \mathbf{x}\_{n} \end{bmatrix}^{\mathrm{T}} \tag{13}$$

The numerical methods used to solve (11) are focused to determine a recursive formula *k k* <sup>+</sup><sup>1</sup> **x xx** = +Δ . The solution algorithm is based in the iterative application of the above formula starting from an initial estimate <sup>0</sup> **x** , until a convergence criterion is achieved max( ) *<sup>k</sup>* Δ < **x** ε , where ε is a small numerical value, and the vector *<sup>k</sup>* **x** is an approximation to the solution <sup>∗</sup> **x** of (11).

The Newton-Raphson method can be easily explained when it is applied to an equation of a single state variable (Arrillaga, 2001). A geometrical illustration of this problem is shown in figure 2.

Fig. 2. Geometric interpretation of the NR algorithm.

From figure 2, it can be established that *kk k* <sup>1</sup> *xx x* <sup>+</sup> Δ= −

$$d\frac{f(\mathbf{x})}{d\mathbf{x}}\bigg|\_{\mathbf{x}^k} = -\frac{f(\mathbf{x})}{\Delta \mathbf{x}^k} \tag{14}$$

PV Curves for Steady-State Security Assessment with MATLAB 275

The 2*n* equations to be solved are represented by (4) and (5). However, for all generator nodes, equation (5) can be omitted and for the slack node the equations (4) and (5) (Arrillaga, 2001). The resulting set of equations is consistent because for the neglected equations, its corresponding state variables *esp P* , *esp Q* are also omitted from them. All this operation gives as a result a set of equations to solve, where its state variables **x** only contain magnitudes of nodal voltages and its corresponding phase angles which are denoted by **V** y **θ**, which simplifies considerably a guaranteed convergence of the numerical

( ) ( )

where Δ**P x**( ) represents the equation (4) for PV and PQ nodes, Δ**Q x**( ) represents the equation (5) for PQ nodes and **x** denotes the state variables **V** and **θ**, which are represented

> = **θ**

Considering equation (16), its matrix equation is obtained and it defines the solution of the

<sup>−</sup> ∂Δ ∂Δ

**P P θ θ V P V QQ Q <sup>θ</sup> <sup>V</sup>**

1

( )

ε

**θ** (22)

**θ θ** (23)

Δ Δ ∂ ∂ = − Δ ∂Δ ∂Δ Δ **<sup>x</sup>** ∂ ∂ **f x**

( ) *k k k*

or until the iteration number exceeds the maximum number previously defined

**J x**

By applying the recursive equation (18), the state variables (**V** y **θ**) are updated every

∂Δ ∂ **P**

They are calculated using (19), however, by taking into account that the specified powers

∂Δ ∂ = − ∂ ∂ **P P**

iteration until the convergence criterion is achieved max( ( ) ) Δ ≤ **P x**

which in this indicates convergence problems.

The Jacobian elements in (21) are,

*esp Pk* are constants, we obtain,

**x**

( ) <sup>Δ</sup> = = <sup>Δ</sup> **P x f x 0**

**Q x** (19)

**V** (20)

(21)

or max( ( ) ) Δ ≤ **Q x**

εfor

method. Therefore, the set of equation can be represented in vector form as,

in vector notation as:

**V** = *nc*x1 vector. **θ** = *nc*+*n*-1 vector. *nc* = Number of PQ nodes. *n* = Total number of nodes.

load flow problem:

where:

a small

ε

where,

$$
\Delta \mathbf{x}^k = -\left(f'(\mathbf{x}\_k)\right)^{-1} \cdot f(\mathbf{x}\_k) \tag{15}
$$

As it can be seen in figure 2, the successive application of this correction 1 2 , , ... *kk k xx x* + + ΔΔ Δ leads to the solution <sup>∗</sup> **x** as nearer as desired.

To derive the recursive formula to be employed in the solution of the set of equations, and by expressing the equation (15) in matrix notation, it is obtained,

$$
\Delta \mathbf{x}^k = -\left(\mathbf{f}'(\mathbf{x}\_k)\right)^{-1} \cdot \mathbf{f}(\mathbf{x}\_k) = -\left[\mathbf{J}(\mathbf{x}\_k)\right]^{-1} \cdot \mathbf{f}(\mathbf{x}\_k) \tag{16}
$$

where

$$\mathbf{J(x\_{k})} = \frac{\partial \mathbf{f(x\_{k})}}{\partial \mathbf{x}} = \begin{vmatrix} \frac{\partial f\_{1}(\mathbf{x})}{\partial x\_{1}} & \frac{\partial f\_{1}(\mathbf{x})}{\partial x\_{2}} & \cdots & \frac{\partial f\_{1}(\mathbf{x})}{\partial x\_{n}} \\ \frac{\partial f\_{2}(\mathbf{x})}{\partial x\_{1}} & \frac{\partial f\_{2}(\mathbf{x})}{\partial x\_{2}} & \cdots & \frac{\partial f\_{2}(\mathbf{x})}{\partial x\_{n}} \\ \vdots & \vdots & \cdots & \vdots \\ \frac{\partial f\_{n}(\mathbf{x})}{\partial x\_{1}} & \frac{\partial f\_{n}(\mathbf{x})}{\partial x\_{2}} & \cdots & \frac{\partial f\_{n}(\mathbf{x})}{\partial x\_{n}} \end{vmatrix} \tag{17}$$

and the recursive formula is given by,

$$\mathbf{x}^{k+1} = \mathbf{x}^k + \Delta \mathbf{x} \tag{18}$$

#### **3.4 Application of the NR to the power flow problem**

The equations to be solved in the load flow problem, as it was explained in section 3.1, are here rewritten,

$$P\_k^{\text{esp}} - \left[ V\_k^2 G\_{kk} + V\_k \sum\_{\substack{m=1 \\ m \neq n}}^n V\_m \left( G\_{km} \text{Cov}(\theta\_k - \theta\_m) + B\_{km} \text{Sim}(\theta\_k - \theta\_m) \right) \right] = 0 \tag{4}$$

$$\left[Q\_k^{\text{op}} - \left[V\_k^2 B\_{km} + V\_k \sum\_{\substack{m=1\\m\neq n}}^n V\_m \left(G\_{km} \text{Cov}(\theta\_k - \theta\_m) - B\_{km} \text{Cov}(\theta\_k - \theta\_m)\right)\right] = 0\tag{5}$$

for *k*= 1,2,…..*n*

The 2*n* equations to be solved are represented by (4) and (5). However, for all generator nodes, equation (5) can be omitted and for the slack node the equations (4) and (5) (Arrillaga, 2001). The resulting set of equations is consistent because for the neglected equations, its corresponding state variables *esp P* , *esp Q* are also omitted from them. All this operation gives as a result a set of equations to solve, where its state variables **x** only contain magnitudes of nodal voltages and its corresponding phase angles which are denoted by **V** y **θ**, which simplifies considerably a guaranteed convergence of the numerical method. Therefore, the set of equation can be represented in vector form as,

$$\mathbf{f}\left(\mathbf{x}\right) = \begin{bmatrix} \Delta \mathbf{P}(\mathbf{x}) \\ \Delta \mathbf{Q}(\mathbf{x}) \end{bmatrix} = \mathbf{0} \tag{19}$$

where Δ**P x**( ) represents the equation (4) for PV and PQ nodes, Δ**Q x**( ) represents the equation (5) for PQ nodes and **x** denotes the state variables **V** and **θ**, which are represented in vector notation as:

$$\mathbf{x} = \begin{bmatrix} \mathbf{e} \\ \mathbf{V} \end{bmatrix} \tag{20}$$

where:

274 MATLAB for Engineers – Applications in Control, Electrical Engineering, IT and Robotics

() () *<sup>k</sup> <sup>k</sup> <sup>x</sup> <sup>f</sup> <sup>x</sup> <sup>f</sup> <sup>x</sup> <sup>d</sup>*

( ) <sup>1</sup> '( ) ( ) *<sup>k</sup>*

As it can be seen in figure 2, the successive application of this correction 1 2 , , ... *kk k xx x* + + ΔΔ Δ

To derive the recursive formula to be employed in the solution of the set of equations, and

( ) [ ] 1 1 '( ) ( ) ( ) ( ) *<sup>k</sup> kk kk*

1 2

1 2

<sup>∂</sup> = = ∂∂ ∂ <sup>∂</sup> ∂∂ ∂ ∂∂ ∂

() () () ( ) ( )

*k n*

The equations to be solved in the load flow problem, as it was explained in section 3.1, are

( ) <sup>2</sup>

( ) <sup>2</sup>

 −− + −− − = 

θθ

 − + −+ − = 

θθ

*k k kk k m km k m km k m*

*k k km k m km k m km k m*

*P V G V V G Cos B Sin*

*Q V B V V G Cos B Cos*

1 2

11 1

∂∂ ∂ ∂∂ ∂ ∂∂ ∂

*ff f xx x ff f xx x*

() () ()

**xx x**

**xx x**

() () ()

**xx x**

22 2

*nn n*

*ff f xx x*

*dx <sup>x</sup>* = − <sup>Δ</sup> (14)

*k k x f x fx* <sup>−</sup> Δ =− ⋅ (15)

*n*

(17)

*n*

*k k* <sup>+</sup><sup>1</sup> **x xx** = +Δ (18)

( ) ( )0

 θθ

(4)

( ) ( )0

(5)

 θθ

− − Δ =− ⋅ =− ⋅ **x f x fx Jx fx** (16)

From figure 2, it can be established that *kk k* <sup>1</sup> *xx x* <sup>+</sup> Δ= −

leads to the solution <sup>∗</sup> **x** as nearer as desired.

and the recursive formula is given by,

by expressing the equation (15) in matrix notation, it is obtained,

*k*

**x**

1

1

= ≠

*m m n*

= ≠

*m m n*

**f x J x**

**3.4 Application of the NR to the power flow problem** 

*<sup>n</sup> esp*

*<sup>n</sup> esp*

where,

where

here rewritten,

for *k*= 1,2,…..*n*

**V** = *nc*x1 vector. **θ** = *nc*+*n*-1 vector. *nc* = Number of PQ nodes.

*n* = Total number of nodes.

Considering equation (16), its matrix equation is obtained and it defines the solution of the load flow problem:

$$
\begin{bmatrix}
\Delta\boldsymbol{\Phi} \\
\underline{\boldsymbol{\Delta}}\boldsymbol{\nabla}
\end{bmatrix} = -\underbrace{\begin{bmatrix}
\frac{\partial\boldsymbol{\Delta}\mathbf{P}}{\partial\boldsymbol{\Theta}} & \frac{\partial\boldsymbol{\Delta}\mathbf{P}}{\partial\boldsymbol{\Delta}} \\
\frac{\partial\boldsymbol{\Delta}\mathbf{Q}}{\partial\boldsymbol{\Theta}} & \frac{\partial\boldsymbol{\Delta}\mathbf{Q}}{\partial\boldsymbol{\Delta}}
\end{bmatrix}}\_{\mathbf{J}(\mathbf{x}^{i})}^{-1} \underbrace{\begin{bmatrix}
\Delta\mathbf{P} \\
\underline{\boldsymbol{\Delta}}\mathbf{Q}
\end{bmatrix}}\_{\mathbf{f}(\mathbf{x}^{k})}\tag{21}
$$

By applying the recursive equation (18), the state variables (**V** y **θ**) are updated every iteration until the convergence criterion is achieved max( ( ) ) Δ ≤ **P x** ε or max( ( ) ) Δ ≤ **Q x** ε for a small ε or until the iteration number exceeds the maximum number previously defined which in this indicates convergence problems.

The Jacobian elements in (21) are,

$$\frac{\partial \Delta \mathbf{P}}{\partial \mathbf{\hat{q}}} \tag{22}$$

They are calculated using (19), however, by taking into account that the specified powers *esp Pk* are constants, we obtain,

$$\frac{\partial \Delta \mathbf{P}}{\partial \mathbf{\Theta}} = -\frac{\partial \mathbf{P}}{\partial \mathbf{\Theta}}\tag{23}$$

Therefore, equation (21) can be expressed as,

$$
\begin{bmatrix}
\Delta \mathbf{P} \\
\Delta \mathbf{Q}
\end{bmatrix} = \begin{bmatrix}
\frac{\partial \mathbf{P}}{\partial \boldsymbol{\theta}} & \frac{\partial \mathbf{P}}{\partial \mathbf{V}} \\
\frac{\partial \mathbf{Q}}{\partial \boldsymbol{\theta}} & \frac{\partial \mathbf{Q}}{\partial \mathbf{V}}
\end{bmatrix} \cdot \begin{array}{l}
\Delta \mathbf{\theta} \\
\Delta \mathbf{V}
\end{array} \tag{24}
$$

PV Curves for Steady-State Security Assessment with MATLAB 277

It is important to consider that subscripts *k* and *m* are different, *L H km km* = and *J N km km* = − , on the contrary, to the principal diagonal elements. Nevertheless, there is a relationship

> 0 0 0 0 0 0 0 0

> 

*n n*

*n nn nn n*

*V YY Y V*

1 11 12 1 1

*V YY YV*

1 21 22 2 1

By simple inspection of (34), we can see that the operation for −*Nkm* and *Jkm* results to be the real part of (34), while *Hkm* and *Lkm* are the imaginary component of it. The variant consists that all elements of the principal diagonal are calculated after (34) has been solved

The Jacobian matrix has the characteristic of being sparse and squared with an order of the

The terms of voltage stability and collapse are closely related to each other in topics of

According to the IEEE, the voltage stability is defined as the capacity of a power system to maintain in all nodes acceptable voltage levels under normal conditions after a system disturbance for a given initial condition (Kundur, 1994). This definition gives us an idea of the robustness of a power system which is measured by its capability of keep the equilibrium between the demanded load and the generated power. The system can be in an unstable condition under a disturbance, increase of demanded load and changes in the topology of the network, causing an incontrollable voltage decrement (Kundur, 1994). The unstable condition can be originated for the operating limits of the power system

*Generators*: They represent the supply of reactive power enough to keep the power system in stable conditions by keeping the standardized voltage levels of normal operation. However, the generation of machines is limited by its capability curve that gives the constraints of the

*Transmission lines*: They are another important constraint to the voltage stability, and they also limit the maximum power that be transported and it is defined the thermal limits. *Loads*: They represent the third elements that have influence on the stability voltage; they are classified in two categories: static and dynamic loads and they have an effect on the voltage

*V YY Y V*

1 1

0 0 0 0

by subtracting or adding the corresponding *Pk* or *Qk* as it can be seen in (30)-(33).

length of vector **X**, where its sub-matrixes have the following dimensions:

\*

(34)

when the following equation is solved:

**4. Voltage stability and collapse** 

operation and control of power systems.

components (Venkataramana, 2007), such as:

profiles under excessive reactive power generation.

reactive power output due to the field winding current limitation.

**H**: *n*-1 x *n*-1 matrix. **N**: *n*-1 x *nc* matrix. **J**: *nc* x *n*-1 matrix. **L**: *nc* x *nc* matrix.

**4.1 Voltage stability** 

where the Jacobian elements are calculated using equations (9) and (10), provided equation (21) is normalized.

To simplify the calculation of the Jacobian elements of (24), it can be reformulated as:

$$
\begin{bmatrix}
\Delta \mathbf{P} \\
\Delta \mathbf{Q}
\end{bmatrix} = \begin{bmatrix}
\mathbf{H} & \mathbf{N} \\
\mathbf{J} & \mathbf{L}
\end{bmatrix} \begin{bmatrix}
\Delta \mathbf{\dot{\theta}} \\
\Delta \mathbf{\dot{\mathbf{V}}} \\
\mathbf{V}
\end{bmatrix} \tag{25}
$$

where the quotient of each element with its corresponding element *V* allows that some elements of the Jacobian matrix can be expressed similarly (Arrillaga, 2001). The Jacobian can be formed by defining four submatrixes denoted as **H**, **N**, **J** and **L** which are defined as, If *k≠m* (off diagonal elements):

$$H\_{km} = \frac{\partial P\_k}{\partial \theta\_m} = V\_k V\_m \left( G\_{km} \sin \theta\_{km} - B\_{km} \cos \theta\_{km} \right) \tag{26}$$

$$N\_{km} = V\_k \frac{\partial P\_k}{\partial V\_m} = V\_k V\_m \left( G\_{km} \cos \theta\_{km} + B\_{km} \sin \theta\_{km} \right) \tag{27}$$

$$J\_{km} = \frac{\partial Q\_k}{\partial \theta\_m} = -V\_k V\_m \left( G\_{km} \cos \theta\_{km} + B\_{km} \sin \theta\_{km} \right) \tag{28}$$

$$L\_{km} = V\_k \frac{\partial P\_k}{\partial V\_m} = V\_k V\_m \left( G\_{km} \sin \theta\_{km} - B\_{km} \cos \theta\_{km} \right) \tag{29}$$

If *k=m* (main diagonal elements):

$$H\_{kk} = \frac{\partial P\_k}{\partial \theta\_k} = -Q\_k - B\_{kk}V\_k^2 \tag{30}$$

$$N\_{kk} = V\_k \frac{\partial P\_k}{\partial V\_k} = P\_k + G\_{kk} V\_k^2 \tag{31}$$

$$J\_{kk} = \frac{\partial \mathbb{Q}\_k}{\partial \theta\_m} = P\_k - \mathbb{G}\_{kk} V\_k^2 \tag{32}$$

$$L\_{kk} = V\_k \frac{\partial P\_k}{\partial V\_m} = Q\_k - B\_{kk} V\_k^2 \tag{33}$$

It is important to consider that subscripts *k* and *m* are different, *L H km km* = and *J N km km* = − , on the contrary, to the principal diagonal elements. Nevertheless, there is a relationship when the following equation is solved:

$$
\begin{bmatrix}
V\_1 & 0 & \cdots & 0 \\
0 & V\_1 & \cdots & 0 \\
\vdots & \vdots & \ddots & \vdots \\
0 & 0 & \cdots & V\_n
\end{bmatrix}
\begin{bmatrix}
Y\_{11} & Y\_{12} & \cdots & Y\_{1n} \\
Y\_{21} & Y\_{22} & \cdots & Y\_{2n} \\
\vdots & \vdots & \cdots & \vdots \\
Y\_{n1} & Y\_{n1} & \cdots & Y\_{nn}
\end{bmatrix}
\begin{bmatrix}
V\_1 & 0 & \cdots & 0 \\
0 & V\_1 & \cdots & 0 \\
\vdots & \vdots & \ddots & \vdots \\
0 & 0 & \cdots & V\_n
\end{bmatrix}
\tag{34}
$$

By simple inspection of (34), we can see that the operation for −*Nkm* and *Jkm* results to be the real part of (34), while *Hkm* and *Lkm* are the imaginary component of it. The variant consists that all elements of the principal diagonal are calculated after (34) has been solved by subtracting or adding the corresponding *Pk* or *Qk* as it can be seen in (30)-(33).

The Jacobian matrix has the characteristic of being sparse and squared with an order of the length of vector **X**, where its sub-matrixes have the following dimensions:

**H**: *n*-1 x *n*-1 matrix.

276 MATLAB for Engineers – Applications in Control, Electrical Engineering, IT and Robotics

 ∂ ∂ Δ Δ ∂ ∂ = ⋅ Δ ∂∂Δ ∂ ∂

where the Jacobian elements are calculated using equations (9) and (10), provided equation

 <sup>Δ</sup> <sup>Δ</sup> <sup>=</sup> <sup>Δ</sup> <sup>Δ</sup> **<sup>θ</sup> P HN <sup>V</sup> Q JL <sup>V</sup>**

where the quotient of each element with its corresponding element *V* allows that some elements of the Jacobian matrix can be expressed similarly (Arrillaga, 2001). The Jacobian can be formed by defining four submatrixes denoted as **H**, **N**, **J** and **L** which are defined as,

*km k k m km km km km*

*km k k m km km km km*

<sup>∂</sup>

( ) sin cos *<sup>k</sup> km k m km km km km*

θ

( ) cos sin *<sup>k</sup>*

( ) cos sin *<sup>k</sup> km k m km km km km*

θ

( ) sin cos *<sup>k</sup>*

*k* 2 *kk k kk k k <sup>P</sup> H Q BV* θ

*k* 2

*k* 2 *kk k kk k m <sup>Q</sup> J P GV* θ

*k* 2

*kk k k kk k k <sup>P</sup> N V P GV V* ∂ = =+

*kk k k kk k m <sup>P</sup> L V Q BV <sup>V</sup>*

θ

θ

 θ

> θ

∂ (27)

 θ

 θ<sup>∂</sup> == − ∂ (29)

<sup>∂</sup> = =− − <sup>∂</sup> (30)

<sup>∂</sup> (31)

<sup>∂</sup> = =− ∂ (32)

<sup>∂</sup> = =− ∂ (33)

∂ (28)

<sup>∂</sup> = = <sup>−</sup> <sup>∂</sup> (26)

To simplify the calculation of the Jacobian elements of (24), it can be reformulated as:

*m*

*m*

*m*

*V*

*V*

*m*

θ

θ

*<sup>P</sup> H VV G B*

*<sup>P</sup> N V VV G B*

*<sup>Q</sup> <sup>J</sup> VV G B*

*<sup>P</sup> L V VV G B*

<sup>∂</sup> = =− <sup>+</sup>

== +

**P P P θ θ V Q QQ V θ V**

(24)

(25)

Therefore, equation (21) can be expressed as,

(21) is normalized.

If *k≠m* (off diagonal elements):

If *k=m* (main diagonal elements):

**N**: *n*-1 x *nc* matrix.

**J**: *nc* x *n*-1 matrix. **L**: *nc* x *nc* matrix.

#### **4. Voltage stability and collapse**

The terms of voltage stability and collapse are closely related to each other in topics of operation and control of power systems.

#### **4.1 Voltage stability**

According to the IEEE, the voltage stability is defined as the capacity of a power system to maintain in all nodes acceptable voltage levels under normal conditions after a system disturbance for a given initial condition (Kundur, 1994). This definition gives us an idea of the robustness of a power system which is measured by its capability of keep the equilibrium between the demanded load and the generated power. The system can be in an unstable condition under a disturbance, increase of demanded load and changes in the topology of the network, causing an incontrollable voltage decrement (Kundur, 1994). The unstable condition can be originated for the operating limits of the power system components (Venkataramana, 2007), such as:

*Generators*: They represent the supply of reactive power enough to keep the power system in stable conditions by keeping the standardized voltage levels of normal operation. However, the generation of machines is limited by its capability curve that gives the constraints of the reactive power output due to the field winding current limitation.

*Transmission lines*: They are another important constraint to the voltage stability, and they also limit the maximum power that be transported and it is defined the thermal limits.

*Loads*: They represent the third elements that have influence on the stability voltage; they are classified in two categories: static and dynamic loads and they have an effect on the voltage profiles under excessive reactive power generation.

PV Curves for Steady-State Security Assessment with MATLAB 279

stability voltage limits. However, the Jacobian used in the load flows, when the Newton-Raphson is employed, becomes singular at the critical point, besides the load flow solutions at the points near to the critical region tend to diverge (Kundur, 1994). These disadvantages are avoided by using the method of continuation load flows (Venkataramana et al, 1992).

**4.5 Application of the continuation method to the power flow problem** 

The continuous load flow procedure is based in a reformulation of the equations of the load flow problem and the application of the continuation technique with a local parameterization which has shown to be efficient in the trajectory plotting of PV curves. The purpose of continuous load flows is to find a set of load flow solutions in a scenario where the load is continuously changing, starting from a base case until the critical point. Thereafter, the continuous load flows had been applied to understand and evaluate the problem of voltage stability and those areas that are likely to the voltage collapse. Besides, they have also been applied in other related problems like the evaluation of power transfer

The general principle of continuous load flows employs a predictor-corrector scheme to find a trajectory of solutions for the set of load flow equations (4) and (5) which are reformulated

( ) <sup>0</sup> *esp Pi Gi Li i <sup>i</sup> <sup>i</sup>* Δ= − − = − = *<sup>λ</sup> PP P <sup>λ</sup>P P* (35)

( ) <sup>0</sup> *esp Qi Gi Li i <sup>i</sup> <sup>i</sup>* Δ= − − = − = *<sup>λ</sup> QQ Q <sup>λ</sup>Q Q* (36)

1 *crític* ≤ ≤ *λ λ* (37)

Fig. 3. PV curve

limits between regions.

to include the load parameter λ.

#### **4.2 Voltage collapse**

The voltage collapse is a phenomenon that might be present in a highly loaded electric power system. This can be present in the form of event sequence together with the voltage instability that may lead to a blackout or to voltage levels below the operating limits for a significant part of the power system (Kundur, 1994). Due to the nonlinear nature of the electrical network, as the phenomenon related to the power system, it is necessary to employ nonlinear techniques for the analysis of the voltage collapse (Venkataramana, 2007) and find out a solution to avoid it.

There many disturbances which contribute to the voltage collapse:


Most of these changes have a significant effect in the production, consumption and transmission of reactive power. Because of this, it is suggested control actions by using compensator elements as capacitor banks, blocking of tap changers, new generation dispatch, secondary voltage regulation and load sectioning (Kundur, 1994).

#### **4.3 Analysis methods for the voltage stability**

Some of the tools used for the analysis of stability voltage are the methods based on dynamic analysis and those based in static analysis.

*Dynamic Analysis*. They consist in the numerical solution (simulation) of the set of differential and algebraic equations that model the power system (Kundur, 1994), this is similar as transients; however, this kind of simulations need considerable amount of computing resources and hence the solution time is large and they do not give information about the sensibility and stability degree.

*Static analysis*. They consist in the solution of the set of algebraic equations that represent the system in steady state (Kundur, 1994), with the aim of evaluating the feasibility of the equilibrium point represented by the operating conditions of the system and to find the critical voltage value. The advantage with respect to the dynamic analysis techniques is that it gives valuable information about the nature of the problem and helps to identify the key factors for the instability problem. The plotting of the PV curve helps to the analysis of the voltage stability limits of a power system under a scenario with load increments and with the presence of a disturbance such as the loss of generation or the loss of a transmission line.

#### **4.4 PV curves**

The PV curves represent the voltage variation with respect to the variation of load reactive power. This curve is produced by a series of load flow solutions for different load levels uniformly distributed, by keeping constant the power factor. The generated active power is proportionally incremented to the generator rating or to the participating factors which are defined by the user. The P and Q components of each load can or cannot be dependant of the bus voltage accordingly to the load model selected. The determination of the critical point for a given load increment is very important because it can lead to the voltage collapse of the system. These characteristics are illustrated in figure 3.

Some authors (Yamura et al, 1998 & Ogrady et al, 1999) have proposed voltage stability indexes which are based in some kind of analysis of load flows with the aim to evaluate the stability voltage limits. However, the Jacobian used in the load flows, when the Newton-Raphson is employed, becomes singular at the critical point, besides the load flow solutions at the points near to the critical region tend to diverge (Kundur, 1994). These disadvantages are avoided by using the method of continuation load flows (Venkataramana et al, 1992).

Fig. 3. PV curve

278 MATLAB for Engineers – Applications in Control, Electrical Engineering, IT and Robotics

The voltage collapse is a phenomenon that might be present in a highly loaded electric power system. This can be present in the form of event sequence together with the voltage instability that may lead to a blackout or to voltage levels below the operating limits for a significant part of the power system (Kundur, 1994). Due to the nonlinear nature of the electrical network, as the phenomenon related to the power system, it is necessary to employ nonlinear techniques for the analysis of the voltage collapse (Venkataramana, 2007)

• To reach the reactive power limits in generators, synchronous condensers or SVC.

Most of these changes have a significant effect in the production, consumption and transmission of reactive power. Because of this, it is suggested control actions by using compensator elements as capacitor banks, blocking of tap changers, new generation

Some of the tools used for the analysis of stability voltage are the methods based on

*Dynamic Analysis*. They consist in the numerical solution (simulation) of the set of differential and algebraic equations that model the power system (Kundur, 1994), this is similar as transients; however, this kind of simulations need considerable amount of computing resources and hence the solution time is large and they do not give information

*Static analysis*. They consist in the solution of the set of algebraic equations that represent the system in steady state (Kundur, 1994), with the aim of evaluating the feasibility of the equilibrium point represented by the operating conditions of the system and to find the critical voltage value. The advantage with respect to the dynamic analysis techniques is that it gives valuable information about the nature of the problem and helps to identify the key factors for the instability problem. The plotting of the PV curve helps to the analysis of the voltage stability limits of a power system under a scenario with load increments and with the presence of a disturbance such as the loss of generation or the loss of a transmission line.

The PV curves represent the voltage variation with respect to the variation of load reactive power. This curve is produced by a series of load flow solutions for different load levels uniformly distributed, by keeping constant the power factor. The generated active power is proportionally incremented to the generator rating or to the participating factors which are defined by the user. The P and Q components of each load can or cannot be dependant of the bus voltage accordingly to the load model selected. The determination of the critical point for a given load increment is very important because it can lead to the voltage collapse

Some authors (Yamura et al, 1998 & Ogrady et al, 1999) have proposed voltage stability indexes which are based in some kind of analysis of load flows with the aim to evaluate the

**4.2 Voltage collapse** 

• Load increment.

**4.4 PV curves** 

and find out a solution to avoid it.

There many disturbances which contribute to the voltage collapse:

• The tripping of transmission lines, transformers and generators.

dispatch, secondary voltage regulation and load sectioning (Kundur, 1994).

• The operation of TAP changers in transformers.

**4.3 Analysis methods for the voltage stability** 

about the sensibility and stability degree.

dynamic analysis and those based in static analysis.

of the system. These characteristics are illustrated in figure 3.

#### **4.5 Application of the continuation method to the power flow problem**

The continuous load flow procedure is based in a reformulation of the equations of the load flow problem and the application of the continuation technique with a local parameterization which has shown to be efficient in the trajectory plotting of PV curves.

The purpose of continuous load flows is to find a set of load flow solutions in a scenario where the load is continuously changing, starting from a base case until the critical point. Thereafter, the continuous load flows had been applied to understand and evaluate the problem of voltage stability and those areas that are likely to the voltage collapse. Besides, they have also been applied in other related problems like the evaluation of power transfer limits between regions.

The general principle of continuous load flows employs a predictor-corrector scheme to find a trajectory of solutions for the set of load flow equations (4) and (5) which are reformulated to include the load parameter λ.

$$
\Delta P\_i = \lambda \left( P\_{Gi} - P\_{Li} \right) - P\_i = \lambda P\_i^{csp} - P\_i = 0 \tag{35}
$$

$$
\Delta Q\_i = \lambda \left( Q\_{Gi} - Q\_{Li} \right) - Q\_i = \lambda Q\_i^{csp} - Q\_i = 0 \tag{36}
$$

$$1 \le \lambda \le \lambda\_{critical} \tag{37}$$

The process is started from a known solution and a predictor vector which is tangent to the corrected solutions is used to estimate the future solutions with different values of the load parameter. The estimation is corrected using the same technique of the Newton-Rhapson employed in the conventional load flow with a new added parameter:

$$\mathbf{f}(\boldsymbol{\theta}, \mathbf{V}, \lambda) = \mathbf{0} \tag{38}$$

PV Curves for Steady-State Security Assessment with MATLAB 281

*esp esp*

<sup>−</sup> <sup>−</sup> ⋅ = <sup>±</sup>

where **e**k is a vector of dimension m+1 with all elements equal to zero but the *k*-th one, which is equal to 1. If the index *k* is correctly selected, tk = ±1 impose a none zero norm to the tangent vector and it guarantees that the augmented Jacobian will be nonsingular at the critical point (Eheinboldt et al, 1986). The usage of +1 or -1 depends on how the *k*-th state variable is changing during the trajectory solution which is being plotted. In a next section of this chapter, a method to select *k* will be presented. Once the tangent vector has found the

*λ λ d*

where "\*" denotes the prediction for a future value of λ (the load parameter) and σ is a scalar that defines the step size. One inconvenient in the control of the step size consists in

> σ 0 σ

where |tk| is the Euclidian norm of the tangent vector and σ0 is a predefined scalar. The process efficiency depends on making a good selection of σ0, which its value is system

After the prediction has been made, it is necessary to correct the approximate solution. Every continuation technique has a particular parameterization that gives a way to identify the solution along the plotting trajectory. The scheme here presented is referred as a local parameterization. In this scheme, the original set of equations is augmented with one extra equation, which has a meaning of specifying the value of a single state variable. In the case of the reformulated equations, this has a meaning of giving a unity magnitude to each nodal voltage, the phase angle of the nodal voltage or the load parameter *λ.* The new set of

λ

 = **x V** θ

> *<sup>k</sup> x* =η

 = + **VV V** θ θ θ

∗ ∗ ∗

its dependence of the normalized tangent vector (Alves et al, 2000),

*k*

**J L Q t e**

**HN P**

solution of (43), the prediction is carried out as follows:

dependant.

where,

**4.5.2 Parameterization and corrector** 

equations involves the new definition of state variables as:

1

*d d*

λ

σ

(43)

(44)

<sup>=</sup> **<sup>t</sup>** (45)

(46)

(47)

**0**

The parameterization plays an important role in the elimination of the Jacobian nonsingularity.

#### **4.5.1 Prediction of the new solution**

Once the base solution has been found for λ=0, it is required to predict the next solution taking into consideration the appropriate step size and the direction of the tangent to the trajectory solution. The first task in this process consists in calculating the tangent vector, which is determined taking the first derivative of the reformulated flow equations (38).

$$d\mathbf{f}(\boldsymbol{\theta}, \mathbf{V}, \boldsymbol{\lambda}) = \mathbf{f}\_{\boldsymbol{\theta}} d\boldsymbol{\theta} + \mathbf{f}\_{V} d\mathbf{V} + \mathbf{f}\_{\boldsymbol{\lambda}} d\boldsymbol{\lambda} = 0 \tag{39}$$

where **F** is the vector [**ΔP**, **ΔQ**, 0] that is augmented in one row; in a factorized form, the equation is expressed as,

$$
\begin{bmatrix}
\mathbf{f\_{\Theta}} & \mathbf{f\_{F}} & \mathbf{f\_{\lambda}}
\end{bmatrix}
\begin{bmatrix}
d\mathbf{\Theta} \\
d\mathbf{V} \\
d\lambda
\end{bmatrix} = \mathbf{0} \tag{40}
$$

The left hand side of the equation is a matrix of partial derivatives that multiplies the tangent vector form with differential elements. The matrix of partial derivatives is known as the Jacobian of the conventional load flow problem that is augmented by the column **F**λ, which can be obtained by taking the partial derivatives with respect to λ (35) and (36), which gives:

$$
\begin{bmatrix}
\Delta P\\\Delta Q
\end{bmatrix} = \begin{bmatrix}
\mathbf{H} & \mathbf{N} & -\mathbf{P}^{esp} \\
\mathbf{J} & \mathbf{L} & -\mathbf{Q}^{esp}
\end{bmatrix} \begin{bmatrix}
d\mathbf{\bar{V}}\\d\mathbf{\bar{V}}\\d\boldsymbol{\lambda}
\end{bmatrix} \tag{41}
$$

Due to the nature of (41) which is a set of *nc*+*n*-1 equations with *nc*+*n* unknowns and by adding *λ* to the load flow equations, it is not possible to find a unique and nontrivial solution of the tangent vector; consequently an additional equation is needed.

This problem is solved by selecting a magnitude different from zero for one of the components of the tangent vector. In other words, if the tangent vector is denoted by:

$$\mathbf{t} = \begin{bmatrix} d\boldsymbol{\Theta} \\ d\mathbf{V} \\ d\boldsymbol{\lambda} \end{bmatrix} = \mathbf{0}, \quad t\_k = \pm \mathbf{1} \tag{42}$$

which leads to:

The process is started from a known solution and a predictor vector which is tangent to the corrected solutions is used to estimate the future solutions with different values of the load parameter. The estimation is corrected using the same technique of the Newton-Rhapson

The parameterization plays an important role in the elimination of the Jacobian non-

Once the base solution has been found for λ=0, it is required to predict the next solution taking into consideration the appropriate step size and the direction of the tangent to the trajectory solution. The first task in this process consists in calculating the tangent vector, which is determined taking the first derivative of the reformulated flow equations (38).

(, , ) 0 *<sup>V</sup> d dd d*

where **F** is the vector [**ΔP**, **ΔQ**, 0] that is augmented in one row; in a factorized form, the

[ ] 0

**<sup>F</sup> fff V** <sup>θ</sup>

λ

The left hand side of the equation is a matrix of partial derivatives that multiplies the tangent vector form with differential elements. The matrix of partial derivatives is known as the Jacobian of the conventional load flow problem that is augmented by the column **F**λ, which can be obtained by taking the partial derivatives with respect to λ (35) and (36), which

*P d*

 Δ − <sup>=</sup> <sup>Δ</sup> <sup>−</sup>

Due to the nature of (41) which is a set of *nc*+*n*-1 equations with *nc*+*n* unknowns and by adding *λ* to the load flow equations, it is not possible to find a unique and nontrivial

This problem is solved by selecting a magnitude different from zero for one of the components of the tangent vector. In other words, if the tangent vector is denoted by:

*d t*

= = =±

0, 1 *<sup>k</sup>*

*Q*

solution of the tangent vector; consequently an additional equation is needed.

*d*

*dλ*

 **t V** θ

θ

=+ + =

*d d dλ*

 <sup>=</sup> 

θ

*esp esp*

**HN P V**

*d*

**θ**

**JL Q <sup>V</sup>** (41)

*dλ*

 λ

**f θ V f θ fVf** (39)

(40)

(42)

 λ

λ

**f**( ) **θ**, , **V 0** *λ* = (38)

employed in the conventional load flow with a new added parameter:

singularity.

gives:

which leads to:

**4.5.1 Prediction of the new solution** 

equation is expressed as,

$$
\begin{bmatrix}
\mathbf{H} & \mathbf{N} & -\mathbf{P}^{\mathrm{esp}} \\
\mathbf{J} & \mathbf{L} & -\mathbf{Q}^{\mathrm{esp}} \\
& \mathbf{e}\_k
\end{bmatrix} \cdot \mathbf{t} = \begin{bmatrix} \mathbf{0} \\ \pm \mathbf{1} \end{bmatrix} \tag{43}
$$

where **e**k is a vector of dimension m+1 with all elements equal to zero but the *k*-th one, which is equal to 1. If the index *k* is correctly selected, tk = ±1 impose a none zero norm to the tangent vector and it guarantees that the augmented Jacobian will be nonsingular at the critical point (Eheinboldt et al, 1986). The usage of +1 or -1 depends on how the *k*-th state variable is changing during the trajectory solution which is being plotted. In a next section of this chapter, a method to select *k* will be presented. Once the tangent vector has found the solution of (43), the prediction is carried out as follows:

$$
\begin{bmatrix}
\mathbf{\dot{O}}^{\*} \\
\mathbf{V}^{\*} \\
\mathbf{\dot{V}}^{\*} \\
\lambda^{\*}
\end{bmatrix} = \begin{bmatrix}
\mathbf{\dot{O}} \\
\mathbf{V} \\
\lambda
\end{bmatrix} + \sigma \begin{bmatrix}
d\mathbf{\dot{O}} \\
d\mathbf{V} \\
d\lambda
\end{bmatrix} \tag{44}
$$

where "\*" denotes the prediction for a future value of λ (the load parameter) and σ is a scalar that defines the step size. One inconvenient in the control of the step size consists in its dependence of the normalized tangent vector (Alves et al, 2000),

$$
\sigma = \frac{\sigma\_0}{\|\mathbf{t}\|} \tag{45}
$$

where |tk| is the Euclidian norm of the tangent vector and σ0 is a predefined scalar. The process efficiency depends on making a good selection of σ0, which its value is system dependant.

#### **4.5.2 Parameterization and corrector**

After the prediction has been made, it is necessary to correct the approximate solution. Every continuation technique has a particular parameterization that gives a way to identify the solution along the plotting trajectory. The scheme here presented is referred as a local parameterization. In this scheme, the original set of equations is augmented with one extra equation, which has a meaning of specifying the value of a single state variable. In the case of the reformulated equations, this has a meaning of giving a unity magnitude to each nodal voltage, the phase angle of the nodal voltage or the load parameter *λ.* The new set of equations involves the new definition of state variables as:

$$\mathbf{x} = \begin{bmatrix} \mathbf{e} \\ \mathbf{V} \\ \mathcal{A} \end{bmatrix} \tag{46}$$

where,

$$
\boldsymbol{\alpha}\_k = \boldsymbol{\eta} \tag{47}
$$

where *<sup>k</sup> x* ε **x** and η represent the appropriate *k*-th element of **x**. Therefore, the new set of equations that substitute (38) is given by,

$$\left| \begin{array}{c} \mathbf{F}(\mathbf{x}) \\ \boldsymbol{x}\_{k} - \boldsymbol{\eta} \end{array} \right| = 0 \tag{48}$$

PV Curves for Steady-State Security Assessment with MATLAB 283

possible to point it out several advantages considered as key points for the development of a

The electrical networks are studied using nodal analysis, as it was presented in section 3.1. In this frame of reference, the network matrixes as Ybus or Jacobian (1) and (21) have a sparse structure, considering that a node in an electrical network is connected to about 2.4 nodes in average. To illustrate this issue, if we consider the creation of a squared matrix with order 20, i.e. the matrix has 200 elements which 256 are zeros and the remaining are different from zero that are denoted as nz, as it is shown in figure 4. The sparsity pattern is

The operation on this type of matrices with conventional computational methods leads to obtain prohibited calculation times (Gracia et al, 2005). Due to this reason, there have been adopted special techniques for deal with this type of matrixes to avoid the unnecessary usage of memory and to execute the calculation processes on the nonzero elements. It is important to point it out that this kind of matrixes is more related to a computation

MATLAB offers mechanisms and methods to create, manipulate and operate on this kind of matrixes. The sparse matrixes are created with the sparse function, which requires the specification of 5 arguments in the following order: 3 arrays to specify the position *i*, the position *j* – row and column- and the element values x that correspond to each position (i,j), and the two integer variables to determine the dimensions *mxn* of the matrix, for example:

In MATLAB language, the indexing of full matrixes is equal to the sparse matrixes. This mechanism consists in pointing to a set of matrix elements through the use of two arrays that makes reference to each row and column of the matrix, e.g. **B** = **A**[**I**, **J**] or by simply

where **A** is a *mxn* spare matrix, I and J are the arrays that point to the rows and columns and **X** is the array that contains each element corresponding to each ordered pair (Ik, Jk). All

pointing to each element o elements of the matrix to be modified, e.g. A[**I**, **J**] = **X.**

mentioned arrays are composed for a number of *k* elements, such as *k* < *n* and *k* < *m.*

script program, which are discussed below.

displayed by using the MATLAB function *spy*.

Fig. 4. An example of a sparse matrix.

technique than to a mathematic concept.

>> A = sparse(i, j, x, m, n)

**5.1 Sparse matrix manipulation** 

After an appropriate index *k* has been selected and its corresponding value of η , the load flow is solved with the slightly modified Newton Raphson method (48). In other words, the *k* index used in the corrector is the same as that used in the predictor and η is equal to the obtained *xk* from the corrector (44), thus the variable *xk* is the continuation parameter. The application of the Newton-Raphson to (38) results in,

$$
\begin{bmatrix}
H & N & -\mathbf{P}^{esp} \\
M & L & -\mathbf{Q}^{esp} \\
& \mathbf{e}\_k & 
\end{bmatrix}
\begin{bmatrix}
\Delta\boldsymbol{\Theta} \\
\Delta\mathbf{V} \\
\Delta\boldsymbol{\mathcal{k}} \\
\end{bmatrix} = \begin{bmatrix}
\Delta\mathbf{P} \\
\Delta\mathbf{Q} \\
\mathbf{0}
\end{bmatrix} \tag{49}
$$

where **e**k is the same vector used in (43), and the elements Δ**P** and Δ**Q** are calculated from (35) and (36). Once the *x*k is specified in (48), the values of the other variables are dependant on it and they are solved by the iterative application of (49).

#### **4.5.3 Selection of the continuation parameter**

The most appropriate selection corresponds to that state variable with the component of the tangent vector with the largest rate of change relative to the given solution. Typically, the load parameter is the best starting selection, i.e. λ=1. This is true if the starting base case is characterized for a light or normal load; in such conditions, the magnitudes of the nodal voltages and angles keep almost constants with load changes. On the other hand, when the load parameter has been increased for a given number of continuation steps, the solution trajectory is approximated to the critical point, and the voltage magnitudes and angles probably will have more significant changes. At this point, λ has had a poor selection as compared with other state variables. Then, once the first step selection has been made, the following verification must be made:

$$\text{fix}\_k \leftarrow \max \left\{ \begin{matrix} \underline{t\_1} & \underline{t\_2} \\ \underline{x\_1} & \underline{x\_2} \end{matrix} \quad \dots \quad \begin{matrix} \underline{t\_{m-1}} & \underline{t\_m} \\ \underline{x\_m} - 1 & \underline{x\_m} \end{matrix} \right\} \tag{50}$$

where *m* is equal to the state variables; including the load parameter and *k* corresponding to the maximum t/x component. When the continuation parameter is selected, the sign of the corresponding component of the tangent vector must be taken into account to assign +1 or - 1 to tk in (42) for the subsequent calculation of the tangent vector.

#### **5. MATLAB resources for electrical networks**

The reason why MATLAB is frequently chosen for the development of academic or research tools is because its huge amount of mathematical operations as those related to vectors and matrixes. In addition, it also has several specialized libraries (toolboxes) for more specific areas as control, optimization, symbolic mathematics, etc. In the area of power systems, it is possible to point it out several advantages considered as key points for the development of a script program, which are discussed below.

#### **5.1 Sparse matrix manipulation**

282 MATLAB for Engineers – Applications in Control, Electrical Engineering, IT and Robotics

( ) <sup>0</sup>

flow is solved with the slightly modified Newton Raphson method (48). In other words, the

*esp esp*

<sup>−</sup> Δ Δ <sup>−</sup> Δ =Δ <sup>Δ</sup>

where **e**k is the same vector used in (43), and the elements Δ**P** and Δ**Q** are calculated from (35) and (36). Once the *x*k is specified in (48), the values of the other variables are dependant

The most appropriate selection corresponds to that state variable with the component of the tangent vector with the largest rate of change relative to the given solution. Typically, the load parameter is the best starting selection, i.e. λ=1. This is true if the starting base case is characterized for a light or normal load; in such conditions, the magnitudes of the nodal voltages and angles keep almost constants with load changes. On the other hand, when the load parameter has been increased for a given number of continuation steps, the solution trajectory is approximated to the critical point, and the voltage magnitudes and angles probably will have more significant changes. At this point, λ has had a poor selection as compared with other state variables. Then, once the first step selection has been made, the

1 2 1

*t t t t*

*x x xm x*

*m m <sup>k</sup>*

where *m* is equal to the state variables; including the load parameter and *k* corresponding to the maximum t/x component. When the continuation parameter is selected, the sign of the corresponding component of the tangent vector must be taken into account to assign +1 or -

The reason why MATLAB is frequently chosen for the development of academic or research tools is because its huge amount of mathematical operations as those related to vectors and matrixes. In addition, it also has several specialized libraries (toolboxes) for more specific areas as control, optimization, symbolic mathematics, etc. In the area of power systems, it is

1

*m*

<sup>−</sup> <sup>←</sup> <sup>−</sup> (50)

1 2

max

1 to tk in (42) for the subsequent calculation of the tangent vector.

*x*

**5. MATLAB resources for electrical networks** 

*k x* η

obtained *xk* from the corrector (44), thus the variable *xk* is the continuation parameter.

After an appropriate index *k* has been selected and its corresponding value of

*k*

**e**

*k* index used in the corrector is the same as that used in the predictor and

*H N M L*

The application of the Newton-Raphson to (38) results in,

on it and they are solved by the iterative application of (49).

**4.5.3 Selection of the continuation parameter** 

following verification must be made:

 <sup>=</sup> <sup>−</sup> **F x**

represent the appropriate *k*-th element of **x**. Therefore, the new set of

0

λ

**P P Q V Q**

θ

(48)

η

η

(49)

, the load

is equal to the

where *<sup>k</sup> x*

ε**x** and

η

equations that substitute (38) is given by,

The electrical networks are studied using nodal analysis, as it was presented in section 3.1. In this frame of reference, the network matrixes as Ybus or Jacobian (1) and (21) have a sparse structure, considering that a node in an electrical network is connected to about 2.4 nodes in average. To illustrate this issue, if we consider the creation of a squared matrix with order 20, i.e. the matrix has 200 elements which 256 are zeros and the remaining are different from zero that are denoted as nz, as it is shown in figure 4. The sparsity pattern is displayed by using the MATLAB function *spy*.

Fig. 4. An example of a sparse matrix.

The operation on this type of matrices with conventional computational methods leads to obtain prohibited calculation times (Gracia et al, 2005). Due to this reason, there have been adopted special techniques for deal with this type of matrixes to avoid the unnecessary usage of memory and to execute the calculation processes on the nonzero elements. It is important to point it out that this kind of matrixes is more related to a computation technique than to a mathematic concept.

MATLAB offers mechanisms and methods to create, manipulate and operate on this kind of matrixes. The sparse matrixes are created with the sparse function, which requires the specification of 5 arguments in the following order: 3 arrays to specify the position *i*, the position *j* – row and column- and the element values x that correspond to each position (i,j), and the two integer variables to determine the dimensions *mxn* of the matrix, for example: >> A = sparse(i, j, x, m, n)

In MATLAB language, the indexing of full matrixes is equal to the sparse matrixes. This mechanism consists in pointing to a set of matrix elements through the use of two arrays that makes reference to each row and column of the matrix, e.g. **B** = **A**[**I**, **J**] or by simply pointing to each element o elements of the matrix to be modified, e.g. A[**I**, **J**] = **X.**

where **A** is a *mxn* spare matrix, I and J are the arrays that point to the rows and columns and **X** is the array that contains each element corresponding to each ordered pair (Ik, Jk). All mentioned arrays are composed for a number of *k* elements, such as *k* < *n* and *k* < *m.*

PV Curves for Steady-State Security Assessment with MATLAB 285

A = 1:1000; B = 1:1000; C = A.\*B;

It is evident that the use of the *for-loop* command to carry out the described operation gives a

Afterwards, the complete application code is listed. In case the code is copied and pasted into a new m-file, this will have the complete application, i.e. there is no necessity to add

*Execution time*: 0.002086 s *Execution time*: 0.000045 s

The program for plotting the PV curves is integrated with four specific tasks:

larger computation time than by using the vector operation **A**.\***B**.

**6. MATLAB application for plotting the PV curves** 

• Calculation of points for the PV curves at each node. • Graphical interface for editing the display of PV curves.

%% \*\*\*\*\*\*\*\*\*\*\*\*\*\* READING OF INPUT DATA \*\*\*\*\*\*\*\*\*\*\*\*\*\*

'IEEE Common Format (\*.cf)'}, 'Select any load flow file');

% -> the code lines are stored in the following variable:

DATA = textread(archivo,'%s','delimiter','\n','whitespace','');

Sbase = str2double(X\_b(32:37)); % Base power (MVA): Sbase

N\_Bus = str2double(fliplr(strtok(fliplr(X\_b(1:N\_Bus-1)))));

Script program with vector operations.

Script program with the loop

command

end

new code lines.

function main()

 return; end

for k = 1:1000 C(k,1) = k\*k;

• Reading of input data

• Generation of the flow base case

% -> The filename and its path are obtained:

 [file, trayectoria] = uigetfile( ... { '\*.cdf;','Type file (\*.cdf)'; '\*.cf', ...

if file == 0 & trayectoria == 0

archivo = [trayectoria file];

% -> Reading of nodal data:

N\_Bus = findstr(X\_b,'ITEMS');

DN = strvcat(DATA{3:N\_Bus});

Nnod = N\_Bus; % Total number of buses

X\_b = DATA{1};

X\_b = DATA{2};

N\_Bus = 2+N\_Bus;

MATLAB has a function called spdiags that is intended for the direct operation on any diagonal of the matrix, e.g. to make uniform changes on the elements of the diagonal "d" of matrix A:

>> A = spdiags(B, d, A)

A mechanism frequently used to form matrixes from other defined ones is called the *concatenation*. Even more, to form sparse matrixes by using other arrays of the same type but with specified dimensions in such a way that there is a consistency to gather into a single one, i.e. the concatenating is horizontal, the matrix rows must be equal to those of B matrix, e.g. C = [A B]. On the other hand, if the concatenating is vertical, then the columns of both matrices must be equal, e.g. C = [A; B].

#### **5.2 The LU factorization for solving a set of equations**

In electrical network applications, to find a solution of the algebraic system **Ax b** = in an efficient way, one option is to use the triangular decomposition as the LU factorization technique.

The triangular factorization LU consists in decomposing a matrix (A) such that it can be represented as the product of two matrixes, one of them is a lower triangular (L) while the other is an upper triangular (U), **A LU** = ⋅ . This representation is commonly named explicit factorization LU; even though it is very related to the Gaussian elimination, the elements of L and U are directly calculated from the **A** elements, the principal advantage with respect to the Gaussian elimination (Gill et al., 1991) consists in obtaining the solution of an algebraic system for any **b** vector, if and only if the "**A"** matrix is not modified.

#### **5.3 Sparse matrix ordering using AMD**

The Approximate minimum degree permutation (AMD) is a set of subroutines for row and column permutation of a sparse matrix before executing the Cholesky factorization or for the LU factorization with a diagonal pivoting (Tim, 2004). The employment of this subroutine is made by using the function "amd" to the matrix to be permuted, e.g. P = amd(**A**).

#### **5.4 Sparse matrix operations**

Care must be taken with a several rules in MATLAB when operations are carried out that include full and sparse matrixes, for example, the operation eye(22) + speye(22) gives a full matrix.

#### **5.5 Vector operations**

An approach to develop the script programs in MATLAB to be executed faster consists in coding the algorithms with the use of vectors within the programs and avoiding the use of loops such as *for, while and do-while*. The vector operations are made by writing the symbol "." before the operation to be made, e.g. .+, .-, .\*, ./. This discussion is illustrated by comparing two MATLAB script programs to solve the following operation:

$$
\begin{bmatrix} \mathbf{C}\_1 \\ \mathbf{C}\_2 \\ \vdots \\ \mathbf{C}\_n \end{bmatrix} = \begin{bmatrix} A\_1 \cdot B\_1 \\ A\_1 \cdot B\_2 \\ \vdots \\ A\_n \cdot B\_n \end{bmatrix}
$$


It is evident that the use of the *for-loop* command to carry out the described operation gives a larger computation time than by using the vector operation **A**.\***B**.

### **6. MATLAB application for plotting the PV curves**

The program for plotting the PV curves is integrated with four specific tasks:

• Reading of input data

284 MATLAB for Engineers – Applications in Control, Electrical Engineering, IT and Robotics

MATLAB has a function called spdiags that is intended for the direct operation on any diagonal of the matrix, e.g. to make uniform changes on the elements of the diagonal "d" of

A mechanism frequently used to form matrixes from other defined ones is called the *concatenation*. Even more, to form sparse matrixes by using other arrays of the same type but with specified dimensions in such a way that there is a consistency to gather into a single one, i.e. the concatenating is horizontal, the matrix rows must be equal to those of B matrix, e.g. C = [A B]. On the other hand, if the concatenating is vertical, then the columns

In electrical network applications, to find a solution of the algebraic system **Ax b** = in an efficient way, one option is to use the triangular decomposition as the LU factorization

The triangular factorization LU consists in decomposing a matrix (A) such that it can be represented as the product of two matrixes, one of them is a lower triangular (L) while the other is an upper triangular (U), **A LU** = ⋅ . This representation is commonly named explicit factorization LU; even though it is very related to the Gaussian elimination, the elements of L and U are directly calculated from the **A** elements, the principal advantage with respect to the Gaussian elimination (Gill et al., 1991) consists in obtaining the solution of an algebraic

The Approximate minimum degree permutation (AMD) is a set of subroutines for row and column permutation of a sparse matrix before executing the Cholesky factorization or for the LU factorization with a diagonal pivoting (Tim, 2004). The employment of this subroutine is

Care must be taken with a several rules in MATLAB when operations are carried out that include full and sparse matrixes, for example, the operation eye(22) + speye(22) gives a full

An approach to develop the script programs in MATLAB to be executed faster consists in coding the algorithms with the use of vectors within the programs and avoiding the use of loops such as *for, while and do-while*. The vector operations are made by writing the symbol "." before the operation to be made, e.g. .+, .-, .\*, ./. This discussion is illustrated by

> 1 11 2 12

*C AB C AB*

⋅

*n nn*

*C AB*

 <sup>⋅</sup> <sup>=</sup> <sup>⋅</sup> 

made by using the function "amd" to the matrix to be permuted, e.g. P = amd(**A**).

comparing two MATLAB script programs to solve the following operation:

matrix A:

technique.

matrix.

>> A = spdiags(B, d, A)

of both matrices must be equal, e.g. C = [A; B].

**5.3 Sparse matrix ordering using AMD** 

**5.4 Sparse matrix operations** 

**5.5 Vector operations** 

**5.2 The LU factorization for solving a set of equations** 

system for any **b** vector, if and only if the "**A"** matrix is not modified.


Afterwards, the complete application code is listed. In case the code is copied and pasted into a new m-file, this will have the complete application, i.e. there is no necessity to add new code lines.

```
function main()
```
%% \*\*\*\*\*\*\*\*\*\*\*\*\*\* READING OF INPUT DATA \*\*\*\*\*\*\*\*\*\*\*\*\*\*

% -> The filename and its path are obtained:

```
 [file, trayectoria] = uigetfile( ... 
 { '*.cdf;','Type file (*.cdf)'; '*.cf', ... 
 'IEEE Common Format (*.cf)'}, 'Select any load flow file');
```

```
 if file == 0 & trayectoria == 0 
 return; 
 end 
 archivo = [trayectoria file];
```
% -> the code lines are stored in the following variable: DATA = textread(archivo,'%s','delimiter','\n','whitespace','');

```
% -> Reading of nodal data:
 X_b = DATA{1}; 
 Sbase = str2double(X_b(32:37)); % Base power (MVA): Sbase
 X_b = DATA{2}; 
 N_Bus = findstr(X_b,'ITEMS'); 
 N_Bus = str2double(fliplr(strtok(fliplr(X_b(1:N_Bus-1))))); 
 Nnod = N_Bus; % Total number of buses 
 N_Bus = 2+N_Bus;
```

```
 DN = strvcat(DATA{3:N_Bus});
```
PV Curves for Steady-State Security Assessment with MATLAB 287

TAP = str2num(XLN(NramT,77:82)); % TAP changers of transformers

 Ylin =1./(RbrL+1j\*XbrL); % Series admítanse of transmission lines Yxtr =(1./(RbrX+1j\*XbrX))./TAP; % Series admítanse of transformers

% -> Admittance matrix:

% Mutual admittances:

% Self admittances: Ynodo = Ynodo + ...

Nnod, Nnod);

% -> Initialization:

% Active power:

% Reactive power:

 PLg = Pload(NumNG); QLg = Qload(NumNG);

 tic 

 Ynodo = sparse([ PLi; PTr; QLi; QTr ],... [ QLi; QTr; PLi; PTr ],...

[-Ylin; -Yxtr; -Ylin; -Yxtr ], Nnod, Nnod);

 sparse([ PLi; QLi; PTr; QTr; NumND],... [ PLi; QLi; PTr; QTr; NumND],...

Tol\_NR = 1e-3; % Tolerance error .

% -> Calculation of specified powers:

Qesp = -Qload/Sbase; % for PQ nodes

[Pnodo Qnodo] = scmplx();

iter = 0; % Initialization of iteration counter.

Max\_Iter = 60; % Maximum number of possible iterations.

 Vabs(NumNC) = 1.0; % Voltage magnitude of PQ nodes Tetan = zeros(Nnod,1); % Phase angles in all nodes

 Pesp(NumNG,1) = (Pgen-PLg)/Sbase; % for PV nodes Pesp(NumNC,1) = (-Pload(NumNC))/Sbase; % for PQ nodes

Ndim = Nnod + length(NumNC) - 1; % Jacobian dimension.

while iter <= Max\_Iter % Limit of the number of iterations

% -> Calculation of misadjustment of reactive and active powers:

% -> Calculation of net active and reactive powers injected to each node:

[Ylin+1j\*Blin; Ylin+1j\*Blin; Yxtr./TAP; Yxtr.\*TAP; 1j\*Bcomp],...

%% \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* CASE BASE GENERATION \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

```
 No_B = str2num(DN(:,1:4)); % Number of buses: No_B
 Tipo = str2num(DN(:,25:26)); % Bus type: Tipo
 Nslack = find(Tipo == 3); % Slack bus
 NumNG = find(Tipo >= 2); % Index of PV nodes
 NumNC = find(Tipo == 0); % Index of PQ nodes
 NumCG = find(Tipo <= 2); % Index of all nodes except slack
 Vabs = str2num(DN(:,28:33)); % Magnitude of nodal voltages.
 Tetan = str2num(DN(:,34:40)); % Phase angle of nodal voltages (degrees)
 Tetan = Tetan*pi/180; % Degrees to radians conversion
 Pload = str2num(DN(:,41:49)); % Demanded active power (MW)
 Qload = str2num(DN(:,50:59)); % Demanded reactive power (MVAr)
 Pgen = str2num(DN(:,60:67)); % Generated active power (MW)
 Qgen = str2num(DN(:,68:75)); % Generated reactive power (MVAr)
 Pgen = Pgen(NumNG); % PV nodes are selected
 Qgen = Qgen(NumNG); %PV nodes are selected 
 Gc = str2num(DN(:,107:114)); % Compensator conductance
 Bc = str2num(DN(:,115:122)); % Compensator susceptance
 NumND = find(Bc~=0); % Indexes of all compensating nodes.
 Bcomp = Bc(NumND); % Susceptance of all compensating nodes NumND
% -> Branch data is read:
 X_b = DATA{N_Bus+2}; 
 N_Bra = findstr(X_b,'ITEMS'); 
 N_Bra = str2double(fliplr(strtok(fliplr(X_b(1:N_Bra-1))))); 
 N_Bra1 = N_Bus+3; 
 N_Bra2 = N_Bus+N_Bra+2; 
 XLN = strvcat(DATA{N_Bra1:N_Bra2}); 
 X_b = str2num(XLN(:,19)); 
 NramL = find(X_b == 0); % Indexes of transmission lines (LT)
 NramT = find(X_b >= 1); % Indexes of transformers (Trafos)
 PLi = str2num(XLN(NramL,1:4)); % Initial bus for the transmission lines
 QLi = str2num(XLN(NramL,6:9)); % Final bus for the transmission lines
 PTr = str2num(XLN(NramT,1:4)); % Initial bus for the transformers
 QTr = str2num(XLN(NramT,6:9)); % Final bus for the transformers
 RbrL = str2num(XLN(NramL,20:29)); % Resistance of transmission lines (pu)
 XbrL = str2num(XLN(NramL,30:40)); % Reactance of transmission lines (pu)
 Blin = str2num(XLN(NramL,41:50))/2; % Susceptance of transmission lines (pu)
 RbrX = str2num(XLN(NramT,20:29)); % Resistance of transmission lines (pu)
 XbrX = str2num(XLN(NramT,30:40)); % Reactance of transmission lines (pu)
```
TAP = str2num(XLN(NramT,77:82)); % TAP changers of transformers

#### % -> Admittance matrix:

286 MATLAB for Engineers – Applications in Control, Electrical Engineering, IT and Robotics

No\_B = str2num(DN(:,1:4)); % Number of buses: No\_B

NumCG = find(Tipo <= 2); % Index of all nodes except slack

Vabs = str2num(DN(:,28:33)); % Magnitude of nodal voltages.

Tetan = Tetan\*pi/180; % Degrees to radians conversion

 Pload = str2num(DN(:,41:49)); % Demanded active power (MW) Qload = str2num(DN(:,50:59)); % Demanded reactive power (MVAr)

 Pgen = str2num(DN(:,60:67)); % Generated active power (MW) Qgen = str2num(DN(:,68:75)); % Generated reactive power (MVAr)

 Gc = str2num(DN(:,107:114)); % Compensator conductance Bc = str2num(DN(:,115:122)); % Compensator susceptance NumND = find(Bc~=0); % Indexes of all compensating nodes.

N\_Bra = str2double(fliplr(strtok(fliplr(X\_b(1:N\_Bra-1)))));

 NramL = find(X\_b == 0); % Indexes of transmission lines (LT) NramT = find(X\_b >= 1); % Indexes of transformers (Trafos)

 PLi = str2num(XLN(NramL,1:4)); % Initial bus for the transmission lines QLi = str2num(XLN(NramL,6:9)); % Final bus for the transmission lines PTr = str2num(XLN(NramT,1:4)); % Initial bus for the transformers QTr = str2num(XLN(NramT,6:9)); % Final bus for the transformers

 RbrL = str2num(XLN(NramL,20:29)); % Resistance of transmission lines (pu) XbrL = str2num(XLN(NramL,30:40)); % Reactance of transmission lines (pu) Blin = str2num(XLN(NramL,41:50))/2; % Susceptance of transmission lines (pu)

 RbrX = str2num(XLN(NramT,20:29)); % Resistance of transmission lines (pu) XbrX = str2num(XLN(NramT,30:40)); % Reactance of transmission lines (pu)

Tetan = str2num(DN(:,34:40)); % Phase angle of nodal voltages (degrees)

Bcomp = Bc(NumND); % Susceptance of all compensating nodes NumND

Tipo = str2num(DN(:,25:26)); % Bus type: Tipo

 NumNG = find(Tipo >= 2); % Index of PV nodes NumNC = find(Tipo == 0); % Index of PQ nodes

 Pgen = Pgen(NumNG); % PV nodes are selected Qgen = Qgen(NumNG); %PV nodes are selected

% -> Branch data is read: X\_b = DATA{N\_Bus+2}; N\_Bra = findstr(X\_b,'ITEMS');

N\_Bra1 = N\_Bus+3;

N\_Bra2 = N\_Bus+N\_Bra+2;

X\_b = str2num(XLN(:,19));

XLN = strvcat(DATA{N\_Bra1:N\_Bra2});

Nslack = find(Tipo == 3); % Slack bus

```
 Ylin =1./(RbrL+1j*XbrL); % Series admítanse of transmission lines
 Yxtr =(1./(RbrX+1j*XbrX))./TAP; % Series admítanse of transformers
% Mutual admittances:
 Ynodo = sparse([ PLi; PTr; QLi; QTr ],...
 [ QLi; QTr; PLi; PTr ],...
 [-Ylin; -Yxtr; -Ylin; -Yxtr ], Nnod, Nnod); 
% Self admittances:
 Ynodo = Ynodo + ...
 sparse([ PLi; QLi; PTr; QTr; NumND],...
 [ PLi; QLi; PTr; QTr; NumND],...
 [Ylin+1j*Blin; Ylin+1j*Blin; Yxtr./TAP; Yxtr.*TAP; 1j*Bcomp],...
 Nnod, Nnod); 
%% ******************* CASE BASE GENERATION ********************
 Tol_NR = 1e-3; % Tolerance error .
 Max_Iter = 60; % Maximum number of possible iterations.
% -> Initialization: 
 Vabs(NumNC) = 1.0; % Voltage magnitude of PQ nodes
 Tetan = zeros(Nnod,1); % Phase angles in all nodes

% -> Calculation of specified powers:
% Active power:
 PLg = Pload(NumNG); 
 QLg = Qload(NumNG); 
 Pesp(NumNG,1) = (Pgen-PLg)/Sbase; % for PV nodes
 Pesp(NumNC,1) = (-Pload(NumNC))/Sbase; % for PQ nodes
% Reactive power:
 Qesp = -Qload/Sbase; % for PQ nodes

 Ndim = Nnod + length(NumNC) - 1; % Jacobian dimension.
 iter = 0; % Initialization of iteration counter.
 tic 

 while iter <= Max_Iter % Limit of the number of iterations
```
% -> Calculation of misadjustment of reactive and active powers:

<sup>% -&</sup>gt; Calculation of net active and reactive powers injected to each node: [Pnodo Qnodo] = scmplx();

PV Curves for Steady-State Security Assessment with MATLAB 289

% -> Calculation of the augmented Jacobian as in equation (43):

JB(1:Ndim-1,Ndim) = [-Pesp(NumCG); -Qesp(NumNC)];

% -> Calculation of the tangent vector as in equation (43)

 sigma0 = 0.25; % Decrement of the predictor step Inferior = 14; % Calculation of additional 14 points.

 JB = Jacob(); JB(Ndim,Ix) = 1;

if b(end) < 0

t = linear\_solver(JB, b);

if Superior == true;

Superior = false;

 Carga(end-1:end) = []; Vpredict(:, end-1:end) = []; Vexact(:, end) = [];

sigma = sigma0/norm(t);

% -> Calculation of predictor:

lambda = lambda + sigma\*t(end);

% -> Calculation with the corrector:

Pmismatch = [DelP; DelQ; 0];

while iter <= Max\_Iter

% -> Selection of the continuation parameter: x = [Tetan(NumCG); Vabs(NumNC); lambda]; [xk Ix] = max(abs(t)./x); % As in equation (50)

% -> Calculation of the predictor step as in equation (45):

Tetan(NumCG) = Tetan(NumCG) + t(1:Nnod-1)\*sigma;

Carga = [Carga lambda]; % Load increment

Vabs(NumNC) = Vabs(NumNC).\*(1 + t(Nnod:Ndim-1)\*sigma);

Vpredict = [Vpredict Vabs]; % Calculated values with the predictor

 [Pnodo Qnodo] = scmplx(); % Computation of the complex power % -> Calculation of misadjustment in active and reactive powers as in: DelP = Pesp(NumCG)\*(1 + lambda) - Pnodo(NumCG); % Equation (35) DelQ = Qesp(NumNC)\*(1 + lambda) - Qnodo(NumNC); % Equation (36)

% -> The critical point has been reached:

iter = 0;

 end end

```
 DelP = Pesp(NumCG) - Pnodo(NumCG); 
 DelQ = Qesp(NumNC) - Qnodo(NumNC); 
 Pmismatch = [DelP; DelQ];
```
% -> Check the convergence method.

 if max(abs(Pmismatch)) < Tol\_NR tsol = toc; fprintf( 'The case has converged: %d iterations \n', iter); fprintf( 'in: %f seg. \n', tsol); break; end


```
 iter = iter + 1; 
 end
```
#### %% \*\*\*\*\*\* CALCULATION OF POINTS OF PV CURVES AT EACH NODE \*\*\*\*\*\*

Ndim = Nnod + length(NumNC); % Augmented Jacobian dimension.


% Flag to indicate state before the critical point: Superior = true;

% Counter used to calculate exactly the number of points alter the critical point: Inferior = 0;

while(Superior == true) || (Inferior > 0)

% -> After the critical point has been reached, only more 14 points are obtained. if (Superior == false) Inferior = Inferior - 1; end

 DelP = Pesp(NumCG) - Pnodo(NumCG); DelQ = Qesp(NumNC) - Qnodo(NumNC);

fprintf( 'The case has converged: %d iterations \n', iter);

% -> Update of magnitudes and angles of nodal voltages: Vabs(NumNC) = Vabs(NumNC).\*(1 + DeltaX(Nnod:Ndim)); Tetan(NumCG) = Tetan(NumCG) + DeltaX(1:Nnod-1);

%% \*\*\*\*\*\* CALCULATION OF POINTS OF PV CURVES AT EACH NODE \*\*\*\*\*\*

Ndim = Nnod + length(NumNC); % Augmented Jacobian dimension.

Ix = Ndim; % Index that indicates the continuation parameter.

% Counter used to calculate exactly the number of points alter the critical point:

% -> After the critical point has been reached, only more 14 points are obtained.

Pmismatch = [DelP; DelQ];

tsol = toc;

 break; end

JB = Jacob();

iter = iter + 1;

Superior = true;

Inferior = 0;

% -> Check the convergence method. if max(abs(Pmismatch)) < Tol\_NR

fprintf( 'in: %f seg. \n', tsol);

% -> Solution of the set of equations: DeltaX = linear\_solver(JB, Pmismatch);

sigma0 = 0.3966; % Predictor step.

 Carga = [0]; % Load increment. lambda = 0; % Initial value of lambda.

 Vpredict = [Vabs]; % Predicted voltage values. Vexact = [Vabs]; % Corrected voltage values.

b(Ndim,1) = 1; % Column vector of equation (43).

% Flag to indicate state before the critical point:

while(Superior == true) || (Inferior > 0)

if (Superior == false) Inferior = Inferior - 1; end

% -> Jacobian calculation:

end


 Vabs(NumNC) = Vabs(NumNC).\*(1 + t(Nnod:Ndim-1)\*sigma); Tetan(NumCG) = Tetan(NumCG) + t(1:Nnod-1)\*sigma; lambda = lambda + sigma\*t(end);

 Vpredict = [Vpredict Vabs]; % Calculated values with the predictor Carga = [Carga lambda]; % Load increment

% -> Calculation with the corrector: iter = 0; while iter <= Max\_Iter

 [Pnodo Qnodo] = scmplx(); % Computation of the complex power % -> Calculation of misadjustment in active and reactive powers as in:

 DelP = Pesp(NumCG)\*(1 + lambda) - Pnodo(NumCG); % Equation (35) DelQ = Qesp(NumNC)\*(1 + lambda) - Qnodo(NumNC); % Equation (36) Pmismatch = [DelP; DelQ; 0];

PV Curves for Steady-State Security Assessment with MATLAB 291

 H = ( imag(J2(NumCG, NumCG)) - Q(NumCG, NumCG)); % Equations (26) and (30) N = ( real(J2(NumCG, NumNC)) + P(NumCG, NumNC)); % Equations (27) and (31) J = (-real(J2(NumNC, NumCG)) + P(NumNC, NumCG)); % Equations (28) and (32) L = ( imag(J2(NumNC, NumNC)) + Q(NumNC, NumNC)); % Equations (29) and (33)

Jac = horzcat( vertcat(H, J), vertcat(N, L) ); % Submatrix concatenation as indicated in

As it was shown above, the four specific tasks of this application are integrated around the principal function: main(), which function is the sequential integration of these tasks. Even though the first three tasks are described in a set of continuous code lines, each task represents one independent process from each other; hence it is possible to separate them as external functions, such as the function PV\_PRINT, which executes the four tasks. Additionally, it can be seen that the calculation tasks, flow case base and the points of PV curves use nested functions within the main function that are common to both tasks. The

*Scmplx*: This function computes the net complex power injected to each node of the system

*Linear\_solver*: This function solves the set of linear equations **Ax b** ⋅ = by using the LU

A program based on the solution of load flows requires of some input data that describes the network to be analyzed. The information can be included in a text file with a

*Jacob*: This function computes the Jacobian of the conventional load flow problem.

Jac = sparse(Ndim, Ndim);

function x = linear\_solver(A, b)

following nested functions are:

**6.1 Reading of input data** 

and it returns its real and imaginary components.

factorization with previous reordering of **A** matrix.

 y = L\b(P); x(P, 1) = U\y;

(25) end 

end

end

 P = sparse(1:Nnod, 1:Nnod, Pnodo); Q = sparse(1:Nnod, 1:Nnod, Qnodo);

Vdiag = sparse(1:Nnod, 1:Nnod, Vabs.\*exp(1j\*Tetan));

 P = amd(A); % Ordering of matrix A (Jacobian). [L, U] = lu(A(P, P)); % Application of LU factorization.

% The set of equations (b=A\*x) are solved using the LU factorization:

J2 = Vdiag\*conj(Ynodo\*Vdiag); % Computation of equation (34)

 if max(abs(Pmismatch)) < Tol\_NR % Convergence criterion break; end % -> Calculation of the augmented Jacobian. JB = Jacob(); JB(1:Ndim-1,Ndim) = [-Pesp(NumCG); -Qesp(NumNC)]; JB(Ndim,Ix) = 1; % -> Calculation of the set of equations as in (49). DeltaX = linear\_solver(JB, Pmismatch); % -> Checking if the critical point has been found. if DeltaX(end) < 0 && Superior == true b(Ndim,1) = -1; break; end % -> Update state variables in the corrector: Vabs(NumNC) = Vabs(NumNC).\*(1 + DeltaX(Nnod:Ndim-1)); Tetan(NumCG) = Tetan(NumCG) + DeltaX(1:Nnod-1); lambda = lambda + DeltaX(end); iter = iter + 1; end Vexact = [Vexact Vabs]; Vpredict = [Vpredict Vabs]; Carga = [Carga lambda]; end %% \*\* GRAPHICAL INTERFACE FOR DISPLAYING THE PV CURVES \*\* PV\_PRINT( Carga, Vpredict, Vexact );

%% \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Nested functions \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* function [P Q] = scmplx()

 Vfasor = Vabs.\*exp(1j\*Tetan); % Complex form of nodal voltage using Euler. Scal = Vfasor.\*conj(Ynodo\*Vfasor); % Calculation of complex power as in (8). P = real(Scal); % Net active power injected to each node as in (9). Q = imag(Scal); % Net reactive power injected to each node as in (10).

end

function Jac = Jacob()

Jac = sparse(Ndim, Ndim);

 Vdiag = sparse(1:Nnod, 1:Nnod, Vabs.\*exp(1j\*Tetan)); J2 = Vdiag\*conj(Ynodo\*Vdiag); % Computation of equation (34) P = sparse(1:Nnod, 1:Nnod, Pnodo); Q = sparse(1:Nnod, 1:Nnod, Qnodo);

 H = ( imag(J2(NumCG, NumCG)) - Q(NumCG, NumCG)); % Equations (26) and (30) N = ( real(J2(NumCG, NumNC)) + P(NumCG, NumNC)); % Equations (27) and (31) J = (-real(J2(NumNC, NumCG)) + P(NumNC, NumCG)); % Equations (28) and (32) L = ( imag(J2(NumNC, NumNC)) + Q(NumNC, NumNC)); % Equations (29) and (33)

 Jac = horzcat( vertcat(H, J), vertcat(N, L) ); % Submatrix concatenation as indicated in (25)

end

290 MATLAB for Engineers – Applications in Control, Electrical Engineering, IT and Robotics

if max(abs(Pmismatch)) < Tol\_NR % Convergence criterion

JB(1:Ndim-1,Ndim) = [-Pesp(NumCG); -Qesp(NumNC)];

Vabs(NumNC) = Vabs(NumNC).\*(1 + DeltaX(Nnod:Ndim-1));

%% \*\* GRAPHICAL INTERFACE FOR DISPLAYING THE PV CURVES \*\*

 Vfasor = Vabs.\*exp(1j\*Tetan); % Complex form of nodal voltage using Euler. Scal = Vfasor.\*conj(Ynodo\*Vfasor); % Calculation of complex power as in (8).

%% \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Nested functions \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

 P = real(Scal); % Net active power injected to each node as in (9). Q = imag(Scal); % Net reactive power injected to each node as in (10).

Tetan(NumCG) = Tetan(NumCG) + DeltaX(1:Nnod-1);

% -> Calculation of the augmented Jacobian.

% -> Calculation of the set of equations as in (49). DeltaX = linear\_solver(JB, Pmismatch);

% -> Checking if the critical point has been found. if DeltaX(end) < 0 && Superior == true

% -> Update state variables in the corrector:

lambda = lambda + DeltaX(end);

PV\_PRINT( Carga, Vpredict, Vexact );

 break; end

JB = Jacob();

JB(Ndim,Ix) = 1;

b(Ndim,1) = -1;

 break; end

iter = iter + 1;

 Vexact = [Vexact Vabs]; Vpredict = [Vpredict Vabs]; Carga = [Carga lambda];

function [P Q] = scmplx()

function Jac = Jacob()

 end 

 end

end

function x = linear\_solver(A, b)

 P = amd(A); % Ordering of matrix A (Jacobian). [L, U] = lu(A(P, P)); % Application of LU factorization. % The set of equations (b=A\*x) are solved using the LU factorization: y = L\b(P); x(P, 1) = U\y;

end

end

As it was shown above, the four specific tasks of this application are integrated around the principal function: main(), which function is the sequential integration of these tasks. Even though the first three tasks are described in a set of continuous code lines, each task represents one independent process from each other; hence it is possible to separate them as external functions, such as the function PV\_PRINT, which executes the four tasks. Additionally, it can be seen that the calculation tasks, flow case base and the points of PV curves use nested functions within the main function that are common to both tasks. The following nested functions are:

*Scmplx*: This function computes the net complex power injected to each node of the system and it returns its real and imaginary components.

*Jacob*: This function computes the Jacobian of the conventional load flow problem.

*Linear\_solver*: This function solves the set of linear equations **Ax b** ⋅ = by using the LU factorization with previous reordering of **A** matrix.

#### **6.1 Reading of input data**

A program based on the solution of load flows requires of some input data that describes the network to be analyzed. The information can be included in a text file with a

PV Curves for Steady-State Security Assessment with MATLAB 293

power transfer, etc. Therefore the input data related to these controllers is not used in the

In the last part of the program, a graphical user interface (GUI) is generated for the plotting of PV curves from the points previously calculated in the continuous load flows program. Even though the main objective of this interface is oriented to the plotting of PV curves, its design allows the illustration continuation method process, i.e. it has the option of displaying the calculated points with the predictor, corrector or both of them, for example, it can be seen in figure 5 the set of points obtained with the predictor-corrector for the nodes 10,12,13, and 14 of the 14-node IEEE test power system. This is possible by integrating the MATLAB controls called uicontrol´s into the GUI design, the resultant GUI makes more

The numbers 1-12, that are indicated in red color in figure 5, make reference to each uicontrol or graphical object that integrates the GUI. The graphical objects with its uicontrol

**6.2 Graphical interface for editing the display of PV curves**

number, its handle and its description are given in table 1.

Fig. 5. GUI for plotting the PV curves for any node.

program.

intuitive and flexible its use.

standardized format with the extension cdf (Common Data Format) (University of Washington electrical engineering, 1999). The reading of the complete information is achieved by using the MATLAB function textread. The reading includes the use of a standard uicontrol of MATLAB to locate the file path. This information is stored in a data matrix of string type, and it can be interpreted by using functions that operate on the variables of string type. There is basic information that is used in the developed program; the variables can be divided into two categories:

*Nodal information:* 

*Sbase* : Base power of the system.

*Nnod* : Number of system nodes.

**No\_B** : *n*x1 vector with the numbering of each system bus.

**Name\_B** : *n*x1 vector with the name of each bus system.

**Tipo** : *n*x1 vector with the node type of the system.

*Nslack* : The number of the slack node.

**Vn** : *n*x1 vector with voltage magnitudes at each system node.

**Vbase** : *n*x1 vector with base values of voltages at each system bus.

**Tetan** : *n*x1 vector with phase angles at each nodal voltage.

**PLoad** and **QLoad** : *n*x1 vector with the active and reactive load powers, respectively.

**Pgen** and **Qgen** : (*n-nc)*x1 vector with the active and reactive power of generators, respectively.

**Gc** and **Bc** : *n*x1 vector with conductance and susceptance of each compensating element, respectively.

*Branch information* (transmission lines and transformers), where *l* denotes the total number of transmission lines and *t* is the number of transformers in the electrical network:

**PLi** and **PTr** : Vectors with dimensions *l*x1 y *t*x1, that indicate one side of transmission lines and transformers connected to the P node, respectively.

**QLr** and **QTr** : They are similar as PL and PT with the difference that indicates the opposite side of the connected branch to the Q node.

**RbrL** and **RbrX** : They are similar as the above two variables with the difference that indicate the resistance of each transmission line and transformer.

**XbrL** and **XbrX** : They are similar as the above with the difference that indicate the reactance of each transmission line and transformer.

**Blin** : *l*x1 vector with the half susceptance of a transmission line.

**TAP** : *t*x1 vector with the current position of the TAP changer of the transformer.

After reading the input data, the admittance matrix **Ynode**, and a series of useful pointers are created to extract particular data from the nodal and branch data:


*Tol\_NR – the maximum deviations in power are lower to this value in case of convergence - and Max\_Iter –is the maximum number of iterations –* these variables are used to control the convergence and a value is assigned to them by default after reading of input data.

The program does not consider the checking of limits of reactive power in generator nodes neither the effect of the automatic tap changer in transformers, nor the inter-area

standardized format with the extension cdf (Common Data Format) (University of Washington electrical engineering, 1999). The reading of the complete information is achieved by using the MATLAB function textread. The reading includes the use of a standard uicontrol of MATLAB to locate the file path. This information is stored in a data matrix of string type, and it can be interpreted by using functions that operate on the variables of string type. There is basic information that is used in the developed program;

the variables can be divided into two categories:

**No\_B** : *n*x1 vector with the numbering of each system bus. **Name\_B** : *n*x1 vector with the name of each bus system. **Tipo** : *n*x1 vector with the node type of the system.

**Vn** : *n*x1 vector with voltage magnitudes at each system node. **Vbase** : *n*x1 vector with base values of voltages at each system bus.

**PLoad** and **QLoad** : *n*x1 vector with the active and reactive load powers, respectively.

of transmission lines and *t* is the number of transformers in the electrical network:

**TAP** : *t*x1 vector with the current position of the TAP changer of the transformer.

convergence and a value is assigned to them by default after reading of input data.

**Pgen** and **Qgen** : (*n-nc)*x1 vector with the active and reactive power of generators,

**Gc** and **Bc** : *n*x1 vector with conductance and susceptance of each compensating element,

*Branch information* (transmission lines and transformers), where *l* denotes the total number

**PLi** and **PTr** : Vectors with dimensions *l*x1 y *t*x1, that indicate one side of transmission lines

**QLr** and **QTr** : They are similar as PL and PT with the difference that indicates the opposite

**RbrL** and **RbrX** : They are similar as the above two variables with the difference that

**XbrL** and **XbrX** : They are similar as the above with the difference that indicate the

After reading the input data, the admittance matrix **Ynode**, and a series of useful pointers

*Tol\_NR – the maximum deviations in power are lower to this value in case of convergence - and Max\_Iter –is the maximum number of iterations –* these variables are used to control the

The program does not consider the checking of limits of reactive power in generator nodes neither the effect of the automatic tap changer in transformers, nor the inter-area

**Tetan** : *n*x1 vector with phase angles at each nodal voltage.

and transformers connected to the P node, respectively.

reactance of each transmission line and transformer.

• **NumNG**: An array that points to the PV nodes. • **NumNC**: An array that points to the PQ nodes.

indicate the resistance of each transmission line and transformer.

**Blin** : *l*x1 vector with the half susceptance of a transmission line.

are created to extract particular data from the nodal and branch data:

• **NumCG**: An array that points to all nodes but the slack node.

side of the connected branch to the Q node.

*Sbase* : Base power of the system. *Nnod* : Number of system nodes.

*Nslack* : The number of the slack node.

*Nodal information:* 

respectively.

respectively.

power transfer, etc. Therefore the input data related to these controllers is not used in the program.

#### **6.2 Graphical interface for editing the display of PV curves**

In the last part of the program, a graphical user interface (GUI) is generated for the plotting of PV curves from the points previously calculated in the continuous load flows program. Even though the main objective of this interface is oriented to the plotting of PV curves, its design allows the illustration continuation method process, i.e. it has the option of displaying the calculated points with the predictor, corrector or both of them, for example, it can be seen in figure 5 the set of points obtained with the predictor-corrector for the nodes 10,12,13, and 14 of the 14-node IEEE test power system. This is possible by integrating the MATLAB controls called uicontrol´s into the GUI design, the resultant GUI makes more intuitive and flexible its use.

The numbers 1-12, that are indicated in red color in figure 5, make reference to each uicontrol or graphical object that integrates the GUI. The graphical objects with its uicontrol number, its handle and its description are given in table 1.

Fig. 5. GUI for plotting the PV curves for any node.

PV Curves for Steady-State Security Assessment with MATLAB 295

% Declaration of axes object where the curves are to be plotted and it is located in

% Declaration of a panel inside the hPanel\_control and it contains the listbox and textbox.

% Listbox located in hPanel and it is used for selecting the node or desired nodes for

 'MenuBar', 'figure', 'numbertitle', 'off',... 'visible', 'on', 'Position', [0.05 0.05 wF hF]);

% Generation of the left panel included in hPV. hPanel\_print = uipanel('Parent', hPV, ...

hAxes\_Curve = axes('Parent', hPanel\_print, ...

% Generation of the right panel in hPV. hPanel\_control = uipanel('Parent',hPV, ...

 'BorderType', 'etchedout', 'BorderWidth', 1,... 'visible', 'on', 'Position', [0.005 0.01 0.75 0.98]);

'Units', 'normalized', 'BackgroundColor', BckgrClr, ...

 'units', 'normalized', 'Position',[0.07 0.07 0.88 0.88], ... 'Box', 'on', 'Tag', 'hAxes\_Curve', 'Visible', 'off');

'Units', 'normalized', 'BackgroundColor', BckgrClr, ...

'Units', 'normalized', 'BackgroundColor', BckgrClr, ...

'Units', 'normalized', 'BackgroundColor', [1 1 1], ...

 'Tag', 'hlb\_log', 'Position', [0 0 1 0.85], 'fontsize', 12,... 'Enable', 'on', 'Style', 'listbox', 'String', etiqueta, ... 'Max', Nodos, 'Min', 0, 'Clipping', 'off', 'Visible', 'on');

'Units', 'normalized', 'HorizontalAlignment', 'center',...

hChoice\_PV = uibuttongroup('Parent', hPanel\_control, ...

 'style', 'text', 'fontname', 'Comic Sans MS',... 'BackgroundColor', 'w', 'string', 'Select the node',... 'fontsize', 12, 'fontweight', 'bold', 'visible', 'on',...

'FontName', 'Lucida Console', 'HorizontalAlignment', 'left',...

% Textbox located in hPanel and it is used for displaying any string.

% Uicontrol of type optionbutton, and it is located in hPanel\_control.

 'BorderType', 'etchedout', 'BorderWidth', 1,... 'visible', 'on', 'Position', [0.76 0.01 0.235 0.98]);

 'BorderType', 'etchedout', 'BorderWidth', 3,... 'visible', 'on', 'Position', [0.05 0.18 0.9 0.45]);

hPanel = uipanel('Parent', hPanel\_control, ...

hlb\_log = uicontrol('Parent', hPanel, ...

hlb\_txt = uicontrol('Parent', hPanel,...

'Position', [0.0 0.85 1 0.15]);

delete(gca);

hPanel\_Print.

displaying its curves.


Table 1. Description of each graphical object used in the GUI shown in figure 5.

The complete code of the function that generates the GUI is presented below, where the code lines for creating each graphical object mentioned in table 1 are fully described.

function PV\_PRINT(lambda, predictor, corrector )

```
 [Nodos columnas] = size(predictor); 
 clear columnas; 
 etiqueta = {};
```
% Variable for registering the elements of listbox that relates the system nodes, which can have plotted its PV curve

```
 for ii = 1:Nodos 
 etiqueta{ii, 1} = ['Node ' num2str(ii)]; 
 end
```
% Variables for configuring the graphical object, color and screen size.

```
 BckgrClr = get(0, 'defaultUicontrolbackgroundColor'); 
 Sc_Sz = get(0, 'ScreenSize'); 
 wF = 0.85; 
 hF = 0.85; 
 wF_Pix = wF*Sc_Sz(3); 
 hF_Pix = hF*Sc_Sz(4);
```
% Creation of the object type figure: main window.

hPV = figure(...

 'Name', 'Graphic tool', ... 'units', 'normalized', 'Color', BckgrClr,...

```
 'MenuBar', 'figure', 'numbertitle', 'off',...
 'visible', 'on', 'Position', [0.05 0.05 wF hF]); 
 delete(gca);
```
1 hPV Graphical object known as figure 2 hPanel\_print Panel located to the left of hPV 3 hAxes\_Curve Object for 2D graphs known as axes 4 hPanel\_control Panel located to the right of hPV 5 hPanel Panel located in the upper part of

6 hlb\_log Graphical object known as listbox 7 hlb\_txt Graphical object known as textbox 8 hChoice\_PV Set of objects known as radio buttons 9 opt0 Graphical objects known as radiobutton 10 opt1 Graphical objects known as radiobutton 11 opt2 Graphical objects known as radiobutton 12 - without handle- Graphical objects known as pushbutton

The complete code of the function that generates the GUI is presented below, where the

% Variable for registering the elements of listbox that relates the system nodes, which can

hPanel\_control

**Uicontrol number handle Description** 

Table 1. Description of each graphical object used in the GUI shown in figure 5.

% Variables for configuring the graphical object, color and screen size.

BckgrClr = get(0, 'defaultUicontrolbackgroundColor');

% Creation of the object type figure: main window.

'units', 'normalized', 'Color', BckgrClr,...

function PV\_PRINT(lambda, predictor, corrector )

[Nodos columnas] = size(predictor);

etiqueta{ii, 1} = ['Node ' num2str(ii)];

 clear columnas; etiqueta = {};

end

 wF = 0.85; hF = 0.85;

hPV = figure(...

have plotted its PV curve for ii = 1:Nodos

Sc\_Sz = get(0, 'ScreenSize');

'Name', 'Graphic tool', ...

 wF\_Pix = wF\*Sc\_Sz(3); hF\_Pix = hF\*Sc\_Sz(4);

code lines for creating each graphical object mentioned in table 1 are fully described.


% Declaration of axes object where the curves are to be plotted and it is located in hPanel\_Print.

 hAxes\_Curve = axes('Parent', hPanel\_print, ... 'units', 'normalized', 'Position',[0.07 0.07 0.88 0.88], ... 'Box', 'on', 'Tag', 'hAxes\_Curve', 'Visible', 'off');

#### % Generation of the right panel in hPV.

 hPanel\_control = uipanel('Parent',hPV, ... 'Units', 'normalized', 'BackgroundColor', BckgrClr, ... 'BorderType', 'etchedout', 'BorderWidth', 1,... 'visible', 'on', 'Position', [0.76 0.01 0.235 0.98]);

% Declaration of a panel inside the hPanel\_control and it contains the listbox and textbox. hPanel = uipanel('Parent', hPanel\_control, ...

 'Units', 'normalized', 'BackgroundColor', BckgrClr, ... 'BorderType', 'etchedout', 'BorderWidth', 3,... 'visible', 'on', 'Position', [0.05 0.18 0.9 0.45]);

% Listbox located in hPanel and it is used for selecting the node or desired nodes for displaying its curves.

 hlb\_log = uicontrol('Parent', hPanel, ... 'Units', 'normalized', 'BackgroundColor', [1 1 1], ... 'FontName', 'Lucida Console', 'HorizontalAlignment', 'left',... 'Tag', 'hlb\_log', 'Position', [0 0 1 0.85], 'fontsize', 12,... 'Enable', 'on', 'Style', 'listbox', 'String', etiqueta, ... 'Max', Nodos, 'Min', 0, 'Clipping', 'off', 'Visible', 'on');

% Textbox located in hPanel and it is used for displaying any string. hlb\_txt = uicontrol('Parent', hPanel,...

 'Units', 'normalized', 'HorizontalAlignment', 'center',... 'style', 'text', 'fontname', 'Comic Sans MS',... 'BackgroundColor', 'w', 'string', 'Select the node',... 'fontsize', 12, 'fontweight', 'bold', 'visible', 'on',... 'Position', [0.0 0.85 1 0.15]);

% Uicontrol of type optionbutton, and it is located in hPanel\_control. hChoice\_PV = uibuttongroup('Parent', hPanel\_control, ...

PV Curves for Steady-State Security Assessment with MATLAB 297

function RefreshAxes(source, eventdata, hChoice\_PV, hAxes\_Curve, hlb\_log, lambda,

Nodos = get(hlb\_log, 'Value'); % It is obtained the node(s) whose PV curves will be

switch get(hChoice\_PV, 'UserData') % Option selection for the object uibuttongroup

 case 0 % The points obtained with the predictor are plotted for the selected nodes. plot(hAxes\_Curve, 1 + [lambda(1), lambda(2:2:end)], [predictor(Nodos, 1),

case 1 % The points obtained with the corrector are plotted for the selected nodes.

% The points stored in the variable predictor are plotted for the selected nodes.

% If there are more than one node, they are labeled for marking the shown curves

% Automatic numbering of axes (selection of maximum and minimum limits for x-y axes)

title(hAxes\_Curve, 'Plot the points of predictor', 'FontSize', 14);

 plot(hAxes\_Curve, 1 + lambda(1:2:end), corrector(Nodos,:)); title(hAxes\_Curve, 'Plot the points of corrector ', 'FontSize', 14);

 plot(hAxes\_Curve, 1 + lambda, predictor(Nodos, :)); title(hAxes\_Curve, ' All points ', 'FontSize', 14);

function selcbk(source, eventdata)

set(source, 'UserData', 0);

set(source, 'UserData', 1);

set(source, 'UserData', 2);

case 'Predictor'

case 'Corrector'

predictor, corrector)

predictor(Nodos, 2:2:end)]);

otherwise

 end

end 

plotted

otherwise

if length(Nodos) > 1

etiqN = get(hlb\_log, 'String');

% The grid are shown in the plot. grid(hAxes\_Curve, 'on');

legend(hAxes\_Curve, etiqN{Nodos});

end

end

switch get(eventdata.NewValue, 'String')

 'Units', 'normalized', 'Position', [0.05 0.7 0.9 0.25], ... 'BackgroundColor', BckgrClr, 'FontName', 'Lucida Console', ... 'FontSize', 10, 'FontWeight', 'bold', 'Tag','hChoice\_PV',... 'Title', 'Plots', 'visible', 'off');

% Optionbutton located in hChoice\_PV which is used for ploting the points obtained with the corrector.

 opt0 = uicontrol('Parent', hChoice\_PV, ... 'Units', 'normalized', 'pos', [0.1 0.68 0.8 0.25], ... 'BackgroundColor', BckgrClr, 'FontName', 'Lucida Console', ... 'FontSize', 9, 'FontWeight', 'bold', 'Style', 'Radio',... 'String', 'Predictor', 'HandleVisibility', 'off');

% Optionbutton located in hChoice\_PV and it is used for plotting the points calculated with the corrector.

opt1 = uicontrol('Parent', hChoice\_PV, ...

 'Units', 'normalized', 'pos', [0.1 0.4 0.8 0.25], ... 'BackgroundColor', BckgrClr, 'FontName', 'Lucida Console', ... 'FontSize', 9, 'FontWeight', 'bold', 'Style', 'Radio',...

'String', 'Corrector', 'HandleVisibility', 'off');

% Optionbutton located in hChoice\_PV and it is used for plotting the points obtained with the predictor + corrector.

opt2 = uicontrol('Parent', hChoice\_PV, ...

 'Units', 'normalized', 'pos', [0.1 0.125 0.8 0.25], ... 'BackgroundColor', BckgrClr, 'FontName', 'Lucida Console', ... 'FontSize', 9, 'FontWeight', 'bold', 'Style', 'Radio',... 'String', 'Predictor + Corrector', 'HandleVisibility', 'off');

% Configuration of the graphical object hChoice\_PV. set(hChoice\_PV, 'SelectionChangeFcn', @selcbk);

 set(hChoice\_PV, 'SelectedObject', opt0); set(hChoice\_PV, 'UserData', 0);

set(hChoice\_PV, 'Visible', 'on');

% Generation of the command button which calls the function that generates the selected graphs for the set of optionbutton located in hChoice\_PV.

uicontrol('Parent', hPanel\_control, ...

 'Units', 'normalized', 'style', 'pushbutton',... 'FontName', 'Comic Sans MS', 'visible', 'on',... 'fontsize', 9, ...

 'callback', {@RefreshAxes, hChoice\_PV, hAxes\_Curve, hlb\_log, lambda, predictor, corrector},...

 'FontWeight', 'bold', 'string', 'Plot', ... 'Position',[0.05 0.05 0.9 0.08]);

function selcbk(source, eventdata)

```
 switch get(eventdata.NewValue, 'String') 
 case 'Predictor'
 set(source, 'UserData', 0); 
 case 'Corrector'
 set(source, 'UserData', 1); 
 otherwise
 set(source, 'UserData', 2);
```
end

end

296 MATLAB for Engineers – Applications in Control, Electrical Engineering, IT and Robotics

% Optionbutton located in hChoice\_PV which is used for ploting the points obtained with

% Optionbutton located in hChoice\_PV and it is used for plotting the points calculated with

% Optionbutton located in hChoice\_PV and it is used for plotting the points obtained with

% Generation of the command button which calls the function that generates the selected

'callback', {@RefreshAxes, hChoice\_PV, hAxes\_Curve, hlb\_log, lambda, predictor,

'Units', 'normalized', 'Position', [0.05 0.7 0.9 0.25], ...

'Title', 'Plots', 'visible', 'off');

opt0 = uicontrol('Parent', hChoice\_PV, ...

opt1 = uicontrol('Parent', hChoice\_PV, ...

opt2 = uicontrol('Parent', hChoice\_PV, ...

set(hChoice\_PV, 'SelectedObject', opt0);

 set(hChoice\_PV, 'UserData', 0); set(hChoice\_PV, 'Visible', 'on');

uicontrol('Parent', hPanel\_control, ...

 'FontWeight', 'bold', 'string', 'Plot', ... 'Position',[0.05 0.05 0.9 0.08]);

'fontsize', 9, ...

corrector},...

 end

'Units', 'normalized', 'pos', [0.1 0.4 0.8 0.25], ...

 'FontSize', 9, 'FontWeight', 'bold', 'Style', 'Radio',... 'String', 'Corrector', 'HandleVisibility', 'off');

'Units', 'normalized', 'pos', [0.1 0.125 0.8 0.25], ...

 'FontSize', 9, 'FontWeight', 'bold', 'Style', 'Radio',... 'String', 'Predictor + Corrector', 'HandleVisibility', 'off');

% Configuration of the graphical object hChoice\_PV. set(hChoice\_PV, 'SelectionChangeFcn', @selcbk);

graphs for the set of optionbutton located in hChoice\_PV.

 'Units', 'normalized', 'style', 'pushbutton',... 'FontName', 'Comic Sans MS', 'visible', 'on',...

'Units', 'normalized', 'pos', [0.1 0.68 0.8 0.25], ...

 'FontSize', 9, 'FontWeight', 'bold', 'Style', 'Radio',... 'String', 'Predictor', 'HandleVisibility', 'off');

the corrector.

the corrector.

the predictor + corrector.

 'BackgroundColor', BckgrClr, 'FontName', 'Lucida Console', ... 'FontSize', 10, 'FontWeight', 'bold', 'Tag','hChoice\_PV',...

'BackgroundColor', BckgrClr, 'FontName', 'Lucida Console', ...

'BackgroundColor', BckgrClr, 'FontName', 'Lucida Console', ...

'BackgroundColor', BckgrClr, 'FontName', 'Lucida Console', ...

function RefreshAxes(source, eventdata, hChoice\_PV, hAxes\_Curve, hlb\_log, lambda, predictor, corrector)

 Nodos = get(hlb\_log, 'Value'); % It is obtained the node(s) whose PV curves will be plotted

switch get(hChoice\_PV, 'UserData') % Option selection for the object uibuttongroup

```
 case 0 % The points obtained with the predictor are plotted for the selected nodes.
 plot(hAxes_Curve, 1 + [lambda(1), lambda(2:2:end)], [predictor(Nodos, 1), 
predictor(Nodos, 2:2:end)]); 
 title(hAxes_Curve, 'Plot the points of predictor', 'FontSize', 14);
```

```
 case 1 % The points obtained with the corrector are plotted for the selected nodes.
 plot(hAxes_Curve, 1 + lambda(1:2:end), corrector(Nodos,:)); 
 title(hAxes_Curve, 'Plot the points of corrector ', 'FontSize', 14); 
 otherwise
 % The points stored in the variable predictor are plotted for the selected nodes.
 plot(hAxes_Curve, 1 + lambda, predictor(Nodos, :)); 
 title(hAxes_Curve, ' All points ', 'FontSize', 14);
```
end

```
 if length(Nodos) > 1 
 % If there are more than one node, they are labeled for marking the shown curves
 etiqN = get(hlb_log, 'String'); 
 legend(hAxes_Curve, etiqN{Nodos}); 
 end
```
% The grid are shown in the plot. grid(hAxes\_Curve, 'on');

% Automatic numbering of axes (selection of maximum and minimum limits for x-y axes)

PV Curves for Steady-State Security Assessment with MATLAB 299

that can be considered as critical point or voltage collapse of the power system. The technique for continuous load flow has been applied to determine the PV curves of the 14 node IEEE test system, and it has been shown that a 4.062% load increment can lead to the instability of the system, and it also has been determined that the node 14 is the weaker

Arrillaga, J. & Walsion,N. (2001). *Computer Modeling of electrical Power Systems (2th),* Whyley,

D. A. Alves, L. C. P. Da Silva, C. A. Castro, V. F. da Costa, "Continuation Load Flor Method Parametrized by Transmissión Line Powers", Paper 0-7801-6338-8/00 IEEE 2000 Garcia, J., Rodriguez, J.& Vidal, J. (2005). Aprenda Matlab 7.0 como si estuviera en primero,

 http://mat21.etsii.upm.es/ayudainf/aprendainf/Matlab70/ matlab70primero.pdf Gill, P., Murray, W. & Wrigth M., (1991). *Nuemric linear Algebra and optimization vol 1* (ed),

Graham, R., Chow, J., &, Vanfretti, L. (2009). Power System Toolbox, In: Power System Toolbox Webpage, 15.03.20011, Available from: http://www.ecse.rpi.edu/pst/ Kundur, P. (1994). Voltage Stability, *Power System stability and control*, pp. 959-1024, Mc Graw

Mahseredjian, J., & Alvarado, F. (1997). MatEMTP, In: Creating an electromagnetic

M. G. Ogrady, M. A. Pai, "Analysis of Voltage Collapse in Power Systems", Proceedings of

Milano, F. (2010). *Power system modelling and scripting* (*1th*)*,* Springer, ISBN 9-783-642-13669-

distribution/power-technologies-international/softwaresolutions/pss-e.htm Tim, D. (2004), Research and software development in sparse matrix algorithms, In: AMD, 12.03.2011, Available from http://www.cise.ufl.edu/research/sparse/amd/ Venkataramana, A. (2007). *Power Computational Techniques for Voltage Stability Assessment and* 

Venkataramana Ajjarapu, Colin Christy, "The Continuation Power flor: A Tool for Steady

W. C. Eheinboldt, J. B. Burkhardt, "A Locally Parametrized Continuation Process", ACM Transactions on Mathematical Software, Vol. 9 No. 2, June 1986, pp. 215-235. University of Washington electrical engineering. (1999). 14 Bus, In: Power Systems Test Case

State Voltaje Stability Analysis", Transactions on Power Systems, Vol. 7, No. 1,

21st Annual North American Power Symposium, Rolla, Missouiri, October 1999ric

Universidad Politécnica de Madrid, Retrieved from

Hill, ISBN 0-07-035959-X, Palo Alto, California

Manufacturers Association, Washington, D.C.

Milano, F. (2006). PSAT, In: Dr. Federico Milano Website, 15.03.2011, http://www.power.uwaterloo.ca/~fmilano/psat.htm PowerWorld Corporation (2010). http://www.powerworld.com

*Control* (*1th*), Springer, ISBN 978-0-387-26080-8.

Archive, 25.01.2011, Available from http://www.ee.washington.edu/research/pstca/.

http://www.energy.siemens.com/us/en/services/powertransmission-

http://minds.wisconsin.edu/handle/1793/9012

Addison-wesley, ISBN 0-201-12647-4, Redwood City, US

transients program in MATLAB, Available: 15.013.2011,

node of the system.

ISBN 0-471-87249-0.

6, London, \_\_\_

Fabruary 1992

Siemens, PTI. (2005).

**8. References** 

axis(hAxes\_Curve, 'auto');


#### end

Since the function PV\_PRINT is external to the function main, the created variables within main cannot be read directly for the function PV\_PRINT, hence it is required to declare arguments as inputs for making reference to any variable in main. The main advantage of using external functions consists in the ability to call them in any application just by giving the required arguments for its correct performance. In order to reproduce this application, it is necessary to copy the code in an m-file which is different from the main.

#### **7. Conclusion**

An electrical engineering problem involves the solution of a series of formulations and mathematical algorithm definitions that describe the problem physics. The problems related to the control, operation and diagnostic of power systems as the steady-state security evaluation for the example the PV curves, are formulated in matrix form, which involves manipulation techniques and matrix operations; however the necessity of operating on matrixes with large dimensions takes us to look for computational tools for handling efficiently these large matrixes. The use of script programming which is oriented to scientific computing is currently widely used in the academic and research areas. By taking advantage of its mathematical features which are normally found in many science or engineering problems allows us solving any numerical problem. It can be adapted for the development of simulation programs and for illustrating the whole process in finding a solution to a defined problem, and thus makes easier to grasp the solution method, such as the conventional load flow problem solved with the Newton-Raphson method.

MATLAB has demonstrated to be a good tool for the numerical experimentation and for the study of engineering problems; it provides a set of functions that make simple and straightforward the programming. It also offers mechanisms that allow dealing with mathematic abstractions such as matrixes in such a way that is possible to develop prototype programs which are oriented to the solution methods by matrix computations. The development of scripts or tools can be considered to be a priority in the academic area such that they allow achieving a valid solution. It is also advisable to take advantage of the MATLAB resources such as: vector operations, functions and mechanisms for operating on each matrix element without using any flow control for the program, i.e. for loop; this offers the advantage of decreasing the number of code lines of the script program. These recommendations reduce the computation time and allow its easy usage and modification by any user. Finally, MATLAB offers powerful graphical tools which are extremely useful for displaying the output information and to aid interpreting the simulation results. In this chapter, the plotting of the corrector points (PV curve) has been presented for a given load that can be considered as critical point or voltage collapse of the power system. The technique for continuous load flow has been applied to determine the PV curves of the 14 node IEEE test system, and it has been shown that a 4.062% load increment can lead to the instability of the system, and it also has been determined that the node 14 is the weaker node of the system.

#### **8. References**

298 MATLAB for Engineers – Applications in Control, Electrical Engineering, IT and Robotics

Since the function PV\_PRINT is external to the function main, the created variables within main cannot be read directly for the function PV\_PRINT, hence it is required to declare arguments as inputs for making reference to any variable in main. The main advantage of using external functions consists in the ability to call them in any application just by giving the required arguments for its correct performance. In order to reproduce this application, it

An electrical engineering problem involves the solution of a series of formulations and mathematical algorithm definitions that describe the problem physics. The problems related to the control, operation and diagnostic of power systems as the steady-state security evaluation for the example the PV curves, are formulated in matrix form, which involves manipulation techniques and matrix operations; however the necessity of operating on matrixes with large dimensions takes us to look for computational tools for handling efficiently these large matrixes. The use of script programming which is oriented to scientific computing is currently widely used in the academic and research areas. By taking advantage of its mathematical features which are normally found in many science or engineering problems allows us solving any numerical problem. It can be adapted for the development of simulation programs and for illustrating the whole process in finding a solution to a defined problem, and thus makes easier to grasp the solution method, such as

is necessary to copy the code in an m-file which is different from the main.

the conventional load flow problem solved with the Newton-Raphson method.

MATLAB has demonstrated to be a good tool for the numerical experimentation and for the study of engineering problems; it provides a set of functions that make simple and straightforward the programming. It also offers mechanisms that allow dealing with mathematic abstractions such as matrixes in such a way that is possible to develop prototype programs which are oriented to the solution methods by matrix computations. The development of scripts or tools can be considered to be a priority in the academic area such that they allow achieving a valid solution. It is also advisable to take advantage of the MATLAB resources such as: vector operations, functions and mechanisms for operating on each matrix element without using any flow control for the program, i.e. for loop; this offers the advantage of decreasing the number of code lines of the script program. These recommendations reduce the computation time and allow its easy usage and modification by any user. Finally, MATLAB offers powerful graphical tools which are extremely useful for displaying the output information and to aid interpreting the simulation results. In this chapter, the plotting of the corrector points (PV curve) has been presented for a given load

 xlabel(hAxes\_Curve, 'Load increment (% PU)', 'FontSize', 10); ylabel(hAxes\_Curve, 'Nodal voltage (PU)', 'FontSize', 10);

% The object becomes visible with the handle hAxes\_Curve.

axis(hAxes\_Curve, 'auto');

% Labeling of X and Y axes.

end

**7. Conclusion** 

set(hAxes\_Curve, 'Visible', 'on');


Addison-wesley, ISBN 0-201-12647-4, Redwood City, US


PowerWorld Corporation (2010). http://www.powerworld.com

Siemens, PTI. (2005).

http://www.energy.siemens.com/us/en/services/powertransmission-

distribution/power-technologies-international/softwaresolutions/pss-e.htm


University of Washington electrical engineering. (1999). 14 Bus, In: Power Systems Test Case Archive, 25.01.2011, Available from

http://www.ee.washington.edu/research/pstca/.

**12** 

**Application of Modern Optimal Control in** 

The occurrence of several incidents in different countries during the seventies and the eighties promoted investigations into the cause of turbine-generator torsional excitation and the effect of the stimulated oscillations on the machine shaft. The best known incidents are the two shaft failures that occurred in the Mohave station in Nevada in 1970 and 1971, which were caused by sub-synchronous resonance (SSR) (Walker et al., 1975; Hall et al., 1976). A major concern associated with fixed series capacitor is the SSR phenomenon which arises as a result of the interaction between the compensated transmission line and turbinegenerator shaft. This results in excessively high oscillatory torque on machine shaft causing their fatigue and damage. These failures were caused by sub-synchronous oscillations due to the SSR between the turbine-generator (T-G) shaft system and the series compensated transmission network. These incidents and others captured the attention of the industry at large and stimulated greater interest in the interaction between power plants and electric systems (IEEE committee report, 1992; IEEE Torsional Issues Working Group, 1997;

Torsional interaction involves energy interchange between the turbine-generator and the electric network. Therefore, the analysis of SSR requires the representation of both the electromechanical dynamics of the generating unit and the electromagnetic dynamics of the transmission network. As a result, the dynamic system model used for SSR studies is of a higher order and greater stiffness than the models used for stability studies. Eigenvalue analysis is used in this research. Eigenvalue analysis is performed with the network and the generator modelled by a system of linear simultaneous differential equations. The differential and algebraic equations which describe the dynamic performance of the synchronous machine and the transmission network are, in general, nonlinear. For the purpose of stability analysis, these equations may be linearized by assuming that a disturbance is considered to be small. Small-signal analysis using linear techniques provides valuable information about the inherent dynamic characteristics of the power system and

In this research, two innovative methods are proposed to improve the performance of linear optimal control for mitigation of sub-synchronous resonance in power systems. At first, a technique is introduced based on shifting eigenvalues of the state matrix of system to the left

**1. Introduction** 

Anderson et al., 1990; Begamudre, 1997).

assists in its design (Cross et al., 1982; Parniani & Iravani, 1995).

**Power System: Damping Detrimental** 

**Sub-Synchronous Oscillations**

*Islamic Azad University, Gonabad Branch* 

*Islamic Republic of Iran* 

Iman Mohammad Hoseiny Naveh and Javad Sadeh


## **Application of Modern Optimal Control in Power System: Damping Detrimental Sub-Synchronous Oscillations**

Iman Mohammad Hoseiny Naveh and Javad Sadeh *Islamic Azad University, Gonabad Branch Islamic Republic of Iran* 

#### **1. Introduction**

300 MATLAB for Engineers – Applications in Control, Electrical Engineering, IT and Robotics

Y. Yamura, K. Sakamoto, Y. Tayama, "Voltaje Instability Proximity Index baesd on Multiple

IEEE Conference on Decision and Control, Austin, Texas, December 1988 Zimmerman, R., Murillo, C., & Gan, D. (2011). MATPOWER, In: A MATLAB Power System

Simulation Package, 15.03.2011, Available from:

http://www.pserc.cornell.edu/matpower/

Load Flor Solutions in Ill-Conditioned Power Systems". Proceedings of the 27th

The occurrence of several incidents in different countries during the seventies and the eighties promoted investigations into the cause of turbine-generator torsional excitation and the effect of the stimulated oscillations on the machine shaft. The best known incidents are the two shaft failures that occurred in the Mohave station in Nevada in 1970 and 1971, which were caused by sub-synchronous resonance (SSR) (Walker et al., 1975; Hall et al., 1976). A major concern associated with fixed series capacitor is the SSR phenomenon which arises as a result of the interaction between the compensated transmission line and turbinegenerator shaft. This results in excessively high oscillatory torque on machine shaft causing their fatigue and damage. These failures were caused by sub-synchronous oscillations due to the SSR between the turbine-generator (T-G) shaft system and the series compensated transmission network. These incidents and others captured the attention of the industry at large and stimulated greater interest in the interaction between power plants and electric systems (IEEE committee report, 1992; IEEE Torsional Issues Working Group, 1997; Anderson et al., 1990; Begamudre, 1997).

Torsional interaction involves energy interchange between the turbine-generator and the electric network. Therefore, the analysis of SSR requires the representation of both the electromechanical dynamics of the generating unit and the electromagnetic dynamics of the transmission network. As a result, the dynamic system model used for SSR studies is of a higher order and greater stiffness than the models used for stability studies. Eigenvalue analysis is used in this research. Eigenvalue analysis is performed with the network and the generator modelled by a system of linear simultaneous differential equations. The differential and algebraic equations which describe the dynamic performance of the synchronous machine and the transmission network are, in general, nonlinear. For the purpose of stability analysis, these equations may be linearized by assuming that a disturbance is considered to be small. Small-signal analysis using linear techniques provides valuable information about the inherent dynamic characteristics of the power system and assists in its design (Cross et al., 1982; Parniani & Iravani, 1995).

In this research, two innovative methods are proposed to improve the performance of linear optimal control for mitigation of sub-synchronous resonance in power systems. At first, a technique is introduced based on shifting eigenvalues of the state matrix of system to the left

Application of Modern Optimal Control in Power

transmission line is given by:

system by below equations:

**2.2 Mechanical system** 

second benchmark model.

**2.3 Combined power system model** 

electrical system and mechanical system.

System: Damping Detrimental Sub-Synchronous Oscillations 303

*<sup>U</sup>* [ ] *VO <sup>g</sup> <sup>g</sup> <sup>E</sup> <sup>T</sup>* <sup>Δ</sup> *Gen* <sup>=</sup> <sup>Δ</sup> <sup>Δ</sup>δ ΔωΔ

Where, ∆VO is variation of infinitive bus voltage. In addition to the synchronous generator, the system also contains the compensated transmission line. The linearized model of

<sup>Δ</sup>*<sup>X</sup> Line* <sup>=</sup> *ALine*Δ*<sup>X</sup> Line* <sup>+</sup> *BLine*Δ*ULine*

*<sup>T</sup>* <sup>Δ</sup>*XLine* <sup>=</sup> <sup>Δ</sup>*<sup>V</sup>* <sup>Δ</sup>*<sup>V</sup>*

*T Line* Δ*U* = Δ*i* Δ*i*

To obtain the electrical system, we can combine (1–7). Finally we can illustrate electrical

[ ] *Cd Cq*

[ ] *d q*

[ ] *<sup>T</sup>*

[ ] *<sup>T</sup> Gen*

*T Gen*

The shaft system of the T-G set is represented by four rigid masses. The linearized model of

[ ] Δ = Δ

Parameters P1 – P5 can simplicity be founded by combination of electrical and mechanical system (Fig 2). Fig.3 illustrates the shaft system of the turbine-generator (T-G) in IEEE

The combined power system model is obtained by combining the linearized equations of the

the shaft system, based on a mass-spring-damping model is:

δ1 Δω1 Δδ *g* Δω*g* Δδ2 Δω2 Δδ3 Δω3

The variation of electrical torque is denoted by ΔTe and is given by:

Let us define a state vector as ΔXSysT = [ΔXElT ΔXMechT]. So we can write:

*Line*

<sup>Δ</sup>*<sup>X</sup> Mech* <sup>=</sup> *AM* <sup>Δ</sup>*<sup>X</sup> Mech* <sup>+</sup> *BM*1Δ*UM*<sup>1</sup> <sup>+</sup> *BM* <sup>2</sup>Δ*UM* <sup>2</sup> (11)

*<sup>T</sup> XMech* (12)

*<sup>e</sup> fd <sup>d</sup> <sup>q</sup> kd kq* <sup>Δ</sup>*<sup>T</sup>* <sup>=</sup> *<sup>P</sup>* .Δ*<sup>i</sup>* <sup>+</sup> *<sup>P</sup>* .Δ*<sup>i</sup>* <sup>+</sup> *<sup>P</sup>* .Δ*<sup>i</sup>* <sup>+</sup> *<sup>P</sup>* .Δ*<sup>i</sup>* <sup>+</sup> *<sup>P</sup>* .Δ*<sup>i</sup>* <sup>1</sup> <sup>2</sup> <sup>3</sup> <sup>4</sup> <sup>5</sup> (14)

<sup>Δ</sup>*XEl* <sup>=</sup> *AEl*Δ*XEl* <sup>+</sup> *BEl*Δ*UEl* (8)

*<sup>T</sup>* <sup>Δ</sup>*<sup>X</sup> El* <sup>=</sup> <sup>Δ</sup>*<sup>X</sup>* <sup>Δ</sup>*<sup>X</sup>* (9)

*<sup>T</sup>* <sup>Δ</sup>*UEl* <sup>=</sup> <sup>Δ</sup>*<sup>U</sup>* (10)

[ ] *<sup>m</sup> <sup>e</sup> <sup>T</sup>* <sup>Δ</sup>*UMech* <sup>=</sup> <sup>Δ</sup>*<sup>T</sup>* <sup>Δ</sup>*<sup>T</sup>* (13)

(4)

(5)

(6)

(7)

hand-side of s plane. It is found that this proposed controller is an extended state of linear optimal controller with determined degree of stability. So this method is called extended optimal control. A proposed design, which is presented in this paper, has been developed in order to control of severe sub-synchronous oscillations in a nearby turbine-generator. The proposed strategy is tested on second benchmark model and compared with the optimal full-state feedback method by means of simulation. It is shown that this method creates more suitable damping for these oscillations.

In some of genuine applications, measurement of all state variables is impossible and uneconomic. Therefore in this chapter, another novel strategy is proposed by using optimal state feedback, based on the reduced – order observer structure. It was shown also that the Linear Observer Method can mitigate Sub-synchronous Oscillations (SSO) in power systems. The proposed methods are applied to the IEEE Second Benchmark system for SSR studies and the results are verified based on comparison with those obtained from digital computer simulation by MATLAB.

#### **2. System model**

The system under study is shown in Fig. 1. This is the IEEE Second benchmark model, with a fixed series capacitor connected to it. This system is adopted to explain and demonstrate applications of the proposed method for investigation of the single-machine torsional oscillations. The system includes a T-G unit which is connected through a radial series compensated line to an infinite bus. The rotating mechanical system of the T-G set is composed of two turbine sections, the generator rotor and a rotating exciter (Harb & Widyan, 2003).

Fig. 1. Schematic diagram of the IEEE Second Benchmark System.

#### **2.1 Electrical system**

Using direct, quadrate (d-q axes) and Park's transformation, the complete mathematical model that describes the dynamics of the synchronous generator system:

$$
\Delta \dot{X}\_{Gen} = A\_G \Delta X\_{Gen} + B\_{G1} \Delta U\_1 + B\_{G2} \Delta U\_2 + B\_{G3} \Delta U\_3 + B\_{G4} \Delta U\_4 \tag{1}
$$

$$
\Delta \mathbf{y}\_{Gen} = C\_G \Delta X\_{Gen} \tag{2}
$$

Where, CG is an identity matrix. The following state variables and input parameters are used in (1):

$$
\Delta X\_{Gen} \stackrel{T}{=} \begin{bmatrix} \Delta i\_{fd} & \Delta i\_d & \Delta i\_{kd} & \Delta i\_q & \Delta i\_{kq} \end{bmatrix} \tag{3}
$$

hand-side of s plane. It is found that this proposed controller is an extended state of linear optimal controller with determined degree of stability. So this method is called extended optimal control. A proposed design, which is presented in this paper, has been developed in order to control of severe sub-synchronous oscillations in a nearby turbine-generator. The proposed strategy is tested on second benchmark model and compared with the optimal full-state feedback method by means of simulation. It is shown that this method creates

In some of genuine applications, measurement of all state variables is impossible and uneconomic. Therefore in this chapter, another novel strategy is proposed by using optimal state feedback, based on the reduced – order observer structure. It was shown also that the Linear Observer Method can mitigate Sub-synchronous Oscillations (SSO) in power systems. The proposed methods are applied to the IEEE Second Benchmark system for SSR studies and the results are verified based on comparison with those obtained from digital

The system under study is shown in Fig. 1. This is the IEEE Second benchmark model, with a fixed series capacitor connected to it. This system is adopted to explain and demonstrate applications of the proposed method for investigation of the single-machine torsional oscillations. The system includes a T-G unit which is connected through a radial series compensated line to an infinite bus. The rotating mechanical system of the T-G set is composed of two turbine sections, the generator rotor and a rotating exciter (Harb &

RL1

RT , XT

more suitable damping for these oscillations.

computer simulation by MATLAB.

**2. System model** 

Widyan, 2003).

XL1

XC

XL2

Using direct, quadrate (d-q axes) and Park's transformation, the complete mathematical

Where, CG is an identity matrix. The following state variables and input parameters are used

[ ] *fd d kd q kq*

RL2

model that describes the dynamics of the synchronous generator system:

*T*

Fig. 1. Schematic diagram of the IEEE Second Benchmark System.

RSYS XSYS

<sup>Δ</sup>*XGen* <sup>=</sup> *AG*Δ*XGen*+*BG*1Δ*U*<sup>1</sup> <sup>+</sup>*BG*2Δ*U*<sup>2</sup> <sup>+</sup> *BG*3Δ*U*<sup>3</sup> <sup>+</sup>*BG*4Δ*U*<sup>4</sup> (1)

*Gen CG <sup>X</sup> Gen* <sup>Δ</sup>*<sup>y</sup>* <sup>=</sup> <sup>Δ</sup> (2)

*Gen* <sup>Δ</sup>*<sup>X</sup>* <sup>=</sup> <sup>Δ</sup>*<sup>i</sup>* <sup>Δ</sup>*<sup>i</sup>* <sup>Δ</sup>*<sup>i</sup>* <sup>Δ</sup>*<sup>i</sup>* <sup>Δ</sup>*<sup>i</sup>* (3)

Infinite Bus

**~** 

**2.1 Electrical system** 

in (1):

i

$$
\Delta U\_{Gen} \stackrel{T}{=} \begin{bmatrix} \Delta V\_O & \Delta \delta\_{\mathfrak{g}} & \Delta a\_{\mathfrak{g}} & \Delta E \end{bmatrix} \tag{4}
$$

Where, ∆VO is variation of infinitive bus voltage. In addition to the synchronous generator, the system also contains the compensated transmission line. The linearized model of transmission line is given by:

$$
\Delta \dot{X}\_{Line} = A\_{Line} \Delta X\_{Line} + B\_{Line} \Delta U\_{Line} \tag{5}
$$

$$
\Delta X\_{L\text{-}line} ^T = \begin{bmatrix} \Delta V\_{Cd} & \Delta V\_{Cq} \end{bmatrix} \tag{6}
$$

$$
\Delta U\_{L\delta n\epsilon} \stackrel{T}{=} \begin{bmatrix} \Delta \dot{\imath}\_d & \Delta \dot{\imath}\_q \end{bmatrix} \tag{7}
$$

To obtain the electrical system, we can combine (1–7). Finally we can illustrate electrical system by below equations:

$$
\Delta \dot{X}\_{El} = A\_{El} \Delta X\_{El} + B\_{El} \Delta U\_{El} \tag{8}
$$

$$
\Delta X\_{EI}^{\;T} = \begin{bmatrix} \Delta X\_{Gen} \; ^T & \Delta X\_{Line} \; ^T \end{bmatrix} \tag{9}
$$

$$
\Delta U\_{El}\,^T = \begin{bmatrix} \Delta U\_{Gen}\,^T \end{bmatrix} \tag{10}
$$

#### **2.2 Mechanical system**

The shaft system of the T-G set is represented by four rigid masses. The linearized model of the shaft system, based on a mass-spring-damping model is:

$$
\Delta \dot{X}\_{Mech} = A\_M \Delta X\_{Mech} + B\_{M1} \Delta U\_{M1} + B\_{M2} \Delta U\_{M2} \tag{11}
$$

$$
\Delta X\_{Mech} \stackrel{T}{=} \begin{vmatrix} \Delta \delta\_1 & \Delta q & \Delta \delta\_\mathbf{g} & \Delta a \mathbf{g} & \Delta \delta\_2 & \Delta a \mathbf{g} & \Delta \delta\_3 & \Delta a \mathbf{g} \end{vmatrix} \tag{12}
$$

$$
\Delta U\_{Mech}\overset{T}{h} = \begin{bmatrix} \Delta T\_m & \Delta T\_e \end{bmatrix} \tag{13}
$$

The variation of electrical torque is denoted by ΔTe and is given by:

$$
\Delta T\_{\rm e} = P\_1 \Delta i\_{fd} + P\_2 \Delta i\_{d} + P\_3 \Delta i\_q + P\_4 \Delta i\_{kd} + P\_5 \Delta i\_{kq} \tag{14}
$$

Parameters P1 – P5 can simplicity be founded by combination of electrical and mechanical system (Fig 2). Fig.3 illustrates the shaft system of the turbine-generator (T-G) in IEEE second benchmark model.

#### **2.3 Combined power system model**

The combined power system model is obtained by combining the linearized equations of the electrical system and mechanical system.

Let us define a state vector as ΔXSysT = [ΔXElT ΔXMechT]. So we can write:

$$
\Delta \dot{X}\_{Sys} = A\_{Sys} \Delta X\_{Sys} + B\_{Sys} \Delta U\_{Sys} \tag{15}
$$

$$
\Delta \mathcal{U}\_{Sys} \stackrel{\textstyle T}{=} \begin{bmatrix} \Delta T\_m & \Delta E \end{bmatrix} \tag{16}
$$

Application of Modern Optimal Control in Power

benchmark model.

**3. Modern optimal control** 

System: Damping Detrimental Sub-Synchronous Oscillations 305

Fig. 3. Schematic diagram of the shaft system of the turbine-generator IEEE second

Sedigh, 2003; Ogata, 1990; Friedland, 1989; Kwakernaak, 1972):

It is given by the feedback control law in terms of system states:

Where P is the solution of Riccati equation:

**3.1 Extended optimal control** 

Optimal control must be employed in order to damp out the sub-synchronous oscillations resulting from the negatively damped mode. For the linear system, the control signal U which minimizes the performance index (Zhu et al., 1996; Patel & Munro, 1982; Khaki

[ ] () () ( ) *T T*

1 . . *<sup>T</sup> KR B P Sys*

<sup>1</sup> .. . . 0 *T T A P PA PB R B P Q Sys Sys Sys Sys*

In this chapter, a strategy is proposed, based on shifting eigenvalues of the state matrix of system to the left hand-side of s plane, for damping all sub-synchronous torsional

*Sys Sys Sys Sys J x t Q x t u R u t dt* = Δ Δ +Δ Δ <sup>μ</sup> (17)

*Ut K x t* () () =− ⋅Δ *Sys* (18)

<sup>−</sup> + − <sup>μ</sup> + = (20)

<sup>−</sup> = <sup>μ</sup> (19)

Fig. 2. Schematic diagram of calculation of Te

Δ = Δ +Δ *X AX BU Sys Sys Sys Sys Sys*

Fig. 2. Schematic diagram of calculation of Te

(15)

[ ] *<sup>T</sup>* Δ =Δ Δ *U TE Sys m* (16)

Fig. 3. Schematic diagram of the shaft system of the turbine-generator IEEE second benchmark model.

#### **3. Modern optimal control**

Optimal control must be employed in order to damp out the sub-synchronous oscillations resulting from the negatively damped mode. For the linear system, the control signal U which minimizes the performance index (Zhu et al., 1996; Patel & Munro, 1982; Khaki Sedigh, 2003; Ogata, 1990; Friedland, 1989; Kwakernaak, 1972):

$$J = \int [\Delta \mathbf{x}\_{Sys} \,^T \{ t \} \mathbf{Q} \Delta \mathbf{x}\_{Sys} \, \{ t \} + \Delta \mu\_{Sys} \,^T R\_{\mu} \Delta \mu\_{Sys} \, \{ t \}] dt \tag{17}$$

It is given by the feedback control law in terms of system states:

$$
\Delta U(t) = -K \cdot \Delta \mathbf{x}\_{\text{Sys}}(t) \tag{18}
$$

$$K = R\_{\mu} \prescript{-1}{}{B}\_{Sys} \prescript{T}{}{P} \tag{19}$$

Where P is the solution of Riccati equation:

$$A\_{Sys}{}^T.P + P.A\_{Sys} - P.B\_{Sys}R\_\mu{}^{-1}B\_{Sys}{}^T.P + Q = 0\tag{20}$$

#### **3.1 Extended optimal control**

In this chapter, a strategy is proposed, based on shifting eigenvalues of the state matrix of system to the left hand-side of s plane, for damping all sub-synchronous torsional oscillations. In order to have a complete research, optimal full state feedback control is designed and the results are compared with extended optimal control as proposed method. It is found that we can design linear optimal controller to obtain special degree of stability in optimal closed loop system by using this method. In the other hand, we can design a new controller that it transfers all of poles of optimal closed loop system to the left hand-side of – α (a real value) in S plane. For a linear system by (15), we can rewrite the performance index using proposed method:

$$J = \int e^{2at} . [\Delta \mathbf{x}\_{Sys} \, ^T(t) Q \Delta \mathbf{x}\_{Sys} \, (t) + \Delta u\_{Sys} \, ^T R\_{\mu} \Delta u\_{Sys} \, (t)] dt \tag{21}$$

For the linear system the control signal U which minimizes the performance index is given by the feedback control law in terms of system states:

$$
\Delta I\_{\alpha} \left( t \right) = -K\_{\alpha} \cdot \Delta \mathbf{x}\_{Sys} \left( t \right) \tag{22}
$$

Application of Modern Optimal Control in Power

The solution of Riccati equation in this case is equal to:

31). Finally the optimal controller is given by:

**3.2 Reduced order observer** 

*P*α

And then the state matrix of optimal closed loop system (Aα) is obtained by:

2 .

*A A I BK* α α *<sup>n</sup>*

that both of them shift to the left hand-side of –α (α=2) in S plane.

reduced-order observer with state vector of z(t), is given by:

By assumption full rank [CTotalT LT] T, we can get:

α α

chose α=2. Suppose that

System: Damping Detrimental Sub-Synchronous Oscillations 307

Where X=[x1(t) x2(t)]T and U=[µ1(t) µ2(t)]T. We want to design an optimal controller in which the closed-loop system achieves to a favourite prescribed degree of stability. In this case, we

> 3.9316 1.1265 1.1265 4.4462

<sup>=</sup>

To obtain the feedback control law in terms of system states, we can combine (23) with (29 –

( ) ( ) ( ) <sup>1</sup> 3.9316 1.1265 ... . 1.1265 4.4462 *<sup>T</sup> U t R B P xt x t* <sup>−</sup>

− − =+ − =

So the poles of optimal closed loop system are located in -3.7321and -4.6458. It can be seen

The Luenberger reduced-order observer is used as a linear observer in this paper. The block diagram of this reduced-order observer is shown in Fig. 3. For the controllable and observable system that is defined by (15), there is an observer structure with size of (n-1). The size of state vector is n and output vector is l. The dynamic system of Luenberger

To determine L, T and R is basic goal in reduced-order observer. In this method, the estimated state vector ( ) <sup>ˆ</sup> <sup>Δ</sup>*X t Total* includes two parts. First one will obtain by measuring

( ) ( ) <sup>ˆ</sup> . *Total Total*

∆yTotal(t) and the other one will obtain by estimating ∆z(t) from (34). We can take:

( )

*y t C*

*z t L*

3.9316 0.1265

1.1265 4.4462

() () . *Total* Δ =Δ *zt L x t* (34)

() () () () .. . *Total Total z t Dz t Ty t Ru t* =+ + (35)

<sup>Δ</sup> = Δ <sup>Δ</sup> (36)

*Total*

*X t*

− −

− − = − <sup>=</sup>

1 1 1 0 , 1 1 0 1 *Q R* = = (30)

− − (32)

(31)

(33)

$$K\_{\alpha} = R\_{\mu}^{-1} \, \_{\text{\tiny}}B\_{\text{\tiny}gs} \, ^{T}P\_{\alpha} \tag{23}$$

Where Pα is the solution of Riccati equation in this case:

$$\left(\left(A\_{\rm Sys} + \alpha I\_n\right)^T.P\_\alpha + P\_\alpha.\left(A\_{\rm Sys} + \alpha I\_n\right) - P\_\alpha.B\_{\rm Sys}R\_\mu^{-1}B\_{\rm Sys}^{\tag{7}}.P\_\alpha + Q = 0\tag{24}$$

Where In is an n×n identity matrix. So the state matrix of optimal closed loop system (Aα) is obtained by below:

$$\left(\left(A\_{\rm Sys} + \alpha I\_n\right)^T.P\_\alpha + P\_\alpha.\left(A\_{\rm Sys} + \alpha I\_n\right) - P\_\alpha.B\_{\rm Sys}.R\_\mu\right.^{-1}B\_{\rm Sys}\,^T.P\_\alpha + Q = 0\tag{25}$$

In order to be asymptotically stable for Aα, we can write:

$$
\lambda\_i(A\_\alpha) = \lambda\_i(A\_{\rm Sgs} + \alpha I\_n - B\_{\rm Sgs}.K\_\alpha) = \lambda\_i(A\_{\rm Sgs} - B\_{\rm Sgs}.K\_\alpha) + \alpha \tag{26}
$$

Where λi(Aα) is eigenvalues of Aα for i=1,2,…,n. Because of Re[λi(Aα)] <0, we can write :

$$\operatorname{Re}\left[\lambda\_i(A\_{\alpha})\right] = \operatorname{Re}\left[\lambda\_i(A\_{\text{Sys}} - B\_{\text{Sys}}.K\_{\alpha}) + \alpha\right] = \operatorname{Re}\left[\lambda\_i(A\_{\text{Sys}} - B\_{\text{Sys}}.K\_{\alpha})\right] + \alpha < 0 \tag{27}$$

So we can write:

$$\operatorname{Re}\left[\lambda\_i(A\_{Sys} - B\_{Sys}K\_\alpha)\right] < -\alpha \tag{28}$$

In the other hand, all of eigenvalues of (ASys-BSys.Kα) are located on the left hand-side of –α in S plane. So the control signal U, which minimizes the performance index in (21), can create a closed lope system with determined degree of stability.

#### **3.1.1 Numeral sample**

This subsection gives a dimensional example in which the controllable system is to be designed in according to the proposed method. Suppose the nominal plant used for design of the controller is:

$$\frac{d}{dt}X = \begin{bmatrix} 0 & 1\\ 0 & 0 \end{bmatrix} X + \begin{bmatrix} 1 & 0\\ 0 & 1 \end{bmatrix} U \tag{29}$$

oscillations. In order to have a complete research, optimal full state feedback control is designed and the results are compared with extended optimal control as proposed method. It is found that we can design linear optimal controller to obtain special degree of stability in optimal closed loop system by using this method. In the other hand, we can design a new controller that it transfers all of poles of optimal closed loop system to the left hand-side of – α (a real value) in S plane. For a linear system by (15), we can rewrite the performance index

() () ( ) <sup>2</sup> .[ ] *t T <sup>T</sup>*

For the linear system the control signal U which minimizes the performance index is given

1 . . *<sup>T</sup> K RB P Sys* −

<sup>1</sup> ( ) . .( ) . . 0 *T T A I P P A I PB R B P Q Sys n Sys n Sys Sys*

Where In is an n×n identity matrix. So the state matrix of optimal closed loop system (Aα) is

<sup>1</sup> ( ) . .( ) . . 0 *T T A I P P A I PB R B P Q Sys n Sys n Sys Sys*

Where λi(Aα) is eigenvalues of Aα for i=1,2,…,n. Because of Re[λi(Aα)] <0, we can write :

In the other hand, all of eigenvalues of (ASys-BSys.Kα) are located on the left hand-side of –α in S plane. So the control signal U, which minimizes the performance index in (21), can

This subsection gives a dimensional example in which the controllable system is to be designed in according to the proposed method. Suppose the nominal plant used for design

> 01 10 . . 00 01 *<sup>d</sup> X XU*

 = +

*Sys Sys Sys Sys J e x t Q x t u R u t dt* <sup>α</sup> = Δ Δ +Δ Δ <sup>μ</sup> (21)

<sup>−</sup> +α + +α − α α αμ α + = (24)

<sup>−</sup> +α + +α − α α αμ α + = (25)

() ( .) ( .) λ =λ +α − =λ − +α *<sup>i</sup> A A I BK A BK* α αα *i Sys n Sys i Sys Sys* (26)

Re[ ( . )] λ − < −α *i Sys Sys A BK*<sup>α</sup> (28)

(29)

Re[ ( )] Re[ ( . ) ] Re[ ( . )] 0 λ = λ − +α = λ − +α< *<sup>i</sup> A A BK A BK* αα α *i Sys Sys i Sys Sys* (27)

( ) ( ) *Ut K x t* α α =− ⋅Δ *Sys* (22)

<sup>α</sup> = <sup>μ</sup> <sup>α</sup> (23)

using proposed method:

obtained by below:

So we can write:

**3.1.1 Numeral sample** 

of the controller is:

by the feedback control law in terms of system states:

Where Pα is the solution of Riccati equation in this case:

In order to be asymptotically stable for Aα, we can write:

create a closed lope system with determined degree of stability.

*dt*

Where X=[x1(t) x2(t)]T and U=[µ1(t) µ2(t)]T. We want to design an optimal controller in which the closed-loop system achieves to a favourite prescribed degree of stability. In this case, we chose α=2. Suppose that

$$Q = \begin{bmatrix} 1 & 1 \\ 1 & 1 \end{bmatrix} \qquad , \qquad R = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} \tag{30}$$

The solution of Riccati equation in this case is equal to:

$$P\_{\alpha} = \begin{bmatrix} 3.9316 & 1.1265 \\ 1.1265 & 4.4462 \end{bmatrix} \tag{31}$$

To obtain the feedback control law in terms of system states, we can combine (23) with (29 – 31). Finally the optimal controller is given by:

$$\mathcal{U}\_{\alpha}(t) = -\boldsymbol{R}^{-1} \boldsymbol{.} \boldsymbol{B}^{T} . P\_{\alpha} \boldsymbol{x}(t) = \begin{bmatrix} -3.9316 & -1.1265 \\ -1.1265 & -4.4462 \end{bmatrix} \boldsymbol{x}(t) \tag{32}$$

And then the state matrix of optimal closed loop system (Aα) is obtained by:

$$A\_{\alpha} = A + 2I\_n - B.K\_{\alpha} = \begin{bmatrix} -3.9316 & -0.1265 \\ -1.1265 & -4.4462 \end{bmatrix} \tag{33}$$

So the poles of optimal closed loop system are located in -3.7321and -4.6458. It can be seen that both of them shift to the left hand-side of –α (α=2) in S plane.

#### **3.2 Reduced order observer**

The Luenberger reduced-order observer is used as a linear observer in this paper. The block diagram of this reduced-order observer is shown in Fig. 3. For the controllable and observable system that is defined by (15), there is an observer structure with size of (n-1). The size of state vector is n and output vector is l. The dynamic system of Luenberger reduced-order observer with state vector of z(t), is given by:

$$
\Delta z(t) = L.\Delta x\_{Total}(t)\tag{34}
$$

$$\dot{z}\left(t\right) = D.z\left(t\right) + T.y\_{Total}\left(t\right) + R.\mu\_{Total}\left(t\right)\tag{35}$$

To determine L, T and R is basic goal in reduced-order observer. In this method, the estimated state vector ( ) <sup>ˆ</sup> <sup>Δ</sup>*X t Total* includes two parts. First one will obtain by measuring ∆yTotal(t) and the other one will obtain by estimating ∆z(t) from (34). We can take:

$$
\begin{bmatrix}
\Delta y\_{Total}(t) \\
\Delta z(t)
\end{bmatrix} = \begin{bmatrix}
\mathbf{C}\_{Total} \\
L
\end{bmatrix} \Delta \hat{X}\_{Total}(t) \tag{36}
$$

By assumption full rank [CTotalT LT] T, we can get:

$$
\Delta \hat{X}\_{Total} \left( t \right) = \begin{bmatrix} \mathbf{C}\_{Total} \\ L \end{bmatrix}^{-1} \cdot \begin{bmatrix} \Delta y\_{Total} \left( t \right) \\ \Delta z \left( t \right) \end{bmatrix} \tag{37}
$$

Application of Modern Optimal Control in Power

Combine (35) and (36), we get:

**3.2.1 Numeral sample** 

*dt*

**4. Simulation results** 

transmission line (XL1=0.48 P.u).

The following cases are considered for the analysis.

simulations.

1982):

is defined as:

System: Damping Detrimental Sub-Synchronous Oscillations 309

Dynamic error between linear combination of states of L.∆XTotal(t) system and observer ∆z(t)

( ) . .. <sup>2</sup> ( ) . <sup>0</sup> *X t Total A B K B KF Total Total Total X t Total e D e* <sup>Δ</sup> − − <sup>Δ</sup> <sup>=</sup>

For stability of the observer dynamic system, the eigenvalues of D must lie in the left hand-

The longitudinal equations of an aircraft are presented in steady state format (Rynaski,

0 1 0 0 0 010 0

*v t a gb d t a a b*

<sup>Δ</sup> α − <sup>α</sup> <sup>=</sup> − δ <sup>θ</sup>

Where Δv is variation of velocity, α is angle of attack, θ is pitch angle, δe is elevator angle

( ) ( ) ( )

( ) <sup>1000</sup> <sup>0100</sup> *<sup>y</sup> X t* <sup>=</sup>

So Δv and α are measurable state variables. Therefor we can get final result by MATLAB

Eigenvalue analysis is a fast and well-suited technique for defining behavioral trends in a system that can provide an immediate stability test. The real parts of the eigenvalue represent the damping mode of vibration, a positive value indicating instability, while the

As mentioned earlier, the system considered here is the IEEE second benchmark model. It is assumed that the fixed capacitive reactance (XC) is 81.62% of the reactance of the

The simulation studies of IEEE-SBM carried out on MATLAB platform is discussed here.

−− − − − <sup>−</sup> <sup>=</sup> − δ −− −

*<sup>d</sup> X t X t <sup>t</sup>*

0.0507 3.861 0 9.8 0 0.00117 0.5164 1 0 0.0717 0.000129 1.4168 0.4932 0 1.645 0 0 10 0

*dt t aaa b*

11 12 1 21 22 2 31 32 33 3

side of s plane. By choosing D, we can calculate L, T and R (Luenberger, 1971).

( ) ( ) ( ) ( )

*q t*

and q is pitch rate. This equation in special state is presented by:

imaginary parts denote the damped natural frequency of oscillation.

() () () . *Total et zt L X t* =Δ − Δ (43)

() ()

*xt t*

*e*

*e*

(45)

(46)

(47)

(44)

By definition:

$$
\begin{bmatrix} \mathbf{C}\_{Total} \\ L \end{bmatrix}^{-1} = \begin{bmatrix} F\_1 & F\_2 \end{bmatrix} \tag{38}
$$

We get:

$$
\Delta \hat{X}\_{Total} \left( t \right) = F\_1 \Delta y\_{Total} \left( t \right) + F\_2 \Delta z \left( t \right) \tag{39}
$$

Where:

$$F\_1.C\_{Total} + F\_2.L = I\_n \tag{40}$$

Fig. 4. Shematic Diagram of State Feedback Using Luenberger Reduced Order Observer

Using estimated state variables, the state feedback control law is given by:

$$
\Delta \mathcal{L} I\_{Total} \left( t \right) = -K \Delta \hat{X}\_{Total} \left( t \right) = K . F\_1 . C\_{Total} \Delta X\_{Total} \left( t \right) - K . F\_2 \Delta z \left( t \right) \tag{41}
$$

By assumption R=L.BTotal in (35), descriptive equations of closed loop control system with reduced-order observer are:

$$
\begin{bmatrix}
\Delta \dot{X}\_{Total}(t) \\
\Delta \dot{z}(t)
\end{bmatrix} = \\
\begin{bmatrix}
A\_{Total} - B\_{Total} \, F\_1 \, \mathcal{C}\_{Total} & -B\_{Total} \, K.F\_2 \\
T. \mathcal{C}\_{Total} - L.B\_{Total} \, K.F\_1 \, \mathcal{C}\_{Total} & D - L.B\_{Total} \, K.F\_2
\end{bmatrix} \begin{bmatrix}
\Delta X\_{Total}(t) \\
\Delta z(t)
\end{bmatrix}
$$

Dynamic error between linear combination of states of L.∆XTotal(t) system and observer ∆z(t) is defined as:

$$
\dot{e}(t) = \Delta \dot{z}(t) - L.\Delta \dot{X}\_{Total}(t)\tag{43}
$$

Combine (35) and (36), we get:

308 MATLAB for Engineers – Applications in Control, Electrical Engineering, IT and Robotics

ˆ . *Total Total*

1

Fig. 4. Shematic Diagram of State Feedback Using Luenberger Reduced Order Observer

*The Luenberg's Reduced-order observer*

By assumption R=L.BTotal in (35), descriptive equations of closed loop control system with

1 2 1 2

*A B F C B KF X t TC LB KF C D LB KF z t*

*Total Total Total Total Total*

 − − Δ − − <sup>Δ</sup>

. . . . . . . .. . . ..

*Total Total Total Total*

( ) ( ) 1 2 () () <sup>ˆ</sup> . .. . .. Δ =− Δ = Δ − Δ *U t K X t KF C X t KF z t Total Total Total Total* (41)

(42)

( ) ( )

Using estimated state variables, the state feedback control law is given by:

*u* (*t*)

*PLANT* 

reduced-order observer are:

( ) ( )

*K* 

u

r

*Total*

 Δ <sup>=</sup> <sup>Δ</sup>

*X t z t*

*L* <sup>−</sup> = 

*CTotal F F*

<sup>−</sup> <sup>Δ</sup> Δ = <sup>Δ</sup>

*Total*

By definition:

We get:

Where:

*X t*

( ) ( )

1

*C y t*

*L z t*

[ ]

A

<sup>∫</sup> *<sup>z</sup>*

B C

1 2

( )

() () () 1 2 <sup>ˆ</sup> . . Δ =Δ +Δ *X t F y t F zt Total Total* (39)

1 2 . . *FC FL I Total* + = *<sup>n</sup>* (40)

*y* (*t*)

(37)

(38)

$$
\begin{bmatrix}
\Delta \dot{X}\_{\text{Total}}(t) \\
\dot{e}
\end{bmatrix} = \begin{bmatrix}
A\_{\text{Total}} - B\_{\text{Total}}.K & -B\_{\text{Total}}.K.F\_2 \\
0 & D
\end{bmatrix} \cdot \begin{bmatrix}
\Delta X\_{\text{Total}}(t) \\
e
\end{bmatrix} \tag{44}
$$

For stability of the observer dynamic system, the eigenvalues of D must lie in the left handside of s plane. By choosing D, we can calculate L, T and R (Luenberger, 1971).

#### **3.2.1 Numeral sample**

The longitudinal equations of an aircraft are presented in steady state format (Rynaski, 1982):

$$
\frac{d}{dt} \begin{bmatrix} \Delta v(t) \\ \alpha(t) \\ \Theta(t) \\ q(t) \end{bmatrix} = \begin{bmatrix} a\_{11} & a\_{12} & 0 & -g \\ a\_{21} & a\_{22} & 1 & 0 \\ a\_{31} & a\_{32} & a\_{33} & 0 \\ 0 & 0 & 1 & 0 \end{bmatrix} x(t) - \begin{bmatrix} b\_1 \\ b\_2 \\ b\_3 \\ 0 \end{bmatrix} \delta\_\varepsilon(t) \tag{45}
$$

Where Δv is variation of velocity, α is angle of attack, θ is pitch angle, δe is elevator angle and q is pitch rate. This equation in special state is presented by:

$$\begin{array}{c} \frac{d}{dt} \mathbf{X}(t) = \begin{bmatrix} -0.0507 & -3.861 & 0 & -9.8\\ -0.00117 & -0.5164 & 1 & 0\\ -0.000129 & 1.4168 & -0.4932 & 0\\ 0 & 0 & 1 & 0 \end{bmatrix} \mathbf{X}(t) - \begin{bmatrix} 0\\ -0.0717\\ -1.645\\ 0 \end{bmatrix} \delta\_{\epsilon}(t) \tag{46}$$
 
$$\mathbf{y} = \begin{bmatrix} 1 & 0 & 0 & 0\\ 0 & 1 & 0 & 0 \end{bmatrix} \mathbf{X}(t) \tag{47}$$

So Δv and α are measurable state variables. Therefor we can get final result by MATLAB simulations.

#### **4. Simulation results**

Eigenvalue analysis is a fast and well-suited technique for defining behavioral trends in a system that can provide an immediate stability test. The real parts of the eigenvalue represent the damping mode of vibration, a positive value indicating instability, while the imaginary parts denote the damped natural frequency of oscillation.

As mentioned earlier, the system considered here is the IEEE second benchmark model. It is assumed that the fixed capacitive reactance (XC) is 81.62% of the reactance of the transmission line (XL1=0.48 P.u).

The simulation studies of IEEE-SBM carried out on MATLAB platform is discussed here. The following cases are considered for the analysis.

Application of Modern Optimal Control in Power

**-1.5**

**-0.06 -0.04 -0.02 0 0.02 0.04 0.06 0.08 0.1**

θ

**-1**

**-0.5**

**0**

**0.5**

**q(t)**

**1**

**1.5**

**2**

Fig. 6. Variation of Immeasurable State Variables

**4.2 With proposed controller: Extended optimal control** 

For presentation of the first proposed controller, power system is simulated by extended optimal control with using (20-24). Proposed method is carried out on second benchmark simultaneously. The obtained results have been compared with prevalent optimal control in (17-20) by Fig. 9-(a). It is observed that the proposed method has created more suitable damping for first torsional mode of second benchmark model than prevalent method. As

**<sup>0</sup> 0.2 0.4 0.6 0.8 <sup>1</sup> 1.2 1.4 1.6 1.8 <sup>2</sup> -0.08**

**Time(sec)**

System: Damping Detrimental Sub-Synchronous Oscillations 311

**Immeasurable State Variable**

**Real State Variable Estimated State Variable** 

**0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2**

**Immeasurable State Variable**

Fig. 5. Variation of Measurable State Variables

#### **4.1 Without controller**

In the first Case, second benchmark model is simulated without any controller in initial conditions. Fig. 7 shows the variation of torque of the rotating mechanical system of the T-G set. It can be seen that variations of torque of the mechanical system are severe unstable and then power system tends to approach to the SSR conditions.

The study is carried out with heavily loaded synchronous generator of PG=0.9 p.u, QG=0.43 p.u and Vt=1.138 p.u. Figure. 8 shows the variation of real and imaginary parts of the eigenvalues of ASys with the compensation factor µC=XC/XL1. It can be observed that the first torsional mode is the most unstable modes at µC=81.62%. The unstable range of variation of torsional modes has been illustrated in Fig. 8.

**Measurable State Variable**

**0 1 2 3 4 5 6 7 8 9 10**

**Time (Sec)**

**Measurable State Variable**

In the first Case, second benchmark model is simulated without any controller in initial conditions. Fig. 7 shows the variation of torque of the rotating mechanical system of the T-G set. It can be seen that variations of torque of the mechanical system are severe unstable and

**<sup>0</sup> <sup>1</sup> <sup>2</sup> <sup>3</sup> <sup>4</sup> <sup>5</sup> <sup>6</sup> <sup>7</sup> <sup>8</sup> <sup>9</sup> <sup>10</sup> -0.05**

**Time (Sec)**

The study is carried out with heavily loaded synchronous generator of PG=0.9 p.u, QG=0.43 p.u and Vt=1.138 p.u. Figure. 8 shows the variation of real and imaginary parts of the eigenvalues of ASys with the compensation factor µC=XC/XL1. It can be observed that the first torsional mode is the most unstable modes at µC=81.62%. The unstable range of variation of

Fig. 5. Variation of Measurable State Variables

torsional modes has been illustrated in Fig. 8.

then power system tends to approach to the SSR conditions.

**4.1 Without controller**

**0**

**0.05**

α

**0.1**

**0.15**

**0.2**

**-0.1 -0.05 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4**

Δ**v**

Fig. 6. Variation of Immeasurable State Variables

#### **4.2 With proposed controller: Extended optimal control**

For presentation of the first proposed controller, power system is simulated by extended optimal control with using (20-24). Proposed method is carried out on second benchmark simultaneously. The obtained results have been compared with prevalent optimal control in (17-20) by Fig. 9-(a). It is observed that the proposed method has created more suitable damping for first torsional mode of second benchmark model than prevalent method. As

Application of Modern Optimal Control in Power

**-1**

**100**

**First Torsional Mode**

**200**

**300**

**400**

 **Imaginary Part of Eigenvalues**

**500**

**600**

**700**

**-0.5**

**0**

**0.5**

 **Real Part of Eigenvalues(1/s)**

**1**

**1.5**

**2**

**2.5**

System: Damping Detrimental Sub-Synchronous Oscillations 313

**0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1**

**0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1**

 **Degree of Compensation (** μ**C=XC/XL1 )**

**Second Torsional Mode**

**Unstable Range**

**First Torsional Mode**

**Third Torsional Mode**

**Third Torsional Mode**

**Second Torsional Mode**

**Swing Mode**

 **Compensation Percent(XC/XL1)**

**Supersynchronous Electrical Mode**

**Subsynchronous Electrical Mode** 

Fig. 8. Variation of real and imaginary parts of eigenvalues as a function of µC

similar way, this proposed method has suitable results on second torsional mode. Fig. 9-(b) clearly illustrates this point.

Fig. 10 illustrates variation of torque of the mechanical system in T-G set. It can be observed that the proposed method has more effect on the output of power system than prevalent method.

Fig. 7. Variation of torque of generator – low pressure turbine in the T-G set for µC=81.62% without any controller.

#### **4.3 With proposed controller: Reduced order observer**

In order to have a complete research, optimal full state feedback control is designed and the results are compared with reduced-order method. Some parameters, such as Δikd and Δikq, are not physical variables. ΔVCd and ΔVCq are transmission line parameters that they are not accessible. So let us define:

$$
\Delta \hat{X}\_{Sys} \stackrel{\textstyle T}{=} \begin{bmatrix} \Delta \dot{i}\_{kd} & \Delta \dot{i}\_{kq} & \Delta V\_{Cd} & \Delta V\_{Cq} \end{bmatrix} \tag{48}
$$

$$
\Delta y\_{Sys} \stackrel{T}{=} \begin{bmatrix} \Delta T\_{EXC-GEN} & \Delta T\_{GEN-LP} & \Delta T\_{LP-HP} \end{bmatrix} \tag{49}
$$

Where ΔySysT is used to obtain variation of torque of the rotating mechanical system of the T-G set . Full order observer estimates all the states in a system, regardless whether they are measurable or immeasurable. When some of the state variables are measurable using a reduced-order observer is so better.

In this scenario, proposed method is carried out on second benchmark model simultaneously. The obtained results have been illustrates in Fig. 11. It is observed that the reduced-order method has created a suitable estimation from immeasurable variables that are introduced in (48).

Fig. 12 shows variation of torque of the mechanical system in T-G set. It can be observed that the proposed method has small effect on the output of power system

**2.5**

312 MATLAB for Engineers – Applications in Control, Electrical Engineering, IT and Robotics

similar way, this proposed method has suitable results on second torsional mode. Fig. 9-(b)

Fig. 10 illustrates variation of torque of the mechanical system in T-G set. It can be observed that the proposed method has more effect on the output of power system than prevalent

Fig. 7. Variation of torque of generator – low pressure turbine in the T-G set for µC=81.62%

**0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5**

 **Time(S)**

In order to have a complete research, optimal full state feedback control is designed and the results are compared with reduced-order method. Some parameters, such as Δikd and Δikq, are not physical variables. ΔVCd and ΔVCq are transmission line parameters that they are not

[ ] *<sup>T</sup>*

Where ΔySysT is used to obtain variation of torque of the rotating mechanical system of the T-G set . Full order observer estimates all the states in a system, regardless whether they are measurable or immeasurable. When some of the state variables are measurable using a

In this scenario, proposed method is carried out on second benchmark model simultaneously. The obtained results have been illustrates in Fig. 11. It is observed that the reduced-order method has created a suitable estimation from immeasurable variables that

Fig. 12 shows variation of torque of the mechanical system in T-G set. It can be observed that

the proposed method has small effect on the output of power system

<sup>ˆ</sup> [ ] *<sup>T</sup>* Δ =Δ Δ Δ Δ *X iiVV Sys kd kq Cd Cq* (48)

*Sys EXC GEN GEN LP LP HP* Δ =Δ Δ Δ *yT T T* − −− (49)

**4.3 With proposed controller: Reduced order observer** 

clearly illustrates this point.

without any controller.

**-500 -400 -300 -200 -100 0 100 200 300 400 500**

Δ **T(GEN-LP)**

accessible. So let us define:

reduced-order observer is so better.

are introduced in (48).

method.

Fig. 8. Variation of real and imaginary parts of eigenvalues as a function of µC

Application of Modern Optimal Control in Power

**-8 -6 -4 -2 0 2 4 6 8 10 x 10-4**

**-0.06 -0.05 -0.04 -0.03 -0.02 -0.01 0 0.01 0.02 0.03 0.04**

Δ **T(GEN-LP)**

Δ **T(EXC-GEN)**

System: Damping Detrimental Sub-Synchronous Oscillations 315

**Variation of T(EXC-GEN) Using** α**=0 Variation of T(EXC-GEN) Using** α**=0.5**

**Variation of T(GEN-LP) Using** α**=0 Variation of T(GEN-LP) Using** α**=0.5**

(a)

**0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1**

 **Time(Sec)**

(b)

**0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1**

 **Time(Sec)**

Fig. 10. Variation of torque of exciter-generator (a) and generator-low pressure (b):

(proposed controller), Dotted (prevalent controller).

Fig. 9. Variation of first torsional mode (a) and second mode (b) in IEEE second benchmark to degree of compensation: Dotted (proposed controller), Solid (prevalent controller).

(a)

**First Torsional Mode Using** α**=0.5 First Torsional Mode Using** α**=0**

**Second Torsional Mode Using** α**=0.5 Second Torsional Mode Using** α**=0**

**-3**

**-0.3**

**-0.25**

**-0.2**

**-0.15**

**Real Part of Eigenvalues**

**-0.1**

**-0.05**

**0**

**-2.5**

**-2**

**-1.5**

**Real Part of Eigenvalues**

**-1**

**-0.5**

**0**

**0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1**

**Degree of Compensation (** μ**C=XC/XL1 )**

(b)

**0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1**

**Degree of Compensation (** μ**C=XC/XL1 )**

Fig. 9. Variation of first torsional mode (a) and second mode (b) in IEEE second benchmark to degree of compensation: Dotted (proposed controller), Solid (prevalent controller).

Fig. 10. Variation of torque of exciter-generator (a) and generator-low pressure (b): (proposed controller), Dotted (prevalent controller).

Application of Modern Optimal Control in Power

observer control).

**-0.3 -0.2 -0.1**

**0 0.1 0.2 0.3 0.4**

Δ **T(ECX-GEN)**

**5. Conclusion**

**-0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.5**

Δ **T(GEN-LP)**

synchronous torsional oscillations.

System: Damping Detrimental Sub-Synchronous Oscillations 317

**Optimal Control**

**Optimal Control**

**Optimal Control with Reduced Order Observer**

**Optimal Control with Reduced Order Observer**

Fig. 11. Variation of δg, δ2and δ3: Solid (optimal full state feedback), Dotted (reduced-order

**0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1**

 **Time(sec)**

Fig. 12. Variation of torque of exciter – generator and generator – low pressure turbine in the

**<sup>0</sup> 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 <sup>1</sup> -0.4**

 **Time(sec)**

Fixed capacitors have long been used to increase the steady state power transfer capabilities of transmission lines. A major concern associated with fixed series capacitor is the subsynchronous resonance (SSR) phenomenon which arises as a result of the interaction between the compensated transmission line and turbine-generator shaft. This results in excessively high oscillatory torque on machine shaft causing their fatigue and damage. This chapter presents two analytical methods useful in the study of small-signal analysis of SSR, establishes a linearized model for the power system, and performs the analysis of the SSR using the eigenvalue technique. It is believed that by studying the small-signal stability of the power system, the engineer will be able to find countermeasures to damp all sub-

T-G set: (reduced-order observer control), Solid (optimal full state feedback).

**Optimal Control**

**Optimal Control**

**Optimal Control**

**Optimal Control with Proposed Method**

**Optimal Control with Proposed Method**

**Optimal Control with Proposed Method**

**0 0.5 1 1.5 2 2.5 3**

 **Time(sec)**

**0 0.5 1 1.5 2 2.5 3**

 **Time(sec)**

**0 0.5 1 1.5 2 2.5 3**

 **Time(sec)**

**-0.04 -0.03 -0.02 -0.01 0 0.01 0.02 0.03 0.04**

**-0.02 -0.01 -0 0.01 0.02 0.03 0.04 0.05**

**-0.002 -0.001 0 0.001 0.002 0.003 0.004**

Δδ

**g**

Δδ

**2**

Δδ

**3**

Fig. 11. Variation of δg, δ2and δ3: Solid (optimal full state feedback), Dotted (reduced-order observer control).

Fig. 12. Variation of torque of exciter – generator and generator – low pressure turbine in the T-G set: (reduced-order observer control), Solid (optimal full state feedback).

#### **5. Conclusion**

Fixed capacitors have long been used to increase the steady state power transfer capabilities of transmission lines. A major concern associated with fixed series capacitor is the subsynchronous resonance (SSR) phenomenon which arises as a result of the interaction between the compensated transmission line and turbine-generator shaft. This results in excessively high oscillatory torque on machine shaft causing their fatigue and damage.

This chapter presents two analytical methods useful in the study of small-signal analysis of SSR, establishes a linearized model for the power system, and performs the analysis of the SSR using the eigenvalue technique. It is believed that by studying the small-signal stability of the power system, the engineer will be able to find countermeasures to damp all subsynchronous torsional oscillations.

Application of Modern Optimal Control in Power

**ΔE** Variation of Field Voltage **J** Performance Index

Degree of Stability

Stability

**8. References**

1889

Hill

pp 596-602 , Dec

**ASys** State Matrix for Combined Power System Model **BSys** Input Matrix for Combined Power System Model **ΔUSys** Input Vector for Combined Power System Model

*K* Gain Feedback Vector in Linear Optimal Control

*Publication,* No.CH1066-0-PWR, pp.22-29

*Power Apparatus and Systems,* pp. 150-157

*System*, IEEE Press, New York

*Distrib.,* pp. 613–617, Nov

International (P) Limited, New Delhi

Ogata K. (1990). *Modern Control Engineering,* Prentice–Hall

**P** Solution of Riccati Equation in Linear Optimal Control

System: Damping Detrimental Sub-Synchronous Oscillations 319

*K***<sup>α</sup>** Gain Feedback Vector in Linear Optimal Control with Determined Degree of

**P<sup>α</sup>** Solution of Riccati Equation in Linear Optimal Control with Determined

Walker D.N.; Bowler C.L., Jackson R.L. & Hodges D.A. (1975). Results of sub-synchronous

Hall M.C. & Hodges D.A. (1976). Experience with 500 kV Subsynchronous Resonance and

IEEE Committee report. (1992). Reader's guide to Subsynchronous Resonance. *IEEE on* 

IEEE Torsional Issues Working Group. (1997). Fourth supplement to a bibliography for

Anderson P.M. ; Agrawal B. L. & Van Ness J.E. (1990). *Sub-synchronous Resonance in Power* 

Begamudre R.D. (1997). *Extra High Voltage A.C Transmission Engineering*, New Age

Gross G,; Imparato C. F., & Look P. M. (1982). A tool for comprehensive analysis of power system dynamic stability, *IEEE on Power Apparatus and Systems*, pp. 226–234, Jan Parniani M. & Iravani M. R. (1995). Computer analysis of small-signal stability of power

Harb A.M. & Widyan M.S. (2004). Chaos and bifurcation control of SSR in the IEEE second

Zhu W.; Mohler R.R., Spce R., Mittelstadt W.A. & Mrartukulam D. (1996). Hopf Bifurcation

Friedland B. (1989). *Control System Design : An Introduction to State – Space Methods,* Mc Graw–

benchmark model, *Chaos, Solitons and Fractals*, pp. 537-552. Dec

Patel R.V. & Munro N. (1976). *Multivariable System Theory and Design,* Pergamon Press Khaki Sedigh A. (2003). *Modern control systems,* university of Tehran, Press 2235

Kwakernaak H. & Sivan R. (1972). *Linear Optimal Control Systems,* Wiley- Intersciences Luenberger D.G. (1971). An Introduction to Observers, *IEEE Trans On Automatic Control,* 

systems, *IEEE on Power Apparatus and Systems,* pp. 1276–1282

resonance test at Mohave, *IEEE on Power Apparatus and Systems,* pp. 1878–

Resulting Turbine-Generator Shaft Damage at Mohave Generating Station, *IEEE* 

study of sub-synchronous resonance between rotating machines and power

systems including network dynamics, *Proc. Inst. Elect. Eng. Gener. Transmiss.* 

in a SMIB Power System with SSR, *IEEE Transaction on Power System,* pp. 1579-1584

The first strategy is proposed, based on shifting eigenvalues of the state matrix of system to the left hand-side of s plane, for damping all sub-synchronous torsional oscillations. The proposed method is applied to The IEEE Second Benchmark system for SSR studies and the results are verified based on comparison with those obtained from digital computer simulation by MATLAB. Analysis reveals that the proposed technique gives more appropriate results than prevalent optimal controller. In the practical environment (real world), access to all of the state variables of system is limited and measuring all of them is also impossible. So when we have fewer sensors available than the number of states or it may be undesirable, expensive, or impossible to directly measure all of the states, using a reduced-order observer is proposed. Therefore in this chapter, another novel approach is introduced by using optimal state feedback, based on the Reduced – order observer structure. Analysis reveals that the proposed technique gives good results. It can be concluded that the application of reduced-order observer controller to mitigate SSR in power system will be provided a practical viewpoint. Also this method can be used in a large power system as a local estimator.

#### **6. Acknowledgement**

The authors would like to express their sincere gratitude and appreciations to the Islamic Azad University, Gonabad Branch, as collegiate assistances in all stages of this research.

#### **7. Appendix (Nomenclature)**



#### **8. References**

318 MATLAB for Engineers – Applications in Control, Electrical Engineering, IT and Robotics

The first strategy is proposed, based on shifting eigenvalues of the state matrix of system to the left hand-side of s plane, for damping all sub-synchronous torsional oscillations. The proposed method is applied to The IEEE Second Benchmark system for SSR studies and the results are verified based on comparison with those obtained from digital computer simulation by MATLAB. Analysis reveals that the proposed technique gives more appropriate results than prevalent optimal controller. In the practical environment (real world), access to all of the state variables of system is limited and measuring all of them is also impossible. So when we have fewer sensors available than the number of states or it may be undesirable, expensive, or impossible to directly measure all of the states, using a reduced-order observer is proposed. Therefore in this chapter, another novel approach is introduced by using optimal state feedback, based on the Reduced – order observer structure. Analysis reveals that the proposed technique gives good results. It can be concluded that the application of reduced-order observer controller to mitigate SSR in power system will be provided a practical viewpoint. Also this method can be used in a

The authors would like to express their sincere gratitude and appreciations to the Islamic Azad University, Gonabad Branch, as collegiate assistances in all stages of this research.

large power system as a local estimator.

**7. Appendix (Nomenclature)** 

**Δδg** Variation of Generator Angle

**ΔTm** Variation of Mechanical Torque **ΔTe** Variation of Electrical Torque

**ΔXGen** State Vector for Generator System Model **AG** State Matrix for Generator System Model **BGi** *i*th Input Matrix for Generator System Model **ΔyGen** Output Vector for Generator System Model **ΔUGen** Input Vector for Generator System Model **Δifd** Variation of Field Winding Current

**Δωg** Variation of Angular Velocity of Generator **ΔXMech** State Vector for Mechanical System Model **AM** State Matrix for Mechanical System Model **BMi** *i*th Input Matrix for Mechanical System Model **ΔyMech** Output Vector for Mechanical System Model **ΔUMech** Input Vector for Mechanical System Model

**ΔXLine** State Vector for Transmission Line System **ALine** State Matrix for Transmission Line System **BLine** Input Matrix for Transmission Line System **ΔULine** Input Vector for Transmission Line System **ΔXSys** State Vector for Combined Power System Model

**Δid,Δiq** Variation of Stator Currents in the d-q Reference Frame

**Δikd,Δikq** Variation of Damping Winding Current in the d-q Reference Frame

**6. Acknowledgement**


**A New Approach of Control System** 

**Design for LLC Resonant Converter** 

Peter Drgoňa, Michal Frivaldský and Anna Simonová *University of Žilina, Faculty of Electrical Engineering, Žilina* 

Main task of power semiconductor converter is transfer of electrical energy from its input to the output and to the load. This energy flow is provided by control of the switching process of one or more semiconductor devices. Based on converter application it is necessary to choose correct control algorithm for selected switching frequency of converter. Algorithm itself has to be utilized with suitable hardware platform, whereby through the set of instructions the turn on and turn - of control pulses are generated. Control system also has to secure other important functions for secondary processes. Nowadays a huge number of converter topologies exists, whereby each type should be suited for different conditions of use. For example uninterruptible power supply must generate constant output voltage with constant frequency and constant amplitude for wide range of output power. Converters for electric drive applications have to control their speed through generation of three phase voltage system with configurable amplitude and speed. From mentioned above it is clear to say that for each topology of power converter, the different type of control modulation (PWM - Pulse Width Modulation, PSM - Phase Shift Modulation, FM - Frequency Modulation) and different structure of regulator has to be used. Therefore selection of suitable control system depends on number of various factors, which are output power of converter, type of switching devices,

type of load, possibility of hardware implementation and ways of switching.

discrete form, including effect of sampling and computation delay.

In the field of DC/DC converters for switching power supplies, the main focus is on implementation of digital control, which means use of microcontrollers or DSP with implemented control algorithms and functions for communication with user as well. Analog control systems are well known and its design procedure is mastered, so it is easy to convert analog (continuous) controller into discrete and consequently implementing in microcontroller and DSP. But this approach ignore sample and hold effect of A/D converter and computing time of microprocessor. For proper discrete controller design, the method named direct digital design can be used. This method uses transfer function of converter in

For controller design purposes, transfer function of converter is necessary. This transfer function is based on model of power stage of controller. For PWM converters such as buck, boost, etc. the averaging method is widely used, but for new resonant topologies such as LLC converter, with this averaging method, the control to output transfer function cannot be used. In this chapter, new simulation based method for obtaining the transfer function of converter is discussed. This method uses MATLAB and OrCad PSPICE environments for

**1. Introduction** 

*Slovakia* 

Rynaski E.J. (1982). Flight control synthesis using robust output observers, *Guidance and Control Conference,* pp. 825-831, San Diego **13** 

### **A New Approach of Control System Design for LLC Resonant Converter**

Peter Drgoňa, Michal Frivaldský and Anna Simonová *University of Žilina, Faculty of Electrical Engineering, Žilina Slovakia* 

#### **1. Introduction**

320 MATLAB for Engineers – Applications in Control, Electrical Engineering, IT and Robotics

Rynaski E.J. (1982). Flight control synthesis using robust output observers, *Guidance and* 

Main task of power semiconductor converter is transfer of electrical energy from its input to the output and to the load. This energy flow is provided by control of the switching process of one or more semiconductor devices. Based on converter application it is necessary to choose correct control algorithm for selected switching frequency of converter. Algorithm itself has to be utilized with suitable hardware platform, whereby through the set of instructions the turn on and turn - of control pulses are generated. Control system also has to secure other important functions for secondary processes. Nowadays a huge number of converter topologies exists, whereby each type should be suited for different conditions of use. For example uninterruptible power supply must generate constant output voltage with constant frequency and constant amplitude for wide range of output power. Converters for electric drive applications have to control their speed through generation of three phase voltage system with configurable amplitude and speed. From mentioned above it is clear to say that for each topology of power converter, the different type of control modulation (PWM - Pulse Width Modulation, PSM - Phase Shift Modulation, FM - Frequency Modulation) and different structure of regulator has to be used. Therefore selection of suitable control system depends on number of various factors, which are output power of converter, type of switching devices, type of load, possibility of hardware implementation and ways of switching.

In the field of DC/DC converters for switching power supplies, the main focus is on implementation of digital control, which means use of microcontrollers or DSP with implemented control algorithms and functions for communication with user as well. Analog control systems are well known and its design procedure is mastered, so it is easy to convert analog (continuous) controller into discrete and consequently implementing in microcontroller and DSP. But this approach ignore sample and hold effect of A/D converter and computing time of microprocessor. For proper discrete controller design, the method named direct digital design can be used. This method uses transfer function of converter in discrete form, including effect of sampling and computation delay.

For controller design purposes, transfer function of converter is necessary. This transfer function is based on model of power stage of controller. For PWM converters such as buck, boost, etc. the averaging method is widely used, but for new resonant topologies such as LLC converter, with this averaging method, the control to output transfer function cannot be used. In this chapter, new simulation based method for obtaining the transfer function of converter is discussed. This method uses MATLAB and OrCad PSPICE environments for revealing the transfer function. Advantage of this method is, that it can be used for every type of power converter. Next in the chapter, the direct digital design of controller based on transfer function is discussed. This method uses MATLAB environment for designing the discrete controller.

#### **2. The ways of regulation of electric quantities in power converters**

From the various types of regulation of electric quantities (voltage, current) the most well known are PWM, PSM, and FM. In pulse width modulation (PWM) technique, the mean value of output voltage or current is controlled through the change of on-time (ton) or offtime (toff) of power transistor. Generation of PWM signals is based on comparison between repeating sequence (sawtooth signal or triangular signal with constant frequency) and between reference value of voltage (ureg) which is generated from regulator. This principle is for analog and digital system almost the same. The only difference in the case of analog system is that repeating sequence is generated from op-amplifier and consequently compared with reference value in analog comparator. For generation of repeating sequence the digital system instead of op-amplifier utilizes digital timer. Comparator is replaced by compare register. The proportional on-time in the case of direct quantities is called duty cycle - D, and is defined as follows:

$$\mathbf{D} = \mathbf{t}\_{\text{on}} / \mathbf{T} \tag{1}$$

A New Approach of Control System Design for LLC Resonant Converter 323

which should be divided into ZVS and/or ZCS region. ZVS region in dependency on the

 a) b) Fig. 1. a) Principle schematics of LLC converter, b) DC-gain characteristic of LLC converter According to the operational modes of resonant converters the operation of LLC resonant converter is rather difficult. The principal waveforms of transformer and output diode during each operating mode are shown in Fig. 2. The impedance of series resonant circuit at the resonant frequency is equal to zero. Therefore the reflected output voltage is equal to the input voltage, what is described by the unity of voltage gain thus the circuit then operates optimally. LLC resonant converter can achieve greater gain, lower or equal to 1. If the switching frequency is less than the resonant frequency, magnetization inductance is

involved into the resonance of the circuit so the converter can deliver higher gain.

 a) b) c) Fig. 2. Waveforms of currents and voltages of LLC converter at different operating

For analysis of operation of LLC converter it is necessary to exactly examine voltage gain characteristic. Voltage gain characteristic is possible to be made from equivalent circuit of converter. Output part together with rectifier and load is replaced by equivalent output

• region3 with switching frequency lower than resonant and with voltage gain < 1

switching frequency can be further divided into:

resistance which is marked as RAC.

conditions a) fsw = fr1, b) fsw > fr1, c) fsw < fr1

• region with switching frequency equal to resonant (fsw = fr1) • region1 with switching frequency higher than resonant (fsw > fr1) • region2 with switching frequency lower than resonant (fsw < fr1)

where ton is on-time of semiconductor devices, and Ts is switching period of converter.

In the case of phase shift modulation (PSM) the mean value of output voltage is controlled by phase shift of on-times of two or more semiconductor devices, such two transistors in upper or lower leg of fullbridge converter are switched simultaneously, whereby switching frequency and duty cycle are constant. The application of PSM is well suited in ZVS (Zero Voltage Switching) and ZCS (Zero Current Switching) resonant converters.

Frequency modulation is basically similar to PWM. Difference is that duty cycle in this case is always constant (D = const.), but frequency of switching signal is varying (fsw = var.). Based on the change of control voltage ureg, the switching frequency of PWM signal is being changed. In the case of analog circuits the frequency modulation is realized through utilization of voltage control oscillator (VCO). On the other hand, in the case of digital implementation the VCO is not required, because frequency of timer is able to be changed directly.

These previously mentioned ways of regulation of electric quantities in power converters are basic types, whereby also their combination is being utilized in practical applications.

#### **3. LLC converter - properties and principle of operation**

LLC resonant converter is multi-resonant converter and is characterized by its unique DC gain characteristic, which has two resonant frequencies (fr1 and fr2). This converter has several advantages compared to standard serial LC resonant topology. One of them is possibility of stable regulation of output voltage in a wide range of input voltages together with the change of output power from 1% to 100%. The next advantage is achievement of ZVS switching mode during various operational modes. LLC resonant converter is composed of three functional parts (Fig. 1a). It deals about pulse generator, resonant circuit with high-frequency transformer and rectifier with capacitive filter. Operation of LLC converter in different operational modes is described by DC gain characteristic (Fig. 1b),

revealing the transfer function. Advantage of this method is, that it can be used for every type of power converter. Next in the chapter, the direct digital design of controller based on transfer function is discussed. This method uses MATLAB environment for designing the

From the various types of regulation of electric quantities (voltage, current) the most well known are PWM, PSM, and FM. In pulse width modulation (PWM) technique, the mean value of output voltage or current is controlled through the change of on-time (ton) or offtime (toff) of power transistor. Generation of PWM signals is based on comparison between repeating sequence (sawtooth signal or triangular signal with constant frequency) and between reference value of voltage (ureg) which is generated from regulator. This principle is for analog and digital system almost the same. The only difference in the case of analog system is that repeating sequence is generated from op-amplifier and consequently compared with reference value in analog comparator. For generation of repeating sequence the digital system instead of op-amplifier utilizes digital timer. Comparator is replaced by compare register. The proportional on-time in the case of direct quantities is called duty

where ton is on-time of semiconductor devices, and Ts is switching period of converter. In the case of phase shift modulation (PSM) the mean value of output voltage is controlled by phase shift of on-times of two or more semiconductor devices, such two transistors in upper or lower leg of fullbridge converter are switched simultaneously, whereby switching frequency and duty cycle are constant. The application of PSM is well suited in ZVS (Zero

Frequency modulation is basically similar to PWM. Difference is that duty cycle in this case is always constant (D = const.), but frequency of switching signal is varying (fsw = var.). Based on the change of control voltage ureg, the switching frequency of PWM signal is being changed. In the case of analog circuits the frequency modulation is realized through utilization of voltage control oscillator (VCO). On the other hand, in the case of digital implementation the VCO is

These previously mentioned ways of regulation of electric quantities in power converters are basic types, whereby also their combination is being utilized in practical applications.

LLC resonant converter is multi-resonant converter and is characterized by its unique DC gain characteristic, which has two resonant frequencies (fr1 and fr2). This converter has several advantages compared to standard serial LC resonant topology. One of them is possibility of stable regulation of output voltage in a wide range of input voltages together with the change of output power from 1% to 100%. The next advantage is achievement of ZVS switching mode during various operational modes. LLC resonant converter is composed of three functional parts (Fig. 1a). It deals about pulse generator, resonant circuit with high-frequency transformer and rectifier with capacitive filter. Operation of LLC converter in different operational modes is described by DC gain characteristic (Fig. 1b),

Voltage Switching) and ZCS (Zero Current Switching) resonant converters.

not required, because frequency of timer is able to be changed directly.

**3. LLC converter - properties and principle of operation** 

D = ton/T (1)

**2. The ways of regulation of electric quantities in power converters** 

discrete controller.

cycle - D, and is defined as follows:

which should be divided into ZVS and/or ZCS region. ZVS region in dependency on the switching frequency can be further divided into:


Fig. 1. a) Principle schematics of LLC converter, b) DC-gain characteristic of LLC converter

According to the operational modes of resonant converters the operation of LLC resonant converter is rather difficult. The principal waveforms of transformer and output diode during each operating mode are shown in Fig. 2. The impedance of series resonant circuit at the resonant frequency is equal to zero. Therefore the reflected output voltage is equal to the input voltage, what is described by the unity of voltage gain thus the circuit then operates optimally. LLC resonant converter can achieve greater gain, lower or equal to 1. If the switching frequency is less than the resonant frequency, magnetization inductance is involved into the resonance of the circuit so the converter can deliver higher gain.

For analysis of operation of LLC converter it is necessary to exactly examine voltage gain characteristic. Voltage gain characteristic is possible to be made from equivalent circuit of converter. Output part together with rectifier and load is replaced by equivalent output resistance which is marked as RAC.

Fig. 2. Waveforms of currents and voltages of LLC converter at different operating conditions a) fsw = fr1, b) fsw > fr1, c) fsw < fr1

Considering, that converter is working with almost resonant frequency, only first harmonic is transferred through resonant circuit, and therefore it is possible to utilize simple approximation, where rectangular pulses are substituted by sinusoidal waveforms.

#### Fig. 3. Equivalent circuit of LLC converter

For voltage expressions of this equivalent circuit next formulas are valid:

$$V\_{RI\text{(l)}} = \frac{4 \cdot V\_o}{\pi} \cdot \sin(\alpha t) \tag{2}$$

A New Approach of Control System Design for LLC Resonant Converter 325

Voltage gain characteristic of proposed converter is shown on Fig. 4. X-axis is defined as switching frequency, or better said frequency of input sinusoidal voltage. Ratio between output voltage and input voltage is marked on y-axis. Each wave is related to different loads of converter (quality factors Q). Main parameters of converter are: **Vin = 400 V, Vout = 60 V,** 

The regulation algorithm for the LLC converter maintains the requested value of output voltage, during the change of input voltage or output load. The LLC converter is controlled by variations of switching frequency, so the active part of the regulator is a voltage controlled oscillator (VCO) in analog or digital (software) form. The change of the output frequency is based on the input voltage of the VCO. As mentioned above, the switching frequencies of the LLC converter are between fr1 and fr2 during normal operation. The regulation algorithm works as follows: The normal operating point (Fig. 5a point 1) is characterized by VIN=400 V, UOUT=60 V. If the input voltage drops below 400 V, the regulation algorithm reacts in form of switching frequency reduction, so the operating point of the converter moves from the point 1 to the point 2. In this point, the converter works with the increased gain to maintain the output voltage at the constant value (60 V). The minimal input voltage is defined as 325V, so it is not

If the input voltage rises back to 400V, the control system increases the switching frequency - voltage gain decreases and the operating point of the converter moves back to the point 1. The next operating condition for the LLC converter is variation of the output load. Fig. 5b shows the point 1, where the converter works with full load, the operating point is on the curve with Q=100%. When the output load drops, the operating point moves from the curve with Q=100% to the curve with Q=10%, which means that for the constant switching frequency, the output voltage rises to 60% above the nominal value, so the regulation algorithm rises the switching frequency which leads to lower voltage gain and output

Specific case of operation is the start of the converter, when the switching frequency is higher than the resonant frequency fr1 to avoid current inrush during the initial charge of the output capacitor COUT. Generally, for the soft start, the switching frequency is two or three times higher than the resonant frequency. Voltage gain on this frequency is lower (Fig. 4), so

the charging current of the output capacitor stays on an acceptable level.

**Lr = 6.6 µH, Cr = 900 nF, Lm = 36 µH, Lr2 = 3 µH, Romin = 2.4 Ω, Imax = 25 A**

Fig. 4. Voltage gain characteristic of proposed converter.

possible to maintain the output voltage on 60V below this value.

**3.1 Regulation of LLC converter** 

voltage decrease to nominal value.

$$V\_{d(1)} = \frac{4}{\pi} \cdot \frac{V\_{in}}{2} \cdot \sin(\alpha t) \tag{3}$$

where VRI is voltage at the output of resonant circuit, and Vd is first harmonic part of supply voltage.

The equivalent circuit of converter is then similar to that which is shown on Fig.3. Equation of voltage gain characteristic is then equal to:

$$M = \frac{2mV\_o}{V\_{in}} = \left| \frac{\left(\frac{\alpha o^2}{\alpha\_{r1}^2}\right) \sqrt{m.(m-1)}}{\left(\frac{\alpha o^2}{\alpha\_{r2}^2} - 1\right) + j.\left(\frac{\alpha o}{\alpha\_{r1}}\right) \left(\frac{\alpha o^2}{\alpha\_{r1}^2} - 1\right).(m-1).Q\right| \tag{4}$$

where:

$$f\_{r1} = \frac{1}{2\pi\sqrt{L\_R \cdot C\_R}}\tag{5}$$

$$f\_{r2} = \frac{1}{2\pi\sqrt{(L\_M + L\_R)C\_R}}\tag{6}$$

$$Q = \frac{\sqrt{\frac{L\_R}{C\_R}}}{R\_{AC}}\tag{7}$$

$$R\_{AC} = \frac{8.n^2}{\pi^2} R\_O \tag{8}$$

Voltage gain characteristic of proposed converter is shown on Fig. 4. X-axis is defined as switching frequency, or better said frequency of input sinusoidal voltage. Ratio between output voltage and input voltage is marked on y-axis. Each wave is related to different loads of converter (quality factors Q). Main parameters of converter are: **Vin = 400 V, Vout = 60 V, Lr = 6.6 µH, Cr = 900 nF, Lm = 36 µH, Lr2 = 3 µH, Romin = 2.4 Ω, Imax = 25 A**

Fig. 4. Voltage gain characteristic of proposed converter.

#### **3.1 Regulation of LLC converter**

324 MATLAB for Engineers – Applications in Control, Electrical Engineering, IT and Robotics

Considering, that converter is working with almost resonant frequency, only first harmonic is transferred through resonant circuit, and therefore it is possible to utilize simple

approximation, where rectangular pulses are substituted by sinusoidal waveforms.

For voltage expressions of this equivalent circuit next formulas are valid:

1

1

*d*

4 ( ) sin( ) *<sup>o</sup> RI <sup>V</sup> V t*

4

π

*o r*

1

π

*f*

2

*f*

ω

ω

π

*<sup>V</sup> V t*

<sup>2</sup> ( ) sin( ) *in*

where VRI is voltage at the output of resonant circuit, and Vd is first harmonic part of supply

The equivalent circuit of converter is then similar to that which is shown on Fig.3. Equation

2 2 1 2 2 2 2 2 11

 ωω

 −+ − − 

ω

ω

= =

*r rr*

1 2 . . *<sup>r</sup>*

1 2 ( ). *<sup>r</sup>*

> *R R AC*

2 2 <sup>8</sup>. . *AC O <sup>n</sup> R R* π

*L C*

π

*R R*

*M R R*

 ωω

ω

ω

( )

.. . .

*j m Q*

1 11

*m m*

. .

<sup>−</sup>

1

<sup>⋅</sup> = ⋅ (2)

=⋅ ⋅ (3)

( )

*L C* <sup>=</sup> (5)

*L LC* <sup>=</sup> <sup>+</sup> (6)

*<sup>Q</sup> <sup>R</sup>* <sup>=</sup> (7)

<sup>=</sup> (8)

(4)

voltage.

where:

Fig. 3. Equivalent circuit of LLC converter

of voltage gain characteristic is then equal to:

2

*nV <sup>M</sup> V*

*in*

The regulation algorithm for the LLC converter maintains the requested value of output voltage, during the change of input voltage or output load. The LLC converter is controlled by variations of switching frequency, so the active part of the regulator is a voltage controlled oscillator (VCO) in analog or digital (software) form. The change of the output frequency is based on the input voltage of the VCO. As mentioned above, the switching frequencies of the LLC converter are between fr1 and fr2 during normal operation. The regulation algorithm works as follows: The normal operating point (Fig. 5a point 1) is characterized by VIN=400 V, UOUT=60 V. If the input voltage drops below 400 V, the regulation algorithm reacts in form of switching frequency reduction, so the operating point of the converter moves from the point 1 to the point 2. In this point, the converter works with the increased gain to maintain the output voltage at the constant value (60 V). The minimal input voltage is defined as 325V, so it is not possible to maintain the output voltage on 60V below this value.

If the input voltage rises back to 400V, the control system increases the switching frequency - voltage gain decreases and the operating point of the converter moves back to the point 1. The next operating condition for the LLC converter is variation of the output load. Fig. 5b shows the point 1, where the converter works with full load, the operating point is on the curve with Q=100%. When the output load drops, the operating point moves from the curve with Q=100% to the curve with Q=10%, which means that for the constant switching frequency, the output voltage rises to 60% above the nominal value, so the regulation algorithm rises the switching frequency which leads to lower voltage gain and output voltage decrease to nominal value.

Specific case of operation is the start of the converter, when the switching frequency is higher than the resonant frequency fr1 to avoid current inrush during the initial charge of the output capacitor COUT. Generally, for the soft start, the switching frequency is two or three times higher than the resonant frequency. Voltage gain on this frequency is lower (Fig. 4), so the charging current of the output capacitor stays on an acceptable level.

A New Approach of Control System Design for LLC Resonant Converter 327

Fig. 7. Time waveforms of voltages and currents during the simulation experiment:

Fig. 8. Time waveforms of voltages and currents during the simulation experiment: Uin = 325V, Pout = 1008W (from top - transistor X1a X2, transformer primary side, output

diode D1 and D2)

diode D1 and D2)

Uin = 425V, Pout = 1008W (from top: transistor T1and T2, transformer primary side, output

Fig. 5. Regulation of output voltage a) during input supply voltage decrease, b) during load variations

#### **3.2 Simulation of LLC converter in OrCad PSPICE**

For verification and mathematical model design, first, the simulation in Orcad PSPICE has been made. Data acquired from simulations in PSPICE are used in MATLAB for design of mathematical model. For best performance and accuracy of switching waveforms, all parasitic components were included into simulation.

For power transistors the IPW60R165CP model was used, and MUR10015CT was used for output diodes. For transformer, the leakage inductance with all parasitic components was also simulated.

Fig. 6. Simulation model of main circuit of proposed LLC resonant converter with parasitic components

In Fig.7 the basic waveforms of LLC converter are shown. This simulation experiment was performed with full input voltage 425V and with output power 1kW. Fig. 8 shows another waveforms, with lower input voltage at 325V and output power of 1kW. All operation conditions including soft start and overload were also verified in simulation experiments.

Fig. 5. Regulation of output voltage a) during input supply voltage decrease, b) during load

For verification and mathematical model design, first, the simulation in Orcad PSPICE has been made. Data acquired from simulations in PSPICE are used in MATLAB for design of mathematical model. For best performance and accuracy of switching waveforms, all

For power transistors the IPW60R165CP model was used, and MUR10015CT was used for output diodes. For transformer, the leakage inductance with all parasitic components was

Fig. 6. Simulation model of main circuit of proposed LLC resonant converter with parasitic

In Fig.7 the basic waveforms of LLC converter are shown. This simulation experiment was performed with full input voltage 425V and with output power 1kW. Fig. 8 shows another waveforms, with lower input voltage at 325V and output power of 1kW. All operation conditions including soft start and overload were also verified in simulation experiments.

a) b)

**3.2 Simulation of LLC converter in OrCad PSPICE** 

parasitic components were included into simulation.

variations

also simulated.

components

Fig. 7. Time waveforms of voltages and currents during the simulation experiment: Uin = 425V, Pout = 1008W (from top: transistor T1and T2, transformer primary side, output diode D1 and D2)

Fig. 8. Time waveforms of voltages and currents during the simulation experiment: Uin = 325V, Pout = 1008W (from top - transistor X1a X2, transformer primary side, output diode D1 and D2)

A New Approach of Control System Design for LLC Resonant Converter 329

Whole process is shown on Fig. 10. First, the simulation of dynamic step response of LLC converter on control value (switching frequency) was created in OrCad PSPICE environment. Result from this simulation was dynamic output voltage response (output value) on step of switching frequency (input value). This simulated results from OrCad PSPICE, were used in MATLAB as input values for identification of this dynamic system.

Fig. 10. Simulation based method for identification of transfer function

of all converters is possible.

**Vo** 

Use of System Identification Toolbox offers several models for identification of dynamic system. With use of different models from System Identification Toolbox (SIT), identification

Fig. 11. Accuracy of some model types from SIT with different degree (step response)

System Identification Toolbox includes number of models in continuous or discrete form, which can be used for identification of systems: ARX (Auto Regresive Exogeneous Input Model), ARMAX (Auto Regresive Moving Average Exogeneous Input Model) OE (Output Error Model), BJ (Box-Jenkins Model), SS (State-Space Model). Accuracy of the models depends on degree of polynomials used in transfer function. Fig. 11 shows accuracy of identified transfer functions for different model types from simulated results of LLC converter. All models are in discrete form (z-domain), so the exact specification of sampling

**Time** 

From simulations above, it's clear to say, that design procedure was very accurate and results are showing acceptable performance.

#### **4. Transfer function for controller**

In previous sections, a operating principle of LLC converter was briefly mentioned, together with simulation of main circuit. Accurate simulation is critical for design and optimization of the control system for the LLC converter. For the design of control structure and the actual control system, a transfer function is necessary, which will describe response of output voltage and current to the change of the control variable.

Fig. 9. Process of transfer function acquiring

Mathematical model of LLC converter requires control-to-output transfer function. Based on this transfer function, digital controller can be obtained. For PWM converters, standard "averaged" methods can be used for revealing the transfer function of converter. One of method with good results is "direct circuit averaging". This method can be easily implemented for standard PWM converters such as boost, buck, flyback etc. Transfer function obtained with this method has duty cycle as an input value and output voltage as an output value.

Unlike the PWM converters, the control transfer function of frequency controlled resonant converters cannot be obtained by state space averaging method, due to different ways of energy processing. While state space averaging methods eliminates the information about switching frequency, they cannot predict dynamic properties of resonant converters, so the proper control-to-output transfer function cannot be evaluated.

There is a several methods for solving this problems, but some of them are too simplified and idealized, others are too complex and difficult to use. In this paper, new simulation based method for revealing the control transfer function is proposed. This method is based on PSPICE simulation, which was discussed in previous chapter, and use of System Identification Toolbox in MATLAB environment. First, the simulation of main circuit in PSPICE must be created. Using of PSPICE simulation, the dependency of output (voltage, current) on input (switching frequency, duty cycle) can be simulated.

Another option for creation of the mathematical model is use of block called SLPS in MATLAB. This block creates interface between circuit model in PSPICE and mathematical models in MATLAB environment. Data acquired from simulation in PSPICE are used in MATLAB for creation of transfer function of LLC multiresonant converter. For obtaining of the transfer function in s-domain, the MATLAB System Identification Toolbox was used.

From simulations above, it's clear to say, that design procedure was very accurate and

In previous sections, a operating principle of LLC converter was briefly mentioned, together with simulation of main circuit. Accurate simulation is critical for design and optimization of the control system for the LLC converter. For the design of control structure and the actual control system, a transfer function is necessary, which will describe response of

Mathematical model of LLC converter requires control-to-output transfer function. Based on this transfer function, digital controller can be obtained. For PWM converters, standard "averaged" methods can be used for revealing the transfer function of converter. One of method with good results is "direct circuit averaging". This method can be easily implemented for standard PWM converters such as boost, buck, flyback etc. Transfer function obtained with this method has duty cycle as an input value and output voltage as

Unlike the PWM converters, the control transfer function of frequency controlled resonant converters cannot be obtained by state space averaging method, due to different ways of energy processing. While state space averaging methods eliminates the information about switching frequency, they cannot predict dynamic properties of resonant converters, so the

There is a several methods for solving this problems, but some of them are too simplified and idealized, others are too complex and difficult to use. In this paper, new simulation based method for revealing the control transfer function is proposed. This method is based on PSPICE simulation, which was discussed in previous chapter, and use of System Identification Toolbox in MATLAB environment. First, the simulation of main circuit in PSPICE must be created. Using of PSPICE simulation, the dependency of output (voltage,

Another option for creation of the mathematical model is use of block called SLPS in MATLAB. This block creates interface between circuit model in PSPICE and mathematical models in MATLAB environment. Data acquired from simulation in PSPICE are used in MATLAB for creation of transfer function of LLC multiresonant converter. For obtaining of the transfer function in s-domain, the MATLAB System Identification Toolbox was used.

results are showing acceptable performance.

Fig. 9. Process of transfer function acquiring

an output value.

output voltage and current to the change of the control variable.

proper control-to-output transfer function cannot be evaluated.

current) on input (switching frequency, duty cycle) can be simulated.

**4. Transfer function for controller** 

Whole process is shown on Fig. 10. First, the simulation of dynamic step response of LLC converter on control value (switching frequency) was created in OrCad PSPICE environment. Result from this simulation was dynamic output voltage response (output value) on step of switching frequency (input value). This simulated results from OrCad PSPICE, were used in MATLAB as input values for identification of this dynamic system.

Fig. 10. Simulation based method for identification of transfer function

Use of System Identification Toolbox offers several models for identification of dynamic system. With use of different models from System Identification Toolbox (SIT), identification of all converters is possible.

Fig. 11. Accuracy of some model types from SIT with different degree (step response)

System Identification Toolbox includes number of models in continuous or discrete form, which can be used for identification of systems: ARX (Auto Regresive Exogeneous Input Model), ARMAX (Auto Regresive Moving Average Exogeneous Input Model) OE (Output Error Model), BJ (Box-Jenkins Model), SS (State-Space Model). Accuracy of the models depends on degree of polynomials used in transfer function. Fig. 11 shows accuracy of identified transfer functions for different model types from simulated results of LLC converter. All models are in discrete form (z-domain), so the exact specification of sampling

A New Approach of Control System Design for LLC Resonant Converter 331

Fig. 13. Accuracy of ARMAX models with different degree (up to down 4,3,2)

function, with simulated dynamic step response from OrCad PSPICE.

For better view, Fig.14 shows comparison of ARMAX 2221 model, used for transfer

Simulation

**Simulation** 

**Time** 

Fig. 14. Comparison of simulated results (PSPICE) with ARMAX model of 2nd degree

. . ( ) . . *<sup>s</sup> G s*

also analyze the characteristics and quality of the proposed control circuit.

**5. Design of discrete controller** 

*s s* ⋅+ ⋅ <sup>=</sup> +⋅+ ⋅

For LLC converter, whose waveforms are in Fig. 7 and Fig. 8, resulting transfer function is in

**Time** 

After acquiring of transfer function, we can obtain basic mathematical model of LLC converter. This mathematical model can be used for design of discrete model, with all effects from discrete control system. The following figures show the bode characteristics of the systems marked Gdlyz3 and Gdlyz4 with discrete controllers. The design of controllers was made in Matlab using the SISOTOOL. This tool allows to design not only regulators, but

Due to implementation in microprocessor, the controller must be in discrete form. There are two ways to design a discrete controller - design by emulation and direct digital design.

6 9

(12)

24 8 2 054 10 6 895 10 2 29 10 1 176 10

**Vo** 

(MATLAB)

**Vo** 

Eq. (12).

interval is necessary, which means, that the integration step which was used in OrCad PSPICE, must be also used for MATLAB. From Fig. 11 can be seen, that the best accuracy has ARX and ARMAX model.

Fig. 12. Structure of ARMAX model

The ARMAX model, whose structure is on Fig. 12, is similar to ARX model, but with better accuracy. It extends the ARX model with polynomial C(z) - equation of average value of perturbation function. The ARMAX model is suitable for those systems, where perturbation function affects input variable u(n). Searched transfer function has the same form as in ARX model, but the computing algorithm is different. The equation for ARMAX model is as follows:

$$A(z)y(n) = \left(B(z)u\left(n-k\right) + \mathcal{C}(z)\mathcal{J}(n)\right) \tag{9}$$

Structure of the model is shown on Fig. 12. After adjusting, the form of Eq. (10) is:

$$\log \left( n \right) = \frac{1}{A(z)} \left( B(z) \mu \left( n - nk \right) + \mathbb{C}(z) \xi \left( n \right) \right) \tag{10}$$

Due to best accuracy of ARMAX model, only this model was used for revealing the transfer function. Another parameter necessary for the transfer function revealing, is degree of its polynomials. Fig. 13 shows accuracy of ARMAX model with different degree. Best accuracy offers model of 2nd degree, which means, that polynomials A(z), and C(z) are just 2nd degree. We can say, that the control to output transfer function of LLC converter has same degree as ARMAX model.

#### **4.1 Transfer function**

As mentioned above, the sampling interval used for models in SIT must be equivalent with integration step used for simulation in OrCad PSPICE. If sampling interval used in SIT differs from integration step in PSPICE, the dynamic results (from step response) will have different time representation in MATLAB, so the searched transfer function will have incorrect form.

Requested discrete transfer function is in form:

$$G(z) = \frac{B(z)}{A(z)} = \frac{b\_0 + b\_1 z^{-1} + b\_2 z^{-2} + \dots + b\_{nb} z^{-nb}}{a\_0 + a\_1 z^{-1} + a\_2 z^{-2} + \dots + a\_{na} z^{-na}}\tag{11}$$

interval is necessary, which means, that the integration step which was used in OrCad PSPICE, must be also used for MATLAB. From Fig. 11 can be seen, that the best accuracy

> C A

ξ

B A

u y

The ARMAX model, whose structure is on Fig. 12, is similar to ARX model, but with better accuracy. It extends the ARX model with polynomial C(z) - equation of average value of perturbation function. The ARMAX model is suitable for those systems, where perturbation function affects input variable u(n). Searched transfer function has the same form as in ARX model, but the computing algorithm is different. The equation for ARMAX model is as

*Azy n B zun k Cz n* ( ) () () ( ) () = −+ ( ) ( )

( ) ( )( ) () ( ) () <sup>1</sup> *<sup>y</sup> n B z u n nk C z n* ( ) *A z* = −+

Due to best accuracy of ARMAX model, only this model was used for revealing the transfer function. Another parameter necessary for the transfer function revealing, is degree of its polynomials. Fig. 13 shows accuracy of ARMAX model with different degree. Best accuracy offers model of 2nd degree, which means, that polynomials A(z), and C(z) are just 2nd degree. We can say, that the control to output transfer function of LLC converter has same degree as

As mentioned above, the sampling interval used for models in SIT must be equivalent with integration step used for simulation in OrCad PSPICE. If sampling interval used in SIT differs from integration step in PSPICE, the dynamic results (from step response) will have different time representation in MATLAB, so the searched transfer function will have

01 2

*B z b bz b z b z G z A z a az a z a z*

+ + ++ = = + + ++

01 2 ( ) ... ( ) ( ) ...

1 2

−− − −− −

1 2

Structure of the model is shown on Fig. 12. After adjusting, the form of Eq. (10) is:

ξ

ξ

*nb nb na na*

(9)

(11)

(10)

has ARX and ARMAX model.

Fig. 12. Structure of ARMAX model

follows:

ARMAX model.

incorrect form.

**4.1 Transfer function** 

Requested discrete transfer function is in form:

Fig. 13. Accuracy of ARMAX models with different degree (up to down 4,3,2)

For better view, Fig.14 shows comparison of ARMAX 2221 model, used for transfer function, with simulated dynamic step response from OrCad PSPICE.

Fig. 14. Comparison of simulated results (PSPICE) with ARMAX model of 2nd degree (MATLAB)

For LLC converter, whose waveforms are in Fig. 7 and Fig. 8, resulting transfer function is in Eq. (12).

$$G(s) = \frac{2.054 \cdot 10^6 s + 6.895 \cdot 10^9}{s^2 + 2.29 \cdot 10^4 s + 1.176 \cdot 10^8} \tag{12}$$

After acquiring of transfer function, we can obtain basic mathematical model of LLC converter. This mathematical model can be used for design of discrete model, with all effects from discrete control system. The following figures show the bode characteristics of the systems marked Gdlyz3 and Gdlyz4 with discrete controllers. The design of controllers was made in Matlab using the SISOTOOL. This tool allows to design not only regulators, but also analyze the characteristics and quality of the proposed control circuit.

#### **5. Design of discrete controller**

Due to implementation in microprocessor, the controller must be in discrete form. There are two ways to design a discrete controller - design by emulation and direct digital design.

A New Approach of Control System Design for LLC Resonant Converter 333

of controller, the different responses of closed control loop can be displayed for

Sampling time Ts Computing delay Tcomp Mark 5μs 0 Gz1 10μs 0 Gz2 5μs 3μs Gdlyz1 10μs 3μs Gdlyz2 5μs 6μs Gdlyz3 10μs 6μs Gdlyz4

From Fig. 16 is clear, that computing delay has significant effect on stability of the control

Table 1. Sampling times and computational delays for transfer functions in Fig. 16

Fig. 16. Effect of sample and hold and computation delay on stability of control loop

Time of control settling is about 70 microseconds, overshoot as high as 17%.

Transfer function of designed controller is in form:

Fig. 17 shows the system Gdlyz3 with poles and zeros of the regulated system (blue) and regulator (red). Fig. 18 shows the closed-loop response of the system to a unitary jump.

> . () . . *<sup>c</sup> <sup>z</sup> G z*

Fig.19 shows the bode characteristics of system marked Gdlyz4, with the proposed controller. Poles and zeros of the transfer function of the regulated system are shown blue, poles and zeros of the controller are shown red. As in the previous case, in Fig. 20 a closed control loop

0 886 0 041204

*z*

0 995

<sup>−</sup> = ⋅ − (13)

loop. With rising computing and sampling time stability of system drops.

verification.

In the design by emulation approach, also known as digital redesign method, first an analog controller is designed in the continuous domain, by ignoring the effects of sampling and hold of A/D converter and computing delay of microprocessor. In next step, the controller can be converted into discrete-time domain by one of discretization method. This approach is good for systems of lower degree, but in discrete systems of higher degree, the transient responses does not reflect the required values because of ignoring sample and hold and computation delay effects.

On the other side, direct digital design approach offers design of controller directly in zdomain, without conversion, including effects of A/D converter and microprocessor. Block diagram of this approach is on Fig. 15.

Fig. 15. Direct digital design control loop

Sampling of measured value with A/D converter can be represented by ideal Zero-Order-Hold block with sample time Ts. Gain of A/D converter is represented by block Kadc. Computing delay of microprocessor, also with delay from PWM module are represented by block Tcomp. A/D converter with PWM module together form a sampling-and-hold device. Sample and hold block brings additional time delay of Ts/2 and phase lag of ωTs/2, which means, that reconstructed signal has time or phase lag. Block Tcomp represents delay between conversion of A/D converter and PWM duty cycle or modulo update. Time between this two events is necessary for computing the values for PWM block. Discrete transfer function of whole converter including Zero-Order block, Sample-and-Hold effect and gain of A/D converter is:

$$G\_{\alpha}(z) = Z \left\{ \frac{1}{s} \Big( 1 - e^{sT\_s} \Big) \cdot H\_C \left( s \right) \cdot G\_P \left( s \right) \cdot K\_d \right\}$$

Fig. 16 shows effect of sampling interval with computing delay on stability of closed control loop. Tab. 1 shows transfer functions with different sampling intervals and different computational delays. Sampling times were used from A/D converter included in DSC 56F8013, the computing times were used from same processor. Application was for digital control system for 200kHz LLC multiresonant converter. In this system discrete regulator of third order was used.

For design of controller in z-domain, all above mentioned delays must be taken into account. With use of MATLAB Siso Design Tool, the proper discrete controller can be designed. Advantage of this tool is possibility of direct placing of zeroes and poles of controller on bode diagram of closed or open loop. After placing the poles or zeros

In the design by emulation approach, also known as digital redesign method, first an analog controller is designed in the continuous domain, by ignoring the effects of sampling and hold of A/D converter and computing delay of microprocessor. In next step, the controller can be converted into discrete-time domain by one of discretization method. This approach is good for systems of lower degree, but in discrete systems of higher degree, the transient responses does not reflect the required values because of ignoring sample and hold and

On the other side, direct digital design approach offers design of controller directly in zdomain, without conversion, including effects of A/D converter and microprocessor. Block

Sampling of measured value with A/D converter can be represented by ideal Zero-Order-Hold block with sample time Ts. Gain of A/D converter is represented by block Kadc. Computing delay of microprocessor, also with delay from PWM module are represented by block Tcomp. A/D converter with PWM module together form a sampling-and-hold device. Sample and hold block brings additional time delay of Ts/2 and phase lag of ωTs/2, which means, that reconstructed signal has time or phase lag. Block Tcomp represents delay between conversion of A/D converter and PWM duty cycle or modulo update. Time between this two events is necessary for computing the values for PWM block. Discrete transfer function of whole converter including Zero-Order block, Sample-and-Hold effect and gain of A/D

( ) ( ) () () <sup>1</sup> <sup>1</sup> *<sup>s</sup> sT Gz Z e H sG sK CPd*

Fig. 16 shows effect of sampling interval with computing delay on stability of closed control loop. Tab. 1 shows transfer functions with different sampling intervals and different computational delays. Sampling times were used from A/D converter included in DSC 56F8013, the computing times were used from same processor. Application was for digital control system for 200kHz LLC multiresonant converter. In this system discrete regulator of

For design of controller in z-domain, all above mentioned delays must be taken into account. With use of MATLAB Siso Design Tool, the proper discrete controller can be designed. Advantage of this tool is possibility of direct placing of zeroes and poles of controller on bode diagram of closed or open loop. After placing the poles or zeros

= −⋅ ⋅ ⋅

*s*

computation delay effects.

diagram of this approach is on Fig. 15.

Fig. 15. Direct digital design control loop

converter is:

third order was used.


of controller, the different responses of closed control loop can be displayed for verification.


From Fig. 16 is clear, that computing delay has significant effect on stability of the control loop. With rising computing and sampling time stability of system drops.

Fig. 16. Effect of sample and hold and computation delay on stability of control loop

Fig. 17 shows the system Gdlyz3 with poles and zeros of the regulated system (blue) and regulator (red). Fig. 18 shows the closed-loop response of the system to a unitary jump. Time of control settling is about 70 microseconds, overshoot as high as 17%. Transfer function of designed controller is in form:

$$\mathcal{G}\_c(z) = 0.041204 \cdot \frac{z - 0.886}{z - 0.995} \tag{13}$$

Fig.19 shows the bode characteristics of system marked Gdlyz4, with the proposed controller. Poles and zeros of the transfer function of the regulated system are shown blue, poles and zeros of the controller are shown red. As in the previous case, in Fig. 20 a closed control loop

A New Approach of Control System Design for LLC Resonant Converter 335

Fig. 19. Design of controller using transfer function of open loop

Fig. 20. Closed-loop response with designed controller for unitary jump

0 748 0 028539

*z*

. . . *<sup>C</sup> <sup>z</sup> <sup>G</sup>*

SISOTOOL enables also the analysis of the quality and stability of the regulatory circuit. The advantage is, that information on the quality and stability control is available directly during the design procedure of the controller. As seen from figures 4.7 and 4.9 the systems

0 994

<sup>−</sup> = ⋅ − (14)

Transfer function of designed controller is in form:

with closed loop are stable , with safety margin about 50°.

response to unitary jump is shown. Time of control settling is 100 microseconds, overshoot is 20%, which is caused by a longer interval sampling interval of system Gdlyz4.

Fig. 17. Design of controller using transfer function of open loop for system Gdlyz3

Fig. 18. Closed-loop response with designed controller for unitary jump

Both designed controllers controls at 97% of requested value, due to the reduction of regulators gain, because of limitation of overshoot below 20% of the requested value. The elimination of this problem was realized by increasing the requested value of the output voltage by 3%

response to unitary jump is shown. Time of control settling is 100 microseconds, overshoot

is 20%, which is caused by a longer interval sampling interval of system Gdlyz4.

Fig. 17. Design of controller using transfer function of open loop for system Gdlyz3

Fig. 18. Closed-loop response with designed controller for unitary jump

voltage by 3%

Both designed controllers controls at 97% of requested value, due to the reduction of regulators gain, because of limitation of overshoot below 20% of the requested value. The elimination of this problem was realized by increasing the requested value of the output

Fig. 19. Design of controller using transfer function of open loop

Fig. 20. Closed-loop response with designed controller for unitary jump

Transfer function of designed controller is in form:

$$G\_{\odot} = 0.028539 \cdot \frac{z - 0.748}{z - 0.994} \tag{14}$$

SISOTOOL enables also the analysis of the quality and stability of the regulatory circuit. The advantage is, that information on the quality and stability control is available directly during the design procedure of the controller. As seen from figures 4.7 and 4.9 the systems with closed loop are stable , with safety margin about 50°.

A New Approach of Control System Design for LLC Resonant Converter 337

56F8013. For measurement of output voltage, this time is sufficient, but for current sensing, the A/D converter on ColdFire is too slow. This problem was eliminated by use of special algorithm for computing of diode current from value of output voltage, value of load and ripple of output voltage. This algorithm is based on computing of output current from output voltage drop, during load connection. Detailed method is described in. Times

The method for creation of mathematical model discussed in this chapter is based on circuit model of LLC converter in OrCAD PSPICE and use of MATLAB System Identification Toolbox. This approach eliminates the problems of transfer function obtaining, whose results from use of standard "averaging" methods. Instead of that, this approach uses simulation in OrCad PSPICE, based on circuit model of converter, for acquiring the results and subsequent use of MATLAB for creation of accurate control to output transfer function (in s- or z- domain). Advantage of this method is in use of all parasitic components (resistors, capacitances, inductors) in OrCad PSPICE simulation, so the transfer function is very accurate. Also, the approach for identification of the system, proposed in this paper, uses new, discrete model based method. This method allows rapid acquiring of mathematical model of converter with use of computing power of modern PC. Another advantage of this method is possibility of use for any type of converter without limitation in

Results of this work were made with support of national grant agency APVV project No. 0535-07 and to R&D operational program Centre of excellence of power electronics systems and materials for their components No. OPVaV-2008/01-SORO, ITMS 2622012003 funded

Maksimovic, D. Zane, R. Erickson, R. (2004). Impact of Digital Control in Power Electronic,

Moudgalya, K. N. (2007). In: *Digital Control*, John Wiley and Sons, pp.157-237, John Wiley

Hangseok, Ch. (2007). Analysis and design of LLC resonant converter with integrated

Hargas, L. Hrianka, M. Lakatos, J. Koniar, D. (2010). Heat fields modelling and verification

Frivaldský, M. Drgona, P. Prikopova, A. (2009). Design and modeling of 200kHz 1,5kW LLC

*Proceedings of 2004 International Symposium on Power Semiconductor Devices*, ISBN 4-

transformer, *Proceedings of Applied Power Electronics Conference,* ISBN 1-4244-

of electronic parts of mechatronics systems, *Metalurgija (Metallurgy)*, vol. 49,

power semiconductor resonant converter, *Proceedings of Applied Electronics*, ISBN

required for computing on both processors are in Tab. 2.

**6. Conclusion** 

structure of converter.

**8. References** 

**7. Acknowledgement** 

by European regional development fund (ERDF).

88686-060-5, Kitakyushu, May 2004

0714-1/07, Anaheim USA, March 2007

(February 2010), ISSN 1334-2576

978-80-7043-781-0, September 2009

and Sons, ISBN 978-0-470-03144-5, Chichester

#### **5.1 Implementation in DSC**

Discrete controller proposed in previous chapter was implemented into 16b digital signal controller (DSC) Freescale 56F8013, which is primary designed for motor and converter control. Advantage of this microprocessor are high performance peripherals which can operate with 96Mhz clock frequency. On the other side, disadvantage of this processor is low core frequency - 32 MHz, and fixed point arithmetic. For better performance, fraction arithmetic with intrinsic functions were used in this DSC.

Block scheme of digital control system with DSC 56F8013 on 200 kHz LLC converter is on Fig. 21. For better performance and lower amount of additional hardware, the concept with microprocessor on secondary side of converter was used. Also, new available fast digital isolators were used instead of standard optocouplers.

Fig. 21. Block scheme of full digital control system with DSC 56F8013


Table 2. Sampling times and computational delays for two processors

Another option for implementation is use of 32b microprocessor ColdFire V1 which offers better computing performance, but sampling time of A/D converter is twice as in DSC 56F8013. For measurement of output voltage, this time is sufficient, but for current sensing, the A/D converter on ColdFire is too slow. This problem was eliminated by use of special algorithm for computing of diode current from value of output voltage, value of load and ripple of output voltage. This algorithm is based on computing of output current from output voltage drop, during load connection. Detailed method is described in. Times required for computing on both processors are in Tab. 2.

### **6. Conclusion**

336 MATLAB for Engineers – Applications in Control, Electrical Engineering, IT and Robotics

Discrete controller proposed in previous chapter was implemented into 16b digital signal controller (DSC) Freescale 56F8013, which is primary designed for motor and converter control. Advantage of this microprocessor are high performance peripherals which can operate with 96Mhz clock frequency. On the other side, disadvantage of this processor is low core frequency - 32 MHz, and fixed point arithmetic. For better performance, fraction

Block scheme of digital control system with DSC 56F8013 on 200 kHz LLC converter is on Fig. 21. For better performance and lower amount of additional hardware, the concept with microprocessor on secondary side of converter was used. Also, new available fast digital

**5.1 Implementation in DSC** 

arithmetic with intrinsic functions were used in this DSC.

isolators were used instead of standard optocouplers.

Fig. 21. Block scheme of full digital control system with DSC 56F8013

Table 2. Sampling times and computational delays for two processors

*time* 

56F8013 16b 32Mhz 1.126µs 2.98µs 3.01µs

ColdFireV1 32b 50,3Mhz 2.252µs 1.8µs 1.12µs

Another option for implementation is use of 32b microprocessor ColdFire V1 which offers better computing performance, but sampling time of A/D converter is twice as in DSC

*Computing of control loop* 

*Computing of current value* 

*Processor* **Bits** *Core frequency A/D sampling* 

The method for creation of mathematical model discussed in this chapter is based on circuit model of LLC converter in OrCAD PSPICE and use of MATLAB System Identification Toolbox. This approach eliminates the problems of transfer function obtaining, whose results from use of standard "averaging" methods. Instead of that, this approach uses simulation in OrCad PSPICE, based on circuit model of converter, for acquiring the results and subsequent use of MATLAB for creation of accurate control to output transfer function (in s- or z- domain). Advantage of this method is in use of all parasitic components (resistors, capacitances, inductors) in OrCad PSPICE simulation, so the transfer function is very accurate. Also, the approach for identification of the system, proposed in this paper, uses new, discrete model based method. This method allows rapid acquiring of mathematical model of converter with use of computing power of modern PC. Another advantage of this method is possibility of use for any type of converter without limitation in structure of converter.

### **7. Acknowledgement**

Results of this work were made with support of national grant agency APVV project No. 0535-07 and to R&D operational program Centre of excellence of power electronics systems and materials for their components No. OPVaV-2008/01-SORO, ITMS 2622012003 funded by European regional development fund (ERDF).

#### **8. References**


**Part 4** 

**Motor Applications** 

Frivaldský, M. Drgoňa, P. Špánik, P. (2009). Optimization of transistor´s hard switched commutation mode in high – power, high frequency application, *Proceedings of 15th International Conference on ELECTRICAL DRIVES and POWER ELECTRONICS*, ISBN 953-6037-55-1, Dubrovnik Croatia, October 2009
