control with neural networks case studies
DESCRIPTION
Control with Neural Networks Case studies. Roland Pihlakas 08. Dec 2008. Proof of concept examples. Sunspot Activity: - Classical example Hydraulic actuator for a crane: NPC > APC The issue of fast sampling for validation Pneumatic position servomechanism: - Nonlinear - PowerPoint PPT PresentationTRANSCRIPT
Control with Neural NetworksControl with Neural Networks
Case studiesCase studies
Roland PihlakasRoland Pihlakas
08. Dec 200808. Dec 2008
Proof of concept examplesProof of concept examples
Sunspot Activity:Sunspot Activity:- Classical example- Classical example
Hydraulic actuator for a crane:Hydraulic actuator for a crane:- NPC > APCNPC > APC- The issue of fast sampling for validationThe issue of fast sampling for validation
Pneumatic position servomechanism:Pneumatic position servomechanism:- Nonlinear- Nonlinear
Level in a water tank:Level in a water tank:- Direct inverse control- Direct inverse control
The Sunspot BenchmarkThe Sunspot Benchmark
Optimal Brain Surgeon (OBS) assists Optimal Brain Surgeon (OBS) assists in:in:• Selecting the network architectureSelecting the network architecture• Selecting the regressors (inputs)Selecting the regressors (inputs)
The Sunspot BenchmarkThe Sunspot Benchmark
Fully connected network has too Fully connected network has too many adjustable parameters for the many adjustable parameters for the training settraining set
OBS algorithm:OBS algorithm:• Prune input-to-hidden weightsPrune input-to-hidden weights• RetrainRetrain• Remove the least salient unit from the Remove the least salient unit from the
set of units with single inputset of units with single input
The Sunspot BenchmarkThe Sunspot Benchmark
The training error gets larger during The training error gets larger during pruningpruning
Test errors will decrease due to better Test errors will decrease due to better generalization / less overfitting ... Until generalization / less overfitting ... Until some point.some point.
Note that FPENote that FPEis not too informativeis not too informativein current example...in current example...
The Sunspot BenchmarkThe Sunspot Benchmark
Matlab: “Matlab: “it looks as if not much is it looks as if not much is gainedgained by pruning. The reason for by pruning. The reason for this is, however, that thethis is, however, that the network network has been trained using has been trained using rregularization.egularization.””
The result of The result of pruning:pruning:
The Sunspot BenchmarkThe Sunspot Benchmark
Additional notesAdditional notes• The result of pruning sessions can vary a The result of pruning sessions can vary a
great dealgreat deal. -> One must run multiple pruning . -> One must run multiple pruning sessions, each one started with a different set sessions, each one started with a different set of network weights.of network weights.
• The test sets were in some sense The test sets were in some sense “actively” used for pruning“actively” used for pruning. A distinction is . A distinction is made between this type of result and so-called made between this type of result and so-called “genuine predictions”, where test sets are “genuine predictions”, where test sets are strictly used for validation. -> gives more strictly used for validation. -> gives more reliable estimate of generalization error.reliable estimate of generalization error.
Hydraulic ActuatorHydraulic Actuator
Problem with fast samplingProblem with fast sampling NPC > APCNPC > APC
Hydraulic ActuatorHydraulic Actuator
Measured values:Measured values:• Valve opening (input)Valve opening (input)• Oil pressure (output)Oil pressure (output)
Note the Note the oscillatory oscillatory responseresponse
Hydraulic ActuatorHydraulic Actuator
First, linear model will be estimatedFirst, linear model will be estimated This is useful as a reference against This is useful as a reference against
more complicated modelsmore complicated models ARX(3, 2, 1) ARX(3, 2, 1)
evaluation:evaluation:
Hydraulic ActuatorHydraulic Actuator
NNARX(3, 2, 1)NNARX(3, 2, 1) 10 network architectures, with 1-10 10 network architectures, with 1-10
hidden units, 5 networks of eachhidden units, 5 networks of each Legend:Legend:
x – training errorx – training erroro – test erroro – test error
Spread of errorsSpread of errorsis caused by is caused by local minimalocal minima
Hydraulic ActuatorHydraulic Actuator
For comparing model structures it is For comparing model structures it is absolutely vitalabsolutely vital that the training that the training must be continued until the weights must be continued until the weights are extremely near the minimum. are extremely near the minimum. Else overfitting will be less Else overfitting will be less pronounced.pronounced.
Network with 4 hidden units was Network with 4 hidden units was best. It is recommended to choose best. It is recommended to choose then a slightly larger network.then a slightly larger network.
Hydraulic ActuatorHydraulic Actuator Next, regularization is performed.Next, regularization is performed.
Legend:Legend:solid – training errorsolid – training errordashed – test errordashed – test errordot-dashed – simulation on testdot-dashed – simulation on test
Note that again test set was used for Note that again test set was used for training...training...
Hydraulic ActuatorHydraulic Actuator
NNARX simulation is better than of NNARX simulation is better than of the linear model:the linear model:
Pneumatic ServomechanismPneumatic Servomechanism
Nonlinear and has poorly damped Nonlinear and has poorly damped complex pole pair in the operating complex pole pair in the operating point.point.
Pneumatic ServomechanismPneumatic Servomechanism
The system has to be operated in The system has to be operated in closed-loop when conducting the closed-loop when conducting the experiment.experiment.
Manually tuned PI-controller is used Manually tuned PI-controller is used for stabilization of the system during for stabilization of the system during the experiment.the experiment.
Pneumatic ServomechanismPneumatic Servomechanism
To cover entire operating range, a high-To cover entire operating range, a high-frequency signal is applied in some frequency signal is applied in some periods of the experiment.periods of the experiment.
Pneumatic ServomechanismPneumatic Servomechanism
Mimimum test error was achieved Mimimum test error was achieved with 12 hidden units, which with 12 hidden units, which corresponds to 121 weights.corresponds to 121 weights.
121 weights is small number 121 weights is small number compared to training set compared to training set => no need for regularization or => no need for regularization or pruning.pruning.
Pneumatic ServomechanismPneumatic Servomechanism
NPC control. Note how controller NPC control. Note how controller anticipates future changes in the anticipates future changes in the set-point.set-point.
Pneumatic ServomechanismPneumatic Servomechanism
APC control. The response is similar APC control. The response is similar to the one of NPC.to the one of NPC.
But this time there was no more But this time there was no more steady-state error.steady-state error.
APC is simpler to implement and APC is simpler to implement and requires much less computations requires much less computations than NPC.than NPC.
Pneumatic ServomechanismPneumatic Servomechanism
The poles of the extracted linear The poles of the extracted linear models:models:
Control of Water LevelControl of Water Level
The water input inlet is controlled.The water input inlet is controlled. The water outlet is uncontrolled and The water outlet is uncontrolled and
open. The water output flow and thus open. The water output flow and thus also the system is nonlinear.also the system is nonlinear.
Control of Water LevelControl of Water Level
When linearising such nonlinear When linearising such nonlinear system, one gets different system, one gets different parameters at different operating parameters at different operating points.points.
This time direct inverse control was This time direct inverse control was used instead. Such controllers are used instead. Such controllers are very simple to implement.very simple to implement.
Control of Water LevelControl of Water Level
Conducting the experiment:Conducting the experiment:• One of linear models was used for One of linear models was used for
conducting the experiment in closed-conducting the experiment in closed-loop.loop.
• There should be both small and big There should be both small and big changes in the output.changes in the output.
• A random signal is added to the control A random signal is added to the control inputs to ensure that the model will be inputs to ensure that the model will be able to produce reliable high-frequency able to produce reliable high-frequency outputs of small magnitude.outputs of small magnitude.
Control of Water LevelControl of Water Level
Behavior of the model:Behavior of the model:• ““Bang-bang” type control - maximum or Bang-bang” type control - maximum or
minimum control input is applied until the minimum control input is applied until the desired set-point is achieved.desired set-point is achieved.
• After that the control After that the control input attains its input attains its steady-state.steady-state.