Is this standard tolerance for square wave generator output? - Page 1
Forum section: electronics / beginners

author: pwnell
author_rank: Regular Contributor
timestamp: December 13, 2020, 09:47:21 pm
content: I have a Rigol MSO5104 scope and tested its built in AWG. I have read that it is only a basic waveform generator and not very good, so I am wondering if the square wave output I measured is within spec. I get that a square wave has lots of extra harmonics and that these get attenuated more the higher the frequency of the harmonic, hence distorting the wave. However the max output of the AWG is 15MHz for a square wave, the scope is 100MHz and should deal with a 100/5 = 20 MHz square wave just fine. And as I understand it, due to the oversampling (8GSa/s) it should even be fine for higher frequency square wve signals...So I tested 1kHz - looks good to me.Then 10kHz - still good.At 1Mhz I can see some overshoot at the rise of the wave, but it still looks decent.At 10MHz it is not really a square wave any longer.At 15MHz it looks more like a distorted sine wave.That said - is this to be expected?Oh - I forgot to mention, I am using the standard 10x passive probe connected to a 50ohm BNC cable from the function generator to try and eliminate wave reflections.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: December 13, 2020, 09:57:50 pm
content: Your squarewave looks quite normal for the output of a function generator. These things have filtering inside and also opamps which are optimized for analog use and have a limited slewrate.

author: rstofer
author_rank: Super Contributor
timestamp: December 14, 2020, 12:08:10 am
content: It looks about right. Getting to the 5th harmonic doesn't produce a very good square wave. Maybe the 9th? In which case, a 100 MHz scope will have a decent display of a 10 MHz square wave.https://www.khanacademy.org/science/electrical-engineering/ee-signals/ee-fourier-series/v/ee-visualize-fourier-series-square-waveThere are many animations on the Internethttp://www.sigcon.com/Pubs/edn/TaketheFifth.htmThere's a bunch of math behind this.

author: pwnell
author_rank: Regular Contributor
timestamp: December 14, 2020, 12:15:25 am
content: Hmm but my 10MHz square wave is not very good, so does that mean it is the AWG or the scope input that is causing this? Unfortunately I do not have another scope to test with.

author: rstofer
author_rank: Super Contributor
timestamp: December 14, 2020, 12:24:46 am
content: If it shows rounding, it is very probably the bandwidth limitation of the scope. The way to test the scope is with a very fast rise time square wave generator. BandWidth (GHz) = 0.35 / RiseTime (ns) for whatever the scope shows for 10%-90% risetime. A 100 MHz scope should have 3.5 ns risetime. There are some fast rise time circuits around this forum. Probably search for 'risetime'

author: MarkF
author_rank: Super Contributor
timestamp: December 14, 2020, 02:00:43 am
content: Here is a fast (2ns) rise time pulse generator:I only used four inverters with 200Ω resistors to get exactly a 50Ω output.Here is what I built with a switchable input of the oscillator or an external source (via a jumper):

author: srb1954
author_rank: Super Contributor
timestamp: December 14, 2020, 02:14:01 am
content: Quote from: pwnell on December 13, 2020, 09:47:21 pmDid you terminate the end of the BNC cable with a 50load? You will need this to get proper pulse fidelity as a 10x passive probe doesn't present the correct termination load to the cable and you may get ringing on the waveform.A better option for maximum pulse fidelity is to run a 50cable direct to the scope's BNC input, through a feed-through 50BNC to BNC termination.

author: pwnell
author_rank: Regular Contributor
timestamp: December 14, 2020, 02:41:20 am
content: Like this? Bnc Adapter, P57 1 Stks 50ohm Feed Through Terminator Bnc Seat 50ky Device Q9 Adapterhttps://www.amazon.ca/dp/B07SD3TC51/ref=cm_sw_r_cp_api_fabc_PaT1FbZ9MH67M

author: srb1954
author_rank: Super Contributor
timestamp: December 14, 2020, 02:50:42 am
content: Yes

author: pwnell
author_rank: Regular Contributor
timestamp: December 14, 2020, 03:09:34 am
content: Ordered one, will test. Might also try and build that circuit if I can find the components. Thanks for the help.

author: S. Petrukhin
author_rank: Super Contributor
timestamp: December 14, 2020, 05:16:19 pm
content: Quote from: pwnell on December 14, 2020, 03:09:34 amСan't the scope itself connect a 50\$\Omega\$ resistor? In the generator output settings, there is an output type.

author: pwnell
author_rank: Regular Contributor
timestamp: December 14, 2020, 05:18:16 pm
content: Yes - that is the output impedance of the AWG that is 50 ohm. But the input terminal of the scope is 1M (HighZ) and cannot be adjusted.

author: S. Petrukhin
author_rank: Super Contributor
timestamp: December 14, 2020, 07:01:50 pm
content: Quote from: pwnell on December 14, 2020, 05:18:16 pmIt seems to me that one resistor on any side is enough.

author: TimFox
author_rank: Super Contributor
timestamp: December 14, 2020, 07:22:35 pm
content: With only a 50 ohm resistor at the source, your cable is “series terminated”, and the voltage waveform at the high impedance load should be correct. It will have twice the amplitude of the “double terminated” case with a 50 ohm load added. However, the double termination will be less sensitive to deviation of either resistance or cable impedance from nominal value.

author: alsetalokin4017
author_rank: Super Contributor
timestamp: December 15, 2020, 05:56:52 am
content: Something is wrong somewhere in the OP's setup. Or, if not exactly wrong, not exactly right either. I'd like to see the test redone with a 50 ohm thru terminator at the scope input.Here's my (unlocked) DS1054Z looking at a fast-edge oscillator circuit similar to MarkF's above, except using 74HC14n (didn't have any AC versions on hand).My FEO isn't even built on a PC board with BNC connectors, it's just soldered together on vectorboard and using JST type 2-pin connection to a 50 ohm generic cable to a 50 ohm feedthru terminator at the scope end.

author: pwnell
author_rank: Regular Contributor
timestamp: December 15, 2020, 07:08:05 am
content: I am going to pick up a Schmitt trigger and try this...

author: srb1954
author_rank: Super Contributor
timestamp: December 15, 2020, 08:19:39 am
content: Quote from: TimFox on December 14, 2020, 07:22:35 pmScope amplifier and probe bandwidths are generally measured/specified with a double terminated signal source to maintain best signal fidelity and to reduce the effect of the input capacitance of the scope input or probe degrading the test signal risetime.

author: MarkF
author_rank: Super Contributor
timestamp: December 15, 2020, 04:44:31 pm
content: Looking at the DS1000Z's AWG square wave output specs, the bandwidth is0.1 Hz to 15 MHz.I'm not surprised that the edges roll off near the bandwidth limit. Just what I would expect to see.I would be interested to see the square wave output from another DS1000Z's built-in Arbitrary Function Generator.I believe most Function Generators specify their bandwidth as the sine wave.However, their square wave bandwidth falls far short of that of the sine wave bandwidth.As far as doing the measurement:I would NOT use a combination of a 50Ω coax and the 10X probe.Just make the 1X connection with the 50Ω coax cable.Then, add the 50Ω in-line termination,at the scope input, when you get one.

author: David Hess
author_rank: Super Contributor
timestamp: December 15, 2020, 09:22:08 pm
content: That looks about right for a higher frequency function generator. The waveform fidelity is limited by the linear output amplifier. Pulse generators can produce much faster square waves because their output amplifier does not need to be linear.Linear amplifiers which can drive 10 or even 20 volts peak-to-peak at 10s of MHz are not trivial so it is expected that higher frequency square waves will have considerable distortion.

author: alsetalokin4017
author_rank: Super Contributor
timestamp: December 16, 2020, 03:07:03 am
content: Output of an antique DataPulse DP-101 pulse generator, topped out at just over 10 MHz:DP101 > 6 feet of RG58/U > 50 ohm thru terminator > scope

author: pwnell
author_rank: Regular Contributor
timestamp: December 16, 2020, 03:14:06 am
content: @MarkF so I built your circuit as close I could. I used a 74AC14 and the same components as you. Hooked up VCC to +5V from my bench supply, and gnd to -. I used the 10x probe and looked at the signal. Here is the circuit and the waveforms. Thoughts? I have a 3.75ns rise - is that fast enough? I looked at the datasheets for an 74AC14 and the only time I could find that might be rise time is tPLH which is 1.5ns to 11ns @ 5V which seems much higher than the 2.5 you got.

author: alsetalokin4017
author_rank: Super Contributor
timestamp: December 16, 2020, 04:10:31 am
content: Not too bad for a breadboard. It's actually kind of amazing that you got that good a result from your breadboard and standard probe. It will be even better when you connect directly with coax and a 50 ohm thru terminator at the scope, instead of using your regular 10x probe.

author: pwnell
author_rank: Regular Contributor
timestamp: December 16, 2020, 04:42:32 am
content: Ps I mistyped my original post. I have a Rigol MSO5104 scope (100MHz)

author: pwnell
author_rank: Regular Contributor
timestamp: December 16, 2020, 05:11:57 am
content: So I just connected the output of the circuit directly to the coax t splitter attached to my oscilloscope with one end of the t attached to a 50 ohm coax terminator. It made no difference except to attenuate the signal. Rise time stays fixed at 3.6ns

author: MarkF
author_rank: Super Contributor
timestamp: December 16, 2020, 07:46:14 am
content: Here is output for comparison:I seem to remember that the actual measured bandwidth of the 100MHz DS1000Z is around 160MHz.So, 3.2ns is about all the scope will be able to measure.

author: alsetalokin4017
author_rank: Super Contributor
timestamp: December 16, 2020, 08:26:42 pm
content: @MarkF: Your trace is plotted at 5 V/div vertically, is this correct?Also I am surprised that my Fast Edge result (2.35 ns risetime) is so much better than yours (3.20 ns), since my construction technique and connections are not as good as yours and I am using the HC version of the chip rather than the AC version. Is your scope unlocked to full bandwidth? (see my reply #14 above for the trace from my scope and FEO)

author: pwnell
author_rank: Regular Contributor
timestamp: December 16, 2020, 09:41:27 pm
content: I tried again, this time using a 74HC14N. It did not make a real difference. Tried 50ohm termination directly attached to the scope - then it got worse - 5ns, remove 50 ohm termination then it bounces back to 3.2ns to 3.7ns depending on the position of my tongue.However I think the point is, the scope shows a fast rising and falling edge just fine. So my issue is definitely with the output of the square wave generator built in to the MSO5104. I also tested it again with a 50ohm terminator (I use a BNC T adaptor with a 50 ohm terminator on one end and the other connected to a BNC 58 cable connected to the output of the AWG on the same scope. The AWG output is set to 50 ohm, the scope is HighZ but with the attached 50 ohm terminator. (I have not yet received my through terminators).Here is the comparison (second image):Yellow = without terminator, red is with terminator. Since this did not affect the rise time which is quite high for a square wave that should have a half period of 33.33ns, I guess it is just the quality of the built in AWG. A rise and fall time of ~12ns means the wave lost 12ns so there is only 21ns "on" and 21ns "off. Interesting.

author: srb1954
author_rank: Super Contributor
timestamp: December 17, 2020, 01:40:25 am
content: Quote from: pwnell on December 16, 2020, 09:41:27 pmThe AWG waveform would appear to be slightly better than the datasheet specified performance of 15ns rise and fall time. I would say that there is nothing particularly wrong with the operation of the AWG.If you need higher performance then you will probably have to go for an external dedicated AWG or function generator. However, be prepared to spend quite a bit of money if you want to get significantly better performance.

author: pwnell
author_rank: Regular Contributor
timestamp: December 17, 2020, 02:15:37 am
content: I have a DG972 on order that will ship out in a couple of days... Will compare them once it arrives.

author: gcewing
author_rank: Regular Contributor
timestamp: December 17, 2020, 02:19:04 am
content: If your scope has a "sinc interpolation" mode or some such you might like to make sure it's turned off. It can make high-frequency waveforms look more curvey than they really are.

author: pwnell
author_rank: Regular Contributor
timestamp: December 17, 2020, 02:41:23 am
content: I looked for it but do not believe the MSO5104 has that option...

author: Bud
author_rank: Super Contributor
timestamp: December 17, 2020, 04:20:54 am
content: Quote from: S. Petrukhin on December 14, 2020, 05:16:19 pmThe output type is only to properly show the output signal level . Nothing is physically switched in the output.

author: MarkF
author_rank: Super Contributor
timestamp: December 17, 2020, 11:27:36 am
content: Quote from: alsetalokin4017 on December 16, 2020, 08:26:42 pmI had a 50Ω coax cable and 50Ω thru terminator connected from my PCB to the scope.You need to ignore the vertical values.The scope thinks it has a 10x probe connected instead of a 1:1 cable.I didn't bother to change the vertical settings.YES. My scope is an unlocked DS1074Z to 100MHz bandwidth.If I'm thinking correctly here (i.e. a triangle waveform with these rise and fall times):bandwidth = 1 / (rise_time + fall_time) = 1 / (3.2ns + 3.4ns) = 151MHzas my measured bandwidth of the scope. Assuming, the edges are faster than the scope can measure.By my same calculation:Your 2.35ns rise time with the same fall time would result in a 212MHz bandwidth.Are you summing four outputs or five? It looks like you amplitude is 500mV higher than mine.I must be looking at this totally wrong???

author: radiolistener
author_rank: Super Contributor
timestamp: December 17, 2020, 02:56:42 pm
content: Quote from: MarkF on December 17, 2020, 11:27:36 amfor 10%/90%: bandwidth = 0.35 / rise_timefor 20%/80%: bandwidth = 0.22 / rise_timein your case bandwidth = 350 / max(3.2, 3.4) = 102 MHz

author: alsetalokin4017
author_rank: Super Contributor
timestamp: December 17, 2020, 03:29:51 pm
content: @MarkF:My FEO uses 5 summed outputs of the Texas Instruments SN74HC14N chip and the sixth gate for the oscillator. I think when I built it I selected the resistors to match closely, fwiw. As far as amplitude goes it's a matter of power supply setting between 3-6 volts, but this doesn't seem to affect the risetime.I know I have some AC versions around here somewhere that I can try when/if I find them. Like I said, I would expect yours to be faster since you used the BNC connector and your circuit is nice and tight, whereas mine is spread out more on the perfboard, no ground plane, and I used a socket for the chip. Maybe I just got lucky and got hold of a chip that exceeds tolerance, it does happen.

author: MarkF
author_rank: Super Contributor
timestamp: December 17, 2020, 04:16:25 pm
content: My chip is in a socket also.I added the BNC external input to buffer the square wave output from my DIY Function Generator.In buffering the BNC input, I used one of the five gates.This gate buffers both the oscillator and the external input.Therefore, I only have four gates driving my output. You have a little more drive power.Maybe my rise time is slower because the four gates don't have the power to drive a 50Ω load?

author: radiolistener
author_rank: Super Contributor
timestamp: December 18, 2020, 02:58:11 pm
content: Quote from: MarkF on December 17, 2020, 04:16:25 pmTry to measure amplitude for on two different load. For example for 25 Ohm and 100 Ohm. What is amplitude? It allows to determine exact output impedance.

author: pwnell
author_rank: Regular Contributor
timestamp: December 18, 2020, 09:55:13 pm
content: So I went a bit crazy. Since I do not have the tools to build a properly laid-out circuit board for this level of performance, I picked upone of these- a (certified) 40ps pulse generator.So I attached it directly to the 1MOhm input of my scope, triggered on it and got a poor 2.299ns rise time. According to 0.4/2.299e-9 that gives 173MHz bandwidth (my scope should do 350MHz). The shape of the square wave is beautiful though. See below.So I got a brief moment of insight and decided to use my newly acquired 50ohm through terminator. With that in the pathway between the generator and the scope, I got the signal below - 860ps rise time. That yields 0.4/860e-12 = 465MHz or 407MHz if you use 0.35 instead. The signal however does have more overshoot.If I change the scale to 1ns per div I get a rise time of 752ps (532MHz). Not sure if at this scale it is still accurate.And comparing the overshoot with 50ohm terminatorand without