Hello The only way i know to get rid of the Problem is to measure the Timepoint when an edge is created. This can be done by a Software Interrupt and if this is too slow one needs a so called Timer Capture Input which stores the timer value when the edge occurs in a Hardware Register. By comparing the last edge before the Controlloop with the last edge from the previous Controlloop one gets the exact speed. v=s/t. s is a discrete natural number, so to get exact measurements the time has to be exactly measured. Hopes this helps. Andreas
----- Original Message ----- From: <[email protected]> To: <[email protected]> Sent: Monday, December 10, 2012 3:49 PM Subject: Emc-developers Digest, Vol 80, Issue 27 > Send Emc-developers mailing list submissions to > [email protected] > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.sourceforge.net/lists/listinfo/emc-developers > or, via email, send a message with subject or body 'help' to > [email protected] > > You can reach the person managing the list at > [email protected] > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Emc-developers digest..." > > > Today's Topics: > > 1. Re: PID tuning, Zeigler-Nichols method (Gene Heskett) > 2. Re: PID tuning, Zeigler-Nichols method (Gene Heskett) > 3. Re: PID tuning, Zeigler-Nichols method (Jon Elson) > 4. Re: PID tuning, Zeigler-Nichols method (andy pugh) > 5. Cmorley: thanks for documenting this (Michael Haberler) > 6. Re: Cmorley: thanks for documenting this (andy pugh) > 7. Re: PID tuning, Zeigler-Nichols method (Kenneth Lerman) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Sun, 9 Dec 2012 21:51:12 -0500 > From: Gene Heskett <[email protected]> > Subject: Re: [Emc-developers] PID tuning, Zeigler-Nichols method > To: [email protected] > Message-ID: <[email protected]> > Content-Type: Text/Plain; charset="windows-1256" > > On Sunday 09 December 2012 21:36:51 Jon Elson did opine: > >> Gene Heskett wrote: >> > Should I be able to induce a rail to rail oscillation with Pgain? >> >> You probably can, but in an actual machine, it would be a VERY bad thing >> to do! Fine for a simulation exercise, but it is likely to cause >> damage, perhaps permanent damage to mechanical parts. >> > > Chuckle. ;-) I still recall a comment Stuart S. made re the z axis on his > cinci oscillating, saying they recorded an earthquake over at the UNI. :) > > This "two gerbils in a wheel" (250 watt motor) powered machine may be an > exception. This is not a reversible servo, it can only speed up or slow > down, and the slowdown isn't terribly active, just a coast down to the new > lower speed. The worst it can do is hit the accelerator long enough, and > hard enough, to blow the 3 amp fuse in the controller. To that end, I > have > a lowpass in the command circuit that ramps the speed both ways, slow > enough so as not to blow the fuse _if_ the spindle can turn freely. A > much > faster lowpass watches the error and tries to shut things down before the > fuse clears. Feedback, from the encoder.0.velocity is direct to > pid.0.feedback, no filtering at all there. > >> Jon >> >> ------------------------------------------------------------------------ >> ------ LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free >> Trial Remotely access PCs and mobile devices and provide instant >> support Improve your efficiency, and focus on delivering more value-add >> services Discover what IT Professionals Know. Rescue delivers >> http://p.sf.net/sfu/logmein_12329d2d >> _______________________________________________ >> Emc-developers mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/emc-developers > > > Cheers, Gene > -- > "There are four boxes to be used in defense of liberty: > soap, ballot, jury, and ammo. Please use in that order." > -Ed Howdershelt (Author) > My web page: <http://coyoteden.dyndns-free.com:85/gene> is up! > BOFH excuse #251: > > Processes running slowly due to weak power supply > I was taught to respect my elders, but its getting > harder and harder to find any... > > > > ------------------------------ > > Message: 2 > Date: Sun, 9 Dec 2012 22:05:20 -0500 > From: Gene Heskett <[email protected]> > Subject: Re: [Emc-developers] PID tuning, Zeigler-Nichols method > To: [email protected] > Message-ID: <[email protected]> > Content-Type: Text/Plain; charset="windows-1256" > > On Sunday 09 December 2012 21:53:04 andy pugh did opine: > >> On 10 December 2012 01:26, Gene Heskett <[email protected]> wrote: >> >> Not in your case, as encoder velocity is the controlled quantity, not >> >> the derivative thereof. >> >> >> >> encoder.velocity is only an appropriate feedback-deriv term in a >> >> position loop. >> > >> > But this is not a position loop per sei, its a velocity loop, working >> > in the rps domain. Does that not change things, and if not, why? >> >> Yes, it changes things a lot. It means that you should _not_ connect >> the encoder velocity to the feedback-deriv pin, as in this case the >> encoder velocity is most definitely not the derivative of the >> controlled quantity. > > It is supposed to be a linear representation of the instant rps. Unforch > the halscope is too fast to verify the speed linearity at sub 1 rps > speeds. > I did set the -deriv level down from its default 1.0, to .25, but could > not > see any effect at what I guessed was roughly .5 rps. At creep speeds the > error hovers around -0.5, and generally stays there up to about 5 rps, at > which point its like a load drops off the motor as the error changes > polarity to about a +_0.6 or .7 all in about .1 rps and stays there till > about 9 rps, then goes back negative all the way to 21 rps. So that is > another effect I hope to stumble over. > >> Now, if you had a pin which (by some magic) measured spindle >> acceleration, then that would be the thing to connect to the >> feedback-deriv pin. >> However, no such pin exists short of fitting an accelerometer to the >> spindle, and nothing you can do in HAL is likely to do a better job >> than the internal differentiator in PID. > > Ok, that's plenty clear enough, so I'll disconnect that 'wire'. > > Thanks Andy. > > Cheers, Gene > -- > "There are four boxes to be used in defense of liberty: > soap, ballot, jury, and ammo. Please use in that order." > -Ed Howdershelt (Author) > My web page: <http://coyoteden.dyndns-free.com:85/gene> is up! > Dealing with failure is easy: > Work hard to improve. > Success is also easy to handle: > You've solved the wrong problem. > Work hard to improve. > I was taught to respect my elders, but its getting > harder and harder to find any... > > > > ------------------------------ > > Message: 3 > Date: Sun, 09 Dec 2012 22:10:51 -0600 > From: Jon Elson <[email protected]> > Subject: Re: [Emc-developers] PID tuning, Zeigler-Nichols method > To: [email protected], EMC developers > <[email protected]> > Message-ID: <[email protected]> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > dave wrote: >> Tuning linuxcnc come up time and again. As far as I can tell it is still >> an art. I keep hoping someone with the requisite brights will write a >> usable diagnostic that gives us a bode plot and then tell us what to do >> with it. I certainly can't do it. Zu hilfe! Zu hilfe! Zu hilfe! >> > Yes, that would be VERY nice. But, I'm not sure how good a job we can > do with > LinuxCNC and typical motion interfaces. Typically, you only get samples > at 1 KHz, > and the encoder resolution adds a lot of noise to the amplitude and > phase signals. > Still, a Bode plot would be really useful. What is needed is to sum the > hal > signal generator into the position command, and to grab a sample of the > halscope > data and run a code on that to extract the magnitude and phase of the > fundamental > response. This is a moving target, so I think actually what you want is > the > mag. and phase of the error vs. the stimulus. That shouldn't be all > that hard to > code. > > But, then, you need to combine this with the current PID settings and > decide > what to change. First, I'm not real clear on what to do with a Bode plot > in connection with ALL the parameters we have available. Well, OK, first, > FFx are out, as they are not part of the control loop. That simplifies > things, > but we still have P, I and D. I've never had much luck with I, I still > think it contaminates the near-present time with really old error > measurements. > So, maybe that just leaves P and I, and maybe I could figure out what to > do with them based on a Bode plot. First, you want to search for > mechanical resonances and any big lags (phase shifts) in the servo > amps and motors. If there is a big mechanical resonance at, say, 40 Hz., > then you have a problem with a 1 KHz servo rate which gives a > Nyquist bandwidth of 500 Hz. If you want to keep the 1 KHz rate, > you will have to cut down the gain a lot by 40 Hz so as to avoid > having gain at or above 40 Hz, where the resonance causes a large > phase shift. > > So, while a Bode plot would be a great thing to be able to generate, and > I'd love to play with such a plot on my machines, I'm not completely > sure what a Bode-inspired tuning protocol might look like. > > I have a $13K box (Schlumberger dynamic signal analyzer) that is > supposed to acquire the data for Bode plots. I tried to use it on my > home-made analog servo amplifiers. I cut the servo loop and > added a 100 Ohm resistor, and connected the drive/sense > terminals across that. It excited the system with a sine wave, and at > the lowest frequencies, I could see the table rock a small amount. > But, the data I got made no sense at all, and may not have been > repeatable, either. The unit may have some problems, so that > may explain the useless data. (I rescued this unit from the local > scrapyard and fixed the display, but haven't gone through it > for any other problems.) > > Generating Bode plots from arbitrary machines would be good. > The Schlumberger analyzer is analog in/out only, being able > to inject a perturbation digitally into the PID and observe the > output from the encoder would make it possible to test > many more types of motion systems. > > Jon > > > > ------------------------------ > > Message: 4 > Date: Mon, 10 Dec 2012 10:10:53 +0000 > From: andy pugh <[email protected]> > Subject: Re: [Emc-developers] PID tuning, Zeigler-Nichols method > To: EMC developers <[email protected]> > Message-ID: > <CAN1+YZUKNzgErsFr0mK_2gHrQ9NjN=pT=yu3dduxy77bt_e...@mail.gmail.com> > Content-Type: text/plain; charset=ISO-8859-1 > > On 10 December 2012 04:10, Jon Elson <[email protected]> wrote: > >> I have a $13K box (Schlumberger dynamic signal analyzer) that is >> supposed to acquire the data for Bode plots. I tried to use it on my >> home-made analog servo amplifiers. I cut the servo loop and >> added a 100 Ohm resistor, and connected the drive/sense >> terminals across that. It excited the system with a sine wave, and at >> the lowest frequencies, I could see the table rock a small amount. >> But, the data I got made no sense at all, and may not have been >> repeatable, either. > > Is a sine-wave the correct input signal? > When I spent my working day creating frequency response curves we > typically used white-noise excitation. > > -- > atp > If you can't fix it, you don't own it. > http://www.ifixit.com/Manifesto > > > > ------------------------------ > > Message: 5 > Date: Mon, 10 Dec 2012 13:29:00 +0100 > From: Michael Haberler <[email protected]> > Subject: [Emc-developers] Cmorley: thanks for documenting this > To: EMC developers <[email protected]> > Message-ID: <[email protected]> > Content-Type: text/plain; charset=us-ascii > > I would like to encourage a public thanks to Chris Morley for doing this: > > http://www.linuxcnc.org/docs/2.5/html/common/python-interface.html > > it takes another round of guessing and needless guru factor out of > programming LinuxCNC > > Let me add a word to authors of such core code: > > a) great that you wrote it, and in such a clever way - thanks for that > b) without properly documenting it, it is merely yet another arcanum in > the overfull cellar of undocumented bodies of LinuxCNC > > without that, all it might do is prove the authors cleverness; it also > proves how much the author gives about same code being usable by someone > else - not very much, that is. The fact that one can read the source is > not a valid excuse. > > - Michael > > > > > > > > > ------------------------------ > > Message: 6 > Date: Mon, 10 Dec 2012 12:55:59 +0000 > From: andy pugh <[email protected]> > Subject: Re: [Emc-developers] Cmorley: thanks for documenting this > To: EMC developers <[email protected]> > Message-ID: > <CAN1+YZUmKr5MPQQFuDpTO9ExY8qEB-siVgPVjBN=vt1o9kq...@mail.gmail.com> > Content-Type: text/plain; charset=ISO-8859-1 > > On 10 December 2012 12:29, Michael Haberler <[email protected]> wrote: > >> http://www.linuxcnc.org/docs/2.5/html/common/python-interface.html > > That does look potentially rather interesting, and I guess is the > obvious interface for any GUI. > > One question I have is what part of LinuxCNC exports the stuff? if one > loads the motion module, but no interpreter, what happens? > > > -- > atp > If you can't fix it, you don't own it. > http://www.ifixit.com/Manifesto > > > > ------------------------------ > > Message: 7 > Date: Mon, 10 Dec 2012 09:49:28 -0500 > From: Kenneth Lerman <[email protected]> > Subject: Re: [Emc-developers] PID tuning, Zeigler-Nichols method > To: EMC developers <[email protected]> > Message-ID: <[email protected]> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On 12/10/2012 5:10 AM, andy pugh wrote: >> On 10 December 2012 04:10, Jon Elson <[email protected]> wrote: >> >>> I have a $13K box (Schlumberger dynamic signal analyzer) that is >>> supposed to acquire the data for Bode plots. I tried to use it on my >>> home-made analog servo amplifiers. I cut the servo loop and >>> added a 100 Ohm resistor, and connected the drive/sense >>> terminals across that. It excited the system with a sine wave, and at >>> the lowest frequencies, I could see the table rock a small amount. >>> But, the data I got made no sense at all, and may not have been >>> repeatable, either. >> Is a sine-wave the correct input signal? >> When I spent my working day creating frequency response curves we >> typically used white-noise excitation. >> > I assume that Jon is saying that it excited the system with a swept sine > wave. We used to use that to measure the system response of aircraft > wings when I worked at Grumman. Response to an impulse (step) and to > white noise (well, actually pink noise) are other ways of measuring > system response. > > One problem I've always had with the PID controller is that the classic > controller views the problem as one of controlling a system so as to > maintain a setpoint in the presence of variations in the system being > controlled. So, in our context, it might control a spindle speed in the > presence of variations of load. > > Our problem is generally different, though. We are changing the > *setpoint* and trying to get the system response to match the setpoint. > > Regarding comments Jon has made about 'I', some systems I've worked on > had something called "wind up limiting". The idea was to limit the > amount of integral that could be added to the system. > > Regards, > > Ken > > > > ------------------------------ > > ------------------------------------------------------------------------------ > LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial > Remotely access PCs and mobile devices and provide instant support > Improve your efficiency, and focus on delivering more value-add services > Discover what IT Professionals Know. Rescue delivers > http://p.sf.net/sfu/logmein_12329d2d > > ------------------------------ > > _______________________________________________ > Emc-developers mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/emc-developers > > > End of Emc-developers Digest, Vol 80, Issue 27 > ********************************************** ------------------------------------------------------------------------------ LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d _______________________________________________ Emc-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-developers
