<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Thanks both, that's exactly what I needed to know.<div><br></div><div>To answer Roman's question; A typical two op-amp schmitt trigger/integrator square/triangle stompbox LFO produces a waveform of about this range around the centre level too, so it helps for this to do the same. While I could get a rail-to-rail op-amp to produce a clean output at 0-5V, that wouldn't actually be that useful in most stomp box circuits, and you'd probably finish up level shifting it anyway.<br><div><br></div><div>Tom</div><div><br><div><div>On 27 Apr 2017, at 21:06, Richie Burnett <<a href="mailto:rburnett@richieburnett.co.uk">rburnett@richieburnett.co.uk</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">As roman said, consider the filter from a DC perspective... The capacitor impedances go to infinity at DC, so C6 and C7 vanish from the schematic. There is also no current into the inverting input of an ideal op-amp, and therefore no voltage drop across resistor R4 so you can replace that with a wire now too. Now the op-amp circuit *is* a familiar inverting amplifier topology (from the point of view of a DC signal) with R2 and R3 setting the gain and you know the equations for this circuit.<br><br>Hope this helps.<br><br>-Richie,<br><br>Sent from my Xperia SP on O2<br><br>---- Roman wrote ----<br><br><div>The bias to reach your desired 2-7V range is pure DC, so you can calculate it just like DC opamp circuit with assumption PWM is at mid level, that is 50%.<br></div><div>You want 4.5V mean value at the output, while PWM mean value is 2.5V. So there is 2V across R2+R3<br></div><div>which means that the R2,R3 node and opamp inverting input is higher by 1V than PWM = 3.5V. So 3.5V should also be set at non-inverting input with PR1.<br></div><div><br></div><div>Wouldn't it be easier just to use Rail-to-Rail opamp and skip the level shifting?<br></div><div><br></div><div>Roman<br></div><div class="nh_extra"><p>Dnia 27 kwietnia 2017 20:41 Tom Wiltshire <<a href="mailto:tom@electricdruid.net">tom@electricdruid.net</a>> napisaĆ(a):<br></p><blockquote class="nh_quote" style="border-left: 2px solid #999; padding-left: 8px; margin: 0;"><div id="gwp14309f75"><div>Hi All,<br></div><div><br></div><div>I have the following situation:<br></div><div><br></div><div>A PIC produces a PWM output representing an LFO waveform. This is then sent to an op-amp MFB filter for smoothing. The circuit looks like this:<br></div><div><br></div><div><a href="http://www.electricdruid.net/images/SingleSupplyLFO.jpg" nh-safe-redirect="" data-saferedirecturl="https://zasobygwp.pl/redirect?sig=9afa8d6ee430085a0d37751ea0a707b9df363d17e61986fe4efc1b1b7f6f8144&url=aHR0cDovL3d3dy5lbGVjdHJpY2RydWlkLm5ldC9pbWFnZXMvU2luZ2xlU3VwcGx5TEZPLmpwZw==" target="_blank">http://www.electricdruid.net/images/SingleSupplyLFO.jpg</a><br></div><div><br></div><div>If I'm running the PIC on 0-5V, and running the op-amp on 0-9V, the op-amp can't handle the raw PWM output, since it clips below about 1.6V (for the TL07x - other typical op-amps are not terribly dissimiliar). So the PWM signal needs biasing to move it to the correct range.<br></div><div><br></div><div>I found the following useful document discussing biasing, both AC and DC, for the various op-amp configurations:<br></div><div><br></div><div><a href="https://ocw.mit.edu/courses/media-arts-and-sciences/mas-836-sensor-technologies-for-interactive-environments-spring-2011/readings/MITMAS_836S11_read02_bias.pdf" nh-safe-redirect="" data-saferedirecturl="https://zasobygwp.pl/redirect?sig=af6b64e89d53dc5a02a97b74f178e482d8b4c08edb74db7a49dca48f05151309&url=aHR0cHM6Ly9vY3cubWl0LmVkdS9jb3Vyc2VzL21lZGlhLWFydHMtYW5kLXNjaWVuY2VzL21hcy04MzYtc2Vuc29yLXRlY2hub2xvZ2llcy1mb3ItaW50ZXJhY3RpdmUtZW52aXJvbm1lbnRzLXNwcmluZy0yMDExL3JlYWRpbmdzL01JVE1BU184MzZTMTFfcmVhZDAyX2JpYXMucGRm" target="_blank">https://ocw.mit.edu/courses/media-arts-and-sciences/mas-836-sensor-technologies-for-interactive-environments-spring-2011/readings/MITMAS_836S11_read02_bias.pdf</a><br></div><div><br></div><div>I've used this guide with success on other circuits. However, in this case I can't make theory and practice match up. For a start, the MFB filter isn't a typical DC-coupled inverting op-amp application, although that's the closest. The filter is inverting and has no overall gain, so gain = -1.<br></div><div><br></div><div>How would I calculate the required bias to get the LFO output signal (0-5V) in the centre of the op-amps range (2-7V)?<br></div><div><br></div><div>I know the answer to this question from practical experiments, but I'd like to know how I'm supposed to derive it from the theory.<br></div><div><br></div><div>Thanks,<br></div><div>Tom<br></div><div><br></div><div><br></div><div><br></div><div>_______________________________________________<br></div><div>Synth-diy mailing list<br></div><div><a nh-compose-link="" href="mailto:Synth-diy@synth-diy.org">Synth-diy@synth-diy.org</a><br></div><div><a href="http://synth-diy.org/mailman/listinfo/synth-diy" nh-safe-redirect="" data-saferedirecturl="https://zasobygwp.pl/redirect?sig=b71c8251b717ba551dbce4e296c1ab7f5c1f2f55b0f607f673fe803609e81823&url=aHR0cDovL3N5bnRoLWRpeS5vcmcvbWFpbG1hbi9saXN0aW5mby9zeW50aC1kaXk=" target="_blank">http://synth-diy.org/mailman/listinfo/synth-diy</a><br></div></div></blockquote></div><div><br></div></blockquote></div><br></div></div></body></html>