On Mon, 10 Dec 2012, Andreas Strecker wrote: > Date: Mon, 10 Dec 2012 21:00:23 +0100 > From: Andreas Strecker <astra...@gmx.de> > Reply-To: EMC developers <emc-developers@lists.sourceforge.net> > To: emc-developers@lists.sourceforge.net > Subject: Re: [Emc-developers] Emc-developers Digest, Vol 80, > Issue 27 : Speed Measurement with digital encoders > > 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
This is how the software encoder counter and at least the Mesa and Pico systems hardware encoders work. Naturally the hardware encoder counters have higher resolution timestamps (the sofware encoder uses the base thread for the edge timestamp) So if you do have a velocity control loop, you should be using encoder.velocity as the feedback input to the PID loop, not d/dt of position Peter Wallace ------------------------------------------------------------------------------ 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 Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers