Excel w/chart for rc and rl circuits.... - Page 1
Forum section: electronics / beginners

author: gotwood
author_rank: Contributor
timestamp: February 09, 2014, 03:00:45 am
content: Looking to make excel spreadsheet to graph V/I for the devices over time frameNew to excel.....How do I vary the timeframe based on the tau/time constantHow many steps are needed for a particular timeframe?I'm in the dark because I'm not really plotting a true curve...just a bunch of individual points...Also, is there a way to use one sheet for the charging phase AND discharging phase? Or do I need do separately?Formulas I know I need:tau=R*Ce^-t/T1-e^-t/TAny others?

author: edy
author_rank: Super Contributor
timestamp: February 09, 2014, 04:05:32 am
content: Are you looking for something like this?:http://www.referencedesigner.com/rfcal/cal_05.phpHere is another good explanation:http://www.electronics-tutorials.ws/rc/rc_1.htmlSeems the only equation you need is:Vc(t) = Vs (1- e^-t/RC)Vc=voltage across capacitor at any given timeVs=supply voltage appliedt=timeR=resistor ohmsC=capacitor faradsNotice that at the beginning, -t/RC = 0. Therefore e^0 is 1, and Vs(1 - 1) = 0.When time is the "time constant" or t=RC, we have e^-1 which is 1/e = 1/2.718 = 0.36.So then Vc = Vs (1-0.36) = Vs (63.2) which is 63.2% of the supply voltage.The excel spreadsheet would simply have columns for each of the variables, plotted against time. I will upload something if I have a chance.

author: edy
author_rank: Super Contributor
timestamp: February 09, 2014, 04:36:07 am
content: I've added an Excel spreadsheet I just put together since the previous post. It simply uses that formula I mentioned. A column for time, just pick arbitrary interval and extend downwards. I have 0 to 5 seconds. I also set my R and C at top of the spreadsheet to the values, and the supply voltage Vs. The formula calculates the values of Vc for different times (I have separated it across several columns so you can see each piece calculated but you can simply combine into 1 column for time, 1 colum for the resulting Vs and that is it.I have graphed the result as well, you can see a nice natural logarithmic curve. Using this spreadsheet you can play around with all the values and pick it apart to understand it. Same can be applied to your LC and other types of circuits where you want to figure out your values. The decay curve would be the same idea... I'll let you try and come up with it, and post it to this thread. Hope that helps.

author: gotwood
author_rank: Contributor
timestamp: February 09, 2014, 06:23:09 am
content: I was thinking that based on the time constant and t-start/t-end you could have a column that uses the appropriate units according to how many points should be used to deliver a decent graph .Example...a time constant of 18us would not be using ms or conversely

author: Rerouter
author_rank: Super Contributor
timestamp: February 09, 2014, 07:28:43 am
content: calculate the time constant, times it by 5, then round up to the nearest decade, then take 5+ samples per time constant

author: gotwood
author_rank: Contributor
timestamp: February 09, 2014, 07:59:41 am
content: You say 5+ samples per TWhat would be overkill?Would 10/T be adequate for an accurate graph?

author: edy
author_rank: Super Contributor
timestamp: February 09, 2014, 05:34:09 pm
content: In the Excel spreadsheet I uploaded, simply make the TIME column a function of the RC. For example, we know that at time=RC means it will reach 63% of the max curve. Therefore just make the time column rather than fixed numbers, based on a formula where it reaches "RC" at about half the steps, and then continue to 2RC at the end.For example, you can add another column called "steps". Make steps increment from 0 to 100. Now make time column equal to (step x 2 x RC/100). Does that make sense?So at step 0, time = step x 2 x R C/100 = 0At step 50, time = 50 x 2 x RC / 100 = RCAt step 100, time = 100 x 2 x RC / 100 = 2 RCNow when you set your RC at the top of the spreadsheet I uploaded, the time automatically SCALES to allow the graph to have that characteristic. You can choose 3 RC as the horizontal time range, 4 RC, whatever you want.

author: gotwood
author_rank: Contributor
timestamp: February 09, 2014, 07:06:09 pm
content: I pretty much have the charging phase with Cap V/I and Res V plotted vs. time down pat......Is it possible to have a spreadsheet go through a time line where you have charging phase, steady state and discharge phase plotted vs. time? With charge phase not at 100%? And adding or taking out resistance between phases ....thus changing time constant?Is excel capable? I'll not bother trying if it cannot handle complex situations like this.

author: edy
author_rank: Super Contributor
timestamp: February 09, 2014, 09:55:03 pm
content: Excel should be very capable. I've done a ton of stuff with Excel, including 2D maps and very heavy math calculations, GPS geocoding and other stuff. I'll try to modify my previous spreadsheet and upload a new one showing charge, steady state and discharge. Keep in mind the steady state will not be at 100% because it would take an infinite time to reach, but it is a close approximation.

author: edy
author_rank: Super Contributor
timestamp: February 10, 2014, 01:38:41 am
content: Hi,I've attached the REVISED Excel spreadsheet showing the RC calculations, along with a screenshot. As you can see, I've created series with different colors plotting the charging, steadystate and discharging phases. I've arbitrarily set 50 steps for charging, 25 steps for steadystate (which is boring) and 50 steps for discharging. The time scale automatically ranges depending on the RC so that we get to 99.3% of the charge. 1xRC gets to 63%, and 5xRC gets to 99.3%.All you have to do in the spreadsheet is modify the yellow cells... R, C and V. The rest is automatic. Let me know if this helps. Excel will let you do almost anything. There is even a flight simulator embedded in there. :-)

author: gotwood
author_rank: Contributor
timestamp: February 10, 2014, 02:15:02 am
content: Thanks so much.....Ill learn much about the excel formulae from this