CHAPTER 4 IMPLEMENTATION OF ADALINE IN MATLAB

Similar documents
Current Rebuilding Concept Applied to Boost CCM for PF Correction

Fourier Signal Analysis

Harmonic Distortions Analyzer for Power Rectifiers

Discrete Fourier Transform (DFT)

THE HONG KONG POLYTECHNIC UNIVERSITY Department of Electronic and Information Engineering. EIE2106 Signal and System Analysis Lab 2 Fourier series

A new approach to monitoring electric power quality

Scanning Digital Radar Receiver Project Proposal. Ryan Hamor. Project Advisor: Dr. Brian Huggins

ME 365 EXPERIMENT 8 FREQUENCY ANALYSIS

THE SINUSOIDAL WAVEFORM

DC and AC Circuits. Objective. Theory. 1. Direct Current (DC) R-C Circuit

CHAPTER 6 UNIT VECTOR GENERATION FOR DETECTING VOLTAGE ANGLE

Supplementary Figures

CHAPTER 6 BACK PROPAGATED ARTIFICIAL NEURAL NETWORK TRAINED ARHF

Laboratory Experiment #1 Introduction to Spectral Analysis

Grid Power Quality Analysis of 3-Phase System Using Low Cost Digital Signal Processor

Lecture 3 Complex Exponential Signals

Adaptive linear learning for on-line harmonic identification: An overview with study cases

DFT: Discrete Fourier Transform & Linear Signal Processing

AC Theory and Electronics

Simulate IFFT using Artificial Neural Network Haoran Chang, Ph.D. student, Fall 2018

ENGR 210 Lab 12: Sampling and Aliasing

Circuit Analysis-II. Circuit Analysis-II Lecture # 2 Wednesday 28 th Mar, 18

Suggested Solutions to Examination SSY130 Applied Signal Processing

ESE 150 Lab 04: The Discrete Fourier Transform (DFT)

ELEC3242 Communications Engineering Laboratory Amplitude Modulation (AM)

SigCal32 User s Guide Version 3.0

Chapter 4 SPEECH ENHANCEMENT

ESE 150 Lab 04: The Discrete Fourier Transform (DFT)

CHAPTER 6. CALCULATION OF TUNING PARAMETERS FOR VIBRATION CONTROL USING LabVIEW

Problem Set 1 (Solutions are due Mon )

Biomedical Signals. Signals and Images in Medicine Dr Nabeel Anwar

Experiment 1 Alternating Current with Coil and Ohmic Resistors

ECEn 487 Digital Signal Processing Laboratory. Lab 3 FFT-based Spectrum Analyzer

Free vibration of cantilever beam FREE VIBRATION OF CANTILEVER BEAM PROCEDURE

SYSTEM ONE * DSP SYSTEM ONE DUAL DOMAIN (preliminary)

UNIVERSITY OF NORTH CAROLINA AT CHARLOTTE Department of Electrical and Computer Engineering

A Prototype Wire Position Monitoring System

Lab 3 FFT based Spectrum Analyzer

ET 304A Laboratory Tutorial-Circuitmaker For Transient and Frequency Analysis

The Discrete Fourier Transform. Claudia Feregrino-Uribe, Alicia Morales-Reyes Original material: Dr. René Cumplido

TRANSFORMS / WAVELETS

USE OF BASIC ELECTRONIC MEASURING INSTRUMENTS Part II, & ANALYSIS OF MEASUREMENT ERROR 1

Development of Mathematical Models for Various PQ Signals and Its Validation for Power Quality Analysis

CHAPTER 5 CONTROL SYSTEM DESIGN FOR UPFC

Experiment 2: Electronic Enhancement of S/N and Boxcar Filtering

Optimization of Existing Centroiding Algorithms for Shack Hartmann Sensor

CHAPTER 5 PERFORMANCE EVALUATION OF SYMMETRIC H- BRIDGE MLI FED THREE PHASE INDUCTION MOTOR

Michael F. Toner, et. al.. "Distortion Measurement." Copyright 2000 CRC Press LLC. <

DSP First. Laboratory Exercise #2. Introduction to Complex Exponentials

Department of Electronic Engineering NED University of Engineering & Technology. LABORATORY WORKBOOK For the Course SIGNALS & SYSTEMS (TC-202)

Laboratory Assignment 4. Fourier Sound Synthesis

DSP First, 2/e. LECTURE #1 Sinusoids. Aug , JH McClellan & RW Schafer

Statistical Pulse Measurements using USB Power Sensors

Spectrum Analysis: The FFT Display

CMPT 368: Lecture 4 Amplitude Modulation (AM) Synthesis

Generating DTMF Tones Using Z8 Encore! MCU

Development of 4/16-Channel Data Acquisition System Using Lab VIEW

A linear Multi-Layer Perceptron for identifying harmonic contents of biomedical signals

Music 171: Amplitude Modulation

Experiments #6. Convolution and Linear Time Invariant Systems

3D Distortion Measurement (DIS)

Objectives. Abstract. This PRO Lesson will examine the Fast Fourier Transformation (FFT) as follows:

EXPERIMENT 4 INTRODUCTION TO AMPLITUDE MODULATION SUBMITTED BY

Laboratory Assignment 1 Sampling Phenomena

Topic 6. The Digital Fourier Transform. (Based, in part, on The Scientist and Engineer's Guide to Digital Signal Processing by Steven Smith)

A Faster Method for Accurate Spectral Testing without Requiring Coherent Sampling

ME scope Application Note 01 The FFT, Leakage, and Windowing

Study on Multi-tone Signals for Design and Testing of Linear Circuits and Systems

DSP Based Lock-in Amplifier

Here are some of Matlab s complex number operators: conj Complex conjugate abs Magnitude. Angle (or phase) in radians

THE BENEFITS OF DSP LOCK-IN AMPLIFIERS

Phasor. Phasor Diagram of a Sinusoidal Waveform

User-friendly Matlab tool for easy ADC testing

An Interactive Tool for Teaching Transmission Line Concepts. by Keaton Scheible A THESIS. submitted to. Oregon State University.

Matching and Locating of Cloud to Ground Lightning Discharges

Laboratory set-up for Real-Time study of Electric Drives with Integrated Interfaces for Test and Measurement

Experiment 1 LRC Transients

Electrical & Computer Engineering Technology

Time Matters How Power Meters Measure Fast Signals

Introduction. sig. ref. sig

Basic Signals and Systems

Frequency Domain Representation of Signals

Real Analog - Circuits 1 Chapter 11: Lab Projects

Alternative View of Frequency Modulation

Linear Time-Invariant Systems

Modulation. Digital Data Transmission. COMP476 Networked Computer Systems. Analog and Digital Signals. Analog and Digital Examples.

Estimation of Vibrations in Switched Reluctance Motor Drives

Using SigLab with the Frequency Domain System Identification Toolbox

CHAPTER 4 FIELD PROGRAMMABLE GATE ARRAY IMPLEMENTATION OF FIVE LEVEL CASCADED MULTILEVEL INVERTER

Signals. Periodic vs. Aperiodic. Signals

Capacitive MEMS accelerometer for condition monitoring

CHAPTER 4 MULTI-LEVEL INVERTER BASED DVR SYSTEM

BME/ISE 3511 Laboratory One - Laboratory Equipment for Measurement. Introduction to biomedical electronic laboratory instrumentation and measurements.

Digital Video and Audio Processing. Winter term 2002/ 2003 Computer-based exercises

Rotation of Coordinates With Given Angle And To Calculate Sine/Cosine Using Cordic Algorithm

Alternating voltages and currents

Experiment: P34 Resonance Modes 1 Resonance Modes of a Stretched String (Power Amplifier, Voltage Sensor)

Chapter 2 Shunt Active Power Filter

Engineering Thesis. The use of Synchronized Phasor Measurement to Determine Power System Stability, Transmission Line Parameters and Fault Location

y(n)= Aa n u(n)+bu(n) b m sin(2πmt)= b 1 sin(2πt)+b 2 sin(4πt)+b 3 sin(6πt)+ m=1 x(t)= x = 2 ( b b b b

Transcription:

52 CHAPTER 4 IMPLEMENTATION OF ADALINE IN MATLAB 4.1 INTRODUCTION The ADALINE is implemented in MATLAB environment running on a PC. One hundred data samples are acquired from a single cycle of load current with the help of a PQA which employs FFT algorithm. These data samples are applied to the ADALINE algorithm, implemented in MATLAB running on a PC and the simulation results are compared with the results obtained from the PQA. 4.2 MATLAB ENVIRONMENT MATLAB provides an elegant and powerful environment to implement algorithms and methodologies specially designed for scientific and engineering computations (Sivanandam et al 2006). It integrates computation, visualization and programming in an environment where problems and solutions are expressed in mathematical representation. The typical applications of MATLAB include: Mathematical computations Algorithm development Modeling, simulation and prototyping Data analysis, exploration and visualization Scientific and engineering graphics, Application development including graphical user interface building.

53 4.3 BLOCK DIAGRAM OF THE SETUP A PC is a typical example for nonlinear load. In the experiment, a PC is supplied with 230V AC from the mains. The PQA C.A 8332 is used for capturing and studying the characteristics of the supply voltage and load current waveforms. A type MN93A current sensor is used for measuring the load current. The instantaneous values of the load current at every 200µs in one complete cycle of the load current are read from the screen of the PQA manually. Thus 100 samples in one cycle of current waveforms with a period of 20ms are obtained. These values are incorporated in the MATLAB code for ADALINE model. The block diagram of the experimental setup is shown in Figure 4.1. Nonlinear load (PC) AC Source 230V, 50Hz Current Sensor, MN93A MATLAB Current input Voltage input Power Quality Analyser C.A 8332 Figure 4.1 Block diagram of the MATLAB experimental setup

54 4.4 IMPLEMENTATION OF ADALINE IN MATLAB the following: The ADALINE model given in Figure 3.6 in Section 3.7 consists of The training vector X(k); One layer of n neurons whose individual outputs are the product of its input values from the training vector X(k) and weight W nk ; A summation element, whose inputs are from all the n neurons and the output is the summation given by, y (k) = x 1 w 1 +x 2 w 2 + +x n w n at every iteration instant k; A comparator which compares y (k) and the instantaneous load current value y(k), sampled at every instant k; The error output from the comparator, calculated by e(k)= y(k)-y (k) and An algorithm for updating the weights w 1,w 2,,w n based on the LMS rule, taking e(k) as its input. 4.4.1. Formation of Training Vector The training vector X(k) of size 80 100 elements is formed as explained below. Each column in the vector represents the possible linear combination of the fundamental and harmonics components. The components themselves are coded as a combination of sine and cosine terms as given by Equation (3.33).

55 sin sin 2 sin 3 sin 4 sin 5... sin100 cos cos 2 cos 3 cos 4 cos5... cos100 sin 2 sin 4 sin 6 sin 8 sin10... sin 200 cos 2 cos 4 cos 6 cos8 cos10... cos 200 sin 3 sin 6 sin 9 sin12 sin15... sin 300 X ( k) cos 3 cos 6 cos 9 cos12 cos15... cos300........................... sin 40 sin 4000 cos 40 cos 4000 (4.1) w = / 100 = 3.6. 4.4.2 The Weight Vector The weight vector, W(k) is given in Equation (4.2). The index k represents the iteration instant, which varies from 1 to 100, corresponding to 100 samples from the load current waveform. The input waveform has to be resolved up to 40 th order of harmonics. For every order of harmonics to be resolved, a sine and cosine terms are needed in the input vector. Hence, the input vector X(k) has 80 rows. Correspondingly, the weight vector also has 80 rows. The indices 1,2,3,,80 represent these weight values at every iteration instant k. W ( k) w w w w w w... w w (4.2) 1k 2k 3k 4k 5k 6k 79k 80k T

56 4.4.3 Acquisition of Current Values One complete cycle of current waveform of a PC used in the laboratory, is captured and displayed on the screen of the PQA. The displayed waveform is reproduced in Figure 4.2. By moving the cursor along the x axis, the instantaneous values of load current, which are given as y(k), at every 200µs, from the positive zero crossing instant, are noted. The measured instantaneous values are given in Table 4.1. Figure 4.2 Voltage and current waveforms of a PC captured by PQA

57 Table 4.1 Instantaneous values of load current measured by PQA Time, k (ms) Load Current, y(k) (A) Time, k (ms) Load Current, y(k) (A) Time, k (ms) Load Current, y(k) (A) Time, k (ms) Load Current, y(k) (A) 0.20 0.02 5.20 2.85 10.20-0.31 15.20-2.12 0.40 0.03 5.40 2.97 10.40-0.32 15.40-2.02 0.60 0.03 5.60 2.72 10.60-0.31 15.60-2.04 0.80 0.04 5.80 2.44 10.80-0.31 15.80-1.67 1.00 0.03 6.00 2.09 11.00-0.31 16.00-1.45 1.20 0.02 6.20 1.76 11.20-0.30 16.20-1.07 1.40 0.02 6.40 1.47 11.40-0.28 16.40-0.35 1.60 0.00 6.60 1.27 11.60-0.28 16.60-0.01 1.80-0.01 6.80 0.71 11.80-0.28 16.80-0.13 2.00-0.02 7.00-0.39 12.00-0.27 17.00 0.03 2.20-0.02 7.20-0.39 12.20-0.27 17.20-0.02 2.40-0.03 7.40-0.38 12.40-0.25 17.40-0.07 2.60-0.04 7.60-0.30 12.60-0.24 17.60-0.08 2.80-0.05 7.80-0.26 12.80-0.24 17.80-0.03 3.00 0.11 8.00-0.24 13.00-0.19 18.00 0.02 3.20-0.10 8.20-0.25 13.20-0.17 18.20 0.04 3.40-0.09 8.40-0.32 13.40-0.18 18.40-0.02 3.60-0.10 8.60-0.30 13.60-0.18 18.60-0.02 3.80 0.04 8.80-0.37 13.80-0.20 18.80-0.01 4.00 0.37 9.00-0.30 14.00-0.28 19.00 0.00 4.20 1.20 9.20-0.31 14.20-0.77 19.20 0.01 4.40 1.65 9.40-0.30 14.40-1.19 19.40 0.01 4.60 2.25 9.60-0.33 14.60-1.75 19.60 0.01 4.80 2.57 9.80-0.34 14.80-2.02 19.80 0.01 5.00 2.73 10.00-0.34 15.00-2.04 20.00 0.00

58 The waveform of the load current reconstructed from the readings given in Table 4.1 is given in Figure 4.3. 4 3 2 1 0-1 -2-3 Load Current waveform of A Personal Computer 1 11 21 31 41 51 61 71 81 91 101 sample number Figure 4.3 Load current waveform of a PC reconstructed from the readings of PQA 4.4.4 Iteration of the ADALINE Algorithm The ADALINE algorithm for measuring the harmonics present in the load current waveform is given below. Step 1: The weight vector is initialised to random values near zero. The selected after several simulation trials which gives a faster convergence with a minimum error Step 2: The 1 st column of training vector values is presented to the ADALINE nodes. These values are multiplied with their corresponding weights. The individual products are summed in the summing node whose output becomes, y (1) = x 1,1 w 1,1 + x 2,1 w 2,1+ x 3,1 w 3,1+ + x 80,1 w 80,1 (4.3)

59 Step 3: The value y (1) from the Equation (4.3) is compared with the 1 st sample from the load current waveform, y(1) and the error value is computed as, e(1)=y(1) y (1) (4.4) Step 4: This error value is used in the weight updating formula as, W ( k 1) W ( k) e( k) X ( k) T X ( k) X ( k) (4.5) Step 5: Iteration is continued until all the 100 columns of training vector and the 100 samples of load current are presented to the ADALINE algorithm and the weights updated. The steps 2-5 represent 1 epoch. Step 6: The obtained error value e(k) is compared with the desired small error value e d, which satisfies the accuracy requirements. Step 7: If the obtained error e(k) is more than the desired error value e d, steps 2-6 are repeated Step 8: If the obtained error value e(k) is less than the desired error value, then the ADALINE has converged. The weight vector is then taken as W F. The amplitudes of harmonics up to the 40 th order are computed using the Equation (3.38). The convergence property of the ADALINE algorithm is shown in Figure 4.4, which proves that the obtained error becomes less then the desired error in 3 epochs. The ADALINE algorithm is explained in the flowchart given in Figure 4.5.

Figure 4.4 Plot showing the convergence of ADALINE algorithm 60

61 Start Form the training vector X(k) e d (k) = 0.01 Initialise weight values Set epoch=1 Set k=1 epoch=epoch+1 k=k+1 Apply k th training vector ; Multiply with k th weight vector; y kj x W kj for j=1 to 80; Get y(k); e(k) = y(k) y Yes k No e(k) d No Yes Set weight vector as W Yes 0 ; 2 2 Compute A W 2n 1 W 2n n F F Stop Figure 4.5 Flow chart for the execution of ADALINE algorithm

62 4.5 SIMULATION RESULTS After the ADALINE algorithm is converged, the values of the harmonics are calculated using Equation (3.38). These values are given in Table 4.2. The same load current waveform is analysed using the PQA, which employs FFT for harmonics measurement. The values obtained from the PQA are given in Table 4.3. The magnitude of the n th harmonic is given as a ratio of its value and the RMS load current expressed in percentage. Table 4.2 Magnitudes of harmonics computed with ADALINE using MATLAB Harmonics order (n) Amplitude A n, % Harmonics order (n) Amplitude A n, % Harmonics Order (n) Amplitude A n, % 1 67.62 15 1.35 29 1.07 2 18.19 16 4.24 30 0.72 3 57.24 17 2.08 31 2.02 4 11.44 18 3.11 32 1.09 5 39.29 19 2.20 33 1.71 6 4.36 20 1.54 34 0.98 7 19.68 21 1.44 35 0.54 8 2.79 22 1.55 36 0.36 9 5.37 23 0.62 37 1.30 10 4.53 24 1.61 38 0.17 11 4.39 25 1.15 39 1.30 12 3.91 26 1.34 40 0.14 13 4.45 27 1.08 14 2.91 28 1.33

63 Table 4.3 Magnitudes of harmonics measured by the PQA Harmonics order (n) Amplitude A n, % Harmonics order (n) Amplitude A n, % 1 68.4 21 1.5 2 18.1 22 1.5 3 57.8 23 0.5 4 11.6 24 1.5 5 39.7 25 1.0 6 4.7 26 1.4 7 19.5 27 1.0 8 2.6 28 1.2 9 5.4 29 1.0 10 4.6 30 0.9 11 4.2 31 1.1 12 4.1 32 0.8 13 4.3 33 0.8 14 2.7 34 0.9 15 1.5 35 1.3 16 4.0 36 1.1 17 2.0 37 0.9 18 3.1 38 0.7 19 2.3 39 1.0 20 1.5 40 0.8 The harmonic values computed by the ADALINE algorithm are also represented in the form of a bar chart in Figure 4.6 for a quick understanding.

64 80 70 60 50 40 30 20 10 0 Harmonics computed by ADALINE 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 Order of harmonics Figure 4.6 Harmonics computed by ADALINE shown as a bar chart The values of harmonics computed using ADALINE algorithm executed in MATLAB and the values obtained from PQA are compared in the Figure 4.7. The figure shows that the output of harmonic amplitudes computed by the ADALINE network for the real-time load current waveform is comparable with that of a standard PQA. 80 70 Comparison of PQA and ADALINE results PQA Results ADALINE Results 60 50 40 30 20 10 0 1 6 11 16 21 26 31 36 Order of harmonics Figure 4.7 Comparison of results of ADALINE in MATLAB and PQA

65 4.6 SUMMARY In this chapter, the methodology for implementing ADALINE in MATLAB is fully explored. The setup for acquiring the sampled values of load current waveform in real-time with a PC as the nonlinear load is illustrated. The formation of training vector of 80 100 elements and the iteration steps for updating the weights of the ADALINE nodes are explained. The error values after each epoch is compared with the desired error value and the epochs repeated if the errors are more than the specified levels. It is observed that, after 3 epochs, the errors are found to be very small, indicating that the ADALINE algorithm has converged. The amplitudes of fundamental and the harmonic components are computed. The same load current waveform is studied and the harmonics are resolved using the PQA. The simulation results obtained using the proposed methodology are compared with the results obtained from the PQA. It is found that the differences between the two set of values obtained from FFT and ADALINE are small and insignificant. The convergence and the results of the proposed implementation demonstrate that 100 data samples from a single cycle of load current are sufficient to resolve the given nonsinusoidal waveform into fundamental and other harmonic components. The simulation of ADALINE in MATLAB using data from the real-time load current waveform forms the basis of implementation on DSP and FPGA platforms.