untested pid
pid logic tentatively working, need to tune to further test