34
Introduction Proposed Approach Simulations and Experimentation Conclusions and Future Work Conversion of Neural Network Models to State-Space Models for Model-Based Control Design Sai Susheel Praneeth Kode Master’s Thesis Defense Examination Committee: Dr. Farbod Fahimi (Adviser) Dr. Mark Lin Dr. Chang-kwon Kang Mechanical and Aerospace Engineering Department University of Alabama in Huntsville Sai Kode (University of Alabama in Huntsville) Conversion of Neural Network Models to State-Space Models

Defense_thesis

Embed Size (px)

Citation preview

Page 1: Defense_thesis

IntroductionProposed Approach

Simulations and ExperimentationConclusions and Future Work

Conversion of Neural Network Models toState-Space Models for Model-Based Control

Design

Sai Susheel Praneeth KodeMaster’s Thesis Defense

Examination Committee:Dr. Farbod Fahimi (Adviser)

Dr. Mark LinDr. Chang-kwon Kang

Mechanical and Aerospace Engineering Department

University of Alabama in HuntsvilleSai Kode (University of Alabama in Huntsville) Conversion of Neural Network Models to State-Space Models

Page 2: Defense_thesis

IntroductionProposed Approach

Simulations and ExperimentationConclusions and Future Work

Outline

1 IntroductionProblem StatementCurrent MethodsProposed MethodProcedure

2 Proposed ApproachAnalytical Dynamic ModelNeural Network Dynamic ModelState-Space ExtractionController Design

3 Simulations and Experimentation

4 Conclusions and Future Work

Sai Kode (University of Alabama in Huntsville) Conversion of Neural Network Models to State-Space Models

Page 3: Defense_thesis

IntroductionProposed Approach

Simulations and ExperimentationConclusions and Future Work

Problem StatementCurrent MethodsProposed MethodProcedure

Problem Statement

Traditional method of system automationImplement mathematical feedback control lawMust know system parameters, mathematical model

Limitations to traditional approachMay be difficult to measure/calculate system parametersMathematical model of system may not be availableMay be computationally inefficient for a nonlinear or complexsystem

ProblemNeed method of automating system with unknown dynamic model

Sai Kode (University of Alabama in Huntsville) Conversion of Neural Network Models to State-Space Models

Page 4: Defense_thesis

IntroductionProposed Approach

Simulations and ExperimentationConclusions and Future Work

Problem StatementCurrent MethodsProposed MethodProcedure

Current Methods (Indirect Method)

Currently, neural networks are used in feedback control assystem identifiers or as controllersA system identification NN "trains" real-time to model systembehaviorSystem information is typically passed on to NN controller,which generates control input

[b]

Sai Kode (University of Alabama in Huntsville) Conversion of Neural Network Models to State-Space Models

Page 5: Defense_thesis

IntroductionProposed Approach

Simulations and ExperimentationConclusions and Future Work

Problem StatementCurrent MethodsProposed MethodProcedure

Current Methods (Direct Method)

A somewhat more straightforward method of using a NN infeedback control is to combine the tasks of system identificationand control into a single NNCurrent methods are mathematically complex due to training realtime and undesirable due to uncertain stability marginsController design using NN may be simplified by using staticNN as system identifier, and separate mathematical control law

Sai Kode (University of Alabama in Huntsville) Conversion of Neural Network Models to State-Space Models

Page 6: Defense_thesis

IntroductionProposed Approach

Simulations and ExperimentationConclusions and Future Work

Problem StatementCurrent MethodsProposed MethodProcedure

Disadvantages

The neural network does not accurately model the system duringtraining.

There is no mathematical guarantee that controller can drive theerror to zero.

Sai Kode (University of Alabama in Huntsville) Conversion of Neural Network Models to State-Space Models

Page 7: Defense_thesis

IntroductionProposed Approach

Simulations and ExperimentationConclusions and Future Work

Problem StatementCurrent MethodsProposed MethodProcedure

Proposed Method

Proposed MethodAutomate system with control law that uses state-space representationof system representation extracted from artificial neural networkdynamic model estimator

Artificial Neural NetworksMap action-reaction response of system"Trained" using data from systemActs as early predictor for state vector

State-Space Extraction from NNNN contains same information as dynamic modelState-space representation matrices may be "extracted" from NNProposed method algebraically extracts state-space matrices of acontrol affine non linear system

Sai Kode (University of Alabama in Huntsville) Conversion of Neural Network Models to State-Space Models

Page 8: Defense_thesis

IntroductionProposed Approach

Simulations and ExperimentationConclusions and Future Work

Problem StatementCurrent MethodsProposed MethodProcedure

Advantages

By offline training, we definitely have an accurate NeuralNetwork model.

Using Model-based control design, we can address our certainstability margins versus uncertain stability margins of currentmethods.

Sai Kode (University of Alabama in Huntsville) Conversion of Neural Network Models to State-Space Models

Page 9: Defense_thesis

IntroductionProposed Approach

Simulations and ExperimentationConclusions and Future Work

Problem StatementCurrent MethodsProposed MethodProcedure

Procedure

Derive analytic dynamic modelActs as "virtual real robot"

Build artificial neural networkActs as a dynamic model estimator for the system"Trained" using input-output data from systemState-space representation of system may be extracted usingproposed method

Design a model-based mathematical feedback control lawUsed in series with neural networkCalculates control input

Verify controller in simulationSimulate controller on "virtual real robot"Use MATLAB/Simulink Software

Sai Kode (University of Alabama in Huntsville) Conversion of Neural Network Models to State-Space Models

Page 10: Defense_thesis

IntroductionProposed Approach

Simulations and ExperimentationConclusions and Future Work

Problem StatementCurrent MethodsProposed MethodProcedure

Model-based Neural Network model

Sai Kode (University of Alabama in Huntsville) Conversion of Neural Network Models to State-Space Models

Page 11: Defense_thesis

IntroductionProposed Approach

Simulations and ExperimentationConclusions and Future Work

Analytical Dynamic ModelNeural Network Dynamic ModelState-Space ExtractionController Design

Analytical Dynamic Model

Sai Kode (University of Alabama in Huntsville) Conversion of Neural Network Models to State-Space Models

Page 12: Defense_thesis

IntroductionProposed Approach

Simulations and ExperimentationConclusions and Future Work

Analytical Dynamic ModelNeural Network Dynamic ModelState-Space ExtractionController Design

Analytical Dynamic Model

Parameters

Vc Forward speedω Turn rate

UL, UR PWM inputsT Track(wheelbase)l c.g.offset

CL,CR Damping coefficientsKp, Kd PD speed regulator gains

a, b PWM input slope, intercept

Dynamic Model State-Space Representation

~̇q = H(~q(t)) + B~U(t) =⇒[

V̇c

ω̇

]= H(Vc, ω) + B

[UL

UR

]Sai Kode (University of Alabama in Huntsville) Conversion of Neural Network Models to State-Space Models

Page 13: Defense_thesis

IntroductionProposed Approach

Simulations and ExperimentationConclusions and Future Work

Analytical Dynamic ModelNeural Network Dynamic ModelState-Space ExtractionController Design

Neural Network Dynamic Model

Neural network predicts next state of system given current statevector and input vectorNeural network built by "training" from input-output dataDoes not require information of system parameters,environment, etc.

~q(t + δt) = ND(~q(t), ~U(t))

Sai Kode (University of Alabama in Huntsville) Conversion of Neural Network Models to State-Space Models

Page 14: Defense_thesis

IntroductionProposed Approach

Simulations and ExperimentationConclusions and Future Work

Analytical Dynamic ModelNeural Network Dynamic ModelState-Space ExtractionController Design

State-Space Extraction

Neural Network Model

~q(t + δt) = ND(~q(t), ~U(t)) (1)

State-Space Model

~q(t + δt) = HD(~q(t)) + BD(~U(t)) (2)

To extract HD , Let U =[

00

]

HD(~q(t)) = HD(~q(t)) + BD

[00

]= ND(~q(t),

[00

]) (3)

Sai Kode (University of Alabama in Huntsville) Conversion of Neural Network Models to State-Space Models

Page 15: Defense_thesis

IntroductionProposed Approach

Simulations and ExperimentationConclusions and Future Work

Analytical Dynamic ModelNeural Network Dynamic ModelState-Space ExtractionController Design

State-Space Extraction

To extract BD, algebraically manipulate state-space equation

~q(t + δt)1 = HD(~q(t)) + BD(~q(t)~U(t)) (4)

~q(t + δt)2 = HD(~q(t)) + BD(~q(t)(~U + δ~U)) (5)

Subtract to eliminate HD from equation

~q(t + δt)2 −~q(t + δt)1 = BD(~q(t))δ~U (6)

Two queries of NN are required

BD(~q(t))δ~U = ND(~q(t), ~U(t) + δ~U)− ND(~q(t), ~U(t)) (7)

Sai Kode (University of Alabama in Huntsville) Conversion of Neural Network Models to State-Space Models

Page 16: Defense_thesis

IntroductionProposed Approach

Simulations and ExperimentationConclusions and Future Work

Analytical Dynamic ModelNeural Network Dynamic ModelState-Space ExtractionController Design

State-Space Extraction

Let δ~U =

[10

]

ND(~q(t), ~U(t) +[

10

])− ND(~q(t), ~U(t)) =

[BD11 BD12

BD21 BD22

] [10

](8)

=

[BD11

BD21

]

Similarly we get for other

Sai Kode (University of Alabama in Huntsville) Conversion of Neural Network Models to State-Space Models

Page 17: Defense_thesis

IntroductionProposed Approach

Simulations and ExperimentationConclusions and Future Work

Analytical Dynamic ModelNeural Network Dynamic ModelState-Space ExtractionController Design

State-Space Extraction

Let δ~U =

[01

]

ND(~q(t), ~U(t) +[

01

])− ND(~q(t), ~U(t)) =

[BD11 BD12

BD21 BD22

] [01

](9)

=

[BD12

BD22

]Augmented individual columns to obtain BD[

BD11 BD12

BD21 BD22

]= BD

Sai Kode (University of Alabama in Huntsville) Conversion of Neural Network Models to State-Space Models

Page 18: Defense_thesis

IntroductionProposed Approach

Simulations and ExperimentationConclusions and Future Work

Analytical Dynamic ModelNeural Network Dynamic ModelState-Space ExtractionController Design

Controller Design

Design closed-loop model-based feedback control law that usesHD,BD extracted from NNAny model-based control law that uses state space form may beusedUsed sliding mode control law as an example

Sai Kode (University of Alabama in Huntsville) Conversion of Neural Network Models to State-Space Models

Page 19: Defense_thesis

IntroductionProposed Approach

Simulations and ExperimentationConclusions and Future Work

Analytical Dynamic ModelNeural Network Dynamic ModelState-Space ExtractionController Design

Sliding Mode Control Law

The future state is given by the equation

~q(t + δt) = HD(~q(t)) + BD~U(t) +~f (~q(t)) (10)

We assume an error function ~σ described as a sliding surface~σ(t + δt) = (~q(t + δt)−~qd(t + δt))− λ((~q(t)−~qd(t))) (11)

if we can make the ~σ(t + δt) = 0 , then

~e(t + δt) = λ(~e(t))

where d denotes a desired value, and λ and K are diagonalmatrices where

0 < λ11, λ22 < 10 < K11,K22 < 1

Sai Kode (University of Alabama in Huntsville) Conversion of Neural Network Models to State-Space Models

Page 20: Defense_thesis

IntroductionProposed Approach

Simulations and ExperimentationConclusions and Future Work

Analytical Dynamic ModelNeural Network Dynamic ModelState-Space ExtractionController Design

Controller Stability Analysis

We assume

~σ(t + δt) = ~σ(t)− K.sgn(~σ(t))

For the control law to drive the error to zero

|~σi(t + δt)| < | ~σi(t)|

If σi(t) > 0

σi(t)− Ki + fi < σi(t) =⇒ Ki > |fi|Ki = Fi + ηi

where Fi ≥ |fi| and ηi > 0

By selecting a gain matrix K that satisfies this condition, systemstability is ensured

Sai Kode (University of Alabama in Huntsville) Conversion of Neural Network Models to State-Space Models

Page 21: Defense_thesis

IntroductionProposed Approach

Simulations and ExperimentationConclusions and Future Work

Simulation(parameters)

System parameters used in MATLAB/Simulink simulationParameter Value UnitsMass,[m] 8 kg

Mass Moment of Inertia, [I] 0.33 kg.m2

c.g. Offset from Axle, [l] 0.05 metersTrack, [T] 0.42 meters

Wheel Motor PD regulator Gains, [KP,KD] 10,1 No unitsWheel Motor PWM intercept slope, [a, b] 3.5285, -0.0025 m/s.bin,m/s

Sai Kode (University of Alabama in Huntsville) Conversion of Neural Network Models to State-Space Models

Page 22: Defense_thesis

IntroductionProposed Approach

Simulations and ExperimentationConclusions and Future Work

Controller gains used in MATLAB/Simulink simulationParameter Value Units

Error Limit, Reduces Chatter [φ][

0.10.28

]No units

Sliding Mode Error Gain, [λ][

0.5 00 0.5

]No units

Error Function Gain, [K][

0.1 + E1 00 0.1 + E2

]No units

~E = |(H(~q(t)~U(t)− N(~q(t), ~U(t)))| (12)

Sai Kode (University of Alabama in Huntsville) Conversion of Neural Network Models to State-Space Models

Page 23: Defense_thesis

IntroductionProposed Approach

Simulations and ExperimentationConclusions and Future Work

Open loop simulation for analytical vs NN response forlinear velocity

Sai Kode (University of Alabama in Huntsville) Conversion of Neural Network Models to State-Space Models

Page 24: Defense_thesis

IntroductionProposed Approach

Simulations and ExperimentationConclusions and Future Work

Open loop simulation for analytical vs NN response forangular velocity

Sai Kode (University of Alabama in Huntsville) Conversion of Neural Network Models to State-Space Models

Page 25: Defense_thesis

IntroductionProposed Approach

Simulations and ExperimentationConclusions and Future Work

Closed loop simulation for both velocities

Sai Kode (University of Alabama in Huntsville) Conversion of Neural Network Models to State-Space Models

Page 26: Defense_thesis

IntroductionProposed Approach

Simulations and ExperimentationConclusions and Future Work

Error in open-loop simulation for both velocities

Sai Kode (University of Alabama in Huntsville) Conversion of Neural Network Models to State-Space Models

Page 27: Defense_thesis

IntroductionProposed Approach

Simulations and ExperimentationConclusions and Future Work

Error in closed-loop simulation for both velocities

Sai Kode (University of Alabama in Huntsville) Conversion of Neural Network Models to State-Space Models

Page 28: Defense_thesis

IntroductionProposed Approach

Simulations and ExperimentationConclusions and Future Work

Open-loop experimental data vs NN response for linearvelocity

Sai Kode (University of Alabama in Huntsville) Conversion of Neural Network Models to State-Space Models

Page 29: Defense_thesis

IntroductionProposed Approach

Simulations and ExperimentationConclusions and Future Work

Open-loop experimental data vs NN response for angularvelocity

Sai Kode (University of Alabama in Huntsville) Conversion of Neural Network Models to State-Space Models

Page 30: Defense_thesis

IntroductionProposed Approach

Simulations and ExperimentationConclusions and Future Work

PWM VS Velocities for analytical data

Sai Kode (University of Alabama in Huntsville) Conversion of Neural Network Models to State-Space Models

Page 31: Defense_thesis

IntroductionProposed Approach

Simulations and ExperimentationConclusions and Future Work

PWM VS Velocities for experimental data

Sai Kode (University of Alabama in Huntsville) Conversion of Neural Network Models to State-Space Models

Page 32: Defense_thesis

IntroductionProposed Approach

Simulations and ExperimentationConclusions and Future Work

Conclusions

Hence, this thesis presents a new approach to implementing anartificial neural network into a closed-loop, model-based statespace control law to govern the motion of an autonomous robot.

This new technique does not require information on systemparameters and does not require information from either amathematical or dynamic model of the system.This method is more computationally efficient than traditionalcontrol approaches for systems that are complex or non linear.

Sai Kode (University of Alabama in Huntsville) Conversion of Neural Network Models to State-Space Models

Page 33: Defense_thesis

IntroductionProposed Approach

Simulations and ExperimentationConclusions and Future Work

Future work

State-space representation of our model works perfectly for thesimulation, in order to have that extended to the real robot used in ourresearch, following state space representation is proposed.

N(~q(t), ~U(t)) = HD(~q(t)) + BD(~U)~U (13)

Sai Kode (University of Alabama in Huntsville) Conversion of Neural Network Models to State-Space Models

Page 34: Defense_thesis

IntroductionProposed Approach

Simulations and ExperimentationConclusions and Future Work

Questions

Sai Kode (University of Alabama in Huntsville) Conversion of Neural Network Models to State-Space Models