1
\$\begingroup\$

This is my first attempt to simulate a circuit in the time domain with CircuitLab. In order to ask a proper question about something similar driven with PWM, I'd like to add an adjustable duty cycle to the square wave, and then if possible ramp it.

How can I add variable duty cycle PWM to a CircuitLab simulation within a question?

schematic

simulate this circuit – Schematic created using CircuitLab

enter image description here

\$\endgroup\$
  • \$\begingroup\$ So far I haven't found anything in meta that discusses if CircuitLab assistance is off-topic, nor have I found anything in the help center for or against. Further, my previous question How to approximate the behavior of a phototransistor in the circuit editor? was answered without incident. Why the silent, anonymous insta-close vote rather than a helpful comment? \$\endgroup\$ – uhoh Jun 4 '18 at 8:33
  • 2
    \$\begingroup\$ As long as we're talking about CircuitLab in general and not a detail of the StackExchange implementation, it's fine on the main site (instead of meta.EE) \$\endgroup\$ – W5VO Jun 4 '18 at 18:07
  • \$\begingroup\$ @W5VO thanks! Yep this one's strictly about simulating a circuit. \$\endgroup\$ – uhoh Jun 5 '18 at 1:06
2
\$\begingroup\$

This is an interesting question. I've never had to do it but this might work for you.

schematic

simulate this circuit – Schematic created using CircuitLab

Figure 1. Two sawtooth oscillators and a comparator.

enter image description here

Figure 2. Note the DC offset in the sawtooth configuration.

enter image description here

Figure 3. The result.

I seem to have configured the amplitude incorrectly on the triangle waves. They should probably be 2.5 V with 2.5 V offset but perhaps the graph is clearer like this.

\$\endgroup\$
  • \$\begingroup\$ Oh excellent! Yes I've got the idea, this will work nicely. It may in fact be how it was actually done at some point. \$\endgroup\$ – uhoh Jun 4 '18 at 8:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.