<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 <tom@electricdruid.net> 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>