Hi Tobias,
In the code you posted, which still doesn't show properly on the forum, you have the IF pid_Out.15 THEN pid_Out = 0 line commented but I'm sure that's not the case in the compiled and tested code?
And, as far as I can see the only thing you have "connected" to the output of the PID filter is the DUTY1 variable, I don't see how that connects to DUTY4 - if that was the purpose.
Finally, you said earlier that you're trying to control the speed of 4 motors based on the speed of anoter motor. The PID filter will only work with ONE motor. You are not going to be able to have one PID filter for each motor with this code. If that is what you need (but I'd get ONE working first) then there is a special version available that allows multiple filters to be run.
I'm sorry I'm not not much of a help here but I still haven't got the whole picture of exactly what you're trying to do. What I'd probably do is try to boil it down to the bare minimum in order to get a grip on how it works.
Also, Darrel pointed out a thing about the DEFINEs that I don't see in your posted code either.
/Henrik.
Bookmarks