The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jul 17th, 2024, 12:23pm
Pages: 1
Send Topic Print
Delay in an ideal switch (Read 2111 times)
shary
New Member
*
Offline



Posts: 6

Delay in an ideal switch
May 10th, 2010, 7:25am
 
Hi,

This seems extremely simple, however I've been having trouble with adding delay to a three terminal ideal switch. The switch has bias, control and output terminals (b,c,o), and depending on the voltage difference between bias and control terminals, the switch is open or closed.

I can get the ideal switch to simulate, but when I try to add delay using either transition or absdelay, nothing works. Am I doing something wrong? Here is my code:

************
if(V(b,c) > Vth || V(c,b) > Vth) closed = 1;
else closed = 0;

if(closed) Iout = V(b,o)/Rswitch;
else Iout=0;

I(b,o) <+ Iout;
***********

This code works fine, except there is no delay. When I replace the last line with:
I(b,o) <+ transition(Iout,td);
OR
I(b,o) <+ absdelay(Iout,td);

it doesn't work. Is there anything obviously wrong?? How do I add a delay of say 10p?

Thank you!

Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2386
Silicon Valley
Re: Delay in an ideal switch
Reply #1 - May 10th, 2010, 9:38am
 
Quote:
This code works fine, except there is no delay. When I replace the last line with:
I(b,o) <+ transition(Iout,td);
OR
I(b,o) <+ absdelay(Iout,td);

it doesn't work. Is there anything obviously wrong?? How do I add a delay of say 10p?
Just saying it doesn't work is not very helpful. You should tell us what it does, and why that is not what you want.

I think what you want is to delay the switching action, not the signal being switched. So you probably want something like ...

Code:
if(V(b,c) > Vth) Gsw = Gon; else Gsw = Goff;
@(cross(V(b,c) - Vth));
I(b,o) <+ transition(Gsw,td,tt)*V(b,o); 


Notice that the transition function, and hence the delay, is applied to the switch conductance, so you would be delaying the switching action itself, and not delaying the current of the input signal relative to its voltage, which would actually model some very strange distributed component.

I have seen some people write this model as
Code:
if(V(b,c) > Vth) logGsw = log(Gon); else logGsw = log(Goff);
@(cross(V(b,c) - Vth));
I(b,o) <+ pow(10, transition(Gsw,td,tt))*V(b,o); 

so that the resistance transitions in a logarithmic fashion, but I don't know that the extra complexity buys you much.

You also made two classic mistakes when writing your model. First, you tried to apply the transition function to a continuous signal (transition(Iout,td)). Never do that. The transition function is only to be applied to piecewise constant signals. Second, you forgot the cross function, which is needed to accurately observe the time of the threshold crossing.

-Ken
Back to top
 
 
View Profile WWW   IP Logged
shary
New Member
*
Offline



Posts: 6

Re: Delay in an ideal switch
Reply #2 - Jun 16th, 2010, 9:38pm
 
Thank you for your reply, Ken. That was very helpful. Also, thank you for your comments about the use of the transition and cross function. I now understand why the initial code was not working, i.e. not adding any delay (due to transition on continuous function).

Thanks again.
Back to top
 
 
View Profile   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.