Circuit for Randomized Pulse Width Modulation

I have a CD4060 outputting a 5Vpp 4Hz (4 hertz) square wave at 50% duty cycle.

How can I randomly pulse width modulate this so that when a low pass filter is added a constantly changing, "wave-like" arbitrary waveform will be produced?

I would prefer analog or CMOS IC's, not a microprocessor, and minimum parts count.

The "randomness" does not need to be true but only a reasonable approximation.

Thank you for any ideas or available circuit diagrams.

Robert Martin

Reply to
Robert Martin
Loading thread data ...

formatting link

You can make a pseudorandnom binary sequence in a single-chip processor - i t can also be done with long shift registers, and some parts seem to have b een designed for the job, but the single-chip microprocessor or a programma ble logic chip are the minimum part solution.

--
Bill Sloman, Sydney
Reply to
bill.sloman

I would prefer not to use a micro. This circuit uses only two IC's.

formatting link

Any comments? Would clocking it at 4Hz present any problems?

Do I understand correctly that the output would be a 4Hz PWM signal at about 2Vpp?

Robert Martin

Reply to
Robert Martin

I think the simplest way to do it without a uP would to build an analog white noise source a la:

and then aggressively low-pass filter it. then feed your square wave into one input of a comparator and the appropriately-scaled low-passed noise into the other.

Reply to
bitrex

Another idea, if pseudo-random is okay and you want to be quick and cheap and not muck with analog noise sources is get yourself one of those "flicker flame" LED candles that have a pseudorandom sequence generator built into the chip in the LED to make the LED "flicker."

Drive the LED with a current source and buffer/filter/gain scale the voltage output across the LED with an op-amp as you like, and then into one input of a comparator and the square wave into the other as before.

Reply to
bitrex

The only other question I have is why you need to filter a PWM waveform to get your desired output to begin with, can't you just filter a noise generator directly? Filtered noise is surely a "constantly-changing wave-like arbitrary waveform" yes?

Reply to
bitrex

Reply to
bitrex

I tried using noise, as recommended earlier on this group and elsewhere. The filtered amplitude below 10Hz was too low to produce a workable result,

Your idea about using a candlelight flickering LED is interesting, but looking at the video the switching appears to be a bit sharp.

In any case, I would prefer a circuit over which I have a degree of design control as I may need to tinker to get the chaotic wave-like effect with smooth transitions that I am looking for.

Robert Martin

Reply to
Robert Martin

XOR it with another free running oscillator of about the same frequency but with a bit of frequency modulation dither added.

It would be so much easier to do in a PIC or with a shift register.

formatting link

--
Regards, 
Martin Brown
Reply to
Martin Brown

That makes sense (loss of signal) how about filter it at ~10-100 kHz and then send it into a counter/ divider to get to lower frequency.

George H.

Reply to
George Herold

e:

y

- it can also be done with long shift registers, and some parts seem to ha ve been designed for the job, but the single-chip microprocessor or a progr ammable logic chip are the minimum part solution.

Of course. You'd have to learn more than the bare minimum required to get t he job done.

_SEQUENCE_GENERATOR.html

The circuit uses three integrated circuits - two 5-stage shift register and the exclusive-OR gate package.

It is singularly un-impressive, clearly designed by somebody who couldn't b e bother finding out what parts are available.

You can get much longer shift registers - designed for the job - that only provide external output from the stages you need to feed into the exclusive

-OR gate, and you can program a programmable-logic device to do all the sam e jobs in one chip.

Clocking it at 4Hz wouldn't present any problems

If you built it with TTL-logic powered from 5V and didn't put a pull-up on the output you'd see about 2V peak to peak.

Most people would use CMOS these days, which would give you rail to rail sw ing - which could be up to 15V with old 4000-series CMOS. More modern parts are mostly only rated for lower supply voltages - 5V or lower.

--
Bill Sloman, Sydney
Reply to
bill.sloman

Yes, but the essence of my original question is how to create "dither" or a degree of randomness at ELF.

Robert Martin

Reply to
Robert Martin

Good suggestion. I'll first apply a 1KHz LPF and clip its output to simulate a logic signal into a divide by 100 counter.

Robert Martin

Reply to
Robert Martin

Robert, now that I think about it, I'm not sure that is going to work... or be that useful. If you've got random pulses coming at some rate... then counting to some number is giving you a running average of the counts And I don't think you'll see a lot of variation. One of the pseudo-random shift register things may be better... you can clock at the rate you like. There are not many low frequency noise sources... maybe 1/f noise in the old carbon comp resistors? Geiger counter with weakish source, some chaotic pendulum...

George H.

Reply to
George Herold

Thank you. I always liked the CMOS logic series. Here is my first attempt with a CD4021.

formatting link

It is an 8 bit adaptation of this 10 bit circuit I posted earlier.

formatting link

I am sure there are mistakes, so comments would be very much appreciated.

Robert Martin

Reply to
Robert Martin

I could whip up a code sketch and have an ATTiny 8 pin uP on a board outputting the required wave form with pseudo-random duty cycle modulation in literally ten minutes

Reply to
bitrex

If Robert Martin needs this function in small quantity I could easily do a thousand of them in a DIP package with the programmer array I have at home, let's make a deal bro :)

Reply to
bitrex

and the exclusive-OR gate package.

't be bother finding out what parts are available.

nly provide external output from the stages you need to feed into the exclu sive-OR gate, and you can program a programmable-logic device to do all the same jobs in one chip.

on the output you'd see about 2V peak to peak.

l swing - which could be up to 15V with old 4000-series CMOS. More modern p arts are mostly only rated for lower supply voltages - 5V or lower.

_SEQUENCE_GENERATOR.html

I haven't looked at it in detail, but one failure mode with pseudo-random b inary sequence generators is that if the shift register gets completely fil led with either ones or zeros (depending on the implementation) they don't do anything. A crude - but often effective - solution is to trigger a pair of monstables - one for rising edges and one for falling edged - each time they see a transition, and if neither has been triggered for a period longe r than the length of the shift register multiplied by the clock period you set or clear the shift register.

It's short - 8-stages is 256 possible state - so it would repeat once a min ute if clocked at 4Hz.

It's decades since I've done it (to confuse bats that a female friend was t esting) so this may not be reliable advice.

--
Bill Sloman, Sydney
Reply to
bill.sloman

Thank you for the update.

You are certainly right about a shortage of LF noise sources. A friend once used a photocell pointed at trees blowing in the wind. Clever but not very portable.

Robert Martin

Reply to
Robert Martin

Thank you for the tempting offer, but I am determined to nut this out using common IC's, not a micro.

If anyone here is able to design such a circuit that provides a random PWM output at around 4Hz with low parts count, do let me know. Here please, not by PM. We can work something out.

Robert Martin

Reply to
Robert Martin

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.