Circuits with diodes

WBahn

Joined Mar 31, 2012
30,072
Ok, I almost got it.

This is what I got:

\(
\displaystyle {v_{OUT} = \left\{\begin{matrix}
\frac{4}{7}\cdot v_{IN}+\frac{8}{7},\,\, v_{IN} > 12\\
\frac{2}{3}\cdot v_{IN},\,\, 9< v_{IN}< 12\\
\frac{1}{2}\cdot v_{IN}+\frac{3}{2},\,\, v_{IN}<9V\\
3 ,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\, v_{IN}< 3
\end{matrix}\right.}
\)
You need to, as usual, pay attention to proper use of units.

These aren't mutually exclusive ranges. Your last two both apply for Vin < 3V. But I think this was a typo and you meant to say

\(
\displaystyle {v_{OUT} = \left\{\begin{matrix}
\frac{4}{7}\cdot v_{IN}+\frac{8}{7}V,\,\, 12V < v_{IN}\\
\frac{2}{3}\cdot v_{IN},\,\, 9V< v_{IN}< 12V\\
\frac{1}{2}\cdot v_{IN}+\frac{3}{2}V,\,\, 3V<v_{IN}<9V\\
3 ,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\, v_{IN}< 3V
\end{matrix}\right.}
\)

On a strictly formatting note, you might consider this:

\(V_{OUT} = \left\{ \begin{array}{ccrcl}
\frac{4}{7}\(v_{IN}+2V\) & \mbox{;} & 12V \le & v_{IN} & \\
\frac{2}{3} v_{IN} & \mbox{;} & 9V \le & v_{IN} & \le 12V \\
\frac{1}{2}\( v_{IN}+3V) & \mbox{;} & 3V \le & v_{IN} & \le 9V \\
3V & \mbox{;} & & v_{IN} & \le 3V\\
\end{array}
\)

Notice the use of equality at the endpoints. Some would argue that this is incorrect because now the endpoints of each range are governed by two defining equations. Others argue that this is acceptable as long as both definitions produce the same result and point out that it has the utility of explicitly indicating that the two ranges are continuous at the boundary. I don't know what the rigorous mathematical answer is to that question.

Before we look at your work below, let's ask if this solution makes sense. The key is that we do expect the output voltage to be a continuous function of the input voltage since there is nothing in this circuit that we would expect to make a large change in output voltage for an infinitesimal change in input voltage. So are your ranges continuous?

At 12V the first equation yields 8V and the second equation yields 8V. (check)
At 9V the second equation yields 6V and the third equation yields 6V. (check)
At 3V the third equation yields 3V and the fourth equation yields 4V. (check)

So as long as your breakpoint voltages are correct and as long as your slopes in the first and last ranges are correct, this is correct. In looking at the original circuit the breakpoint appear correct. The slope of the last range is clearly correct. I worked out the slope in the first range and it is correct. So unless I am missing something or did something wrong (clearly always possible), this is the correct solution.

The only one I couldn't get, I don't know what is wrong!

The situation where there are differences between my solution and teacher solution is situation 7 - D1 ON - D2 ON - D3 OFF

The conditions that makes diodes like that are:

Vout < Vin ^ Vout < 6V ^ Vout < 8V
<=> Vout < Vin ^ Vout < 6V


Then I say that I1 is the current across R1 = 2.5k, I2 is the current across R2 = 5k and I3 is the current across Rload.
So,

I1 = I2 + I3

(Vin -Vout)/R1 = (Vout - V1)/R2 + Vout/Rload
<=>(Vin - Vout)/(5/2) = (Vout - 6)/5 + Vout/5
<=>2(Vin - Vout)=Vout - 6 + Vout
<=> Vout = (1/2)Vin + 3/2

Then, replacing this equation in the conditions equation, I get:

(1/2)Vin + 3/2 < 6V

Vin < 9V

But our teacher has 3V < Vin < 9V which would have implied that the conditions of Vout for this situation (D1 ON, D2 ON and D3 OFF) would have to be something like x < Vout < y...
Ah, so it wasn't a typo and you really were trying to say that the last two equations both apply for Vin < 3V (since that satisfies Vin < 9V). So what is the voltage at Vin=0V? You third line says it is 1.5V while your last line says that it is 0V. Which is it? Always ask if the answer makes sense.

So let's take a look at your claims:

Vout < Vin ^ Vout < 6V ^ Vout < 8V
D1 = ON => Vout < Vin (check)
D2 = ON => Vout < 6V (check)
D3 = OFF => Vout < 8V (check)

So I agree with you.

The second condition covers the third condition leaving you with

<=> Vout < Vin ^ Vout < 6V
So I agree with you.

So you came up with the following equation

Vout = (1/2)Vin + 3/2
Which is correct.

You then applied the condition that Vout < 6V

(1/2)Vin + 3/2 < 6V
Which gives you Vin < 9V. Fine. But this inequality was only based on the requirement that Vout < 6V.

You still have to apply the requirement that Vin > Vout.
 

WBahn

Joined Mar 31, 2012
30,072
Let's not put it that way. You're trying to place the bulls in front of the car. Let's go easy and slowly.
So.... when should you start adhering to good practices?

Anyway, I almost got the answer and I got few "helpful help". I saw a lot of complaints and just a little help that in practice.
You've gotten a LOT of help, it's just that no one has outright done your work for you and, instead, have made you fight with it. That's the best way to learn stuff -- you fight with it and you get snippets of help to point out where you are going wrong or what you should consider that you aren't.

I understand that you want me to do everything perfect and that I should follow all your advices but I have no time to follow all your words.
In order words, you don't have time to do things properly, but you have plenty of time to flounder around chasing dead ends because you won't do things properly.

.. As you see I got the result without LTSpice. And I don't have time to check all my answers with it. And another reason is that most of the times, the answers I need, LTSpice can't give them to me! I like a lot LTSpice but unfortunately I don't have time to learn more.
While LTSpice and other simulators are valuable tools, you shouldn't need to use them to either find the solution OR check the solution in a problem like this. Notice that all of the checks I have been doing and recommending do not involve simulating it. I don't have a problem with using it to check your work, but at this stage in your learning it should not be the first layer of checks that you do.

But you should always, always, ALWAYS check your work and ask if the answer makes sense. If you don't have time to do that, then what you are saying is that you don't mind losing points that you didn't need to lose just because you wouldn't even make simple checks of your results.
 

Thread Starter

PsySc0rpi0n

Joined Mar 4, 2014
1,772
So.... when should you start adhering to good practices?
In fact I'm a guy that likes good practices, precise results and also that likes to have results exactly as we were expecting and probably that is a problem because things, usually are never like we expected them! So, I know when I really need to use good practices and when I can loosen a bit!

You've gotten a LOT of help, it's just that no one has outright done your work for you and, instead, have made you fight with it. That's the best way to learn stuff -- you fight with it and you get snippets of help to point out where you are going wrong or what you should consider that you aren't.
Well, so you say! I don't agree and I don't want to ague about it. The help that I got in this exercise didn't even led me anyway because a considerable part of all posts are complaints and questions to my questions. Anyway, I'm having a déjá vu about this! Let's move on.
What I wrote before was just an opinion that wasn't even meant to be replied.

In order words, you don't have time to do things properly, but you have plenty of time to flounder around chasing dead ends because you won't do things properly.
Yes, unfortunately, pretty much that... Flounder around chasing dead ends because the lack of guidance from any of who knows more than me!

While LTSpice and other simulators are valuable tools, you shouldn't need to use them to either find the solution OR check the solution in a problem like this. Notice that all of the checks I have been doing and recommending do not involve simulating it. I don't have a problem with using it to check your work, but at this stage in your learning it should not be the first layer of checks that you do.


But you should always, always, ALWAYS check your work and ask if the answer makes sense. If you don't have time to do that, then what you are saying is that you don't mind losing points that you didn't need to lose just because you wouldn't even make simple checks of your results.
That's not what I said at all. What I said is that I don't have much time to check my results with LTSpice. Of course that I look to the results and ask myself if that is correct or not. If not, that was pretty stupid to solve a problem and don't try to see if the solution is correct. However, I may think my answer is correct, and in fact, it is not, even after I have checked the answer!


Anyway, let's move on and not stick in this discussion forever!

Regarding your previous post, I was trying to say that the last situation, situation 7 was giving me Vin < 9V but this is not what is in the teacher's solution. He has 3V < Vin < 9V. But this would make that the conditions for the state of the diodes were something like x < Vin < y and in situation 7, condition is just Vin < 6V. (That's me asking if the solution is correct)!
 

WBahn

Joined Mar 31, 2012
30,072
Well, so you say! I don't agree and I don't want to ague about it. The help that I got in this exercise didn't even led me anyway because a considerable part of all posts are complaints and questions to my questions.
Now that you've floundered your way to a solution, I was going to show you how you could use the advice I gave at the beginning to solve the problem very quickly and the apparently mistaken believe that you are now in a position to learn the most from it. But since you don't find my attempts to assist you helpful, I won't waste any more of your time.
 

Thread Starter

PsySc0rpi0n

Joined Mar 4, 2014
1,772
That's what I mean... When the help is not needed is when you are willing to give it... I don't want to be digging into all posts in this thread but many of them were questions to my questions, leading me nowhere!
I accept all the help since it leads me somewhere further from the point I'm at at the moment.

You all saw that I was completely lost at some point in this thread about what to do to solve the problem, but no one said to me anything like: that's not what you need to do. Try to start here (or there or anywhere else) and try to build up your solution from there!

Do whatever you feel better to do. If you still want to say what you were about to say, be my guest, if not, I appreciate the help given so far anyway, as I always do!

I've been reading page 1 and 2 again, and I admit that some help was indeed given to me, but once I was still not getting into the correct path, I think that a bit more help would be needed so that I wouldn't spend like 3 or 4 days with a single diodes problem!

I felt that you (all) were trying to lead me into a different path according to each of my answers. I mean that if I was trying to answer the problem in one way, you tried to lead me further that way, but if, for some reason, I deviated from that way in a later answer, then you would be leading my in that new way. So a lot of way were open at once and leaded me to confusion avoiding me to focus in only one way. This was the impression I got from what I just read!

I'm sorry if most of you don't like my way of be but I'm being as honest and frontal as I can. I felt completely lost in this problem somewhere in this thread and the help given wasn't helping me much!
 

WBahn

Joined Mar 31, 2012
30,072
You all saw that I was completely lost at some point in this thread about what to do to solve the problem, but no one said to me anything like: that's not what you need to do. Try to start here (or there or anywhere else) and try to build up your solution from there!
Really? Look at Post #5, my very first post in this thread:

It's not as simple as identifying which combinations are impossible because you have an additional variable, namely Vin. So some combinations will be impossible for some values of Vin and possible for others. Still, it's worthwhile identifying combinations that are impossible for ANY value of Vin in order to narrow the field up front.

By "ideal" diodes I'm going to assume you mean 0V drop across it when forward biased. Some authors refer to a diode that has a constant Vd drop as "ideal", too.

The obvious one to start with is, as already noted, D1. That's because if you assume that it is OFF then the value of Vin doesn't matter. Now, the assumption that it is OFF depends on V1, but not the possible combinations of the other two diodes IF it is off. The next one to focus on, again as already noted, are the possible combinations of D2 and D3. There are four possibilities and you can look at them separately from and you have correctly

After that you start looking for critical values of Vin that make some combinations impossible either above or below that critical value. But you don't have to start with Vin directly. In this case, the top node (Vo) is a very good candidate to look at first.
But you chose to ignore that advice for a long time. For example, the very first thing I pointed out was that it wasn't as simple as just looking at which combinations where possible, but you kept focusing on which combinations were possible.

Look at Post #12, my second post in this thread:

This is where my suggestion of looking for critical voltages comes into play.

Walk Vin from -∞ to +∞ and looking for critical points at which the changes occur.

For instance, with Vin = -∞, determine the state of the diodes. That will give you a value of Vout for all the values of Vin from -∞ up to whatever Vout is, at which point D1 turns on. So that's your first critical value for Vin. Now ask yourself what Vout needs to become in order to change the state of the D2/D3 combination. Then you just ask what value of Vin corresponds that value of Vout.

Notice that, for a set configuration of the diodes, you just have a linear circuit. This means that if you find (Vin,Vout) at the transition points from one diode configuration to the next, that the Vout(Vin) characteristic is going to be a straight line between those points.

Also, each diode will transition state just once. So you will have, at most, four regions of operation. You might have fewer since it is possible that one or more diodes never change state or that two or more diodes change state at the same point.
And you chose to ignore all of those suggestions.

Others made similar recommendations early on that largely fell on deaf ears.

The reason it felt like we were leading you along the path that YOU had chosen was, in no small part, because you refused to follow any of the recommendations to follow a different path and made it pretty obvious that you were going to follow whatever path you happened to choose no matter what. So we had little choice but to try to guide you to a solution under the constraint that it had to go the direction you were taking it since any recommendation to follow a different path was going to be ignored.
 

Thread Starter

PsySc0rpi0n

Joined Mar 4, 2014
1,772
Ok... You are always right no matter what I say when you're not in "this side"!

Anyway, I'm going to move forward and start another exercise!
 

WBahn

Joined Mar 31, 2012
30,072
Regarding your previous post, I was trying to say that the last situation, situation 7 was giving me Vin < 9V but this is not what is in the teacher's solution. He has 3V < Vin < 9V. But this would make that the conditions for the state of the diodes were something like x < Vin < y and in situation 7, condition is just Vin < 6V. (That's me asking if the solution is correct)!
I'm assuming you mean Vout < 6V.

But what did YOU do to check if the solution is correct? I tried (apparently unsuccessfully) to show you not one, but two ways to do that -- asking if the answer makes sense in the context of the following condition and checking if it actually agrees with the condition, which requires that D1 be ON.

I'll post one or two solutions once I get back from my doctor's appointment (assuming I survive it :D).
 

WBahn

Joined Mar 31, 2012
30,072
∞So, as promised, here is a way to solve this problem in short order. This not the only way -- there are several reasonable ways to go about it.

Ex-17.png

The key node if Vo. In fact, since components in series can be swapped, the unique role of Vo is apparent when you consider that it is effectively connected to all three diodes.

Ex-17a.png

But making this change to the circuit is not needed to solve it -- it just highlights the above point.

One thing I just noticed is the direction of the arrows on Vi and Vo. I'm not a fan of using arrows to indicate voltage polarity, but doesn't the arrow normally point from the negative side to the positive side of the indicated voltage? Be that as it may, the discussion up to this point has been consistent with Vi and Vo being positive at the upper nodes, so that is what I will continue with.

So let's identify the points at which the circuit behavior changes. That is going to occur at the following events:

D1: ON when Vi > Vo
D2: ON when Vo < 6V
D3: ON when Vo > 8V

If Vo < 6V, then D1 is ON and D3 is OFF. If D1 is also OFF, the we have a simple voltage divider:
Ex-17_010.png
The output voltage is clearly 3V. To turn on, Vi must be greater than 3V, so our first <Vi, Vo> breakpoint is <3V, 3V>. Below this our diodes {D1,D2,D3} are {OFF,ON,OFF} and as we cross above it our diodes go to {ON, ON, OFF}. From this point on, D1 will be ON. Our next breakpoint is going to occur when Vo reaches 6V and D2 turns off, making our diode configuration {ON,OFF,OFF}. At this point our circuit will look like
Ex-17_100.png
In this configuration we can see that the circuit is a voltage diver with a gain of 2/3. In order for the output voltage to be 6V, the input voltage needs to be 9V. So our second breakpoint is <9V,6V>. Our final breakpoint will occur when Vo hits 8V. Using this same circuit, we see that that happens when Vin reaches 12V making our final breakpoint <12V,8V>. Our diode configuration after that will be {ON,OFF,ON}.

Region|from <Vi,Vo>|to <Vi,Vo>|D1|D2|D3
1|<-∞, 3V>|<3V,3V>|OFF|ON|OFF
2|<3V,3V>|<9V,6V> |ON|ON|OFF
3|<9V,6V>|<12V,8V> |ON|OFF|OFF
4|<12V,8V>|<-∞,-∞> |ON|OFF|ON

The equation for Vo(Vi) in the first region is trivial since it is flat.

Region 1: Vo = 3V

In the next two regions, we can use the two endpoints of the region to find the equations for the connecting lines. If you don't recall and can't derive the formula, you know that the form will be

Vo = m·Vin + b

and you have two equations (the endpoints) and two unknowns (m and b).

From this you get

Region 2: Vo = (Vi + 3V)/2
Region 3: Vo = (2/3)·Vi

The final region can be determined a couple of ways. You could just pick a value of Vo (above 8V) and find the corresponding value of Vi and then do the same thing. You could just analyze the circuit. Or you could recognize that the slope if just the voltage divider you get by shorting the 8V battery, which has a gain of 4/7. Then you can use the point-slope formula for a line or just the fact that you now have one equation and one unknown (since m is known).

From this you get

Region 4: Vo = (4/7)(Vi + 2V)

Problem solved.

Region|from <Vi,Vo>|to <Vi,Vo>|D1|D2|D3|Vo(Vi)
1|<-∞, 3V>|<3V,3V>|OFF|ON|OFF|3V
2|<3V,3V>|<9V,6V> |ON|ON|OFF|(Vi + 3V)/2
3|<9V,6V>|<12V,8V> |ON|OFF|OFF|(2/3)·Vi
4|<12V,8V>|<-∞,-∞> |ON|OFF|ON|(4/7)(Vi + 2V)

As a check on these, we can look at the gains of the voltage dividers formed in each region with any DC supplies turned off (shorted) and compare those to the slopes in our equations.

Region 1: m = 0
Region 2: m = 0.5
Region 3: m = 2/3
Region 4: m = 4/7

We should also check that all of the equations actually yield the breakpoint values, which they do.
 

Thread Starter

PsySc0rpi0n

Joined Mar 4, 2014
1,772
Morning...

Well, I was reading your answer but in fact I got a little lost and didn't understood some points. Anyway, there was something you said before back at the very end of your post #41 that made me to get the final and correct answer...

All calcs I made were only taking into account part of the conditions and I was ignoring Vin > Vout or Vin < Vout...

For situation 7, D1 - ON, D2 - ON and D3 - OFF, conditions would be:

D1 ON -- Vin > Vout
D2 ON -- Vout < 6V
D3 OFF - Vout < 8V

These conditions become Vin > Vout Λ Vout < 6V

After calculating Vout as (1/2)*Vin + 3/2 for this situation I'm going to check for what Vin values this situation is valid:

Vin > Vout <=> Vin > (1/2)*Vin + 3/2 <=> (1/2)*Vin = 3/2 <=> Vin > 3V.

Vout < 6V <=> (1/2)*Vin + 3/2 < 6V <=> Vin < 12V - 3V <=> Vin < 9V

So, compiling both conditions I get 3V < Vin < 9V...

This was what I was missing!
Anyway, thanks for your thorough answer!
 
Top