0
\$\begingroup\$

I'm generating sine waves by using a micro-controller and DDS module. The output sine normally swings always positive between 0 to around 1V. But I want to generate a real alternating sine with symmetric swing.

If I AC couple via a scope the sine output becomes absolutely symmetric. For instance if the sine wave Vpp is 1.04V. Scope's AC coupling results a swing between -520mV to +520mV.

But if I myself AC couple with an RC high pass filter with 22uF cap and a 1Meg resistor the scope in its DC setting shows a sine with around 10mV error between the swings I observe a swing between -512mV to +528mV.

What could be the reason and how can I fix this to a symmetric swing?

EDIT:

Unfortunately using such large cap for AC coupling to obtain frequency independent solution has problem. I first observed this after sampling the data in plot. This new problem is not related to leakage or DDS offset ect. The problem is the response time is too long when switching from one frequency to another. By response time I mean the time taken for the sine to take its final form when the DDS sine output freq. is varied.

I simulated the circuit to show what I mean see green plot decaying(for this case not that bad but depending on when it is varied and freq. change that decay varies a lot):

enter image description here

Above freq. is switched from 0.1Hz to 1Hz. Response is even worse for different frequencies. I don't need a crazy fast response but definitely this is not reliable. And here from a real data acquisition shows the bottom of the sine wave how it is varying for many seconds. I also observed more weird transitions for different frequency changes:

enter image description here

Basically the above RC AC coupling will not work for me.

So I think my last solution is to remove the offset by a circuit like this:

enter image description here

If I use the above technique there is no issue with the response time. But I need to find a way to fine tune the 1V by a voltage divider and rely on Vref will be stable and DDS have same offset. Anything can be improved for this above circuit?

\$\endgroup\$
  • \$\begingroup\$ Have you checked your 'scope DC offset? It might need calibration \$\endgroup\$ – glen_geek Nov 22 '18 at 14:32
  • \$\begingroup\$ No the scope is fine see the comments below. \$\endgroup\$ – floppy380 Nov 22 '18 at 14:41
  • \$\begingroup\$ Does the output of the DDS swing symmetrically around 0.5V? Does it make it's reference voltage available? \$\endgroup\$ – TimWescott Nov 22 '18 at 15:26
  • \$\begingroup\$ I took a video there is some shaky behavior due to DDS output vimeo.com/302285649 But I cant verify that would be the reason. \$\endgroup\$ – floppy380 Nov 22 '18 at 15:28
  • \$\begingroup\$ @TimWescott These pins are accessible 2.bp.blogspot.com/-f28-j1b6mqU/UyXHhSdXL9I/AAAAAAAABLA/… \$\endgroup\$ – floppy380 Nov 22 '18 at 15:36
3
\$\begingroup\$

Either your capacitor has some leakage so it causes a bias in the output voltage:

schematic

simulate this circuit – Schematic created using CircuitLab

Or whatever you are connecting it to has some nA of bias current, or both.

The offset is dependent on the ratio of the leakage to the load resistor in the first case. If you are using an electrolytic capacitor you could change to a low-leakage type or to a film or ceramic type. Increasing the value of C1, if it remains an electrolytic, will not necessarily help because the leakage tends to increase with capacitance for the same type of electrolytic cap.

Edit:

schematic

simulate this circuit

\$\endgroup\$
  • \$\begingroup\$ I replaced the cap with a ceramic 1uF, and I still have some offset problem. Most importantly the reason I was using 22uF was to make the output amplitude independent on freq. range between 0.1Hz to 1kHz. But now with 1uF I lost that stability. . Output shrinks at low frequencies. How could I workaround this issue? I can use opamp if it would help. \$\endgroup\$ – floppy380 Nov 22 '18 at 13:46
  • \$\begingroup\$ What are you connecting the output to? Your oscilloscope? Test that with only a 1M resistor across the input and see if there is much DC offset. If you have something else connected, test that. \$\endgroup\$ – Spehro Pefhany Nov 22 '18 at 13:49
  • \$\begingroup\$ Yes to a scope, nothing else connected to the scope or test. I did what you suggested. The output is only coupled to only a 1Meg resistor and I observe with a scope. There is still some offset on AC coupling. I observe less offset if I use 10X setting I didnt verify it though 100%. If I use a small cap fro AC coupling like 1uF the issue is the signal attenuates too much and SNR decreases. But there is no stable cap for 22uF I guess. I really need the amplitude remain the same at 0.1Hz upto 1kHz. \$\endgroup\$ – floppy380 Nov 22 '18 at 14:06
  • \$\begingroup\$ I observed another issue, the sine wave from the DDS module is shakey. I uploaded the video of 10 sec scope screen here vimeo.com/302285649 This issue is same if I directly couple the output to scope without RC. \$\endgroup\$ – floppy380 Nov 22 '18 at 15:01
  • \$\begingroup\$ What is your actual requirement for maximum DC content? A 22uF film cap (about $5 US one-off) and a 1M resistor with an appropriate op-amp buffer (eg. ADA4661) with +/-5V supplies should give < 100uV offset. If your PCBs are clean and reasonable care is taken. \$\endgroup\$ – Spehro Pefhany Nov 22 '18 at 15:06
2
\$\begingroup\$

Well, you are using a very large resistor with a large (very likely electrolytic) capacitor. Capacitors have leakage, electrolytic capacitors even more so. How much leakage is acceptable depends on your application, and you choose capacitors accordingly.

10nA of leakage, which is quite acceptable in most power supply applications, imply 10mV of DC thanks to your using a 1Mohm resistor.

\$\endgroup\$
  • \$\begingroup\$ So replace the 22uF cap with the largest ceramic cap you have available (it might be 1 uF but that's OK) and check again. \$\endgroup\$ – Bimpelrekkie Nov 22 '18 at 13:12
  • \$\begingroup\$ I replaced the cap with a ceramic 1uF, and I still have some offset problem. Most importantly the reason I was using 22uF was to make the output amplitude independent on freq. range between 0.1Hz to 1kHz. But now with 1uF I lost that stability. Output shrinks at low frequencies. How could I workaround this issue? I can use opamp if it would help. \$\endgroup\$ – floppy380 Nov 22 '18 at 13:46
  • \$\begingroup\$ At 0.1Hz SNR decreases a lot and the signal attenuates, where I need a fixed amplitude between 0.1Hz to 1kHz. \$\endgroup\$ – floppy380 Nov 22 '18 at 14:07
  • \$\begingroup\$ @user1234 ceramics can also have leakage. 1Mohm is not very forgiving. Go back to the electrolytic and reduce the resistor instead. Your leakage can also be coming from the instrumentation you are using (e.g., your oscope). \$\endgroup\$ – Edgar Brown Nov 22 '18 at 14:09
  • \$\begingroup\$ @EdgarBrown Alright I will also try to check with a DAQ board. \$\endgroup\$ – floppy380 Nov 22 '18 at 14:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.