├── Functions ├── LLC_closed_loop_02.slx ├── README.md ├── bms_final_sims_06.slx └── pfc_closed_loop_ripple4.slx /Functions: -------------------------------------------------------------------------------- 1 | %% 2 | function soh =soh_fcn(soc) 3 | n=3500; 4 | [xb,yb]=stairs(soc); 5 | ds=diff(yb); 6 | time=0:1e-03:600; 7 | dt=diff(time); 8 | c=0; 9 | u=0; 10 | d=0; 11 | if (ds/dt>0 && soc>80) 12 | u=1; 13 | if d==1 14 | c=c+1; 15 | u=0; 16 | end 17 | d=0; 18 | elseif ds/dt<0 && soc<20 19 | d=1; 20 | if u==1 21 | c=c+1; 22 | d=0; 23 | end 24 | u=0; 25 | end 26 | soh=(c/n)*100; 27 | end 28 | 29 | %% 30 | 31 | function [Iavg,wavg]= avg_fcn(I,w) 32 | Iavg=0; 33 | wavg=0; 34 | while(1) 35 | for i=1:180 36 | Iav=((Iavg*(i-1))+I)/i; 37 | wav=((wavg*(i-1))+w)/i; 38 | pause(1); 39 | end 40 | i=1; 41 | Iavg=Iav; 42 | wavg=wav; 43 | end 44 | end 45 | 46 | %% 47 | 48 | function R = range_fcn(Iavg,S,wavg) 49 | while (1) 50 | t=S/Iavg; 51 | rad=0.35; 52 | V=rad*wavg; 53 | R=t*V; 54 | pause(180); 55 | end 56 | end 57 | 58 | 59 | -------------------------------------------------------------------------------- /LLC_closed_loop_02.slx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nimishamehta5/EV_Simulation/ced79e9383a832abae199ee06c3dfdb7184526c8/LLC_closed_loop_02.slx -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # EV_Simulation 2 | Matlab/Simulink model of a battery charging and monitoring system for an electric utility vehicle. 3 | Charging circuit features: 4 | a. PFC (interleaved boost converter) 5 | b. Isolation (LLC bridge and synchronous rectifier) 6 | c. Closed Loop operation 7 | 8 | Monitoring system: 9 | a. V, I, T monitoring 10 | b. Functions to estimate range and health of battery 11 | c. Fault simulation and tripping 12 | d. Dashboard GUI 13 | -------------------------------------------------------------------------------- /bms_final_sims_06.slx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nimishamehta5/EV_Simulation/ced79e9383a832abae199ee06c3dfdb7184526c8/bms_final_sims_06.slx -------------------------------------------------------------------------------- /pfc_closed_loop_ripple4.slx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nimishamehta5/EV_Simulation/ced79e9383a832abae199ee06c3dfdb7184526c8/pfc_closed_loop_ripple4.slx --------------------------------------------------------------------------------