<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Jon and Charles: If you have EE degrees and I forgot, my
      apologies! But Kevin is one of the guys on this list who could
      write at least parts of "The Art of Electronics" while many of us,
      like me, can only read, hoping some day to master the equations
      hiding under the practical/intuitive presentation of that book. I
      spent a summer a few years back getting my math back to where i
      was when I graduated from high school. I still haven't gotten my
      act together to get the math to where it was when I bombed out of
      Auburn. The inconvenient detail of math exams is that  they're
      frequently like programming settings: "close" is a fail. :-)<br>
    </p>
    Regards,<br>
    Pete<br>
    <div class="moz-cite-prefix">On 6/30/20 7:35 AM, Pete Soper wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:on3so6uket2uc1rnsrubs4md.1593516959183@email.android.com">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      I was hoping an EE would join in. :-)
      <div dir="auto"><br>
        <div dir="auto">Your point is excellent. By the time you have
          the usable bits on the ADC side you've either got PWM
          frequencies that don't happen to be available w many hobby
          MPUs or enough complexity that only in an industrial setting
          can you say you're saving X pennies by avoiding a DAC chip.
          But the extra headache is that most (all?) DAC chips require
          at least two pins for control. Anybody know of an exception?</div>
        <div dir="auto">Pete</div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">I was hoping an EE would join in. :-)Your point is excellent. By the time you have the usable bits on the ADC side you've either got PWM frequencies that don't happen to be available w many hobby MPUs or enough complexity that only in an industrial setting can you say you're saving X pennies by avoiding a DAC chip. But the extra headache is that most (all?) DAC chips require at least two pins for control. Anybody know of an exception?Pete</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <div style="font-size:100%;color:#000000" dir="auto"><!-- originalMessage -->
        <div>-------- Original message --------</div>
        <div>From: Kevin Schilf via TriEmbed
          <a class="moz-txt-link-rfc2396E" href="mailto:triembed@triembed.org"><triembed@triembed.org></a> </div>
        <div>Date: 6/30/20 3:14 AM (GMT-05:00) </div>
        <div>To: Jon Wolfe <a class="moz-txt-link-rfc2396E" href="mailto:jonjwolfe@anibit.com"><jonjwolfe@anibit.com></a>, Charles A
          <a class="moz-txt-link-rfc2396E" href="mailto:chanoia33@gmail.com"><chanoia33@gmail.com></a> </div>
        <div>Cc: <a class="moz-txt-link-abbreviated" href="mailto:triembed@triembed.org">triembed@triembed.org</a> </div>
        <div>Subject: Re: [TriEmbed] PWM to Analog 0 to 5 VDC? </div>
        <div><br>
        </div>
      </div>
      <div class="ydp81202e6eyahoo-style-wrap"
        style="font-family:Helvetica Neue, Helvetica, Arial,
        sans-serif;font-size:16px;">
        <div dir="ltr" data-setdir="false">Hi Chuck,</div>
        <div dir="ltr" data-setdir="false"><br>
        </div>
        <div dir="ltr" data-setdir="false">A few thoughts sight unseen. 
          :-)<br>
        </div>
        <div dir="ltr" data-setdir="false"><br>
        </div>
        <div dir="ltr" data-setdir="false">Increasing switching speed
          pushes the switching artifacts out to the right on a frequency
          plot giving you greater frequency "space" between the DC value
          you want and the switching noise you don't.  This gives you
          flexibility on the pole frequency/ses and room for the low
          pass filter to roll off without having to use a higher-order
          filter to shorten the tail.  Basically, you want the highest
          pole frequency with sufficient roll off using the simplest
          acceptable filter topology (single pole RC (simplest), double
          pole LRC, active filter).  You can use a Spice simulator
          (LTSpice, etc.) to do trade-offs.</div>
        <div dir="ltr" data-setdir="false"><br>
        </div>
        <div dir="ltr" data-setdir="false">Faster switching implies more
          power.  No free lunch.<br>
        </div>
        <div dir="ltr" data-setdir="false"><br>
        </div>
        <div dir="ltr" data-setdir="false">Playing devil's advocate, if
          you control the head end another option is a simple D2A
          converter instead of PWM?  Many micros now provide D2A's.  You
          may also be able to digitally filter the A2D readings in the
          receiver.<br>
        </div>
        <div dir="ltr" data-setdir="false"><br>
        </div>
        <div dir="ltr" data-setdir="false">Good luck,</div>
        <div dir="ltr" data-setdir="false">Kevin Schilf<br>
        </div>
        <br>
        <div dir="ltr" data-setdir="false"><br>
        </div>
        <div><br>
        </div>
      </div>
      <div id="ydpc2377ac1yahoo_quoted_4229205768"
        class="ydpc2377ac1yahoo_quoted">
        <div style="font-family:'Helvetica Neue', Helvetica, Arial,
          sans-serif;font-size:13px;color:#26282a;">
          <div> On Tuesday, June 30, 2020, 12:08:32 AM EDT, Charles A
            via TriEmbed <a class="moz-txt-link-rfc2396E" href="mailto:triembed@triembed.org"><triembed@triembed.org></a> wrote: </div>
          <div><br>
          </div>
          <div><br>
          </div>
          <div>
            <div id="ydpc2377ac1yiv5987644365">
              <div>
                <div dir="ltr"> Well I have the low pass RLC filter into
                  the OpAmp.  I get less ripple at the higher PWM
                  frequencies however at those frequencies I have much
                  less granularity on the duty cycle.  Trying to deal
                  with the ripple.  Guess I should look at different RLC
                  filter values next.    <br clear="none">
                  <div><br clear="none">
                  </div>
                  <div>The ADC input is on another board and I have no
                    control over it.  I need to supply a stable DC
                    voltage to it. The current device (obsolete now)
                    only deviates by 10 mV or less according to its raw
                    ADC reads.  I need to match that or the SW reading
                    the ADC is not satisfied.  My low pass filter
                    attempt so far deviates at best by 50 mV.  <br
                      clear="none">
                  </div>
                </div>
                <br clear="none">
                <div class="ydpc2377ac1yiv5987644365yqt2847000422"
                  id="ydpc2377ac1yiv5987644365yqt78964">
                  <div class="ydpc2377ac1yiv5987644365gmail_quote">
                    <div class="ydpc2377ac1yiv5987644365gmail_attr"
                      dir="ltr">On Mon, Jun 29, 2020 at 11:57 PM Jon
                      Wolfe <<a shape="rect"
                        href="mailto:jonjwolfe@anibit.com"
                        rel="nofollow" target="_blank"
                        moz-do-not-send="true">jonjwolfe@anibit.com</a>>
                      wrote:<br clear="none">
                    </div>
                    <blockquote
                      class="ydpc2377ac1yiv5987644365gmail_quote"
                      style="margin:0px 0px 0px 0.8ex;border-left:1px
                      solid rgb(204,204,204);padding-left:1ex;">
                      <div>
                        <div>
                          <div>Yeah an rc low pass filter is the way to
                            go.  I've done it that way many times. The
                            unity gain op amp could give you a buffer on
                            the filter output, but I think ADCs are
                            usually high impedance inputs. Depending on
                            how fast you need the signal to change could
                            impact what op amp you would need to use.
                            You could play around in LT spice with
                            different frequencies and component values
                            to find something that works.  Pete would
                            know better than me, but I think the
                            downside to higher frequency might be higher
                            power draw, since more of the signal is
                            going through the cap in the filter.</div>
                          <div><br clear="none">
                          </div>
                          <div
                            id="ydpc2377ac1yiv5987644365gmail-m_6516571825788142142aqm-original"
                            style="color:black;">
                            <div>
                              <div style="color:black;">
                                <p
                                  style="color:black;font-size:10pt;font-family:sans-serif;margin:8pt
                                  0px;">On June 29, 2020 10:32:55 PM
                                  Pete Soper via TriEmbed <<a
                                    shape="rect"
                                    href="mailto:triembed@triembed.org"
                                    rel="nofollow" target="_blank"
                                    moz-do-not-send="true">triembed@triembed.org</a>>
                                  wrote:</p>
                                <blockquote
                                  class="ydpc2377ac1yiv5987644365gmail_quote"
                                  type="cite" style="margin:0px 0px 0px
                                  0.75ex;border-left:1px solid
                                  rgb(128,128,128);padding-left:0.75ex;">
                                  The classic way to do this is with a
                                  low pass filter. If you google "PWM
                                  DAC" you'll find what you need. But
                                  the performance is going to be a
                                  function of the PWM frequency and how
                                  precisely you can change the duty
                                  cycle.
                                  <div>Pete</div>
                                  <div><br clear="none">
                                  </div>
                                  <div
                                    style="font-size:100%;color:rgb(0,0,0);">
                                    <div>-------- Original message
                                      --------</div>
                                    <div>From: Charles A via TriEmbed
                                      <<a shape="rect"
                                        href="mailto:triembed@triembed.org"
                                        rel="nofollow" target="_blank"
                                        moz-do-not-send="true">triembed@triembed.org</a>>
                                    </div>
                                    <div>Date: 6/29/20 10:23 PM
                                      (GMT-05:00) </div>
                                    <div>To: <a shape="rect"
                                        href="mailto:triembed@triembed.org"
                                        rel="nofollow" target="_blank"
                                        moz-do-not-send="true">triembed@triembed.org</a>
                                    </div>
                                    <div>Subject: [TriEmbed] PWM to
                                      Analog 0 to 5 VDC? </div>
                                    <div><br clear="none">
                                    </div>
                                  </div>
                                  <div dir="ltr">Anyone have a favorite
                                    circuit or chip to convert a PWM
                                    signal to a 0 to 5 VDC signal?  The
                                    resulting voltage needs to be very
                                    stable.  It feeds an ADC input. 
                                    I've looked at an RL circuit into an
                                    OpAmp that also has a cap to ground
                                    at the OpAmp input.  The DVM says
                                    it's stable but the ADC reading the
                                    voltage says it's not. I'm measuring
                                    100 mV deviations.  Would like to
                                    get to a 10 mV deviation. I've tried
                                    changing cap values on the input as
                                    well as adding caps on the output
                                    side of the OpAmp.  Made
                                    improvements but still not good
                                    enough.  So looking for suggestions
                                    please.
                                    <div><br clear="none">
                                    </div>
                                    <div>Thanks,</div>
                                    <div>Chuck</div>
                                  </div>
                                  <div>_______________________________________________</div>
                                  <div>Triangle, NC Embedded Computing
                                    mailing list</div>
                                  <div><br clear="none">
                                  </div>
                                  <div>To post message: <a shape="rect"
href="mailto:TriEmbed%40triembed.org" rel="nofollow" target="_blank"
                                      moz-do-not-send="true">TriEmbed@triembed.org</a></div>
                                  <div>List info: <a shape="rect"
                                      href="http://mail.triembed.org/mailman/listinfo/triembed_triembed.org"
                                      rel="nofollow" target="_blank"
                                      moz-do-not-send="true">http://mail.triembed.org/mailman/listinfo/triembed_triembed.org</a></div>
                                  <div>TriEmbed web site: <a
                                      shape="rect"
                                      href="http://TriEmbed.org"
                                      rel="nofollow" target="_blank"
                                      moz-do-not-send="true">http://TriEmbed.org</a></div>
                                  <div>To unsubscribe, click link and
                                    send a blank message: mailto:<a
                                      shape="rect"
                                      href="mailto:unsubscribe-TriEmbed%40bitser.net"
                                      rel="nofollow" target="_blank"
                                      moz-do-not-send="true">unsubscribe-TriEmbed@bitser.net</a>?subject=unsubscribe</div>
                                  <div><br clear="none">
                                  </div>
                                  <div><br clear="none">
                                  </div>
                                </blockquote>
                              </div>
                            </div>
                          </div>
                          <div><br clear="none">
                          </div>
                        </div>
                      </div>
                    </blockquote>
                  </div>
                </div>
              </div>
            </div>
            <div class="ydpc2377ac1yqt2847000422"
              id="ydpc2377ac1yqt74312">_______________________________________________<br
                clear="none">
              Triangle, NC Embedded Computing mailing list<br
                clear="none">
              <br clear="none">
              To post message: <a shape="rect"
                href="mailto:TriEmbed@triembed.org" rel="nofollow"
                target="_blank" moz-do-not-send="true">TriEmbed@triembed.org</a><br
                clear="none">
              List info: <a shape="rect"
                href="http://mail.triembed.org/mailman/listinfo/triembed_triembed.org"
                rel="nofollow" target="_blank" moz-do-not-send="true">http://mail.triembed.org/mailman/listinfo/triembed_triembed.org</a><br
                clear="none">
              TriEmbed web site: <a shape="rect"
                href="http://TriEmbed.org" rel="nofollow"
                target="_blank" moz-do-not-send="true">http://TriEmbed.org</a><br
                clear="none">
              To unsubscribe, click link and send a blank message:
              mailto:<a shape="rect"
                href="mailto:unsubscribe-TriEmbed@bitser.net"
                rel="nofollow" target="_blank" moz-do-not-send="true">unsubscribe-TriEmbed@bitser.net</a>?subject=unsubscribe<br
                clear="none">
              <br clear="none">
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">-------- Original message --------From: Kevin Schilf via TriEmbed <a class="moz-txt-link-rfc2396E" href="mailto:triembed@triembed.org"><triembed@triembed.org></a> Date: 6/30/20  3:14 AM  (GMT-05:00) To: Jon Wolfe <a class="moz-txt-link-rfc2396E" href="mailto:jonjwolfe@anibit.com"><jonjwolfe@anibit.com></a>, Charles A <a class="moz-txt-link-rfc2396E" href="mailto:chanoia33@gmail.com"><chanoia33@gmail.com></a> Cc: <a class="moz-txt-link-abbreviated" href="mailto:triembed@triembed.org">triembed@triembed.org</a> Subject: Re: [TriEmbed] PWM to Analog 0 to 5 VDC? 
        Hi Chuck,A few thoughts sight unseen.  :-)Increasing switching speed pushes the switching artifacts out to the right on a frequency plot giving you greater frequency "space" between the DC value you want and the switching noise you don't.  This gives you flexibility on the pole frequency/ses and room for the low pass filter to roll off without having to use a higher-order filter to shorten the tail.  Basically, you want the highest pole frequency with sufficient roll off using the simplest acceptable filter topology (single pole RC (simplest), double pole LRC, active filter).  You can use a Spice simulator (LTSpice, etc.) to do trade-offs.Faster switching implies more power.  No free lunch.Playing devil's advocate, if you control the head end another option is a simple D2A converter instead of PWM?  Many micros now provide D2A's.  You may also be able to digitally filter the A2D readings in the receiver.Good luck,Kevin Schilf
        
        
            
                
                
                    On Tuesday, June 30, 2020, 12:08:32 AM EDT, Charles A via TriEmbed <a class="moz-txt-link-rfc2396E" href="mailto:triembed@triembed.org"><triembed@triembed.org></a> wrote:
                
                
                
                 Well I have the low pass RLC filter into the OpAmp.  I get less ripple at the higher PWM frequencies however at those frequencies I have much less granularity on the duty cycle.  Trying to deal with the ripple.  Guess I should look at different RLC filter values next.    The ADC input is on another board and I have no control over it.  I need to supply a stable DC voltage to it. The current device (obsolete now) only deviates by 10 mV or less according to its raw ADC reads.  I need to match that or the SW reading the ADC is not satisfied.  My low pass filter attempt so far deviates at best by 50 mV.  On Mon, Jun 29, 2020 at 11:57 PM Jon Wolfe <a class="moz-txt-link-rfc2396E" href="mailto:jonjwolfe@anibit.com"><jonjwolfe@anibit.com></a> wrote:



Yeah an rc low pass filter is the way to go.  I've done it that way many times. The unity gain op amp could give you a buffer on the filter output, but I think ADCs are usually high impedance inputs. Depending on how fast you need the signal to change could impact what op amp you would need to use. You could play around in LT spice with different frequencies and component values to find something that works.  Pete would know better than me, but I think the downside to higher frequency might be higher power draw, since more of the signal is going through the cap in the filter.



On June 29, 2020 10:32:55 PM Pete Soper via TriEmbed <a class="moz-txt-link-rfc2396E" href="mailto:triembed@triembed.org"><triembed@triembed.org></a> wrote:

The classic way to do this is with a low pass filter. If you google "PWM DAC" you'll find what you need. But the performance is going to be a function of the PWM frequency and how precisely you can change the duty cycle.Pete-------- Original message --------From: Charles A via TriEmbed <a class="moz-txt-link-rfc2396E" href="mailto:triembed@triembed.org"><triembed@triembed.org></a> Date: 6/29/20  10:23 PM  (GMT-05:00) To: <a class="moz-txt-link-abbreviated" href="mailto:triembed@triembed.org">triembed@triembed.org</a> Subject: [TriEmbed] PWM to Analog 0 to 5 VDC? Anyone have a favorite circuit or chip to convert a PWM signal to a 0 to 5 VDC signal?  The resulting voltage needs to be very stable.  It feeds an ADC input.  I've looked at an RL circuit into an OpAmp that also has a cap to ground at the OpAmp input.  The DVM says it's stable but the ADC reading the voltage says it's not. I'm measuring 100 mV deviations.  Would like to get to a 10 mV deviation. I've tried changing cap values on the input as well as adding caps on the output side of the OpAmp.  Made improvements but still not good enough.  So looking for suggestions please.Thanks,Chuck

_______________________________________________
Triangle, NC Embedded Computing mailing list

To post message: <a class="moz-txt-link-abbreviated" href="mailto:TriEmbed@triembed.org">TriEmbed@triembed.org</a>
List info: <a class="moz-txt-link-freetext" href="http://mail.triembed.org/mailman/listinfo/triembed_triembed.org">http://mail.triembed.org/mailman/listinfo/triembed_triembed.org</a>
TriEmbed web site: <a class="moz-txt-link-freetext" href="http://TriEmbed.org">http://TriEmbed.org</a>
To unsubscribe, click link and send a blank message: <a class="moz-txt-link-freetext" href="mailto:unsubscribe-TriEmbed@bitser.net?subject=unsubscribe">mailto:unsubscribe-TriEmbed@bitser.net?subject=unsubscribe</a>









_______________________________________________Triangle, NC Embedded Computing mailing listTo post message: <a class="moz-txt-link-abbreviated" href="mailto:TriEmbed@triembed.orgList">TriEmbed@triembed.orgList</a> info: <a class="moz-txt-link-freetext" href="http://mail.triembed.org/mailman/listinfo/triembed_triembed.orgTriEmbed">http://mail.triembed.org/mailman/listinfo/triembed_triembed.orgTriEmbed</a> web site: <a class="moz-txt-link-freetext" href="http://TriEmbed.orgTo">http://TriEmbed.orgTo</a> unsubscribe, click link and send a blank message: <a class="moz-txt-link-freetext" href="mailto:unsubscribe-TriEmbed@bitser.net?subject=unsubscribe">mailto:unsubscribe-TriEmbed@bitser.net?subject=unsubscribe</a>
            
        </pre>
    </blockquote>
  </body>
</html>