Possible to Initialize Phase Accumulator of DDS? - Page 1
Forum section: electronics / projects

author: Odysseus
author_rank: Regular Contributor
timestamp: May 17, 2015, 05:18:11 am
content: I'm looking at an application that requires a pair of quadrature sinusoids at 0-10MHz that can be made as orthogonal as possible. Trimming of the phase is required due to tolerance of filter components, delay skews, etc. A DDS chip seems ideal, but the cost effective solutions from ADI seem to only have a 12-bit phase offset registers, when the phase accumulator itself is 24/28 bits. The phase accumulator itself cannot be directly preset to anything other than 0. I suppose I can hack the chips the initialize the phase accumulator by setting the tuning word to 1 and just increment it. Is there a better solution? Am I approaching the problem correctly?

author: Rerouter
author_rank: Super Contributor
timestamp: May 17, 2015, 06:10:51 am
content: use the same clock, share the reset and data load lines, and set them both to the same frequency, but a different phase word?

author: zapta
author_rank: Super Contributor
timestamp: May 17, 2015, 06:40:12 am
content: Quote from: Rerouter on May 17, 2015, 06:10:51 amI think the problem is that the phase word is not large enough to represent 90 degrees.How about reseting them at control internal and then use the phase word for minor adjustments?

author: Rerouter
author_rank: Super Contributor
timestamp: May 17, 2015, 06:50:20 am
content: first bit, 0 or 180 degrees, second bit, 90 / 270 degrees? in steps of 30 degrees for a 12 bit phase register?most of the DDS chips are phase continuous when the frequency word changes, and the phase changes when the word changes? i'm not following how you cannot get a 90 degree offset between 2 sine waves?

author: awallin
author_rank: Frequent Contributor
timestamp: May 17, 2015, 07:10:28 am
content: phase is the integral of frequency. to adjust phase accurately just change the frequency by a tiny amount *for some amount of time* then set back to original frequency. you'll get a phase shift equal to the integral over time of the frequency offset.If you have two DDS:s set to the same frequency and look at the output on a scope you should see the two sine-waves stationary wrt. eachother.Now change the frequency of one DDS by a small amount (1LSB or a bit more depending on the length of your frequency tuning word) and you will see one sine-wave start to drift wrt to the the other. When you are at the correct phase-offset just jump back to exact same frequency on both DDS:s.You can have the phase-adjust words set to zero or any constant during this procedure. This should allow very very fine adjustments of the relative phase between the two DDS outputs. On the AD9912 for example it is possible to get 10 MHz output and adjust one DDS to be let's say 1 mHz offset from the other. Now it will take 1000 seconds for the sine-waves to drift 360 degrees, or a quarter of that to get your desired 90 degree shift.With this methid, if you are using a mixer to detect the 90-degree offset then you will probably be limited by the mixer 1/f noise and/or DC-drift in phase resolution, not the DDS.

author: moffy
author_rank: Super Contributor
timestamp: May 18, 2015, 01:51:38 am
content: Perhaps you could try adjusting the phase with an allpass filter. I assume that the phase will need more compensating at a higher frequency. Or perhaps you can just calibrate out the phase shifts.

author: Odysseus
author_rank: Regular Contributor
timestamp: May 18, 2015, 06:15:21 am
content: Quote from: zapta on May 17, 2015, 06:40:12 amActually, awallin is on the same track I was initially considering (and trying to avoid due to complexity and speed). Let me clarify more by referring specifically to the AD9834. This part is more than capable of producing any desired shift 0-360 degrees. The problem I am facing is a matter of resolution in phase.However, only a few minutes after posting I realized I didn't need them to be that accurate. I can measure the actual phase difference, so I can simply compensate with some math. This way I can actually get by using the AD9850, which only has five bits of phase offset resolution (steps of 11.25 degrees), and I get a nice differential comparator, too.

author: German_EE
author_rank: Super Contributor
timestamp: May 18, 2015, 11:24:43 am
content: Another way to shift the output phase of one DDS chip relative to another is to insert a variable phase shifter into the clock line of one device.http://194.75.38.69/products/phase_shifters.shtml

author: deephaven
author_rank: Frequent Contributor
timestamp: May 18, 2015, 12:11:31 pm
content: You could make your own DDS with a CPLD and a couple of DACs

author: cncjerry
author_rank: Unknown
timestamp: May 18, 2015, 07:55:28 pm
content: what chip are you using? Many have I/Q outputs which are as close to 90 degrees as practical for the bit rate of the DDS. If you need it more exact, there is a counter circuit that can drive the second DDS in quadrature from a master clock. Look at the N2PK VNA design where he uses two AD9851s in quadrature. I've used AD9854s which have differential I/Q outputs and if you think about it, the phase accumulator only needs to be as accurate as 12bits (or in other cases, 10 bits) allow.Many of the DDS chips have registers for setting the phase but they aren't that granular, some only like 11 degrees. Also, do you need a square or sinusoid? And if you need exactly 90 degrees, then just use one DDS running at a multiple (rate I forget) and a Johnson counter to get the in-phase and quadrature as used in the Tayloe detector. I think you can drive that counter as a multiple as well getting even better performance and lower jitter. The only time you need to vary the phase precisely is if you are making up for defects down stream (depending on the application, of course). I know the AD9854 was used in phase modulation at some high rate and that is pretty demanding so I bet it would do the trick.Lastly, phase is important but phase noise is a bigger problem as well as jitter in your master oscillator no matter what DDS you use. Have you given any consideration to the MO? A low phase noise, low jitter MO is fairly expensive new, like $120 - $140 unless you find your requisite frequency on ebay. I've referenced Valpey Fisher oscillators in other places though they were bought out not that long ago.Jerryedit: Though I never tried it, a switched capacitor bank hanging on a twisted wire quadrature might also give you more control.

author: moffy
author_rank: Super Contributor
timestamp: May 20, 2015, 01:01:14 am
content: Quote from: German_EE on May 18, 2015, 11:24:43 amNice idea but it wouldn't be simple as it looks like it is a sine wave phase shifter rather than a clock phase shifter. You would need some very good comparators, probably ECL. It would take some effort.

author: Odysseus
author_rank: Regular Contributor
timestamp: May 20, 2015, 02:24:27 am
content: So here's what I'm planning on doing now, for anyone who's interested. The original problem to solve is that two quadrature DDS outputs, after filtering, will not be exactly 90 degrees apart. I was planning on using these to drive the LO inputs of an I/Q de-modulator (just two mixers) but I couldn't guarantee that the LO signals were orthogonal. I've realized that this is acceptable,ifI can measure the phase error. To do so, I can just mix the LO signals together and measure the DC outputboth with and withoutthe 90 degree offset. Some simple trigonometry shows that these DC values are proportional to the sin and cos of the phase error. Plug them into atan2 and voila, I have the actual phase error.Quote from: cncjerry on May 18, 2015, 07:55:28 pmProbably the AD9851 at this point.Both, at the same frequency.Just a crystal for now. I'm trying to understand what effect phase noise will have on my system. All signals/clocks in the system are derived from the same oscillator, however.

author: cncjerry
author_rank: Unknown
timestamp: May 20, 2015, 02:29:55 pm
content: Look into twisted wired quadrature for it is more than good enough for what you are doing and you can tweak the toroid coil spacing to dial into quadrature. Alternatively get the schematic for the N2PK VNA and copy the DDS circuit. That will get you more than you need by a factor of 10.If you match your filter components to 1% or better the phase will be so close with either of those suggestions above you won't be able to tell no matter what your scope says. To measure the phase accurately you would need a differential probe or matched and calibrated scope probes. Also, your mixers force the DDS drive into a square wave sort of when the diodes saturate (assuming a diode ring type) and so drive level will be just as important as phase. In order to measure phase at the mixer port precisely you need an active probe or again a matched set.You can buy an AD9854 board from eBay that has all you need to 60Mhz for under $100US including phase adjustment and SMA patch cords. The 9854 is very tough to beat but hard to solder so get one that is populated. If you go to Analog Devices DDS selection chart you will see the 9854 is still the king of quadrature having i/q differential outputs.