Function generator drift? - Page 1
Forum section: electronics / projects

author: ftransform
author_rank: Frequent Contributor
timestamp: December 27, 2012, 09:34:36 pm
content: So I have a tektronix function generator. This is the first time I'm using it but I noticed that the frequency wont settle. Using a external frequency counter I set the frequency to 4.91250mhz.It has a 10mhz crystal and the manual saysFrequency mode: ±(1 count+ timebase error)I see it dropping round 0.00003 MHz every second, with no end in sight.This seems unacceptable for a function generator. Do you think that this is a serviceable issue? Perhaps replacing the internal crystal?I'm going to let it run for a long while to see if it settles down but this does not inspire confidence.

author: Unknown
author_rank: Unknown
timestamp: December 27, 2012, 09:53:25 pm
content: Quote from: ftransform on December 27, 2012, 09:34:36 pmWhat model?Quote from: ftransform on December 27, 2012, 09:34:36 pmIs this for the external frequency counter, a frequency counter incorporated in the frequency generator, or for the generator itself? Only synthesized (eg. DDS) function generator use a crystal as frequency reference, otherwise it might just be for the internal counter.Quote from: ftransform on December 27, 2012, 09:34:36 pmIf it's an old analog function generator, then it might very well be normal. These usually use an RC-based oscillator, and are not known for good frequency stability. Resistance and capacitance values will change with temperature. A resistor might have a 100 ppm tempco, so a 5 MHz output signal would change about 0.0005 MHz/K. DDS-based function generators tend to use a crystal timebase, which performs much better.

author: ftransform
author_rank: Frequent Contributor
timestamp: December 27, 2012, 10:13:24 pm
content: Quote from: alm on December 27, 2012, 09:53:25 pmOh, its a Tektronix CFG280.After its been on for 40 minutes it seems to be behaving slightly better but its still not great.DO you think that a scratchy old turnpot could be part of the problem?And I am measuring it with a rigol 1052e

author: Unknown
author_rank: Unknown
timestamp: December 27, 2012, 10:30:49 pm
content: This is a traditional function generator with an RC oscillator as time base. Don't expect exceptional stability or distortion figures from this design, it was not intended for precision measurements. 3 Hz (< 1 ppm) drift would not even register in my mind: I expect the accuracy of these devices to be in the order of a few percent, with maybe an order of magnitude better short-term stability.This doesn't sound like bad contacts to me, since it's a very gradual drift. Heating of some components sounds like the most likely culprit.The accuracy specifications you quoted is for the internal counter, as is the 10 MHz crystal.

author: mazurov
author_rank: Frequent Contributor
timestamp: December 28, 2012, 01:30:06 am
content: What is your counter and how is it clocked? My HP 5328A with OCXO will be quite off for about an hour or two after cold start and final stabilization is achieved after about 24 hours. Besides, the spec for your generator time base lists 10ppm stability which is 10Hz per each MHz so if your counter is accurate then the generator is actually pretty good.

author: ftransform
author_rank: Frequent Contributor
timestamp: December 28, 2012, 02:09:49 am
content: I think I should have went about this question a different way.What frequency stability do I need in order to run a CMOS clock on a ADC?And the overshoot is pretty bad on this thing too, 20% according to my rigol. It gets pretty bad at higher square wave frequencies.When the 2v-Peak to Peak mode is enabled then the square wave looks pretty good even at max amplitude. However when the 10v PP mode is enabled then the square wave gets overshoot and undershoot on positive and negative edge. 15% overshoot when it is outputting maximum amplitude.Another problem that this function generator has is a noisy fan. Do you think that MAYBE the vibration from the fan is causing the potentiometer to cause problems? I'm going to replace it anyway because it sounds fucking annoying.

author: ftransform
author_rank: Frequent Contributor
timestamp: December 28, 2012, 02:23:00 am
content: Quote from: mazurov on December 28, 2012, 01:30:06 amrigol 1052e with its Utility > Counter enabled. Not the counter that measures the onscreen wave, but its built in counter. I read that its a pretty good counter.

author: Unknown
author_rank: Unknown
timestamp: December 28, 2012, 03:24:37 am
content: Quote from: ftransform on December 28, 2012, 02:09:49 amI wouldn't expect long term drift (long on the time scale of 1/4.9152 MHz) to make much difference. Note that a standard crystal might change 50 ppm over the temperature range, or 250 Hz for a ~5 MHz crystal.Quote from: ftransform on December 28, 2012, 02:09:49 amIs this with a 50 ohm BNC cable terminated into 50 ohm at the scope end?Quote from: ftransform on December 28, 2012, 02:09:49 amUnlikely, but it's easy to stop the fan for a few seconds to see if it stops drifting.

author: ftransform
author_rank: Frequent Contributor
timestamp: December 28, 2012, 04:51:21 am
content: Quote from: alm on December 28, 2012, 03:24:37 amLol duh, stop the fan, I wish I thought of that!And yes it is connected BNC to BNC. I don't think its the cable because the overshoot does not appear when it is in 2vpp mode, so 2vpp mode max = no overshoot, but 2v pp on 20vpp mode = overshoot.

author: c4757p
author_rank: Super Contributor
timestamp: December 28, 2012, 05:07:37 am
content: Quote from: ftransform on December 28, 2012, 04:51:21 amWith a terminator? My function generator's higher frequencies look absolutely dreadful without a terminator, but they're just fine with one.

author: jerry507
author_rank: Regular Contributor
timestamp: December 28, 2012, 08:27:59 pm
content: Generator: Tektronix CFG280Scope: rigol 1052eSo no, he's got a (probably) 50 ohm BNC cable terminated in the scopes 1meg input. That's why he's got so much overshoot. If the output is stable it shouldn't have much effect on the frequency measurement though. Zoom in and make sure the scope's measurement points aren't jumping around.

author: ftransform
author_rank: Frequent Contributor
timestamp: December 29, 2012, 04:33:29 am
content: Quote from: jerry507 on December 28, 2012, 08:27:59 pmOk, but you need to read a bit more carefully. When the function generator is set to 2v PP mode and the output adjusted to 2v, there is no overshoot at 2V. When the function generator is set to 20v PP mode, and the output is adjusted to 2v, then there is overshoot.I would assume the 20v PP mode is less "ideal", but I am wondering if a 20% overshoot is not too great.Are the impedances of the function generator different on the 20v and 2v mode? I can't find this in the datasheet.

author: Unknown
author_rank: Unknown
timestamp: December 29, 2012, 04:58:49 am
content: Square wave aberrations are only specified into a 50 ohms impedance, so comparing open-circuit figures is kind of useless. Performance without termination will depend on cable length. Theoretically you should be able to get 100% overshoot or 50% undershoot, given the right cable length. This 'right' cable length may change with output frequency and amplitude, if the rise time changes. Maybe the output amplifier is slew-rate limited, making the rise time slower when it gets closer to full scale?

author: ftransform
author_rank: Frequent Contributor
timestamp: December 29, 2012, 05:18:06 am
content: Quote from: alm on December 29, 2012, 04:58:49 amI don't understand how a slow rise time could lead to a overshoot. Can you explain your idea differently?I would imagine that as more of a sine-wave then a overshoot square wave.And I don't think its the cable because the voltages and frequencies on the 2 ranges are identical.Does this have something to do with reflections? I will measure the rise time of the waveforms.Rise times appear to differ by only 2-3 nanoseconds.

author: Unknown
author_rank: Unknown
timestamp: December 29, 2012, 05:53:27 am
content: The output stage most likely consists of an output amplifier followed by a step attenuator. In 20Vp-p mode, the step attenuator does not attenuate. In 2Vp-p mode, it attenuates the signal from the output amplifier by a factor of ten. So 2Vp-p mode requires a higher slew rate from the output amplifier (20Vp-p before the attenuator) than 2Vp-p in 20Vp-p mode (2Vp-p before attenuation). This would result in a faster rise time in 20Vp-p mode.This is just speculation, however, I'm not really interested in trying to figure out how this device should perform under unspecified conditions. Either test with a proper 50 ohm terminator or accept that you're unable to test it, and assume it is working correctly.Attached is an illustration why I consider your measurements without termination meaningless. All three lines represent the same signal from a function generator. The white and gray trace were acquired with 1 Mohm input impedance and ~1m and ~3m of cable, the yellow trace is with the same ~3m cable and a 50 ohm terminator at the scope end. I'm sure I could get even larger differences if I tried a wider variety of cable lengths, or function generators.

author: BravoV
author_rank: Super Contributor
timestamp: December 29, 2012, 10:46:25 am
content: Its damn funny certain character just love to whine and keep whiningon how bad the signal while keep ignoring many people asked and suggested to get a proper termination.Alm, I think you should rest, you've been so generous and patience explaining thing and posting pic here which is becoming pointless.@OP , it seems like you still don't get it and this is my attempt, hopefully it works.Get one of this terminator with value of 50 Ohm, again... I repeat just in case you still too thick, NOT 75 Ohm terminator :Use a T bnc connector like below, put that 50 Ohm terminator like above at one end of that T connector, while the middle connector goes to your scope's BNC input, and the other end with the BNC cable to your FG.I believe this is not difficult and just don't know what to say anymore should this failed again, maybe this is a proof that certain people just don't "fit in" to play with this kind of gadget..

author: SeanB
author_rank: Super Contributor
timestamp: December 29, 2012, 10:53:00 am
content: I did crisp one of those by transmitting 1W into it...............

author: Unknown
author_rank: Unknown
timestamp: December 29, 2012, 12:42:11 pm
content: Quote from: BravoV on December 29, 2012, 10:46:25 amNot that it matters in this case, but for the benefit for anyone reading along: the best way (apart from using the internal terminator in the scope if available) is to use afeed-through terminator. This minimizes the length of the unterminated stub. Too bad they're kind of expensive, since they're produced/sold in much smaller numbers.I fully expect the OP to wire a 4.7 ohm wire wound resistor to a BNC tee with long hookup wires.Quote from: SeanB on December 29, 2012, 10:53:00 amSo get a larger terminator.

author: ftransform
author_rank: Frequent Contributor
timestamp: December 29, 2012, 02:22:26 pm
content: Quote from: BravoV on December 29, 2012, 10:46:25 ammaybe i don't have one on hand you dickhead

author: ftransform
author_rank: Frequent Contributor
timestamp: December 29, 2012, 02:27:51 pm
content: And I am still curious how the device behavior under unspecified conditions. Maybe I will learn something interesting.

author: SeanB
author_rank: Super Contributor
timestamp: December 29, 2012, 03:19:35 pm
content: If you do not have one but have the T you can do a reasonable approximation using a crimp BNC connector and a 47 or 51 ohm resistor stuck in the cable entry with the resistor lead forming the centre pin, and the other end folded over and soldered or crimped to the shell. Does work in a pinch.

author: ftransform
author_rank: Frequent Contributor
timestamp: December 29, 2012, 03:36:36 pm
content: I found one and it removes the overshoot. But why does the overshoot happen in the first place?

author: Unknown
author_rank: Unknown
timestamp: December 29, 2012, 03:58:14 pm
content: Beyond the 'you should terminate your transmission lines if you care about signal integrity':First look up what the frequency spectrum of an ideal square wave looks like (it would help to be familiar with Fourier decomposition). There are some demos around showing you what a square wave looks like if you only take a certain number of harmonics into account. Now take into account that there is no such thing as an ideal square wave; real signals have a finite rise time. This rise time depends on the amount of 'high' frequency content in the square wave. It might be instructive to compare this insight to an FFT of your signal on a scope.Now look up transmission lines, especially the behavior of both terminated and unterminated transmission lines. These will usually use sine waves or step signals as example. Figure out what will happen to the higher order harmonics of your signal using the same principles.

author: BravoV
author_rank: Super Contributor
timestamp: December 29, 2012, 04:36:50 pm
content: Quote from: ftransform on December 29, 2012, 02:22:26 pmQuote from: ftransform on December 29, 2012, 03:36:36 pmYou are welcome.See guys, this is the definitive proof that sometimes using the ass whippin methodworks very effectively rather than using civilized & polite method.

author: ftransform
author_rank: Frequent Contributor
timestamp: December 29, 2012, 04:47:53 pm
content: Quote from: BravoV on December 29, 2012, 04:36:50 pmno actually your cuntishness did not help me find a 50 ohm terminator any sooner.acting like a prick on the internet does not improve the ability to find components in my lab.And I still don't understand why the problem occurs. I thought a stair-step response happens with improperly terminated cables. This is just an overshoot, not a stair step.

author: ftransform
author_rank: Frequent Contributor
timestamp: December 30, 2012, 12:20:02 am
content: Quote from: PA0PBZ on December 29, 2012, 08:32:07 pmit looks like none of those. one spike.

author: PA4TIM
author_rank: Super Contributor
timestamp: December 30, 2012, 12:46:20 am
content: Why the overshoot happens is not easy to explain. It has to do with charge in cables, bad impedance matching and reflections.If you use TDR with a step and you leave the line open ( 1M is allmost open) you get the same effect.About the drift: the Tek is not " controlled" it is free running so it will not be very stable and not very accurate.The Rigol is also not very stable and accurate. Look the % accuracy up in your manual and then calculate the amount of Hz itvis allowed to be over or under. This is also not locked to a reference so it will drift to.Risetime measurements are tricky, the 1052 is 50 MHz so upto 5 MHz it will be close, above that not ( a square wave needs about 10X the BW for the scope to come close. But if you move the trace over the screen it will change too. So that should make you wonder.I used to have a 100 MHz Rigol, i made RRT measurements on diodes. Later I repeated them using a 350 MHz Hameg , a 200 MHz Tek, a 1GHz Tek and 1 GHz Philips. The results of the Rigol were a realy unbelievable far off. ( up to ten times to slow)Not to insult you, these experiments are very educational ( but it's a pity you only tried the given advises about terminators after several people told you) You used mHz and MHz, be carefull with that because 1 mHz is 0.001 Hz and 1MHz is 1000000 Hz. I think you are talking MHz only because the Rigol does not do mHz. But this is very confusing. Always use the right units. (capital letters or not)Also your reaction above, this is to explain you the reason of overshoot, how a squarewave is made ( Fourrier) but your reaction is more like, " I know better" and you give an answer that makes no sense , but you probably have no clue about what the picture shows.If you want to do precision measurements you need precision instruments. That is a good counter locked to a gps controlled OCXO, cesium or rubidium frequency standard. And a geberator locked to the same source. ( Iuse a trimble thunderbold, a HP-105 coupled to several counters and my R&S function generator is also coupled to the thunderbolt.

author: JuiceKing
author_rank: Regular Contributor
timestamp: December 30, 2012, 01:59:34 am
content: The hardware frequency counter in your Rigol scope is very good, but of course it has its limits, too. Here's a fun and fascinating video Dave made about relative frequency stability:Regarding transmission lines, waves and reflections, here are two videos that are really interesting and instructive.- Ken

author: ftransform
author_rank: Frequent Contributor
timestamp: January 12, 2013, 02:00:25 am
content: Quote from: PA4TIM on December 30, 2012, 12:46:20 amI do have a clue what that picture is showing and what the integers represent.And its a pity you don't know how to read (I don't have 300 pieces of test equipment and terminators etc around my work area, so I need to actually go out and buy stuff).And regardless of the terminators application the measurement could have been explained. I did ask why the result occurred. It is good to know a solution but I would still like my question answered rather then people trying to stuff 50 ohms up my ass and that it is too complicated to understand.*Perhaps you did not catch my sarcasm towards the post of the image. It was not explaining any question which I asked. The summation of odd harmonics picture was about as useful as a picture of a turkey. I fail to see how it explains over shoot in any way. Maybe it is obvious to you because you seem to have a career out of this stuff.I appreciate your input despite the condescending attitude btw.I did look at impedance mismatch scenarios but none of the examples I found matched what I see.http://www.avtechpulse.com/appnote/techbrief12/I wonder if maybe this waveform would look a bit different on a better scope. I wonder if perhaps if the described ringing is actually present but invisible on the rigol? My main confusion towards identifying this effect is the fact that ringing is not present on my scope, while it is present on all pictures describing the issue, leading me to believe there is a different explanation, after all why should I jump to the conclusion when my results do not look like the textbook answer?i.e. in some of daves videos when he complains about mismatch i can see clear ringing, it never looked like what I see.

author: vk6zgo
author_rank: Super Contributor
timestamp: January 12, 2013, 07:53:39 am
content: Quote from: ftransform on December 30, 2012, 12:20:02 amWhat he is showing you is how the original square wave is made up of multiple frequencies,all of which are in a particular phase relationship.Using a correctly terminated cable,they will retain that relationship,but if you use an unterminated cable,the phase relationship of themultiple frequencies are no longer maintained,as the cable will look like different wavelengths for each frequency.The type of ringing you describe also often appears in bandwidth limited systems,as the phase relationships change at the same time as the amplitude response rolls off.Each time there is a sudden change in the applied signal,the result is ringing,which is usually delayed enough as to appear as an overshoot on the next transition.But wait! There's more!The reason for the better result with the lower level signal could be several things:The load on the output amplifier may change, or the amp may run flat out all the time with attenuation switched in & out.The attenuators may be a better match for the line than the amp alone, & reduce the effect of the reflected wave.Because of these imponderables,it is best to use a terminated system.There are some "very smart cookies" on this forum who can probably give you "chapter & verse" on this stuff,if you let them!(See " Speed of waves through coaxial cable experiment"in this forum)

author: jahonen
author_rank: Super Contributor
timestamp: January 12, 2013, 09:06:05 am
content: Uhh, not quite due to harmonics misalignment, but because of the superposition of reflected and incident waves.I think it is perhaps easiest to think the reflections using a single pulse and how it travels back and forth to avoid complicating things by harmonics, which is anyway tedious when duty cycle is not 50%. By then thinking how incident and reflected pulse will superimpose at the ends, gives an idea why the overshoot occurs. For example, a source termination, which is commonly used in digital world, relies just on the principle that reflected and incident waves are exactly half of the final amplitude.This works about as follows: the driving gate is connected via a series resistor to the transmission line. Now, as we know, the input impedance of a lossless transmission line is initially equal to the characteristic impedance of a transmission line, which is completely resistive for lossless case.Now, the voltage is exactly half of the driving gate output voltage due to a voltage divider formed by the series resistor and the transmission line impedance. This produces a wave traveling towards the load end. Now when the load end is reached, where the load exists without any termination (let's assume that the load has infinite input impedance), the incident wave sees an impedance discontinuity and produces a reflected wave. This is because energy can't change to other form instantaneously. Any disturbance of voltage to current ratio produces an impedance deviation.The amplitude of the reflected wave can be calculated using the reflection coefficient formula (Zl-Zs)/(Zl+Zs) so we have reflection coefficient at the load (inf-50)/(inf+50) = 1. Now since the incident wave had an amplitude of 0.5, and reflected wave will be equal to the incident wave, the load will see pulse height exactly equal the driving amplitude without any distortion (incident wave of 0.5 + reflected wave of 0.5 = 1).But what happens to the reflected wave after that? Well, it starts to travel towards the driving gate. Now, when it reaches the driving gate, it will see the characteristic impedance of the transmission line, and again, by the reflection coefficient formula, this time the reflection coefficient is zero (50-50)/(50+50)=0 so no reflected pulse is produced.Now if we would not have a resistor driving the line, the incident wave amplitude would have been equal to 1, and corresponding reflection would also be 1. Then the load end would see double the original pulse height, thus the overshoot would be enormous. Another possibility is that the source resistor is too high. This will also produce reflections but this time the result is such that initial pulse fails to rise to final height, and several round-trips is required before the output voltage rises to final value.Here is a scope picture taken from the load end which illustrates two of these cases:It shows both edges and also demonstrates a common problem for casual logic gates driving a transmission line. This gate has different output impedances in '0' and '1' states, so we can't make perfect termination with just simple series resistor (although acceptable compromise can be achieved).The rising edge can be seen to be almost perfect. The output impedance of the logic gate along with a series resistor equals the transmission line impedance pretty much exactly. The falling edge shows exactly what happens when the driver has lower impedance than the transmission line, an overshoot (or undershoot here because of falling edge) happens. The "ringing" is actually a series of reflected edges fading out gradually. Note that the frequency of a signal is irrelevant here, this kind of signal can be seen even with single edge.I don't know if this is a very good explanation how reflections and overshoots work in digital stuff but it certainly works for me.Regards,Janne