study of electric fuel injection

73
SYSTEM IDENT IMPLEME M E D TIFICATION AND CONTROL DESIG ENTATION OF MAGLEV SYSTEM A PROJECT REPORT DEGREE 32 Submitted By MAMOONA BIRKHEZ SHAMI MUHAMMAD SARMAD SALMAN AHMED TAHA HAMID BACHELORS IN ELECTRICAL ENGINEERING Year 2014 PROJECT SUPERVISOR DR. FAHAD MUMTAZ MALIK GN &

Upload: muhammad-kifl

Post on 28-Jan-2016

217 views

Category:

Documents


0 download

DESCRIPTION

this is a report of a comprehensive study done on electric fuel injection of cars.all the sensors calibration and their circuits are thoroughly discussed.all the kits available in market are also discussed.

TRANSCRIPT

Page 1: study of electric fuel injection

SYSTEM IDENTIFICATION AND CONTROL DESIGN &

IMPLEMENTATION OF MAGLEV SYSTEM

MAMOONA BIRKHEZ SHAMI

ELECTRICAL ENGINEERING

DR. FAHAD MUMTAZ MALIK

SYSTEM IDENTIFICATION AND CONTROL DESIGN &

IMPLEMENTATION OF MAGLEV SYSTEM

A PROJECT REPORT

DEGREE

32

Submitted By

MAMOONA BIRKHEZ SHAMI

MUHAMMAD SARMAD

SALMAN AHMED

TAHA HAMID

BACHELORS

IN

ELECTRICAL ENGINEERING

Year

2014

PROJECT SUPERVISOR

DR. FAHAD MUMTAZ MALIK

SYSTEM IDENTIFICATION AND CONTROL DESIGN &

Page 2: study of electric fuel injection

1 | P a g e

ELECTRICAL AND MECHANICAL ENGINEERING

SYSTEM IDENTIFICATION AND CONTROL DESIGN &

IMPLEMENTATION OF MAGLEV SYSTEM

Submitted by:

NS MAMOONA BIRKHEZ SHAMI

NS MUHAMMAD SARMAD

NS SALMAN AHMED

NS TAHA HAMID

Project Supervisor:

Dr. Fahad Mumtaz Malik

Head of Department:

Brig. Basharat

DEPARTMENT OF ELECTRICAL ENGINEERING

ELECTRICAL AND MECHANICAL ENGINEERING

PESHAWAR ROAD, RAWALPINDI

NUST COLLEGE OF

ELECTRICAL AND MECHANICAL ENGINEERING

SYSTEM IDENTIFICATION AND CONTROL DESIGN &

IMPLEMENTATION OF MAGLEV SYSTEM

SHAMI 2010-NUST-CEME-BE-EE

2010-NUST-CEME-BE-EE

2010-NUST-CEME-BE-EE

2010-NUST-CEME-BE-EE

Dr. Fahad Mumtaz Malik

Brig. Basharat

DEPARTMENT OF ELECTRICAL ENGINEERING

COLLEGE OF

ELECTRICAL AND MECHANICAL ENGINEERING

PESHAWAR ROAD, RAWALPINDI

Date:

Date:

ELECTRICAL AND MECHANICAL ENGINEERING

SYSTEM IDENTIFICATION AND CONTROL DESIGN &

EE-052

EE-033

EE-040

EE-044

Page 3: study of electric fuel injection

2 | P a g e

DECLARATION

We hereby declare that no portion of the work referred to in this Project Thesis has been

submitted in support of an application for another degree or qualification of this or of any other

university or other institute of learning. If any act of plagiarism found, we are fully responsible

for every disciplinary action taken against us depending upon the seriousness of the proven

offense.

COPYRIGHT STATEMENT

Copyright in text of this thesis rests with the student authors, copies (by any process)

either in full, or of extracts, may be made only in accordance with the instructions given

by the authors and lodged in the Library of NUST College of E&ME. Details may be

obtained by the Librarian, this page must form part of any such copies made. Further

copies (by any process) of copies made in accordance with such instructions may not be

made without the permission (in writing) of the authors.

The ownership of any intellectual property rights which may be described in this thesis is

vested in NUST College of E&ME, subject to any prior agreement to the contrary, and

may not be made available for use by third parties without the written permission of the

College of E&ME, which will prescribe the terms and conditions of any such agreement.

Further information on the conditions under which disclosures and exploitation may take

place is available from the Library of NUST College of E&ME, Rawalpindi.

Page 4: study of electric fuel injection

3 | P a g e

Dedicated to our Beloved Parents and Family Members

Page 5: study of electric fuel injection

4 | P a g e

ACKNOWLEDGEMENTS

First of all, we would like to thank ALLAH (Subhanahuwata’ala) Who enlightened us with the

knowledge that we needed for our project and gave us strength to accomplish our task.

We acknowledge, with deep gratitude and appreciation, the inspiration, encouragement, valuable

and continuous guidance given to us by Dr. Fahad Mumtaz Malik, we also acknowledge the

immense support of Dr. Shakeel Ahmed (Nescom) and Sir Mukhtar (Nescom) regarding control

design and system identification respectively.

Special thanks to our family members for bearing with us through the tough routine and for

continuously encouraging us.

Page 6: study of electric fuel injection

5 | P a g e

Table of Contents Abstract ........................................................................................................................................... 8

1 Introduction ........................................................................................................................... 11

1.1 Applications of Maglev .................................................................................................. 11

1.2 Objectives ....................................................................................................................... 13

1.3 Scope of Project ............................................................................................................. 13

2 Hardware Setup for Magnetic Levitation System ................................................................. 15

2.1 Setup Introduction and Hardware Details ...................................................................... 15

2.2 Sensor Calibration .......................................................................................................... 16

2.2.1 Procedure ................................................................................................................ 16

2.3 Actuator Calibration ....................................................................................................... 17

2.3.1 Procedure ................................................................................................................ 17

3 Mathematical Modeling ........................................................................................................ 20

3.1 Motivation ...................................................................................................................... 20

3.2 Modeling Approach........................................................................................................ 20

3.3 Simulink Models ............................................................................................................ 20

3.3.1 Block model ............................................................................................................ 21

3.3.2 S function ................................................................................................................ 21

3.4 Simulated model validation ............................................................................................ 21

4 Linearization ......................................................................................................................... 24

4.1 Taylor Series Expansion................................................................................................. 24

4.2 Linearized Models at Different Points ........................................................................... 25

5 Black Box System Identification .......................................................................................... 27

5.1 Introduction .................................................................................................................... 27

5.2 Literature Review ........................................................................................................... 27

5.2.1 White box modeling ................................................................................................ 27

5.2.2 Grey Box Modeling ................................................................................................ 27

5.2.3 Black Box Modeling ............................................................................................... 27

5.3 Procedure ........................................................................................................................ 28

5.4 Model Structure .............................................................................................................. 29

5.5 Identification MATLAB Tool ........................................................................................ 29

Page 7: study of electric fuel injection

6 | P a g e

5.6 Working of MATLAB System Identification Tool........................................................ 30

5.7 Applying System Identification procedure to the Maglev system ................................. 32

5.7.1 Collecting Input-Output Data ................................................................................. 33

5.7.2 Identifying the model .............................................................................................. 36

5.7.3 Selecting the identified model ................................................................................ 39

5.8 Comparison of Identified Model with the Linearized Model ........................................ 42

5.9 Limitations of the Identified Model ............................................................................... 43

6 Control Design & Implementation........................................................................................ 44

6.1 Lead-Lag Compensator .................................................................................................. 44

6.1.1 Introduction ............................................................................................................. 44

6.1.2 Design Steps............................................................................................................ 45

6.1.3 Results ..................................................................................................................... 50

6.1.4 Discretization and Hardware implementation ........................................................ 51

6.2 H-Infinity ........................................................................................................................ 54

6.2.1 Introduction ............................................................................................................. 54

6.2.2 Design Steps............................................................................................................ 55

6.2.3 Simulations ............................................................................................................. 56

6.2.4 Hardware Implementation ...................................................................................... 56

7 Controller Identification........................................................................................................ 60

7.1 Introduction .................................................................................................................... 60

7.2 Literature Review ........................................................................................................... 61

7.3 Applying Controller Identification Procedure to Maglev system .................................. 61

7.3.1 Finding the input ..................................................................................................... 61

7.3.2 Finding the output ................................................................................................... 62

7.3.3 Identifying the controller ........................................................................................ 63

7.4 Implementing the identified controller on hardware ...................................................... 65

7.5 Comparison of Controller Identification with conventional controllers ........................ 65

7.5.1 Controller Identification Vs. Lag Lead Controller and H infinity controller ......... 66

7.6 Limitations ..................................................................................................................... 66

8 Appendix ............................................................................................................................... 67

A. S-Function ...................................................................................................................... 67

Page 8: study of electric fuel injection

7 | P a g e

B. Sensor1.m File ................................................................................................................ 68

C. Actuat1.m File ................................................................................................................ 70

9 Bibliography ......................................................................................................................... 72

Page 9: study of electric fuel injection

8 | P a g e

Table of Figures:

FIG. 1-1 ...................................................................................................................................................................... 14 FIG. 2-1 HARDWARE ASSEMBLY ........................................................................................................................ 15 FIG. 3-1FREE BODY DIAGRAM ............................................................................................................................ 20 FIG. 3-2 SIMULINK BLOCK DIAGRAM OF PLANT ........................................................................................... 21 FIG. 3-3 VALIDATION SETUP ............................................................................................................................... 22 FIG. 3-4 VALIDATION GRAPHS ........................................................................................................................... 23 FIG. 4-1 STEP RESPONSE AT DIFFERENT EQUILIBRIUM POINTS ................................................................ 26 FIG. 5-1: DIFFERENT MODELING STRUCTURES. ............................................................................................. 29 FIG. 5-2: SYSTEM ID TOOL BOX MAIN WINDOW. ........................................................................................... 30 FIG. 5-3: STEP INPUT TO THE OPEN LOOP SYSTEM. ....................................................................................... 34 FIG. 5-4: STEP RESPONSE OF THE OPEN LOOP SYSTEM. ............................................................................... 34 FIG. 5-5: RAMP INPUT TO THE OPEN LOOP SYSTEM. ..................................................................................... 34 FIG. 5-6: RAMP RESPONSE OF THE OPEN LOOP SYSTEM. ............................................................................. 34 FIG. 5-7: SINE INPUT TO THE OPEN LOOP SYSTEM. ....................................................................................... 35 FIG. 5-8: SINE RESPONSE OF THE OPEN LOOP SYSTEM. ............................................................................... 35 FIG. 5-9: SINE SWEEP INPUT TO THE SYSTEM. ................................................................................................ 35 FIG. 5-10: SINE SWEEP RESPONSE OF THE OPEN LOOP SYSTEM. ............................................................... 35 FIG. 5-11: SELECTED MODEL OUTPUT GRAPHS FOR THE STEP INPUT. ..................................................... 36 FIG. 5-12: SELECTED MODEL OUTPUT GRAPHS FOR THE RAMP INPUT. ................................................... 37 FIG. 5-13: SELECTED MODEL OUTPUT GRAPHS FOR THE SINE INPUT. ..................................................... 38 FIG. 5-14: SELECTED MODEL OUTPUT GRAPHS FOR THE SINE SWEEP INPUT. ....................................... 39 FIG. 5-15: IDENTIFIED MODEL RESPONSES TO STEP INPUT AND CORRESPONDING ERROR. .............. 40 FIG. 5-16 : IDENTIFIED MODEL RESPONSES TO RAMP INPUT AND CORRESPONDING ERRORS.......... 41 FIG. 5-17: IDENTIFIED MODEL RESPONSES TO SINE INPUT AND CORRESPONDING ERRORS. ............ 41 FIG. 5-18: IDENTIFIED MODEL RESPONSES TO SINE SWEEP INPUT AND CORRESPONDING ERRORS.

........................................................................................................................................................................... 42 FIG. 5-19: RESPONSE OF THE MODELS TO A STEP INPUT. ............................................................................ 43 FIG. 5-20: ERROR PLOTS FOR LINEARIZED AND IDENTIFIED MODELS. .................................................... 43 FIG. 6-1 : NEGATIVE FEEDBACK CONFIGURATION USED IN LEAD LAD COMPENSATOR DESIGN .... 44 FIG. 6-2: OPEN LOOP FREQUENCY RESPONSE OF THE PLANT .................................................................... 45 FIG. 6-3 : BODE PLOTS FOR OPEN LOOP PLANT AND LEAD COMPENSATOR .......................................... 47 FIG. 6-4: OPEN LOOP FREQUENCY RESPONSE WITH LEAD COMPENSATOR ........................................... 48 FIG. 6-5: BODE PLOTS FOR GCLAG AND LEAD COMPENSATED SYSTEM ................................................. 49 FIG. 6-6 : OPEN LOOP FREQUENCY RESPONSE OF LAG LEAD COMPENSATED SYSTEM ...................... 50 FIG. 6-7: COMPARISON OF BODE PLOTS THREE DIFFERENT COMPENSATED SYSTEM ........................ 50 FIG. 6-8: STEP RESPONSE OF LAG LEAD COMPENSATED SYSTEM ............................................................ 51 FIG. 6-9: COMPARISON OF STEP RESPONSE OF SIMULATION AND HARDWARE .................................... 52 FIG. 6-10: DISPLAYING NONLINEAR BEHAVIOR AT LARGE DISPLACEMENTS ....................................... 53 FIG. 6-11: INSTABILITY OCCURRING AT DISPLACEMENT OF -10 CM ........................................................ 54 FIG. 6-12: POSITIVE CONFIGURATION USED IN H INFINITY LOOP SHAPING DESIGN ........................... 55 FIG. 6-13: COMPARISON OF STEP RESPONSE OF LAG LEAD AND H INFINITY LS CONTROLLED

SYSTEM ............................................................................................................................................................ 56 FIG. 6-14 :COMPARISON OF STEP RESPONSE OF H INFINITY LS CONTROLLED SYSTEM ..................... 58 FIG. 6-15( DISPLAYING H INFINITY LS ROBUSTNESS OVER LAG LEAD COMPENSATOR ) ................... 59 FIG. 7-1: A CLOSED LOOP SYSTEM ..................................................................................................................... 60

Page 10: study of electric fuel injection

9 | P a g e

FIG. 7-2:INPUT OUTPUT RELATIONSHIP. .......................................................................................................... 60 FIG. 7-3: OPEN LOOP BODE PLOT OF ORIGINAL TRANSFER FUNCTION (G) AND TRANSFER

FUNCTION WITH ADDED ZEROES (G_MOD). .......................................................................................... 62 FIG. 7-4: STEP RESPONSE OF ORIGINAL TRANSFER FUNCTION (G) AND TRANSFER FUNCTION WITH

ADDED ZEROES (G_MOD). ........................................................................................................................... 63 FIG. 7-5: MAGNITUDE AND PHASE PLOTS FOR G AND GK. .......................................................................... 64 FIG. 7-6:IDEAL STEP RESPONSE AND THE RESPONSE ACHIEVED BY USING THE IDENTIFIED

CONTROLLER. ................................................................................................................................................ 64 FIG. 7-7CLOSED LOOP SYSTEM RESPONSE OF HARDWARE AND SIMULATION. .................................... 65 FIG. 7-8: COMPARISON PLOTS FOR DIFFERENT CONTROLLERS. ................................................................ 66

Page 11: study of electric fuel injection

10 | P a g e

Abstract

A linear model of a magnetic levitation module (ECP model 730) has been identified using

system identification techniques. The accuracy of the identified model has been affirmed by its

comparison with the mathematically derived linear model. Furthermore, three different linear

control schemes which include conventional lag lead compensator, H infinity loop shaping

controller and a relatively newer one which we name controller identification have been

implemented on the ECP model 730.

Page 12: study of electric fuel injection

1. INTRODUCTION

11 | P a g e

1 Introduction

Maglev (derived from magnetic levitation) is a method of propulsion that uses magnetic

levitation to propel vehicles with magnets rather than with wheels, axles and bearings. With

maglev, a vehicle is levitated a short distance away from a guide way using magnets to create

both lift and thrust.

Maglev vehicles move more smoothly and somewhat more quietly than wheeled mass

transit systems. Their non-reliance on traction and friction means that acceleration and

deceleration can surpass that of wheeled transports, and they are unaffected by weather. The

power needed for levitation is typically not a large percentage of the overall energy

consumption; most of the power is used to overcome air resistance (drag), as with any other

high-speed form of transport. Although conventional wheeled transportation can travel very

quickly, a maglev system allows routine use of higher top speeds than conventional rail, and it is

this type which holds the speed record for rail transportation.

Earnshaw's theorem proves that using only paramagnetic materials (such as ferromagnetic iron)

it is impossible for a static system to stably levitate against gravity.For example, the simplest

example of lift with two simple dipole magnets repelling is highly unstable, since the top magnet

can slide sideways, or flip over, and it turns out that no configuration produced adding more

magnets can produce stability.However, controllers can be designed to control the magnetic

force which can allow stability to be achieved.

1.1 Applications of Maglev Magnetic levitation systems can find application in wide area such as maglev passenger trains,

levitation of wind tunnel model, frictionless bearings, etc. In particular, the magnetic

levitation train reduces rolling friction between the locomotive and the railway, much higher

speeds and less energy lost to friction can be achieved.

Bullet Trains

High speed trains in Europe and Japan are perhaps the best example of magnetic levitation

technology. According to the Los Alamos National Laboratory, Germany, France and Japan have

developed “bullet” trains with speeds ranging between 150-180 mph. This exceeds the speed of

conventional trains which are capable of up to 110 mph. Though the magnetic suspension system

of bullet trains allows for greater speeds, the technology is currently expensive to implement and

maintain.

Magnetic Bearings

Magnetic bearings are another application of magnetic levitation technology formed by

electromagnetic suspension and electromagnets. Magnetic bearings support loads without any

Page 13: study of electric fuel injection

1. INTRODUCTION

12 | P a g e

kind of physical contact. The benefits of this include reduced friction, reduced wear on

machinery and the highest speeds of any kind of bearing. Disadvantages of magnetic bearings

include attraction difficulties when increasing or decreasing bearing distances from levitating

objects.

Flywheels and Levitation Melting

Two additional scientific applications for magnetic levitation include flywheels and levitation

melting. Flywheels are rotating mechanisms used to store energy. Magnetic levitation can be

used to rotate flywheels thereby assisting with energy storage. With levitation melting, it is

possible to levitate small amounts of metal and eventually melt the metal through use of

magnetic forces and electricity. Levitation melting has been commercially tested and is a viable

application of the technology.

Maglev usages from view point of engineering science can be categorized and summarized as

follows:

Transportation engineering (magnetically levitated trains, flying cars, or personal rapid

transit (PRT), etc.),

Environmental engineering (small and huge wind turbines: at home, office, industry,

etc.),

Aerospace engineering (spacecraft, rocket, etc.),

Military weapons engineering (rocket, gun, etc.),

Nuclear engineering (the centrifuge of nuclear reactor),

Civil engineering including building facilities and air conditioning systems (magnetic

bearing, elevator, lift, fan, compressor, chiller, pump, gas pump, geothermal heat pumps,

etc.),

Biomedical engineering (heart pump, etc.),

Chemical engineering (analyzing foods and beverages, etc.),

Electrical engineering (magnet, etc.),

Page 14: study of electric fuel injection

1. INTRODUCTION

13 | P a g e

Architectural engineering and interior design engineering including household and

administrative appliances (lamp, chair, sofa, bed, washing machine, room, toys (train,

levitating spacemen over the space ship, etc.), stationery (pen), etc.),

Automotive engineering (car, etc.),

Advertising engineering (levitating everything considered inside or above various frames

can be selected).

1.2 Objectives

The first objective of this project is to implement different system identification

techniques and achieve a model as close to the actual model as possible.

The second objective is to design such a linear control technique that stabilizes the

system over the range of operation and shows a linear response.

The third objective is to identify the transfer function of an ideal controller using system

identification techniques.

Various system identification models are present e.g. ARMAX, ARX etc. Based on the input and

output data, a system model can be obtained of the desired order. The response of this identified

model is then compared with the actual hardware to validate the identified model.

A lot of research has been done on control design techniques for maglev systems. Various linear

and non-linear control schemes, robust stabilization techniques and intelligent adaptive control

techniques have been implemented on maglev systems. For the purpose of this project, the

discussion has been limited to Lead-Lag compensator and H-infinity Loop Shaping controller.

H-infinity Loop Shaping controller shapes the frequency response of the plant using Lead-Lag

compensator as weights in its standard notation and robustly stabilizes the plant .

Controller identification is a relatively new field. This domain of study entails acquiring input

data and required output data (based on the performance and robustness criteria) and obtaining a

transfer function using identification techniques. This technique removes the restrictions on the

designer to use a set of equations to implement a particular kind of controller. This also waives

the tedious work involved in solving equations and designing a particular kind of controller.

1.3 Scope of Project

The scope of this project was:

To calibrate the hardware

Model the plant dynamics and acquire a mathematical non-linear model of the system

Linearize the 2nd order system at different equilibrium points and use the best model

Page 15: study of electric fuel injection

14 | P a g e

Acquire input and output data and

MATLAB and use the best fit model

Implement the model using Simulink and S

Develop Lead-Lag Compensator and implement in Simulink and on hardware and

compare the results

Develop H-infinity loop shapi

hardware and compare the results

Using the input and required output data, identify the controller using Ident Tool

Mathematical Modelling & Linearization

Data Acquisition and system Identification

1. INTRODUCTION

Acquire input and output data and get models of different orders using Ident Tool of

MATLAB and use the best fit model

Implement the model using Simulink and S-Function

Lag Compensator and implement in Simulink and on hardware and

infinity loop shaping controller and implement it in Simulink and on

hardware and compare the results

Using the input and required output data, identify the controller using Ident Tool

Fig. 1-1

Data Acquisition and system Identification

Implementing Lead-Lag & H-Infinity

Hardware Implementation & Validation

Controller Identification

INTRODUCTION

models of different orders using Ident Tool of

Lag Compensator and implement in Simulink and on hardware and

in Simulink and on

Using the input and required output data, identify the controller using Ident Tool

Controller Identification

Page 16: study of electric fuel injection

2. HARDWARE SETUP FOR MAGNETIC LEVITATION SYSTEM

15 | P a g e

2 Hardware Setup for Magnetic Levitation System

2.1 Setup Introduction and Hardware Details Seen in Fig. 2-1, each consists of an electromechanical plant and a full complement of

control hardware and software. The user interface to the system is via an easy to use,

PC based environment that supports a broad range of controller specification, trajectory

generation, data acquisition, and plotting features. The systems are designed to accompany

introductory through advanced level courses in control systems.

Fig. 2-1 Hardware Assembly

The Model 730 Magnetic Levitation (Maglev) apparatus may be quickly transformed into

a variety of single input single output (SISO) and multi-input multi-output (MIMO)

configurations. By using repulsive force from the lower coil to levitate a single magnet,

an open loop stable SISO system is created. Attractive levitation via the upper coil affects an

open loop unstable system. Two magnets may be raised by a single coil to produce a SIMO

plant. If two coils are used a MIMO one is produced. These may be locally stable or unstable

depending on the selection of the magnet polarities and the nominal magnet positions. The plant

has inherently strong nonlinearities due to the natural properties of magnetic fields. These may

be compensated for in feed forward using derived or provided algorithms so that the

control problem may be approached as that of a linear or nonlinear system depending on

the desired course of study. Thus this dynamically rich system provides a test bed for

experiments ranging from demonstration of fundamental principles to advanced research. For

the purpose of this project, we will focus on the SISO system of the lower coil.

The experimental system is comprised of the three subsystems shown in Fig. 2-1. The first of

these is the electromechanical plant, which consists of the Maglev apparatus including its

actuators and sensors. The design features two high field density rare earth magnets and high

flux drive coils to provide more than 4 cm. of controlled levitation range. Laser sensors provide

Page 17: study of electric fuel injection

2. HARDWARE SETUP FOR MAGNETIC LEVITATION SYSTEM

16 | P a g e

non-contacting position feedback and incorporate proprietary conditioning electronics for signal

noise reduction and ambient light rejection. An optional turntable incorporates a high-speed

conductive spin platter that interacts with the permanent magnet in such a way as to induce a

traveling current and cause the magnet to levitate. Magnet position control is accomplished

through spin speed changes in the platter.The next subsystem is the real-time controller unit

which contains the digital signal processor (DSP) based real-time controller, servo/actuator

interfaces, servo amplifiers, and auxiliary power supplies. The DSP – based on the M56000

processor family - is capable of executing control laws at high sampling rates allowing the

implementation to be modeled as being in continuous or discrete time. The controller also

interprets trajectory commands and supports such functions as data acquisition, trajectory

generation, and system health and safety checks. A logic gate array performs encoder pulse

decoding (optional turntable sensing). Four 16 bit analog-to-digital (ADC) converters are used

to digitize the laser sensor signals. Two optional auxiliary digital-to analog converters (DAC's)

provide for real-time analog signal measurement. This controller is representative of modern

industrial control implementation. The third subsystem is the Executive program which runs

on a PC under the Windows™operating system. This graphical user interface (GUI) based

program is the user's interface to the system and supports controller specification, trajectory

definition, data acquisition, plotting, system execution commands, and more. Controllers

are specified via an intuitive “C-like” language that supports easy generation of basic or highly

complex algorithms. A built-in auto compiler provides for efficient downloading and

implementation of the real-time code by the DSP while remaining within the Executive. The

interface supports a wide assortment of features that provide a friendly yet powerful

experimental environment.

2.2 Sensor Calibration The approach will be to measure the specific input/output characteristics of the laser sensor and

magnet/coil actuators and the magnet/magnet interactions as they vary with relative position. The

laser position nonlinearity results from the nature of the change of light intensity on the detector

with magnet position and is associated with the particular sensor used. The strong magnetic field

nonlinearities, however, are inherent in this class of magnetic systems.

2.2.1 Procedure

1. Setup the mechanism with one magnet only resting on the lower drive coil. Make certain that

your hands are clean at all times when touching the magnet avoid touching the white surface.

Power to the Control Box should be off.

2. Enter the Setup Sensor Calibration box via the Setup menu, and verify that Use Raw Sensor

Counts and Apply Thermal Compensation are selected. Select OK to exit to the background

screen. Select Abort Control to make sure that no real-time controller is active. Turn on power to

the Control Box. You should see the laser light beam on the upper and lower magnet surfaces.

Move the magnet manually up and down to verify that the sensor counts displayed on the

Background Screen are changing.

Page 18: study of electric fuel injection

2. HARDWARE SETUP FOR MAGNETIC LEVITATION SYSTEM

17 | P a g e

3. Sight along the top of the magnet and adjust the ruler height so that the 0 cm position precisely

matches the plane of the top of the magnet.

4. Record the raw sensor output at the 0 cm. position as read from the Sensor 1display on the

Background Screen. Refer to the notes below regarding moving the magnet to the desired

calibration positions and reading the sensor counts. Manually move the magnet to the 0.50 cm

position and read and record the raw sensor output. Continue moving and recording the sensor

data according for the magnet positions in the Table. There will be some noise in the sensor

reading; you should “visually average” the values displayed. You need only read the sensor to

three significant digits for the purposes here.

Magnet Position for Sensor#1 (cm) Y1raw (Sensor 1, count(s))

0 8324

1 5093

2 3296

3 2053

4 1243

5 650

6 224 Table 2-1 Sensor Calibration

Using sensor1.m file for curve fitting, the equation constants come out to be:

�� = −17632000

�� = 2166915

�� = −5739

ℎ� = −1.9731

The values when plugged in the ECP software results in a sensor gain of 1000000 counts / meter.

2.3 Actuator Calibration The mechanism should be in the same configuration as in the last section. Assure that the north

pole of the magnet is facing upward. The ruler should again be adjusted to measure off the upper

surface of the magnet when it is resting in its lowermost position.

2.3.1 Procedure

1. Write a simple real-time algorithm to activate actuator coil #1 (i.e. put control effort values on

the DAC) with a constant control effort of 5000 counts.

2. Implement this algorithm using the following steps:

a) Enter Setup Control Algorithm via the Setup menu and select Edit Algorithm. You are now in

the control algorithm editor. If the editor contains any text select New under File.

Page 19: study of electric fuel injection

2. HARDWARE SETUP FOR MAGNETIC LEVITATION SYSTEM

18 | P a g e

b) Type in your algorithm. Select Save as… and choose an appropriate name and directory to

save this algorithm in. Close the editor by either selecting Save Changes and Quit or simply

clicking on the upper right hand button.

c) Stay well clear of the apparatus when initially performing the next step. Select Implement

Algorithm to begin immediate execution of your algorithm. You should see the lower magnet

levitate roughly 1 cm.

3. Record the height of the magnet corresponding to 5000 counts in a table. You may wish to

spin the magnet (again touching only its edge) to reduce the effects of friction so that the true

equilibrium height is observed.

4. Reenter the algorithm editor via Edit Algorithm, reduce the control effort to4000 counts, and

select Save Changes and Quit, and Implement Algorithm. You should notice the magnet height

become lower. Record the magnet height.

5. Repeat step 4 to find the control effort value at which the magnet is lifted only a very slight

amount above the support pads (i.e. the 0+ position). Again, you may wish to spin the magnet to

reduce the effects of friction.

6. Repeat step 4 for the remaining control effort values of Table. Select Abort Control

immediately after measuring magnet height to minimize heat buildup in the coil and servo

amplifiers during exposure to the higher control effort values (those greater than 10,000 counts).

Do not exceed 22,000 counts of control effort.

Magnet Position (cm) U1raw (Uncompensated Control Effort, counts)

0 2000

0.1 2100

0.3 2300

0.6 2500

0.83 2800

0.88 3000

1 3500

1.3 4000

1.6 4500

1.9 5000

2.16 6000

2.4 7000

2.8 8000

3.12 9000

3.18 10000

Page 20: study of electric fuel injection

2. HARDWARE SETUP FOR MAGNETIC LEVITATION SYSTEM

19 | P a g e

3.3 11000

3.69 12000

3.7 14000

3.95 18000

3.99 22000 Table 2.2 Actuator Calibration

Using actuat1.m file for curve fitting: However the values of a1 and b1 were later changed by

hit and trial using the experiment mentioned in the manual.

�� = 1.04

�� = 6.2

Page 21: study of electric fuel injection

20 | P a g e

3 Mathematical Modeling

3.1 Motivation

In control systems, any control technique for implementation requires a system model on

simulation. This is required because we cannot simply move on to the hardware in first

need to be sure about how our con

important to have a mathematical model of our system through which we can anal

responses beforehand.

3.2 Modeling Approach A second order differential equation is

derived using the Newton's second law of

motion using the following free body

diagram. Only the lower magnet is taken

into consideration.

��̈ = �

�(� + 100�)�− ��

Where

����������������������

��ℎ��������� 1.1 ����������

3.3 Simulink Models The nonlinear system equation is implemented in S

1. Block model

3. MATHEMATICAL MODELING

Modeling

any control technique for implementation requires a system model on

This is required because we cannot simply move on to the hardware in first

to be sure about how our control technique is going to change the system.

important to have a mathematical model of our system through which we can anal

A second order differential equation is

derived using the Newton's second law of

motion using the following free body

Only the lower magnet is taken

�� − ��̇

� = ℎ���ℎ�

� = �������������

� = 1.04

� = 6.2

���������������������� . ����������������������ℎ�����ℎ��������

����������ℎ�ℎ�������ℎ�����������ℎ����������

tem equation is implemented in Simulink using two different approaches.

Fig. 3-1free body diagram

MATHEMATICAL MODELING

any control technique for implementation requires a system model on

This is required because we cannot simply move on to the hardware in first go. We

system. For that, it is

important to have a mathematical model of our system through which we can analyze the system

�������� .

����������

approaches.

free body diagram

Page 22: study of electric fuel injection

3. MATHEMATICAL MODELING

21 | P a g e

2. S - function

Two approaches are used to verify the results of each other. This is done to boost our confidence

that the differential equation is implemented correctly.

3.3.1 Block model

Fig. 3-2 Simulink Block Diagram of Plant

3.3.2 S function

In this tool, the entire differential equation is implemented in a code. The code is imported in the

S-function block of Simulink. The code is present in the appendix.

3.4 Simulated model validation Once the working model was obtained, its response was compared with that of the hardware.

Similar inputs are given to both the systems, hardware and simulation, and their responses were

compared.

In order to cope up with the mechanical restriction at y = 0 cm. The magnetic disk is first

levitated at y = 2cm and then different inputs were given.

1

air gap

(m)

0.121*9.8

mg

6.2

b

1.04

a

Product4

Product1

Product

uv

Math

Function

1

s

Integrator1

1

s

Integrator

Limited

1.1

Friction Coefficient100

Converting m to cm

4

Constant4

1

Constant2

Add

1/0.121

1/m

1

Control effort

(counts)

double

double

double

doubledoubledouble

double

double

double

double

double

doubledouble

double

doubledouble

double

Page 23: study of electric fuel injection

22 | P a g e

The results were quite satisfactory and following were noted.

The overshoot in the simulated response is due to the selection of damping coefficient ‘c’

using hit and trial to match.

Increasing ‘c’ will reduce overshoot.

Transients and steady state of both systems are significantly similar

3. MATHEMATICAL MODELING

Fig. 3-3 Validation Setup

The results were quite satisfactory and following were noted.

The overshoot in the simulated response is due to the selection of damping coefficient ‘c’

using hit and trial to match.

Increasing ‘c’ will reduce overshoot.

Transients and steady state of both systems are significantly similar

MATHEMATICAL MODELING

The overshoot in the simulated response is due to the selection of damping coefficient ‘c’

Page 24: study of electric fuel injection

3. MATHEMATICAL MODELING

23 | P a g e

(a)

(b)

(c)

Fig. 3-4 Validation Graphs

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 20

1

2

3

4

5

6

7x 10

4 Impulse ResponseS

ensor

1 p

ositio

n (

counts

)

Time (s)

Actual Hardware

Simulated Model

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 22

2.5

3

3.5

4

4.5x 10

4

time(sec)

Sen

sor

Positio

n(c

oun

ts)

Response to Step Input

Real System Response

Simulated System Response

2 4 6 8 10 12 140

0.5

1

1.5

2

2.5

3

3.5

4

4.5x 10

4 Sine Sweep Response

Sen

sor 1

pos

ition

(cou

nts)

Time (s)

Actual Plant

Simulated Nonlinear Model

Page 25: study of electric fuel injection

24 | P a g e

4 Linearization

4.1 Taylor Series ExpansionOnce simulated model was validated

using Taylor series expansion .

Using Taylor series expansion about equilibrium point (

Plugging it in first equation and with some

Where m = 0.121 kg

c = 1.1

a = 1.04

b = 6.2

u0 = 5575 counts

y0 = 0.02 m

4. LINEARIZATION

Taylor Series Expansion Once simulated model was validated (Increasein our Confidence ) the model was linearized

Using Taylor series expansion about equilibrium point (u0, y0)

Plugging it in first equation and with some manipulations, the linear model obtained

LINEARIZATION

) the model was linearized

e linear model obtained is:

Page 26: study of electric fuel injection

4. LINEARIZATION

25 | P a g e

4.2 Linearized Models at Different Points Once linearization was done, linear models were obtained at different equilibrium points to see

how the system response varies if operating conditions are changed. Following table shows the

linearized models of Simulated Nonlinear model at different operating points. These were

developed using Linear analysis tool of Matlab.

height (cm)

Control

Effort

(Counts)

Transfer Function

1 3314.16 �(�) = 0.002957

�� + 9.091� + 544.4

1.5 4335.1855 �(�) = 0.002261

�� + 9.091� + 509.1

2 5575 �(�) = 0.001757

�� + 9.091� + 477.98

2.5 7065.15 �(�) = 0.001387

�� + 9.091� + 450.6

3 8834.78 �(�) = 0.001109

�� + 9.091� + 426.1

3.5 10917.7 �(�) = 0.0008976

�� + 9.091� + 404.1

4 13348.89 �(�) = 0.0007341

�� + 9.091� + 384.3

Table 4-1

Different step inputs were given to each model to compare the output displacement. It is evident

from the graphs that there is a significant difference in displacement in (m) between all models.

Page 27: study of electric fuel injection

4. LINEARIZATION

26 | P a g e

The model at 1cm has the maximum displacement whereas the model linearized at 4cm has the

least displacement for equal control effort (counts). This suggests that controllers designed for

one linear model will not give us the same performance at other operating points.

(a) (b)

(c)

Fig. 4-1 Step Response at different equilibrium points

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 20

0.5

1

1.5

2

2.5

3

3.5

4

4.5x 10

-3 Step Response (Control Effort (500 counts)

time(sec)

He

ight

( m

)

1cm

1,5 cm

2 cm

2.5 cm

3 cm

3.5 cm

4 cm

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 20

1

2

3

4

5

6

7

8

9x 10

-3 Step Response (Control Effort (1000 counts)

time(sec)H

eig

ht

( m

)

1cm

1.5cm

2cm

2.5cm

3cm

3.5cm

4cm

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 20

0.002

0.004

0.006

0.008

0.01

0.012

0.014

0.016

0.018Step Response (Control Effort (2000 counts)

time(sec)

Hei

ght

( m

)

1cm

1.5cm

2cm

2.5cm

3cm

3.5cm

4cm

Page 28: study of electric fuel injection

5. BLACK BOX SYSTEM IDENTIFICATION

27 | P a g e

5 Black Box System Identification

5.1 Introduction

In many practical scenarios in daily life in order to apply control on a specific plant the transfer

function is not easily determinable or is not known at all. In such situation a hit and trial

approach is used to apply a control scheme on the particular plant. But system identification not

only helps in finding a transfer function but also helps in applying a control scheme on the plant

by using that transfer function.

Therefore system identification is very important especially in case of plants where a hit and trial

approach is not feasible.

In this section the procedure to identify the model of the ECP 730 Maglev system and then

compare the identified transfer function with the actual model and linearized model to determine

the level of accuracy of the identified data is presented.

This identified model is also used as the basis to design different controllers for the plant.

5.2 Literature Review System identification is a procedure whereby a mathematical model for a dynamical systemis

developed usingmeasured data. The three main kinds of system identification are given below:

1) White box modeling

2) Grey box modeling

3) Black box modeling

5.2.1 White box modeling

It is the creation of a model for the system using first principlese.g. a model for a physical

process can be made using Newton’s equations. However in many cases this becomes complex

or impossible and therefore this type of modeling is limited.

5.2.2 Grey Box Modeling

In this model complete information about the inner working of the system is not available but

due to a little insight into the system as well as using measured experimental data a model is

constructed which is a representation of the system.

5.2.3 Black Box Modeling

In this type of modeling the system is a black box i-e nothing is known about the dynamics of the

system and the entire model is formed using input output experimental data. It is not possible to

identify such a model which exactly represents the system. The acceptance of the model depends

on usefulness rather than truth. [1] [2]

Page 29: study of electric fuel injection

5. BLACK BOX SYSTEM IDENTIFICATION

28 | P a g e

5.3 Procedure

1. The data record. The input-output data are sometimes recorded during a specifically designed

identification experiment, where the user may determine which signals to measure and when to

measure them and may also choose the input signals. The object with experiment design is thus

to make these choices so that the data become maximally informative, subject to constraints that

may be at hand. In other cases the user may not have the possibility to affect the experiment, but

must use data from the normal operation of the system.

2. The set of models. A set of candidate models is obtained by specifying within which collection

of models we are going to look for a suitable one. This is no doubt the most important and, at the

same time, the most difficult choice of the system identification procedure. It is here that a priori

knowledge and engineering intuition and insight have to be combined with formal properties of

models. Sometimes the model set is obtained after careful modeling. Then a model with some

unknown physical parameters is constructed from basic physical laws and other well-established

relationships. In other cases standardlinear models may be employed, without reference to the

physical background. Such a model set, whose parameters are basically viewed as vehicles for

adjusting the fit to the data and do not reflect physical considerations in the system, is called a

black box. Model sets with adjustable parameters with physical interpretation may, accordingly,

be called gray boxes.

3. Determining the "best" model in the set, guided by the data. This is the identification method.

The assessment of model quality is typically based on how the models perform when they

attempt to reproduce the measured data.

Page 30: study of electric fuel injection

5. BLACK BOX SYSTEM IDENTIFICATION

29 | P a g e

5.4 Model Structure

There is a wide variety of model structures which can be identified some of them are as follows:

Fig. 5-1: Different modeling structures.

For this model there is a need to find the parameters that are associated with that particular

model. For the purpose of this project least squares algorithm has been used. [1]

5.5 Identification MATLAB Tool

MATLAB provides a comprehensive identification tool made by Lennart Ljung. This tool gives

the user all the options to identify a system’s model of a particular type with a particular order.

Various type of models structures can be identified given the input and output data and the tool

box in turn provides a transfer function which is a representation of that system [2]. A layout of

the tool box is shown below:

Page 31: study of electric fuel injection

5. BLACK BOX SYSTEM IDENTIFICATION

30 | P a g e

Fig. 5-2: System ID tool box main window.

5.6 Working ofMATLABSystem Identification Tool

In order to understand the working of the MATLAB tool the algorithm running behind the

System ID tool is used to find the parameters of the ARX model using the least squares

algorithm. The algorithm and procedure to apply least square algorithm for parameter estimation

of the most basic ARX model structure is summed up below:

Polynomial order: na=2, nb=1, nk =1;

nk is the order of the delay i-e we will use u[k-1] as the input term as shown below.

�[�]= −�� × �[� − 1]− �� × �[� − 2]+ � × �[� − 1]+ �[�]

The above equation is the equation for the ARX model under consideration. Noise has been

treated as direct input. Using MATLAB tool box the parameters estimates yield the following

numerical values for the parameters

a1= -1.8894 a2= 0.9289 b= 0.1068

Plugging these parameters in the above equation will define the complete ARX model. Up till

now MATLAB’s system identification tool has done all the work.

Page 32: study of electric fuel injection

5. BLACK BOX SYSTEM IDENTIFICATION

31 | P a g e

In order to derive the ARX model parameters least squares algorithm can be used and the results

can be compared with the above found parameters which have been found using the MATLAB

System Id tool. To find parameters a1, a2, b without getting any help from System Id tool the

following procedure can be used

Linear model is

�[�]= ∅��� + �[�]

e[n] is the white noise which will obviously not be a part of the linear predictor ,thus linear

predictor is ��[�]= ∅���

Then error between predictor and linear model at any given k is

�[�]= �[�]− ��[�]

The residual for all values of k can be expressed in vector form as follows

�� = �

�[1]⋮⋮

�[� ]

� = �

�[1]⋮⋮

�[� ]

� − �

∅[1]⋮⋮

∅[� ]

� × � = �� − ∅� �

Then the loss function can be written as

�(�)=1

�× � ��[�]

�� �

=1

�× (�� − ∅� �)� × (�� − ∅� �)

The optimal estimate �� can be found by solving, �

���(�) = 0 which gives the following result.

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

��� )…………..equation # 1

For simplest ARX model which is used above the optimal estimate is equal to

�� = �−�1−�2

��

So putting values in the equation #1 and after solving the following particular equation for the

ARX model parameters can be obtained. In this case:

∅��∅� can be given as follows

Page 33: study of electric fuel injection

5. BLACK BOX SYSTEM IDENTIFICATION

32 | P a g e

∅��∅� = �

�[0] … �[� − 1]�[−1] … �[� − 2]�[0] … �[� − 1]

� × ��[0] �[−1] �[0]

⋮ ⋮ ⋮�[� − 1] �[� − 2] �[� − 1]

�� =

⎜⎜⎜⎜⎜⎛

� ��[� − 1]

� �[� − 1]× �[� − 2]

� �[� − 1]× �[� − 1]

� �[� − 2]× �[� − 1]

� ��[� − 2]

� �[� − 2]× �[� − 1]

� �[� − 1]× �[� − 1]

� �[� − 1]× �[� − 2]

� ��[� − 1]

� ⎠

⎟⎟⎟⎟⎟⎞

��

×

⎜⎜⎜⎜⎜⎛

� �[� − 1]× �[�]

� �[� − 2]× �[�]

� �[� − 1]× �[�]

� ⎠

⎟⎟⎟⎟⎟⎞

After finding the above equation the same input output data was used that was given to the

system identification tool box for finding the ARX model. And a code in MATLAB can be

written to solve the above given matrix equation for that particular input output data and thus��

can be found out which comes out to be:

�� = �−1.88940.89150.1005

Hence the parameters become

a1=-1.8894, a2=0.8915, b=0.1005

These values are very near to the values which were found by the system identification tool.

ARX model parameters can be derived while being independent of the system identification tool.

And after finding out those parameters, they can be compared with the parameters of the system

identification tool. The comparison for the values obtained from manual derivation and those

from System Id tool is given below:

a1 a2 b

Identification Tool -1.8894 0.9289 0.1068

Manual Derivation -1.8894 0.8915 0.1005 Table 5-1 Comparison of computer calculated values with manually calculated values.

5.7 Applying System Identification procedure to the Maglev system

A step by step method of applying the system identification procedure to the maglev

system is explained in this section.

Page 34: study of electric fuel injection

5. BLACK BOX SYSTEM IDENTIFICATION

33 | P a g e

5.7.1 Collecting Input-Output Data

The first step towards system identification is to apply suitable input to the actual system

and collect the output and input data. A rich input should be selected which excites all the states

of the system. The ECP module attached with the system provides a range of inputs that can be

applied to it. To achieve a better identified model and to maintain generality, four different

inputs were considered.

Input 1 was a step input with an amplitude of 4000 counts, dwell time of 1 s and 2

repetitions. Input 2 was a ramp input with distance of 4000 counts, velocity of 4000 counts,

dwell time of 2 s and 2 repetitions. Input 3 was a sine input with amplitude of 4000 counts,

frequency of 1 Hz and 2 repetitions. Input 4 was a sine sweep input with an amplitude of 2000

counts, frequency range from 1 to 30 Hz and sweep time of 20 s.

Note: The given specifications of the inputs are in accordance with the ECP software. To get

more information regarding the terminology please refer to the manual of the ECP system.[3]

Since the equilibrium point of 2 cm was chosen, first the disc had to be levitated to this

height before application of the input. Therefore this identification procedure returns a linear

identified system with an equilibrium point of 2 cm. The plots of the input output data collected

are provided below. The y-axis represents Δy in counts and x-axis represents time in seconds.

Page 35: study of electric fuel injection

5. BLACK BOX SYSTEM IDENTIFICATION

34 | P a g e

Fig. 5-3: Step Input to the open loop system. Fig. 5-4: Step Response of the open loop system.

Fig. 5-5: Ramp Input to the open loop system. Fig. 5-6: Ramp response of the open loop system.

0 1 2 3 4 50

500

1000

1500

2000

2500

3000

3500

4000Hardware Input

Time (s)

Input

(counts

)

0 1 2 3 4 5-0.5

0

0.5

1

1.5

2

2.5x 10

4 Hardware Output

Time (s)

Heig

ht

(counts

)

0 2 4 6 8 100

500

1000

1500

2000

2500

3000

3500

4000Hardware Input

Time (s)

Input

(counts

)

0 2 4 6 8 100

2000

4000

6000

8000

10000

12000Hardware Output

Time (s)

Heig

ht

(counts

)

Page 36: study of electric fuel injection

5. BLACK BOX SYSTEM IDENTIFICATION

35 | P a g e

Fig. 5-7: Sine input to the open loop system. Fig. 5-8: Sine Response of the open loop system.

Fig. 5-9: Sine sweep input to the system. Fig. 5-10: Sine sweep response of the open loop system.

0 0.5 1 1.5 2 2.5 3 3.5 4-4000

-3000

-2000

-1000

0

1000

2000

3000

4000Hardware Input

Time (s)

Input

(counts

)

0 0.5 1 1.5 2 2.5 3 3.5 4-2.5

-2

-1.5

-1

-0.5

0

0.5

1

1.5x 10

4 Hardware Output

Time (s)H

eig

ht

(co

unts

)

0 5 10 15 20 25 30-2000

-1500

-1000

-500

0

500

1000

1500

2000Hardware Input

Time (s)

Input

(counts

)

0 5 10 15 20 25 30-3

-2

-1

0

1

2

3

4

5x 10

4 Hardware Output

Time (s)

Heig

ht

(counts

)

Page 37: study of electric fuel injection

5. BLACK BOX SYSTEM IDENTIFICATION

36 | P a g e

The sampling time for all these plots is 0.001768 s which is equal to 1 servo cycle of the ECP

module.

5.7.2 Identifying the model

The input output data was exported to the System Identification toolbox in MATLAB. The data

was preprocessed before applying the estimation procedure. Preprocessing removes any trends in

the data and divides the data into two parts: one for identification and the other for validation of

the identified model. For the purpose of this experiment ARX and ARMAX models were

considered. It was decided to minimize the complexity of the system by choosing a lower order

model such as a 2nd order model. The estimation focus was on Prediction and minimum least

squares method was used to estimate the parameters.

For each input a number of models were estimated and their output performance compared using

the Model Output plots of the System Identification toolbox. It was observed that for a second

order model best fit percentage varied from 40 to 75 % and to achieve a best fit percentage of

around 80% a much higher order was required. ARMAX models showed better estimation than

ARX models in most cases.

The model output graphs for selected step data are provided below:

Fig. 5-11: Selected Model output graphs for the step input.

2.5 3 3.5 4 4.5 5-1.5

-1

-0.5

0

0.5

1

1.5x 10

4

Time

Measured and simulated model output

arx221 (42.83)

arx931 (81.77)

amx2111 (79.06)

Validation Data

Page 38: study of electric fuel injection

5. BLACK BOX SYSTEM IDENTIFICATION

37 | P a g e

It can be seen that ARX model with the order [9 3 1] gives the highest best fit percentage

(81.77%) however a much lower order ARMAX model with order [2 1 1 1] provides an equally

good best fit percentage (79.06%). This model preserves the system dynamics and manages to

give a small error. Therefore ARMAX [2 1 1 1] was selected as the step model.

The model output graphs for selected ramp data are provided below:

Fig. 5-12: Selected Model output graphs for the ramp input.

It can be seen all these models give approximately same best fit percentage so the ARX model

with order [2 1 1] and best fit percentage of 81.86% is selected.

5 5.5 6 6.5 7 7.5 8 8.5 9 9.5 10-6000

-4000

-2000

0

2000

4000

6000

Time

Measured and simulated model output

amx21221 (81.41)

amx2211 (80.97)

amx2211 (80.97)

arx211 (81.86)

Validation Data

Page 39: study of electric fuel injection

5. BLACK BOX SYSTEM IDENTIFICATION

38 | P a g e

The model output graphs for selected sine data are provided below:

Fig. 5-13: Selected Model Output graphs for the sine input.

Again the performance of all the estimated models is similar so the model with the highest best

fit percentage is selected. In this case ARMAX model with order [2 1 1 1] gives the maximum

best fit percentage of 73.23% and has the lowest order. Therefore it is selected.

0 0.5 1 1.5 2 2.5 3 3.5 4-3

-2.5

-2

-1.5

-1

-0.5

0

0.5

1

1.5

2x 10

4

Time

Measured and simulated model output

amx2221 (73.23)

arx331 (66.49)

amx2111 (73.23)

arx221 (66.76)

Validation Data

Page 40: study of electric fuel injection

5. BLACK BOX SYSTEM IDENTIFICATION

39 | P a g e

The model output graphs for selected sine sweep data are provided below:

Fig. 5-14: Selected Model output graphs for the sine sweep input.

It can be seen that all models show poor performance especially the ARX models. This can be

attributed to the fact that the input is changing very quickly and so it becomes difficult for basic

techniques such as ARX or ARMAX to estimate a proper model. Either more advanced

modeling techniques such as Box Jenkins techniques can be applied or input improved to give

less variations. Considering that fact that such high variations do not occur normally ARMAX

model with order [2 1 1 1] is selected because it gives the highest best fit percentage (43.19%)

and has an acceptable order.

5.7.3 Selecting the identified model

Having estimated four different models they were now compared to arrive at a general model

which gave minimum error for all considered inputs. This was done by applying the same

hardware inputs to all models and comparing their responses to each input. Then the percentage

error of each model was calculated for every input. The model which gave minimum error for all

inputs was selected as the identified model. This was achieved by making a model file in

Simulink with the appropriate blocks.

6 7 8 9 10 11 12 13 14 15 16-3

-2

-1

0

1

2

3

4x 10

4

Time

Measured and simulated model output

arx311 (-1.073)

amx2111 (43.19)

arx211 (-3.932)

Validation Data

Page 41: study of electric fuel injection

5. BLACK BOX SYSTEM IDENTIFICATION

40 | P a g e

Step response of the models together with the error percentages are provided below.

Fig. 5-15: Identified Model responses to step input and corresponding error.

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5-1

-0.5

0

0.5

1

1.5

2

2.5x 10

4

Time (s)

He

igh

t (c

ou

nts

)

Comparison of Identified Models

Hardware

Step Model

Ramp Model

Sine Model

Sinesweep Model

Page 42: study of electric fuel injection

5. BLACK BOX SYSTEM IDENTIFICATION

41 | P a g e

Ramp response of the models together with the error percentages are provided below.

Fig. 5-16 : Identified model responses to ramp input and corresponding errors.

Sine response of the models together with the error percentages are provided below.

Fig. 5-17: Identified model responses to sine input and corresponding errors.

0 1 2 3 4 5 6 7 8 9-5000

0

5000

10000

15000

20000

Time (s)

Heig

ht

(counts

)

Comparison of Identified Models

Hardware

Step Model

Ramp Model

Sine Model

Sinesweep Model

0 0.5 1 1.5 2 2.5 3 3.5 4-2.5

-2

-1.5

-1

-0.5

0

0.5

1

1.5

2x 10

4

Time (s)

Heig

ht

(counts

)

Comparison of Identified Models

Hardware

Step Model

Ramp Model

Sine Model

Sinesweep Model

Page 43: study of electric fuel injection

5. BLACK BOX SYSTEM IDENTIFICATION

42 | P a g e

Sine sweep response of the models together with the error percentages are provided below.

Fig. 5-18: Identified model responses to sine sweep input and corresponding errors.

It can be observed that in all cases the model estimated using the sine sweep data gives the least

error and in all cases except for the sine sweep input case the error is not more than 30% which is

quite acceptable. Therefore this model can serve as the general identified model at the

equilibrium point of 2 cm.

The discrete time and continuous time transfer function of the estimated model are as follows:

�(�) = 0.004231�

�� − 1.986� + 0.9873

�(�) = 1.202� + 1362

�� + 7.253� + 402.2

The conversion was done using MATLAB with zero order hold and sample time of 0.001768 s.

5.8 Comparison of Identified Model with the Linearized Model

In order to check the performance of the identified model and to see if there was any advantage

in using the identification procedure it was compared with the linearized model obtained

previously in chapter 4, from linearization of the non-linear equations provided in the manual of

the maglev system. Both linear models were compared with the non-linear model of the system

developed earlier.

0 5 10 15 20 25 30-3

-2

-1

0

1

2

3

4

5x 10

4

Time (s)

Hei

ght

(co

unts

)Comparison of Identified Models

Hardware

Step Model

Ramp Model

Sine Model

Sinesweep Model

Page 44: study of electric fuel injection

5. BLACK BOX SYSTEM IDENTIFICATION

43 | P a g e

The comparison was achieved by making a model file in Simulink. Common input was provided

to all the models and the difference between the output of linearized model and identified model

from the non-linear model was observed. All the models used were in continuous domain.

The result for a step input is provided below.

Fig. 5-19: Response of the models to a step input.

Fig. 5-20: Error plots for linearized and identified models.

The graphs show that both linear models are quite close to each other with the identified model

being a little more accurate than the linearized model. Therefore it is preferable to use input

output data of the system to derive a model through MATLAB easily instead of taking on the

laborious task of linearizing the system equations manually.

5.9 Limitations of the Identified Model

Though the system identification procedure has given us a reasonable estimate of the transfer

function of our system it should be kept in mind that this model is only accurate under certain

conditions. The most important among them are:

1. The model is linear so higher order dynamics of the system are ignored.

2. It is meant for an equilibrium point of 2 cm.

3. It assumes that the noise affecting the system is white in nature.

0 1 2 3 4 5-0.5

0

0.5

1

1.5

2

2.5

3x 10

4

Time (s)

Heig

ht

(counts

)

Comparison of Non linear Vs Linear Vs Identified

Non Linear Model

Linear Model

Identified Model

0 1 2 3 4 5-1000

0

1000

2000

3000

4000

5000

6000

Time (s)

Err

or

(counts

)

Comparison of Non linear Vs Linear Vs Identified

Linear - Non Linear

Identified - Non Linear

Page 45: study of electric fuel injection

44 | P a g e

6 Control Design & Implementation

6.1 Lead-Lag Compensator

6.1.1 Introduction

Control design begins by using a simple unity

which the gain is adjusted in an effort to provide good steady performance and good stability. If

the uncompensated system is unable to meet the design goals, a compensator must be added.

Compensators improve the frequency response according to the performance requirements

feedback and control system. They are fundamental building blocks in classical control theory.

Many different types of compensators are available e.g. PID, lag

controller. Ideal integral compensation requires an active integ

we use passive networks such as lag compensation instead of ideal integrator, the pole and zero

are moved to the left close to the origin. Even though this placement of the pole does not

increase the type number of the system, it yields an improvement in the static error constant over

an uncompensated system. Just as an ideal integrator can be realized by a lag compensator, ideal

derivative compensator can be approximated by lead compensator.

The advantages of passive networks over active networks are:

1. No additional power supplies are required

2. Noise due to differentiation is reduced

The disadvantage is that where

Also, the additional pole of lead does not red

cross the imaginary axis into the right

A negative feedback configuration is used in this section as shown below. The saturation block

limits the control effort output in between

them and continuous lines have continuous

Fig. 6-1 : Negative feedback configuration used in Lead Lad Compensator Design

6. CONTROL DESIGN & IMPLEMENTATION

Control Design & Implementation

Lag Compensator

Control design begins by using a simple unity-feedback system (the uncompensated system) in

adjusted in an effort to provide good steady performance and good stability. If

the uncompensated system is unable to meet the design goals, a compensator must be added.

Compensators improve the frequency response according to the performance requirements

feedback and control system. They are fundamental building blocks in classical control theory.

Many different types of compensators are available e.g. PID, lag-lead etc. PID is an ideal

Ideal integral compensation requires an active integrator with its pole on the origin. If

we use passive networks such as lag compensation instead of ideal integrator, the pole and zero

are moved to the left close to the origin. Even though this placement of the pole does not

system, it yields an improvement in the static error constant over

an uncompensated system. Just as an ideal integrator can be realized by a lag compensator, ideal

derivative compensator can be approximated by lead compensator.

networks over active networks are:

No additional power supplies are required

Noise due to differentiation is reduced

The disadvantage is that where an integrator increases the system type number, lag does not.

Also, the additional pole of lead does not reduce the number of branches of the root locus that

cross the imaginary axis into the right-half plane while ideal derivative reduces the branches.

A negative feedback configuration is used in this section as shown below. The saturation block

rol effort output in between -30000 to 30000. The dotted lines have digital data on

them and continuous lines have continuous data.

: Negative feedback configuration used in Lead Lad Compensator Design

CONTROL DESIGN & IMPLEMENTATION

feedback system (the uncompensated system) in

adjusted in an effort to provide good steady performance and good stability. If

the uncompensated system is unable to meet the design goals, a compensator must be added.

Compensators improve the frequency response according to the performance requirements in a

feedback and control system. They are fundamental building blocks in classical control theory.

lead etc. PID is an ideal

rator with its pole on the origin. If

we use passive networks such as lag compensation instead of ideal integrator, the pole and zero

are moved to the left close to the origin. Even though this placement of the pole does not

system, it yields an improvement in the static error constant over

an uncompensated system. Just as an ideal integrator can be realized by a lag compensator, ideal

the system type number, lag does not.

uce the number of branches of the root locus that

half plane while ideal derivative reduces the branches.

A negative feedback configuration is used in this section as shown below. The saturation block

The dotted lines have digital data on

Page 46: study of electric fuel injection

6. CONTROL DESIGN & IMPLEMENTATION

45 | P a g e

6.1.2 Design Steps

Compensator has been designed using frequency response of open loop system. The design

procedure followed is from [4]

In the following section, the linear model used for designing has operating point (5575

counts,0.02m) which is

������(�) =0.001757

�� + 9.091� + 477.98

The sensor acts as a constant gain of 1000000 counts per meter. So the overall plant is

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

�� + 9.091� + 477.98

Fig. 6-2: Open loop frequency response of the plant

This Bode plot shows the frequency response of the uncompensated system. The phase margin is

very less at 14°.

Lead compensator is used to shift the phase margin of the open loop system to the required phase

margin while not affecting low frequencies in any way.

-60

-40

-20

0

20

Magnitu

de (

dB

)

100

101

102

103

-180

-135

-90

-45

0

Phase (

deg)

Bode Diagram

Gm = Inf dB (at Inf rad/s) , Pm = 14 deg (at 46.7 rad/s)

Frequency (rad/s)

Page 47: study of electric fuel injection

6. CONTROL DESIGN & IMPLEMENTATION

46 | P a g e

Lag compensator is used to provide high gain at low frequencies while not changing the phase

margin in any way and not affecting high frequency response either.

High DC gain is required to reduce steady state error.

Design Procedure:

First we find the value of total gain K required to meet the steady state error requirement.

� = 100

Next we calculate the additional gain we need to provide by the lag compensator.

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

���� = 28.69

Next we design the lead compensator to increase the phase margin of the open loop compensated

plant. The Phase margin (P.M) is calculated using equation as follows.

P. M ��� = tan��2ζ

� −2ζ� + � 1 + 4ζ�

where ζ= 0.5

P. M ��� = 51.83°

As can be seen from the above diagram P.Mcurrent=14° . So the compensator has to add a phase of

P.Mcomp.

�. � ���� = 51.83 − 14 + 10 = 47.84°

3. For this additional phase, the lead compensator’s poles and zeros are found using

�����(�) = 1

� + 1��

� + 1���

Where, � = ����� (�.� ���� )

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

� � � =

� ������ � �

Using the above formulas first � = 0.1486 is calculated. Then

�������� ������ � = 2.5943��

The frequency on the uncompensated system's magnitude plot where the magnitude is -2.5943

dB is selected as the new phase margin frequency. By doing this, the magnitude bode plot of the

compensated system becomes 0db at this new frequency.

Page 48: study of electric fuel injection

6. CONTROL DESIGN & IMPLEMENTATION

47 | P a g e

� ������ = 70.6448 ���/�

� = 0.0367

Lastly, poles of compensator are calculated using the above equations and we get

�����(�) = 6.729� + 27.23

� + 183.3

Fig. 6-3 : bode plots for open loop plant and lead compensator

This figure compares the frequency responses of the uncompensated system and the Lead

compensator. The magnitude curve of the compensator shows that it has no effect on the lower

frequencies. The cross over frequency is increased, the phase margin is increased.

-100

-80

-60

-40

-20

0

20

Magnitu

de (

dB

)

100

101

102

103

104

-180

-135

-90

-45

0

45

Phase (

deg)

Bode Diagram

Frequency (rad/s)

gcLead

gp

Page 49: study of electric fuel injection

6. CONTROL DESIGN & IMPLEMENTATION

48 | P a g e

Fig. 6-4: Open loop frequency response with Lead compensator

This bode plot shows that the required phase margin has been achieved but the dc gain is very

less. So we design Lag compensator such that its magnitude is 0 at higher frequencies but high at

lower frequencies to achieve the required gain.

To design Lag compensator:

We draw two asymptotes between 0 dB and the required gain i.e. 28.7 dB + 11.3 dB = 40dB.

Using equation of line:

� = −20�� /������(�)+ �

The slope of line is -20 dB/decade. The upper frequency for lag compensator is chosen as 0.1

times less than the crossover frequency of lead compensator. This is done so that the pole and

zero of lag compensator do not interfere with the effect of lead compensator.

� ������ = 70.6448 ���/�

Zero of Lag compensator is 0.1w

Pole of Lag compensator is found by the equation of line at 40dB point.

����(�) = � + 7.064

� + 0.2597

-80

-60

-40

-20

0

20

40

Ma

gn

itude

(dB

)

100

101

102

103

104

-180

-135

-90

-45

0

45

Pha

se

(d

eg

)

Bode Diagram

Gm = Inf dB (at Inf rad/s) , Pm = 55.9 deg (at 70.6 rad/s)

Frequency (rad/s)

Page 50: study of electric fuel injection

6. CONTROL DESIGN & IMPLEMENTATION

49 | P a g e

Fig. 6-5: Bode plots for GcLag and Lead Compensated system

This figure compares the frequency response of the Lead compensated system and the Lag

compensator. The magnitude curve of the Lag compensator shows that it adds the desired dc gain

in the system but does not affect the already achieved phase margin and crossover frequency of

the system.

Combining Lead and Lag gives the desired response.

��(�) = 6.7303(� + 7.064)(� + 27.23)

(� + 183.3)(� + 0.2597)

The closed loop bandwidth of the system is 112.8103 rad/s.

-80

-60

-40

-20

0

20

40

Ma

gnitu

de

(d

B)

10-2

10-1

100

101

102

103

104

-180

-135

-90

-45

0

45

Ph

ase

(d

eg)

Bode Diagram

Frequency (rad/s)

Lead Compensated

gcLag

Page 51: study of electric fuel injection

6. CONTROL DESIGN & IMPLEMENTATION

50 | P a g e

6.1.3 Results

Fig. 6-6 : Open loop frequency response of Lag Lead compensated system

The phase margin of open loop compensated system has increased from 11.3° to the 50.4° which

is the design requirement.

Fig. 6-7: Comparison of bode plots three different compensated system

-80

-60

-40

-20

0

20

40

Magnitu

de (

dB

)

10-2

10-1

100

101

102

103

104

-180

-135

-90

-45

0

Phase (

deg)

Bode Diagram

Gm = Inf dB (at Inf rad/s) , Pm = 50.4 deg (at 70.9 rad/s)

Frequency (rad/s)

-100

-50

0

50

Mag

nitu

de (

dB

)

10-2

10-1

100

101

102

103

104

-180

-135

-90

-45

0

45

Pha

se (

de

g)

Bode Diagram

Frequency (rad/s)

Lead Compensated system

Lag Compensated system

Lag-Lead

Page 52: study of electric fuel injection

6. CONTROL DESIGN & IMPLEMENTATION

51 | P a g e

It can be clearly seen from bode plot that Lead compensator only changes the high frequency

response while the response at lower frequencies remains same as the uncompensated system.

Similarly, Lag compensator changes response at lower frequencies while response at higher

frequencies remains same as uncompensated system.

Fig. 6-8: Step Response Of Lag Lead compensated system

The time restrictions have been well met. Overshoot is less than 20%. Settling time is around 0.4

sec. Steady state error is also within the required bounds.

6.1.4 Discretization and Hardware implementation

To implement the compensator on hardware, we discretized the compensator block using

Simulink Model Discretizer with zero order hold [5].

The discretized model is as follows:

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

(� − �����)(� − ������)�ℎ����� = 0.001768 ���

In order to code this compensator in the ECP software, we made use of the following

methodology.

0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.50

0.2

0.4

0.6

0.8

1

1.2

1.4

System: TfCL

Time (seconds): 0.464

Amplitude: 0.973

Step response Closed loop

Time (seconds)

Am

plit

ud

e

Page 53: study of electric fuel injection

6. CONTROL DESIGN & IMPLEMENTATION

52 | P a g e

�� (�) =� (�)

�(�)=

� (1 − ������ + ���������� + ����������������)

1 − (����� + ������)��� + (�����������)���

� (�)− ������ + ����������� (�)+ ��������������� (�)

= � (�(�)− ������ + �����������(�)+ �����������������(�)

Taking inverse z-transform

�[�]= ������ + ��������[� − 1]− (�����������)�[� − 2]+ � (�[�]− ������ + ��������[� − 1]

+ ������������ ��[� − 2])

Putting ����� = 0.9868 ����� = 1 ������ = 0.9611 ������ = 0.7232

�[�]= 1.7232�[� − 1]− 0.7232�[� − 2]+ 6.73�[�]− 13.11�[� − 1]+ 6.383�[� − 2]

This equation can be easily coded. We can see that the present sample of output depends upon

the previous values of output and inputs.

This equation was implemented in ECP software. The system was given different inputs and the

results were compared with those obtained from Simulink.

Fig. 6-9: Comparison of step response of simulation and hardware

0 0.5 1 1.5 20

500

1000

1500

2000

2500

3000

time (sec)

Del

ta y

(co

unts

)

Step Response (Input 2500 counts)

Input Ref

Hardware

Simulation

Page 54: study of electric fuel injection

6. CONTROL DESIGN & IMPLEMENTATION

53 | P a g e

The responses of both Simulink and the hardware are very similar. The difference in the

hardware is very small, about the order of 0.01mm which is not visible to the naked eye. So for

small inputs the compensator works fine.

Fig. 6-10: Displaying nonlinear behavior at large displacements

If we increase the input step to 0.5cm, the response of hardware is still somewhat similar to the

simulated response but some deviations can be observed when the reference goes below 0. This

is because the gain of the linearized plant at lower positions is high. Compensator gain combined

with the gain of plant results in our system to move towards instability. This is observed once the

step input is large as shown below.

0 1 2 3 4 5 6-8000

-6000

-4000

-2000

0

2000

4000

6000

8000

time (sec)

Del

ta y

(cou

nts)

Step Response (Input 5000 counts)

Input Ref

Hardware

simulation

Page 55: study of electric fuel injection

6. CONTROL DESIGN & IMPLEMENTATION

54 | P a g e

Fig. 6-11: Instability occurring at displacement of -10 cm

For large input, such as 1cm (10000 counts), the hardware response does not match the simulated

response. The hardware response is faster and becomes unstable at lower positions.

6.2 H-Infinity

6.2.1 Introduction

In order to overcome the instability caused by the unknown model of the plant, as seen in the lag

lead compensator design section, an H-infinity loop shaping controller is designed. This

controller involves robust stabilization of �∞combined with classical loop-shaping procedure as

mentioned in[6]. It’s a two stage process in which first appropriate weights are chosen to shape

bode plot of the open loop plant as desired and then the shaped plant is robustly stabilized using

�∞ optimization . In our case, we have selected the weights to be that of lag-lead compensator

designed in the previous section.

A positive feedback configuration is used

0 1 2 3 4 5 6-2

-1.5

-1

-0.5

0

0.5

1

1.5x 10

4

time (sec)

Del

ta y

(co

unts

)

Step Response (Input 10000 counts)

Input Ref

Hardware

Simulation

Page 56: study of electric fuel injection

55 | P a g e

Fig. 6-12: positive configuration us

��and�� are pre and post compensators respectively .

plant to the desired shape . Once that is

technique mentioned in [6]. The complete controller implemented is

6.2.2 Design Steps

1. First of all a simple lag lead is designed (or any other conventional controllers

controller is taken as pre- compensator

desired.

2. Next, the maximum stability margin

usually successful. It means that at least 25% of coprime

doesn't change the shape of the open loop plant

3. Synthesize the controller �∞using the Matlab robust analysis

The final controller � = �1�∞�

� . � = �

⎣⎢⎢⎢⎡

6. CONTROL DESIGN & IMPLEMENTATION

: positive configuration used in H infinity loop shaping design

are pre and post compensators respectively . ��and�� are used to shape the open loop

plant to the desired shape . Once that is done,�∞ is synthesized using robust stabilization

. The complete controller implemented is = ���∞��

1. First of all a simple lag lead is designed (or any other conventional controllers

compensator �� to the plant which shapes the open loop bode plot as

�� =6.7303(� + 27.23)(� + 7.064)

(� + 183.3)(� + 0.002597)

�� = 1

the maximum stability margin Ɛ��� is calculated. If Ɛ��� >0.25 then the design is

It means that at least 25% of coprime uncertainty is allowed[6

doesn't change the shape of the open loop plant considerably. In our case

Ɛ��� = 0.556

using the Matlab robust analysis tool. [7]

�2 thus obtained is

⎣⎢⎢⎢⎡−183.3

1000

−0.4760000

−716.10

−150.75.95

−127.8

−11.870

−6.068−0.05338

13.23

−438.50

−130.6−13.25−174 ⎦

⎥⎥⎥⎤

CONTROL DESIGN & IMPLEMENTATION

are used to shape the open loop

is synthesized using robust stabilization

�� .

1. First of all a simple lag lead is designed (or any other conventional controllers). The designed

to the plant which shapes the open loop bode plot as

>0.25 then the design is

6]. This also

Page 57: study of electric fuel injection

6. CONTROL DESIGN & IMPLEMENTATION

56 | P a g e

� . � =

⎣⎢⎢⎢⎡−93.05

0−11.450.186−6.86 ⎦

⎥⎥⎥⎤

� . � = [−15.67 20.18 −75.3 −1.248 −46.11]

� . � = −9.785

6.2.3 Simulations

The step response of lag lead and �� controllers is shown in Fig 7-13. The rise time and settling

time of both controllers is also equal. This shows that the performance specifications by using

weights as conventional controller approximately remain same and we can use the �� robust

stabilization to cater for uncertainties.

.

Fig. 6-13: Comparison of step response of lag lead and H infinity LS controlled system

6.2.4 Hardware Implementation

The controller discretized using zero order hold for three different sampling times and is also

converted into diagonal form for convenience. The state space form of only one of the three

controllers is shown below.

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10

500

1000

1500

2000

2500

3000

Linear Simulation Results

Time (seconds)

Am

plit

ud

e

Lag Lead

H infinity

Scale :1000 counts = 1mm

Page 58: study of electric fuel injection

6. CONTROL DESIGN & IMPLEMENTATION

57 | P a g e

� . � = �

⎣⎢⎢⎢⎡0.9995

0000

00.7232

000

00

0.549900

000

0.96290

0000

0.9865⎦⎥⎥⎥⎤

� . � =

⎣⎢⎢⎢⎡

−1.70.1143−3.383.538−2.81 ⎦

⎥⎥⎥⎤

� . � = [0.004662 0.684 −1.078 0.0002286 0.00003098]

� . � = −8.961

A comparison of step plot for �� with its hardware implementation is shown in Fig 7-14 (a) , (b) and (c).

For TS = 0.001768, the response is very accurate whereas for higher sampling times, the hardware

responses are different from simulations. The H infinity controller also shows a stable response even at

larger displacements (0.5cm) as compared to lag lead compensator which is shown in Fig 7-15 (a) and (b)

.With increase in sampling times, we also notice decrease in stability. A comparison of �� loop shaping

controller using lag lead as weights and lag lead controller proves that we can stabilize such traditional

controllers by H infinity optimization.

Page 59: study of electric fuel injection

6. CONTROL DESIGN & IMPLEMENTATION

58 | P a g e

(a) Ts = 0.001768

(b) Ts = 0.003536

(c) Ts = 0.005304

Fig. 6-14 :Comparison of step response of H infinity LS controlled system

0 0.5 1 1.50

500

1000

1500

2000

2500

3000

Time (sec)

heig

ht(

co

unts

)Step Response (2500 counts)

input

hardware

simulation

Scale:1000 counts = 1mm

0 0.5 1 1.50

500

1000

1500

2000

2500

3000

time(seconds)

heig

ht(

co

unts

)

simulation

hardware

0 0.5 1 1.50

500

1000

1500

2000

2500

3000

time(seconds)

heig

ht(

cou

nts

)

simulation

hardware

Page 60: study of electric fuel injection

6. CONTROL DESIGN & IMPLEMENTATION

59 | P a g e

(a) Ts = 0.001768

(b) Ts = 0.003536

(c) Ts = 0.005304

Fig. 6-15( Displaying H infinity LS robustness over Lag lead compensator )

0 0.5 1 1.5-9000

-8000

-7000

-6000

-5000

-4000

-3000

-2000

-1000

0

1000

time(seconds)

heig

ht(

counts

)

hinf

Lag lead

0 0.5 1 1.5-8000

-7000

-6000

-5000

-4000

-3000

-2000

-1000

0

1000

time(seconds)

he

ight(

co

un

ts)

hinf

Lag lead

0 0.5 1 1.5-10000

-8000

-6000

-4000

-2000

0

2000

time(seconds)

heig

ht(

counts

)

hinf

Lag lead

Page 61: study of electric fuel injection

7. CONTROLLER IDENTIFICATION

60 | P a g e

7 Controller Identification

7.1 Introduction

In chapter 5 it was stated that the transfer function of a system could be determined by collecting

the input-output data of the system and then applying the system identification procedure on it.

This method was illustrated by applying it on the maglev system. Similar procedure can be

applied to identify the transfer function of a controller. Essentially a controller is also a system

with a certain transfer function. Therefore provided that we can collect the input-output data for

the controller, we can identify it by applying the same system identification procedure.

Fig. 7-1: A closed loop system

The question that now arises is how to find the input and output data of the controller. The input

to a controller is the error signal, e(t), which is the difference between the required output and the

actual output. By setting the required parameters we can determine the system closed loop

response that we desire. For example, in the case of a second order system by setting the values

of wn and ζ and by using the generalized second order system equation:

T.F = � �

������ � �� ��,we can approximate closed loop system response which includes the

controller together with the plant. Now apply a test input to this system and observe the output.

The difference between the input provided and the output observed will be the error signal.

The output of the controller is a control effort or the plant input, u(t). Having knowledge of the

plant transfer function and the output response that we require, we can construct the input signal

to the plant. Since Y(s) = G(s) R(s) → R(s) =Y(s)

G(s)or R(s) = G-1(s) Y(s). G-1(s) simply corresponds

to replacing the zeroes of the G(s) with its poles and vice versa.

=>

G-1(s)

Fig. 7-2:Input Output relationship.

Page 62: study of electric fuel injection

7. CONTROLLER IDENTIFICATION

61 | P a g e

For a proper transfer function it creates a problem since now number of zeroes is greater than

number of poles and the inverse transfer function becomes unrealizable. Therefore extra zeroes

have to be added far from the original zeros so that they do not have a considerable effect on the

transfer function. Like this the input of the plant or the output of the controller can be

determined.

Having both input and output data it is now a simple problem of system identification. This

method is considerably easier to apply than designing of controllers and ideally gives an

optimized controller for the system.

7.2 Literature Review

Much work has been done previously but different terminologies have been used instead of

controller identification. Those techniques are different to some degree and the technique

presented here has a certain degree of uniqueness. Using spline fitting to Virtual reference

feedback tuning method to design a controller has been shown in “Comparison of VRFT, NCbT

and VRFT with Spline Fitting”.[8] These techniques are different because they assume that the

plant is unknown and the experimental data collected is that of the closed loop system. On the

other hand, the technique presented in this section uses open loop data to first identify the plant.

Having the plant model and desired output of plant, the input of the plant is found. Using the

desired error trajectory as input data to the controller and the previously found data of plant input

as the output of the controller, a controller is identified using system identification techniques. It

should be noted that term controller identification used in this sectionimplies designing a

controller using system identification technique. It is not simply the process of finding out which

unknown controller is used in a closed loop system. The latter has been done in “controller

identification”[9].

7.3 Applying Controller Identification Procedure to Maglev system

The initial step required to identify the transfer function of a controller is to collect the input and

output data for it. In order to collect this data, information about the transfer function of the plant

is required as well as the specifications of the desired closed loop response such as ��andζ.

7.3.1 Finding the input

Input to the controller is the error signal, e(t), which is the difference between the required output

and the actual output.In order to find this signal we need to first specify the performance

parameters and develop an ideal closed loop response desired. For a second order system the

general equation T.F = � �

������ � �� �� can be used with the desired value of ��and ζ to get the

ideal closed loop response. For the purpose of this experiment �� = 120 rad/s and ζ = 0.8.

Apply a step to this ideal transfer function and record the output. The error signal is the

difference between the input and the output. Like this the input to the controller is found.

Page 63: study of electric fuel injection

7. CONTROLLER IDENTIFICATION

62 | P a g e

7.3.2 Finding the output

The output of the controller is the control effort which is fed to the plant. This means that

controller’s output is the input of the plant. Therefore using the fact that Y(z) = G(z) U(z) which

means that U(z) = G-1(z) Y(z), the input of the plant can be calculated. In order to find it

information about the plant’s transfer function, G(z) is required. For this experiment the model of

the plant identified in chapter 5 will be used as plant’s transfer function. Inverse of this transfer

function is found simply by replacing zeroes with poles and vice versa.

For proper transfer functions calculating the inverse in this way can cause a problem because

now number of zeroes exceeds the number of poles which makes the transfer function

unrealizable. In order to make it realizable extra zeroes need to be added until the transfer

function becomes proper. Theses zeroes are added at such far locations that they have negligible

effect on the transfer function. In this experiment the extra zeroes were added at a frequency 50

times the natural frequency in the original transfer function before calculating its inverse. The

resulting bode plots and step responses of the original system (G) and modified system (G_mod)

show that there is negligible effect due to the extra zeroes.

Note that using this technique to find the inverse presents the limitation that the original system

must be minimum phase otherwise it will give rise to an unstable inverse.

Fig. 7-3: Open loop bode plot of original transfer function (G) and transfer function with added zeroes (G_mod).

-80

-60

-40

-20

0

20

Magnitu

de (

dB

)

10-2

100

102

104

-180

-135

-90

-45

0

Phase (

deg)

Bode Diagram

Frequency (rad/s)

G

G_mod

G

G_mod

Page 64: study of electric fuel injection

7. CONTROLLER IDENTIFICATION

63 | P a g e

Fig. 7-4: Step response of original transfer function (G) and transfer function with added zeroes (G_mod).

Now the step response produced in section 7.3.1, which is the ideal step response required, is fed

to the calculated inverse and the output is recorded. This gives the input of the plant required to

generate the ideal response. This corresponds to the control effort that needs to be generated by

the controller which means that this is the output of the controller.

7.3.3 Identifying the controller

Now that the input-output data set of the controller is complete, system identification techniques

can be used to find the transfer function of the controller. For this experiment a third order ARX

model was found out using the system identification procedure similar to the one described in the

chapter 5. The resulting discrete time transfer function identified is:

�.����� � �.���� � �.���

�� � �.����� � �.������.����.

The open loop bode plots for the plant alone and with the controller are shown below.

0 0.5 1 1.5 2 2.50

1

2

3

4

5

6

Step Response

Time (seconds)

Am

plit

ude

G

G_mod

Page 65: study of electric fuel injection

7. CONTROLLER IDENTIFICATION

64 | P a g e

Fig. 7-5: Magnitude and Phase plots for G and GK.

The step response obtained by using the controller is now compared with the ideal response

required to evaluate the identified controller model.

Fig. 7-6:Ideal step response and the response achieved by using the identified controller.

-100

-50

0

50

100

Magnitu

de (

dB

)

10-3

10-2

10-1

100

101

102

103

-225

-180

-135

-90

-45

0

Phase (

deg)

Bode Diagram

Frequency (rad/s)

G

GK

G

GK

0 0.5 1 1.5 2 2.5 3 3.5 4 4.50

0.2

0.4

0.6

0.8

1

1.2

1.4

Step Response w ith K

time (seconds)

He

ight

(co

un

ts)

Ideal

Using Controller

Page 66: study of electric fuel injection

7. CONTROLLER IDENTIFICATION

65 | P a g e

The graphs show that the performance of the system using the identified controller is quite

similar to the ideal response desired. The only difference is the oscillatory behavior shown by the

system with identified controller for the first 0.5 s which is not a serious issue.

The closed loop system with the identified controller has a gain margin = 21.1 dB at 323 rad/s

and a phase margin of 41.1o at 43.4 rad/s. Therefore the system meets acceptable stability

requirements and the identified controller is accepted as a suitable controller for this system.

7.4 Implementing the identified controller on hardware

After identifying the controller in simulations it was coded for the actual hardware using the

language supported by the ECP software. An input of 2500 counts was given to the hardware and

the response was recorded and compared with the simulation response. The comparison graph is

given below:

Fig. 7-7Closed loop system response of hardware and simulation.

The graphs for actual hardware output and simulated output are quite similar and also in line

with applied input. Therefore this shows that using identification procedure a very suitable

controller was developed for the maglev system.

7.5 Comparison of Controller Identification with conventional controllers

After designing the controller using identification technique it was then compared with the

conventional controllers to gauge its performance.

0 0.5 1 1.5 2 2.5 3-2000

-1000

0

1000

2000

3000

4000

Time (s)

Heig

ht

(counts

)

Closed loop step response

Input

Hardware Output

Simulated Output

Page 67: study of electric fuel injection

7. CONTROLLER IDENTIFICATION

66 | P a g e

7.5.1 Controller Identification Vs. Lag Lead Controller and H infinity controller

This section gives the comparison plots of conventional lag-lead and H infinity controllers with

the controller designed using identification technique. A step input of 5000 counts is applied and

the performance of all three controllers is measured. The result is shown below:

Fig. 7-8: Comparison plots for different controllers.

The graph shows that the controller obtained through identification technique gives enhanced

stability performance similar to the h infinity controller. Therefore this controller is better than

lag lead controller. On the other hand this controller gives a high initial overshoot which quickly

reduces to zero. In this regard H infinity controller shows better performance because it does not

give an overshoot. Furthermore it gives a zero steady state error. This means that the controller

obtained through identification technique is an acceptable controller which can be used in

practical situations.

7.6 Limitations Though the controller obtained through identification process gives acceptable performance it

has certain limitations. The major among them are:

1. This process uses an ideal closed loop response which for the purpose of this experiment

is the ideal second order model. For controllers higher than second order generalized

models are scarcely available which makes this method difficult to apply for higher

models.

2. This method is applicable only to minimum phase systems. For non-minimum phase

systems pole zero cancellation is required which is not feasible in practical systems.

3. The accuracy of this method relies on the accuracy of the identified plant model.

0 0.5 1 1.5-10000

-8000

-6000

-4000

-2000

0

2000

time(seconds)

heig

ht(

counts

)

Comparison of H infinity controller, Laglead Controller and Controller using Identification

hinf

laglead

controller ID

Page 68: study of electric fuel injection

8. APPENDIX

67 | P a g e

8 Appendix

A. S-Function function [sys,x0,str,ts] = Maglev_nonlinear(t,x,u,flag,x0)

switch flag,

% Initialization %

case 0,

[sys,x0,str,ts]=mdlInitializeSizes();

% Derivatives %

case 1,

sys=mdlDerivatives(t,x,u);

% Outputs %

case 3,

sys=mdlOutputs(t,x,u);

% Unhandled flags %

case { 2, 4, 9 },

sys = [];

% Unexpected flags %

otherwise

DAStudio.error('Simulink:blocks:unhandledFlag', num2str(flag));

end

% mdlInitializeSizes

% Return the sizes, initial conditions, and sample times for the S-function.

function [sys,x0,str,ts]=mdlInitializeSizes()

sizes = simsizes;

sizes.NumContStates = 2;

sizes.NumDiscStates = 0;

Page 69: study of electric fuel injection

8. APPENDIX

68 | P a g e

sizes.NumOutputs = 1;

sizes.NumInputs = 1;

sizes.DirFeedthrough = 0;

sizes.NumSampleTimes = 1;

sys = simsizes(sizes);

x0 = [2/100 0]; %zeros(2,1);

str = [];

ts = [0 0];

end mdlInitializeSizes

% mdlDerivatives

% Return the derivatives for the continuous states.

function sys=mdlDerivatives(t,x,u)

a=1.04;

b=6.2;

m=.121;

c=1.1;

g=9.81;

sys(1) = x(2);

sys(2) = (u./(a*m*(100*x(1)+b).^4)-g-((c/m)*x(2)));

end mdlDerivatives

% mdlOutputs

% Return the block outputs.

function sys=mdlOutputs(t,x,u)

sys = x(1);

end mdlOutputs

B. Sensor1.m File % This script finds the coefficients for the sensor linearization / calibration

% using the assumed form of the correction which is linear in the parameters{e,f,g,h}

%INPUTS

Page 70: study of electric fuel injection

8. APPENDIX

69 | P a g e

% Sensor Location (1=lower, 2=upper)

sensloc=2

% Actual magnet distance from mechanical stop (cm),

Yactual=[ 1 2 3 4 5 6 7]';

% Raw data from laser sensor at each height

Y1raw=[7540 4480 2590 1560 793 309 ]';

Y2raw=[ 20 210 493 870 1470 2190 3150]';

% Construct the correction function array

% Solve for the coefficient vector efgh via regression using the backslash operator

if sensloc==1

% Construct the correction function array

X=[1./Y1raw sqrt(1./Y1raw) ones(size(Y1raw)) Y1raw];

efgh=X\Yactual

% Create vector of evaluation points for correction function

Yraw_eval=(2000:100:30000)';

% Evaluate function at points

Ycal=[1./Yraw_eval sqrt(1./Yraw_eval) ones(size(Yraw_eval)) Yraw_eval]*efgh;

e1=efgh(1),f1=efgh(2),g1=efgh(3),h1=efgh(4)

% Plot

plot(Y1raw,Yactual,'o',Yraw_eval,Ycal,'-'),grid,%axis([0 30000 -7 0])

xlabel('Raw Sensor Output (counts)')

ylabel('Magnet Position (cm)')

title('y1 Sensor Calibration / Linearization')

end

if sensloc==2

% Construct the correction function array

X=[1./Y2raw sqrt(1./Y2raw) ones(size(Y2raw)) Y2raw];

efgh=X\(-Yactual);

e2=efgh(1),f2=efgh(2),g2=efgh(3),h2=efgh(4)

% Create vector of evaluation points for correction function

Page 71: study of electric fuel injection

8. APPENDIX

70 | P a g e

Yraw_eval=(2000:100:30000)';

% Evaluate function at points

Ycal=[1./Yraw_eval sqrt(1./Yraw_eval) ones(size(Yraw_eval)) Yraw_eval]*efgh;

% Plot

plot(Y2raw,-Yactual,'o',Yraw_eval,Ycal,'-'),grid,axis([0 30000 -7 0])

xlabel('Raw Sensor Output (counts)')

ylabel('Magnet Position (cm)')

title('y2 Sensor Calibration / Linearization')

end

C. Actuat1.m File % This script finds the coefficients for the magnetic actuator linearization / calibration

% using the assumed form of the correction which is linear in the parameter a

% For Model 730 Apparatus, The upper magnetic field characteristic may be considered to

% the mirror image of the lower ==> The UPPER field coefficent a is the same as for the

% LOWER, and b is the negative of that of the lower

n=4;

% Measured magnet height, CHANGE TO NEGATIVE VALUES FOR ACTUATOR #2

Ymeasured=[3.99 3.95 3.7 3.69 3.3 3.18 3.12 2.8 2.4 2.16 1.9 1.6 1.3 1 0.88 0.83 0.6 0.3 0.1 0]';

% Uncompensated Control Effort input

Utest=[22000 18000 14000 12000 11000 10000 9000 8000 7000 6000 5000 4500 4000 3500 3000 2800 2500 2300 2100 2000]';

% Specify offset parameter, b

b=6.2;

% Input Magnet mass in Kg

m=0.121

W=m*9.81 % magnet weight

% Construct the correction function array

X=[(Ymeasured+b).^n];

% Solve for the coefficient vector abcd via regression using the backslash operator

% Divide by W to normalize force to N

a=X\(Utest/W);

Page 72: study of electric fuel injection

8. APPENDIX

71 | P a g e

% Create vector of evaluation points for correction function

Y_eval=(0:0.1:4.5)';

% Evaluate function at points. Multiply by W to show as-tested case

Ueval=[(Y_eval+b).^n]*a*W;

% Plot

plot(Ymeasured,Utest,'o',Y_eval,Ueval,'-'),grid,%axis([0 4.5 0 25000])

ylabel('Conrol Effort Required to Produce Force Equal to Magnet Weight (counts)')

xlabel('Magnet Position (cm)')

title('u1 Actuator Characteristic / Pre-correction')

a1=a

b1=b

a2=a

b2=-b

Page 73: study of electric fuel injection

9. BIBLIOGRAPHY

72 | P a g e

9 Bibliography

[1] Lennart Ljung, System Identification: Theory for the User.

[2] Lennart Ljung, System Identification Toolbox: For use with MATLAB.

[3] Educational Controls Products, The Model 730 Magnetic Levitation Apparatus.

[4] Norman S. Nise, Control Systems Engineering, 6th ed.

[5] Katsuhiko Ogata, Discrete Time Control Systems, 2nd ed.

[6] Ian Postlethwaite Sigurd Skogestad, Multivariable feedback control - Analysis and Design.

[7] D. ,BHP Res., Clayton, Vic., Australia ,Glover, Keith McFarlane, "A loop-shaping design

procedure using H∞ synthesis," Automatic Control, IEEE Transactions on (Volume:37 ,

Issue: 6 ).

[8] Nobuhiko Koyama, Ichiro Kitamuki, Masuhiro Nitta, Kiyotaka Kato Keisuke Kubota,

"Comparison of VRFT, NCbT and VRFT with Spline Fitting ," in 12th International

Conference on Control, Automation and Systems, 2012.

[9] Michael G. Safonov Thomas F. Brozenec, "Controller Identification," in American Control

Conference, 1997.

[10] Philip & Geim, Andre Gibbs, "Is Magnetic Levitation Possible?," 2009.