Bismillah... In the Name of God...
I will briefly describe the case as here: The battery supplies the DC motor to operate but it is important to keep the State-of-Charge (SOC) between 40 and 80%. Thus, the Relay and Switching component must assure that when the battery SOC goes down to 40% the PV Array needs to charge the battery. And if the SOC already reach 80%, the PV Array needs to be disconnected and the battery runs into discharging state.
Fortunately, PV Array model is already available in MATLAB Simulink 2017. Together with the battery and DC machine, I combine them into a simple structure as shown below. Before reaching a conclusion with this structure, I faced many problems in running the simulation, especially caused by switching mechanism.
Figure 1 Automatic battery charging with PV Array
In the beginning, I used ‘Ideal Switch’ together with Relay component to perform the switching mechanism. But whatever I adjust the solver configuration and component structure, the singularity error comes very often especially when the SOC reach 80% and the ‘Ideal Switch’ must cut the connection between PV Array and the others.
The error notification such as this comes to me very often:
Algebraic state in algebraic loop containing 'epsmdc/PV Array/I Filter/First-Order Filter/Model/Sum1' computed at time 504.77687270591304 is Inf or NaN. There may be a singularity in the solution. If the model is correct, try reducing the step size (either by reducing the fixed step size or by tightening the error tolerances)
After so many trials, I suspected that the main problem lied within the ‘Ideal Switch’ component. The very short ON-OFF jump in cutting the line, probably caused the solver reach singularity solution. Then, after looking for many ways out, I think the most plausible solution is by adding some transient for ON-OFF switching mechanism. Thus, I use the transfer function of First-Order System as shown in the figure. And Thank to God, this solution is working perfectly and provide me with this plot of SOC.
Figure 2 The battery SOC for 100000 seconds
This plot shows that charging and discharging mechanism of the battery is already working normally for 100000 seconds. It seems that, PV array needs 8000 seconds (~2 hours) to charge the battery and then the battery can supply the machine until for ~ 9 hours.
Figure 3 Rotor speed of the DC machine
This plot shows rotor speed of dc machine driven by the battery for 100000 seconds. The rotor rotates steadily at 135 rad/s or around 1300 rpm while the battery is charging and discharging many times.
Figure 4 Solver configuration
The configuration for the solver needs to be chosen properly. The singularity errors sometimes are caused by inappropriate solver, step size, and also the relative tolerance. So far, the configuration as shown above, for this case, works best. It can perform my simulation for 100000 seconds only in few minutes without any singularity errors.
I think, some important points I've got from this study is listed below
- Ideal Switching with very short ON-OFF jump, in my case, caused singularity error especially for PV Array. Using transient switching is preferable.
- The selection of Solver (odexx) and also its step size and relative tolerance sometimes prevent the simulation to reach singularity error, and also perform the simulation faster. So far in my cases, ode23tb is the fastest solver I have ever used, but still needs some verifications later with the other cases. Insya Allah.
REFERENCES
https://www.mathworks.com/help/physmod/sps/powersys/ref/battery.html
https://www.mathworks.com/help/physmod/sps/powersys/ref/pvarray.html
Olivier Tremblay, Louis-A. Dessaint, https://www.mathworks.com/help/physmod/sps/examples/ni-mh-battery-model.html
https://www.mathworks.com/help/physmod/sps/powersys/ref/dcmachine.html
Assalam O Alaikum.....
ReplyDeleteI studied your work in detail. Your efforts are much appreciable.
I am working on a related project. I feel glad and thankful to you if u kindly share related material or research paper with me.
Thanks