-
-
Save ericfont/c66ef20f7de7867b000dddc61e857305 to your computer and use it in GitHub Desktop.
although the sim looks fine, in reality trying to do it on a breadboard and tweaking variable capacitor values doesn't seem to actually work to null the oscillation.
Maybe a better way would be to send a delayed negative version of the PWM and add it to the original pwm (i.e. do a comb filter) would could precisely target a specific frequency.
adding a delayed version of waveform that is 1/2 of the oscillation period seems to work well to null most of the oscillation frequency, while not really delaying or distorting much...here is 1kHz 1V(peak) input:
and here is 10kHz 1V(peak) input:
Nothe: the RC lowpasses are unnecessary for reconstruction, or their cutoff freq could even be made lower closer to 20kHz if desired for smoothness. The integrator is the one crucial part.
And for feedback, the RC cutoff is the main thing that influences the oscillation frequency (other than other circuit dealys). Thus, a Potentiometer could be used for the resistor to tweak the oscillation frequency to be exactly 96kHz.
maybe there is some other way to encode 2nd derivative other than just using 1st derivative as input or mix it in with some CR network when combining with feedback result.








sim