Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > sci.electronics.design > #399121 > unrolled thread

Design play/challenge: Phase Shift PWM

Started by"Tim Williams" <tiwill@seventransistorlabs.com>
First post2016-02-16 13:56 -0600
Last post2016-02-17 17:32 -0800
Articles 20 on this page of 29 — 9 participants

Back to article view | Back to sci.electronics.design


Contents

  Design play/challenge: Phase Shift PWM "Tim Williams" <tiwill@seventransistorlabs.com> - 2016-02-16 13:56 -0600
    Re: Design play/challenge: Phase Shift PWM Tauno Voipio <tauno.voipio@notused.fi.invalid> - 2016-02-16 22:49 +0200
    Re: Design play/challenge: Phase Shift PWM Klaus Kragelund <klauskvik@hotmail.com> - 2016-02-16 14:05 -0800
      Re: Design play/challenge: Phase Shift PWM "Tim Williams" <tiwill@seventransistorlabs.com> - 2016-02-16 17:29 -0600
      Re: Design play/challenge: Phase Shift PWM Jan Panteltje <pNaOnStPeAlMtje@yahoo.com> - 2016-02-17 09:22 +0000
        Re: Design play/challenge: Phase Shift PWM Les Cargill <lcargill99@comcast.com> - 2016-02-17 20:38 -0600
          Re: Design play/challenge: Phase Shift PWM Jan Panteltje <pNaOnStPeAlMtje@yahoo.com> - 2016-02-18 07:18 +0000
          Re: Design play/challenge: Phase Shift PWM Jan Panteltje <pNaOnStPeAlMtje@yahoo.com> - 2016-02-18 07:20 +0000
            Re: Design play/challenge: Phase Shift PWM Les Cargill <lcargill99@comcast.com> - 2016-02-18 02:35 -0600
              Re: Design play/challenge: Phase Shift PWM Jan Panteltje <pNaOnStPeAlMtje@yahoo.com> - 2016-02-18 10:13 +0000
                Re: Design play/challenge: Phase Shift PWM Les Cargill <lcargill99@comcast.com> - 2016-02-18 12:37 -0600
    Re: Design play/challenge: Phase Shift PWM piglet <erichpwagner@hotmail.com> - 2016-02-17 10:56 +0000
      Re: Design play/challenge: Phase Shift PWM "Tim Williams" <tiwill@seventransistorlabs.com> - 2016-02-17 10:43 -0600
        Re: Design play/challenge: Phase Shift PWM piglet <erichpwagner@hotmail.com> - 2016-02-17 18:33 +0000
        Re: Design play/challenge: Phase Shift PWM piglet <erichpwagner@hotmail.com> - 2016-02-18 08:54 +0000
          Re: Design play/challenge: Phase Shift PWM piglet <erichpwagner@hotmail.com> - 2016-02-18 13:38 +0000
            Re: Design play/challenge: Phase Shift PWM "Tim Williams" <tiwill@seventransistorlabs.com> - 2016-02-18 10:55 -0600
              Re: Design play/challenge: Phase Shift PWM piglet <erichpwagner@hotmail.com> - 2016-02-18 17:01 +0000
                Re: Design play/challenge: Phase Shift PWM "Tim Williams" <tiwill@seventransistorlabs.com> - 2016-02-18 11:20 -0600
                  Re: Design play/challenge: Phase Shift PWM piglet <erichpwagner@hotmail.com> - 2016-02-18 17:39 +0000
                  Re: Design play/challenge: Phase Shift PWM Jim Thompson <To-Email-Use-The-Envelope-Icon@On-My-Web-Site.com> - 2016-02-18 10:47 -0700
                    Re: Design play/challenge: Phase Shift PWM piglet <erichpwagner@hotmail.com> - 2016-02-18 17:53 +0000
                      Re: Design play/challenge: Phase Shift PWM Jim Thompson <To-Email-Use-The-Envelope-Icon@On-My-Web-Site.com> - 2016-02-18 12:57 -0700
                        Re: Design play/challenge: Phase Shift PWM piglet <erichpwagner@hotmail.com> - 2016-02-18 20:50 +0000
                          Re: Design play/challenge: Phase Shift PWM Jim Thompson <To-Email-Use-The-Envelope-Icon@On-My-Web-Site.com> - 2016-02-18 14:42 -0700
                        Re: Design play/challenge: Phase Shift PWM "Tim Williams" <tiwill@seventransistorlabs.com> - 2016-02-18 18:21 -0600
                          Re: Design play/challenge: Phase Shift PWM Jim Thompson <To-Email-Use-The-Envelope-Icon@On-My-Web-Site.com> - 2016-02-18 17:50 -0700
    Re: Design play/challenge: Phase Shift PWM jack4747@gmail.com - 2016-02-17 03:17 -0800
      Re: Design play/challenge: Phase Shift PWM boB <boB@theresnoplacelikehome.com> - 2016-02-17 17:32 -0800

Page 1 of 2  [1] 2  Next page →


#399121 — Design play/challenge: Phase Shift PWM

From"Tim Williams" <tiwill@seventransistorlabs.com>
Date2016-02-16 13:56 -0600
SubjectDesign play/challenge: Phase Shift PWM
Message-ID<n9vuof$9u1$1@dont-email.me>
It finally occurred to me, I've been using these things for so long, yet 
never built my own.  And therefore, never fully understood nor trusted 
what the documentation says (or hides!).

So here's the challenge:

Design a phase shift PWM controller.

Example applications:
Full bridge forward converter (SMPS, UPS, motor control, etc.)
Frequency-locked, resonant systems (resonant SMPS, induction heating): PWM 
provides linear, continuous power control, independent of frequency.

Requirements:
- Constant 50% +/- 3% duty cycle per output (complementary outputs with 
dead time for full bridge gate driving are easily added on)
- Variable frequency, using a control voltage/current, or single variable 
resistor (duty cycle and phase shift remain ~constant)
- Variable phase shift, from a control voltage input
- Phase shift adjustable from 0-180 degrees or more (or 180-360, same 
thing)
- Must use continuous-time methods, not sampled/divided.  (Or, ENOB > 12, 
which will rule out most digital methods for rather modest output 
frequencies anyway.)
- Uses discrete transistors, comparators, logic gates (no more than MSI), 
that sort of thing.  ("Transistors" includes the hollow FET kinds, if you 
like.)

Homework:
The basic prototype is an astable multivibrator (makes 50% duty cycle 
reference clock), followed by a delay and ramp circuit.  The tricky parts 
are:
- The multivibrator has to be timed from the same global (frequency 
control) bias current (e.g., using a current steering triangle-wave 
oscillator, like you'd find in an analog function generator)
- Essentially, an oscilloscope's triggered sweep circuit is required for 
the delay generator.  Multivibrator triggers it on rising edge; cap 
charges for almost the whole cycle time (again, charged by the global bias 
current), making a sawtooth wave; comparator picks a point along that 
ramp, thus implementing the delay.
- Thus, delay is adjustable anywhere along the sawtooth ramp, which might 
be, say, 10-350 degrees.  It can't go quite to zero due to delay (which 
could be subtracted out by delaying the original clock source), and can't 
quite go to 360 because of reset time and trigger window.
- To square up the output, a 50% duty cycle generator is needed, which can 
be: injection locked multivibrator (otherwise matched to the clock 
multivibrator); or another triggered delay generator with the required 
slope; or:
- Or instead of using a triggered sweep for the delay generator, the clock 
multivibrator can be a sawtooth type.  Use one comparator to bisect the 
sawtooth, yielding the non-delayed 50% output.  Use another comparator to 
generate the delayed trigger (the multivibrator slope sets range).  A 
triggered delay generator is still required, to produce the delayed 50% 
duty output.
- Symmetry bonus: you can start with a clock pulse, and run two triggered 
delay generators, where one delay control voltage is inverse of the other. 
Each one only needs 90 degrees of adjustable range.  This probably incurs 
more hardware than the lopsided-phase version, though.

Possibly useful: 50% duty can be obtained by dividing a square wave in 
half (type T flip-flop), without having to match capacitors.  But half the 
frequency means twice the phase shift, and if the flip-flops ever end up 
out of sync, phase suddenly inverts.  May be tricky to use.

The basic breadboarding of this ("RTA level") description used an LM339, 
5/6ths CD40106, 1/2 CD4013, and five transistors (true, I could've better 
squared up an edge using /Seven Transistors/..).  On a good old fashioned 
solderless breadboard, that's a full row of stuff.  Very messy!

So if I've captured your fancy at all... Simplify it, if you think you 
can!  ;-)

(Special note to you in the monolithic peanut-gallery: yes, I know you can 
make all of this, and more, in a tiny 1mm chip.  Unless you have one 
available that can be bought for less than the parts listed above, STFU. 
:-P )

Tim

-- 
Seven Transistor Labs, LLC
Electrical Engineering Consultation and Contract Design
Website: http://seventransistorlabs.com 

[toc] | [next] | [standalone]


#399125

FromTauno Voipio <tauno.voipio@notused.fi.invalid>
Date2016-02-16 22:49 +0200
Message-ID<na01rc$m9q$1@dont-email.me>
In reply to#399121
On 16.2.16 21:56, Tim Williams wrote:
> It finally occurred to me, I've been using these things for so long, yet
> never built my own.  And therefore, never fully understood nor trusted
> what the documentation says (or hides!).
>
> So here's the challenge:
>
> Design a phase shift PWM controller.
>
> Example applications:
> Full bridge forward converter (SMPS, UPS, motor control, etc.)
> Frequency-locked, resonant systems (resonant SMPS, induction heating): PWM
> provides linear, continuous power control, independent of frequency.
>
> Requirements:
> - Constant 50% +/- 3% duty cycle per output (complementary outputs with
> dead time for full bridge gate driving are easily added on)
> - Variable frequency, using a control voltage/current, or single variable
> resistor (duty cycle and phase shift remain ~constant)
> - Variable phase shift, from a control voltage input
> - Phase shift adjustable from 0-180 degrees or more (or 180-360, same
> thing)
> - Must use continuous-time methods, not sampled/divided.  (Or, ENOB > 12,
> which will rule out most digital methods for rather modest output
> frequencies anyway.)
> - Uses discrete transistors, comparators, logic gates (no more than MSI),
> that sort of thing.  ("Transistors" includes the hollow FET kinds, if you
> like.)
>
> Homework:
> The basic prototype is an astable multivibrator (makes 50% duty cycle
> reference clock), followed by a delay and ramp circuit.  The tricky parts
> are:
> - The multivibrator has to be timed from the same global (frequency
> control) bias current (e.g., using a current steering triangle-wave
> oscillator, like you'd find in an analog function generator)
> - Essentially, an oscilloscope's triggered sweep circuit is required for
> the delay generator.  Multivibrator triggers it on rising edge; cap
> charges for almost the whole cycle time (again, charged by the global bias
> current), making a sawtooth wave; comparator picks a point along that
> ramp, thus implementing the delay.
> - Thus, delay is adjustable anywhere along the sawtooth ramp, which might
> be, say, 10-350 degrees.  It can't go quite to zero due to delay (which
> could be subtracted out by delaying the original clock source), and can't
> quite go to 360 because of reset time and trigger window.
> - To square up the output, a 50% duty cycle generator is needed, which can
> be: injection locked multivibrator (otherwise matched to the clock
> multivibrator); or another triggered delay generator with the required
> slope; or:
> - Or instead of using a triggered sweep for the delay generator, the clock
> multivibrator can be a sawtooth type.  Use one comparator to bisect the
> sawtooth, yielding the non-delayed 50% output.  Use another comparator to
> generate the delayed trigger (the multivibrator slope sets range).  A
> triggered delay generator is still required, to produce the delayed 50%
> duty output.
> - Symmetry bonus: you can start with a clock pulse, and run two triggered
> delay generators, where one delay control voltage is inverse of the other.
> Each one only needs 90 degrees of adjustable range.  This probably incurs
> more hardware than the lopsided-phase version, though.
>
> Possibly useful: 50% duty can be obtained by dividing a square wave in
> half (type T flip-flop), without having to match capacitors.  But half the
> frequency means twice the phase shift, and if the flip-flops ever end up
> out of sync, phase suddenly inverts.  May be tricky to use.
>
> The basic breadboarding of this ("RTA level") description used an LM339,
> 5/6ths CD40106, 1/2 CD4013, and five transistors (true, I could've better
> squared up an edge using /Seven Transistors/..).  On a good old fashioned
> solderless breadboard, that's a full row of stuff.  Very messy!
>
> So if I've captured your fancy at all... Simplify it, if you think you
> can!  ;-)
>
> (Special note to you in the monolithic peanut-gallery: yes, I know you can
> make all of this, and more, in a tiny 1mm chip.  Unless you have one
> available that can be bought for less than the parts listed above, STFU.
> :-P )
>
> Tim
>

Make an analytic (sine+cosine) sine wave oscillator and combine the
sine and cosine outputs with a two-phase resolver for phase shift.
Using a Scott T-transformer, even a three phase synchro will do.

-- 

-TV

[toc] | [prev] | [next] | [standalone]


#399130

FromKlaus Kragelund <klauskvik@hotmail.com>
Date2016-02-16 14:05 -0800
Message-ID<0bfe4fd0-2d03-4c61-ba03-cce6341abc46@googlegroups.com>
In reply to#399121
On Tuesday, February 16, 2016 at 8:56:53 PM UTC+1, Tim Williams wrote:
> It finally occurred to me, I've been using these things for so long, yet 
> never built my own.  And therefore, never fully understood nor trusted 
> what the documentation says (or hides!).
> 
> So here's the challenge:
> 
> Design a phase shift PWM controller.
> 
> Example applications:
> Full bridge forward converter (SMPS, UPS, motor control, etc.)
> Frequency-locked, resonant systems (resonant SMPS, induction heating): PWM 
> provides linear, continuous power control, independent of frequency.
> 
> Requirements:
> - Constant 50% +/- 3% duty cycle per output (complementary outputs with 
> dead time for full bridge gate driving are easily added on)
> - Variable frequency, using a control voltage/current, or single variable 
> resistor (duty cycle and phase shift remain ~constant)
> - Variable phase shift, from a control voltage input
> - Phase shift adjustable from 0-180 degrees or more (or 180-360, same 
> thing)
> - Must use continuous-time methods, not sampled/divided.  (Or, ENOB > 12, 
> which will rule out most digital methods for rather modest output 
> frequencies anyway.)
> - Uses discrete transistors, comparators, logic gates (no more than MSI), 
> that sort of thing.  ("Transistors" includes the hollow FET kinds, if you 
> like.)
> 
> Homework:
> The basic prototype is an astable multivibrator (makes 50% duty cycle 
> reference clock), followed by a delay and ramp circuit.  The tricky parts 
> are:
> - The multivibrator has to be timed from the same global (frequency 
> control) bias current (e.g., using a current steering triangle-wave 
> oscillator, like you'd find in an analog function generator)
> - Essentially, an oscilloscope's triggered sweep circuit is required for 
> the delay generator.  Multivibrator triggers it on rising edge; cap 
> charges for almost the whole cycle time (again, charged by the global bias 
> current), making a sawtooth wave; comparator picks a point along that 
> ramp, thus implementing the delay.
> - Thus, delay is adjustable anywhere along the sawtooth ramp, which might 
> be, say, 10-350 degrees.  It can't go quite to zero due to delay (which 
> could be subtracted out by delaying the original clock source), and can't 
> quite go to 360 because of reset time and trigger window.
> - To square up the output, a 50% duty cycle generator is needed, which can 
> be: injection locked multivibrator (otherwise matched to the clock 
> multivibrator); or another triggered delay generator with the required 
> slope; or:
> - Or instead of using a triggered sweep for the delay generator, the clock 
> multivibrator can be a sawtooth type.  Use one comparator to bisect the 
> sawtooth, yielding the non-delayed 50% output.  Use another comparator to 
> generate the delayed trigger (the multivibrator slope sets range).  A 
> triggered delay generator is still required, to produce the delayed 50% 
> duty output.
> - Symmetry bonus: you can start with a clock pulse, and run two triggered 
> delay generators, where one delay control voltage is inverse of the other. 
> Each one only needs 90 degrees of adjustable range.  This probably incurs 
> more hardware than the lopsided-phase version, though.
> 
> Possibly useful: 50% duty can be obtained by dividing a square wave in 
> half (type T flip-flop), without having to match capacitors.  But half the 
> frequency means twice the phase shift, and if the flip-flops ever end up 
> out of sync, phase suddenly inverts.  May be tricky to use.
> 
> The basic breadboarding of this ("RTA level") description used an LM339, 
> 5/6ths CD40106, 1/2 CD4013, and five transistors (true, I could've better 
> squared up an edge using /Seven Transistors/..).  On a good old fashioned 
> solderless breadboard, that's a full row of stuff.  Very messy!
> 
> So if I've captured your fancy at all... Simplify it, if you think you 
> can!  ;-)
> 
> (Special note to you in the monolithic peanut-gallery: yes, I know you can 
> make all of this, and more, in a tiny 1mm chip.  Unless you have one 
> available that can be bought for less than the parts listed above, STFU. 
> :-P )
> 

I would like to challenge not using a micro. If you use a micro with 1Msa 12 bit ADC and feed that with DMA to the frequency setting register, wouldn't that be possible. Even if you have to let the micro do nothing else than this task?

Cheers

Klaus

[toc] | [prev] | [next] | [standalone]


#399135

From"Tim Williams" <tiwill@seventransistorlabs.com>
Date2016-02-16 17:29 -0600
Message-ID<na0b6o$t0c$1@dont-email.me>
In reply to#399130
"Klaus Kragelund"  wrote in message 
news:0bfe4fd0-2d03-4c61-ba03-cce6341abc46@googlegroups.com...
> I would like to challenge not using a micro. If you use a micro
> with 1Msa 12 bit ADC and feed that with DMA to the frequency
> setting register, wouldn't that be possible. Even if you have to
> let the micro do nothing else than this task?

Still won't meet the continuity requirement.  Maybe not bad if you have 
one with a vernier timer.

But anyway, you aren't learning anything, which defeats the purpose of a 
design _play_.  ;)

Tim

-- 
Seven Transistor Labs, LLC
Electrical Engineering Consultation and Contract Design
Website: http://seventransistorlabs.com 

[toc] | [prev] | [next] | [standalone]


#399170

FromJan Panteltje <pNaOnStPeAlMtje@yahoo.com>
Date2016-02-17 09:22 +0000
Message-ID<na1e4b$bff$1@news.datemas.de>
In reply to#399130
On a sunny day (Tue, 16 Feb 2016 14:05:20 -0800 (PST)) it happened Klaus
Kragelund <klauskvik@hotmail.com> wrote in
<0bfe4fd0-2d03-4c61-ba03-cce6341abc46@googlegroups.com>:

>I would like to challenge not using a micro. If you use a micro with 1Msa 12 bit ADC and feed that with DMA to the frequency
>setting register, wouldn't that be possible. Even if you have to let the micro do nothing else than this task?
>
>Cheers
>
>Klaus

Yep, 2$ PIC can do all that.

[toc] | [prev] | [next] | [standalone]


#399239

FromLes Cargill <lcargill99@comcast.com>
Date2016-02-17 20:38 -0600
Message-ID<na3a6b$3pe$4@dont-email.me>
In reply to#399170
Jan Panteltje wrote:
> On a sunny day (Tue, 16 Feb 2016 14:05:20 -0800 (PST)) it happened Klaus
> Kragelund <klauskvik@hotmail.com> wrote in
> <0bfe4fd0-2d03-4c61-ba03-cce6341abc46@googlegroups.com>:
>
>> I would like to challenge not using a micro. If you use a micro with 1Msa 12 bit ADC and feed that with DMA to the frequency
>> setting register, wouldn't that be possible. Even if you have to let the micro do nothing else than this task?
>>
>> Cheers
>>
>> Klaus
>
> Yep, 2$ PIC can do all that.
>

But that's so *LAZY* :)


-- 
Les Cargill

[toc] | [prev] | [next] | [standalone]


#399257

FromJan Panteltje <pNaOnStPeAlMtje@yahoo.com>
Date2016-02-18 07:18 +0000
Message-ID<na3r7h$il6$1@news.datemas.de>
In reply to#399239
On a sunny day (Wed, 17 Feb 2016 20:38:13 -0600) it happened Les Cargill
<lcargill99@comcast.com> wrote in <na3a6b$3pe$4@dont-email.me>:

>Jan Panteltje wrote:
>> On a sunny day (Tue, 16 Feb 2016 14:05:20 -0800 (PST)) it happened Klaus
>> Kragelund <klauskvik@hotmail.com> wrote in
>> <0bfe4fd0-2d03-4c61-ba03-cce6341abc46@googlegroups.com>:
>>
>>> I would like to challenge not using a micro. If you use a micro with 1Msa 12 bit ADC and feed that with DMA to the frequency
>>> setting register, wouldn't that be possible. Even if you have to let the micro do nothing else than this task?
>>>
>>> Cheers
>>>
>>> Klaus
>>
>> Yep, 2$ PIC can do all that.
>>
>
>But that's so *LAZY* :)

It is called 'efficiency'.
:-)

[toc] | [prev] | [next] | [standalone]


#399258

FromJan Panteltje <pNaOnStPeAlMtje@yahoo.com>
Date2016-02-18 07:20 +0000
Message-ID<na3rc3$j2b$1@news.datemas.de>
In reply to#399239
>> Yep, 2$ PIC can do all that.
>>
>
>But that's so *LAZY* :)

It is called 'efficiency'.
:-)

PS did you know PIC has 2 hardware comparators and a FF?
I use those comparators a a lot.

[toc] | [prev] | [next] | [standalone]


#399259

FromLes Cargill <lcargill99@comcast.com>
Date2016-02-18 02:35 -0600
Message-ID<na3v4i$jk3$1@dont-email.me>
In reply to#399258
Jan Panteltje wrote:
>
>>> Yep, 2$ PIC can do all that.
>>>
>>
>> But that's so *LAZY* :)
>
> It is called 'efficiency'.
> :-)
>
> PS did you know PIC has 2 hardware comparators

Yes. We'd used one of them on some really small PIC16
for power/reset management of the main processor in a former
life. Nicely boring, but the thing sure worked.

> and a FF?

Wot's an FF?

> I use those comparators a a lot.
>

I've trolled through this a bit:
http://ww1.microchip.com/downloads/en/DeviceDoc/41215C.pdf

My favorites are the capacitive voltage doubler and the
delta-sigma ADC.

-- 
Les Cargill

[toc] | [prev] | [next] | [standalone]


#399277

FromJan Panteltje <pNaOnStPeAlMtje@yahoo.com>
Date2016-02-18 10:13 +0000
Message-ID<na45fp$4jp$1@news.datemas.de>
In reply to#399259
On a sunny day (Thu, 18 Feb 2016 02:35:40 -0600) it happened Les Cargill
<lcargill99@comcast.com> wrote in <na3v4i$jk3$1@dont-email.me>:

>I've trolled through this a bit:
>http://ww1.microchip.com/downloads/en/DeviceDoc/41215C.pdf
>
>My favorites are the capacitive voltage doubler and the
>delta-sigma ADC.

Nice document.
I never did the comparator delta-sigma in PIC, tried it on a FPGA input... then bought a real ADC for that.
but I did voltage doubling by using a Villard circuit on the clock output pin (need to enable that).

Funny, they even give a comparator PWM example :-)

For a continuous variable frequency source the comparators can be used.
PWM done in the internal hardware PWW generator.

But 'continuous' has little meaning without specifying the granularity,
in a universe where physics claims Planck size etc Planck time ;-)
So maybe using the counter controlled by an ADC that reads an input pin would give fine enough frequency control.
For even finer you can defeat Planck ( :-) )by heating the chip to control the frequency.

There is an application note to use the watchdog oscillator as temp sensor,
I did it here:
 http://panteltje.com/panteltje/pic/temp_pic/index.html

I have used that comparator as analog TV sync separator, current limit detection via a current transformer for a MOSFET
output stage, GM pulse detector, etc etc, basically everywhere where you need to 'immediately' switch something.
The comparator allows you to terminate an ongoing PWM pulse in progress in hardware.
Cool.
And all the 4 phases are supported in that PIC module too.

[toc] | [prev] | [next] | [standalone]


#399332

FromLes Cargill <lcargill99@comcast.com>
Date2016-02-18 12:37 -0600
Message-ID<na52dg$tq5$1@dont-email.me>
In reply to#399277
Jan Panteltje wrote:
> On a sunny day (Thu, 18 Feb 2016 02:35:40 -0600) it happened Les Cargill
> <lcargill99@comcast.com> wrote in <na3v4i$jk3$1@dont-email.me>:
>
>> I've trolled through this a bit:
>> http://ww1.microchip.com/downloads/en/DeviceDoc/41215C.pdf
>>
>> My favorites are the capacitive voltage doubler and the
>> delta-sigma ADC.
>
> Nice document.
> I never did the comparator delta-sigma in PIC, tried it on a FPGA input... then bought a real ADC for that.
> but I did voltage doubling by using a Villard circuit on the clock output pin (need to enable that).
>
> Funny, they even give a comparator PWM example :-)
>

Yeah, saw that.

> For a continuous variable frequency source the comparators can be used.
> PWM done in the internal hardware PWW generator.
>
> But 'continuous' has little meaning without specifying the granularity,
> in a universe where physics claims Planck size etc Planck time ;-)
> So maybe using the counter controlled by an ADC that reads an input pin would give fine enough frequency control.
> For even finer you can defeat Planck ( :-) )by heating the chip to control the frequency.
>
> There is an application note to use the watchdog oscillator as temp sensor,
> I did it here:
>   http://panteltje.com/panteltje/pic/temp_pic/index.html
>

Heh. Nice.

> I have used that comparator as analog TV sync separator, current limit detection via a current transformer for a MOSFET
> output stage, GM pulse detector, etc etc, basically everywhere where you need to 'immediately' switch something.
> The comparator allows you to terminate an ongoing PWM pulse in progress in hardware.
> Cool.
> And all the 4 phases are supported in that PIC module too.
>
>

-- 
Les Cargill

[toc] | [prev] | [next] | [standalone]


#399172

Frompiglet <erichpwagner@hotmail.com>
Date2016-02-17 10:56 +0000
Message-ID<na1jf5$b59$1@dont-email.me>
In reply to#399121
On 16/02/2016 19:56, Tim Williams wrote:
> It finally occurred to me, I've been using these things for so long, yet
> never built my own.  And therefore, never fully understood nor trusted
> what the documentation says (or hides!).
>
> So here's the challenge:
>
> Design a phase shift PWM controller.
>
> Example applications:
> Full bridge forward converter (SMPS, UPS, motor control, etc.)
> Frequency-locked, resonant systems (resonant SMPS, induction heating): PWM
> provides linear, continuous power control, independent of frequency.
>
> Requirements:
> - Constant 50% +/- 3% duty cycle per output (complementary outputs with
> dead time for full bridge gate driving are easily added on)
> - Variable frequency, using a control voltage/current, or single variable
> resistor (duty cycle and phase shift remain ~constant)
> - Variable phase shift, from a control voltage input
> - Phase shift adjustable from 0-180 degrees or more (or 180-360, same
> thing)
> - Must use continuous-time methods, not sampled/divided.  (Or, ENOB > 12,
> which will rule out most digital methods for rather modest output
> frequencies anyway.)
> - Uses discrete transistors, comparators, logic gates (no more than MSI),
> that sort of thing.  ("Transistors" includes the hollow FET kinds, if you
> like.)
>
> Homework:
> The basic prototype is an astable multivibrator (makes 50% duty cycle
> reference clock), followed by a delay and ramp circuit.  The tricky parts
> are:
> - The multivibrator has to be timed from the same global (frequency
> control) bias current (e.g., using a current steering triangle-wave
> oscillator, like you'd find in an analog function generator)
> - Essentially, an oscilloscope's triggered sweep circuit is required for
> the delay generator.  Multivibrator triggers it on rising edge; cap
> charges for almost the whole cycle time (again, charged by the global bias
> current), making a sawtooth wave; comparator picks a point along that
> ramp, thus implementing the delay.
> - Thus, delay is adjustable anywhere along the sawtooth ramp, which might
> be, say, 10-350 degrees.  It can't go quite to zero due to delay (which
> could be subtracted out by delaying the original clock source), and can't
> quite go to 360 because of reset time and trigger window.
> - To square up the output, a 50% duty cycle generator is needed, which can
> be: injection locked multivibrator (otherwise matched to the clock
> multivibrator); or another triggered delay generator with the required
> slope; or:
> - Or instead of using a triggered sweep for the delay generator, the clock
> multivibrator can be a sawtooth type.  Use one comparator to bisect the
> sawtooth, yielding the non-delayed 50% output.  Use another comparator to
> generate the delayed trigger (the multivibrator slope sets range).  A
> triggered delay generator is still required, to produce the delayed 50%
> duty output.
> - Symmetry bonus: you can start with a clock pulse, and run two triggered
> delay generators, where one delay control voltage is inverse of the other.
> Each one only needs 90 degrees of adjustable range.  This probably incurs
> more hardware than the lopsided-phase version, though.
>
> Possibly useful: 50% duty can be obtained by dividing a square wave in
> half (type T flip-flop), without having to match capacitors.  But half the
> frequency means twice the phase shift, and if the flip-flops ever end up
> out of sync, phase suddenly inverts.  May be tricky to use.
>
> The basic breadboarding of this ("RTA level") description used an LM339,
> 5/6ths CD40106, 1/2 CD4013, and five transistors (true, I could've better
> squared up an edge using /Seven Transistors/..).  On a good old fashioned
> solderless breadboard, that's a full row of stuff.  Very messy!
>
> So if I've captured your fancy at all... Simplify it, if you think you
> can!  ;-)
>
> (Special note to you in the monolithic peanut-gallery: yes, I know you can
> make all of this, and more, in a tiny 1mm chip.  Unless you have one
> available that can be bought for less than the parts listed above, STFU.
> :-P )
>
> Tim
>


Here is the way I'd start doing it using jelly-bean parts:

<https://www.dropbox.com/s/37htfm6qdv6gobi/TimWilliamsChallengeFeb16.pdf>

I haven't included the deadtime/overlap requirement which if only a few 
00's ns could be RCD delays in the gate drivers. The frequency can be 
tuned by one resistor. Duty cycle is 50% guaranteed by flip-flops.

With more thought I might cross-couple the flip-flops to prevent the 
phase flip-over risk you mention. Not yet sure this even works! but 
looks easy enough to spice or breadboard.

How did you do it?

piglet



[toc] | [prev] | [next] | [standalone]


#399190

From"Tim Williams" <tiwill@seventransistorlabs.com>
Date2016-02-17 10:43 -0600
Message-ID<na27pv$4bu$1@dont-email.me>
In reply to#399172
"piglet"  wrote in message news:na1jf5$b59$1@dont-email.me...
>Here is the way I'd start doing it using jelly-bean parts:
>
><https://www.dropbox.com/s/37htfm6qdv6gobi/TimWilliamsChallengeFeb16.pdf>
>
>I haven't included the deadtime/overlap requirement which if only a few 
>00's ns could be RCD delays in the gate drivers. The frequency can be 
>tuned by one resistor. Duty cycle is 50% guaranteed by flip-flops.
>
>With more thought I might cross-couple the flip-flops to prevent the 
>phase flip-over risk you mention. Not yet sure this even works! but looks 
>easy enough to spice or breadboard.
>
>How did you do it?

Hmm, delay comparator only covers half a wave at the initial clock, so 1/4 
wave at the output, no?  In other words, only about 90 degrees of range, 
not 180?

My first attempt did:
Sawtooth osc
Comparator (sawtooth + fixed threshold) for 50% duty (non-delayed output)
Comparator (sawtooth + adj threshold) for adjustable delay (say 10-350 
degrees)
Triggered ramp generator (aka monostable timer) for 50% duty (delayed 
output).

http://seventransistorlabs.com/Images/PSPWM.png
The crossed-out part was as-built, then I realized I could skip the 
runt-pulse hack with the D f/f (probably).  Which can be further 
simplified to one R-S f/f and a couple gates (the comparator gets 
hysteresis, to serve as the "slave" f/f in the master-slave D structure), 
but it's still kind of a lot of logic, or transistors, however you cut it.

Not very well optimized. Not very well engineered, you might say!

(Oh, and it's not shown with variable frequency, but the current sources 
are equal, so that is easily included, by anyone "skilled in the art" as 
they say.)

Tim

-- 
Seven Transistor Labs, LLC
Electrical Engineering Consultation and Contract Design
Website: http://seventransistorlabs.com 

[toc] | [prev] | [next] | [standalone]


#399199

Frompiglet <erichpwagner@hotmail.com>
Date2016-02-17 18:33 +0000
Message-ID<na2e88$c7$1@dont-email.me>
In reply to#399190
On 17/02/2016 16:43, Tim Williams wrote:
>
> Hmm, delay comparator only covers half a wave at the initial clock, so 1/4
> wave at the output, no?  In other words, only about 90 degrees of range,
> not 180?
>

No, I think mine might work. At -ve Verr the outputs are tending to be 
in-phase, at 0v Verr the outputs are 50% out of phase (or 90deg phase 
shift if you prefer) and at +ve Verr the outputs are tending to be in 
anti-phase (or 180deg shift)?

I think because the flip flop divide-by-two applys to both channels the 
phase is preserved, or have I blundered?

Might have a go at analysis or LT Spice later.

Thanks for showing me your circuit, will need to study it.

piglet

[toc] | [prev] | [next] | [standalone]


#399266

Frompiglet <erichpwagner@hotmail.com>
Date2016-02-18 08:54 +0000
Message-ID<na40n0$ns8$1@dont-email.me>
In reply to#399190
On 17/02/2016 16:43, Tim Williams wrote:
>
> Hmm, delay comparator only covers half a wave at the initial clock, so 1/4
> wave at the output, no?  In other words, only about 90 degrees of range,
> not 180?
>

Dang! You are right Tim. I have blundered, my sketch does not cover the 
full 0-180deg range as I thought - another coffee-time wasted.

piglet

[toc] | [prev] | [next] | [standalone]


#399291

Frompiglet <erichpwagner@hotmail.com>
Date2016-02-18 13:38 +0000
Message-ID<na4hbk$m0f$1@dont-email.me>
In reply to#399266
On 18/02/2016 08:54, piglet wrote:
> On 17/02/2016 16:43, Tim Williams wrote:
>>
>> Hmm, delay comparator only covers half a wave at the initial clock, so
>> 1/4
>> wave at the output, no?  In other words, only about 90 degrees of range,
>> not 180?
>>
>
> Dang! You are right Tim. I have blundered, my sketch does not cover the
> full 0-180deg range as I thought - another coffee-time wasted.
>
> piglet
>

This one may work, uses one more stock comparator and op-amp but retains 
all timing derived from one ramp. It loses the guaranteed 50% duty cycle 
outputs. S-R flip-flop is a bit clunky but shows the principles, 
something edge triggered would be better?


Version 4
SHEET 1 1268 960
WIRE -512 -304 -512 -336
WIRE -400 -304 -512 -304
WIRE 448 -288 272 -320
WIRE 448 -288 -224 -288
WIRE 816 -288 448 -288
WIRE 928 -288 960 -304
WIRE 928 -288 880 -288
WIRE -512 -240 -512 -304
WIRE -64 -192 -96 -192
WIRE 144 -192 80 -208
WIRE 144 -192 0 -192
WIRE 432 -192 432 -208
WIRE 544 -192 432 -192
WIRE 544 -160 544 -192
WIRE -512 -128 -512 -160
WIRE -400 -128 -512 -128
WIRE 432 -112 432 -192
WIRE -400 -96 -400 -128
WIRE -512 -80 -512 -128
WIRE 400 -80 224 -80
WIRE 544 -64 544 -80
WIRE 544 -64 480 -64
WIRE 624 -64 544 -64
WIRE 720 -64 688 -64
WIRE 816 -64 720 -64
WIRE 928 -64 976 -80
WIRE 928 -64 912 -64
WIRE 144 -48 144 -192
WIRE 320 -48 144 -48
WIRE 400 -48 320 -48
WIRE 720 -48 720 -64
WIRE -32 -16 -32 -32
WIRE 816 -16 784 -16
WIRE -224 0 -224 -288
WIRE -208 0 -224 0
WIRE -96 0 -96 -192
WIRE -96 0 -128 0
WIRE -64 0 -96 0
WIRE 144 16 144 -48
WIRE 144 16 0 16
WIRE 416 16 416 -16
WIRE 416 16 384 16
WIRE -64 32 -112 32
WIRE 432 32 432 -16
WIRE 528 32 528 16
WIRE 608 32 528 32
WIRE 384 48 384 16
WIRE 608 48 608 32
WIRE -112 64 -112 32
WIRE 720 64 720 32
WIRE -32 80 -32 48
WIRE 144 80 144 16
WIRE 528 112 528 32
WIRE 320 144 320 -48
WIRE 496 144 320 144
WIRE 608 160 608 128
WIRE 608 160 576 160
WIRE 672 160 608 160
WIRE 784 160 784 -16
WIRE 784 160 736 160
WIRE 496 176 464 176
WIRE -224 192 -224 0
WIRE -176 192 -224 192
WIRE 144 192 144 160
WIRE 144 192 -96 192
WIRE 784 192 784 160
WIRE -512 208 -512 0
WIRE -416 208 -416 176
WIRE -416 208 -512 208
WIRE 512 224 512 208
WIRE 512 224 496 224
WIRE 528 240 528 208
WIRE 16 256 16 240
WIRE 16 256 -128 256
WIRE 496 256 496 224
WIRE -128 272 -128 256
WIRE 368 272 336 272
WIRE 464 272 464 176
WIRE 464 272 448 272
WIRE 96 288 64 288
WIRE 784 304 784 272
WIRE 16 320 16 256
WIRE 96 320 96 288
WIRE 64 352 64 288
WIRE 64 352 48 352
WIRE -224 368 -224 192
WIRE -128 368 -128 352
WIRE -128 368 -224 368
WIRE -32 368 -128 368
WIRE 144 384 144 192
WIRE 144 384 48 384
WIRE 400 384 400 368
WIRE 224 400 224 -80
WIRE 240 400 224 400
WIRE 336 400 336 272
WIRE 336 400 320 400
WIRE 368 400 336 400
WIRE 464 416 464 272
WIRE 464 416 432 416
WIRE 528 416 592 400
WIRE 528 416 464 416
WIRE 368 432 336 432
WIRE 16 448 16 416
WIRE 32 448 32 416
WIRE 32 448 16 448
WIRE 224 464 224 400
WIRE 224 464 144 448
WIRE 336 464 336 432
WIRE -16 496 -16 480
WIRE 16 496 16 448
WIRE 16 496 -16 496
WIRE 224 496 224 464
WIRE 400 496 400 448
WIRE 400 512 400 496
WIRE 224 608 224 576
FLAG 384 48 0
FLAG -112 64 0
FLAG 432 32 6N
FLAG 432 -208 6P
FLAG -32 -32 6P
FLAG -32 80 6N
FLAG -16 480 6N
FLAG 16 240 6P
FLAG -400 -96 0
FLAG -512 -336 6P
FLAG -416 176 6N
FLAG -416 272 0
FLAG 224 608 0
FLAG 96 320 0
FLAG -400 -240 0
FLAG 80 -208 TRIWAVE
FLAG 272 -320 SQWAVE
FLAG 144 448 VCONTROL
FLAG 976 -80 OUT-B
FLAG 960 -304 OUT-A
FLAG 400 368 6P
FLAG 400 496 6N
FLAG 336 464 0
FLAG 528 240 6N
FLAG 528 16 6P
FLAG 496 256 0
FLAG 784 304 0
FLAG 720 64 0
FLAG 592 400 INV-VCONTROL
SYMBOL Comparators\\LT1011 16 368 M0
SYMATTR InstName U1
SYMBOL Comparators\\LT1011 432 -64 R0
SYMATTR InstName U2
SYMBOL Opamps\\LT1007 -32 -48 R0
SYMATTR InstName U3
SYMBOL cap 0 -208 R90
WINDOW 0 0 32 VBottom 2
WINDOW 3 32 32 VTop 2
SYMATTR InstName C1
SYMATTR Value 200p
SYMBOL res -112 -16 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R1
SYMATTR Value 100k
SYMBOL res -144 256 R0
SYMATTR InstName R2
SYMATTR Value 1k
SYMBOL res 528 -176 R0
SYMATTR InstName R3
SYMATTR Value 1k
SYMBOL voltage -512 -256 R0
WINDOW 123 0 0 Left 2
WINDOW 39 0 0 Left 2
SYMATTR InstName V1
SYMATTR Value PULSE(0 6 10u 10u)
SYMBOL voltage -512 -96 R0
WINDOW 123 0 0 Left 2
WINDOW 39 0 0 Left 2
SYMATTR InstName V2
SYMATTR Value PULSE(0 6 10u 10u)
SYMBOL voltage 224 480 R0
WINDOW 123 0 0 Left 2
WINDOW 39 0 0 Left 2
SYMATTR InstName V3
SYMATTR Value PULSE(-2 2 250u 1m)
SYMBOL cap -432 208 R0
SYMATTR InstName C2
SYMATTR Value 100n
SYMBOL cap -416 -304 R0
SYMATTR InstName C3
SYMATTR Value 100n
SYMBOL res -192 208 R270
WINDOW 0 32 56 VTop 2
WINDOW 3 0 56 VBottom 2
SYMATTR InstName R4
SYMATTR Value 100k
SYMBOL res 160 176 R180
WINDOW 0 36 76 Left 2
WINDOW 3 36 40 Left 2
SYMATTR InstName R5
SYMATTR Value 35k
SYMBOL Digital\\inv 816 -352 R0
SYMATTR InstName A3
SYMBOL Opamps\\LT1007 400 352 R0
SYMATTR InstName U4
SYMBOL res 336 384 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R6
SYMATTR Value 10k
SYMBOL res 464 256 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R7
SYMATTR Value 10k
SYMBOL Comparators\\LT1011 528 160 R0
SYMATTR InstName U5
SYMBOL res 592 32 R0
SYMATTR InstName R8
SYMATTR Value 1k
SYMBOL res 704 -64 R0
SYMATTR InstName R9
SYMATTR Value 1k
SYMBOL res 768 176 R0
SYMATTR InstName R10
SYMATTR Value 1k
SYMBOL cap 736 144 R90
WINDOW 0 0 32 VBottom 2
WINDOW 3 32 32 VTop 2
SYMATTR InstName C5
SYMATTR Value 20p
SYMBOL Digital\\srflop 864 -112 R0
SYMATTR InstName A1
SYMBOL cap 688 -80 R90
WINDOW 0 0 32 VBottom 2
WINDOW 3 32 32 VTop 2
SYMATTR InstName C4
SYMATTR Value 20p
TEXT -544 584 Left 2 !.tran 1.5m
TEXT 648 504 Left 2 ;Phase Shift Modulator
TEXT 648 560 Left 2 ;EPW FEB 2016
TEXT 648 448 Left 2 ;SED Tim Williams Challenge

piglet

[toc] | [prev] | [next] | [standalone]


#399316

From"Tim Williams" <tiwill@seventransistorlabs.com>
Date2016-02-18 10:55 -0600
Message-ID<na4sss$4q1$1@dont-email.me>
In reply to#399291
"piglet"  wrote in message news:na4hbk$m0f$1@dont-email.me...
> This one may work, uses one more stock comparator and op-amp but retains 
> all timing derived from one ramp. It loses the guaranteed 50% duty cycle 
> outputs. S-R flip-flop is a bit clunky but shows the principles, 
> something edge triggered would be better?

That's a good one.

Crappy part is, a double-clocked F/F doesn't exist.  Not that it's not 
possible, but nobody has one handy as a stand-alone chip, and no HDL 
synthesizer will allow it (naively, anyway).  You can write one manually 
from the combinatorial parts, but that'll just synthesize to multiple LUTs 
with delay as bad as doing it discrete.  (Discrete uses e.g. 8 x NOR, by 
the way.)

There's a phase detector that does this, but I don't think it's available 
in the *4046 flavors, not that you'd need the extra stuff that comes with, 
anyway.

Unless there's a way to use that stuff to your advantage...

Tim

-- 
Seven Transistor Labs, LLC
Electrical Engineering Consultation and Contract Design
Website: http://seventransistorlabs.com 

[toc] | [prev] | [next] | [standalone]


#399318

Frompiglet <erichpwagner@hotmail.com>
Date2016-02-18 17:01 +0000
Message-ID<na4t7m$661$1@dont-email.me>
In reply to#399316
On 18/02/2016 16:55, Tim Williams wrote:
> "piglet"  wrote in message news:na4hbk$m0f$1@dont-email.me...
>> This one may work, uses one more stock comparator and op-amp but retains
>> all timing derived from one ramp. It loses the guaranteed 50% duty cycle
>> outputs. S-R flip-flop is a bit clunky but shows the principles,
>> something edge triggered would be better?
>
> That's a good one.
>
> Crappy part is, a double-clocked F/F doesn't exist.  Not that it's not
> possible, but nobody has one handy as a stand-alone chip, and no HDL
> synthesizer will allow it (naively, anyway).  You can write one manually
> from the combinatorial parts, but that'll just synthesize to multiple LUTs
> with delay as bad as doing it discrete.  (Discrete uses e.g. 8 x NOR, by
> the way.)
>
> There's a phase detector that does this, but I don't think it's available
> in the *4046 flavors, not that you'd need the extra stuff that comes with,
> anyway.
>
> Unless there's a way to use that stuff to your advantage...
>
> Tim
>

Thanks, Tim.

I wonder if using two F/Fs, one for each edge would do ... hmm.

piglet

[toc] | [prev] | [next] | [standalone]


#399322

From"Tim Williams" <tiwill@seventransistorlabs.com>
Date2016-02-18 11:20 -0600
Message-ID<na4ubi$aui$1@dont-email.me>
In reply to#399318
"piglet"  wrote in message news:na4t7m$661$1@dont-email.me...
> I wonder if using two F/Fs, one for each edge would do ... hmm.

That's the most commonly shown version of it -- but you still need an AND 
gate to reset them, and a third (RS at least) to hold the result.

I can't find a complete circuit (and damned if I knew the name, if the 
configuration even has a proper name), but it's a one of these
http://analog.intgckts.com/wp-content/uploads/sites/2/2013/11/Phase-Frequency-Detector-Block-Diagram.png
with an R-S on the end, for obvious(?) reasons.

On an unrelated topic, this is neat I guess,
https://asicdigitaldesign.wordpress.com/2007/07/31/the-double-edge-flip-flop/

Tim

-- 
Seven Transistor Labs, LLC
Electrical Engineering Consultation and Contract Design
Website: http://seventransistorlabs.com 

[toc] | [prev] | [next] | [standalone]


#399326

Frompiglet <erichpwagner@hotmail.com>
Date2016-02-18 17:39 +0000
Message-ID<na4vff$fnu$1@dont-email.me>
In reply to#399322
On 18/02/2016 17:20, Tim Williams wrote:
> "piglet"  wrote in message news:na4t7m$661$1@dont-email.me...
>> I wonder if using two F/Fs, one for each edge would do ... hmm.
>
> That's the most commonly shown version of it -- but you still need an AND
> gate to reset them, and a third (RS at least) to hold the result.
>
> I can't find a complete circuit (and damned if I knew the name, if the
> configuration even has a proper name), but it's a one of these
> http://analog.intgckts.com/wp-content/uploads/sites/2/2013/11/Phase-Frequency-Detector-Block-Diagram.png
> with an R-S on the end, for obvious(?) reasons.


Yeah, thanks. I was stumbling towards something like that.


>
> On an unrelated topic, this is neat I guess,
> https://asicdigitaldesign.wordpress.com/2007/07/31/the-double-edge-flip-flop/
>

Wow, that makes my brain hurt!

piglet

[toc] | [prev] | [next] | [standalone]


Page 1 of 2  [1] 2  Next page →

Back to top | Article view | sci.electronics.design


csiph-web