On Monday, October 15, 2012 7:49:19 PM UTC-4, brett beauregard wrote:
> you've got a double "+=" going on there. you want to keep the one on line
> 66, and change the one on line 64 to just an "="
> it looks like you went a little crazy on the derivative! not sure why you
> introduced dErr into the mix. you should be fine with "dInput =
> (input-lastInput) / timechange;"
> also, remember to remove the sampletime adjustments from the tuning
> parameters. this is both in SetTunings and in SetSampleTime.
> On Mon, Oct 15, 2012 at 7:18 PM, Deeg <deegchr...@gmail.com <javascript:>>wrote:
>> Hello all, I've been working on converting Brett's algorithm to Java
>> (with his permission). I've got the completed algorithm up on
>> SourceForge at https://sourceforge.net/p/javapid/code . Feel free to
>> use it for your own projects. I've got two requests where you all can help
>> me:
>> 1) Help test it. I don't know a good way to test it except to try it and
>> my Java project isn't to the point I can do this. If anybody knows a good
>> programmatic way to test it (perhaps against a known set of inputs) I might
>> be able to implement it.
>> 2) Help modify the algorithm. I've got Brett's original algorithm in
>> PidAlgorithm.java. For my project I need to remove the static sample time
>> code so the algorithm can handle different periods. I've created a class
>> name PidWithVariableTime.java with the changes but it doesn't create the
>> same output as PidAlgorithm. Can someone eyeball the changes and see what
>> I'm doing wrong? Attached is a picture showing the diff of the compute()
>> method.
> --
> Brett