1. Trang chủ
  2. » Công Nghệ Thông Tin

excel by example a microsoft excel cookbook for electronics engineers phần 6 potx

38 459 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 38
Dung lượng 4,5 MB

Nội dung

173 Example 10: Voltage Regulator: LM317 Click on OK, and right-click on the button to edit the button text to “Set Voltage”. Click away from the button to end the change. Clicking on the button will now run the macro. Thermal Analysis Let’s add another dimension by considering the thermal implications of the design. First, let’s consider some theory. Figure 10-11: Inserting a button and associating a macro with it. Θ JC T = junction temp. j T = case temp. c T = heat sink temp. hs T = ambient temp. a Θ CS Θ SA Heat source Figure 10-12: Analogy for thermal analysis. 174 Excel by Example It is possible to draw an analogy between thermal and electrical conductivity. The tempera- ture corresponds to voltage, the thermal resistance to electrical resistance and heat flow to current. Using this approach and applying it to Figure 10-12, we can write Θ JA = (T j – T a )/P d (1) where Θ JA is the thermal resistance from semiconductor junction to the ambient temperature (in °C/W), T j is the junction temperature, T a is the ambient temperature and P d is the power dissipated. Θ JA = Θ JC + Θ CS + Θ SA (2) where Θ JC is the thermal resistance from the junction to the case, Θ CS is the thermal resis- tance from the case to the heat sink, and Θ SA is the thermal resistance from the heat sink to the ambient air. The power dissipation, P d, is calculated from the volt drop across the device V d and the cur- rent flowing into it I in . P d = V d * I in = (V in – V out ) * I in ≈ (V in – V out ) * I out (3) The last approximation is true only where the quiescent current of the device is small in comparison to the output current. In every case where heat dissipation is an issue, we must first consider the total power dissipa - tion and provide enough heat sinking that is necessary to limit the junction temperature to a safe maximum. We need to consider the worst case of an application, and that may include a dead short across the output of the device. Using these generalities with our specific example of an LM317T (that is the TO-220 pack - age), the absolute maximum for the junction temperature is 150°C and traditionally we limit it to 25°C less than this. The next step in this example is creating a model that produces the required thermal resistance of the heat sink required. Moving to Sheet2 and renaming it Thermal, we create the initial format as in Figure 10-13. Each variable input can have several possible sources of data or value. For instance, as we shall see, the source voltage could be from DC or rectified AC. We are going to handle these alternatives by means of Option buttons. The Option buttons are grouped together to deal with a single common aspect of the model. Each group of Option buttons is associated with a cell in column A, a column that we will hide later. The value of the cell corresponds to the Option button selected. Depending on the design, the input voltage to the regulator can come from a DC source or some form of AC waveform. We will deal with a non-DC input later, but for the moment, the input voltage to the regulator will be derived from cell D3 for a DC input, or D4 for a rectified AC input, depending on an Option button selection. We first need to get the cor- 175 Example 10: Voltage Regulator: LM317 rect toolbox by clicking on View | Toolbars | Forms. Then click on the Group box icon and then click and drag an area as in Figure 10-14. Figure 10-13: Preliminary setup for thermal analysis. Figure 10-14: Creating a Group box. 176 Excel by Example Click on a cell away from the Group box and then move the cursor over the text of the group box until the cursor becomes a four-headed arrow. Then right-click and select Edit Text from the pop-up menu. Change the Group box title to something like “Input Voltage Selection ” with a few spaces at the end to improve the appearance. Click on the Option button in the toolbox. Click within the Group box, and drag a window (within the Group box) to a suitable size. There are to be two Option buttons in this box, but rather than creating a second, select the first by right-clicking on it and cutting and copying. There is another way to copy a control. <Ctrl> + <Click> on the original control and then drag while still holding the <Ctrl> key. By copying the control, both buttons and associated text will be the same size. Right-click on each and modify the text. Also, right-click on either one and select the Format Control and point the cell link to cell A7. If you want to copy this setup (and I certainly will), it is better to make this a relative and not an absolute reference. Click away from the button to lose the focus, and then clicking on one or other of the buttons will change the value of cell A7 from 1 to 2 and back. See Figure 10-15. Figure 10-15: Using Option buttons. We now add other options, either by copying and pasting or by starting fresh each time until we arrive at Figure 10-16. There are several types of component packages, but for simplicity I have stayed with the TO- 220. There are different methods of affixing the LM317 to the heat sink. In the one that uses the Kapton insulator (Sil-Pad®), the thermal conductivity varies with the pressure affixing the component to the heat sink. I have stayed with one value. Figure 10-17 shows the formulas used in the calculations. The user is expected to enter the current through the device in cell D15 and the maximum ambient temperature in cell D16. The power dissipation in the device is found using equation (3), as previously shown. The overall thermal conductivity is derived from equation (1), and if the result is greater than 50 °C/W (derived from the data sheet entry “Thermal Resistance, Junction-to-Ambi- ent (No Heat Sink)”) then no heat sink will be required and this will be annunciated in cell 177 Example 10: Voltage Regulator: LM317 E32. Otherwise, the required thermal resistance is calculated from equation (1) and (2) and reported in cell D32. Figure 10-18 shows the completed thermal model. In Parenthesis: CHOOSE The format of the CHOOSE function is: CHOOSE(index_num,value1,value2, ) index_num selects which entry in the following list is used. It can be a numerical value, evaluate to a numerical value or refer to a cell containing a numerical value, but it cannot exceed the value of 29. In other words, the maximum size of the following list is 29. The following list can be a value, a calculation, or refer to a cell. It can even refer to an array of cells. For instance: =min(choose(1,b7:b25,b26:b30,b31:b45)) will effectively reduce to: =min(b7:b25) Figure 10-16: Preparatory work on options and inputs. 178 Excel by Example Figure 10-17: Formulas needed to calculate the thermal conductivity for a heat sink. Figure 10-18: Completed thermal analysis. 179 Example 10: Voltage Regulator: LM317 Half-Wave Rectification It is very common to provide a rectified and smoothed voltage as a source to a voltage regula- tor. Throughout the building automation sector, 24VAC is used as a supply voltage with one of the sides tied to chassis ground. The simplest way of converting this to a DC voltage (with a ripple on it) is through half-wave rectification as shown in Figure 10-19. Figure 10-19: Half-wave rectification circuit. AC input ½ wave rectified The minimum value for the input voltage to the voltage regulator must not drop below the dropout voltage of the regulator, so a large smoothing capacitor would reduce the ripple. On the other hand, the less the value of the smoothing capacitor, the smaller and cheaper it is likely to be. In addition, the effective voltage (RMS voltage) is reduced and consequently the power dissipated is also reduced, economizing on the requirements for the heat sinking of the regulator. We can use Excel to calculate the optimal value of this capacitor. True RMS and Integration Part of the model will calculate the RMS value of the voltage to use in the calculation of the power dissipated in the regulator. Before we examine the complex waveform of the smoothed half-rectified AC, let us test the model as to how we are going to calculate a finite integral using Excel and we will use a sine wave since we know what the results should be. The RMS voltage is calculated from the equation: Integration between limits defines area under a curve, so by dividing the area into trap - ezoids, we can calculate the area of each trapezoid and sum them to calculate the total area. The area of a trapezoid is the average of the sum of the two parallel sides multiplied by the distance between them. This is shown in Figure 10-20. The area of one of the trapezoids is ((Y1 + Y2)/2) * X1. Obviously, the smaller the value of X1, the greater the accuracy of the calculation. Y X Y2 Y1 X1 Figure 10-20: Trapezium method of calculating the area under a curve. ( ) 2 0 1 T rms V v t dt T = ∫ 180 Excel by Example If we take a formula for a curve and evaluate it for a number of points, we can use these points as the values for Y1 and Y2 and so calculate the area. Figure 10-21 shows the formulas used to implement this for a sine wave. I have hidden some of the middle of the range points (rows 14 to 43) to fit the top and bottom of the worksheet into the figure. I have chosen to work with 50 Hz since the numbers are nicer, and anyway when we get to the smoothing capacitor, the result will be that the design can be used in the rest of the world as well as North America. The formula for a sine wave is A 0 sin (2 π ft) where A 0 is the peak amplitude, f is the frequency of the wave, and t is the elapsed time. The 0.001 factor that appears is the conversion of milliseconds to seconds. Figure 10-21: Formulas to calculate the RMS value of a sine wave. Note that the worksheet has been renamed. Cells B9 to B49 calculate the amplitude of the sine function at different times. Note the use of the PI( ) function for the π value. Cells C9 to C49 contain the square of the amplitudes. Cells D10 to D49 contain the calculation for the area of each trapezoid, and the areas are all summed in D51. This value is divided by the period (1/f) in cell D52, and the square root is found in cell D53. The results are shown in the worksheet in Figure 10-22 (please excuse the lack of formatting), and the result is very close to reality. See the actual results in Figure 10-22. 181 Example 10: Voltage Regulator: LM317 Now that we have considered the calculation of the RMS voltage, we can put it aside for a while. I have left this workbook as LM317_Sine.xls. Figure 10-22: Calculation of the RMS value of a 50 Hz sine wave with an amplitude of 10. More Preparation In a half-wave rectifier, the smoothing capacitor is charged until the AC voltage peaks. It then discharges according to the formula i = Cdv/dt where i is the current, C is the capaci- tance of the capacitor, dv is the change in voltage and dt is the change in time. The AC voltage continues to drop until it reaches zero and stays zero until the next positive cycle starts. In the meantime, the capacitor discharges linearly (since the current through the regulator is constant) until the increasing AC voltage exceeds the reduced capacitor voltage whereupon the capacitor is recharged. Actually, the capacitor discharge may not start exactly at the AC peak, but it should be close enough for this calculation. I have created the top of the worksheet to include all the parameters that are needed (see Fig - ure 10-24), and the cells C3 to C9 have been suitably named. Only the nominal transformer voltage is required as an entry from the user. This whole effort is to find the capacitance, but to initiate the development an arbitrary value is entered. All the other cells are derived. 182 Excel by Example Let’s create the table of the AC waveform. We will start the analysis from the time 5 mS since this is where the AC signal peaks and the capacitor starts to discharge, and continue it to 25 mS, which is where the AC signal next peaks. Each cell with the amplitude calculation (B10 to B50) contains the following formula (adjusted for relative cell locations): =IF(ac*SIN(2*PI()*freq*A10*0.001)>=0,ac*SIN(2*PI()*freq*A10*0.001),0) to allow for the fact that the signal is at 0 in the negative half of the sine wave as a result of the rectification. The voltage drop dv is given by: dv=i*dt/C and this is calculated in cells C13 to C53. The entry is: =current*(A13−$A$13)*0.001/(Cap*0.000001) The capacitance is converted to farads by the factor 0.000001 in the denominator. D13 to D53 have the resulting droop generated by subtracting dv from the peak voltage that the capacitor was charged to: =ac−C13 We now combine the two voltages in cells E13 to E53. The higher of the two voltages be - comes dominant by use of the following formula: =IF((D13>B13),D13,B13) This traces the waveform as it charges and discharges the capacitor. The MIN function in Excel simply looks at a range of numbers and returns the minimum value. Cell E55 contains the formula: =MIN(E13:E53) which is the minimum value of the regulator input voltage. We would like this minimum voltage to be no lower than the regulated output voltage plus the dropout voltage of the regulator. From the data sheet, we pick a safe dropout voltage of 2.5V, entered as a constant in cell C8. Now we use the Goal Seek tool. It will be set up to change the value of the capacitor (cell c5=“Cap”), while monitoring the cell E55 (the minimum voltage) for the value of the drop- out voltage plus the output voltage. In order to do this, we follow the sequence Tools | Goal Seek and the dialog window pops up as in Figure 10-23. Right away we notice a problem that is hinted to by the lack of the expand button on the right-hand side of the To value: entry. Excel requires a number here, it cannot handle a cell reference. This is easy enough to solve by recording this Goal Seek process as a macro. The result of this, recorded to the macro named FindCapacitance in the example, follows: [...]... far Figure 10-24: Calculation of minimum capacitance value Note that rows 20 to 43 are hidden 183 Excel by Example Standard Capacitance Value I am sure that it comes as no surprise to you that as with resistors, there are standard capacitance values as well Since the smoothing capacitors are only likely to be between 10 µF and 10000 µF, there are very few values to consider, so I have just created a. .. capacitor values and then fetching the standard value may result in solutions that may be bettered by starting out using the standard resistor and capacitor values I set out to find a method to achieve this My solution was to create a table of standard values (as opposed to the NearestValue approach) I wanted to access the standard value by using an INDEX function based on an integer that would vary I hope... dominant and the capacitor recharges The formula is: =IF((F13>B13),F13,B13) This column forms the basis for the RMS value calculation Column H contains the square of the input voltage (for example, G13^2), and then using the Trapezium method as detailed earlier, each trapezoid area is calculated in cells I14 to I53 using the formula: =(((H14+H13)/2)*( (A1 4 -A1 3)*0.001)) Note that there is no entry for. . .Example 10: Voltage Regulator: LM317 Figure 10-23: Using Goal Seek to determine the capacitor value Sub FindCapacitance() Range(“E55”).GoalSeek Goal:= 15, ChangingCell:=Range(“C6”) End Sub We edit the macro to read: Sub FindCapacitance() Range(“E55”).GoalSeek Goal:=(Range(“Vreg”).Value + Range(“Vdrop”).Value), ChangingCell: =Range(“C6”) End Sub and this will automate the process Figure... capacitor value greater than the calculated value, so we first need to fetch the identified location using the MATCH function to find the associated row, and then use the INDEX function to get the next value up Cell E6 becomes: =INDEX(StdCap!B4:B 16, (MATCH(Cap,StdCap!B4:B 16) +1),1) Having calculated the standard capacitance, we need to reevaluate the input waveform Cells F13 to F53 contain the formula (suitably... certain ways and see how the relationships respond The conditions that Solver starts from are based on the numbers that we enter as the seed—the initial numbers in the worksheet It certainly speeds up the calculation, and may even allow con194 Example 11: TL431 Adjustable Voltage Reference vergence, to have a good idea of what the answer is likely to be and use that as the seed The actual algorithm that... to your advantage on a chart with a large number of entries, using every fifth reading, say Figure 10-30: The correct output on the chart Right-clicking on almost any aspect of the chart will allow you to change the object’s properties For instance, you can change the number of “ticks,” and the font and alignment on an axis Go ahead and try a few! With all its versatility, the chart model apparently... configurations of the 555 are a monostable or an astable multivibrator (Is multivibrator an archaic term? Is there a newer word for it? Am I showing my age?) There are many other functions that may be realized, but the treatment is very similar and so they are left to you (as my lecturers used to say, as an exercise) I will deal with each function independently, and they will be implemented on two separate... then drag the tab to the left of the Thermal tab until a small black triangle pops up just above the insertion point and then release the mouse button I added a Command button that triggers the FindCapacitance macro at the top of the worksheet Chart It would be nice to have a graphical representation of the ripple, so let’s introduce a chart With the HalfWave sheet selected, select cells A1 3 to A5 3 and... these values, run Solver again (Tools | Solver, and click on Solve) Name this scenario as SecondAttempt We can now view the scenarios by clicking on Tools | Scenarios and in the Scenario Manager (Figure 11-11) viewing each scenario Note that the results are different, yet both are an acceptable solution Figure 11-11: Scenario Manager to allow investigation of different conditions As we play around . click and drag an area as in Figure 10-14. Figure 10-13: Preliminary setup for thermal analysis. Figure 10-14: Creating a Group box. 1 76 Excel by Example Click on a cell away from the Group box and. under a curve. ( ) 2 0 1 T rms V v t dt T = ∫ 180 Excel by Example If we take a formula for a curve and evaluate it for a number of points, we can use these points as the values for Y1 and Y2 and. 10-24: Calculation of minimum capacitance value. Note that rows 20 to 43 are hidden. 184 Excel by Example Standard Capacitance Value I am sure that it comes as no surprise to you that as with resistors,

Ngày đăng: 14/08/2014, 07:20

TỪ KHÓA LIÊN QUAN