I'm speaking from memory but the variable "period" is used in linuxcnc pid.c component, as the time between two calls of the thread.
This period I think I remember was not the value set in ini when creating the servo thread, but some thing close to it, that varies at each invocation of the pid calculations. So probably is related to the actual period that the thread takes to be called, not the intended one. Is this is true, the PID component is actually behaving as you say, accounting for the actual period fluctuations. This would be pretty exact if the servo thread is not interrupted, for example if no base thread is present. If a base thread is present, this period could still be a good approximation of the actual period, that should be exact timings of the measurements used to compute the derivative part (encoder reading times most frequently). I hope this helps, Javier I discover this when trying to implement a special controller with a complicated transfer function, I did try to access the specified value of the servo thread in ini file within the thread with no luck, so I implemented it based on the actual period -as discussed- and it worked well. On Thu, Jul 11, 2013 at 3:50 PM, Eric Keller <[email protected]> wrote: > On Thu, Jul 11, 2013 at 8:07 AM, Michael Haberler <[email protected]> > wrote: > > > now if somebody went around and outlined an RTAPI patch to pass the > actual invocation time to RT threads as discussed in Wichita, we could go > ahead and timebase-correct some of the code which relies on the "assumed > time equals actual time" assumption, like motion and pid comps, then we > likely could put the latency discussion to rest for the the better part > > Most digital control algorithms assume that the sample period is > constant. The ramifications of using actual times instead of nominal > sampling times seem to be fairly significant. I speculate that if you > are going to stick to PID it should be fairly easy to accommodate. > > > ------------------------------------------------------------------------------ > See everything from the browser to the database with AppDynamics > Get end-to-end visibility with application monitoring from AppDynamics > Isolate bottlenecks and diagnose root cause in seconds. > Start your free trial of AppDynamics Pro today! > http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk > _______________________________________________ > Emc-developers mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/emc-developers > ------------------------------------------------------------------------------ See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk _______________________________________________ Emc-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-developers
