Driver to drive?

Tim Wescott wrote:
On Sun, 14 Jul 2013 08:19:09 -0700, Joerg wrote:

Bill Sloman wrote:
On Sunday, 14 July 2013 08:35:57 UTC+10, Joerg wrote:
Folks, Has anyone tried this? I have to lock a PLL around 10kHz into a
certai odd phase angle. No problem to do that with a bunch of hardware
like usual. If one were to do that with the PC via a USB sound card,
the PC could measure the phase angle and then adjust a software tone
generator (output via sound card) to always match the phase angle even
if stuff in the outside resonant structure changes. I need the PLL to
follow within 10msec or so. Seems like the 1msec USB latency could get
in the way. Or is there a trick to circumvent that? Since sound chips
have frequency responses up to 22kHZ and rarely hiccup I could imagine
there is a way.
If the oscillator in the phase-locked loop were a DDS chip, where you
can manipulate both phase and frequency digitally, it could be
reasonably straightforward. The messy bit is that it is going to take
your sound card an appreciable time to accumulate enough data on the
oscillator to which you are locking and the oscillator that you are
trying to lock, to let you calculate your frequency correction, so you
probably have to get the frequency pretty much exactly right before you
can start fiddling with the phase - as long as the frequencies aren't
locked, the desired phase correction will drift with time, and if you
don't know precisely when the USB link will dump the phase correction
into the DDS chip, you won't be able to get it exactly right.

But you should be able to get close enough for all practical purposes
pretty rapidly. As in the old engineer/physicist joke.

I would do this differently, not via sound card. The oscillator can be
controlled via direct register write into a FTDI-sumpthin' chip, and the
phase error can be read back the same way. The plant response is a bit
sluggish, a few hundred Hz bandwidth. Control response needed to get the
PLL to within a few Hertz can be 10-20msec.

It's all doable, I just don't know whether the USB link will hold up.

Use a microprocessor that talks to the Windows machine via USB, and
implements the PLL?

Yeah, I've looked at the Cypress PSoC for that. The bigger ones can do
it without redlining. Probably some others as well. But I'd need someone
to do the uC coding, that's really not my turf.

Another option would be to use the 4046 as Whit3rd mentioned. But this
would need to be heavily filtered to make a nice sine, or followed by a
DDS module where the 4046 acts as a reference. Also, the XOR results in
a frequency-dependent phase error which I can't have. So I'd have to
plop a PID between that and the VCO to get rid of the phase error.
Possible, but gets busy. However, someone wrote that one don't need no
Ph.D. for a PID :)

--
Regards, Joerg

http://www.analogconsultants.com/
 
On Mon, 15 Jul 2013 14:11:34 -0700, Joerg wrote:

Tim Wescott wrote:
On Sun, 14 Jul 2013 08:19:09 -0700, Joerg wrote:

Bill Sloman wrote:
On Sunday, 14 July 2013 08:35:57 UTC+10, Joerg wrote:
Folks, Has anyone tried this? I have to lock a PLL around 10kHz into
a certai odd phase angle. No problem to do that with a bunch of
hardware like usual. If one were to do that with the PC via a USB
sound card, the PC could measure the phase angle and then adjust a
software tone generator (output via sound card) to always match the
phase angle even if stuff in the outside resonant structure changes.
I need the PLL to follow within 10msec or so. Seems like the 1msec
USB latency could get in the way. Or is there a trick to circumvent
that? Since sound chips have frequency responses up to 22kHZ and
rarely hiccup I could imagine there is a way.
If the oscillator in the phase-locked loop were a DDS chip, where you
can manipulate both phase and frequency digitally, it could be
reasonably straightforward. The messy bit is that it is going to take
your sound card an appreciable time to accumulate enough data on the
oscillator to which you are locking and the oscillator that you are
trying to lock, to let you calculate your frequency correction, so
you probably have to get the frequency pretty much exactly right
before you can start fiddling with the phase - as long as the
frequencies aren't locked, the desired phase correction will drift
with time, and if you don't know precisely when the USB link will
dump the phase correction into the DDS chip, you won't be able to get
it exactly right.

But you should be able to get close enough for all practical purposes
pretty rapidly. As in the old engineer/physicist joke.

I would do this differently, not via sound card. The oscillator can be
controlled via direct register write into a FTDI-sumpthin' chip, and
the phase error can be read back the same way. The plant response is a
bit sluggish, a few hundred Hz bandwidth. Control response needed to
get the PLL to within a few Hertz can be 10-20msec.

It's all doable, I just don't know whether the USB link will hold up.

Use a microprocessor that talks to the Windows machine via USB, and
implements the PLL?



Yeah, I've looked at the Cypress PSoC for that. The bigger ones can do
it without redlining. Probably some others as well. But I'd need someone
to do the uC coding, that's really not my turf.

Another option would be to use the 4046 as Whit3rd mentioned. But this
would need to be heavily filtered to make a nice sine, or followed by a
DDS module where the 4046 acts as a reference. Also, the XOR results in
a frequency-dependent phase error which I can't have. So I'd have to
plop a PID between that and the VCO to get rid of the phase error.
Possible, but gets busy. However, someone wrote that one don't need no
Ph.D. for a PID :)
Getting a clean all-analog solution certainly seems harder than a clean
solution built around a micro. It sounds like you need a fairly clean
sine wave, though, which means that any solution with a microprocessor in
the middle would have to have a nice DAC, and probably filtering and
buffering.

Lessee -- FTDI chip, 4046, op-amp, DDS and filter or honkin' big filter
-- eww, it's getting ugly, isn't it?

It's too bad there aren't any really clean ways to build a sine-wave
oscillator at that frequency. Then it'd be FTDI chip, 1-gate XOR, loop
filter, Wien-bridge oscillator, done...

--

Tim Wescott
Wescott Design Services
http://www.wescottdesign.com
 
Tim Wescott wrote:
On Mon, 15 Jul 2013 14:11:34 -0700, Joerg wrote:

Tim Wescott wrote:
On Sun, 14 Jul 2013 08:19:09 -0700, Joerg wrote:

Bill Sloman wrote:
On Sunday, 14 July 2013 08:35:57 UTC+10, Joerg wrote:
Folks, Has anyone tried this? I have to lock a PLL around 10kHz into
a certai odd phase angle. No problem to do that with a bunch of
hardware like usual. If one were to do that with the PC via a USB
sound card, the PC could measure the phase angle and then adjust a
software tone generator (output via sound card) to always match the
phase angle even if stuff in the outside resonant structure changes.
I need the PLL to follow within 10msec or so. Seems like the 1msec
USB latency could get in the way. Or is there a trick to circumvent
that? Since sound chips have frequency responses up to 22kHZ and
rarely hiccup I could imagine there is a way.
If the oscillator in the phase-locked loop were a DDS chip, where you
can manipulate both phase and frequency digitally, it could be
reasonably straightforward. The messy bit is that it is going to take
your sound card an appreciable time to accumulate enough data on the
oscillator to which you are locking and the oscillator that you are
trying to lock, to let you calculate your frequency correction, so
you probably have to get the frequency pretty much exactly right
before you can start fiddling with the phase - as long as the
frequencies aren't locked, the desired phase correction will drift
with time, and if you don't know precisely when the USB link will
dump the phase correction into the DDS chip, you won't be able to get
it exactly right.

But you should be able to get close enough for all practical purposes
pretty rapidly. As in the old engineer/physicist joke.
I would do this differently, not via sound card. The oscillator can be
controlled via direct register write into a FTDI-sumpthin' chip, and
the phase error can be read back the same way. The plant response is a
bit sluggish, a few hundred Hz bandwidth. Control response needed to
get the PLL to within a few Hertz can be 10-20msec.

It's all doable, I just don't know whether the USB link will hold up.
Use a microprocessor that talks to the Windows machine via USB, and
implements the PLL?


Yeah, I've looked at the Cypress PSoC for that. The bigger ones can do
it without redlining. Probably some others as well. But I'd need someone
to do the uC coding, that's really not my turf.

Another option would be to use the 4046 as Whit3rd mentioned. But this
would need to be heavily filtered to make a nice sine, or followed by a
DDS module where the 4046 acts as a reference. Also, the XOR results in
a frequency-dependent phase error which I can't have. So I'd have to
plop a PID between that and the VCO to get rid of the phase error.
Possible, but gets busy. However, someone wrote that one don't need no
Ph.D. for a PID :)

Getting a clean all-analog solution certainly seems harder than a clean
solution built around a micro. It sounds like you need a fairly clean
sine wave, though, which means that any solution with a microprocessor in
the middle would have to have a nice DAC, and probably filtering and
buffering.
The uC would be breaking a sweat. In order to obtain a clean sine wave
at 10kHz it has to either pump data into a port with lots of R2R at more
than 1MHz or pump the data into a DAC at the same clip. The data could
either come from a 1/4-cycle LUT (gets pretty big) or be calculated
on-the-fly (even more sweat beads). Then it has to handle all the loop
response stuff, some USB, some housekeeping.

PWM-ing it could be a stretch at 10kHz.


Lessee -- FTDI chip, 4046, op-amp, DDS and filter or honkin' big filter
-- eww, it's getting ugly, isn't it?
In SMT, not really. And it gets me out of having to program a uC,
although I can certainly find someone to do that.


It's too bad there aren't any really clean ways to build a sine-wave
oscillator at that frequency. Then it'd be FTDI chip, 1-gate XOR, loop
filter, Wien-bridge oscillator, done...
Plus an opamp for the PID. Can't do it with XOR alone because that
results in a frequency-dependent phase error.

It's a pity that all the sinewave oscillators such as XR2206 and ICL8038
have been obsoleted. Those could easily be FM-modulated, something that
is a real hassle with DDS chips.

--
Regards, Joerg

http://www.analogconsultants.com/
 
On 07/16/2013 12:19 PM, Joerg wrote:
Tim Wescott wrote:
On Mon, 15 Jul 2013 14:11:34 -0700, Joerg wrote:

Tim Wescott wrote:
On Sun, 14 Jul 2013 08:19:09 -0700, Joerg wrote:

Bill Sloman wrote:
On Sunday, 14 July 2013 08:35:57 UTC+10, Joerg wrote:
Folks, Has anyone tried this? I have to lock a PLL around 10kHz into
a certai odd phase angle. No problem to do that with a bunch of
hardware like usual. If one were to do that with the PC via a USB
sound card, the PC could measure the phase angle and then adjust a
software tone generator (output via sound card) to always match the
phase angle even if stuff in the outside resonant structure changes.
I need the PLL to follow within 10msec or so. Seems like the 1msec
USB latency could get in the way. Or is there a trick to circumvent
that? Since sound chips have frequency responses up to 22kHZ and
rarely hiccup I could imagine there is a way.
If the oscillator in the phase-locked loop were a DDS chip, where you
can manipulate both phase and frequency digitally, it could be
reasonably straightforward. The messy bit is that it is going to take
your sound card an appreciable time to accumulate enough data on the
oscillator to which you are locking and the oscillator that you are
trying to lock, to let you calculate your frequency correction, so
you probably have to get the frequency pretty much exactly right
before you can start fiddling with the phase - as long as the
frequencies aren't locked, the desired phase correction will drift
with time, and if you don't know precisely when the USB link will
dump the phase correction into the DDS chip, you won't be able to get
it exactly right.

But you should be able to get close enough for all practical purposes
pretty rapidly. As in the old engineer/physicist joke.
I would do this differently, not via sound card. The oscillator can be
controlled via direct register write into a FTDI-sumpthin' chip, and
the phase error can be read back the same way. The plant response is a
bit sluggish, a few hundred Hz bandwidth. Control response needed to
get the PLL to within a few Hertz can be 10-20msec.

It's all doable, I just don't know whether the USB link will hold up.
Use a microprocessor that talks to the Windows machine via USB, and
implements the PLL?


Yeah, I've looked at the Cypress PSoC for that. The bigger ones can do
it without redlining. Probably some others as well. But I'd need someone
to do the uC coding, that's really not my turf.

Another option would be to use the 4046 as Whit3rd mentioned. But this
would need to be heavily filtered to make a nice sine, or followed by a
DDS module where the 4046 acts as a reference. Also, the XOR results in
a frequency-dependent phase error which I can't have. So I'd have to
plop a PID between that and the VCO to get rid of the phase error.
Possible, but gets busy. However, someone wrote that one don't need no
Ph.D. for a PID :)

Getting a clean all-analog solution certainly seems harder than a clean
solution built around a micro. It sounds like you need a fairly clean
sine wave, though, which means that any solution with a microprocessor in
the middle would have to have a nice DAC, and probably filtering and
buffering.


The uC would be breaking a sweat. In order to obtain a clean sine wave
at 10kHz it has to either pump data into a port with lots of R2R at more
than 1MHz or pump the data into a DAC at the same clip. The data could
either come from a 1/4-cycle LUT (gets pretty big) or be calculated
on-the-fly (even more sweat beads). Then it has to handle all the loop
response stuff, some USB, some housekeeping.

PWM-ing it could be a stretch at 10kHz.


Lessee -- FTDI chip, 4046, op-amp, DDS and filter or honkin' big filter
-- eww, it's getting ugly, isn't it?


In SMT, not really. And it gets me out of having to program a uC,
although I can certainly find someone to do that.


It's too bad there aren't any really clean ways to build a sine-wave
oscillator at that frequency. Then it'd be FTDI chip, 1-gate XOR, loop
filter, Wien-bridge oscillator, done...


Plus an opamp for the PID. Can't do it with XOR alone because that
results in a frequency-dependent phase error.

It's a pity that all the sinewave oscillators such as XR2206 and ICL8038
have been obsoleted. Those could easily be FM-modulated, something that
is a real hassle with DDS chips.
Well, there's always the DIY sine wave DAC using a CD4017. That makes
the filtering a lot easier.

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC
Optics, Electro-optics, Photonics, Analog Electronics

160 North State Road #203
Briarcliff Manor NY 10510

hobbs at electrooptical dot net
http://electrooptical.net
 
Phil Hobbs wrote:
On 07/16/2013 12:19 PM, Joerg wrote:
Tim Wescott wrote:
On Mon, 15 Jul 2013 14:11:34 -0700, Joerg wrote:

Tim Wescott wrote:
On Sun, 14 Jul 2013 08:19:09 -0700, Joerg wrote:

Bill Sloman wrote:
On Sunday, 14 July 2013 08:35:57 UTC+10, Joerg wrote:
Folks, Has anyone tried this? I have to lock a PLL around 10kHz
into
a certai odd phase angle. No problem to do that with a bunch of
hardware like usual. If one were to do that with the PC via a USB
sound card, the PC could measure the phase angle and then adjust a
software tone generator (output via sound card) to always match the
phase angle even if stuff in the outside resonant structure
changes.
I need the PLL to follow within 10msec or so. Seems like the 1msec
USB latency could get in the way. Or is there a trick to circumvent
that? Since sound chips have frequency responses up to 22kHZ and
rarely hiccup I could imagine there is a way.
If the oscillator in the phase-locked loop were a DDS chip, where
you
can manipulate both phase and frequency digitally, it could be
reasonably straightforward. The messy bit is that it is going to
take
your sound card an appreciable time to accumulate enough data on the
oscillator to which you are locking and the oscillator that you are
trying to lock, to let you calculate your frequency correction, so
you probably have to get the frequency pretty much exactly right
before you can start fiddling with the phase - as long as the
frequencies aren't locked, the desired phase correction will drift
with time, and if you don't know precisely when the USB link will
dump the phase correction into the DDS chip, you won't be able to
get
it exactly right.

But you should be able to get close enough for all practical
purposes
pretty rapidly. As in the old engineer/physicist joke.
I would do this differently, not via sound card. The oscillator
can be
controlled via direct register write into a FTDI-sumpthin' chip, and
the phase error can be read back the same way. The plant response
is a
bit sluggish, a few hundred Hz bandwidth. Control response needed to
get the PLL to within a few Hertz can be 10-20msec.

It's all doable, I just don't know whether the USB link will hold up.
Use a microprocessor that talks to the Windows machine via USB, and
implements the PLL?


Yeah, I've looked at the Cypress PSoC for that. The bigger ones can do
it without redlining. Probably some others as well. But I'd need
someone
to do the uC coding, that's really not my turf.

Another option would be to use the 4046 as Whit3rd mentioned. But this
would need to be heavily filtered to make a nice sine, or followed by a
DDS module where the 4046 acts as a reference. Also, the XOR results in
a frequency-dependent phase error which I can't have. So I'd have to
plop a PID between that and the VCO to get rid of the phase error.
Possible, but gets busy. However, someone wrote that one don't need no
Ph.D. for a PID :)

Getting a clean all-analog solution certainly seems harder than a clean
solution built around a micro. It sounds like you need a fairly clean
sine wave, though, which means that any solution with a
microprocessor in
the middle would have to have a nice DAC, and probably filtering and
buffering.


The uC would be breaking a sweat. In order to obtain a clean sine wave
at 10kHz it has to either pump data into a port with lots of R2R at more
than 1MHz or pump the data into a DAC at the same clip. The data could
either come from a 1/4-cycle LUT (gets pretty big) or be calculated
on-the-fly (even more sweat beads). Then it has to handle all the loop
response stuff, some USB, some housekeeping.

PWM-ing it could be a stretch at 10kHz.


Lessee -- FTDI chip, 4046, op-amp, DDS and filter or honkin' big filter
-- eww, it's getting ugly, isn't it?


In SMT, not really. And it gets me out of having to program a uC,
although I can certainly find someone to do that.


It's too bad there aren't any really clean ways to build a sine-wave
oscillator at that frequency. Then it'd be FTDI chip, 1-gate XOR, loop
filter, Wien-bridge oscillator, done...


Plus an opamp for the PID. Can't do it with XOR alone because that
results in a frequency-dependent phase error.

It's a pity that all the sinewave oscillators such as XR2206 and ICL8038
have been obsoleted. Those could easily be FM-modulated, something that
is a real hassle with DDS chips.


Well, there's always the DIY sine wave DAC using a CD4017. That makes
the filtering a lot easier.
Sure, but the wee problem will be a lack of granularity when setting the
frequency. Unless I would alter the DFL inside the uC in order to set
the whole master clock to odd numbers, IOW the uC master clock becomes
my VCO. Then chances are that the USB or something else falls apart.

I need a few ten Hoitz of granularity for the VCO frequency. Being more
of an RF guy by trade I am tempted to build a cheapo VCO that oscillates
between the uC clock and 15kHz above it, mix that with the uC clock, and
.... voila. Of course there comes a point where I might just do it all
analog and it won't much extra effort.

--
Regards, Joerg

http://www.analogconsultants.com/
 
On Tue, 16 Jul 2013 09:19:38 -0700, Joerg wrote:

Tim Wescott wrote:
On Mon, 15 Jul 2013 14:11:34 -0700, Joerg wrote:

Tim Wescott wrote:
On Sun, 14 Jul 2013 08:19:09 -0700, Joerg wrote:

Bill Sloman wrote:
On Sunday, 14 July 2013 08:35:57 UTC+10, Joerg wrote:
Folks, Has anyone tried this? I have to lock a PLL around 10kHz
into a certai odd phase angle. No problem to do that with a bunch
of hardware like usual. If one were to do that with the PC via a
USB sound card, the PC could measure the phase angle and then
adjust a software tone generator (output via sound card) to always
match the phase angle even if stuff in the outside resonant
structure changes.
I need the PLL to follow within 10msec or so. Seems like the 1msec
USB latency could get in the way. Or is there a trick to
circumvent that? Since sound chips have frequency responses up to
22kHZ and rarely hiccup I could imagine there is a way.
If the oscillator in the phase-locked loop were a DDS chip, where
you can manipulate both phase and frequency digitally, it could be
reasonably straightforward. The messy bit is that it is going to
take your sound card an appreciable time to accumulate enough data
on the oscillator to which you are locking and the oscillator that
you are trying to lock, to let you calculate your frequency
correction, so you probably have to get the frequency pretty much
exactly right before you can start fiddling with the phase - as
long as the frequencies aren't locked, the desired phase correction
will drift with time, and if you don't know precisely when the USB
link will dump the phase correction into the DDS chip, you won't be
able to get it exactly right.

But you should be able to get close enough for all practical
purposes pretty rapidly. As in the old engineer/physicist joke.
I would do this differently, not via sound card. The oscillator can
be controlled via direct register write into a FTDI-sumpthin' chip,
and the phase error can be read back the same way. The plant
response is a bit sluggish, a few hundred Hz bandwidth. Control
response needed to get the PLL to within a few Hertz can be
10-20msec.

It's all doable, I just don't know whether the USB link will hold
up.
Use a microprocessor that talks to the Windows machine via USB, and
implements the PLL?


Yeah, I've looked at the Cypress PSoC for that. The bigger ones can do
it without redlining. Probably some others as well. But I'd need
someone to do the uC coding, that's really not my turf.

Another option would be to use the 4046 as Whit3rd mentioned. But this
would need to be heavily filtered to make a nice sine, or followed by
a DDS module where the 4046 acts as a reference. Also, the XOR results
in a frequency-dependent phase error which I can't have. So I'd have
to plop a PID between that and the VCO to get rid of the phase error.
Possible, but gets busy. However, someone wrote that one don't need no
Ph.D. for a PID :)

Getting a clean all-analog solution certainly seems harder than a clean
solution built around a micro. It sounds like you need a fairly clean
sine wave, though, which means that any solution with a microprocessor
in the middle would have to have a nice DAC, and probably filtering and
buffering.


The uC would be breaking a sweat. In order to obtain a clean sine wave
at 10kHz it has to either pump data into a port with lots of R2R at more
than 1MHz or pump the data into a DAC at the same clip. The data could
either come from a 1/4-cycle LUT (gets pretty big) or be calculated
on-the-fly (even more sweat beads). Then it has to handle all the loop
response stuff, some USB, some housekeeping.

PWM-ing it could be a stretch at 10kHz.
I'm not sure I agree with your more than 1MHz assessment. It depends on
just how clean you need the sine wave to be, of course, but you'll have a
first alias at fs - 10Hz; as soon as you can pound that down sufficiently
then you're done.

Lessee -- FTDI chip, 4046, op-amp, DDS and filter or honkin' big filter
-- eww, it's getting ugly, isn't it?


In SMT, not really. And it gets me out of having to program a uC,
although I can certainly find someone to do that.
As much as I'm generally pro-uC, if you have to bring a whole nother
person on board, I can see not wanting to.

It's too bad there aren't any really clean ways to build a sine-wave
oscillator at that frequency. Then it'd be FTDI chip, 1-gate XOR, loop
filter, Wien-bridge oscillator, done...


Plus an opamp for the PID. Can't do it with XOR alone because that
results in a frequency-dependent phase error.

It's a pity that all the sinewave oscillators such as XR2206 and ICL8038
have been obsoleted. Those could easily be FM-modulated, something that
is a real hassle with DDS chips.
I've never seen one of those that was really clean at the tips of the
sine waves -- I don't see how being able to stand the little tit on the
end of your sine wave is consistent with needing to sample your DAC at
over 1MHz to attain your desired performance.

If you didn't have the "need a uC guy" constraint, having a
microprocessor feeding a DDS may work. That depends on how flexible a
clock you could get out of the micro, of course.

--

Tim Wescott
Wescott Design Services
http://www.wescottdesign.com
 
On Sat, 13 Jul 2013 15:35:57 -0700, Joerg <invalid@invalid.invalid>
wrote:

Folks,

Has anyone tried this? I have to lock a PLL around 10kHz into a certain
odd phase angle. No problem to do that with a bunch of hardware like
usual. If one were to do that with the PC via a USB sound card, the PC
could measure the phase angle and then adjust a software tone generator
(output via sound card) to always match the phase angle even if stuff in
the outside resonant structure changes.

I need the PLL to follow within 10msec or so. Seems like the 1msec USB
latency could get in the way. Or is there a trick to circumvent that?
Since sound chips have frequency responses up to 22kHZ and rarely hiccup
I could imagine there is a way.
Apparently I have not understood the real question. since I do not
understand what the real issue is :-(.

If you want two sine waveforms with xyz degree phase shift, any NCO
calculation should be able to do it on Left and Right soundcard stereo
channel.

If you are phase locking to some existing sine waves, you need the
quadrature Q signal by doing 90 degree phase locking. After that, any
phase shift from the Q signal can be generated by adding the suitable
phase shift to the main phase accumulator.
 
Tim Wescott wrote:
On Tue, 16 Jul 2013 09:19:38 -0700, Joerg wrote:

Tim Wescott wrote:
On Mon, 15 Jul 2013 14:11:34 -0700, Joerg wrote:

Tim Wescott wrote:
On Sun, 14 Jul 2013 08:19:09 -0700, Joerg wrote:

Bill Sloman wrote:
On Sunday, 14 July 2013 08:35:57 UTC+10, Joerg wrote:
Folks, Has anyone tried this? I have to lock a PLL around 10kHz
into a certai odd phase angle. No problem to do that with a bunch
of hardware like usual. If one were to do that with the PC via a
USB sound card, the PC could measure the phase angle and then
adjust a software tone generator (output via sound card) to always
match the phase angle even if stuff in the outside resonant
structure changes.
I need the PLL to follow within 10msec or so. Seems like the 1msec
USB latency could get in the way. Or is there a trick to
circumvent that? Since sound chips have frequency responses up to
22kHZ and rarely hiccup I could imagine there is a way.
If the oscillator in the phase-locked loop were a DDS chip, where
you can manipulate both phase and frequency digitally, it could be
reasonably straightforward. The messy bit is that it is going to
take your sound card an appreciable time to accumulate enough data
on the oscillator to which you are locking and the oscillator that
you are trying to lock, to let you calculate your frequency
correction, so you probably have to get the frequency pretty much
exactly right before you can start fiddling with the phase - as
long as the frequencies aren't locked, the desired phase correction
will drift with time, and if you don't know precisely when the USB
link will dump the phase correction into the DDS chip, you won't be
able to get it exactly right.

But you should be able to get close enough for all practical
purposes pretty rapidly. As in the old engineer/physicist joke.
I would do this differently, not via sound card. The oscillator can
be controlled via direct register write into a FTDI-sumpthin' chip,
and the phase error can be read back the same way. The plant
response is a bit sluggish, a few hundred Hz bandwidth. Control
response needed to get the PLL to within a few Hertz can be
10-20msec.

It's all doable, I just don't know whether the USB link will hold
up.
Use a microprocessor that talks to the Windows machine via USB, and
implements the PLL?


Yeah, I've looked at the Cypress PSoC for that. The bigger ones can do
it without redlining. Probably some others as well. But I'd need
someone to do the uC coding, that's really not my turf.

Another option would be to use the 4046 as Whit3rd mentioned. But this
would need to be heavily filtered to make a nice sine, or followed by
a DDS module where the 4046 acts as a reference. Also, the XOR results
in a frequency-dependent phase error which I can't have. So I'd have
to plop a PID between that and the VCO to get rid of the phase error.
Possible, but gets busy. However, someone wrote that one don't need no
Ph.D. for a PID :)
Getting a clean all-analog solution certainly seems harder than a clean
solution built around a micro. It sounds like you need a fairly clean
sine wave, though, which means that any solution with a microprocessor
in the middle would have to have a nice DAC, and probably filtering and
buffering.


The uC would be breaking a sweat. In order to obtain a clean sine wave
at 10kHz it has to either pump data into a port with lots of R2R at more
than 1MHz or pump the data into a DAC at the same clip. The data could
either come from a 1/4-cycle LUT (gets pretty big) or be calculated
on-the-fly (even more sweat beads). Then it has to handle all the loop
response stuff, some USB, some housekeeping.

PWM-ing it could be a stretch at 10kHz.

I'm not sure I agree with your more than 1MHz assessment. It depends on
just how clean you need the sine wave to be, of course, but you'll have a
first alias at fs - 10Hz; as soon as you can pound that down sufficiently
then you're done.
What I assumed was the time it takes to clock through the R2R. A quarter
wave of a 10kHz sine takes 25usec. If you want a reasonable R2R-style
amplitude tracking you'd have to have well below 1usec step granularity
in the pseudo-DAC.


Lessee -- FTDI chip, 4046, op-amp, DDS and filter or honkin' big filter
-- eww, it's getting ugly, isn't it?


In SMT, not really. And it gets me out of having to program a uC,
although I can certainly find someone to do that.

As much as I'm generally pro-uC, if you have to bring a whole nother
person on board, I can see not wanting to.
It can be contracted out. Just like the Windows GUI stuff and other
programming will have to be. But if we can avoid uC-programming that
would be nice.


It's too bad there aren't any really clean ways to build a sine-wave
oscillator at that frequency. Then it'd be FTDI chip, 1-gate XOR, loop
filter, Wien-bridge oscillator, done...


Plus an opamp for the PID. Can't do it with XOR alone because that
results in a frequency-dependent phase error.

It's a pity that all the sinewave oscillators such as XR2206 and ICL8038
have been obsoleted. Those could easily be FM-modulated, something that
is a real hassle with DDS chips.

I've never seen one of those that was really clean at the tips of the
sine waves -- I don't see how being able to stand the little tit on the
end of your sine wave is consistent with needing to sample your DAC at
over 1MHz to attain your desired performance.
Well, I don't see how to get a decent sign with less than 25 steps per
quarter-cycle. The tit is very high frequency, I usd to get rid of that
with LC.


If you didn't have the "need a uC guy" constraint, having a
microprocessor feeding a DDS may work. That depends on how flexible a
clock you could get out of the micro, of course.
If the DDS could be cajoled into working with a reference of less than
100kHz that would be very feasible.

But I might just do it the usual way. Using a higher frequency VCO plus
a crystal oscillator slightly lower in frequency, then mixing that down
to 5-15kHz. If I felt really decadent I could even buy the VCO, like
thsi one:

http://www.digikey.com/scripts/dksearch/dksus.dll?vendor=0&keywords=%09744-1164-ND

then mixed its output with the output of this one:

http://www.digikey.com/product-detail/en/CB3-3C-45M0000/CTX297TR-ND/280251

But that would feel very unsportsmanlike. Like "cooking" a TV dinner.

--
Regards, Joerg

http://www.analogconsultants.com/
 
upsidedown@downunder.com wrote:
On Sat, 13 Jul 2013 15:35:57 -0700, Joerg <invalid@invalid.invalid
wrote:

Folks,

Has anyone tried this? I have to lock a PLL around 10kHz into a certain
odd phase angle. No problem to do that with a bunch of hardware like
usual. If one were to do that with the PC via a USB sound card, the PC
could measure the phase angle and then adjust a software tone generator
(output via sound card) to always match the phase angle even if stuff in
the outside resonant structure changes.

I need the PLL to follow within 10msec or so. Seems like the 1msec USB
latency could get in the way. Or is there a trick to circumvent that?
Since sound chips have frequency responses up to 22kHZ and rarely hiccup
I could imagine there is a way.

Apparently I have not understood the real question. since I do not
understand what the real issue is :-(.

If you want two sine waveforms with xyz degree phase shift, any NCO
calculation should be able to do it on Left and Right soundcard stereo
channel.

If you are phase locking to some existing sine waves, you need the
quadrature Q signal by doing 90 degree phase locking. After that, any
phase shift from the Q signal can be generated by adding the suitable
phase shift to the main phase accumulator.
The essence of the task is this: A generator sends a sine wave of around
10kHz into a reactive network. This network causes a phase shift
(current versus voltage, like a power factor) but that is not totally
known because the exact RLC values in the reactive network are not
known. I want to keep that phase shift constant.

--
Regards, Joerg

http://www.analogconsultants.com/
 
On Tue, 16 Jul 2013 13:41:46 -0700, Joerg wrote:

Tim Wescott wrote:
<< snip >>

I'm not sure I agree with your more than 1MHz assessment. It depends
on just how clean you need the sine wave to be, of course, but you'll
have a first alias at fs - 10Hz; as soon as you can pound that down
sufficiently then you're done.


What I assumed was the time it takes to clock through the R2R. A quarter
wave of a 10kHz sine takes 25usec. If you want a reasonable R2R-style
amplitude tracking you'd have to have well below 1usec step granularity
in the pseudo-DAC.
OK. So taking as an engineering specification the level of the RMS
error, and assuming no error in the DAC beyond sampling. When you use
the for-free sinc filtering that comes from the sample and hold behavior
of the DAC but no other filtering, the total RMS voltage of the aliasing
components is 1.6% of the signal voltage.

If you sample at 100kHz and run the output of your DAC through a 2nd-
order Butterworth filter with a cut-off frequency of 40kHz, then you get
more than twice the attenuation of the resulting aliasing, and you get
rid of a lot more of the "stair-steppy" than just by sampling fast.

At 15kHz you're only down to 1.9% of the total -- but if you sampled at
1MHz with no filtering and 15kHz out, you'd be worse off, too.

And, I pulled these numbers out of my donkey*. Actually putting in some
effort to select sampling rates and filter cutoff frequencies may result
in a better tradeoff.

<< snip even more >>

I've never seen one of those that was really clean at the tips of the
sine waves -- I don't see how being able to stand the little tit on the
end of your sine wave is consistent with needing to sample your DAC at
over 1MHz to attain your desired performance.


Well, I don't see how to get a decent sign with less than 25 steps per
quarter-cycle. The tit is very high frequency, I usd to get rid of that
with LC.
If you use a 40kHz-cutoff Butterworth that should take care of it nicely
(or an LC. At 10kHz???). Now where did I see that filter mentioned?

If you didn't have the "need a uC guy" constraint, having a
microprocessor feeding a DDS may work. That depends on how flexible a
clock you could get out of the micro, of course.


If the DDS could be cajoled into working with a reference of less than
100kHz that would be very feasible.

But I might just do it the usual way. Using a higher frequency VCO plus
a crystal oscillator slightly lower in frequency, then mixing that down
to 5-15kHz. If I felt really decadent I could even buy the VCO, like
thsi one:

http://www.digikey.com/scripts/dksearch/dksus.dll?vendor=0&keywords=%
09744-1164-ND

then mixed its output with the output of this one:

http://www.digikey.com/product-detail/en/CB3-3C-45M0000/CTX297TR-
ND/280251

But that would feel very unsportsmanlike. Like "cooking" a TV dinner.
I actually like the "two RF oscillators beating" solution, but only
because I'm a geek. It will, of course, need a clean sine wave on one
channel, but then the other can be just about anything as long as your
mixer is linear. I bet that once you get all the necessary bells and
whistles in place you'll have used more real estate than a micro sampling
at 100kHz followed by a 2nd-order Butterworth, though.

* English idiom sure can be weird, can't it?

--
Tim Wescott
Control system and signal processing consulting
www.wescottdesign.com
 
Tim Wescott wrote:
On Tue, 16 Jul 2013 13:41:46 -0700, Joerg wrote:

Tim Wescott wrote:

snip

I'm not sure I agree with your more than 1MHz assessment. It depends
on just how clean you need the sine wave to be, of course, but you'll
have a first alias at fs - 10Hz; as soon as you can pound that down
sufficiently then you're done.


What I assumed was the time it takes to clock through the R2R. A quarter
wave of a 10kHz sine takes 25usec. If you want a reasonable R2R-style
amplitude tracking you'd have to have well below 1usec step granularity
in the pseudo-DAC.

OK. So taking as an engineering specification the level of the RMS
error, and assuming no error in the DAC beyond sampling. When you use
the for-free sinc filtering that comes from the sample and hold behavior
of the DAC but no other filtering, the total RMS voltage of the aliasing
components is 1.6% of the signal voltage.

If you sample at 100kHz and run the output of your DAC through a 2nd-
order Butterworth filter with a cut-off frequency of 40kHz, then you get
more than twice the attenuation of the resulting aliasing, and you get
rid of a lot more of the "stair-steppy" than just by sampling fast.

At 15kHz you're only down to 1.9% of the total -- but if you sampled at
1MHz with no filtering and 15kHz out, you'd be worse off, too.
Yeah, ok, if I need a filter I might as well use a square wave and hang
an LC lowpass behind it. Can be Chebyshev or even elliptical because
phase won't matter since we can tap off after the filter. I wouldn't
spring for any DAC if I have to filter after all.


And, I pulled these numbers out of my donkey*. Actually putting in some
effort to select sampling rates and filter cutoff frequencies may result
in a better tradeoff.
I think the two-oscillator method plus mix down is less effort :)


snip even more

I've never seen one of those that was really clean at the tips of the
sine waves -- I don't see how being able to stand the little tit on the
end of your sine wave is consistent with needing to sample your DAC at
over 1MHz to attain your desired performance.


Well, I don't see how to get a decent sign with less than 25 steps per
quarter-cycle. The tit is very high frequency, I usd to get rid of that
with LC.

If you use a 40kHz-cutoff Butterworth that should take care of it nicely
(or an LC. At 10kHz???). Now where did I see that filter mentioned?
I routinely do LC down there. But then I might as well go in with a
square wave.


If you didn't have the "need a uC guy" constraint, having a
microprocessor feeding a DDS may work. That depends on how flexible a
clock you could get out of the micro, of course.


If the DDS could be cajoled into working with a reference of less than
100kHz that would be very feasible.

But I might just do it the usual way. Using a higher frequency VCO plus
a crystal oscillator slightly lower in frequency, then mixing that down
to 5-15kHz. If I felt really decadent I could even buy the VCO, like
thsi one:

http://www.digikey.com/scripts/dksearch/dksus.dll?vendor=0&keywords=%
09744-1164-ND
then mixed its output with the output of this one:

http://www.digikey.com/product-detail/en/CB3-3C-45M0000/CTX297TR-
ND/280251
But that would feel very unsportsmanlike. Like "cooking" a TV dinner.

I actually like the "two RF oscillators beating" solution, but only
because I'm a geek. It will, of course, need a clean sine wave on one
channel, but then the other can be just about anything as long as your
mixer is linear. I bet that once you get all the necessary bells and
whistles in place you'll have used more real estate than a micro sampling
at 100kHz followed by a 2nd-order Butterworth, though.
If it absolutely has to be cheap you can do all that in CMOS to the tune
of around 50 cents. There are cheap RF receiver chips that contain a
VCO-capable LO, a mixer, and even a preamp. Plus lots of other stuff
that would have to lie fallow. So all this needs is another oscillator.
That one has to be sine but that's totally easy up there. Doesn't even
have to be crystal-controlled.


* English idiom sure can be weird, can't it?
I'd probably have said "out of my hat". When I was a kid grandma read
another story about a donkey. One that pooped money when you lifted its
tail. Still trying to find one of those ...

--
Regards, Joerg

http://www.analogconsultants.com/
 
On Wednesday, 17 July 2013 06:41:46 UTC+10, Joerg wrote:
Tim Wescott wrote:
On Tue, 16 Jul 2013 09:19:38 -0700, Joerg wrote:
Tim Wescott wrote:
On Mon, 15 Jul 2013 14:11:34 -0700, Joerg wrote
Tim Wescott wrote:
On Sun, 14 Jul 2013 08:19:09 -0700, Joerg wrote:
Bill Sloman wrote:
On Sunday, 14 July 2013 08:35:57 UTC+10, Joerg wrote:

Folks, Has anyone tried this? I have to lock a PLL around 10kHz
into a certai odd phase angle. No problem to do that with a bunch
of hardware like usual. If one were to do that with the PC via a
USB sound card, the PC could measure the phase angle and then
adjust a software tone generator (output via sound card) to always
match the phase angle even if stuff in the outside resonant
structure changes.
I need the PLL to follow within 10msec or so. Seems like the 1msec
USB latency could get in the way. Or is there a trick to
circumvent that? Since sound chips have frequency responses up to
22kHZ and rarely hiccup I could imagine there is a way.
If the oscillator in the phase-locked loop were a DDS chip, where
you can manipulate both phase and frequency digitally, it could be
reasonably straightforward. The messy bit is that it is going to
take your sound card an appreciable time to accumulate enough data
on the oscillator to which you are locking and the oscillator that
you are trying to lock, to let you calculate your frequency
correction, so you probably have to get the frequency pretty much
exactly right before you can start fiddling with the phase - as
long as the frequencies aren't locked, the desired phase correction
will drift with time, and if you don't know precisely when the USB
link will dump the phase correction into the DDS chip, you won't be
able to get it exactly right.

But you should be able to get close enough for all practical
purposes pretty rapidly. As in the old engineer/physicist joke.

I would do this differently, not via sound card. The oscillator can
be controlled via direct register write into a FTDI-sumpthin' chip,
and the phase error can be read back the same way. The plant
response is a bit sluggish, a few hundred Hz bandwidth. Control
response needed to get the PLL to within a few Hertz can be
10-20msec.

It's all doable, I just don't know whether the USB link will hold
up.

Use a microprocessor that talks to the Windows machine via USB, and
implements the PLL?

Yeah, I've looked at the Cypress PSoC for that. The bigger ones can do
it without redlining. Probably some others as well. But I'd need
someone to do the uC coding, that's really not my turf.

Another option would be to use the 4046 as Whit3rd mentioned. But this
would need to be heavily filtered to make a nice sine, or followed by
a DDS module where the 4046 acts as a reference. Also, the XOR results
in a frequency-dependent phase error which I can't have. So I'd have
to plop a PID between that and the VCO to get rid of the phase error.
Possible, but gets busy. However, someone wrote that one don't need no
Ph.D. for a PID :)

Getting a clean all-analog solution certainly seems harder than a clean
solution built around a micro. It sounds like you need a fairly clean
sine wave, though, which means that any solution with a microprocessor
in the middle would have to have a nice DAC, and probably filtering and
buffering.

The uC would be breaking a sweat. In order to obtain a clean sine wave
at 10kHz it has to either pump data into a port with lots of R2R at more
than 1MHz or pump the data into a DAC at the same clip. The data could
either come from a 1/4-cycle LUT (gets pretty big) or be calculated
on-the-fly (even more sweat beads). Then it has to handle all the loop
response stuff, some USB, some housekeeping.

PWM-ing it could be a stretch at 10kHz.

I'm not sure I agree with your more than 1MHz assessment. It depends on
just how clean you need the sine wave to be, of course, but you'll have a
first alias at fs - 10Hz; as soon as you can pound that down sufficiently
then you're done.

What I assumed was the time it takes to clock through the R2R. A quarter
wave of a 10kHz sine takes 25usec. If you want a reasonable R2R-style
amplitude tracking you'd have to have well below 1usec step granularity
in the pseudo-DAC.

Lessee -- FTDI chip, 4046, op-amp, DDS and filter or honkin' big filter
-- eww, it's getting ugly, isn't it?

In SMT, not really. And it gets me out of having to program a uC,
although I can certainly find someone to do that.

As much as I'm generally pro-uC, if you have to bring a whole nother
person on board, I can see not wanting to.

It can be contracted out. Just like the Windows GUI stuff and other
programming will have to be. But if we can avoid uC-programming that
would be nice.

It's too bad there aren't any really clean ways to build a sine-wave
oscillator at that frequency. Then it'd be FTDI chip, 1-gate XOR, loop
filter, Wien-bridge oscillator, done...

Plus an opamp for the PID. Can't do it with XOR alone because that
results in a frequency-dependent phase error.

It's a pity that all the sinewave oscillators such as XR2206 and ICL8038
have been obsoleted. Those could easily be FM-modulated, something that
is a real hassle with DDS chips.

I've never seen one of those that was really clean at the tips of the
sine waves -- I don't see how being able to stand the little tit on the
end of your sine wave is consistent with needing to sample your DAC at
over 1MHz to attain your desired performance.

Well, I don't see how to get a decent sign with less than 25 steps per
quarter-cycle. The tit is very high frequency, I usd to get rid of that
with LC.

If you didn't have the "need a uC guy" constraint, having a
microprocessor feeding a DDS may work. That depends on how flexible a
clock you could get out of the micro, of course

If the DDS could be cajoled into working with a reference of less than
100kHz that would be very feasible.
A lot of Analog Devices DDS chips include an on-board reference clock multiplier.

http://www.analog.com/static/imported-files/data_sheets/AD9856.pdf

offers a programmable 4x to 20x internal multiplication. At $17.19 in volume, it's way outside your financial comfort zone. The AD5932 is cheaper, and might work.

<snipped unsportmanslike solutions>

--
Bill Sloman, Sydney
 
On Tue, 16 Jul 2013 17:35:49 -0700, Joerg wrote:

Tim Wescott wrote:
On Tue, 16 Jul 2013 13:41:46 -0700, Joerg wrote:

Tim Wescott wrote:

snip

I'm not sure I agree with your more than 1MHz assessment. It depends
on just how clean you need the sine wave to be, of course, but you'll
have a first alias at fs - 10Hz; as soon as you can pound that down
sufficiently then you're done.


What I assumed was the time it takes to clock through the R2R. A
quarter wave of a 10kHz sine takes 25usec. If you want a reasonable
R2R-style amplitude tracking you'd have to have well below 1usec step
granularity in the pseudo-DAC.

OK. So taking as an engineering specification the level of the RMS
error, and assuming no error in the DAC beyond sampling. When you use
the for-free sinc filtering that comes from the sample and hold
behavior of the DAC but no other filtering, the total RMS voltage of
the aliasing components is 1.6% of the signal voltage.

If you sample at 100kHz and run the output of your DAC through a 2nd-
order Butterworth filter with a cut-off frequency of 40kHz, then you
get more than twice the attenuation of the resulting aliasing, and you
get rid of a lot more of the "stair-steppy" than just by sampling fast.

At 15kHz you're only down to 1.9% of the total -- but if you sampled at
1MHz with no filtering and 15kHz out, you'd be worse off, too.


Yeah, ok, if I need a filter I might as well use a square wave and hang
an LC lowpass behind it. Can be Chebyshev or even elliptical because
phase won't matter since we can tap off after the filter. I wouldn't
spring for any DAC if I have to filter after all.
You'd need more than a 2nd-order filter to smooth out a square wave at
any frequency between 5 and 15kHz. At least to the degree that you're
calling out with your 1us sampling into an unfiltered DAC.

But your two-oscillator approach with an NE 612 or whatever is just too
cool. I think you should do that so that I can say "tsk tsk" if it
doesn't work, and gloat vicariously if it does.

--

Tim Wescott
Wescott Design Services
http://www.wescottdesign.com
 
On Tue, 16 Jul 2013 09:19:38 -0700, Joerg <invalid@invalid.invalid>
wrote:

The uC would be breaking a sweat. In order to obtain a clean sine wave
at 10kHz it has to either pump data into a port with lots of R2R at more
than 1MHz or pump the data into a DAC at the same clip. The data could
either come from a 1/4-cycle LUT (gets pretty big) or be calculated
on-the-fly (even more sweat beads). Then it has to handle all the loop
response stuff, some USB, some housekeeping.
Why would you need 1 Ms/s to generate pure sine way at 10 kHz ?

As long as the clock rate is not a simple harmonic of the wanted
signal, something like 44.056 kHz (the original digital audio sample
rate) might do. Just put an analog reconstruction filter after the
DAC.

At a slightly higher sample rate would allow a simple RC filter (-6
dB/octave) to attenuate the sampling rate aliases from distorting the
analog waveform significantly. With such a gently filters, there are
not going to be a lot of phase error between the channels, due to
component tolerances.
 
On Tue, 16 Jul 2013 10:32:15 -0700, Joerg <invalid@invalid.invalid>
wrote:

Well, there's always the DIY sine wave DAC using a CD4017. That makes
the filtering a lot easier.


Sure, but the wee problem will be a lack of granularity when setting the
frequency. Unless I would alter the DFL inside the uC in order to set
the whole master clock to odd numbers, IOW the uC master clock becomes
my VCO. Then chances are that the USB or something else falls apart.
In the NCO system, the frequency granulaty is determined by the length
of the phase accumulator, the width of the DAC only defines the amount
of distortion and spurs.

For audio applications a 24 or even 16 bit phase accumulator would be
sufficient. Even a simple 8 bitter should be able to increment a 2 or
3 byte integer at every interrupt. Then take say the 8 highest bits
from the phase accumulator, use it to address the 256 position LUT and
feed the result to DAC. Take the same top of phase accumulator, add a
constant (phase difference) ignoring carry and use it to access the
same 256 position LUT and feed it to the other DAC.

A simple one chip controller with 16 digital outputs should be able to
feed two R2R DACs.
 
upsidedown@downunder.com wrote:
On Tue, 16 Jul 2013 09:19:38 -0700, Joerg <invalid@invalid.invalid
wrote:

The uC would be breaking a sweat. In order to obtain a clean sine wave
at 10kHz it has to either pump data into a port with lots of R2R at more
than 1MHz or pump the data into a DAC at the same clip. The data could
either come from a 1/4-cycle LUT (gets pretty big) or be calculated
on-the-fly (even more sweat beads). Then it has to handle all the loop
response stuff, some USB, some housekeeping.

Why would you need 1 Ms/s to generate pure sine way at 10 kHz ?
I was figuring of around 25 steps per quarter-cycle, in order to get a
decent sine representation without much filtering.


As long as the clock rate is not a simple harmonic of the wanted
signal, something like 44.056 kHz (the original digital audio sample
rate) might do. Just put an analog reconstruction filter after the
DAC.
That was the whole purpose of that exercise, to avoid elaborate
filtering. If I need to do much filtereing I might as well take a square
wave. Since the frequency will be somewhat variable filtering is a bit
of a hassle.


At a slightly higher sample rate would allow a simple RC filter (-6
dB/octave) to attenuate the sampling rate aliases from distorting the
analog waveform significantly. With such a gently filters, there are
not going to be a lot of phase error between the channels, due to
component tolerances.
Phase error is no problem because this signal feeds the whole chebang,
so things are ratiometric.

--
Regards, Joerg

http://www.analogconsultants.com/
 
Tim Wescott wrote:
On Tue, 16 Jul 2013 17:35:49 -0700, Joerg wrote:

Tim Wescott wrote:
On Tue, 16 Jul 2013 13:41:46 -0700, Joerg wrote:

Tim Wescott wrote:
snip

I'm not sure I agree with your more than 1MHz assessment. It depends
on just how clean you need the sine wave to be, of course, but you'll
have a first alias at fs - 10Hz; as soon as you can pound that down
sufficiently then you're done.


What I assumed was the time it takes to clock through the R2R. A
quarter wave of a 10kHz sine takes 25usec. If you want a reasonable
R2R-style amplitude tracking you'd have to have well below 1usec step
granularity in the pseudo-DAC.
OK. So taking as an engineering specification the level of the RMS
error, and assuming no error in the DAC beyond sampling. When you use
the for-free sinc filtering that comes from the sample and hold
behavior of the DAC but no other filtering, the total RMS voltage of
the aliasing components is 1.6% of the signal voltage.

If you sample at 100kHz and run the output of your DAC through a 2nd-
order Butterworth filter with a cut-off frequency of 40kHz, then you
get more than twice the attenuation of the resulting aliasing, and you
get rid of a lot more of the "stair-steppy" than just by sampling fast.

At 15kHz you're only down to 1.9% of the total -- but if you sampled at
1MHz with no filtering and 15kHz out, you'd be worse off, too.


Yeah, ok, if I need a filter I might as well use a square wave and hang
an LC lowpass behind it. Can be Chebyshev or even elliptical because
phase won't matter since we can tap off after the filter. I wouldn't
spring for any DAC if I have to filter after all.

You'd need more than a 2nd-order filter to smooth out a square wave at
any frequency between 5 and 15kHz. At least to the degree that you're
calling out with your 1us sampling into an unfiltered DAC.
It can probably be done with a 4-pole Chebyshev.


But your two-oscillator approach with an NE 612 or whatever is just too
cool. I think you should do that so that I can say "tsk tsk" if it
doesn't work, and gloat vicariously if it does.
It'll work. But it has too much sledgehammer appeal :)

--
Regards, Joerg

http://www.analogconsultants.com/
 
Bill Sloman wrote:
On Wednesday, 17 July 2013 06:41:46 UTC+10, Joerg wrote:
Tim Wescott wrote:
On Tue, 16 Jul 2013 09:19:38 -0700, Joerg wrote:
Tim Wescott wrote:
[...]


It's too bad there aren't any really clean ways to build a
sine-wave oscillator at that frequency. Then it'd be FTDI
chip, 1-gate XOR, loop filter, Wien-bridge oscillator,
done...

Plus an opamp for the PID. Can't do it with XOR alone because
that results in a frequency-dependent phase error.

It's a pity that all the sinewave oscillators such as XR2206
and ICL8038 have been obsoleted. Those could easily be
FM-modulated, something that is a real hassle with DDS chips.

I've never seen one of those that was really clean at the tips of
the sine waves -- I don't see how being able to stand the little
tit on the end of your sine wave is consistent with needing to
sample your DAC at over 1MHz to attain your desired performance.


Well, I don't see how to get a decent sign with less than 25 steps
per quarter-cycle. The tit is very high frequency, I usd to get rid
of that with LC.

If you didn't have the "need a uC guy" constraint, having a
microprocessor feeding a DDS may work. That depends on how
flexible a clock you could get out of the micro, of course
If the DDS could be cajoled into working with a reference of less
than 100kHz that would be very feasible.

A lot of Analog Devices DDS chips include an on-board reference clock
multiplier.

http://www.analog.com/static/imported-files/data_sheets/AD9856.pdf

offers a programmable 4x to 20x internal multiplication. At $17.19 in
volume, it's way outside your financial comfort zone. The AD5932 is
cheaper, and might work.
That is pricey. But first I will be looking at simpler and cheaper
solutions. And it seems it'll again be all analog. Sometimes a modern
digital approach simply doesn't cut it.


snipped unsportmanslike solutions
But if done with a cheap IC or two those may be the best :)

--
Regards, Joerg

http://www.analogconsultants.com/
 
On Tue, 16 Jul 2013 09:19:38 -0700, Joerg wrote:


Plus an opamp for the PID. Can't do it with XOR alone because that
results in a frequency-dependent phase error.

It's a pity that all the sinewave oscillators such as XR2206 and ICL8038
have been obsoleted. Those could easily be FM-modulated, something that
is a real hassle with DDS chips.
Jeorg,
How about a varactor tuned Wein bridge oscillator an FTDI chip, a micro
(PIC, AVR. etc.,), mostly to handle the FTDI chip, a couple onchip
comparators, then using a counter in the uC count clocks after the first
comparator detects a "zero crossing" of the reference, to the time the
second comparator detect the locked signal zero crossing. With a touch
of logic (possibly external to the uC) this will allow producing the
opportunity of having correction pulses to integrate every half cycle.
It would allow fast phase adjustment and stable lock, the phase
resolution would be determined by the counter clock rate.


?-)
 
josephkk wrote:
On Tue, 16 Jul 2013 09:19:38 -0700, Joerg wrote:


Plus an opamp for the PID. Can't do it with XOR alone because that
results in a frequency-dependent phase error.

It's a pity that all the sinewave oscillators such as XR2206 and ICL8038
have been obsoleted. Those could easily be FM-modulated, something that
is a real hassle with DDS chips.

Jeorg,
How about a varactor tuned Wein bridge oscillator an FTDI chip, a micro
(PIC, AVR. etc.,), mostly to handle the FTDI chip, a couple onchip
comparators, then using a counter in the uC count clocks after the first
comparator detects a "zero crossing" of the reference, to the time the
second comparator detect the locked signal zero crossing. With a touch
of logic (possibly external to the uC) this will allow producing the
opportunity of having correction pulses to integrate every half cycle.
It would allow fast phase adjustment and stable lock, the phase
resolution would be determined by the counter clock rate.
The problem with varactor diodes is that pretty much all high
capacitance ones have gone lalaland. Probably because there are no
radios with discrete oscillators and filters anymore.

--
Regards, Joerg

http://www.analogconsultants.com/
 

Welcome to EDABoard.com

Sponsor

Back
Top