Design and control of shunt active power filter for power quality improvement of utility powered brushless DC motor drives

ABSTRACT The presence of nonlinear loads like brushless DC (BLDC) motor drives in the distribution system leads to poor power quality (PQ) indices like low power factor, high total harmonic distortion and creates electromagnetic interference. Passive filters and Power factor correction converters are often inserted between the utility and BLDC motor drives to improve the PQ parameters. This paper proposes the shunt active power filter (SAF) for the PQ improvement of medium and high power BLDC motor drives. In this paper, the design steps and control of an SAF for a 20 kW BLDC motor drive are presented. The control of SAF is realized by applying the instantaneous “p–q” theory with the sinusoidal current control strategy. The current control is realized by a hysteresis controller. In contrast to normal electrical loads, the motor drive loads are subjected to continuous speed and load variations. This will result in fluctuations in the DC-link voltage of the SAF capacitor. Hence, the sliding mode controller is used for DC-link voltage control. The proposed methodology is validated in simulations and the experimental prototype. The enhancement of various PQ parameters is analysed for different loading conditions of the motor in the distorted and non-distorted distribution system voltage conditions.


Introduction
In recent years, Permanent Magnet Brushless DC motors have established their presence in domestic and industrial applications, as they have high torque weight ratio, high power density and less maintenance requirement. They are widely used in household appliances like fans, blowers, air conditioning units and industrial applications like compressors, industrial tools, robotics for precise motion control, automation and transportation.
In the construction point of view, the Brushless DC (BLDC) motor has a permanent magnet rotor and a three-phase winding that is distributed so as to produce the trapezoidal back EMF on the stator. The stator winding is energized by a Voltage Source Inverter (VSI). This VSI will act as an electronic commutator that energizes appropriate windings, based on the rotor position information [1]. The rotor position information is obtained from a set of Hall Effect position sensors and Sensor-less methods respectively as discussed in [2,3].
Usually, the low power BLDC motor drive contains a Diode Bridge Rectifier (DBR), which is energized from a single-phase distribution AC main, followed by a three-phase VSI with an intermediate DC-link capacitor for maintaining the constant DC-link voltage [4]. The DBR with a DC-link capacitor draws nonsinusoidal current from the distribution system. The Total Harmonic Distortion (THD) of the source current is high in the order of 65-70% which results in poor power factor (p.f) (0.6-0.7) at the single-phase distribution AC mains [5]. Such poor power quality (PQ) parameters in the distribution system are not acceptable, as they are not within the limits of international PQ standards [6][7][8].
Usually, the medium power BLDC motors of capacity more than 5 kW are powered from the three phase distribution AC mains followed by a DBR, DC-link capacitor and VSI. As the BLDC motor drive contains a power electronic converter in the front end, it possesses nonlinear characteristics and results in the propagation of harmonic currents into the distribution AC mains. The presence of harmonics in the distribution system will lead to greater power loss, malfunctioning of critical loads, failure of sensitive equipment and electromagnetic interference problems. Moreover, this harmonic current will produce a harmonic voltage drop in the source and feeder impedance, resulting in voltage harmonics in other non-polluting loads, which are connected to the same point of common coupling (PCC).
In recent years, the medium power BLDC motors in the range of 10-100 kW have been developed and used in various applications like blowers [9], automobiles, pumps, air conditioning units and connected to the three-phase distribution AC mains. Hence, they must comply with the International standards specified for harmonic current emissions [6][7][8]. As the PQ parameters of BLDC motor drives are not within the allowable margins stipulated by the above standards, this necessitates an appropriate method for improving the power quality.
The typical load current waveforms of nonlinear loads like a three-phase DBR with an RL load and a DBR with BLDC motor drive are shown in Figure 1. The load current of DBR with an RL load has the THD of 30.75% due to the nonlinear characteristics of DBR. However, the Pulse Width Modulation (PWM) based speed control and the electronic commutation of BLDC motor results in increased load current THD of 43.64% for the BLDC motor drive.
A passive filter comprising of inductor and capacitor is often inserted between the distribution AC mains and DBR to improve the PQ parameters. However, it requires a larger size of inductors and capacitors, which results in additional power loss and thereby reducing the drive efficiency. Besides, the passive filter is designed for eliminating harmonics of the particular frequency range, which results in fixed filtering characteristics and the source impedance adversely affects it. It may also lead to harmonic resonance by the interaction with other loads.
Power Factor Correction (PFC) converter comprising of switches and reactive elements such as inductors and capacitors are inserted between the DBR and VSI to improve PQ at the AC mains. The PFC converter, which employs a DC-DC converter topology like Buck, Boost, Buck-boost, CUK, ZETA, SEPIC and LUO converter for improving the PQ parameters of low power BLDC motor drives are reported in the works of literature [5,[10][11][12]. The bridgeless Landsman PFC converter for the PQ improvement of a 400 W BLDC motor drive is reported in [13]. The power electronic switches in these PFC converters are controlled suitably, so as to force the drive to draw a sinusoidal current from the AC mains. Such PFC converters result in improving the source p.f to near unity and reducing the THD of source current. However, the PFC converter which operates in discontinuous inductor current mode has high voltage stress on the switch.
The grid integration of solar PV fed BLDC motor drive is reported in [14]. The DC voltage of the capacitor is regulated to generate the reference value of the single-phase source current. This results in improved PQ parameters in the grid side. Besides the improvement of PQ parameters, the methods discussed in the works of literature [10][11][12][13][14] are limited to the low power BLDC motor drives only.
The authors in [15] stated that Active Front End rectifier (AFE) and Shunt Active Filter (SAF) have been considered as the best solutions to improve the PQ in AC mains for medium and high power motor drive applications.
The AFE rectifier has a front-end converter with a series inductor connected in all the three phases. The realization of sinusoidal source current is accomplished directly, by high-frequency switching of the converter switches. As the entire load power and the reactive power of the inductor flows through the converter, the rating of AFE rectifier depends on the load power and the value of the inductor.
Conversely, the sinusoidal source current is realized with the SAF, by the principle of load current compensation [16]. The SAF acts as a controlled current source, which realizes the reactive and harmonic component of the load current. Hence, the rating of SAF is lesser than AFE rectifier, since it injects only the reactive and harmonic component of the load current.
In the case of medium power BLDC motor drives up to 100 kW, the rating of SAF required for compensation is 50% lesser than AFE rectifier due to the lower displacement angle. Moreover, the SAF requires only the lower rating of switches, possessing better switch utilization and lower switching losses than the AFE rectifier for providing the compensation. As the SAF injects only the reactive and harmonic power, the value of DC-link capacitor required in the SAF is lower than the AFE rectifier. The lower value of the SAF converter rating and capacitor results in a reduction of converter size for medium power BLDC motor drives.
The authors in [17] propose the active filtering method that is applied to the switched reluctance motor drives, for maintaining the constant source current from the DC power supply. The role of SAF for the PQ improvement in the distribution system that contains the nonlinear loads like DBR with R load and reactive loads, by employing various control strategies like adaptive PI, Fuzzy logic control and sliding mode control has been presented in the works of literature [18][19][20][21][22]. However, the employability of SAF for the PQ improvement of BLDC motor drive applications is not found in the literature. Hence, this paper proposes the SAF to improve the PQ parameters of BLDC motor drive in the 3 phase distribution AC mains.
In this work, the instantaneous "p-q" theory with the sinusoidal current control strategy is adopted for the reference current calculation of SAF. The SAF current controller is realized by hysteresis control, as it is faster and easier to implement in digital controllers.
Usually, the mechanical loads connected to the BLDC motor may undergo frequent variations in applications like compressors and pumps. This will result in fluctuations in the DC-link voltage of the SAF capacitor. In order to realize the load current compensation at all instants, the DC-link voltage stabilization is mandatory. Hence, the sliding mode controller is adopted in this work for DC-link voltage control, since it is easier to implement and robust.
The role of SAF for the PQ improvement of BLDC motor drive is explained in Section 2. Section 3 describes the control of SAF that explains the power processing section, reference current calculation and controller section of SAF. Section 4 explains the design steps of SAF for a 20 kW BLDC motor drive. The PQ improvement of BLDC motor drive, which employs the SAF is validated in MATLAB SIMULINK. The PQ parameters such as THD of source current, source p.f. are analyzed for different loading conditions of the BLDC motor in various distribution system voltage conditions. The simulation results are presented in Section 5. The proposed system is validated in an experimental prototype and the experimental results are presented in Section 6. Finally, the conclusions are drawn in Section 7. The number of components required, the losses incurred in various components, the efficiency and the cost of the proposed method are compared with the bridgeless landsman PFC converter [13], AFE rectifier and presented in Appendix. Figure 2 shows the proposed system that contains the SAF for PQ improvement of the BLDC motor drive. The SAF is connected in parallel with the BLDC motor drive, for improving the PQ at the distribution AC mains. The BLDC motor is powered from the threephase distribution AC mains via DBR, intermediate DC-link capacitor for maintaining the constant DClink voltage, followed by a VSI that acts as a PWM inverter.

System description
The introduction of DBR with DC-link capacitor results in nonlinear load characteristics in the distribution system. The instantaneous value of nonlinear load current i L can be resolved into a fundamental active component i LF , a harmonic component i LH , and a reactive component i LQ . The SAF is designed for load current compensation and it injects the compensating current i C which equals the harmonic and reactive component of load current i LH and i LQ respectively. Hence, the current drawn from the source i S is nearly sinusoidal which contains the fundamental component with no phase angle displacement with respect to the source voltage. This will result in the prevention of the harmonic current propagation into the distribution system and improvement of the power factor.
The block diagram of SAF with its controller for PQ improvement of the BLDC motor drive is shown in Figure 3. The various blocks are explained in the following sections.

BLDC motor speed controller
The BLDC motor is powered from the three-phase distribution AC mains followed by a front-end three-phase DBR and VSI. The VSI consists of six MOSFET switches with inherent anti-parallel body diodes. The VSI functions as an electronic commutator and its operation is dictated by the rotor position information. The rotor position information is obtained by using hall sensors. The speed control of BLDC motor can be realized by manipulating the modulation index of the PWM pulses applied to the six MOSFET switches.

Shunt active filter
The SAF is realized by a VSI, having six numbers of MOSFETs with built-in anti-parallel diodes. The SAF is connected to the distribution AC mains through the interfacing reactor having the inductance of L f H and resistance of R f . The real power requirement of the load is supplied from the source, the reactive power and harmonic power requirement of the load are supplied from the SAF. The capacitor C f is connected across the DC-link of VSI.
The SAF does not inject into the load any part of the real power demand pertaining to the fundamental frequency. However, the SAF supplies the load real power components pertaining to the harmonic components as demanded by the nonlinear nature of the load. This harmonic power supplied to the load from the SAF causes a fall of the voltage across the DC-link capacitor of the SAF. The control system takes care to top up the

Shunt active filter controller
The SAF essentially contains two main sections (i) Power processing section (ii) Active filter controller section. The power processing section contains a VSI, having six MOSFETs and a Capacitor (C f ) connected across the DC-link. This section performs the power processing, by synthesizing the compensating current, which has been calculated by the active filter controller section. The active filter controller section has three main parts. (i) reference current calculation from the distorted load current (ii) the current controller for VSI (iii) voltage regulation of the DC-link capacitor.

Reference current calculation
The reference current of SAF is calculated by using the instantaneous p-q theory [23], since it is simple, effective, involves only algebraic calculations and can be easily implemented in digital controllers with minimum additional hardware.
Since the distribution system voltage may contain harmonics and be unbalanced, the controller section may have different control strategies like constant instantaneous power control, sinusoidal current control and generalized Fryze current control [24,25]. The sinusoidal current control strategy is applied in this work, for the SAF controller section.
The Phase Locked Loop (PLL) is used to extract the fundamental positive sequence component of the distribution system voltage.
The instantaneous power calculation block calculates the instantaneous powers of BLDC motor drive, based on the positive sequence component of the distribution system voltage from the PLL and the nonlinear load current of the BLDC motor drive. The instantaneous positive sequence component of phase voltage (V sa +,V sb +,V sc +) and the nonlinear load current (I la , I lb , I lc ) are transformed into α-β (orthogonal) coordinates V α , V β and I α , I β respectively in the Clarke transformation block. The instantaneous real and reactive power is calculated as below.
where p is the instantaneous real power and q is the instantaneous reactive power. The instantaneous real power and reactive power of the BLDC motor drive are shown in Figure 4. The balanced sinusoidal source voltage is applied from 0 to 0.02 s and the unbalanced non-sinusoidal source voltage is applied from 0.02 to 0.1 s to the BLDC motor drive. The load current contains harmonics due to its nonlinear characteristics and the harmonics content in the source voltage. This will result in oscillatory characteristics of the instantaneous real power (p) and reactive power (q). The instantaneous real power (p) contains the average

component (p avg ) and oscillation component (p osc ) that is separated by a moving average filter.
In order to make the source current as balanced and sinusoidal at unity p.f, the SAF should compensate all the harmonic components, reactive components as well as the non-positive sequence fundamental components of the load power. This can be realized by selecting the oscillation component of real power (p osc ) and instantaneous reactive power (q) for generating the reference currents in the power compensating section.
In addition, the SAF supplies the required real power to meet out the switching losses of the VSI switches, losses in the resistance of the interfacing reactor and the negative sequence real power of the load that is caused by the unbalance in the source voltage. This will lead to low-frequency DC voltage fluctuations across the SAF capacitor.
The DC voltage controller section maintains the constant voltage of SAF capacitor, against these lowfrequency DC voltage fluctuations, by drawing the necessary real power (p loss ) from the source. Since this real power (p loss ) is drawn from the source, the negative value of p loss is added with the oscillatory component of real power (due to harmonics) p osc and given as a reference to the power compensating section. The instantaneous reactive power (q) is given as another reference. Subsequently, the reference current calculation block calculates the reference current (I fa *, I fb *, I fc *) of SAF by applying inverse Clarke transformation as below.

Hysteresis current controller
The steady-state and dynamic performance of the SAF are prominently influenced by the methods applied to current control of the SAF and the reference current calculations. Since the mechanical load connected to the BLDC motor is continuously varying, the load current harmonics may change rapidly and the SAF should have a faster dynamic response in current control, for achieving the desired PQ parameters. Hence the hysteresis current control is implemented in this work, as it is conceptually simple, does not involve complex calculations, has a quicker dynamic response, better accuracy and can be easily implemented in the digital controllers. Figure 5 shows the hysteresis current control scheme of SAF. The measured SAF currents (I fa , I fb , I fc ) are compared with the reference currents (I fa *, I fb *, I fc *) in comparators. Each comparator determines the current error signal, which is given as input to the relay with a smaller hysteresis band. This relay determines the switching functions (S a (t), S b (t), S c (t)) of the MOSFET switches in the three inverter legs such that, the SAF current is forced to remain within the desired hysteresis band. When the error signal reaches the upper bound, the switching is done to reduce the SAF current and vice versa.
The width of the hysteresis band determines the switching frequency of the SAF [26]. The hysteresis bandwidth of 5% is chosen in this work and it results in switching frequency variation between 2 KHZ to 10 KHZ.

Sliding mode controller for capacitor voltage regulation
As the positive sequence components of the distribution system voltage (V sa +, V sb +, V sc +) are used to generate the reference current of SAF, the average component of real power (p avg ) contains only the fundamental positive sequence real power of the load. The oscillatory component of real power (p osc ) contains all the harmonics power and the fundamental negative sequence power of the load.
In order to accomplish the source current waveform as a balanced sinusoidal with unity p.f, the source must supply only the average component of load real power (p avg ). Hence, the SAF must supply the entire negative sequence power to the load, whose average value is not zero, which causes the low-frequency DC voltage variations in the capacitor (C f ). In addition, the switching losses of VSI switches and losses in the interfacing reactor also result in a drop of the DC-link voltage. Moreover, as the load on the BLDC motor is continuously changing, a large variation in the DC voltage across the capacitor is evident.
The DC voltage stabilization is achieved by using a Sliding Mode Controller [27]. Sliding Mode Control (SMC) is a nonlinear control technique that adjusts the dynamics of the nonlinear system by applying a discontinuous control signal.
SMC is designed to steer the system states on to a sliding surface.
The sliding surface S is designed as below.
where V DC is the measured DC voltage of capacitor (C f ) and V DC−REF is the reference value of DC voltage. The standard first-order sliding mode control is implemented in this paper.
The control action The sliding mode controller determines the loss component of real power (p loss ). The negative value of loss component (p loss ) is added with the harmonic component of real power (p osc ) and given as input to the reference current calculation block. The reactive power of the BLDC motor drive (q) is given as another input. The reference current calculation block calculates the reference current of SAF in orthogonal coordinates (α-β) by using the Equation (4). Further, the current in orthogonal (α-β) coordinates are converted into three-phase reference current (I fa * * , I fb * * , I fc * * ), by applying the inverse Clarke transformation Equation (5).

Stability analysis of voltage controller
The transfer function model for the voltage control loop of SAF is obtained as below. In MATLAB Simulink, a unit step input signal is applied at the reference input of DC-link voltage. The load disturbance is applied to the BLDC motor at 0.1 s. The variations in DC voltage across the capacitor (C f ) are observed and stored in the workspace as the variable name reference_input and cap_voltage respectively. The transfer function model is obtained using the following commands. mysys = iddata (cap_voltage, reference_input, 0.0001) sys = tfest (mysys, 3)  The following transfer function model is obtained for the closed-loop voltage control.

G(s) =
14.99 s 2 + 124 s + 7448 s 3 + 111.1 s 2 + 1890 s + 7600 The root locus plot of the system is obtained as shown in Figure 6.
From Figure 6, it is evident that the system contains three poles located at (−6.88,0), (−12.8,0), (−95,0) and two zeros located at (−4 + 24i), (−4−24i) in the complex "s" plane. The two dominant poles are (−6.88,0) and (−12.8,0). It is inferred from the root locus plots that, all the closed-loop poles are lying in the left half of the "s" plane and hence the system is stable.

Design of shunt active filter
The design steps of DC-link capacitor (C f ), interfacing inductor (L f ) of SAF [28] for the PQ improvement of a 110 V, 20 kW BLDC motor, fed from 3 phase 110 V line voltage is explained below.

DC-link capacitor voltage
The DC voltage of the capacitor must be greater than the peak value of the distribution system line voltage at all instants, in order to realize the control over the full cycle of AC input voltage.
For a three-phase full converter, the maximum DC output voltage is For the distribution system with V line = 110 V, Equation (9) gives the DC side voltage of a three phase full converter, where there is no series inductor on the AC side. In the case of SAF applications, because of the boost action of the series inductors in each phase, the Equation (9) is not applicable directly, however the empirical constraint as discussed herein is used. For the PWM converter operating in the linear modulation range, and for the amplitude modulation factor of 1 The allowable range of V C is (V S to 2V S ) for better controllablity, where V C is the AC output voltage of the converter and V S is the phase voltage at PCC. Hence for realizing the control, 2 Hence, the value of V DC is chosen as 300 V.

DC-link capacitance of SAF (C f )
The energy balance equation of the capacitor is From Figure 4, it is evident that the compensation real power that should be supplied by the SAF is less than 0.1 per unit (p.u). Since the base value of power is chosen as 20 kW, the required compensation power is less than 2 kW. If this has to be supplied by the SAF for a period of one AC cycle (20 × 10 −3 s) Hence, the value of C f is chosen as 1100 μF.

Inductor (L f )
The compensating current of the SAF contains the harmonic and reactive component of load current. The inductor should allow all these load harmonic currents into the PCC. It also should prevent the penetration of high-frequency switching harmonic currents, which are generated by the switching of VSI into the PCC.
n=2 n × ω × I nh (12) The harmonic profile of load current of a 20 kW BLDC motor drive is obtained from the simulation and shown in Table 1. The magnitude of load current is 104.5 A (peak), 73.92 (rms) and the THD is 28.44%.
Substituting the harmonic current components in (12) results in

Simulation results
The SAF is designed for a 20 kW BLDC motor drive and numerous simulations have been conducted, to validate the performance of the proposed method.
The rated DC voltage of the SAF capacitor is set at 300 V. The rms value of the source line voltage is set at 110 V. A 20 kW BLDC motor drive, which contains a three-phase DBR and VSI is connected as the load. The SAF is connected in parallel with the DBR, to compensate the harmonic and reactive power of the load. The system parameters are listed in Table 2.

PQ parameters with sinusoidal source voltage
Initially, the three-phase balanced sinusoidal source voltage of 110 V rms (line) value is applied to the BLDC motor drive and a load of 14 kW is applied to the BLDC motor. It is observed that the load current is non-sinusoidal and contains the switching ripples due to PWM switching of the VSI switches. The load current has the THD of 27.12% and its harmonic spectrum is shown in Figure 7(a). As the BLDC motor drive contains a six-pulse DBR in the front end, the harmonics in the order of (6n ± 1) is evident in the harmonic spectrum of the load current.
When the SAF is connected for the load current compensation, it injects the harmonic and reactive component of the load current. The improved harmonic spectrum of the source current is shown in Figure 7(b). It is observed that the THD of source current is improved to 1.28%, within the duration of one time-period from the instant of connection of SAF.
The waveforms of three-phase source voltage (v s ), source current after compensation (i s ), load current (i l ), SAF current (i f ) and DC-link voltage (v dc ) are shown in Figure 8. The load current is non-sinusoidal with the magnitude of 105 A (peak) and the source current is sinusoidal with the magnitude of 110 A (peak) and the source p.f is improved to 0.999. The contribution  of individual harmonics in the source current (i s ) and load current (i l ), PQ parameters such as THD and p.f are listed in Table 3.

PQ parameters with the non-sinusoidal source voltage
The presence of other nonlinear loads in the distribution system may result in voltage harmonics at the PCC, due to the harmonic voltage drop in the source and line impedance. Hence, the performance of the drive system has been evaluated in the non-sinusoidal distribution voltage conditions, by applying the 5th order harmonic of 0.1 p.u and the 7th order harmonic of 0.1 p.u with the sinusoidal source voltage of 110 V rms. This non-sinusoidal source voltage has the THD of 14.14% and the non-sinusoidal load current has the THD of 30.18%. It is evident that, the SAF improves the THD of source current to 3.17% despite higher source voltage THD of 14.14%.
The waveforms for this condition are shown in Figure 9. The contribution of individual harmonics in the source current (i s ) and load current (i l ), PQ parameters for the non-sinusoidal source voltage are listed in Table 4.

PQ parameters with the different loads and different speeds of BLDC motor
As the load on the BLDC motor is subjected to frequent changes, the SAF must have an appreciable dynamic response, in providing the load compensation, to attain better PQ parameters. Hence, the performance of the drive system is validated for the different level of loads in the BLDC motor. The 3-phase sinusoidal source voltage of 110 V (rms) is applied to the BLDC motor drive and a step-change in load from 7 to 14 kW is applied to the BLDC motor in 1500 rpm at 0.2 s. The load current has a magnitude of 105 A (peak) with the THD of 25.31%. The SAF injects the necessary compensating current and hence the source current THD is improved to 3.22%. It is evident that, the SAF has a better dynamic response to the load variations. The THD of load current and source current for various level of loads on the BLDC motor are listed in Table 5.
The waveforms of "a" phase source voltage (v sa ), source current (i sa ), load current (i la ), SAF current (i fa ), DC-link voltage (v dc ) and the speed of BLDC motor (N r ) for the change in load, applied at 0.2 s are shown in Figure 10.
The dynamic characteristics of THD of source current (i s ), THD of load current (i L ) and DC-link voltage (v dc ) for a step-change in load, that is applied at 0.1 s is shown in Figure 11. It is observed that the THD reaches the acceptable value of 5% and the DC-link voltage is stabilized within the time duration of 0.02 s.

Experimental verification
The experimental prototype model of the BLDC motor drive is shown in Figure 12(b). The SAF prototype model as shown in Figure 12(a) is connected to the PCC, for improving the PQ parameters of the threephase distribution system that contains the BLDC motor drive.   The BLDC motor drive as shown in Figure 13 contains a three-phase DBR and a three-phase Graetz bridge converter which employs six MOSFETs arranged in three legs. The speed of the BLDC motor is varied, by changing the modulation index of PWM pulses applied to the MOSFETs, by using a PIC16F877A microcontroller. In addition, the electronic commutation is carried out in the Graetz bridge converter, based on the hall sensor signals of the BLDC motor. The waveforms of the hall sensor signal output from the BLDC motor is shown in Figure 14.   The experimental prototype of SAF contains the three-phase isolated 24 V power supply arrangement. The three-phase Graetz bridge converter is connected to the PCC through an interfacing transformer that provides the filter reactance. The system parameters   The distorted load current of the BLDC motor drive and the distribution system voltage are measured by using the current and potential transformers. The measured voltage and current signals from each phase are signal conditioned by using the operational amplifiers and applied to the ADC of PIC 16F877A microcontroller.
The instantaneous reactive power algorithm which employs the Clarke and inverse Clarke transformation is implemented in the form of algebraic equations in the PIC16F877A microcontroller.
The waveforms of sinusoidal distribution system voltage, non-sinusoidal load current of the BLDC motor drive and the reference value of compensating current generated from the microcontroller are shown in Figure 15. The DC voltage across the SAF capacitor is shown in Figure 16.
The three-phase load current waveforms of the BLDC motor drive and its harmonic spectrum are shown in Figure 17(a,b), respectively.
In order to make the source current as sinusoidal and in-phase with the distribution system voltage, the necessary compensation current is injected by the SAF at the PCC. The compensation current from the SAF is realized by applying necessary switching pulses to the central Graetz bridge converter of SAF.
The waveforms of the compensated source currents are recorded and the R phase current is shown in Figure 18(a). The FFT of R phase source current is shown in Figure 18(b). The source current has improved to a closer sinusoidal wave with the THD of 3.9% while the load current is rich in harmonics. While the waveform of the source current has become sinusoidal, it contains the harmonics at the multiples of the switching frequency due to the switching of the MOSFETs. The waveforms of the R phase load current and the compensated source current for an increasing load of the BLDC motor is shown in Figure 19(a,b), respectively.

Conclusion
The maintenance of power quality in the utility system is a mandatory requirement especially when nonlinear loads are connected across the AC lines. It is possible that the critical loads are affected when nonlinear loads are connected across the bus bars. The introduction of BLDC motor drive in the distribution system results in poor power quality parameters on the utility side. This paper has presented an effective method, using the shunt active power filter, to improve the power quality parameters on the utility side, when a BLDC drive is connected to the distribution system. The compensation current controller has been implemented by hysteresis current control and the DC-link voltage controller has been implemented by the sliding mode controller.
The power quality parameters such as THD, and power factor on the source side of the BLDC drive system for different loading conditions of the BLDC motor with sinusoidal and non-sinusoidal source voltage conditions have been analyzed. It has been observed that the control of SAF using instantaneous "p-q" theory with the sinusoidal current control strategy provides better power quality parameters with the faster response of less than one time-period, for all types of source voltage conditions. The simulation and experimental results have validated the proposed methodology and the power quality parameters are in compliance with the standards.

Disclosure statement
No potential conflict of interest was reported by the author(s).

ORCID
S. Kumaresan http://orcid.org/0000-0003-2716-9845 Table A1. Calculation of losses and efficiency of the PFC converter and the SAF used for the power quality improvement of a 100 W BLDC motor drive.
PFC converter for BLDC motor drive [13] SAF