Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Converting Brett's PID algorithm to Java
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Deeg  
View profile  
 More options Oct 15 2012, 7:18 pm
From: Deeg <deegchristen...@gmail.com>
Date: Mon, 15 Oct 2012 16:18:43 -0700 (PDT)
Local: Mon, Oct 15 2012 7:18 pm
Subject: Converting Brett's PID algorithm to Java

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.

  diff.png
87K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brett Beauregard  
View profile  
 More options Oct 15 2012, 7:49 pm
From: Brett Beauregard <br3...@gmail.com>
Date: Mon, 15 Oct 2012 19:48:57 -0400
Local: Mon, Oct 15 2012 7:48 pm
Subject: Re: [diy-pid-control] Converting Brett's PID algorithm to Java

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.

--
Brett

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Deeg  
View profile  
 More options Nov 25 2012, 1:22 am
From: Deeg <deegchristen...@gmail.com>
Date: Sat, 24 Nov 2012 22:22:01 -0800 (PST)
Local: Sun, Nov 25 2012 1:22 am
Subject: Re: [diy-pid-control] Converting Brett's PID algorithm to Java

Thanks for you help Brett.  I haven't been able to get back to it until now
but I believe I've got the problem solved.  I've committed the changes to
the repository and it is available for any to use.  If anybody finds an
error I'll fix it as soon as possible.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »