Electronics-Related.com
Forums

Circuit for Randomized Pulse Width Modulation

Started by Robert Martin January 8, 2019
On 01/11/2019 05:51 PM, gnuarm.deletethisbit@gmail.com wrote:
> On Wednesday, January 9, 2019 at 5:24:32 PM UTC-5, bitrex wrote: >> On 01/09/2019 09:08 AM, bill.sloman@ieee.org wrote: >>> On Wednesday, January 9, 2019 at 3:13:48 PM UTC+11, Robert Martin wrote: >>>> On 9/1/19 11:04 am, bill.sloman@ieee.org wrote: >>>>> On Wednesday, January 9, 2019 at 10:48:46 AM UTC+11, Robert Martin wrote: >>>>>> 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. >>>>> >>>>> https://en.wikipedia.org/wiki/Pseudorandom_binary_sequence >>>>> >>>>> You can make a pseudorandnom binary sequence in a single-chip processor - it can also be done with long shift registers, and some parts seem to have been designed for the job, but the single-chip microprocessor or a programmable logic chip are the minimum part solution. >>>>> >>>> >>>> I would prefer not to use a micro. >>> >>> Of course. You'd have to learn more than the bare minimum required to get the job done. >>> >>>> This circuit uses only two IC's. >>>> http://www.seekic.com/circuit_diagram/Signal_Processing/PSEUDO_RANDOM_BIT_SEQUENCE_GENERATOR.html >>>> >>>> >>>> Any comments? Would clocking it at 4Hz present any problems? >>> >>> 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 be 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 same jobs in one chip. >>> >>> Clocking it at 4Hz wouldn't present any problems >>> >>>> Do I understand correctly that the output would be a 4Hz PWM signal at >>>> about 2Vpp? >>> >>> 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 swing - 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. >>> >> >> 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 > > Couldn't you low pass filter the bit stream and feed an on chip DAC and drive an analog output directly? His actual goal is to produce random waves, right? > > Rick C. > > - Get 6 months of free supercharging > - Tesla referral code - https://ts.la/richard11209 >
Sure, the ATTiny series doesn't have an onboard DAC but it has hardware PWM channels which top out at around 32kHz base frequency for an 8MHz internal oscillator clock, 8 bit for the PWM. For a max frequency output say 1/10 lower a two pole Bessel should work fine to filter that, maybe even just a buffered RC. The internal pseudorandom modulation source for the PWM output could be 1-dimensional Perlin noise: <https://en.wikipedia.org/wiki/Perlin_noise>
On 01/11/2019 05:51 PM, gnuarm.deletethisbit@gmail.com wrote:
> On Wednesday, January 9, 2019 at 5:24:32 PM UTC-5, bitrex wrote: >> On 01/09/2019 09:08 AM, bill.sloman@ieee.org wrote: >>> On Wednesday, January 9, 2019 at 3:13:48 PM UTC+11, Robert Martin wrote: >>>> On 9/1/19 11:04 am, bill.sloman@ieee.org wrote: >>>>> On Wednesday, January 9, 2019 at 10:48:46 AM UTC+11, Robert Martin wrote: >>>>>> 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. >>>>> >>>>> https://en.wikipedia.org/wiki/Pseudorandom_binary_sequence >>>>> >>>>> You can make a pseudorandnom binary sequence in a single-chip processor - it can also be done with long shift registers, and some parts seem to have been designed for the job, but the single-chip microprocessor or a programmable logic chip are the minimum part solution. >>>>> >>>> >>>> I would prefer not to use a micro. >>> >>> Of course. You'd have to learn more than the bare minimum required to get the job done. >>> >>>> This circuit uses only two IC's. >>>> http://www.seekic.com/circuit_diagram/Signal_Processing/PSEUDO_RANDOM_BIT_SEQUENCE_GENERATOR.html >>>> >>>> >>>> Any comments? Would clocking it at 4Hz present any problems? >>> >>> 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 be 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 same jobs in one chip. >>> >>> Clocking it at 4Hz wouldn't present any problems >>> >>>> Do I understand correctly that the output would be a 4Hz PWM signal at >>>> about 2Vpp? >>> >>> 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 swing - 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. >>> >> >> 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 > > Couldn't you low pass filter the bit stream and feed an on chip DAC and drive an analog output directly? His actual goal is to produce random waves, right? > > Rick C. > > - Get 6 months of free supercharging > - Tesla referral code - https://ts.la/richard11209 >
10 minute proof of concept, this is a couple octaves summation of 1D Perlin noise/pseudorandom coherent noise modulating the PWM duty cycle and driving a yellow LED from the PWM output of an AVR. Looks a lot like one of those flicker-flame candle LEDs. A bit late for the holidays oh well... <https://www.dropbox.com/s/yuxvb3a4qwu12n3/VID_20190111_220348599.mp4?dl=0>
On 01/11/2019 06:41 PM, Tim Williams wrote:
> "Phil Hobbs" <pcdhSpamMeSenseless@electrooptical.net> wrote in message > news:uKadneOhtb_WL6XBnZ2dnUU7-QHNnZ2d@supernews.com... >> There are quite a few folks that show up here asking questions who don't >> actually want a solution, > > What is it with people like that, anyway? > > Not referring to the present example in particular, but more generally. > It seems to fit a pattern.
they have a constraint they don't wanna mention because if they mentioned it, whatever it is, it would be clear what they were doing which is probably trying to get work done for free, the type of work most people want 2 get paid to do. It's a fishing expedition, fishing for brains! Heh!
On Saturday, 12 January 2019 03:38:20 UTC, bitrex  wrote:
> On 01/11/2019 06:41 PM, Tim Williams wrote: > > "Phil Hobbs" <pcdhSpamMeSenseless@electrooptical.net> wrote in message > > news:uKadneOhtb_WL6XBnZ2dnUU7-QHNnZ2d@supernews.com...
> >> There are quite a few folks that show up here asking questions who don't > >> actually want a solution, > > > > What is it with people like that, anyway? > > > > Not referring to the present example in particular, but more generally. > > It seems to fit a pattern. > > they have a constraint they don't wanna mention because if they
often yes
> mentioned it, whatever it is, it would be clear what they were doing > which is probably trying to get work done for free, the type of work > most people want 2 get paid to do.
I'm sure there's a variety of explanations in differing cases. Some likely candidates spring to mind: 1. they can't talk about what they're making 2. they just don't want to talk about what they're making 3. they've made their mind up on aspects of the design that more or less none of us would agree with, and they aren't interested in re-questioning those decisions 4. they have invented something, or think they have, so don't want to talk about some aspects of the thing such as what they're trying to achieve 5. sometimes I think they just don't see how the questions we ask are relevant 6. sometimes their communication skills are simply inadequate 7. they're looking for something very specific & most/all responses don't get them what they're looking for. Often they can't/won't say what that specific thing is. 8. they only want to use what's in their rather limited parts box There are probably other possibles too. NT