Amazing. I should have gone to engineering school. Apparently what I have been building with my tilt sensor and E/P transducer is a PID loop or proportional–integral–derivative controller. And to make it worse there are numerous algorithms already defined using variables that have real names like “deadband” and “gain”.
I am working with Enfield Technologies, the experts in proportional control of pneumatics, and I think they have a product that would be more suited for our needs.
0.002 is the noise in G’s that we can expect to hear on the Phidgets board so if the last value is +- 0.002 then ignore it?
Hysteresis is 5%, is that our deadband? 5% of the total range?
Interval is 4ms (250 samples per second) limited by the Phidgets (the Enfield is 2.8ms)
Kp of 1
Ki of 0.02
Kd of 1