File Exchange

image thumbnail

Current Controller DC/DC Bidirectional Converter

version (229 KB) by Mahmoud Saleh
Current Controller DC/DC Bidirectional Converter Model with a detailed description


Updated 19 Jul 2017

View Version History

View License

Current Control DC/DC Bidirectional Converter Simulink 2016b, 06/15/2017 Mahmoud Saleh
If you need lower version of the model like Simulink 2015 or lower let me know in the comments
The description of each element is on top of it and how it was calculated. The model is flexible to work within wide range of values. If you have questions please email me at my main email:, student email: msaleh000@citymail.cuny,edu, gmail:
In the subject of your email write: Bidirectional Mathwork question so that I would be able to track the emails even if they went to junk mail.
I am an expert in modeling in Simulink, especially microgrids, I have encountered many problems and I was able to fix it. I used to work with dSpace and I build with my colleagues microgrid testbed at City College of New York. We modeled according to the hardware components avialable in our lab, then we build it and test it. I will try to help in case you have a question.
This work was used in the following publications, please kindly reference them in case you will use this model:
More description about the model and it is testing results in hardware is provided here:
For Citation use :
- M. Saleh, Y. Esa, Y. Mhandi, W. Brandauer and A. Mohamed, "Design and implementation of CCNY DC microgrid testbed,"
2016 IEEE Industry Applications Society Annual Meeting, Portland, OR, 2016.
Also This Model was used in the paper:
For Citation use :
-M. Saleh, A. Althaibani, Y. Esa, Y. Mhandi and A. Mohamed, "Impact of clustering microgrids on their stability and resilience during blackouts," 2015 International Conference on Smart Grid and Clean Energy Technologies (ICSGCE), Offenburg, 2015, pp. 195-200.

Cite As

Mahmoud Saleh (2021). Current Controller DC/DC Bidirectional Converter (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (35)

Vishnu Chandran

Vishnu Chandran

Your model helped me a lot for my project.

Muhammad Hassan

Mahmoud Saleh

Hello Mathewos, you could send me an email with more detailed questions and I'll try to help as much as I can.

Mahmoud Saleh

Hello Mohamed, there is a constant block where you could change the current reference. Notice that the current reference would work within a certain range depending on, voltage levels of the battery and DC bus; values of L and C to achieve continuous or discontinuous mode, which will affect the average output values; values of Kp and Ki; and the size of the connected loads. For more insight, I would recommend reading Ned Mohan's book for Power Electronics, DC/DC converters chapter 7 as far as I remember.

Mahmoud Saleh

Hello Dener, Previous versions are already included in the downloaded file.

Mahmoud Saleh

Hello neethu, you will need a nested PI. The first one is taking the feedback from the load (P or V) and is compared with the desired output power, voltage, etc. This outer PI loop will control the inner current control PI within the model. Notice in this case that the inner loop will have to be faster the outer loop (i.e. tunning/changing the values of Kp and Ki properly).

mathewos hadero

hello thanks for your contribution and I am working on dc microgrid for electric vehicle charging station use which has 500 Vdc and 200A it and I am using fuzzy logic for power flow management of PV system storage battery and grid. BUT still now i have not got what I need.would you help me?

Mohamed Hassan

Amazing job. I just want to ask where should I put the current reference value, excuse my naive question ? thank you

ferhat andirir

Dener Brandão

Hello! I need version of the model for Simulink 2015a!
Thank you so much! E-mail:


Without entering current reference value, how is it possible to control battery absorb and release of power depending on load requirement

Ainsmar Brown

Good model man.

Oguntola Kolawole

Vikash Gurugubelli

Anandraj selva

Nice work Sir,....Sir i need need lower version of the model like Simulink 2014.. email id : Thanks..


Guimin Long

He WenBin

Eric Yeap

Nisha Sathian

Amazing model, thank you for sharing it with us.

umaid ali

its a great well.......thanks a lot :)

anmol sharma

please tell
how tuning is done for other voltage level?

Mahmoud Saleh

Sorry for the late reply i was quite busy and just saw this comment.
A quick answer on top of my head would be that the capacity of the battery is small and need to be increased, also in the past the matlab model for batteries used to give me hard time because it needs to be adjusted carefully to work porperly for your application (e.g. slow dynamics, capcity). One thing you can do, is that replace the batteries with super capacitor and increase it's size to see what will happen and understand wheater the battery model need to change or it is a control problem (i.e. the controller is slow to respond to the changes from the MG). The idea is to think about series of tests to trouble shoot where is the problem and then try to fix it.
Let me know if you have further questions and please share the outcomes of your finding so that we all learn
Best regards,

Boris Brdjanin

By the way I am talking about voltage controller but I accidently put the comment here :D

Boris Brdjanin

Hi Mahmoud, I have one question: If we increase the microgrid current to 5A for example, then the voltage will rise till nearly 500V. Battery should be charging in this situation but it charges too slowly, almost it doesn't charge at all, so the voltage stays at 500V. You mentioned that (I_Microgrid + I_Bidirectional) * R_MG should be ~ V_ref which is probably why it is not working like this. But, can we adjust it so it charges the battery with bigger current and keeps the voltage at 300V at the same time? I would like to connect it to the PV panel, so when I produce too much power from the PV I will charge the battery but I will also keep the voltage at 300V...

Mahmoud Saleh

I will converted to 2016a and upload it as soon as possible, probably during this week. However, I thought I uploaded many version of that model. Anyways, I'll double check and upload it.

ammar khalid

i need this in 2016a

Pham Minh Cong

Dai-Duong Tran -ETEC-

Yusef Esa

Great model, Thanks. It works.

MATLAB Release Compatibility
Created with R2016b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!