I have designed an analog PWM generator and would like to have it checked by someone to confirm that I haven't missed anything.
Well, your schematic reveals that you have reached the state of being dangerous
As I read it, you understand the blocks that you have welded together (at least to some degree), but lack the oversight.
You have used 3 op-amps and two 555's to make a circuit that would perform very similar to a single 555 with a little extra (when values are changed and errors removed) and I guess that stems from jumping into it feet first and just start laying brick on brick. to find out how the finished result will look once it's done.
Just like programming by just typing until the code works and then document it.
The right way of getting things done, whether it's electronics, software, mech or whatever is like this:
- Get idea
- Roughly sketch out idea (i.e. take notes while the idea is fresh - don't rely on your memory)
- Flesh out the sketches (i.e. make block diagrams with the sub-functions of the circuit [or software or...])
- Refine each block independently
- Build each block independently
- Test each block independently
- When all blocks are done,start merging blocks, while assuring everything works before adding more blocks - take notes along the way.
- When all blocks are merged and working, you're done and you only had to juggle a very few balls at a time.
And you have a ton of paper and notes that will help you writing up a pro documentation if needed
Original idea was to use DAC port of microcontroller to extend number of PWM ports with the circuit I designed.
I could give you a solution made with a single op-amp, but you'd learn nothing from that (it's hard to make modular as well), so instead, I'll give you a starting point to help you do a good job AND understand each bit of it (you've demonstrated a great potential to learn, so this should be plain sailing for you).
You want to make a voltage controlled PWM generator.
The input has to be 0..5V (from the D/A-C) and the output has to be a PWM signal that is 0..100% (my assumption).
For this I'd start out with 3 block as follows:
The oscillator needs to be either triangle or sawtooth (either will do - no difference).
As you base this on charging and discharging a cap, you could use constant current for linearity, but by voltage charging and using just the middle third of the voltage range, you get a fairly linear result with less headache, less outlay and you won't be able to tell the difference in the finished result.
The level translator is needed to change the 0..5V from the D/A-C to cover the rangeof 1/3 to 2/3 of VCC
(which I assume to be 5V).
Finally, a comparator (an op-amp could be used depending...) to compare the two signals and make the output high at all times when the oscillator output is lower than the the control voltage from the level translator.
A few things to take into consideration...
As you've already heard, keep resistor values as low as you can get away with, without blowing components or budget. You want the output to have short rise- and fall times and this means you need a good strong hold in the transistor I assume you'll want to drive and fast transients means lots of harmonics - a digital circuit cruising at a lowly 10kHz may well generate harmonics in the MHz or even GHz range.
Use caps on any node* that you want to stay silent or hold a rigid voltage, but don't overdo it - few circuits are happy to see a very capacitive load.
When you draw a schematic, whether for others to read or for your own collection, name each component (like R1, R2, IC1A, etc.) as it makes it possible to point out any place in a circuit.
Don't draw wires through components.
Don't litter the schematic with junction "dots", making it look like you assaulted it with a shotgun
Don't fit any component that isn't needed - the more components in a circuit, the larger the chance that it fails.(* a node is any part of a circuit that connects 2 or more components)
If you concentrate on one sub-circuit at a time (here's two plus a comparator), it should be doable. Perhaps a minor challenge (best way to learn
), but absolutely doable and if you run into a hurdle - post what you've done and what you have measured etc.
Well, high resistor values ore there to reduce current leak. Some of the resistor values will have to change when prototyping this circuit.
Calculating a circuit prior to prototyping should land you close to the final values and the proto-stage is just for trimming the final bits & bobs, optimizing the real world example of what you have on paper.
Stay clear of resistors above ~100 kOhm (or use extensive screening techniques). Sure I have resistors up to 10GOhm (10 Giga-Ohm), but they're reserved for very special circuitry and is never my first pick. Any design involving, or working in proximity to; PWM, motors, solenoids, relays, transmitters, any kind of spark gap and similar noisy environments, I try to keep the resistors quite low).
On the other hand, I don't see how you'd see the components thermoelectric noise as a problem in circuits like that, as that is orders of magnitude below the noise sources that you will
have to deal with - if we were discussing something like a sensitive mic-preamp, with a gain of 1k, it would indeed be something to take very serious though.
A couple of things to ponder
How much current can you "afford" to use for this circuit?
Eg. 5kOhm on 5V is 1mA and if it will be running a load that takes a thousand times that or more...
What frequency do you want your PWM to run?
What precision do you need*
What repeatability do you need*
, not like
- we'd all like a Lambo in the garage, but most of us make do with something a little less but still able to get us down the road and back
These are all design criteria, so should be spec'd out before you touch a single component
Where would it come from, how would it affect it and etc?
The noise that you have to consider may (will) come from:
- Any motor (via the supply, magnetic induction etc.)
- Any other reactive loads
- Any shifting transients (the higher the voltage and the faster the shift, the more noise is generated)
- Radio signals, like R/C equipment and all the clutter in the ISM bands, where there's lots of "garbage" from WiFi, wireless doorbells, baby alarms and what not
- Cell phones should have a specific mention, as a pulse burst from a cell can tilt most circuits if not designed to the latest EMC specs.
- What we used to call "Radio Moscov", i.e. any broadcast that resonates with any part of your circuit (which is just one of the reasons why proper design and
PCB layout is important)
- Klingon tractor beams
As long as you get your signals cleanly into the digital domain, you're some 90% home, as digital signals are way more noise immune. Don't celebrate just yet though, unless you know you have low impedance supply lines, low impedance sensor circuits, low inductance PCB layout, screening where needed (especially with cheap plastic end capped motors and/or large open slots in same), twisted power leads etc.
What is a low impedance, you may ask - well, it depends on the circuit and its intended function - sometimes there's conflicting demands (like only having 1µA to spare, say in a hearing aid), but then there's Metglas and similar stuff to wrap sensitive circuits in