sine to cosine converter

Discussion in 'The Projects Forum' started by dayalrohan, Sep 22, 2010.

  1. dayalrohan

    dayalrohan Thread Starter New Member

    Joined:
    May 28, 2009
    Messages:
    7
    Basically I want a circuit that can convert a sine wave to cosine wave.

    I cannot use a passive circuit like LR circuit since my frequency of operation is very low ( a few Hz) so the passives would be very huge.

    What I was trying to do was a op-amp differentiator circuit ; since differentiation of sine is cos.

    The image of the circuit I am using is attached.

    [​IMG]http://img683.imageshack.us/i/circuitl.jpg/

    My values are R2=157k,R1=1k, C1=.1u, C2=220p : input frequency - 10 Hz

    However, I am getting a distortion as shown below
    [​IMG]
    http://img215.imageshack.us/i/waveforms.jpg/

    Any comments/suggestions?
    If there is any other way of doing this, I am open for it.
  2. tom66

    tom66 Senior Member

    Joined:
    May 9, 2009
    Messages:
    2,613
    Location:
    Basingstoke, UK
    The LM101A is a very old operational amplifier. It would probably be better to substitute in an op-amp with lower cross-over distortion, which is likely causing the distortion you see.
  3. dayalrohan

    dayalrohan Thread Starter New Member

    Joined:
    May 28, 2009
    Messages:
    7
    Oh!! The circuit was just for reference.

    I am using TLC2201IP,
    Low Noise Precision Rail-To-Rail Output Operational Amplifier
  4. tom66

    tom66 Senior Member

    Joined:
    May 9, 2009
    Messages:
    2,613
    Location:
    Basingstoke, UK
    What are the values of R1, R2 and R3?

    I would suggest you drop C2, R2 and R3 and see how it works.
  5. dayalrohan

    dayalrohan Thread Starter New Member

    Joined:
    May 28, 2009
    Messages:
    7
    My values are R2=157k,R1=1k, C1=.1u, C2=220p : input frequency - 10 Hz

    R3 is arbitrary around 10k I think, no change in dropping that resistor.

    C2 was a later add-on to my circuit ( in the hope of mitigating "noise" )

    ;the only change that I see on adding it is absence of little spikes (even smaller than the ZC distortion).

    Why would I drop R2 ?
    this with C1 forms the differentiator.

    Also, I might add, I had similar waveform with the ubiquitous UA741, anything in my connections/values that may be causing this?
  6. tom66

    tom66 Senior Member

    Joined:
    May 9, 2009
    Messages:
    2,613
    Location:
    Basingstoke, UK
    R2 is not part of the differentiator. Only R1 and C2, as well as the op-amp, form the differentiator. All the other components are unnecessary in a traditional differentiator.

    I think R3 should the same as R1 || R2, or about 993 ohms, so change the 10k to 1k. R3 only helps with minimizing input current offset.
  7. dayalrohan

    dayalrohan Thread Starter New Member

    Joined:
    May 28, 2009
    Messages:
    7
    I think one of us is getting confused :)

    http://www.ecircuitcenter.com/circuits/opdfr/opdfr.htm

    so R2 and C1 should form the differentiator, not R1 and C2 (that is a traditional integrator).

    I will try the R3 change though and just R2 and C1 as well.
  8. tom66

    tom66 Senior Member

    Joined:
    May 9, 2009
    Messages:
    2,613
    Location:
    Basingstoke, UK
    Yeah, sorry. Doing too many things at once. R2 and C1. But the other components are unnecessary for now.
  9. Ghar

    Ghar Active Member

    Joined:
    Mar 8, 2010
    Messages:
    655
    Location:
    Toronto Canada
    R1 does not influence DC performance because of C1.
  10. tom66

    tom66 Senior Member

    Joined:
    May 9, 2009
    Messages:
    2,613
    Location:
    Basingstoke, UK
    Doesn't it reduce the offset voltage due to input current?
  11. Papabravo

    Papabravo AAC Fanatic!

    Joined:
    Feb 24, 2006
    Messages:
    5,879
    Location:
    Michigan, USA (GMT-5)
    You can also use an integrator to convert a sine to a cosine. If you have a choice between an integrator and a differentiator you should always choose the integrator.
  12. JoeJester

    JoeJester AAC Fanatic!

    Joined:
    Apr 26, 2005
    Messages:
    2,414
    Location:
    Grand Prairie, TX, USA
    The OPs component's values failed to follow the Application Note.

    Consider this simulation using the TLC 2201 and the Application Note:

    Attached Files:

    Last edited: Sep 24, 2010
  13. t06afre

    t06afre AAC Fanatic!

    Joined:
    May 11, 2009
    Messages:
    5,939
    Perhaps it would be more easy for you to create a "quadrature oscillator" such an oscillator give out a sine and cosine wave.
  14. dayalrohan

    dayalrohan Thread Starter New Member

    Joined:
    May 28, 2009
    Messages:
    7
    Not sure what I did wrong,

    R2C1 = designed to give 0 dB gain at fc=10 Hz, hence their values. fh is a order higher. Can you give me your designed values?

    Also I get correct results in my simulations as well (I use LTspice).

    I was thinking of an integrator, but the output will have a DC bias equal to the supply voltage, getting rid of that bias is going to be difficult at such a low frequency. I can use a RC type load I guess to chop off that DC and get that AC on the R load.

    I am inclining towards a quadrature type oscillator myself; havent made one ever, does the signal come out nice practically ( I mean distortion free).

    Also
    @tom66
    Removing the compensating components (non-essential), I just increase the noise in the output but the distortion remains.
  15. JoeJester

    JoeJester AAC Fanatic!

    Joined:
    Apr 26, 2005
    Messages:
    2,414
    Location:
    Grand Prairie, TX, USA
    According to the application note ... fc = 10f and fh = 100f (both formulas) f (10 Hz) will be -20 dB.
  16. DickCappels

    DickCappels Well-Known Member

    Joined:
    Aug 21, 2008
    Messages:
    890
    Location:
    Thailand
    From the distortion, it looks like the output of the opamp is capacitively coupled to the non-inverting input, causing hysteresis. Try grounding the noninverting input instead of returning it to ground through a resistor, and that would solve the problem if its coupling via stray capacitance. I think you can get away with leaving R3 out of the circuit because the input bias currents on the inputs of the TLC2201IP are very low.

    Other than the stray C, the circuit as you show it is fine.
    Last edited: Sep 25, 2010
  17. dayalrohan

    dayalrohan Thread Starter New Member

    Joined:
    May 28, 2009
    Messages:
    7
    Well, I tried that as well. As far as I could see, no appreciable change. My simulation runs fine, so it must be something on BB (practical) that is skewing up things. In fact, I coupled a capacitor as high as 100 pF between non-inverting input and output but could not see the same result in simulation.

    I tried other options like:

    1. Integrator - too much phase delay in my range ( 2-30 Hz)
    2. Quadrature oscillator circuit - too much noise, resembles a triangular wave rather than a sine wave.

    Any help or any other circuit to convert sine to cos would be really appreciated
  18. DickCappels

    DickCappels Well-Known Member

    Joined:
    Aug 21, 2008
    Messages:
    890
    Location:
    Thailand
    That brings us back to crossover distortion. Is your power supply voltage adequate? Sometimes crossover distortion is helped by a load resistor to ground.
  19. dayalrohan

    dayalrohan Thread Starter New Member

    Joined:
    May 28, 2009
    Messages:
    7
    Already tried that long time back (I mean loading),
    supply is nice, have checked it on oscilloscope for any ac ripple. (I am using +/- 5V)

    Even tried a generous offering of bypassing capacitors at the + and - supply near the op-amp.

    I thought this was going to be done in 10 minutes, boy was I wrong :(
Similar Threads
Forum Title Date
The Projects Forum Suggestion for choosing a D/A converter for 3Vpp 3500Hz sine wave? Sep 4, 2014
The Projects Forum Project part: sine wave generation Apr 20, 2014
The Projects Forum sloppy sine to square wave Mar 16, 2014
The Projects Forum Conversion of low amplitude sine wave to square wave for PLC Jan 23, 2014
The Projects Forum how to get sine wave for colpitt oscillator Nov 14, 2013

Related Site Pages

Share This Page