Add a zero to this RC transfer function - Page 1
Forum section: electronics / beginners

author: bonzer
author_rank: Regular Contributor
timestamp: January 05, 2019, 04:49:04 pm
content: Hello everyone! Please help me to find out how to add a zero at higher frequency to this transfer function (the first one). One solution I found is to insert Rx in series with that capacitor but someone already did it I would like to discover new ways. If what you think of adds another pole too, it's not a problem unless it's at an even higher frequency like 2 decades after.

author: Benta
author_rank: Super Contributor
timestamp: January 05, 2019, 05:20:20 pm
content: Try adding a cap in series with the first resistor. But the argument that "someone else already did it" leaves me somewhat baffled.

author: MrAl
author_rank: Super Contributor
timestamp: January 06, 2019, 02:01:45 am
content: Quote from: bonzer on January 05, 2019, 04:49:04 pmHello,I dont think you get another zero by placing a cap in series with the first resistor in the first diagram.However, i think you do get another zero if you place a cap in parallel to either the first resistor or the third resistor.I think the idea is to get it to behave more 'high pass like'.Also note that either of those caps would 'bridge' either a source and cap or two caps so probably no extra pole.We could verify with some formulas.In the numerator, s*a+1 is one zero, (s*a+1)*(s*b+1) is a second zero, so you should get two factors like that in the numerator.The transfer function of the original circuit is:Vout/Vin=(s*C2*R3+1)/(s^2*C1*C2*R1*R3+s*C2*R3+s^2*C1*C2*R1*R2+s*C2*R2+s*C2*R1+s*C1*R1+1)and note only one factor in the numerator.We could go over this in detail if you like and change components and check.And yes that extra resistor in series with the bottom (second) resistor creates another zero too.

author: Wimberleytech
author_rank: Super Contributor
timestamp: January 06, 2019, 02:20:08 am
content: QuoteYes, it puts the zero at the origin.

author: MrAl
author_rank: Super Contributor
timestamp: January 06, 2019, 02:19:52 pm
content: Quote from: Wimberleytech on January 06, 2019, 02:20:08 amHi,Thanks for the reply. You are right, except it doesnt look like it is at the origin. You can show your transfer function if you disagree.Here is the transfer function i get with both the 'lower' R8 added and the series 'C8' added:((s*C8*R1+1)*(s*C2*R3+1)*(s*C1*R8+1))/(s^3*C1*C2*C8*R1*R3*R8+s^2*C1*C2*R3*R8+s^3*C1*C2*C8*R1*R2*R8+s^2*C1*C2*R2*R8+s^2*C1*C8*R1*R8+s^2*C1*C2*R1*R8+s*C1*R8+s^2*C2*C8*R1*R3+s^2*C1*C2*R1*R3+s*C2*R3+s^2*C2*C8*R1*R2+s^2*C1*C2*R1*R2+s*C2*R2+s*C8*R1+s*C2*R1+s*C1*R1+1)Here we can see three zeros because that lower R8 is still in the circuit. If we short that out, we get two zeros but it doesnt look like one of those is at the origin. Take a look if you can.Here's what i get with all R's the same and all C's the same:(s*C*R+1)^2/(4*s^2*C^2*R^2+5*s*C*R+1)I see a double zero there but not at the origin so would be interesting to see your transfer function.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: January 06, 2019, 02:49:27 pm
content: Also a capacitor in parallel with one of the resistors (not Rc). Or an inductor in series with the capacitor, if you don't mind that it's a complex pole pair.Tim

author: MrAl
author_rank: Super Contributor
timestamp: January 06, 2019, 03:41:59 pm
content: Quote from: T3sl4co1l on January 06, 2019, 02:49:27 pmHi,Yes one of the horizontally drawn resistors and i pointed that out in post #2.Interesting though, a cap in series with that second horizontally drawn resistor does not produce another zero but it does if the cap is in series with the first horizontally drawn resistor.So far the list, not including inductors, is:1. cap in series with the first horizontal resistor.2. cap in parallel with the first horizontal resistor3. cap in parallel with the second horizontal resistor.The overview is that the idea is to shoot for a more high pass like quality. That means a resistor in parallel (vertically) or a cap in series (horizontally).Now for inductors, it would be the opposite as for caps, so we'd look to add inductors vertically drawn, although i did not test with any inductances yet.

author: Wimberleytech
author_rank: Super Contributor
timestamp: January 06, 2019, 03:57:42 pm
content: QuoteRC circuitC8 1 2 1R1 2 3 2C1 3 0 2R2 3 4 3C2 4 5 4R3 5 0 5vin 1 0 ac 1.end------RC circuit[0 ] [-sC8 sC8+G1 -G1 0 0 ][V1 ][0 ] [0 -G1 sC1+G2+G1 -G2 0 ][V2 ][0 ]=[0 0 -G2 sC2+G2 -sC2 ][V3 ][0 ] [0 0 0 -sC2 sC2+G3 ][V4 ][1 ] [1 0 0 0 0 ][V5 ]*Ignore nodes 6 and higher if present. They are used for internal numbering.Numerator of: v4/v1TERMS SORTED ACCORDING TO POWERS OF ss**2 terms:+ sC8*sC2*G2*G1s**1 terms:+ sC8*G3*G2*G1************************************************Denominator of: v4/v1TERMS SORTED ACCORDING TO POWERS OF ss**3 terms:+ sC8*sC2*sC1*G3 + sC8*sC2*sC1*G2s**2 terms:+ sC8*sC2*G3*G2 + sC8*sC2*G3*G1 + sC8*sC2*G2*G1+ sC8*sC1*G3*G2 + sC2*sC1*G3*G1 + sC2*sC1*G2*G1s**1 terms:+ sC8*G3*G2*G1 + sC2*G3*G2*G1 + sC1*G3*G2*G1************************************************

author: MrAl
author_rank: Super Contributor
timestamp: January 06, 2019, 07:29:23 pm
content: Quote from: Wimberleytech on January 06, 2019, 03:57:42 pmHello again,That looks like you have 3 zeros now?However, how did you create that matrix? That might have something to do with it.I did this again and am now getting no extra zero as before. What must have happened was i left that other resistor in the circuit so it already had 2 zeros before i started :-)But anyway, i did it again and only get 1 zero. Also, i checked it on a simulator this time and dont see a zero at the origin.Consider this:Make all caps the same value C, make all resistors the same value R.Now make R=1 Ohm.Now at low frequency the reactance of C is very large, so replace all C with 10 megohm resistors.Now analyze the circuit for DC. What do we get? We get:Vout/Vin=1/3So at near zero frequency we dont get zero output.The simulator also shows this.Maybe you could show how you got that matrix.

author: Wimberleytech
author_rank: Super Contributor
timestamp: January 06, 2019, 08:20:18 pm
content: QuoteActually, the numerator has two zeros, however, the zero at the origin is canceled by a pole at the origin, so there is only one zero.You are correct--there is no additional zero added with the input capacitor...BECAUSE, there is no 'real' path to ground. I missed that. However, no practical circuit will have the output floating node as is the case with this circuit.BTW, the matrix is generated with Symspice

author: MrAl
author_rank: Super Contributor
timestamp: January 06, 2019, 09:12:34 pm
content: Quote from: Wimberleytech on January 06, 2019, 08:20:18 pmHi,Yeah that reminded me i was going to ask the OP what this circuit was going to be used for.We can connected a high resistance load to the output and re-evaluate i guess. Might be interesting.

author: Wimberleytech
author_rank: Super Contributor
timestamp: January 06, 2019, 10:54:46 pm
content: QuoteAs soon as you connect it to ANY 'real' impedance (e.g. resistance), the zero at the origin will appear. For any real circuit, there would have to be a 'real' resistance, otherwise it would not be properly biased.

author: bonzer
author_rank: Regular Contributor
timestamp: January 07, 2019, 01:39:45 pm
content: Hello thanks a lot! I'm gonna try your answers as soon as I can as I also need some other conditions to be verified. Anyway if you were asking yourself what I need this for it's about the compensation of a circuit. This is the transfer function corresponding to the feedback network of a op amp circuit that does the derivative. So this network is Beta. I need that zero because in closed loop it creates a pole before the critical point of instability so this way I remove the overshoot. It's something that I still have to work on

author: MrAl
author_rank: Super Contributor
timestamp: January 07, 2019, 03:01:47 pm
content: Quote from: Wimberleytech on January 06, 2019, 10:54:46 pmHello again,Yes and i think that is good insight there. I would still want to look at the effectiveness of that zero however, because if we have a high impedance output then the zero is almost like it wasnt there. I guess we'd then have to evaluate inside the application circuit.Normally we like a zero that we have control over where we dont have to depend on the load to control. That means instead of a numerator like:(s+a)*swe have:(s+a)*(s+b)and that gives us more control i think. We could look at some frequency plots i guess but i have a feeling that with that one zero depending on the load value we could see a virtual zero at a frequency of 1e-12 Hz but at f=0.01 Hz it jumps right back up to 1/3 or so.

author: bonzer
author_rank: Regular Contributor
timestamp: January 07, 2019, 08:36:59 pm
content: Meanwhile, @Wimberleytech I took a look at Symspice and it seems to be interesting for this stuff but it's not free. Anyway do you know other software like this that generate you the transfer function from the circuit? I know only how to do bode diagram. It would be really helpful to get the actual formula with components when dealing with complex rc networks to verify the result.I'll be back with updates about my circuit in the next days.

author: Wimberleytech
author_rank: Super Contributor
timestamp: January 07, 2019, 09:15:11 pm
content: Quote from: bonzer on January 07, 2019, 08:36:59 pmThey have a free version that is limited to six nodes. That is what I use. Anything beyond six nodes seems too cumbersome to deal with by hand...even with the matrix solved.

author: MrAl
author_rank: Super Contributor
timestamp: January 07, 2019, 09:34:40 pm
content: Quote from: Wimberleytech on January 07, 2019, 09:15:11 pmHi,Yes that does look interesting. Only thing i dont like is they want your whole life history before you can download :-)I use a hand written analysis program i wrote myself which is not limited except by sheer time factor to solve the equations.Regular simulators also help here. Lots of people use LT Spice.

author: bonzer
author_rank: Regular Contributor
timestamp: January 07, 2019, 10:42:07 pm
content: I'm back. Thank you guys, adding a capacitor in parallel to the first resistor works! I verified it with pspice and it gives me that zero at 1/(RC*2*pi). Getting to the final formula by hand is bloody hard because requires many steps so it's easier to make a mistake but from the bode diagram it seems to give me exactly what I was looking for. I see no other poles introduced by the capacitor even though I can't be sure at 100% as I didn't solve the circuit in theory so there could be one at higher frequency that I didn't see in my limited observation range inside the simulation. Also it seems to work for my compensation. I'm working on a derivative circuit. Anyway if you are curious here's the whole circuit with the capacitor. I still have to analyse if stability is ok about the phase and stuff but it showed very little overshoot so far. But as I said adding a capacitor is a bit more risky so I think that adding a resistor like in the first case would still be better but whatever it's still an alternative.

author: MrAl
author_rank: Super Contributor
timestamp: January 08, 2019, 01:05:48 pm
content: Quote from: bonzer on January 07, 2019, 10:42:07 pmHi again,Is that the final circuit there? That looks much different than the original network.We can analyze that too though if you like.The circuit now looks like a high pass filter with cutoff frequency f0=3183.2649 HzThe theoretical time response is (subject to op amp output limitations):f(t)=(4*e^(-(40000*t)/53))/51-(5512*e^(-20000*t))/51which says it is stable. Since the output is clamped and passband gain is over 100 though that should be investigated also.

author: bonzer
author_rank: Regular Contributor
timestamp: January 09, 2019, 02:48:00 pm
content: Yes it's stable. It's the main reason why I introduced that zero (which in closed loop became a pole). I had to deal with the phase margin and an overshoot. Actually the whole circuit apart from being high pass - its main purpose is being a derivative. In fact I'm working with a real op amp (simulated) so high frequencies are getting attenuated with a -20dB slope after like 4.5 kHz because of the crossing of my theoretical gain with the op amp's open loop gain (which behaves as a low pass) so it actually doesn't let those high frequencies pass (Bode diagram becomes like a triangle).Anyway BOTH ways work fine (adding the resistor or adding that capacitor like you told me as an alternative) for the compensation.Both ways give me similar phase margins at the critical point (like 50°) and a low overshoot (like half of dB when compared with an ideal derivative circuit).So my question is:Which solution is better in your opinion?I would say adding the resistor (Rc) because in reality they are more precise in value and the overall calculation of the formula is simpler.Maybe there're other reasons I don't know, what do you think?

author: The Electrician
author_rank: Frequent Contributor
timestamp: January 10, 2019, 10:19:09 pm
content: Quote from: bonzer on January 09, 2019, 02:48:00 pmWhat formula are you referring to? Frequency response, time response?

author: bonzer
author_rank: Regular Contributor
timestamp: January 11, 2019, 08:19:58 am
content: frequency response

author: MrAl
author_rank: Super Contributor
timestamp: January 11, 2019, 02:03:59 pm
content: Quote from: bonzer on January 09, 2019, 02:48:00 pmHi again,Which circuit are you talking about now.Is it the op amp circuit?If so, can you show where you intend to insert the resistor and what value it is?This would give us more to work with to answer that question.I would prefer to see the op amp circuit with the added resistor because the network without the op amp is not as practical when looking for actual differences.

author: The Electrician
author_rank: Frequent Contributor
timestamp: January 11, 2019, 10:20:01 pm
content: Quote from: bonzer on January 09, 2019, 02:48:00 pmStarting from the circuit you show in reply #17, here are the expressions for the frequency response for 3 cases. The expression for the case where Rc is added is more complicated. I don't know whether the overall calculation of this formula is simpler because I don't do these calculations by hand; I use a modern mathematical software.

author: MrAl
author_rank: Super Contributor
timestamp: January 12, 2019, 03:56:18 pm
content: Quote from: The Electrician on January 11, 2019, 10:20:01 pmHello,I am not sure what he is doing now. I guess we assume he is adding Rc in series with Cd2?And i guess when that happens, we take out Cd1?I am trying to relate the new circuit to the questions, but there seems to be no direct correlation.Cd3 is in parallel to R3 which doesnt make sense either.We should have a circuit diagram that explains explicitly which caps get added and what resistors get added, or what gets removed at the same time. We'd have to look at too many variations i think without this information.Maybe you have a better idea?

author: bonzer
author_rank: Regular Contributor
timestamp: January 12, 2019, 08:52:10 pm
content: This is what I mean. Therefore it looks like the resistor version has a more complicated formula. Anyway from the physical/engineer point of view which solution is better in your opinion? (compare it to the one at reply #17)Also: from the bode diagram analysis their overshoot is at the same level. There's no difference at the critical point between them. But phase margin is bigger when adding the capacitor so it looks more stable but there's little difference anyway (like between 40 and 50°).

author: MrAl
author_rank: Super Contributor
timestamp: January 13, 2019, 01:40:33 am
content: Quote from: bonzer on January 12, 2019, 08:52:10 pmHi again,Here are the two idealized time responses:First circuit:0.078431373*e^(-754.71698*t)-108.07843*e^(-20000*t)Second Circuit:0.0034894227*e^(-754.71698*t)-129.00349*e^(-24319.066*t)They are almost the same. One is just a little faster.

author: bonzer
author_rank: Regular Contributor
timestamp: January 13, 2019, 09:18:42 am
content: So in theory there's no big difference. But finding a cap with a precise value would cost more as they usually have much bigger tollerance in value than resistors. So I suppose that If anyone had to build them, he would add the resistor.

author: MrAl
author_rank: Super Contributor
timestamp: January 13, 2019, 01:45:28 pm
content: Quote from: bonzer on January 13, 2019, 09:18:42 amHi,Well for that you would do a sensitivity analysis. Just how sensitive is the response to a small change in cap value for some particular capacitor. There is a chance that the response does not change much for a small change in cap value. Most likely the time constant changes a little and could be in proportion to the cap value. So for say a 0.010uf cap changing to a 0.015uf cap we probably see a 50 percent change in time constant, which for this would probably equate to settling time. There also could be a change in amplitude, probably the max would follow the same rule.Usually you pick a standard cap value then pick a suitable resistor. That's probably because you can get lots of resistor values and you probably have them on hand already anyway.

author: The Electrician
author_rank: Frequent Contributor
timestamp: January 13, 2019, 03:10:10 pm
content: I get the exact same time responses as MrAl did in reply #26. If we plot the frequency responses for those same two cases, we get this:The blue curve is for the first circuit and the red curve is for the second circuit:The frequency responses are significantly different, so we would expect different time responses. If Rd4 is changed to 193 ohms, and Cd2 is changed to 260 nF, we get these frequency responses; they're practically coincident:With these changes, the time response of the second circuit becomes:0.0790072*e^(-754.717*t) - 107.706*e^(-19928.3*t)Compare this to the time response of the first circuit--it's very similar as we would expect given the similarity of the frequency responses.