Programme control of a ball valve with PID regulation