Author Topic: Generating Sine Wave for LCR Meter  (Read 3864 times)

0 Members and 1 Guest are viewing this topic.

Offline MattHollandsTopic starter

  • Frequent Contributor
  • **
  • Posts: 313
  • Country: gb
    • Matt's Projects
Generating Sine Wave for LCR Meter
« on: May 01, 2015, 10:09:22 pm »
Hi!

I would like to design and build my own LCR meter. The way it will operate (I think) is that it will generate either a 100Hz, 1kHz or 10kHz sine wave, pass this through a known resistor in series with the DUT and measure the voltage drop across known resistor, voltage drop across DUT and potentially look at phase shifts too.

What I am trying to do first is generate the sine wave to pass through the DUT. My current idea is for the uC to generate a square wave which I will then filter to get a nice sine wave.

I'm using the Art of Electronics to help design a Butterworth filter (eventually hopefully 6-pole). My current tests however are giving me some odd results.

I'm simulating the design for a 100Hz, 2 pole low pass filter as specified on page 408 of the 3rd edition of the Art of Electronics, however I'm not quite getting the output I would expect in LTSpice. There appears to be a DC shift in the signal! And an unusual amount of gain (see attached images).

Is this what is expected with a low pass butterworth filter? Is this an error in the simulation? Do I have the circuit wrong?

I'm sorry that this is only simulation as I don't have the equipment with me for a few months to actually build the circuit.

Thanks  :)
« Last Edit: May 01, 2015, 10:12:54 pm by MattHollands »
Read about my stuff at: projects.matthollands.com
 

Offline bugs

  • Contributor
  • Posts: 31
  • Country: 00
 

Offline MattHollandsTopic starter

  • Frequent Contributor
  • **
  • Posts: 313
  • Country: gb
    • Matt's Projects
Re: Generating Sine Wave for LCR Meter
« Reply #2 on: May 03, 2015, 12:23:46 am »
Thank you, that does look like it could potentially be a good option for me. But I would still like to know where this DC shift is coming from!
Read about my stuff at: projects.matthollands.com
 

Online Marco

  • Super Contributor
  • ***
  • Posts: 6939
  • Country: nl
Re: Generating Sine Wave for LCR Meter
« Reply #3 on: May 03, 2015, 12:37:07 am »
You are getting too near the rail on the opamp ... you need to give it a negative supply. That said, it's not truly necessary to generate a sine for this ... you could just use a square and filter out the fundamental during detection (with a single frequency discrete fourier transformation, ie. multiplying with a sine and a cosine). As long as the component is linear it doesn't matter.

PS. of course the square wave generally still shouldn't have a DC component.
« Last Edit: May 03, 2015, 12:41:47 am by Marco »
 

Offline LvW

  • Frequent Contributor
  • **
  • Posts: 282
  • Country: de
Re: Generating Sine Wave for LCR Meter
« Reply #4 on: May 04, 2015, 01:25:24 pm »
There are several options for creating a sine wave.
In order to be able to select one of the many methods (one of various sine wave oscillator concepts or square wave generator with filtering) it is necessary to know some details of your requirements - in particular:Signal amplitudes and signal quality (THD values). 
 

Offline ivan747

  • Super Contributor
  • ***
  • Posts: 2046
  • Country: us
Re: Generating Sine Wave for LCR Meter
« Reply #5 on: May 04, 2015, 01:35:43 pm »
There is a DC offset on the sine wave because there is a DC offset on the square wave! The square wave goes from 0V to 5V, that is an offset of +2.5V. You'd have to generate a -2.5V to 2.5V square wave or use AC coupling on the op amp input.
 

Offline Richard Crowley

  • Super Contributor
  • ***
  • Posts: 4319
  • Country: us
  • KJ7YLK
Re: Generating Sine Wave for LCR Meter
« Reply #6 on: May 04, 2015, 02:34:17 pm »
Magic Sinewave Sourcecode: Some PIC Programming Guidelines
Quote
A new class of math functions called Magic Sinewaves now lets you efficiently produce power sinewaves that can have any chosen number of low harmonics forced very near zero. And do so using the fewest possible switching events for the highest possible energy efficiency. Two new intros appear here and here, along with a development proposal here, a tutorial here, visualizations here , jitter and distortion analysis here, lots of calculators here, some evaluation chips here and seminars and workshops here.

Successful magic sinewave sourcecode development seems to need a unique programming style. Combined with non-obvious and often non-mainstream techniques required to create useful real world devices. In this GuruGram, we will be looking at my programming techniques for PIC based magic sinewave sourcecode development and evaluation.

The latest fully tested and professional sourcecode is now readily available to commercial users at quite reasonable pricing. As are custom new designs. Free older sourcecode has been posted to my website for possible limited demo use by students or low budget home experimenters....
http://www.tinaja.com/glib/mspicpro.pdf

Even though the title mentions PIC, the principles apply to any microcontroller.
Don Lancaster is a prolific inventor, engineer and author of many popular books like "TTL Cookbook", "TV Typewriter Cookbook", "CMOS Cookbook", "Active Filter Cookbook", etc. etc.
 

Online Marco

  • Super Contributor
  • ***
  • Posts: 6939
  • Country: nl
Re: Generating Sine Wave for LCR Meter
« Reply #7 on: May 04, 2015, 04:13:30 pm »
I think the most flexible excitation source would be an adjustable amplitude AC square wave current with adjustable DC offset, with some resistors you can switch in in parallel with the DUT, this would work for pretty much everything.
« Last Edit: May 04, 2015, 04:30:10 pm by Marco »
 

Offline Sparc

  • Contributor
  • Posts: 16
Re: Generating Sine Wave for LCR Meter
« Reply #8 on: May 04, 2015, 08:53:28 pm »
I don't know if you were looking for only an analog solution.  But, a pretty good sine wave can be made with a microprocessor and a DAC.  Your computer and sound card should be good.   :)   There is a published project that uses the computer and sound card to make an RLC impedance bridge.  I tried it out some years ago and it worked as I remember.  The downside was that it monopolized the sound card and needs a computer.

http://wb6dhw.com/RLC_Meter/N%20LMS%20Impedance%20Bridge.pdf
http://traktoria.org/files/software/LMS_Impedance_Bridge/
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf