On Thursday 17 September 2015 05:11:47 andy pugh wrote: > On 17 September 2015 at 02:32, Gene Heskett <ghesk...@wdtv.com> wrote: > > So what do I set its TOL and SCALE at to achieve this, and better > > yet, how did you go about determining the proper settings to do > > that? > > It's a fairly simple comp, maybe loooking at the source code will > help? > > http://git.linuxcnc.org/gitweb?p=linuxcnc.git;a=blob;f=src/hal/compone >nts/near.comp;h=fd9a62cd787dbd8f5222a52026b0046069c93749;hb=HEAD > > read && as "and" and || as "or"
If in1 is negative, change the sign on both. Thats good... That is some help in that 'scale' is only applied to in1, so 1.0=unity gain and we are comparing items of basically the same values. >if((scale > 1 && in1/scale <= in2 && in2 <= in1*scale) I would read that as 'scale' being used to make it symmetrical, so raising 'scale' is raising the tolerance for a difference as the numbers rise. || fabs(in1-in2) <= difference) So the difference then is an absolute, minimum difference that is still considered good/true, and scale, applied to only in1, should be considered as the bandwidth expander. So, set the difference such that rolling the chuck in neutral, stopped should turn it red fairly easily, trying 5 RPM=0.0833333333333 RPS at zero speed, then set scale so the window expands and might be 100 RPM off & still good at 1000 RPM's. Since geneally we are comparing in RPS in a spindle velocity scene, difference would set the zero speed tolerance that still says True. And scale would then set an expanding good window at higher input levels. Seems like something in the 1.05 to 1.1 area for scale is indicated, depending on how stiffly the PID is setup. Right? Then why can't the manpage say so? Does it make a diff at the end of the day if the inputs are swapped? It stands to reason that in1 s/b the commanded value as sent to the pid.s.command pin, so its scaled right as the numbers rise else the output becomes less predictable when the scaling if any is set by the wandering feedback. So in my theoretical situation, difference s/b setp'd to 5 RPM equ at zero speed. Its gradually filtering thru to my coffee deprived brain IF my analysis(sp?) above is correct. Note the caps, I need to go make a pot of plasma to get me started. Thanks for the link Andy, thats very helpful. I'll have to play with a calculator of course, some of which you see above, but now I have a clue as to what the heck i am doing rather than blindly trying numbers for effect. Cheers, Gene Heskett -- "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author) Genes Web page <http://geneslinuxbox.net:6309/gene> ------------------------------------------------------------------------------ Monitor Your Dynamic Infrastructure at Any Scale With Datadog! Get real-time metrics from all of your servers, apps and tools in one place. SourceForge users - Click here to start your Free Trial of Datadog now! http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140 _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users