Sie sind auf Seite 1von 50

MODELING & COMPENSATION OF FRICTION

NONLINEARITY OF GEARHEAD DC SERVOMOTOR

A PROJECT REPORT

Submitted by

Aritra Chatterjee (Univ. Roll no. 12201613012)

Samrat Das (Univ. Roll no. 12201613038)

Shubham Anand (Univ. Roll no. 12201613042)

in partial fulfillment for the award of the degree

of

BACHELOR OF TECHNOLOGY

in

ELECTRICAL ENGINEERING

ST. THOMAS COLLEGE OF ENGINEERING & TECHNOLOGY, KOLKATA

MAULANA ABUL KALAM AZAD UNIVERSITY OF TECHNOLOGY,


WEST BENGAL

MAY, 2017
Page |2

CERTIFICATE OF APPROVAL
This is to certify that the project entitled Modeling& Compensation of Friction Nonlinearity of
Gear-head DC Servomotor in partial fulfillment of requirements for the award of B.Tech
degree in Electrical Engineering , submitted in the Department of Electrical Engineering at
St.Thomas College of Engineering & Technology, Kolkata under Maulana Abul Kalam Azad
University of Technology , West Bengal is an authentic record of our own work carried out
under the supervision of Mrs. Ananya Bose Department of Electrical Engineering.

The matter presented has not been submitted by me/us in any other University / Institute for
the award of B.Tech. Degree.

The names of the students are as follows:-

1. Aritra Chatterjee

2. Samrat Das .

3. Shubham Anand .

(Signature of students)

This is to certify that the above statement made by the candidates is correct to the best of my
knowledge.


Prof. Ananya Bose
Supervisor:
Dept. of EE

. .
HOD (External Examiner)
(Dept. Of Electrical Engineering)
Date:-
Page |3

ACKNOWLEDGEMENT

THE PROJECT ENTITLED MODELING& COMPENSATION OF FRICTION NONLINEARITY OF


GEARHEAD DC SERVOMOTOR HAS BEEN CARRIED OUT UNDER THE GUIDENCE OF MRS.
ANANYA BOSE (Electrical Engineering Department, St. Thomas, College of Engineering &
Technology).

WE LIKE TO EXPRESS OUR SPECIAL GRATITUDE AND THANKS TO MRS. ANANYA BOSE FOR
HER GUIDENCE AND CONSTANT SUPERVISION AND PROVIDING NECESSERY
INFORMATIONS REGARDING THE PROJECT.

WE ALSO LIKE TO EXPRESS OUR SPECIAL THANKS TO DR. BIMAL BHUSAN SEN SIR FOR HIS
HELP AND GUIDENCE.

NAME UNIV. ROLL NO SIGNATURE

ARITRA CHATTERJEE (9) 12201613012

SAMRAT DAS (14) 12201613038

SHUBHAM ANAND (4) 12201613042


Page |4

ABSTRACT

Precision motion control is always mandatory in mechatronic applications. Gear-head dc


servomotors are commonly selected as the actuators for such motion control applications.
However, the downside of applying gear-head motors is incorporation of a good amount of
nonlinearity and consequently the loss of precision to a significant level. In order to overcome
the ill-effects of the nonlinearities of the gearbox, application of robust or adaptive control
strategies could be a prudent decision.
Modeling of gear-head motor is a challenging task due to the complex nature of the
couplingof the nonlinear terms and the uncertainty associated with the friction parameters.
Themain goal of this thesis is to derive a dependable and reduced order mathematical model
ofgear-head motor so that robust control laws can be designed with an aim to improve
themotion control performance even with low cost mechatronic systems that have been
realizedby commercial gear-head motors. Here, an accurate reduced order mathematical
model of agear-head system is derived. The response of the motor under different inputs is
provided. The sequences are then processedto reconstruct the original system response. Then,
the reduced order friction model along withnonlinear ARX based uncertainty structure is
used to segregate the ideal motor response fromthe friction nonlinearity and uncertainty. The
responses are then used to accurately estimatethe nonlinear system model using system
identification toolbox in Matlab. First order Sliding mode controller has been developed for
the controlling action.
Page |5

CONTENTS

1. INTRODUCTION..................................................................................................................................8
1.1 GEAR MECHANISM AND ITS USE IN SERVO APPLICATION..8
1.2 MODELING OF GEAR MECHANISM.......................8
1.3 MOTIVATION AND OBJECTIVE...........................9
2. LITERATURESURVEY.........................................................................................................................10
2.1 INTRODUCTION.....................10
2.2 GEAR FRICTION MODELS...10
2.3 IDENTIFICATION METHODOLOGIES OF GEAR FRICTION MODELS..11
2.4 COMPENSATION TECHNIQUE......................12
3. GENERALISED MODEL OF GEAR HEAD DC SERVO MOTOR.............................................14
3.1 INTRODUCTION..14
3.2 MATLAB MODEL......15
3.3 OBJECTIVES.....................16
4. SYSTEM IDENTIFICATION USING GREY-BOX MODELING TECHNIQUE......17
4.1 INTRODUCTION......................17
4.2 LINEAR SYSTEM MODELS....18
4.3 NON-LINEAR SYSTEM IDENTIFICATION....19
4.4 EXPERIMENTAL PROCEDURE OF FRICTION ESTIMATION USING NONLINEAR
STRUCTURES.......20
4.5 SIMULATION RESULTS ...23
5. COMPENSATION USING SLIDING MODE CONTROLLER...................................................24
5.1 INTRODUCTION.......24
5.1.1 SLIDING MODE CONTROL BASICS....24
5.1.2 VARIABLE STRUCTURE CONTROLLER25
5.2 FIRST AND SECOND ORDER SLIDING MODE CONTROLLER..................25
5.2.1 FIRST OREDER SLIDING MODE CONTROL.....25
5.2.2 REACHABILITY CONDITION.................26
5.2.3 PROOF OF REACHABILITY CONDITION...............27
5.2.4 ADVANTAGES OF SLIDING MODE CONTROL........27
5.2.5 DISADVANTAGES OF SLIDING MODE CONTROL.27
5.2.6 ROBUSTNESS AGAINST MODEL UNCERTANITY.........27
Page |6

5.2.7 LYAPUNOV THEOREM.................28


5.2.8 SECOND OREDER SLIDING MODE CONTROL OR HYPERPLANE
DESIGN...29
5.2.9 REACHABILITY CONDITION FOR SECOND ORDER SYSTEM..29
5.3 SIMULATION RESULTS..........................................................................................................30
6. METHODOLOGY....................................................................................................................................31
6.1 OVERALL ALGORITHM............31
6.2 STEPS WHICH HAVE BEEN FOLLOWED....31
7. CONSTRAINTS & LIMITATIONS.......................................................................................................39
8. FUTURE EXTENSION.............................................................................................................................40
9. APPLICATIONS........................................................................................................................................41
10. DISCUSSIONS &CONCLUSIONS......................................................................................................42
11. BIBLIOGRAPHY.......................................................................................................................................43
12. ANNEXURE...............................................................................................................................................45
Page |7

LIST OF SYMBOLS

J MOMENT OF INERTIA
ANGULAR DISPLACEMENT
X LINEAR DISPLACEMENT
U INPUT TO THE SYSTEM
Sign SIGNUM FUNCTION
S SLIDING SURFACE
A CONSTANT MULTIPLIER
T TIME
T0 INSTANT WHEN S GOES TO ZERO
Exp EXPONENTIAL FUNCTION
K INPUT MULTIPLIER
f(X) NONLINEAR FUNCTION OF LINEAR DISPLACEMENT
E ERROR
R REFERENCE SIGNAL
U0 CONSTANT INPUT
V LYAPUNOV FUNCTION
f(t) NONLINEAR FUNCTION OF TIME
A1 CONSTANT MULTIPLIER OF LINEAR DISPLACEMENT
A2 CONSTANT MULTIPLIER OF LINEAR VELOCITY
C CONSTANT MULTIPLIER OF LINEAR DISPLACEMENT
M MULTIPLIER
Ueq EQUIVALENT INPUT

SUPERSCRIPTS MEANING
. FIRST DERIVATIVE WITH RESPECT TO TIME
.. SECOND DERIVATIVE WITH RESPECT TO TIME
Page |8

1. INTRODUCTION

1.1 GEAR MECHANISM AND ITS USE IN SERVO APPLICATION

Precision motion control is always mandatory in mechatronic applications. Gear-head dc


servomotors are commonly selected as the actuators for such motion control applications. The
dc motors that are used for this purpose are mostly commercial standard low cost motors.
Without gears they run at high speed (around 1000-1200 r.p.m) and produce small amount
of torque. But for precision motion control applications the required speed is quite low (100-
120 r.p.m) and torque requirement is high. Therefore, motors with reduction gears are
commonly used in this kind of applications to increase torque and reduce speed. Apart from
that, large gear ratio has many other advantages. They essentially render the nonlinear and
highly coupled components of a complex dynamic system like a robot manipulators
negligible and thus allow the designer to consider the system to be a linear and decentralized
collection of n number of individual sub-systems. However, the downside of applying gear-
head motors is incorporation of a good amount of nonlinearity and consequently the loss of
precision to a significant level. Gear-head motors introduce several dry friction, backlash,
dead zone kind of hard nonlinearity into the system and thus compromise with the precision
of the system. In order to overcome the ill-effects of the nonlinearities of the gearbox,
application of robust or adaptive control strategies could be a prudent decision. However,
being model based techniques; design of these control systems necessitates a dependable
mathematical model of the gear-head motors. Modeling of gearhead motor is a challenging
task due to the complex nature of the coupling of the nonlinear terms and the uncertainty
associated with the friction parameters. The main goal of this thesis is to derive a dependable
and reduced order mathematical model of gear-head system so that robust control laws can
be designed with an aim to improve the motion control performance even with low cost
mechatronic systems that have been realized by commercial gear-head motors.

1.2 MODELING OF GEAR MECHANISM

Since 1970's, there have been many approaches to correctly model gear mechanisms. In the
earlier days, usually even in the most complicated applications, only a small number of gears
used to be employed in tandem. With the advent of technology, now-a-days much larger
Page |9

number of gears is used even in very cheap and common applications. The use of so called
gearboxes instead of using separate gears helps in reducing the size of the application.
However, the use of multiple gears has adverse effects in terms of increased complexity of the
design, increased nonlinearity and uncertainty. So, unless, these effects are modeled
accurately and precisely, most control algorithms that rely on the accuracy of the system
models would fail.
To overcome this shortcoming, scientists and engineers have been working on developing
more accurate models of gear box mechanism for the last few decades. While some of these
models are quite accurate and exhaustive, they are too complicated to be implemented in a
standard application. However, there are simpler models too [11], but they fail to correctly
and precisely address all the uncertainties and nonlinearities associated with the gearboxes.
Only mathematical modeling of a system doesn't give the exact representation of the system
because of complexity of the system, limited prior information about the system and
incomplete availability of observed data. Even if full knowledge about the system exists yet
exact description is not desirable as the model may become too complex for further
application. So, system identification is considered as an approximate modeling for specific
application on the basis of observed data and prior information.

1.3 MOTIVATION AND OBJECTIVE

From the above discussion it is clear that Gear-head motors introduce several dry friction,
backlash, dead zone kind of nonlinearity into the system and thus precision of the system is
hampered. In the field of mechatronic applications, friction is an impediment that can have
significant negative impact on performance by limiting positional accuracy, causing loss of
energy and potential instability in precision motion control applications. Firstly the
researchers ignored this friction mechanism and presented extensive gear dynamic models.
These produced simplified models but they were not at all realistic and hence could not be
used for any practical application. Then a number of friction models came into existence like
the Coulomb model, Karnopp model, Dahl model, Bristle model etc. [11] , that successfully
modeled the friction nonlinearity in the gearbox of gear-head motors. Moreover, gears not
only exhibit friction nonlinearity, other kinds of nonlinearities such as clearance, spatial
variation and sliding friction also persists. When these nonlinearities are included in the basic
friction model, it complicates even the model of a single mesh gear system. Now, if we try to
extend this model to n number of gears in a gearbox then the whole model becomes more
and more complicated which makes it impossible to be used in real-time applications.
Control of such nonlinearity is also complicated.
P a g e | 10

2. LITERATURE SURVEY

2.1 INTRODUCTION

A comprehensive literature survey has been carried out in order to find out the works
alreadyperformed in gear train / gear box friction modeling and related identification
methodologies. This chapter gives an account of the same. The literature survey has been
presented underthree groups: Gear Friction Models, Identification Methodologies,
Compensation techniques.

2.2 GEAR FRICTIONMODELS

This section briefly describes the available friction models as well as friction uncertainty
basedmodels for gear-head motors.Olsson et al [11] described the available classical static
friction models as well as the modernmodels. They include Coulomb friction model, Karnopp
model, and Armstrong's model. Thepaper also describes the dynamic friction models in detail.
Starting off with the most famous Dahl model, it describes Bristle's model, the Reset Integrator
model, the Bilman and Sorinemodel, the LuGre model. The paper also provides a detailed
comparison of the above modelsand propose algorithms for friction compensation.The
Coulomb friction model [11] is based on the idea that friction opposes motion and the
magnitude of this opposing force is independent of area of contact and relative velocity of
thecontact surfaces. It is often described as a scaled signum function. In the nineteenth
centuryafter the development of modern fluid mechanics a new term `viscous friction' was
coined [12].This was for taking into account the effects of viscous force components due to
the presenceof lubricants in the surfaces of contact. Unlike the discontinuous Coulomb
friction model,the viscous friction was assumed to be continuous and directly proportional to
the relativevelocity of the contact surfaces. However, viscous friction is often combined with
Coulombfriction and described by a linearly rising and falling signum function with a certain
scale parameter. The term stiction was introduced to describe the friction force at rest. This
introduced thefact that external forces below a certain level resist a static object from moving.
The force due to stiction is described by a piecewise linear function for external forces less
than a certain threshold level and greater than that.
The Karnopp model [13] takes into account the fact that the static friction models described
P a g e | 11

by piecewise continuous or discontinuous functions are not suitable for control or simulation
purpose. It was developed to overcome the problems with the zero-crossing detection of
sliding velocity and to avoid the switching between stiction dynamics and sliding dynamics.
However this model suffers from the fact that it is strongly coupled with the rest of the
system, especially the external forces, which are not always explicitly given. Thus, the model
needs tremendous makeovers before it can be applied to systems with different
configurations. The classical friction models has been shown to be capable of being modified
further in order to be capable of considering the temporal dependencies of stiction and
Stribeck effect, notwithstanding anything related to the presliding displacement.
Advancement in this direction was proposed by Armstrong [14]. Unlike the Karnopp model, it
considers the switching between stictionand sliding but using a well-defined mechanism to
govern the switching.

2.3 IDENTIFICATION METHODOLOGIESOF GEAR FRICTION MODELS

Servomotors are widely used in industry. Computer-controlled machines, robots, and process
control valves are some of their applications. Modern Servomotors perform tuning
automatically using real-time data for controlling these actuators. This procedure is
composed of three sequential steps.
. Parameter estimation algorithm identifies a model of the servomotor.
. The parameters obtained in the first step, allows computing a control algorithm.
. The servomotor works using the control algorithm computed in the second step.
Regarding the design of the control law, there exist a great number of designs including
ProportionalDerivative (PD) and Proportional Integral Derivative (PID) controllers. System
identification is a method of using the input and output data of the system to build
themathematical model of the system, which is being widely applied to various fields of
productionand life. Since modern systems are becoming more and more complex, and
eventheir internal mechanisms are unclear in whole, therefore, whether or not researchers
designa rational system identification method to establish the mathematical model of the
systemplays an important role in the process of system identification.
P a g e | 12

2.4 COMPENSATION TECHNIQUE

For friction compensation numerous applications and variations can be found in literature
which is partly summarized in [14]. These ways of compensation can be divided into model
based and non-model based friction compensation and is discussed next into more detail.

NON-MODEL BASED FRICTION COMPENSATION

Examples of non-model based friction compensations are classic PD and PID feedback
controllers, impulsive control and dither. Although the position tracking with a PD control is
stable, stick-slip might occur at low velocity. This effect can be eliminated through high
derivative, high proportional feedback or a combination of both but at cost of possible
instability and the need for a strong actuator. Another issue is the steady-state tracking error
which can be solved with integral control. Integral control on the other hand can cause limit
cycling at low or zero velocity and can cause other difficulties at velocity reversals. These
issues can be handled with a dead band and anti-windup at velocity reversal. But
unfortunately these methods also introduce new issues like steady-state errors and decreasing
performance. Impulsive control achieves precise tracking by applying series of small impacts.
This makes combinations of other technologies possible as well. For example the use of the
impulsive control to achieve a controlled breakaway after which another controller takes
over to regulate the macroscopic movements. Dither is a high frequency signal introduced
into a system to modify its behavior which can result into a stabilizing effect. The focus here
is the capability to smooth the discontinuity of friction at low velocity. After this application
other friction compensation can be applied on top of this as would be done normally for the
velocity dependent friction part. For repetitive trajectories the iterative learning controller
can be applied into a feedforward approach in order to compensate for friction and other
undesired effects. Another class of non-model based friction compensators are friction
estimators. Examples of these are the Kalman-based filter, a predictive filter and a local
function estimator which are compared in [15]. The Kalman-based method uses a random
walk model that treats friction as a random constant and which should not be confused with
the structured friction models used in model based observers. Many more non-model friction
compensations are possible but are not further discussedsince the main focus in this study is
model based friction compensation which is discussed next.
P a g e | 13

MODEL BASED FRICTION COMPENSATION

Model based ways to compensate friction can be subdivided into feed forward and feedback
approaches. The feedback compensation uses the real-time sensed system output while the
feed forward compensation operates with a desired reference. Both systems can be expanded
with adaption mechanisms to cope with changing model-parameters due to varying
circumstances.
P a g e | 14

3. GENERALISED MODEL OF GEAR HEAD DC


SERVOMOTOR MOTOR

3.1 INTRODUCTION

A servomotor is a rotary actuator or linear actuator that allows for precise control of angular
or linear position, velocity and acceleration. It consists of a suitable motor coupled to a sensor
for position feedback.Anything which opposes the relative motion of the body is called
friction. It is a kind of non linearity present in the system. The common example in an electric
motoris in which we find coulomb friction drag due to the rubbing contact between the
brushes and the commutator.
Since 1970's, there have been many approaches to correctly model gear mechanisms. In the
earlier days, usually even in the most complicated applications, only a small number of gears
used to be employed in tandem. With the advent of technology, now-a-days much larger
number of gears is used even in very cheap and common applications.

Fig:3.1.1 Armature controlled DC servomotor

The first and the foremost step for designing a practical controller is the modeling of the
mechanical system. Controller commanding systems where the operating points vary and
where high precision is required, nonlinear modeling is employed. Position and velocity
dependent forces govern the working of industrial mechanical systems. Nonlinear
components of the forces such as coulomb friction, deadzone are present that influence the
operating points of the system adversely while rotation. So, accurate modeling of the plant is
P a g e | 15

required for practical controller design. When uncertainties and time-dependencies prevail
in the system, the parameters of the system must be identified using system identification
technique. Though the system identification technique is very useful and yields accurate
results yet a reasonably simpler model is required so that the identification procedure can be
carried out successfully and each and every parameter of the system may be figured out.

3.2 MATLAB MODEL

Fig :3.2.1 Simulink Model

We first did the state space analysis of the considered model & drew the signal flow graph.
From that we later designed the generalized gear head model for n number of gears using
Matlab.
P a g e | 16

3.3 OBJECTIVES

3.3.1 Gear-head motors introduce several dry friction nonlinearity into the system
and thus precision of the system is hampered. In the field of applications,
friction is an impediment that can have significant negative impact on
performance by limiting positional accuracy, causing loss of energy and
potential instability in precision motion control applications. Firstly the
researchers ignored this friction mechanism and presented extensive gear
dynamic models. These produced simplified models but they were not at all
realistic and hence could not be used for any practical application. So our
main objective is to compensate the friction non linearity of the gear head DC
Servomotor to improve its performance to some extent.

3.3.2 Here, firstly we formulate a gear friction model for a spur gear pair under
sliding friction and time-varying mesh parameters. Then we tried to
compensate the friction non-linearity using sliding mode control.
P a g e | 17

4 .SYSTEM IDENTIFICATION USING GREY-


BOX MODELING TECHNIQUE
4.1 INTRODUCTION

A mathematical modeling of a system is not the exact but is an approximate model of the
realsystem. Exact modeling of the system is not always possible because of the system
complexity,limited prior knowledge about the system and also lack of accurate observed data.
But, evenif we have full knowledge of the system with complete experimental data then also
exactmodeling is not desirable as it may lead to a complex model that will make it difficult to
beused for any practical application.
So, system identification may be defined as the process of establishing a mathematical
modelof the system from a set of experimental data. Types of system identification are as
follows:

Modal parameter identification


Structural-model parameter identification
Control-model identification

Modal and Structural-model parameter identification are used in structural engineering.


Control-model identification is used in mechanical and aerospace engineering. Another mode
of system identification is based on availability of experimental data of thesystem:
White-box model estimation - When a very detailed model of the system is obtained
i.e., when complete experimental data of the system response is obtained. These
models are generally called White box models.
Grey-box model estimation - If, however, some of these parameters are uncertain or
not well known then these models are generally called Grey - box models.
Black-box model estimation - In other cases, as, for instance, in control applications, it
usually suffices to use linear models which do not necessarily refer to the underlying
physical laws and relationships of the process. These models are generally called black
box models are no knowledge about the system is provided or known.

The key steps of system identification are as follows:


. Approximate analytical model of the system is established.
. Responses of the system model are obtained when the system is excited by sources.
P a g e | 18

. Instrumental requirement for accurate sensing is noted.


. Experiment is conducted and data collected.
. System identification techniques are applied.
. Model up-gradation is done based on the obtained results.

4.2 LINEAR SYSTEM MODELS

A linear system is a mathematical model of a system based on the use of a linear


operator. Linear systems typically exhibit features and properties that are much
simpler than the nonlinear case. As a mathematical abstraction or idealization, linear
systems find important applications in automatic control theory, signal processing,
and telecommunications. For example, the propagation medium for wireless
communication systems can often be modeled by linear systems.

Linear Systems
To see whether a system is linear, we need to test whether it obeys certain rules
that all linear systems obey. The two basic tests of linearity are homogeneity and
additivity.

Homogeneity: As we increase the strength of a simple input to a linear system,


say we double it, then we predict that the output function will also be doubled.
For example, if a person's voice becomes twice as loud, the ear should respond
twice as much if it's a linear system. This is called homogeneity or sometimes the
scalar rule of linear systems. Clearly, systems that obey Steven's Power Law do
not obey homogeneity and are not linear, because they show response
compression or response expansion.
Additivity: Suppose we present a complex stimulus S1 such as the sound of a
person's voice to the inner ear, and we measure the electrical responses of
several nerve fibers coming from the inner ear. Next, we present a second
stimulus S2 that is a little different: a different person's voice. The second
stimulus also generates a set of responses which we measure and write down.
Then, we present the sum of the two stimuli S1 + S2: we present both voices
together and see what happens. If the system is linear, then the measured
response will be just the sum of its responses to each of the two stimuli
presented separately.
P a g e | 19

Autoregressive model [AR(p)] model:


yn b0 xn a1 yn 1 a2 yn 2 ... a p yn p
Moving Average [MA(q)] model:
yn b0 xn b1 xn 1 b2 xn 2 ... bq yn q
Autoregressive Moving Average [ARMA(p, q)] model:
yn b0 xn b1 xn 1 b2 xn 2 ... bq yn q b0 xn a1 yn 1 a2 yn 2 ... a p yn p

In statistics and signal processing, an autoregressive (AR) model is a representation of


a type of random process; as such, it is used to describe certain time-varying processes
in nature, economics, etc. The autoregressive model specifies that the output variable
depends linearly on its own previous values and on a stochastic term (an imperfectly
predictable term); thus the model is in the form of a stochastic difference equation.

Together with the moving-average (MA) model, it is a special case and key component
of the more general ARMA and ARIMA models of time series, which have a more
complicated stochastic structure; it is also a special case of the vector autoregressive
model (VAR), which consists of a system of more than one interlocking stochastic
difference equation in more than one evolving random variable.

Contrary to the moving-average model, the autoregressive model is not


always stationary as it may contain a unit root

4.3 NON-LINEAR SYSTEM IDENTIFICATION

System identification is a method of identifying or measuring the mathematical model of


a system from measurements of the system inputs and outputs. The applications of system
identification include any system where the inputs and outputs can be measured and
include industrial processes, control systems, economic data,, biology and the life
sciences, medicine, social systems and many more.

A nonlinear system is defined as any system that is not linear, that is any system that does not
satisfy the superposition principle.. This negative definition tends to obscure that there are
very many different types of nonlinear systems. Historically, system identification for
nonlinearsystems has developed by focusing on specific classes of system and can be broadly
categorised into four basic approaches, each defined by a model class:

1. Volterra seriesmodels,
2. block structured models,
P a g e | 20

3. neural network models, and


4. NARMAX models.

There are four steps to be followed for system identification: data gathering, model postulate,
parameter identification and model validation. Data gathering is considered as the first and
essential part in identification terminology, used as the input for the model which is prepared
later. It consists of selecting an appropriate data set, pre-processing and processing. It
involves the implementation of the known algorithms together with the transcription of flight
tapes, data storage and data management, calibration, processing, analysis and presentation.
Moreover, model validation is necessary to gain confidence in, or reject, a particular model.
In particular, the parameter estimation and the model validation are integral parts of the
system identification. Validation refers to the process of confirming the conceptual model and
demonstrating an adequate correspondence between the computational results of the model
and the actual data.

4.4 EXPERIMENTAL PROCEDURE OF FRICTION ESTIMATION


USING NONLINEAR STRUCTURES

The System Identification Toolbox in MATLAB is for building accurate, simplified models
of complex systems from noisy time-series data. It provides tools for creating
mathematical models of dynamic systems based on observed input/output data. The
toolbox features a exible graphical user interface that aids in the organization of data
and models. The identification techniques provided with this toolbox are useful for
applications ranging from control system design and signal processing to time-series
analysis and vibration analysis.

BASIC STEPS OF SYSTEM IDENTIFICATION

Obtaining systematic information from experimental observations is a key aspect of any


scientific work. The obtained information leads to the formulation of a model of the system
under consideration. Such a model is some form of pattern that explains the observed
experimental results and allows for predictions of future system responses to be made. In our
research in the field of system identification we address the problem of deriving
mathematical models to describe dynamical systems. In particular, we attempt to derive tools
and methods to construct dynamic models for control purposes.
P a g e | 21

A dynamical system is an object linking observable output signals, manipulatable inputs


signals, and disturbances. The process of identifying a system model consists of finding
mathematical functions that correlate these signals. Such a model is an approximation of the
true systematic behaviour. Its complexity is a design choice and should depend on the
purpose the model is designed for. Often complex models are beneficial for analysis of system
behaviour. Whereas, for the design of feedback controllers simple models are generally
desired.

The image below illustrates the fitting of a transfer function, corresponding to a linear time-
invariant dynamic model of vibrations in a flexible structure, to experimental data in the
frequency domain.

Fig : 4.4.1 Fitting of a transfer function

Identification Procedure

An identification procedure consists of designing a suitable input signal, conducting an


experiment, measuring the system response, and finally using the collected data to get a
model of the considered plant. The methods applied in the final identification step depend on
the assumptions that are made on the model structure. In a first principles approach a
parametric model derived from physical principles is built. In contrast, in a "black-box"
modeling approach, the input-output relationship is estimated from experimental data only.
A combination of a first principles model structure and experimental estimation of the model
parameters is referred to as "grey-box" modeling.

The System Identification problem is to estimate a model of a system based on observedinput-


output data. Several ways to describe a system and to estimate such descriptionsexist. This
P a g e | 22

section gives a brief account of the most important approaches. The procedureto determine a
model of a dynamical system from observed input-output data involves threebasic
ingredients:
The input-output data
A set of candidate models (the model structure)
A criterion to select a particular model in the set, based on the information in the data
(the identification method).

The cycle can be itemized as follows:


. A data set of 2500 samples of data was provided to us.
. Tachogenerator generator data is examined. It is smoothed so as to remove trends
and outliers, and useful portions of the original data are selected. Filtering can also be
applied to enhance important frequency ranges. After measuring the signals, organize
the data into variables, and save them in the MATLAB Workspace.
. Then,we import it in the System Identification Tool GUI or represent it as a data
object for estimating models at the command line.
. A programme is formulated that de-noises the tachogenerator data in order to find
out the original TF of the motor. Before we estimate a transfer function model, we
must have:
{ Input/Output data.
{ Perform any required data pre-processing operations. We can detrend the data
before estimation.

The system identification toolbox is used to find out the linear TF of the motor.

It is worth noting that, the validation process is mandatory in case a nonlinear system is being
identified. If the system that we want to identify is a linear one (which, in ourcase, is true), the
validation process is not absolutely mandatory.

. Then the linear TF of the motor is subtracted from the original TF which results into
separation of the friction nonlinearity.
. Then the System Identification toolbox is used to identify the friction data using
Nonlinear polynomial ARX [10 10 9] model.

4.5 SIMULATION RESULT


P a g e | 23
P a g e | 24

5. COMPENSATION USING SLIDING MODE


CONTROLLER
5.1 INTRODUCTION
5.1.1 SLIDING MODE CONTROL BASICS

In control systems, sliding mode control, or SMC, is a nonlinear control method that alters
the dynamics of a nonlinear system by application of a discontinuous control signal that
forces the system to "slide" along a cross-section of the system's normal behaviour. The state-
feedback control law is not a continuous function of time. Instead, it can switch from one
continuous structure to another based on the current position in the state space. Hence,
sliding mode control is a variable structure control method. The multiple control structures
are designed so that trajectories always move toward an adjacent region with a different
control structure, and so the ultimate trajectory will not exist entirely within one control
structure. Instead, it will slide along the boundaries of the control structures. The motion of
the system as it slides along these boundaries is called a sliding mode and the
geometrical locus consisting of the boundaries is called the sliding (hyper)surface. In the
context of modern control theory, any variable structure system, like a system under SMC,
may be viewed as a special case of a hybrid dynamical system as the system both flows
through a continuous state space but also moves through different discrete control modes.

We know

J U

U
= ...(5.1.1.1)
J

Let X (5.1.1.2)

Now take J=1

So from (5.1.1.1) and (5.1.1.2) X U

So we can say U Sign( X ) ....(5.1.1.3)


P a g e | 25

5.1.2 VARIABLE STRUCTURE CONTROLLER

Variable structure control (VSC) is a form of discontinuous nonlinear control. The method
alters the dynamics of a nonlinear system by application of a high-frequency switching
control. The state-feedback control law is not a continuous function of time; it switches from
one smooth condition to another. So the structure of the control law varies based on the
position of the state trajectory; the method switches from one smooth control law to another
and possibly very fast speeds (e.g., for a count ably infinite number of times in a finite time
interval). VSC and associated sliding mode behaviour was first investigated in early 1950s in
the Soviet Union by Emelyanov and several co researchers.

5.2 FIRST AND SECOND ORDER SLIDING MODE CONTROLLER

5.2.1 FIRST OREDER SLIDING MODE CONTROL

Lets define

S X AX ....(5.2.1.1)

From (5.1.1.3) using switching property it gives S= 0 , Now putting in (5.2.2.1)

X = -AX

X(t) = X(0) e At (5.2.1.2)

X = -Sign(S)

Figure 5.2.1.1 sliding surface vs time

Now at the starting time S is non zero. But as time passes S goes to zero gradually.
P a g e | 26

So after T0, Xis going to follow equation (5.2.1.2). As only after S is all the calculations are
going to be valid.

5.2.2 REACHABILITY CONDITION

Now any system following the law S S < 0 will surely reach the sliding surface.

Now say at the beginning of the calculation system has some speed, so here X is nonzero
and X is also nonzero at position a in figure 5.2.2.1

Now as the time progress it gradually falls to S =0 line.

As S S < 0 then if due to its inertia system tries to go beyond S =0 line .

Then S >0 thus S has to be less than zero.

So system again comes back to its position b in case of figure 5.2.2.1 It is also true for the
reverse case if S <0 then always S >0.

So oscillatory behavior along S =0 line will be found. This phenomenon is known as


chattering.

Figure 5.2.2.1first order sliding mode control


P a g e | 27

5.2.3 PROOF OF REACHABILITY CONDITION

Lets say U = -K sign(S)

S X AX (5.2.3.1)

S X AX

S K sign(S ) AX

Now assume | K || AX | then always S < 0 for S> 0

5.2.4 ADVANTAGES OF SLIDING MODE CONTROL

Low sensitivity to plant parameter uncertainty


Greatly reduced-order modeling of plant dynamics
Finite-time convergence (due to discontinuous control law)

5.2.5 DISADVANTAGES OF SLIDING MODE CONTROL

Chattering due to implementation imperfections


Over-focus on matched uncertainties (i.e., uncertainties that enter into the control
channel)

5.2.6 ROBUSTNESS AGAINST MODEL UNCERTANITY

Now if model is not certain like

X f ( X ) U (5.2.6.1)

Assume that | f ( X ) | f 0 and always f 0 0

So now uncertainty is bounded

Now E = R X.(5.2.6.2)
P a g e | 28

Lets define U = U0 if E > 0

= -U0 if E < 0....(5.2.6.3)

So we can say U = U0 sign(E) ....(5.2.6.4)

5.2.7 LYAPUNOV THEOREM

Suppose there is a function V such that

V is positive definite

V ( z ) < 0 for all z 0 , V (0) = 0

then, every trajectory of X = f ( X ) converges to zero as t (i.e., the system is globally


asymptotically stable)

1 2
V E
2

V EE E ( R X ) (5.2.7.1)

Now R is always constant then from equation (5.2.6.2)

= E 0 f X U

= E( f X U 0 sign E )

E ( f 0 U 0 sign E )

E ( U 0 sign E ) . When assuming U 0 f 0

0 .as U 0 0

Then it shows that derivative of the energy is always going to be less than zero, means either
energy will reduce or remain constant .Then error term will also come as zero.

So it is clear that only taking the system as a bounded we can still design U and can achieve
the desired result.
P a g e | 29

In figure 5.2.2.1between point a and b its known as Range Space Dynamics and this
design is known as Range space Design.

5.2.8 SECOND OREDER SLIDING MODE CONTROL OR HYPERPLANE DESIGN

So take the system equation as

X A2 X A1 X U f t (5.2.8.1)

Here f (t ) is the nonlinear part

Now lets say U M sign S ...(5.2.8.2)

Lets take S X CX ...(5.2.8.3)

So from equation (5.2.8.2) and (5.2.8.3) X CX ........(5.2.8.4)

5.2.9 REACHABILITY CONDITION FOR SECOND ORDER SYSTEM

From equation (5.2.8.3)

S X CX

A2 X A1 X U f t CX

A2 X A1 X CX U f t

Ueq U f t ....(5.2.9.1)

Now lets take U U eq M sign S

Now putting in equation (5.2.9.1)

S M sign S f t ...(5.2.9.2)
P a g e | 30

Then SS S M sign S f t .(5.2.9.3)

Assume M f t

Then we can say from equation (5.2.9.3)that SS 0

So, reachability condition is proved for second order system also.

5.3 SIMULATION RESULTS


P a g e | 31

6. METHODOLOGY

6.1 OVERALL ALGORITHM

A generalized signal flow graph is created for dc servo taking gearbox in


consideration.
Relation between all parameters in terms of equation is found from the graph.
The matlab model to obtain response for uncompensated system is created.
First order sliding mode controller to compensate friction is applied.
Two programs named as friction_model and friction_model_modified to obtain
the response of relative displacement is created, so that these values can be used by
loading it in future programs.
Some velocity data of the motor measured by encoder previously had been given.
Having smoothened those data corresponding velocity is found.
As input and output is known, so motor_tf in matlab is found.
Step response of this motor_tf from velocity data is subtracted toobtain friction.
The sytem as a nonlinear arx model and sliding motor control technique is applied.
Finally friction compensated output is the result.

6.2 STEPS WHICHHAVE BEEN FOLLOWED

6.2.1 Creation of friction_model.m & friction_model_modified.m

At first we have found the solutions for and in terms of x1 and x2 in


friction_model.m and friction_model_modified.m program which is written
based on the calculations done at the pdf of HE SONG and 7 thsem report.
(Beside each line from where it is been taken clearly written in annexure)
P a g e | 32

6.2.1.1 Responses
P a g e | 33

6.2.2 Creation of f _motor_ data _reco.m

6.2.2.1 Then we create the motor_data_reco.m where we use the motor_data.m

where previously motor speeds at different instants were recorded.

6.2.2.2 Then we plot that y vs t means velocity vs time curve and name it as
Original encoder data.
6.2.2.3 So the velocity data have been stored in an array of y.
6.2.2.4 Now we define simulation time Ts.
6.2.2.5 But velocity data s in the array y consists of a huge range of data., that is
unnecessary so we apply the smoothing technique where if velocity more
than 200 we set it as 1 and if smaller than -200 put it as -1 else put it as
0.
6.2.2.6 Then again we plot it with the time and name it as Smoothened encoder
data.
6.2.2.7 In the mean time we define a variable named vel that symbolizes the
position of the servo and a single dimensional array velocity with the
zeros initialized in it.
6.2.2.8 Now if y>0 then surely motor has rotation towards the positive means
clockwise direction. Here the motor used is positional servo. So in total it
has 180 degrotation and has 30 teeth in it.
6.2.2.9 Now for each smoothened y recorded we try to find its position in the
180 deg half cycle.
6.2.2.10 So it comes to Summing up the encoder data where if y comes to be 0 vel
remains unchanged, if y>1 means vel increases by 180/30 deg in the
forward direction and y<1 means 180/30 in the reverse direction.
6.2.2.11 So for each time interval what should be the position of the gearhead we
find and put it in the array named Velocity.
6.2.2.12 Then we plot Velocity with the Time and name it as Motor velocity
response with friction.
6.2.2.13 Now we define an one dimensional array input having length same as
total time samples that has already been recorded in range.
P a g e | 34

6.2.2.14 We fill the array with 1.


6.2.2.15 Then we define a variable ideal_motor_data signifies ideal time series
data with the help of iddata command where velocity is considered as
output to corresponding input .
6.2.2.16 Now we find the estimated Motor_tf with help of tfest command where
no of poles taken as 1 and no of zeros taken as 0.
6.2.2.17 Next to load the velocity_data.mat file where Ts , t , velocity ,
motor_tf , input is also loaded.
6.2.2.18 Then we take the step response of motor_tf with time t and put the
response in ideal_motor_data variable.
6.2.2.19 Now plot ideal_motor data with time t and entitle it with Response of
the identified motor.
6.2.2.20 Now the velocity we determined consisted of friction along with
ideal_motor_data. So we subtract ideal_motor from velocity to get the
friction data.
6.2.2.21 Next to plot friction with time t and name it as Friction dynamics
6.2.2.22 We then create a time series data named as friction_data with the help
of iddata command as previous.
6.2.2.23 So finally we estimate the nonlinear arx model with the help of nlarx
command with friction data and orders [nanbnk] [4 4 9] given as
input. Orders are selected randomly with the help of trial and error
method.
na= no of past input
nb= no of past output
nk= no of delays between input and output
6.2.2.24 Now with help of findop command operating points are returned and
assigned where ~ stores steady state , r stores 1 . r is known as
reference, x is the output.
6.2.2.25 r is actually a 3 by 4 by 2 three dimensional array.
6.2.2.26 Now we define an input as u0=1.
6.2.2.27 As r is a matrix it has different columns and rows and one of those is
signallevels, also in this signallevels row it has exactly two part one
being input another being output. So that output part we store in y0.
P a g e | 35

6.2.2.28 But whatever data we have obtained there is a certain amount of


nonlinearity in it. So we need to linearize it by linearize command and
we now store it in sys variable.
6.2.2.29 By the use of StepDataOptions default options for step is been created
and stored in opt.
6.2.2.30 Also this step has two part InputOffset and StepAmplitude.

6.2.2.31 So correspondingly we set the values for Inputoffset and step


Amplitude.
6.2.2.32 Next store the step response in friction identified.
6.2.2.33 Now plot it with respect to t and entitle as Identified Nonlinear Friction
Model Response.
6.2.2.34 At last save all of that .
6.2.2.35 Corresponding responses
( in the next page)
P a g e | 36
P a g e | 37

6.2.3 Creation of f_motor_smc.m

6.2.3.1We load two mat files friction data and velocity data in workspace
Consisting of previously saved values.
6.2.3.2 Then separate the denominator and numerator part of the motor_tf .
6.2.3.3 Find the step response of motor_tf and put it in y_ideal.
6.2.3.4 Next step 6.2.2.24 to 6.2.2.31 is again repeated but here only difference that
we store the step response in a variable x.
6.2.3.5 But step response has dc gain but we have to take the postion where it
settles down. means the steady state value .so we subtract the mean of x
from its original value.
6.2.3.6 Then find the length of time t and put it in variable n.
6.2.3.7 Create two matrix y_smcand input of dimension (n*1) and initialize with
zeros.
6.2.3.8 Now x stores time series data for step response of friction_sys and it has
least value of -0.1110 and highest value of 0.0834.
output
6.2.3.9 We know motor_tf
input
a
Let motor_tf be =
bs+c
So here num=a den[1]=b den[2]=c

d
And bs means (b) in time domain in the program that is nothing but
dt
b
Ts

Then we can say

output a

input b
c
Ts

b
Or, ( output) + (c output) = a input
Ts

b
Or, (a input ) (c output) = ( output)
Ts
P a g e | 38

Ts
Or, output = {(a input)(c output)} .(6.2.3.9.1)
b

Equation (6.2.3.9.1) has been followed in line 34 of the program

6.2.3.10 We have assigned two variable discont_in and in and assigned values to
it.
6.2.3.11 In x times series values of step response of friction_sys has been loaded.
6.2.3.12 So if x crosses the limit of 0.01 and -0.01 then we find system to have too
much of friction nonlinearity. That needs compensation.
6.2.3.13 So we change the values of input, if it is more than 0.01 subtract from in
else addAnd put it in input. y_smc means velocity of the motor
Then plot it .

6.2.3.14 Corresponding response


P a g e | 39

7. CONSTRAINTS & LIMITATIONS

7.1 As we did not have much previous knowledge about the subject of the project as it
is related to mechatronics engineering, we had to spend a lot of time for studying
the subject matters.

7.2 As a gearhead DC servomotor has a lot of nonlinear uncertainty, we had to spend


a lot of time for choosing the different parameters of the entire model.

7.3 After completing the modeling part, we tried to compensate the friction
nonlinearity of the servomotor using PID controller first but we did not get any
justified output. So we used sliding mode controller to compensate the friction
non-linearity.
P a g e | 40

8. FUTURE EXTENSION

8.1 We have used sliding mode controller of first order only. Higher order extension
of the compensator can be the future extension of this project.
8.2 Hardware model of the project has not been done yet. So it can also be thought of.
P a g e | 41

9. APPLICATIONS

Gear head DC servomotor has various applications in robotics & other industrial purpose
and it is often desired that the nonlinearity of the motor must not exceed a certain level so
that it gives the required performance. So the nonlinearity of the motor can be
compensated by this method and in that case our project will be very much useful.
P a g e | 42

10. DISCUSSIONS & CONCLUSIONS

The main aim of the project has been to develop a complete and accurate model of the
gearheaddc servomotor & to compensate the friction non-linearity using sliding mode
controller. The necessity of having this exact model was to have an idea aboutthe
nonlinearities present in the gearbox of the gear-head servomotors that generally
hamperprecision motion control application. In order to achieve the exact nonlinear
model of the gear-head motors, identification techniques were used. This helped in clearly
identifying theparameters of the whole system and also estimating the uncertainty present
in the system.In this work, a systematic procedure has been developed to determine a
friction model thatcharacterizes the real uncertainty in a motor. Accurate model for a
gear-pinion pair hasbeen formulated and then this model has been extended for n number
of gears in action.Generalization makes the model more complicated from the design as
well as the applicationpoint of view. So, in order to have a feasible model of the gear-head
motors the said generalizedmodel was reduced to relatively simpler model. Our work
resulted in a systematic approach to find out a dependable model of the gear-head servo
motor in presence of friction uncertainty.As the proposed approach was generalized in
nature, it could be extended to any type ofgearbox or gear-head and dc motor in
combination.

Now, the accuracy of the model needed to be judged. We have used dataset of 2500
samplesof a small gear-head dcmotor as our system of interest. The gear-head motor's
parameter was to be identified. The first and the foremost step is system identification that
was carried out using grey-box identification technique. Grey-box identification provided
a complete system model along withthe nonlinearities present in the system. Then a robust
controller i.e., sliding mode controller was employed for the compensation.
P a g e | 43

11. BIBLIOGRAPHY
[1]EFFECT OF SLIDING FRICTION ON SPUR AND HELICAL GEARDYNAMICS AND VIBRO-
ACOUSTICSBySong He, B.S., M.S.

[2] R.Haber, H. Unbehauen, \Structure Identification of Nonlinear Dynamic Systems


ASurvey on Input/OutputAproaches," Automatica, vol. 26 , no. 4, pp. 651-677, 1990.

[3] I. D. Landau, \System Identification and Control Design Using P.I.M.+ Software,
EnglewoodCli_s," New Jersey: Prentice Hall, 1990.

[4] L. Zadeh, \From circuit theory to system theory," Proc. of the IRE, vol. 50, no. 5, May1962,
pp. 856-865.

[5] Z. Pang, H. Cui, \MATLAB Simulation of System Identification and Adaptive


Control,"Beijing: National Defense Industry Press, 2009.

[6] D. Liu, \System Identification Methods and Applications," Beijing: National


DefenseIndustry Press, 2010.

[7] F. Ding, \System identification, Part A: Introduction to the identification," Journal


ofNanjing University of Information Science and Technology: Natural Science Edition, vol.3,
no. 1, pp. 1- 22, 2011.

[8]L. Ljung, \Convergence analysis of parametric identification methods," IEEE Trans.


OnAutomatic Control, vol. 23 no. 5, pp. 770-783, Oct. 1978.

[9] P. Eykho_, \System Identification:Parameter and State Estimation," John Wiley & Sons,pp.
555, 1974.

[10]Nelles, Oliver,\Nonlinear system identification," Ed. Springer Verlag, 2001.

[11]H. Olsson, K. J. _Astrom, C. C. de Wit, M. Gafvert, and P. Lischinsky, \Friction Models


and Friction Compensation," Eur. J. Control, vol. 4, no. 3, pp. 176{195, 1998.}
P a g e | 44

[12]O. Reynolds, \On the theory of lubrication and its application to Mr. Beauchamp
Tower'sexperiments, including an experimental determination of the viscosity of olive oil,"
Phil. Trans. Royal Soc., vol.177, pp. 157{234, 1886.}

[13]D. Karnopp, "Computer simulation of stick-slip friction in dynamical systems," J. Dy -


namic Syst., Meas., Contr., vol. 107, no. 1, pp.100 -103, 1985.

[14]B. Armstrong-Helouvry , P. Dupont and C. C. de Wit, "A survey of models, analysis


tools and compensation methods for the control of machines with friction," Automatica,
vol. 30, no. 7, pp.1083 -1138, 1994.

[15] A. Ramasubramanian and L.E. Ray. Stability and performance analysis for non-model-
based friction estimators. volume 3, pages 29292935, 2001.
P a g e | 45

12. ANNEXURE
12.1 friction_model.m
%The parameters are to be copied from the thesis of He Song
%Page 21
%The Solution is based on Euler's Method
%viscous damping of tooth (lb-s/in)
c1= 1; c0= 1;
%tooth mesh stiffness (lb/in)
k1= 1; k0=1;
%Moment arm of pinion (in)
Xp1=1; Xp0=1;
%Moment arm of gear (in)
Xg1=1; Xg0=1;
%polar moment of inertia (lb-s^2-in)
Jp=1; Jg=1;
%effective polar moment of inertia (lb-s^2-in)
Je=1;
%radius (in) from base to gear
rbg=1;
%radius from base to pinion
rbp=1;
%angular speed (rad/s)
omegap=1;
%base pitch (/in)
lambda=1;
%coefficient of friction
mu=1;
%Effective Troque (lb-in)
Te=1;

Lap=1;
%----------------------------------------------------%

deno=Jp*rbg^2+Jg*rbp^2; % 7 thsem report eqn 3.3.9


fac1=mu*(Xp1*Jg*rbp+Xg1*Jp*rbg)/deno; % 7 thsem report eqn 3.3.9 as
contact ratio sigma=2 here fac1 for i=2
fac0=mu*(Xp0*Jg*rbp+Xg0*Jp*rbg)/deno; % fac0 for i=1
TSim=15;
h=0.001;
t=0;
u=Te/deno; % 7 thsem report eqn 3.3.13
n=floor(TSim/h); % finding no of looping
x1=zeros(n,1); % initializing x1 which stores values of del
x2=zeros(n,1); % initializing x2 which stores values of del dot
for i=1:n-1
sgn=sign(mod(omegap*rbp*t,lambda)-Lap); % 7 thsem report eqn 3.3.9 where
n=ceil(sigma) and here sigma=1.43 then n=2 so n-i=1
B=c1*(1+fac1*sgn)+c0*fac0; % 7 thsem report as n=2 only c1 and c0 exists
K=k1*(1+fac1*sgn)+k0*fac0; % 7 thsem report as n=2 only k1 and k0 exists
x1(i+1)=x1(i)+h*x2(i); % here h=stepsize=dt, h=d(del)/(d(deldot)/dt)
x2(i+1)=x2(i)+h*(-K*x1(i)/Je-B*x2(i)/Je+u/Je); % 7 thsem report eqn 3.3.13
rearrange the eqn for finding value of deldoubledot
t=t+h;
end
time=linspace(0,t-h,n);
plot(time',x1,'k')
P a g e | 46

holdon;
plot(time',x2,'r')
xlabel('Time (s)')
ylabel('$\delta(t)$ and $\dot{\delta}(t)$','Interpreter','latex')
legend('\delta(t)','d\delta(t)/dt')
grid

12.2 friction_model_modified.m
%Spur gear friction gear model
%The Solution is based on Euler's Method

%polar moment of inertia (lb-s^2-in)


Jp=8.48E-03; Jg=2.00E-02;

%radius (in) from base to gear


rbg=4.117/2;

%radius from base to pinion


rbp=3.372/2;

%base pitch (/in)


lambda=pi/8;

%angular speed (rad/s)


omegap=100*pi/3;

tc=lambda/(omegap*rbp);

%time invariant damping ratio


zetam=0.2;

%effective polar moment of inertia (lb-s^2-in)


deno=Jp*rbg^2+Jg*rbp^2;
Je=Jp*Jg/deno;

%Profile contact ratio


gamma=1.43;

%coefficient of friction
mu=0.2;

%Effective Troque (lb-in)


Tp=2000;
Tg=(31/25)*Tp; % no of teeth in pinion=25 and in gear=31
Te=Tp*Jg*rbp+Tg*Jp*rbg; % hesong equation 4.1b-d page 94

Lap=lambda*(gamma-1)/(2-gamma);

%----------------------------------------------------%

TSim=.5;
h=0.001;
t=0;
u=Te/deno; % 7 thsem report equation 3.3.10
n=floor(TSim/h); % finding no of looping
x1=zeros(n,1); % initializing values of del
P a g e | 47

x2=zeros(n,1); % initializing values of deldot

clc

for i=1:n-1
t=h*i;

%tooth mesh stiffness (lb/in)


k=20E03; % from hesong
k1= k*mod(t,tc); k0=k*(tc+mod(t,tc)); % hesong page25 eqn 2.3 for i=1
and i=0

%viscous damping of tooth (lb-s/in)


c1= 2*zetam*sqrt(k1*Je); c0= 2*zetam*sqrt(k0*Je); % hesong page 29 eqn
2.8

%Moment arm of pinion (in)


LXA=1; % from hesong
Xp1=LXA+mod(omegap*rbp*t,lambda); Xp0=LXA+lambda+mod(omegap*rbp*t,lambda);
% hesong page 29 eqn 2.6 for i=1 and i=0

%Moment arm of gear (in)


LYC=1;
Xg1=LYC+lambda-mod(omegap*rbg*t,lambda);
Xg0=LYC-mod(omegap*rbg*t,lambda); % hesong page 29 eqn 2.7 for i=0 and i=1

fac1=mu*(Xp1*Jg*rbp+Xg1*Jp*rbg)/deno;
fac0=mu*(Xp0*Jg*rbp+Xg0*Jp*rbg)/deno;
sgn=sign(mod(omegap*rbp*t,lambda)-Lap);
B=c1*(1+fac1*sgn)+c0*fac0;
K=k1*(1+fac1*sgn)+k0*fac0;
x1(i+1)=x1(i)+h*x2(i);
x2(i+1)=x2(i)+h*(-K*x1(i)/Je-B*x2(i)/Je+u/Je);
end
time=linspace(0,t-h,n);
subplot(2,1,1)
plot(time',x1,'b')
xlabel('Time (s)')
ylabel('\delta(t)')
legend('\delta(t)')
grid
subplot(2,1,2)
plot(time',x2,'r')
xlabel('Time (s)')
ylabel('d\delta(t)/dt')
legend('d\delta(t)/dt')
grid
P a g e | 48

12.3 f_motor_data_reco.m
clc;
clear;

load('motor_data.mat')
range = length(t);
vel = 0;
velocity = zeros(range, 1);
Ts = (t(200) - t(100))/100;

subplot(2,3,1)
plot(t,y);
xlabel('time (s)');
ylabel('velocity (rad/s)');
grid;
title('Original encoder data');

%Smoothing
for i = 1:range
if y(i,1)> 200
y(i,1) = 1;
elseif y(i,1)< -200
y(i,1) = -1;
else
y(i,1)= 0;
end
end

subplot(2,3,2)
plot(t,y);
xlabel('time (s)');
ylabel('velocity (rad/s)');
grid;
title('Smoothned encoder data');

%Summing up the encoder data


for i = 1: range
if y(i,1) == 0
vel = vel + 0;
elseif y(i,1) > 0
vel = vel + pi/30;
elseif y(i,1) < 0
vel = vel - pi/30;
end

velocity(i,1) = vel;
end
input=ones(range,1);

subplot(2,3,3)
plot(t, velocity);
xlabel('time (s)');
ylabel('velocity (rad/s)');
grid;
title('Motor velocity response with friction');

ideal_motor_data = iddata(velocity, input, Ts);


motor_tf = tfest(ideal_motor_data, 1,0)
P a g e | 49

save ('velocity_data', 'velocity', 'Ts' , 'input', 't', 'motor_tf');


clear;

load('velocity_data.mat');

ideal_motor = step(motor_tf,t);
subplot(2,3,4)
plot(t, ideal_motor)
xlabel('time (s)');
ylabel('velocity (rad/s)');
grid;
title('Response of the identified motor');

friction = velocity - ideal_motor;


friction_data = iddata(friction, input, Ts);

subplot(2,3,5)
plot(t, friction)
title('Friction dynamics');
xlabel('time (s)');
ylabel('velocity (rad/s)');
grid;

%Nonlinear ARX model


%After Trial and error, best results are seen to be obtained if nk = 8 or 9
friction_sys = nlarx(friction_data, [4,4,9])

u0 = 1;
[X,~,r] = findop(friction_sys, 'steady', 1); %operating point or equilibrium
point
y0 = r.SignalLevels.Output;
sys = linearize(friction_sys,u0,X);
opt = stepDataOptions;
opt.InputOffset = u0;
opt.StepAmplitude = 0.1;

friction_identified = step(friction_sys, t, opt);

subplot(2,3,6)
plot(t, friction_identified)
title('Identified Nonlinear Friction Model Response');
xlabel('time (s)');
ylabel('velocity (rad/s)');
grid;
input = ones(length(t),1);
save('friction_data', 'friction_sys', 'friction_identified', 'friction',
'input', 'Ts', 't');
clear
P a g e | 50

12.4 f_motor_smc.m
load('friction_data.mat');
load('velocity_data.mat');

discont_in = 0.1;
num = motor_tf.num;
den = motor_tf.den;

y_ideal = step(motor_tf,t);

u0 = 1;
[X,~,r] = findop(friction_sys, 'steady', 1);
y0 = r.SignalLevels.Output;
sys = linearize(friction_sys,u0,X);
opt = stepDataOptions;
opt.InputOffset = u0;
opt.StepAmplitude = 0.1;
x = step(friction_sys, t, opt);
x = x - mean(x); %dc gain consideration

n=length(t);
y_smc=zeros(n,1);
in = 1.0;
input=zeros(n,1);
clc;

for i=1:n-1
if x(i)>=0.01
input(i) = in - discont_in;
elseif x(i)<=-0.01
input(i) = in + discont_in;
else
input (i) = in;
end
y_smc(i+1) = y_smc(i) + (Ts/den(1))*(-den(2)*y_smc(i)+ num*input(i)); %Js+B
end

plot(t, y_smc)
title('Response of the motor with friction identification and SMC');
xlabel('time (s)');
ylabel('speed (rad/s)');
grid;

Das könnte Ihnen auch gefallen