For my project at WSS2016, I implemented PD control on an inverted double pendulum.
The double pendulum is an intrisicall chaotic system, shown below:
I then produced many data points and taught a neural network how to respond to various forces on the system.
Per my expectation, the neural network performs much more quickly and smoothly for randomized initial conditions than the linearized algorithm that I use for control.
The equations of motion in the simplified system are as follows:
c[t_] := -\[Alpha] x1[t] - \[Beta] x1'[t];
d2x1[t_] := (m2 x2''[t] + m1 g x1[t] + c[t])/m1;
d2x2[t_] := (m2 g x2[t] + c[t]/4)/m2;
d2xc[t_] = c[t];
where
c[t]
is the acceleration of the controller.
This simplification may seem gross, but since the system only works within some reasonable error of the unstable equilibrium (~4%) I used the typical first term expansions of all trigonometric terms and came to these equations.
The neural network I trained on this data is exceedingly simple; this is the initialization code for it:
alconet =
NetChain[{DotPlusLayer[12], DropoutLayer[0.2], DotPlusLayer[8],
DropoutLayer[0.2], DotPlusLayer[4], DropoutLayer[0.2],
DotPlusLayer[2]}, "Input" -> 4]
It consists of only linear transformation layers, and works for the simple PD control system.