C=" Welcome to the VisSim/Neural-Net (TM) working demo of an inverted pendulum.
READ THESE INSTRUCTIONS FIRST!!!
Step 1. The neural-net is ready to learn. Just select GO under SIMULATE, and it will start learning.
WARNING!!!
It will take many hours for the neural net to sufficiently learn to control the inverted pendulum. Our recommendation is that you stop the neural net at some point. Select Stop from the Simulate menu when the Error signal from the neural-net (lower plot) is always below 10E-2.
Change the neural-net learning method or input parameters by clicking the right mouse button on the neural-net block CP-095.NET. The two methods to try are Backpropagation, and Backpropagation with Momentum.
Step 2. Try placing the pole at different initial positions from vertical. The initial deflection can be between +/- .99 radians of vertical. Click the right button on the Cart and Pole, and follow the directions for setting the pole's initial condition. You should train the net on a number of initial conditions (say, 6 total) ranging from -.99 to +.99 radians.
Step 3. To try controlling the inverted pendulum with a neural-net that has already been trained, click right button on the neural-net block and replace CP-095.NET with CP.NET under Weight File. Be sure to turn off \"Learn\" and turn off \"Save at Sim End\".
CP.NET will control the inverted pendulum at any initial deflection between -.99 and +.99 radians."
N.2="gain"(0.0625)@378x175<M>
N.3="export"@96x595
n="noNet.dat"
dc=512
dp=15
di=0.008
N.4="import"@24x588
n="noNet.dat"
di=0.008
N.5="Compound"@132x112#4,1<CR>
n="control system"
Ms=1254,0,0,873,0,0
N.6="gain"(6)@210x42<M>
N.7="gain"(1)@156x147<M>
N.8="wireLabel"@12x28<M>
n="Theta"
N.9="comment"@216x0@210x21<M>
C="Pole balancing control"
N.10="summingJunction"(0)@426x182#4,1<M>
N.11="wireLabel"@12x133<M>
n="Theta dot"
N.12="wireLabel"@12x238<M>
n="x"
N.13="wireLabel"@12x350<M>
n="x dot"
N.14="gain"(0.65)@180x364<M>
N.15="gain"(0.5)@150x252<M>
N.16="wireLabel"@528x182<M>
n="Control output"
N.17="gain"(100)@18x357
N.18="Compound"@96x336#1,4<C>
n="Cart and Pole"
Ms=1254,0,0,873,0,0
N.19="Compound"@522x42#1,1<MC>
n="X"
Ms=333,0,0,252,0,0
N.20="integrator"(0,3)@330x203<M>
N.21="Compound"@444x147#1,1<MC>
n="Xdot"
Ms=303,0,0,252,0,0
N.22="integrator"(0,2)@300x203<M>
N.23="Compound"@198x161#3,2<MCR>
n="Acceleration"
Ms=1254,0,0,873,0,0
N.24="cos"@96x49<M>
N.25="Compound"@120x98#0,1<MC>
n="Gravity"
Ms=1254,0,0,873,0,0
N.26="const"(9.8)@408x203<M>
N.27="sin"@66x112<M>
N.28="*"@198x98<M>
N.29="*"@384x308<M>
N.30="const"(2)@504x322<M>
N.31="*"@558x280#3,1<M>
N.32="summingJunction"(0)@468x287<M>
N.33="Compound"@18x175#0,1<MC>
n="MasspoleLength"
Ms=1254,0,0,873,0,0
N.34="const"(0.05)@492x203<M>
N.35="*"@138x161#4,1<M>
N.36="Compound"@72x385#1,1<MC>
n="External force"
Ms=559,0,0,317,0,0
N.37="Compound"@120x273#0,1<MC>
n="force magnitude"
Ms=422,0,0,216,0,0
N.38="const"(10)@420x182<M>
N.39="-X"@426x273<M>
N.40="merge"@528x189<M>
N.41="summingJunction"(0)@204x329<M>
N.42="const"(1.33333)@306x259<M>
N.43="summingJunction"(0)@402x245<M>
N.44="1/X"@486x252<M>
N.45="*"@348x182#3,1<M>
N.46="const"(0.0909091)@264x210<M>
N.47="summingJunction"(0)@552x91<M>
N.48="const"(0.90909)@222x371<M>
N.49="*"@324x336<M>
N.50="gain"(0.454545)@360x77<M>
N.51="wireLabel"@12x329<M>
n="applied force"
N.52="wireLabel"@12x217<M>
n="theta dot"
N.53="wireLabel"@12x49<M>
n="theta"
N.54="wireLabel"@516x343<M>
n="theta acceleration"
N.55="wireLabel"@534x70<M>
n="x acceleration"
N.56="*"@498x77<M>
N.57="Compound"@234x364#1,1<MC>
n="ThetaDot"
Ms=1254,0,0,873,0,0
N.58="integrator"(0,0)@288x203<M>
N.59="Compound"@480x252#1,1<MC>
n="Theta"
Ms=1254,0,0,873,0,0
N.60="wireLabel"@696x182<M>
n="x dot"
N.61="wireLabel"@696x294<M>
n="theta"
N.62="wireLabel"@654x399<M>
n="theta dot"
N.63="wireLabel"@720x63<M>
n="x"
N.64="wireLabel"@12x189<M>
n="applied force"
N.65="neuralNet"@108x196#5,1<R>
n="cp.net"
UP=4,1,0,1,8,0.3,0.7,0.5,1,1,0,0,0
N.66="plot"@312x210@306x147
pt="Neural-net error in learning mode"
px="Time (sec)"
py="Error"
pax=0
pf=H
pf=F
pb=0.1,0.0001
pbx=15,0
pbY=0,0
pbX=0,0
pc=500
pm=10
pf=Y
pb.0=10,1e-016
pb.1=1,0.01
pL.1="err"
pb.2=0,0
pb.3=0,0
N.67="variable"@162x49<M>
n=":cosTheta"
N.68="variable"@252x189<M>
n=":cosTheta"
N.69="variable"@258x308<M>
n=":cosTheta"
N.70="summingJunction"(0)@330x168<M>
N.71="Compound"@186x196#1,1<CR>
n="bias"
Ms=1248,0,0,852,0,0
N.72="Compound"@12x224#1,1<CR>
n="outBias"
Ms=1248,0,0,852,0,0
N.73="stop"@258x210<M>
N.74="Compound"@282x364#1,0<C>
n="stopCnd"
Ms=1248,0,0,852,0,0
N.75=">"@186x203<M>
N.76="abs"@78x203<M>
N.77="const"(1)@108x259<M>
N.78="merge"@6x147<R>
N.79="button"(1)@12x119
N.80="Compound"@186x238#1,1<CR>
n="bias"
Ms=1248,0,0,852,0,0
N.81="Compound"@186x252#1,1<CR>
n="bias"
Ms=1248,0,0,852,0,0
N.82="Compound"@186x224#1,1<CR>
n="bias"
Ms=1248,0,0,852,0,0
N.83="Compound"@186x210#1,1<CR>
n="bias"
Ms=1248,0,0,852,0,0
N.84="const"(8)@276x196<M>
N.85="wireLabel"@288x140<M>
n="values range from -6 to 6"
N.86="wireLabel"@228x98<M>
n="X input"
N.87="wireLabel"@228x105<M>
n="Values range from -5 to 5"
N.88="wireLabel"@288x119<M>
n="Controller Input"
N.89="summingJunction"(0)@270x161<M>
N.90="gain"(0.08333333)@354x168<M>
N.91="const"(6)@228x196<M>
N.92="wireLabel"@216x126<M>
n="X dot range from -15 to 15"
N.93="wireLabel"@198x119<M>
n="Theta Input ranges from -1 to 1"
N.94="summingJunction"(0)@228x168<M>
N.95="gain"(0.025)@312x175<M>
N.96="const"(20)@180x196<M>
N.97="wireLabel"@156x126<M>
n="Theta dot ranges from -15 to 15"
N.98="gain"(16)@156x182<M>
N.99="summingJunction"(0)@246x196<M>
N.100="const"(8)@174x210<M>
N.101="wireLabel"@186x140<M>
n="Map into the range -6 to 6"
N.102="summingJunction"(0)@252x147<M>
N.103="gain"(0.025)@336x154<M>
N.104="const"(20)@204x182<M>
N.105="summingJunction"(0)@240x168<M>
N.106="gain"(0.15)@324x175<M>
N.107="const"(4)@192x196<M>
N.108="integrator"(-0.85,1)@312x203<M>
N.109="wireLabel"@216x56<M>
n="Cart and Pole"
N.110="wirePositioner"@90x182
N.111="wirePositioner"@258x182
N.112="display"(0.61869404189366)@384x252<M>
N.113="meter"(-1,1)@312x0@306x105
n="pole angle in radians"
N.114="meter"(-1,1)@312x105@306x105
n="Cart displacement from origin"
N.115="comment"@252x91@176x97<M>
C="Click the right mouse button on the 1/S block to set the initial condition of the pole.
Initial conditions must be between -0.99 and 0 .99."
N.116="comment"@432x273@176x56<M>
C="Click the right mouse button on Theta to set the initial condition of the pole."
N.117="wirePositioner"@240x287<M>
N.118="comment"@54x280@176x50
C="Click the right mouse button on Cart and Pole to set the pole to an initial deflection."