Author Topic: Peak detector with load?  (Read 1740 times)

0 Members and 1 Guest are viewing this topic.

Offline FriedMuleTopic starter

  • Frequent Contributor
  • **
  • Posts: 807
  • Country: dk
  • Can make even the simplest task look imposible.
Peak detector with load?
« on: August 26, 2019, 07:49:49 pm »
I have made a peak detector
It has zero droop and, do I think, deliver a constant result until shut off
Since KiCad do not have the components I want to use as the Digital Potentiometer I have just put one in the circuit.

Suddenly the thought occurred to me, what if I added an load to the output of the peak detector, would it then work as an PSU with constant, no ripple 5V voltage?
I have added a Zenor (D3) that goes from output to ground if above 5V
Even if I appear online is it not necessary so, my computer is on 24/7 even if I am not on.
 

Offline 741

  • Frequent Contributor
  • **
  • Posts: 400
  • Country: gb
    • Circuit & PCB Design (small PCB quantities OK)
Re: Peak detector with load?
« Reply #1 on: August 27, 2019, 02:33:42 pm »
Hi

I think there is a mistake with the 2x LM358: A real op-amp will not function reliably/long term with (+) input "floating".
( Have you tried it for real  :)? )

I can not understand how the AD5293 works without any programming-pins (SPI) connected - is this OK? ... what happens to the 'resistor' when the /CS pin is enabled, does it change?


Re: "...would it then work as an PSU with constant, no ripple 5V voltage?"

Although you might see a nice low ripple, that ripple reduction (if any) would come from the U4a's "PSRR", and the peak detector would be "irrevelevant".
That is, U4A's output is not powered by it's signal input.

Best wishes
Stephen

Offline FriedMuleTopic starter

  • Frequent Contributor
  • **
  • Posts: 807
  • Country: dk
  • Can make even the simplest task look imposible.
Re: Peak detector with load?
« Reply #2 on: August 27, 2019, 03:12:00 pm »
Hi

I think there is a mistake with the 2x LM358: A real op-amp will not function reliably/long term with (+) input "floating".
( Have you tried it for real  :)? )

I can not understand how the AD5293 works without any programming-pins (SPI) connected - is this OK? ... what happens to the 'resistor' when the /CS pin is enabled, does it change?


Re: "...would it then work as an PSU with constant, no ripple 5V voltage?"

Although you might see a nice low ripple, that ripple reduction (if any) would come from the U4a's "PSRR", and the peak detector would be "irrevelevant".
That is, U4A's output is not powered by it's signal input.

Best wishes
Stephen
Thanks for your reply, no I have about no components yet, is just started on the electronical journey:-)
I am trying to learn KiCad but can't get the simulator part to work, lots of "pin not driven" and no lines on the scope even if I tell it where to probe.
I was also a bit confused it's all from the following links: https://www.nutsvolts.com/magazine/article/op-amp-cookbook-part-4
The peak detector is from this video: https://youtu.be/5Pz7Mx0WRUk?t=375
« Last Edit: August 27, 2019, 03:14:02 pm by FriedMule »
Even if I appear online is it not necessary so, my computer is on 24/7 even if I am not on.
 

Offline Bassman59

  • Super Contributor
  • ***
  • Posts: 2501
  • Country: us
  • Yes, I do this for a living
Re: Peak detector with load?
« Reply #3 on: August 27, 2019, 03:58:06 pm »
Hi

I think there is a mistake with the 2x LM358: A real op-amp will not function reliably/long term with (+) input "floating".
( Have you tried it for real  :)? )

I can not understand how the AD5293 works without any programming-pins (SPI) connected - is this OK? ... what happens to the 'resistor' when the /CS pin is enabled, does it change?


Re: "...would it then work as an PSU with constant, no ripple 5V voltage?"

Although you might see a nice low ripple, that ripple reduction (if any) would come from the U4a's "PSRR", and the peak detector would be "irrevelevant".
That is, U4A's output is not powered by it's signal input.

Best wishes
Stephen
Thanks for your reply, no I have about no components yet, is just started on the electronical journey:-)
I am trying to learn KiCad but can't get the simulator part to work, lots of "pin not driven" and no lines on the scope even if I tell it where to probe.
I was also a bit confused it's all from the following links: https://www.nutsvolts.com/magazine/article/op-amp-cookbook-part-4
The peak detector is from this video: https://youtu.be/5Pz7Mx0WRUk?t=375

For simulation, Kicad uses ngspice. You should look for how to use it. Then there's the question of obtaining models.
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19875
  • Country: gb
  • 0999
Re: Peak detector with load?
« Reply #4 on: August 27, 2019, 04:55:56 pm »
It's not the LM358, but the LMV358, which is totally different. It's only rated up to 5.5V and has rail-to-rail inputs. The LM358 is rated up to 30V, but its common mode range is about 2V less than the +V rail, although it can tolerate either input going to 30V, irrespective of the supply voltage.

I don't see how this circuit will work. No op-amp will work with its inputs floating. Pins 5 and 3 on U1 will just pick up stray noise causing the output to flip from 0V to 5V unpredictably.
« Last Edit: August 27, 2019, 05:01:33 pm by Zero999 »
 

Offline FriedMuleTopic starter

  • Frequent Contributor
  • **
  • Posts: 807
  • Country: dk
  • Can make even the simplest task look imposible.
Re: Peak detector with load?
« Reply #5 on: August 27, 2019, 05:07:23 pm »
Thanks, could you please tell me what and how to change it?
My thought was that the result would be a straight line of 5V and sines it can not go under it's max value, it would never make any ripple.
Even if I appear online is it not necessary so, my computer is on 24/7 even if I am not on.
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19875
  • Country: gb
  • 0999
Re: Peak detector with load?
« Reply #6 on: August 27, 2019, 09:46:50 pm »
I don't believe it's possible to make a peak detector, with zero droop, without some kind of memory element. The standard way is to charge a capacitor, via a precision rectifier, but there will always be some leakage in the capacitor and bias currents on the op-amp's inputs, so the value will drift slightly. The easiest way to achieve zero droop would be to sample the input using an ADC, storing it in a register and converting it back to an analogue voltage, with a DAC, if necessary.
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3313
  • Country: gb
Re: Peak detector with load?
« Reply #7 on: August 27, 2019, 10:18:37 pm »
I don't believe it's possible to make a peak detector, with zero droop, without some kind of memory element. The standard way is to charge a capacitor, via a precision rectifier, but there will always be some leakage in the capacitor and bias currents on the op-amp's inputs, so the value will drift slightly. The easiest way to achieve zero droop would be to sample the input using an ADC, storing it in a register and converting it back to an analogue voltage, with a DAC, if necessary.

The OP's schematic is very misleading since he's using the incorrect digipot symbol.  The "zero droop" peak detector uses a digipot with an "up/down" input to track the output of a conventional peak detector.  Obviously the output of the digipot is considerably quantised since they are limited to around 10 bits.
 

Offline FriedMuleTopic starter

  • Frequent Contributor
  • **
  • Posts: 807
  • Country: dk
  • Can make even the simplest task look imposible.
Re: Peak detector with load?
« Reply #8 on: August 27, 2019, 11:01:11 pm »
After have seen a great deal of KiCad videos, I have tried to make a more correct schematic.

About zero droop, I have about no idea on what I am doing, so I did just trust the info in the video, so again no idea:-)
« Last Edit: August 27, 2019, 11:06:51 pm by FriedMule »
Even if I appear online is it not necessary so, my computer is on 24/7 even if I am not on.
 

Offline FriedMuleTopic starter

  • Frequent Contributor
  • **
  • Posts: 807
  • Country: dk
  • Can make even the simplest task look imposible.
Re: Peak detector with load?
« Reply #9 on: August 28, 2019, 12:41:30 pm »
Added question: I have asked KiCad to check the electrical rules but it say something that I do not understand and cant seem to find any clear answer to.

ERC report (28-08-2019 14:38:38, Encoding UTF8 )

***** Sheet /
ErrType(3): Pin connected to other pins, but not driven by any pin
    @(29,21 mm, 88,90 mm): Pin 3 (Input) of component U1 is not driven (Net 1).
ErrType(3): Pin connected to other pins, but not driven by any pin
    @(20,32 mm, 82,55 mm): Pin 1 (Power input) of component #PWR01 is not driven (Net 8).
ErrType(3): Pin connected to other pins, but not driven by any pin
    @(154,94 mm, 45,72 mm): Pin 1 (Power input) of component #PWR06 is not driven (Net 10).
ErrType(3): Pin connected to other pins, but not driven by any pin
    @(110,49 mm, 78,74 mm): Pin 1 (Power input) of component #PWR02 is not driven (Net 11).

 ** ERC messages: 4  Errors 0  Warnings 4
Even if I appear online is it not necessary so, my computer is on 24/7 even if I am not on.
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3313
  • Country: gb
Re: Peak detector with load?
« Reply #10 on: August 28, 2019, 09:56:48 pm »
I don't use this tool but the KiCad Forum has a detailed answer addressing the cause and solution to this.  Essentially the design rules check sees a bunch of power input pins tied together (i.e. Vdd/Vss on the ICs) but you need to tell it which node the power is being supplied from.
 

Offline FriedMuleTopic starter

  • Frequent Contributor
  • **
  • Posts: 807
  • Country: dk
  • Can make even the simplest task look imposible.
Re: Peak detector with load?
« Reply #11 on: August 28, 2019, 10:50:36 pm »
I don't use this tool but the KiCad Forum has a detailed answer addressing the cause and solution to this.  Essentially the design rules check sees a bunch of power input pins tied together (i.e. Vdd/Vss on the ICs) but you need to tell it which node the power is being supplied from.
Great thanks, I'll try to look again:-)
Even if I appear online is it not necessary so, my computer is on 24/7 even if I am not on.
 

Offline FriedMuleTopic starter

  • Frequent Contributor
  • **
  • Posts: 807
  • Country: dk
  • Can make even the simplest task look imposible.
Re: Peak detector with load?
« Reply #12 on: August 30, 2019, 09:39:57 am »
you need to tell it which node the power is being supplied from.
That hint was all I neaded to solve the errors, thanks a lot! :-)
Even if I appear online is it not necessary so, my computer is on 24/7 even if I am not on.
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3313
  • Country: gb
Re: Peak detector with load?
« Reply #13 on: August 30, 2019, 01:49:33 pm »
Glad I could help, and thanks for posting the resolution.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf