The math behind this is linear control theory (LCT) [0], which is quite interesting. LCT and the Laplace transform techniques at its heart (this is where the "s" terms on the web site come from) are not really that daunting and once you learn them you'll know whether you even need the I and D parts of the PID and what order of each you need.
If we had an analogous "Machine Learning Theory", we'd be able to predict from first principles how many neurons we needed, how many hidden layers we needed, and what architecture (i.e. recursive, convolutional, etc.) we needed to solve a given problem. We don't have that now, but I hope we do some day. The good news is we do have such a theory for control problems (at least the linear ones).