|
From: Peter C. W. <pc...@me...> - 2008-01-19 20:58:38
|
On Sat, 19 Jan 2008, Javid Butler wrote: > Date: Sat, 19 Jan 2008 14:29:37 -0600 > From: Javid Butler <jav...@co...> > Reply-To: "Enhanced Machine Controller (EMC)" > <emc...@li...> > To: "Enhanced Machine Controller (EMC)" <emc...@li...> > Subject: Re: [Emc-users] Analog to PWM or pulse-train ? > > There is a simple way to convert analog to PWM using a comparator, but it > will probably be faster to simply do it in a PIC if you only need one of > them. With the PIC you just set up a PWM output and an analog input and copy > the latter into the former. > > To convert analog to PWM you take a triangle wave into one input of a > comparator and the analog input into the other input. The triangle wave > should be the same amplitude as the analog input. Which signal goes to which > input will determine the polarity of the output. The thing that takes time > in a one-off is generating a temperature stable triangle wave of the right > amplitude. You can also make a simple charge-balance PDM generator with a comparator (with a little hysteresis) followed by an integrator (maybe just an R/C filter) , the integrator output fed back into the '-' comparator input, the '+' comparator input being the analog input. If the comparator output was sampled at say 10 KHz for some period and the times is was sampled high counted, you would have a crude A-D... > > Javid > > ----- Original Message ----- > From: "Anders Wallin" <and...@he...> > To: "Enhanced Machine Controller (EMC)" <emc...@li...> > Sent: Saturday, January 19, 2008 1:22 PM > Subject: [Emc-users] Analog to PWM or pulse-train ? > > >> Hi All, >> >> My VFD has an analog output which can be programmed to indicate either >> output frequency, current, or power etc. >> >> I'd like to read this into EMC so I can monitor and plot the spindle >> load while the machine is running. >> >> I have a M5i20 card which doesn't have analog inputs, so I'm wondering >> if any of you know a nice simple way of converting the 0-10 V into >> either PWM or a pulse-train (FM) or something else that can be read by >> one IO pin (read say every 0.1 ms) on the m5i20 ? >> >> I know a small 8-pin PIC could do this easily but if there are ICs that >> do this out there I'd like to avoid the programming... >> >> >> Anders >> >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by: Microsoft >> Defy all challenges. Microsoft(R) Visual Studio 2008. >> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ >> _______________________________________________ >> Emc-users mailing list >> Emc...@li... >> https://lists.sourceforge.net/lists/listinfo/emc-users >> > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Emc-users mailing list > Emc...@li... > https://lists.sourceforge.net/lists/listinfo/emc-users > Peter Wallace Mesa Electronics (\__/) (='.'=) This is Bunny. Copy and paste bunny into your (")_(") signature to help him gain world domination. |