You need an RC single pole analog filter. Choose a cutoff frequency a bit above what your required bandwidth is, subject to resistors and capacitors on hand. Shouldn't be very critical.
Trying to digital filter a high-ish frequency pwm signal with a 1khz sampled servo thread is not going to work. Will only give you lots of aliasing, which likely will look as noisy as what you started with. -- Ralph ________________________________________ From: Gene Heskett [ghesk...@shentel.net] Sent: Monday, December 28, 2020 10:28 AM To: emc-users@lists.sourceforge.net Subject: Re: [Emc-users] A clarifying post that might help another victum of poor Chinese docs. CAUTION: This email originated from outside the Walla Walla University email system. On Sunday 27 December 2020 14:35:54 Gene Heskett wrote: > On Sunday 27 December 2020 13:42:57 andy pugh wrote: > > On Sun, 27 Dec 2020 at 18:31, Gene Heskett <ghesk...@shentel.net> > > wrote: > > > pd054=0 which is supposed to be an analog voltage from 0 to 10 > > > volts, representing 0 to 400 hz from the invertor. > > > > > > But the output is actually a 10v p-p pwm corresponding to the duty > > > cycle to get that % of a pwm. > > > > Which would presumably drive a moving-coil meter entirely > > adequately. > > > > It sounds like it just needs an RC filter to turn it from PWM to > > analogue voltage. > > Its a pretty slow wave, would seriously shake the needle of an analog > moving coil meter. Its as if its stuck in some mode from 4 to 7, > which is a rate scaled in the op-freq of the vfd. 1-3 are analog > versions of the a list of output current, bus voltage and output > voltage. And its set for 0. > > The text says: > 0:~10V analog output, corresponding to output frequency. 0~10V > corresponds to 0~Maximum operating frequency. > 1: 0~10V representing output current > 2: 0~10V representing bus voltage 0~1000 volts > 3: 0~10V representing AV output voltage > 4~7: Pulse Output, scaled 1,2,3,6 pulses per op freq /hz, with a 50% > pulse duty. > > One could filter (long sigh) it I suppose, but to get a steady reading > would certainly impact its response time. And that would be no more > informative that just feeding the tach from the command which is what > I am doing now. Both of these also ignore "slip angles" which the vfd > can compensate for. > > But, I have a job for it, and it will run the way it is. I bought a > box to put the BS-1 servo psu and driver into and its not as roomy > inside as advertised so I will need to make new end caps and extension > side walls to make it at least 1/2" taller, maybe even 3/4". Should be > fun, not. Grrrr. > > Cheers, Gene Heskett And now just for S&G I built a chain to filter this very noisy pwm signal from the vfd consisting of: net tach-fltr-raw <= hm2_5i25.0.7i76.0.0.analogin0 => tachfltr(limit3).in net tach-fltr-cln <= tachfltr.out => scale60.in setp tachfltr.enable true setp scale60.scale 60 But nothing I do with setp from 0.0000125 to 10000000 to maxv, maxa, or smoothsteps actually gets me output data that makes sense, even the sign changes at random. So how do I filter this? Thanks folks. Thanks. 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) If we desire respect for the law, we must first make the law respectable. - Louis D. Brandeis Genes Web page <https://nam12.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgeneslinuxbox.net%3A6309%2Fgene&data=04%7C01%7Cralph.stirling%40wallawalla.edu%7Cf4656fdf5f354b03378a08d8ab5e6847%7Cd958f048e43142779c8debfb75e7aa64%7C0%7C0%7C637447769261852754%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=mmqApLF85zFpU19PRs4kr1EBjVW8Zz6p2CbvCqZk990%3D&reserved=0> _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Femc-users&data=04%7C01%7Cralph.stirling%40wallawalla.edu%7Cf4656fdf5f354b03378a08d8ab5e6847%7Cd958f048e43142779c8debfb75e7aa64%7C0%7C0%7C637447769261852754%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=VuYr9oXVR5Xg0UJC0mqaEoZiqloQKnXder5Fjc5RXYw%3D&reserved=0 _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users