this should be self-learning PID loop