Neural Network Toolbox |
Using the NARMA-L2 Controller Block
This section demonstrates how the NARMA-L2 controller is trained.The first step is to copy the NARMA-L2 Controller block from the Neural Network Toolbox blockset to your model window. See your Simulink documentation if you are not sure how to do this. This step is skipped in the following demonstration.
A demo model is provided with the Neural Network Toolbox to demonstrate the NARMA-L2 controller. In this demo, the objective is to control the position of a magnet suspended above an electromagnet, where the magnet is constrained so that it can only move in the vertical direction, as in the following figure.
The equation of motion for this system is
where is the distance of the magnet above the electromagnet, is the current flowing in the electromagnet, is the mass of the magnet, and is the gravitational constant. The parameter is a viscous friction coefficient that is determined by the material in which the magnet moves, and is a field strength constant that is determined by the number of turns of wire on the electromagnet and the strength of the magnet.
To run this demo, follow these steps.
narmamaglev
in the MATLAB command window. This command starts Simulink and creates the following model window. The NARMA-L2 Control block has already been placed in the model.
NARMA-L2 Controller | Model Reference Control |
© 1994-2005 The MathWorks, Inc.