Chris Radek wrote: > On Sun, Oct 17, 2010 at 01:34:12PM -0500, Jon Elson wrote: > >> Hello, >> >> I've been revisiting this velocity estimation thing again, and was >> wondering if anyone >> is actually using the velocity estimate output from an encoder. >> > > I use hm2's encoder velocity as a fake tach for a velocity mode amp, > on my machine which has a bad tach on Y. > OK, well, that's one use, for sure! >> I seem >> to recall there >> was a variant of PID called PID2, but can't find it in the codebase. >> Does anyone >> use this or remember the details? >> > > I don't recall that... > OK, I was pretty sure there was such a component created at one time, might not have even reached the status of a contributed component. I thought the name was pid2, but might have been pid_vel or pidv or something.
Anyway, the idea was that any velocity computed directly from the encoder position, or any damping computed from error - last_error will have a lot of this quantization noise. The higher you raise the D term to PID, the worse it gets. So, one way to fix it is to use some kind of smoothed velocity estimate to help the D term avoid this quantization noise. Looking at the regular PID, it uses error - last_error, so a velocity can't just be plugged straight in there. So, I'm not sure a smooth velocity estimate would actually be helpful, here. But, maybe a D term that added in changes in velocity would cancel out the quantization noise. That's mostly what I'm after, is being able to use a fair amount of the D term without the quantization artifact. So, if you did this : raw_velocity = current_pos - last_pos velocity_error = raw_velocity - clean_velocity error = current_pos - commanded_pos delta_error = error - last_error now, delta_error has the noisy derivative of error, but if you did this : delta_error = error - last_error - velocity_error it ought to remove the quantization noise from the value fed to the D term. I will have to try this! Jon ------------------------------------------------------------------------------ Download new Adobe(R) Flash(R) Builder(TM) 4 The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly Flex(R) Builder(TM)) enable the development of rich applications that run across multiple browsers and platforms. Download your free trials today! http://p.sf.net/sfu/adobe-dev2dev _______________________________________________ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers