Matlab Documentation

download Matlab Documentation

of 21

Transcript of Matlab Documentation

2.MATLAB

2.1 INTRODUCTION

MATLAB has been developed by Math Works Inc. It is a powerful Software package used for high performance scientific numerical computation, Data analysis, visualization and programming in an easy to use environment where problems and solution are expressed in familiar Mathematical notations.

MATLAB stands for MATLAB laboratory. The combination of analysis capabilities, flexibility, reliability and powerful graphics makes MATLAB the main software package for power system engineers . This is because unlike other programming languages where we have to declare matrices and operate on them with their indices, MATLAB provides matrix as one of the basic elements. It provides basic operation like addition, subtraction, multiplication by use of simple mathematical operators. Also we need to declare the type and size of any variable in advance. It is dynamically decided depending on what value we assign to it. But MATLAB is case sensitive and so we have to be careful about the case of variables while using them in our program.MATLAB gives an interactive environment with hundreds of reliable and accurate built in functions. These functions help in providing the solution to a variety of mathematical problems including matrix algebra, linear system, a differential equations, optimization , non-linear system and many other types of scientific and technical computations. The most important feature of MATLAB is its programming capability, which supports both types of programming, object oriented and structured programming which is very easy to learn, use, and allow user developed functions. It facilitates access to FORTRAN and C codes by means of external interfaces. There are several optional tool boxes for simulating specialized problems of different areas and extensions to link up MATLAB and other programs. Simulink is a program built on top of MATLAB environment, which along with its specialized products, enhances the power of MATLAB for scientific simulations and visualization.

2.2 OVERVIEW OF MATLAB:

MATLAB is a high performance language for technical computing .It integrates Computation, visualization, and programming in an easy-to-use environment where problems and solutions are expressed in familiar mathematical notation. Typical uses include Math and computation Algorithm development Data acquisition Modeling, simulation, and prototyping Data analysis, exploration, and visualization Scientific and engineering graphicsApplication development, including graphical user interface building

MATLAB is an interactive system whose basic data element is an array that does not require dimensioning. This allows you to solve many technical computing problems, especially those with matrix and vector formulations, in a fraction of the time it would take to write a program in a scalar non interactive language such as C or FORTRAN.

The name MATLAB stands for matrix laboratory. MATLAB was originally written to provide easy access to matrix software developed by the LINPACK and EISPACK projects. Today, MATLAB engines incorporate the LAPACK and BLAS libraries, embedding the state of the art in software for matrix computation.MATLAB has evolved over a period of years with input from many users. In university environments, it is the standard instructional tool for introductory and advanced courses in mathematics, engineering, and science.

In industry, MATLAB is the tool of choice for high-productivity research, development, and analysis. MATLAB features a family of add-on application-specific solutions called toolboxes. Very important to most users of MATLAB, toolboxes allow you to learn and apply specialized technology. Toolboxes are comprehensive collections of MATLAB functions (M-files) that extend the MATLAB environment to solve particular classes of problems. Areas in which toolboxes are available include signal processing, control systems, neural networks, fuzzy logic, wavelets, simulation, and many others.

2.3 MATLAB SYSTEMThe MATLAB system consists of these main parts:2.3.1 DESKTOP TOOLS AND DEVELOPMENT ENVIRONMENTThis is the set of tools and facilities that help you use MATLAB functions and files. Many of these tools are graphical user interfaces. It includes the MATLAB desktop and Command Window, a command history, an editor and debugger, a code analyzer and other reports, and browsers for viewing help, the workspace, files, and the search path.2.3.2 MATLAB MATHEMATICAL FUNCTION LIBRARYThis is a vast collection of computational algorithms ranging from elementary functions, like sum, sine, cosine, and complex arithmetic, to more sophisticated functions like matrix inverse, matrix Eigen values, Bessel functions, and fast Fourier transforms.2.3.3 MATLAB LANGUAGEThis is a high-level matrix/array language with control flow statements, functions, data structures, input/output, and object-oriented programming features. It allows both "programming in the small" to rapidly create quick and dirty throw-away programs, and "'programming in the large" to create large and complex application programs.2.3.4 GRAPHICSMATLAB has extensive facilities for displaying vectors and matrices as graphs, as well as annotating and printing these graphs. It includes high-level functions for two-dimensional and three-dimensional data visualization, image processing, animation and presentation graphics. It also includes low-level functions that allow you to fully customize the appearance of graphics as well as to build complete graphical user interfaces on your MATLAB applications.2.3.5 MATLAB EXTERNAL INTERFACESThis is a library that allows you to write C and FORTRAN programs that interact with MATLAB. It includes facilities for calling routines from MATLAB (dynamic linking), calling MATLAB as a computational engine, and for reading and writing MAT-files.

2.3.6 MATLAB DOCUMENTATIONMATLAB provides extensive documentation, in both printable and HTML format, to help you learn about and use all of its features. If you are a new user, start with this Getting Started book. It covers all the primary MATLAB features at a high level, including many examples.To view the online documentation, select MATLAB Help from the Help menu in MATLAB. Online help appears in the Help browser, providing task-oriented and reference information about MATLAB features.The MATLAB documentation is organized into these main topics: Desktop Tools and Development Environment - Startup and shutdown, the desktop and other tools that help you use MATLAB. Mathematics - Mathematical operations Data Analysis - Data analysis, including data fitting, Fourier analysis, and time-series tools Programming - The MATLAB language and how to develop MATLAB applications Graphics - Tools and techniques for plotting, graph annotation, printing, and programming with Handle Graphics 3-D Visualization - Visualizing surface and volume data, transparency, and viewing and lighting techniques Creating Graphical User Interfaces - GUI-building tools and how to write callback functions External Interfaces - MEX-files, the MATLAB engine, and interfacing to Java, COM, and the serial port.MATLAB also includes reference documentation for all MATLAB functions: "Functions - By Category" - Lists all MATLAB functions grouped into categories Handle Graphics Property Browser - Provides easy access to descriptions of graphics object properties C and Fortran API Reference - Covers those functions used by the MATLAB external interfaces, providing information on syntax in the calling language, description, arguments, return values, and examplesThe MATLAB online documentation also includes Examples - An index of examples included in the documentation Release Notes - New features, compatibility considerations, and bug reports Printable Documentation - PDF versions of the documentation suitable for printing.In addition to the documentation, you can access demos from the Help browser by clicking the Demos tab. Run demos to learn about key functionality of Math Works products and tools.2.4 STARTING MATLABOn windows platforms, start MATLAB by double-clicking the MATLAB shortcut icon on your Windows desktop.On UNIX platforms, start MATLAB by typing MATLAB at the operating system prompt.You can customize MATLAB startup. For example, you can change the directory in which MATLAB starts or automatically execute MATLAB statements in a script file named startup M-file.2.5 MATLAB DESKTOPWhen you start MATLAB, the MATLAB desktop appears, containing tools (graphical user interfaces) for managing files, variables, and applications associated with MATLAB.The following illustration shows the default desktop. You can customize the arrangement of tools and documents to suit your needs.

Command window

3. REVIEW OF INDUCTION MOTOR

3.1 INTRODUCTION OF INDUCTION MOTORIn general, conversion of electrical power into mechanical power takes place in the rotating part of an electric motor. In DC motor, the electrical power is conducted directly to the armature through brushes and commutator. Therefore, the DC motor can be called as conduction motor. However, in AC motor, the rotor does not receive electric power by conduction but by induction in exactly the same way of the secondary of a 2-winding transformer receives its power from the primary. These motors are called induction motors. The induction motor can be treated as rotating transformer. i.e., one in which primary winding is stationary but the secondary is free to rotate.3.1.1 CONSTRUCTIONAn Induction Motor consists essential of two main parts:(a) Stator and(b) Rotor(a) STATOR

The stator of an induction motor is similar to that of a synchronous machine and is wound for three phrases and it is fed from a three phase supply it is wound for a definite number of poles, the exact number of poles being determined by the requirement of speed. Greater the number of poles, lesser the speed and vice versa. The stator windings supplied with 3-phase currents produces a magnetic flux which is of constant magnitude but which revolves at synchronous speed. This revolving magnetic flux induces an e.m.f in the rotor by mutual induction. (b) ROTOR1) Squirrel-cage Rotor: Motors employing this type of rotor are known as squirrel cage induction motors.2) Phase-wound or wound Rotor: Motors employing this type of rotor are variously known as phase wound motors or wound motors or as slip ring motors.

SQUIRREL-CAGE ROTORSAlmost 90% of induction motors are squirrel cage type, because this type of rotor has the simplest and most rugged construction imaginable and is almost indestructible. The rotor consists of a cylindrical laminated core with parallel slots for carrying the rotor conductors, which, it should be noted clearly, are not wires but consists of heavy bars of copper, aluminium or alloys. One bar is placed in each slot, rather the bars are inserted from the end when semi-closed slots are used. The rotor bars are brazed or electrically welded or bolted to two heavy and stout short-circuiting end-rings, thus giving us, so called a squirrel-cage construction.Rotor bars are permanently short circuited on them, hence it is not possible to add any external resistance in series with the rotor circuit for starting purposes.The rotor slots are usually not parallel to the shaft but are purposely given as slight skew. This is useful in two ways:1) It helps to make the motor run quietly by reducing the magnetic hum and2) It helps in reducing the locking tendency of the rotor i.e. the tendency of the rotor teeth to remain under the stator teeth due to direct magnetic attraction between the two.PHASE-WOUND ROTOR:This type of rotor is provided with 3-phase, double layer, distributed winding consisting of coils as used alternators. The rotor is wound for as many poles as the number of stator poles and is always wound three phases even when the stator is wound two phases.The three phases are starred internally. The other winding terminals are brought out and connected to three insulated slip rings mounted on the shaft with brushes resting on them. These three brushes are further externally connected to a three-phase star connected rheostat. This makes possible the introduction of additional resistance in the rotor circuit during the starting period of increasing the starting torque of the motor and for changing its speed-torque/current characteristics. When running under normal conditions, the slip rings are automatically short-circuited by means of metal collar, which is pushed along the shaft and connects all the rings together. Next, the brushes are automatically lifted from the slip-rings to reduce the frictional losses and the wear and tear. It is seen that under normal running conditions, the wound rotor is short-circuited on itself just like the squirrel-cage rotor.3.1.2 PRINCIPLE OF OPERATION:As a general rule, conversion of electrical power into mechanical power takes place in the rotating part of electrical motor. In D.C motors, the electrical power is conducted directly to the armature (i.e rotating part) through brushes and commutator. In the sense, a D.C motor can be conduction motor.In A.c motors, the rotor does not receive electric power by conduction but by induction in exactly the same way as the secondary of a 2-winding transformer receives its power from the primary. That is why such motors are known as induction motors. In fact, an induction motor can be treated as a rotating transformer i.e. one in which primary winding is stationary but the secondary is free to rotate.The induction motor may be regarded as practically a constant-speed machine: the difficulty of varying its speed economically constitutes one of its main disadvantages. This drawback is overcome by the circuit described here: it enables the speed to be lowered in small steps.A.C motors have the great advantages of being relatively inexpensive and very reliable. Induction motors in particularly are very robust and therefore used in many domestic appliances such as washing, vacuum cleaners, water pumps, and in an induction motor, the higher the speed of the rotor, the lower is the speed of the rotating field relative to the rotor winding and the smaller is the e.m.f. generated in the latter. Where the speed of the rotor conductors would be stationary relative to the rotating flux. There would then be no e.m.f. and no current in the rotor conductors and consequently no torque on the rotor. Thus, the rotor could not continue rotating at synchronous speed. As the rotor speed falls more and more below the synchronous speed, the values of rotor e.m.f. and current, and therefore of the torque, would continue to increase until the latter is equal to that required by the rotor losses and by any load there may be on the motor.The speed of the rotor relative to that of the rotating flux is called the slip. For torque varying between zero and the full-load value, the slip is practically proportional to the torque. It is usual to express the slip either as a per-unit or fractional value or as a percentage of the synchronous speed.Per-unit slip = (n1-nr)/n1, andPercentage slip = (n1-nr)/n1100,Where n1 is the synchronous speed and Nr is the rotor speed.Note that the synchronous speed = 120 f/p, where f is the frequency of the applied voltage (mains) and p is the number of pairs of poles of the stator.The value of the slip at full load varies from about 6% for small motors to about 2% for large machines. This shows that, as already stated, the induction motor is practically a constant- speed machine.3.1.3 GOVERNING THE SPEED:Since the speed of the motor depends primarily on the frequency of the applied voltage (normally the main voltage), it is readily governed by altering the frequency. This is not so simple, however, because the min frequency is internationally agreed to be 50Hz (Europe and most parts of the world, except the USA and Canada where it is 60Hz). Before the upsurge of electronics, complex techniques (such as the Ward-Leonard circuit for 3-phase motors) were developed to govern the speed of Ac motors. With the aid of electronics, however, it becomes far less complex. The present circuit enables the frequency to be lowered as desired by a factor 1/2, 1/3, 1/5, 1/7 or 1/9. Greater precision is not necessary since the speed varies in any case as the function of the load. The factor should be treated with some circumspection since during tests by the designer some motors.3.2 TYPES OF SINGLE PHASE INDUCTION MOTORPermanent Split Capacitor Motor:One way to solve the single phase problem is to build a 2-phase motor, deriving 2-phase power from single phase. This requires a motor with two windings spaced apart 90 electrical, fed with two phases of current displaced 90 in time. This is called permanent split capacitor motor.

This type of motor suffers increased current magnitude and backward time shift as the motor comes up to speed, with torque pulsations at full speed. The solution is to keep the capacitor (impedance) small to minimize losses. The losses are less than for a shaded pole motor. This motor configuration works well up to horse power (200W), though, usually applied to smaller motors. The direction of the motor is easily reversed by switching the capacitor in series with the other winding. This type of motor can be adopted for use as a servo motor.Capacitor - Start Induction Motor:A large capacitor may be used to start a single-phase induction motor via the auxiliary winding if it is switched out by a centrifugal switch once the motor is up to speed. Moreover, the auxiliary winding may be many more turns of heavier wire than used in a resistance split-phase motor to mitigate excessive temperature rise.

The result is that more starting torque is available for heavy loads like air conditioning compressors. This motor configuration works so well that it is available in multi-horse power (multi-kilowatt) sizes.

2.6 EQUIVALENT CIRCUIT OF INDUCTION MOTOR:The single coil of a single phase induction motor does not produce a rotating magnetic field, at a pulsating field reaching maximum intensity at 0 and 180 electrical.

Another view is that the single coil excited by a single phase current produces two counter rotating magnetic field phasors, coinciding twice per revolution at 0(fig a) and 180(fig e). When the phasors rotate to 90 and -90 they cancel in figure b. At 45and -45(fig c). They are partially additive along the positive x-axis and cancel along the y-axis. An analogous situation exists in fig d.

The sum of these two phasors is a phasor stationary in space but alternating polarities in time. Thus, no starting torque is developed. However, if the rotor is rotated forward at a bit less than the synchronous speed, it will develop maximum torque at 10% slip with respect to the forward rotating phasor. Less torque will be developed above or below 10% slip. The rotor will see 200% - 10% slip with respect to the counter rotating magnetic field phasor. Little torque other than a double frequency ripple is developed from the counter rotating phasor. Thus, the single phase coil will develop torque, once the rotor is started. If the rotor is started in the reverse direction it will develop a similar large torque as it nears the speed of the backward rotating phasor.Single phase induction motors have a copper or aluminium squirrel cage embedded in a cylinder of steel laminations, typical of poly-phase induction motors.

4.DISCRETE PWM GENERATOR

Generate pulses for carrier-based two-level pulse width modulator (PWM) in Converter Bridge.4.1 LibraryExtras/Control BlocksA discrete version of this block is available in the Extras/Discrete Control Blocks library.4.2 Description The PWM Generator block generates pulses for carrier-based pulse width Modulation (PWM) converters using two-level topology. The block can be used to fire the forced-commutated devices (FETs, GTOs, or IGBTs) of single-phase, Two-phase, three-phase, two-level bridges or a combination of two three-phase Bridges. The number of pulses generated by the PWM Generator block is determined by the number of bridge arms you have to control: Two pulses are generated for a one-arm bridge. Pulse 1 fires the upper device and pulse 2 fires the lower device (shown for the IGBT device).

Four pulses are generated for a two-arm bridge. Pulses 1 and 3 fire the upper devices of the first and second arm. Pulses 2 and 4 fire the lower devices.

Six pulses are generated for a three-arm bridge. Pulses 1, 3, and 5 fire the upper devices of the first, second, and third arms. Pulses 2, 4, and 6 fire the lower devices.

Twelve pulses are generated for a double three-arm bridge. The first six pulses (1 to 6) fire the six devices of the first three-arm bridge and the last six pulses (7 to 12) fire the six devices of the second three-arm bridge.For each arm the pulses are generated by comparing a triangular carrier waveform to a reference modulating signal. The modulating signals can be generated by the PWM generator itself, or they can be a vector of external signals connected at the input of the block. One reference signal is needed to generate the pulses for a single- or a two-arm bridge, and three reference signals are needed to generate the pulses for a three-phase, single or double bridge.The amplitude (modulation), phase, and frequency of the reference signals are set to control the output voltage (on the AC terminals) of the bridge connected to the PWM Generator block.The two pulses firing the two devices of an arm bridge are complementary. For example, pulse 4 is low (0) when pulse 3 is high (1). This is illustrated in the next two figures.The following figure displays the two pulses generated by the PWM Generator block when it is programmed to control a one-arm bridge.

The triangular carrier signal is compared with the sinusoidal modulating signal. When the modulating signal is greater than the carrier pulse 1 is high (1) and pulse 2 is low (0).For a single-phase two-arm bridge the modulating signal used for arm 2 is the negative of modulating signal used for arm 1 (180 degrees phase shift). For a three-phase six-arm bridge the three modulating signals used for bridge 2 are the negative of the modulating signals applied to bridge 1.The following figure displays the six pulses generated by the PWM Generator block when it is programmed to control a three-arm bridge.

Dialog Box and Parameters

4.3 Generator ModeSpecify the number of pulses to generate. The number of pulses is proportional to the number of bridge arms to fire. Select for example Double 3-arm bridges (12 pulses) to fire the self-commutated devices of two six-pulse bridges connected in a twelve-pulse bridge configuration.4.3.1 Carrier frequencyThe frequency, in hertz, of the carrier triangular signal.

4.3.2 Internal generation of modulating signal If selected, the modulating signal is generated by the block. Otherwise, external modulating signals are used for pulse generation.4.3.3 Modulation Index (0 < m < 1) The Modulation index parameter is visible only if the Internal generation of modulating signal (s) parameter is selected.The amplitude of the internal sinusoidal modulating signal. The Modulation index must be greater than 0, and lower than or equal to 1. This parameter is used to control the amplitude of the fundamental component of the output voltage of the controlled bridge. 4.3.4 Frequency of output voltageThe Frequency of output voltage (Hz) parameter is visible only if the Internal generation of modulating signal (s) parameter is selected.The frequency, in hertz, of the internal modulating signals. This parameter is used to control the fundamental frequency of the output voltage of the controlled bridge.4.3.5 Phase of output voltageThe Phase of output voltage parameter is visible only if the internal generation of modulating signal (s) parameter is selected.The phase, in degrees, of the internal modulating signal. This parameter is used to control the phase of the fundamental component of the output voltage of the controlled bridge.4.3.6 Inputs And OutputsSIGNAL(S)The input is not visible when internal generation of modulating signal (s) is selected. The input is the vector of modulating signals when internal generation of modulating signal is not selected. Connect this input to a single-phase sinusoidal signal when the block is used to control a single- or a two-arm bridge or to a three-phase sinusoidal signal when the PWM Generator block is controlling one or two three-phase bridges.PULSESThe output contains the two, four, six, or twelve pulse signals used to fire the self-commutated devices (MOSFETs, GTOs, or IGBTs) of single-phase, two-phase, or three-phase bridges or a combination of two three-phase bridges.

1