electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » DIY Hardware and Software » Developers' Corner
Problem with Ideal Diodes
Post new topic   Reply to topic Moderators: DrJustice
Page 1 of 1 [10 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
françois



Joined: Dec 23, 2006
Posts: 139
Location: Paris (France)
Audio files: 1

PostPosted: Tue Dec 16, 2008 10:59 am    Post subject: Problem with Ideal Diodes Reply with quote  Mark this post and the followings unread

Hello all,

I thought I understood thoroughly Jim Patchell's "Ideal Diode Tutorial", and in fact I've been using ideal diodes in many places. But always with a zero volt threshold.

Now I need something a bit more elaborate. I have a bipolar control signal (typ. +/-10V, allowed to swing to the +/-15V rails). But I can only guarantee accurate operation of the controlled circuit when the control signal is between +/-5V.

So I need a three-segment piecewise linear response curve : Vout = 0V when Vin in +/-5V, Vout = 5V - Vin when Vin below -5V, Vout = Vin - 5V when Vin above + 5V (I wouldn't care if the signs were reversed). Seemingly simple, no? This should even be obvious according to Jim's paper.

But I just can't get it to work, although I tried many combinations, sometimes after careful thought, sometimes just out of anger and boredom.

Can anyone tell me what I'm getting wrong?

Thank you,

-- françois
Back to top
View user's profile Send private message
JovianPyx



Joined: Nov 20, 2007
Posts: 1988
Location: West Red Spot, Jupiter
Audio files: 224

PostPosted: Tue Dec 16, 2008 2:29 pm    Post subject: Reply with quote  Mark this post and the followings unread

A schematic of your current circuit would be immensely helpful to this end.
_________________
FPGA, dsPIC and Fatman Synth Stuff

Time flies like a banana.
Fruit flies when you're having fun.
BTW, Do these genes make my ass look fat?
corruptio optimi pessima
Back to top
View user's profile Send private message Visit poster's website
françois



Joined: Dec 23, 2006
Posts: 139
Location: Paris (France)
Audio files: 1

PostPosted: Wed Dec 17, 2008 4:26 am    Post subject: Reply with quote  Mark this post and the followings unread

Hello and thank you, Scott!

I couldn't join a schematic yesterday because I had been testing so many configurations... (moreover there was a typo in my post). After much thought I came to a working circuit, but it required 7 (!) opamps. Obviously there was something wrong. Tracking every signal from every opamp I managed to get to an almost satisfying circuit with only 3 opamps (see attached schematic).

Opamp U1 extracts the negative (V1) and positive (V2) parts of the input signal Ve (and of course inverts them). Then U2 computes Vx = V2 - V1 + 5V, which is an inverted full-wave rectified version of Ve, shifted up by +5V -- then Vx is positive only when Ve is between -5V and +5V. Finally U3 cuts off this positive part of Vx and inverts the negative ones, thus achieving the desired effect.

Now what is the purpose? I could certainly just clamp Ve to -5V/+5V with just two diodes (provided the diode voltage drop is taken into account). But it is sometimes interesting to allow some overdrive in the control signal, even if it is at the cost of accuracy. If I observe some abnormal behaviour I do not want to track which modules (there are many of them) are being overdriven. Just a LED indicating this circumstance will be of great help. Of course, I could use a window comparator that goes high when Ve exceeds +/-5V, but it would be nice also to have an indication of how much overdrive is applied. In fact I don't know if this is actually useful, but it is worth testing. And anyway, that was a good exercise.

What worries me a bit is, why 3 opamps? Couldn't it be done with just two? I tried to incorporate the last diode in U2's feedback path, to no avail. I think I have an idea why it doesn't work (at least not in the obvious manner) but I have to keep testing. Anyone who could help me getting rid of this "extra" opamp will be blessed!

Yours,

-- françois

EDIT: Oops. I forgot half of the output stage (U3). Attached is a correct version. I also forgot to mention that all "anonymous" resistors are equal, of any reasonable value (I used 10k).


Visio-Ideal Diode Clamp.pdf
 Description:

Download
 Filename:  Visio-Ideal Diode Clamp.pdf
 Filesize:  12.46 KB
 Downloaded:  366 Time(s)

Back to top
View user's profile Send private message
JovianPyx



Joined: Nov 20, 2007
Posts: 1988
Location: West Red Spot, Jupiter
Audio files: 224

PostPosted: Mon Dec 22, 2008 12:03 pm    Post subject: Reply with quote  Mark this post and the followings unread

Well, while reducing to 2 opamps would be great, if your 3 opamp design works well and does what you want, then I would leave it. Opamps are pretty inexpensive, so one more or less ...

I can't see a way to combine functions to reduce it to 2 opamps, but then doing those mental gymnastics isn't my forte. Perhaps someone else?

_________________
FPGA, dsPIC and Fatman Synth Stuff

Time flies like a banana.
Fruit flies when you're having fun.
BTW, Do these genes make my ass look fat?
corruptio optimi pessima
Back to top
View user's profile Send private message Visit poster's website
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24085
Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320

PostPosted: Mon Dec 22, 2008 12:33 pm    Post subject: Reply with quote  Mark this post and the followings unread

I'd expect :

Posted Image, might have been reduced in size. Click Image to view fullscreen.

but probably you tried that variation ... Laughing

_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
BananaPlug



Joined: Jul 04, 2007
Posts: 307
Location: Philly
Audio files: 5

PostPosted: Mon Dec 22, 2008 12:54 pm    Post subject: Reply with quote  Mark this post and the followings unread

Quote:
I have a bipolar control signal (typ. +/-10V, allowed to swing to the +/-15V rails). But I can only guarantee accurate operation of the controlled circuit when the control signal is between +/-5V.


Quote:
But it is sometimes interesting to allow some overdrive in the control signal, even if it is at the cost of accuracy.


Maybe I don't understand what you're trying to do but I can't figure out why you have rectification in your solution. Isn't this a simple scaling issue?

How about a buffer circuit with adjustable gain over a range of 33% to 50%. At the minimum setting, you can't output more than +/- 5v (you've told us it the input is limited by the power rails to +/-15). At the maximum the "typical" +/- 10v range would scale to +/-5v. In between you have the possibility for "some overdrive."
Back to top
View user's profile Send private message Visit poster's website
françois



Joined: Dec 23, 2006
Posts: 139
Location: Paris (France)
Audio files: 1

PostPosted: Tue Dec 23, 2008 3:45 am    Post subject: Reply with quote  Mark this post and the followings unread

@Blue Hell: Sorry for the PDF, it is just the "natural" output format for Microsoft Visio... but you need a PDF viewer (try Foxit Reader, freeware). Attached is a JPEG file, hopefullly easier to handle. I don't know how to include an image in the message body, though.
EDIT: OK, the PDF was not the point. I just missed your image the first time. I did try this variation, but it doesn't work any better... Sad

@BananaPlug : It is not just a scaling issue. Have a look at the response curve I need. There is some scaling involved, of course, but also some thresholding, and I can't see how to do that without diodes. But full rectification is probably too much.

@ScottG: Well, opamps usually come in packs of four, so I usually have one or two unused. And, while not being a millionnaire, I still can afford a dedicated TL084 if needed. But I love these gymnastics, trying to use as few components as possible (or even as impossible in some cases).


Ideal Diode Clamp.jpg
 Description:
 Filesize:  134.21 KB
 Viewed:  370 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

Ideal Diode Clamp.jpg


Back to top
View user's profile Send private message
BananaPlug



Joined: Jul 04, 2007
Posts: 307
Location: Philly
Audio files: 5

PostPosted: Tue Dec 23, 2008 9:31 am    Post subject: Reply with quote  Mark this post and the followings unread

Quote:
@BananaPlug : It is not just a scaling issue. Have a look at the response curve I need.

I'm just having a hard time reconciling your verbal description with what I think the graphs mean. They seem to be saying very different things.
Back to top
View user's profile Send private message Visit poster's website
françois



Joined: Dec 23, 2006
Posts: 139
Location: Paris (France)
Audio files: 1

PostPosted: Tue Dec 23, 2008 12:28 pm    Post subject: Reply with quote  Mark this post and the followings unread

BananaPlug wrote:
Quote:
@BananaPlug : It is not just a scaling issue. Have a look at the response curve I need.

I'm just having a hard time reconciling your verbal description with what I think the graphs mean. They seem to be saying very different things.


Please do not worry about my verbal description. English is not my native language -- when I'm working with people in real life, my English seems clear because the underlying context is there. But in writing, things get a bit different. Now, the graphics do show very explicitly what I am intending to do.

Thanks,

-- françois
Back to top
View user's profile Send private message
BananaPlug



Joined: Jul 04, 2007
Posts: 307
Location: Philly
Audio files: 5

PostPosted: Tue Dec 23, 2008 1:15 pm    Post subject: Reply with quote  Mark this post and the followings unread

Actually, your non-native English is great but I read what I expected to see rather than what you actually wrote. Wink
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic Moderators: DrJustice
Page 1 of 1 [10 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » Developers' Corner
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use