/MPPT-Reinforcement

Maximum power point tracking - MPPT. Traditional algorithms and Q learning

Primary LanguageMATLAB

MPPT-Reinforcement

Maximum power point tracking(MPPT) algortihms and reinforcement learning. This repository is, for now, limited to solar cells. You can also do it with wind.

The implemented algorithms can be found here.

What's MPPT?

It's like climbing a hill except the hill is made of power and all you have is voltage. Sometimes, if you're really unlucky, you're climbing multiple hills...

Uniform irradiance Partial shading
Fig 1. PV curve with the maximum power point(MPP, the red thing). The goal is to get to the red thing. Fig 2. PV curve with multiple local maximum power points. The goal is still to get to the red thing - the global MPP.

The scenario in Fig 1. happens when there is 1 or no bypass diodes(the ones parallel to the panel) on the string of solar panels connected to one converter or if there are more but they are all irradiated equaly. However, if there are more bypass diodes per converter and the panels are partially shaded i.e. they aren't irradiated equaly you get what's shown on Fig 2. - a mess. In that case a global search algorithm would be cool. In the first scenarion, a local one will suffice.


What can you do about it?

Well, you can employ certain algorithms to climb that hill for you. Traditional algorithms include but are not limited to:

  • Perturb and observe
  • Incremental conductance
  • TODO Others that are not as good as the first two

Newer, less traditional algorithms include but are also not limited to:

  • Q learning
  • TODO Others

This is where the fun is.

A comparison

Let's compare two algorithms as they try to track the MPP as it changes over time.

Perturb and observe

Climbs a hill. Knows what left, right, up and down are. Does the job well. Is short sighted - optimizes locally.

pno

Fig 3. Perturb and observe algorithm. Quick, clean, realiable.


Q learning with Q table

Climbs a hill without knowing what a hill is. Never heard of up and down, left or right. Only knows what actions are on the table. Climbs the hill nevertheless. Can't ask for much more than that. Uses a lot of memory, though. I don't know if it optimizes locally, that remains to be seen.

qtable

Fig 4. Q learning with Q table. Takes a while to warm up, is a little sloppy but gets the job done.