EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024 
<== Date ==> <== Thread ==>

Subject: EPICS Record
From: Ben Franksen via Tech-talk <tech-talk at aps.anl.gov>
To: EPICS tech-talk <tech-talk at aps.anl.gov>
Date: Sat, 13 Feb 2021 10:50:44 +0100
I have a question regarding the epid record type, which is part of
https://github.com/epics-modules/std.

According to the docs, the formula to calculate the output is

  OVAL = P + I + D
  P = KP * E(n)
  I = KP * KI * SUMi ( E(i) * dT(n) )
  D = KP * KD * ( (E(n) - (E(n-1) ) / dT(n) )

I checked that the code (in the soft device support) really does that. I
am ignoring the extra functionality that limits the output to be between
DRVL and DRVH as this is irrelevant here.

Suppose we have been at the target position for some time, i.e.
VAL=OVAL, so that E(n)=0 for all n. Then all terms become 0 and the
output is OVAL=0 as well. But shouldn't it be OVAL=VAL instead?

Either I am mising something here or this is a bug and line 171 of
stdApp/src/devEpidSoft.c should not be

            oval = p + i + d;

but rather

            oval += p + i + d;

and the formula above start with

  OVAL += P + I + D

Cheers
Ben
-- 
I would rather have questions that cannot be answered, than answers that
cannot be questioned.  -- Richard Feynman


Attachment: signature.asc
Description: OpenPGP digital signature


Replies:
Re: EPID Record Ben Franksen via Tech-talk

Navigate by Date:
Prev: Re: PVXS release 0.1.2 Michael Davidsaver via Tech-talk
Next: Re: EPID Record Ben Franksen via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024 
Navigate by Thread:
Prev: Re: LUA: Segmentation fault on Raspberry for IOC being invoked from shell prompt; no problem via gdb execution. Lang, Keenan C. via Tech-talk
Next: Re: EPID Record Ben Franksen via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024 
ANJ, 13 Feb 2021 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·