C******************************************************************** SUBROUTINE TYPE74(TIME,XIN,OUT,T,DTDT,PAR,INFO,ICNTRL,*) C version from: 12/22/89 C SAMPLE INPUTS AND OUTPUT VALUES FOLLOW THE NOMENCLATURE C******************************************************************** C**** Subroutine represents a charge controller for a system including C**** PV-array, load and battery storage. C**** The controler represents a shunt type controler. A multi step C**** control scheme is implemented. That means if the battery voltage C**** exceeds the gassing voltage specified by the user, the current C**** into the battery will be limitted to the current corresponding C**** to the gassing voltage. Excess energy is shunted through a C**** dissipater. C**** A blocking diode is included in the model to prevent that the C**** battery is being discharged through the cell. It is assumed that C**** voltage drop at the diode is constant throughout the simulation C**** and just depends on the diode material used in the system. C**** The user has to provide this information as a parameter. C**** Another diode is included in the undervoltage protection C**** device. This way the battery can be disconnected from the load, C**** i.e. the battery won't be discharged, while the array can still C**** charge the battery. C****************************************************************** C**** variables: C F -- fractional State of Charge C FD -- discharge limit on F C FC -- charge limit on F C FDA -- F after which battery can be discharged again, C after being charged C FCA -- F after which battery can be charged again, C after being discharged C GUARD -- signal from undervoltage regulator C IB -- battery current [amps] C SIGNAL -- signals that undervoltage limit is exceeded C SUV -- signal to undervoltage regulator C VB -- battery voltage [volts] C VCA -- limit on voltage, above battery can again begin to charge C after being discharged C VCELL -- voltage send to cell C VC -- high limit on voltage, when battery charging-cutoff voltage C VDA -- limit on voltage, above battery can again begin to discharge C after being charged C VDIODE -- voltage of diode C VD -- low limit on voltage, when battery discharging C VLOAD -- voltage send to load C C************************************************************************** C C SAMPLE INPUT AND OUTPUT VALUES C C INPUTS SAMPLE VALUES C XIN(1) VB 225.7 C XIN(2) VLOAD 220.0 C XIN(3) GUARD 0.0 C XIN(4) IB 61.6 C XIN(5) F .8095 C XIN(6) VC 234.6 C XIN(7) VD 182.4 C C PARAMETERS C PAR(1) VDA 223.0 C PAR(2) FD .7 C PAR(3) FC .99 C PAR(4) FDA .72 C PAR(5) FCA .98 C PAR(6) VDIODE .7 C C OUTPUT C OUT(1) VCELL 226.4 C OUT(2) VLOAD 225.7 C OUT(3) SIGNAL 0.0 C OUT(4) SUV 0.0 C OUT(5) DUMMY 0.0 C C****************************************************************** IMPLICIT NONE DOUBLE PRECISION XIN,OUT INTEGER INFO INTEGER ISTORE,NSTORE,IAV REAL TIME,T,DTDT,ICNTRL,PAR,S REAL VB,VD,VC,VDA,VCA,VDIODE REAL VCELL,VLOAD,DUMMY REAL SIGNAL,SUV,GUARD REAL IB,F,FD,FC,FDA,FCA DIMENSION XIN(7), OUT(5), PAR(6), INFO(10) COMMON /STORE/ NSTORE,IAV,S(5000) C**** store is used to store values from previous timestep INFO(6)=5 INFO(9)=1 DUMMY=S(ISTORE) C-------------------------------------------------------------- C**** Initial call of component IF(INFO(7).LT.0)THEN C**** storage allocation INFO(10)=1 CALL TYPECK(1,INFO,7,6,0) ISTORE=INFO(10) C**** Iinitialization of auxiliary variables used in secant C**** method S(ISTORE)=0. C**** SET PARAMETERS VDA=PAR(1) FD=PAR(2) FC=PAR(3) FDA=PAR(4) FCA=PAR(5) VDIODE=PAR(6) DUMMY=0. C------------------------------------------------------------- C**** first and following calls in time step ELSE C**** Following calls in time step C**** Set inputs VB=XIN(1) VLOAD=XIN(2) GUARD=XIN(3) IB=XIN(4) F=XIN(5) VC=XIN(6) VD=XIN(7) IF(INFO(7).EQ.0)THEN IF(DUMMY.EQ.1.)THEN DUMMY=11. ELSEIF(DUMMY.EQ.22)THEN DUMMY=0. ENDIF ENDIF C**** initially no restrictions are made, battery can either C**** be charged or discharged IF(DUMMY.EQ.0.)THEN C**** F-checks IF((F.GT.FC).AND.(IB.GT.0.))THEN C**** very little current into battery C**** current is shunted through a dissipative device VCELL=VDIODE+VB VLOAD=VB SIGNAL=0. SUV=2. DUMMY=2. ELSEIF((F.LT.FD).AND.(IB.LT.0.))THEN C**** no current out of battery C**** direct coupled mode: array direct connected to load VCELL=VDIODE+VLOAD SIGNAL=1. SUV=0. DUMMY=1. ELSE C**** check voltage IF(VB.LT.VD)THEN C**** satisfying the load is prior to charging the battery VCELL=VDIODE+VLOAD SIGNAL=1. SUV=0. DUMMY=1. ELSEIF(VB.GT.VC)THEN C**** current is shunted through a dissipative device C**** to reduce the battery voltage: trickle charge VCELL=VDIODE+VB VLOAD=VB SIGNAL=0. SUV=3. DUMMY=22. ELSE C**** no restrictions VCELL=VDIODE+VB VLOAD=VB SIGNAL=0. SUV=0. ENDIF ENDIF ELSEIF(DUMMY.EQ.1.)THEN C**** direct coupled mode: array direct connected to load VCELL=VDIODE+VLOAD SIGNAL=1. SUV=0. ELSEIF(DUMMY.EQ.11.)THEN C**** try to run the system with battery C**** battery is disconnected from load VCELL=VDIODE+VDIODE+VB VLOAD=VDIODE+VB SIGNAL=0. SUV=1. DUMMY=12. ELSEIF(DUMMY.EQ.12.)THEN C**** try to run the system with battery IF((F.LT.FDA).OR.(VB.LT.VDA))THEN C**** battery is still disconnected from load IF(GUARD.EQ.1.)THEN C**** battery would be discharged; switch to C**** direct coupled mode VCELL=VDIODE+VLOAD SIGNAL=1. SUV=0. DUMMY=1. ELSE C**** dummy=11 mode is continued VCELL=VDIODE+VDIODE+VB VLOAD=VDIODE+VB SIGNAL=0. SUV=1. ENDIF ELSE C**** no restrictions VCELL=VDIODE +VB VLOAD=VB SIGNAL=0. SUV=0. DUMMY=0. ENDIF ELSEIF(DUMMY.EQ.2.)THEN C**** battery can only begin to charge again, when F is C**** less than FCA IF(IB.GT.0)THEN C**** battery is still on charge IF(F.GT.FCA)THEN C**** very little current into battery C**** current is shunted through a dissipative device VCELL=VDIODE+VB VLOAD=VB SIGNAL=0. SUV=2. DUMMY=2. ELSE IF(VB.GT.VC)THEN C**** current is shunted through a dissipative device C**** to reduce the battery voltage: trickle charge VCELL=VDIODE+VB VLOAD=VB SIGNAL=0. SUV=3. DUMMY=22. ELSE C**** no restrictions VCELL=VDIODE+VB VLOAD=VB SIGNAL=0. SUV=0. DUMMY=0. ENDIF ENDIF ELSE C**** no restrictions VCELL=VDIODE+VB VLOAD=VB SIGNAL=0. SUV=0. DUMMY=0. ENDIF ELSEIF(DUMMY.EQ.22.)THEN C**** current is shunted through a dissipative device C**** to reduce the battery voltage: trickle charge VCELL=VDIODE+VB VLOAD=VB SIGNAL=0. SUV=3. DUMMY=22. ENDIF ENDIF C--------------------------------------------------------- S(ISTORE)=DUMMY C**** set outputs OUT(1)=VCELL OUT(2)=VLOAD OUT(3)=SIGNAL OUT(4)=SUV OUT(5)=DUMMY RETURN 1 END