Thank you so much Henrik, now I got it!
I'll test it as soon as I can. Then i'll bother you again

I have another question in a new thread, not related to PID, but related to counting position. Thread title: "Pulse count matching"