Yes, what I meant with set the output to 0 was that if the ouput of the PID filter goes negative you "clamp" the dutycycle at 0 since you can't effectively have a negative drive with that system.
In any case the second aproach should work better. Just a note though, in your first message you wrote:You don't add/subtract the PID filter output from the last output, you add/subtract it from the initial "steady state value". I guess you had that figured out but just in case.Likewise, I'll need to take the output of the PID include that gets passed back to the main process, and add/subtract the new output with the last output based on the direction bit, currently B.15.
Let me know how it goes or if there's anything I can do.
/Henrik.
Bookmarks