# PSpice Capture student - part help

Discussion in 'The Projects Forum' started by xeroshady, Sep 22, 2012.

Aug 1, 2012
11
0
This may sound like a total noob question, but how do you represent rechargeable batteries in a circuit? Is it just represented as a voltage source?

and is there a specific part for a rechargeable battery on PSpice Capture?

2. ### SgtWookie Expert

Jul 17, 2007
22,183
1,728
It's more complicated than that. If you want to do it the "quick and dirty" way, just use a very large capacitor with a low-value resistor in series with it, and a high-value resistor in parallel. It won't be very accurate, but it will be reasonably simple to create.

If you want a more accurate model, it will take a good deal more work, and you'll need to get very familiar with implementing PSPICE subcircuits.

Here is a .subckt that came from the LTSpice Users' Group on Yahoo! Groups; it's written for LTSpice. Your mileage may vary. I started with this subckt to make a model for a SLA (sealed lead-acid) battery.
Code ( (Unknown Language)):
1. * V2.0 Helmut Sennewald   02/22/04
2. *
3. *
4. * The Rechargable Battery
5. *------------------------
6. *
7. * Possible Parameters
8. * -------------------
9. * VCELL   nominal cell voltage in volts, e.g. 1.2
10. * CAPAH   cell capacity in Ah(ampere*hours), e.g. 1.8
11. * R_SER   series resistance in Ohms, e.g 0.2
12. * SOC     state of charge (0..1, 0=empty, 1=full)
13. * CHEFF   charging effeciency, e.g 0.7  means you need 1/0.7 times the
14. *         ampere*hours to charge fully
15. * SELFDC  self discharge per hour, e.g. 0.00028 if 20%/per month
16.
17. *
18. * I started with an old article from S.C.Hageman about a SPICE model for
19. * NIMH batteries. It's the model "NIMH" - PSpice Nickel-Metal-Hydride
20. * battery discharge simulator. Optimized for 4/5A and AA Standard Cells
21. * and discharge rates from 0C to 5C. It's for discharge only.
22.
23. * First I did some little changes on this discharge model.
24. * Later, I started with further development to include a charging model
25. * the battery too. The result is the new model NIMH_AA.
26.
27.
28.
29. *  Ext+     Ext-  Soc  Rate_d
30. *    ^       ^     ^    ^
31. *    |       |     |    |
32. *    |       |     |    +-- Instantaneous discharge rate, 1V=C
33. *    |       |     +------ State of battery charge 1V=100%
34. *    +-------+----------- +/- Cell connections (Floating)
35. *
36. *
37. *
38. .SUBCKT NIMH_AA  Ext+  Ext-  Soc  Rate_d
39. *
40. .PARAM VCELL=1.2
41. .PARAM CAPAH=1.8
42. .PARAM R_SER=0.2
43. .PARAM SOC=1
44. .PARAM CHEFF=0.7
45. .PARAM SELFDC=0.00028
46.
47. .IC V(Charge)={SOC}
48. .NODESET V(Charge)={SOC}
49. .PARAM R_DIS={VCELL/(SELFDC*CAPAH)}
50.
51. R_Cell Ext+ Cell+ {R_SER}
52. V_Sense Ext- Cell- 0
53. R_dis Cell+ Cell- {R_DIS}
54.
55. * Charge to voltage translation with E-TABLE
56. * The last table entry (1.1 -10) together with the clamped reverse voltage(D2)
57. * defines the battery voltage in reverse mode. If this entry is omitted,
58. * then the battery will clamp to zero volts.
59. E_Cell Cell+ Cell- TABLE { V(SODC) } =
60. +(0.0 1.3346) (0.0293 1.3042)(0.0426 1.2942) (0.0689 1.2841)
61. +(0.13 1.2733) (0.436 1.2633) (0.512 1.2532) (0.580 1.2432)
62. +(0.646 1.2331) (0.702 1.2231) (0.7583 1.2130)(8.0324E-01 1.2030)
63. +(0.831 1.1929) (0.851 1.1828) (0.908 1.1425) (0.948 1.0919)
64. +(0.980 0.987) (0.99 0.9352) (0.995 0.8272) (0.996 0.741)
65. +(0.997 0.647)(0.998 0.514) (0.999 0.33) (1.0000 0.0) (1.1 -10)
66.
67. * Actual rate of discharge by external load.
68. *  E.g. 0.2 means a full battery battery would last 5hours(=1/0.2).
69. E_Rate N001 0 VALUE = { IF( (I(V_sense)>0 & V(Cell+,Cell-)>0),
70. + I(V_Sense)/CAPAH, CHEFF*I(V_Sense)/CAPAH ) }
71. R2 N001 Rate_d 1
72. C1 Rate_d 0 1
73.
74. * State of charge is actually just a 1 to 1 transform of "Charge"
75. E_Rate1 Soc 0 TABLE { V(Charge) } = (-1,-1) (1,1)
76.
77. * Higher capacity for discharge current below 0.2*C
78. E_LowRate LowRate 0 TABLE { V(Rate_d) } = (0,0) (0.001,0.15) (0.1,0.1) (0.2,0)
79. R3 LowRate 0 1G
80. G_LowRate 0 Charge VALUE = { IF( (I(V_sense)>0 & V(Cell+,Cell-))>0,
81. + V(LowRate)*I(V_Sense), 0) }
82.
83. * Lower capacity for discharge current above  0.2*C
84. E_LostRate LostRate 0 TABLE { V(Rate_d) } = (0.2,0.0) (1.0,0.1) (5,0.2)
85. R5 LostRate 0 1G
86. G_HighRate Charge 0 VALUE = { IF( I(V_sense)>0 & V(Cell+,Cell-)>0,
87. + V(LostRate)*I(V_Sense), 0) }
88.
89. * The charge model
90. * Overcharge and discharge clamped with diodes
91. C_CellCapacity Charge 0 { 3600 * CAPAH }
92. R1 Charge 0 1MEG
93. V2 N003 0 0.993
94. D1 Charge N003 DFULL
95. D2 0 Charge DREV
96. G_DisCharge Charge 0 VALUE = { IF( I(V_Sense)>0 ^ (V(Cell+,Cell-)<0),
97. + I(V_Sense), I(V_Sense)*CHEFF) }
98.
99. * State of Discharge = 1-SOC
100. E_Invert SODC 0 TABLE { V(Soc) } = (-1,2) (0,1) (1,0)
101. R4 SODC 0 1G
102.
103. .model DFULL  D(Is=1e-6 N=0.02)
104. .model DREV  D(Is=1e-8 N=0.02)
105. .ends
106.