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