Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

MPPT

Status
Not open for further replies.
Section 1:
So, for perturb and observe algorithm the temperature sensor is not required.

Not required but always desired. It's a good health check and can be used for feed-forward setpoints to help the feedback start near the correct point.

Do you think that we need to turn off the mppt charge controller unit and also disconnect the panel? Wouldn't turning off the controller be enough? I think the panel needs to be disconnected so that for some reason battery doesn't get discharged through the panel at night.
If you turn the switch off in the converter, then the panel is disconnected. The coil will discharge and the battery will not have a load on it from the panel or the converter.



First I didn't know that we also need to program the microcontroller to regulate the battery charging. I had thought we only need to track the maximum power point. Now it's clear that mppt charge controller needs two kinds of coding - one to track maximum power point and the other to track the charging of the battery. By the way, I do think that for a school project we can omit battery charge controlling part from the mppt controller and perhaps use some separate IC to protect the battery.
The controller should monitor the battery to determine if it is fully charged. The simple thing to do is to disable the converter when the battery is charged. Eventually the load will bring the battery down to a voltage that can tell you to turn the converter back on.

Of course, there are many other ways, but in a school project simple is better. Actually, even in the real world, sometimes simple is better.

I think the only way, at least a simple one, to track charging of a battery is to already know the pattern of battery charging and it's only possible if manufacturer has provided some kind of data like this one.
It is important to know the battery type and general requirements for charging. A lead acid charging scheme is relatively simple, while a Li-ion would be more involved.

I think the capacitor C_in in Figure 2 plays the role of input voltage source for the buck converter and at the same time also functions as dummy load or resistance to the panel.
That is a reasonable thing to say. The cap is needed by the panel, otherwise it can never operate at it's optimum point given that a buck converter has a discontinuous current input with no coil directly on the input, as would be the case for a boost converter (or SEPIC, or Cuk). Also, the Cin helps the converter see a more stable input voltage, which is basically a good thing.


An mppt charge controller is only programmed to find the maximum power point (ignoring the battery charging algorithm). An mppt only varies the rate of pulse width modulation to the switch such as MOSFET of buck converter to find maximum power point. In Figure 1, it is shown that maximum power point occurs at the same voltage for several curves. Perhaps, in reality this is not really true and maximum power point occurs at slightly different voltage values. But I would say the difference between those real voltage values won't be too much because if it were then the output voltage will vary. But as it is evident from the linked video above, the output voltage doesn't change. So, what do we conclude from this? My first conclusion would be that maximum power point occurs at roughly same voltage. My second observation would be that during search for maximum power point output voltage continuously varies because the rate of pulse width modulation is constantly changed.
Remember that temperature can change also, which would change the optimum voltage. A simple feedforward controller could measure temperature and map temperature to voltage setpoint, and then a controller could do feedback to maintain the voltage. But, then you have no project and it might not perform as well as an MPPT controller. Then again, it might, so you could test both methods if you want to (and have the time to) do a better study. I think generally MPPT is thought to be better, but that assumes a good implementation, so testing would verify that your implementation is good, and better than the other way.


Section 3:
When P_new is less than P_old then according to the flowchart the duty cycle is decreased. To me decreasing the duty cycle would mean that the charge on capacitor would increase and hence more voltage on it. Let's say P_new is the green point "A" in the power figure. To get back to maximum power point, the capacitor needs to lose some of its charge and hence voltage on it, and for this duty cycle needs to be increased and not decreased, so that the charge can get more time to flow toward the output load. Where do I have it wrong?

When P_new is greater than P_old then according to the flowchart P_old is updated with P_new and duty cycle is increased. Again, it seems kinda contradictory to me. Let's say P_new is red point "C" in the power figure and P_old is the blue point "B". Clearly P_old should be updated with P_new but I don't see why duty cycle should be increased. In my view duty cycle should either be held constant or decreased so that more charge can accumulate in capacitor which will raise it voltage. Where am I going wrong?

I think that if the new power is greater, you want to keep the duty cycle at it's new value and not continue on in the same direction yet. On the next step, the controller can figure out if continuing is a good idea. If the new power is less, then go back to the old duty cycle. This is a nice simple method, but obviously there are many other methods, including fuzzy logic control.

So basically, you can step one way and then the other if power is not improving. If power is improving you will move in the correct direction.
 
If you turn the switch off in the converter, then the panel is disconnected.

I want to clarify this a bit. It depends on the construction of the switch. If it is a MOSFET, then it conducts in opposite direction and won't prevent the battery from discharging into the panel during the night.
 
I find it hard grasping that you have to regulate multiple things.

The service voltage. Usually say 120 VAC
The battery charging algorithm.
The operating point of the input. MPPT.

The MPPT input doesnt matter if there is no load or sun.

Battery disconnect is a protection mechanism.
If the battery protect is on then wait.
Wait for what?
Voc and or idependent intensity or temp measurement?
When is the load allowed to be connected?

Assume the load is variable, the generating capacity is variable and the load may exceed generating capacity what do yo do?

Load shed? Do you say disconnect the load until the battey is 3/4 charged? Detecting that is a problem in itself.
 
Thank you, NorthGuy, Steve, KISS, for the help.

I'm still very much confused about the query posted in Section 3 in my previous post and I don't think it would be wise to proceed any further before clarifying that main confusion.

Though NG has said that the flowchart is wrong, I don't see how because the pseudocode which I later added to my previous post also says something similar to the flowchart.

steveB : It would be really interesting and good thing to understand the given problem in terms of control theory. But, in my opinion, for me it would be more helpful to understand the model in terms of simple circuit theory first. Once I have some understanding of the model from circuit theory point of view, I can proceed to try to analyze the model in terms of feedback, feeedforward terms. If I'm thinking wrongly then please let me know. Thank you.

Let me try to state my confusion again in the hope that you might be able guide me properly. I will be using this figure.

Let us think of MOSFET as a valve and duty cycle as the time duration during which the valve is open. This way the term 'increasing the duty cycle' would mean that the valve would remain open for longer period of time. When the duty cycle is increased (valve is kept open for longer period of time) then more quantity of charge will be able to reach the output terminal, V_out. Increased duty cycle will also mean that the quantity of charge being depleted from C_in at a faster rate and this depletion of charge means voltage getting lowered on C_in.

Suppose, the power being calculated is the point "A" in blue. The point A corresponds to a certain voltage on the input capacitor, C_in, and that voltage is approximately 0.3V. In order to increase the voltage on C_in, what should be done? I think the duty cycle needs to be decreased (valve should remain closed for longer period of time) so that rate of accumulation of charge on C_in is greater than rate of depletion of charge from C_in.

If you think that what I'm saying is wrong then how else the voltage on C_in can be increased so that power point "B" can be reached which correspond to 0.4V. Please remember than I'm thinking of C_in as a dummy load to the panel and also as a dummy voltage source to the buck converter.

Thanks a lot.

Regards
PG
 

Attachments

  • pro_po_flow1.jpg
    pro_po_flow1.jpg
    72.2 KB · Views: 931
Last edited:
You're right. Increasing the duty cycle will decrease the voltage. 0% duty cycle will let the panel to charge the capacitor to the highest possible voltage. 100% duty cycle will make the voltage equal to the battery voltage (plus mosfet drop).

However, you need to maximize the power, not the voltage. If you increase duty cycle and this causes the power to decrease then you need to decrease duty cycle to get more power. If you decrease duty cycle and see the power decrease then you need to increase duty cycle to get better power. Therefore, your actions depend on the direction of the perturb step taken. The flowchart you posted seems to dismiss the direction of the perturb step.
 
It would be really interesting and good thing to understand the given problem in terms of control theory. But, in my opinion, for me it would be more helpful to understand the model in terms of simple circuit theory first. Once I have some understanding of the model from circuit theory point of view, I can proceed to try to analyze the model in terms of feedback, feeedforward terms. If I'm thinking wrongly then please let me know.
You are thinking correctly in my opinion. I'm far from an expert on DC/DC converters, but my approach is always to consider the basic circuit topology first. I try to understand the operation, and then develop a model of the circuit. Only then do I try to figure out the control issues. Some circuits lend themselves to easy analysis, and others are more difficult. The same is true of control methods. There are simple control schemes and complex schemes depending on the circuit topology/type and on what exactly you are trying to do.

Let us think of MOSFET as a valve and duty cycle as the time duration during which the valve is open. This way the term 'increasing the duty cycle' would mean that the valve would remain open for longer period of time. When the duty cycle is increased (valve is kept open for longer period of time) then more quantity of charge will be able to reach the output terminal, V_out. Increased duty cycle will also mean that the quantity of charge being depleted from C_in at a faster rate and this depletion of charge means voltage getting lowered on C_in.

I find this description confusing, although it seems to be correct. Let's not use the word valve and refer to it as open/closed because it is confusing. I would prefer to say "switch" and then closed/open means on/off or shorted/unshorted. I like to say the switch state is value s=1 when the switch is closed, and then s=0 means the switch is open. The duty cycle is then

[latex]D=\frac{1}{T}\cdot\int_{t}^{t+T} s(\tau) \cdot d\tau[/latex]

In other words, the longer you leave the switch on (or closed) the higher the duty cycle is. If the switch is on always D=1, and if the switch is off always D=0. You don't have to define it this way, but it's my choice. If you choose, you can invert it and have D'=1-D as the duty cycle.

Suppose, the power being calculated is the point "A" in blue. The point A corresponds to a certain voltage on the input capacitor, C_in, and that voltage is approximately 0.3V. In order to increase the voltage on C_in, what should be done? I think the duty cycle needs to be decreased (valve should remain closed for longer period of time) so that rate of accumulation of charge on C_in is greater than rate of depletion of charge from C_in.

If you think that what I'm saying is wrong then how else the voltage on C_in can be increased so that power point "B" can be reached which correspond to 0.4V. Please remember than I'm thinking of C_in as a dummy load to the panel and also as a dummy voltage source to the buck converter.

I would look at it from a different point of view. Think about the converter as a load resistance emulator, or a controllable/variable resistance. If you short the panel, the current is maximum and the voltage is zero, and you have moved away from point B. If you open the panel, you move to zero current and max voltage, which moves you toward B. Hence, in your case you want to increase the emulated resistance from the converter. This implies that your converter's controller can be configured to emulate resistance with a resistance command as an input, then the MPPT simply needs to perturb the resistance value, and then observe which direction increases power. The simple algorithm will search out and sit at the peak power point.

Next comes the question of how you implement the resistance emulation control, but as you mentioned above, you need to understand the low level circuit operation before you can design the controller. I've designed resistance emulation controllers with SEPIC topology, but a buck converter will have different issues to think about. So, I can't claim to have thought this out fully. I can't even tell you if this will be trivially easy or very difficult to control with this topology. Off the cuff, I see that the average input current (which needs to track the average input voltage to emulate a constant resistance) depends on D and the coil current, as I1=D I2, where I1 is the average input current and I2 is the coil current. The input current is discontinuous turning on and off quickly, while the coil current changes more gradually. This means that D can have a very fast effect on I1, while the effects of I2 take longer. If D decreases, then initially I1 goes down quickly. Also, this will begin to discharge the coil current gradually. A lower input current means higher resistance. Hence, as you say, decreasing D will put you in the correct direction.

However, an inner feedback loop seems to be needed here to make it work as best as it can. The MPPT control is a very slow controller, while typically DC/DC converters should be controlled with higher bandwidth.

EDIT: I fixed an error at the end of my description above.
 
Last edited:
Thank you.

However, you need to maximize the power, not the voltage. If you increase duty cycle and this causes the power to decrease then you need to decrease duty cycle to get more power. If you decrease duty cycle and see the power decrease then you need to increase duty cycle to get better power. Therefore, your actions depend on the direction of the perturb step taken. The flowchart you posted seems to dismiss the direction of the perturb step.

Do you consider this flowchart correct? Please note that I have edited the flowchart a little so that you can tell if my understanding is exactly correct. Now I'm also little confused about the flowchart which I posted in post #39. Thanks.

Regards
PG
 

Attachments

  • pro_flow2.jpg
    pro_flow2.jpg
    64.7 KB · Views: 906
Do you consider this flowchart correct?

Yes, except that you cannot go both directions from the "Start" box. You can go to either "Increase" or "Decrease". Since the start occurs when it turns on in the morning, the voltage is likely to be too high, so you probably need to start from decreasing it.
 
Yes, except that you cannot go both directions from the "Start" box. You can go to either "Increase" or "Decrease". Since the start occurs when it turns on in the morning, the voltage is likely to be too high, so you probably need to start from decreasing it.

Is this any better? Is there any need for modification? Thank you.

By the way, now I find this pseudocode incorrect assuming that you find the shown flowchart correct. Am I correct? Thanks.
 

Attachments

  • pro_flow3.jpg
    pro_flow3.jpg
    39.7 KB · Views: 1,000
Last edited:
This chart looks good.

IMHO, such way of writing code leads to confusion. I would write it like this.

C:
duty_cycle = 0;
delta = 1; // some useful prturb step for the duty cycle
prev_power = 0;
 
while (1) {
  power = meausure_power();
  if (power < prev_power) {
    delta = -delta;
  }
  prev_power = power;
  duty_cycle += delta;
  wait(); // if necessary
}

This way you don't need to worry whether you move in the correct direction or not.
 

Amazing!!! Just look at P&O algorithm on diagram 2. They think it's real bad. So they build a new INCCOND algorithm, and draw much bigger diagram (3). But look, it's entirely equivalent to the "bad" P&O algorithm with a single difference - it doesn't perturb when two measurements of the power are equal. What's the chance of them being exactly equal if each measurement is an average of, say, 100 measurement (assuming 4kHz sampling rate) on a ripply singnal? If you have an ADC with enough resolution to detect MPPT point, the chance of them being equal is close to zero! INCCOND is exactly the same as P&O except it will skip perturb in one of 1000 cycles. No wonder they didn't post any comparisons! They wouldn't find any difference!

I'd say with contemporary ADC speed and accuracy, the algorithms with two nested control loops are the things of the past. May be good for a school project, but not good enough to write application notes representing them as an advanced stuff.

The question remains whether it's a marketing trick, or just incompetent people writing application notes.
 
Thank you, Steve, NG, Jony.

steveB: Thank you for your input and pointing out some practical issues. I will get back to your post later once I have basic understanding of the circuit.

NorthGuy: At this time I won't get into coding details because, as I said above, I first need to clear some fundamental flaws in my understanding.

I believe we were able to resolve the confusion related to Section 3 in post #39. But now it's time to get back to Section 2. For that purpose, I will repeat some of the stuff.

I understand the operation of a standalone buck converter. It's output voltage is less than or equal to the input voltage and depends on input voltage and duty cycle. If duty cycle is increased, output voltage increases. Likewise if input voltage is increased while keeping the duty cycle constant, the output voltage also increases. If both input voltage and duty cycle are increased, the output voltage also increases, and so on. But I get confused when buck converter is used as part of mppt charge controller.

An mppt charge controller is only programmed to find the maximum power point (ignore the battery charging algorithm). An mppt varies the rate of pulse width modulation to the switch such as MOSFET of buck converter to find maximum power point. In other words, I'm saying that maximum power point tracker doesn't really care about the output voltage of buck converter; it's sole function is to deliver maximum power. In Figure 1, it is shown that maximum power point occurs at the same voltage for several curves. Perhaps, in reality this is not really true and maximum power point occurs at slightly different voltage values. But I would say the difference between those real voltage values won't be too much because if it were then the output voltage will vary by great degree. Do you also think that the value of output voltage, V_out, will vary by significant amount if maximum power point occurred at voltage values which noticeably differed from each other? Please don't forget that I'm ignoring any charging algorithm and effect of temperature. BTW, if we are ignoring charging algorithm then calling it just maximum power point tracker is more appropriate.

Do you agree that during search for maximum power point the output voltage continuously varies because the rate of pulse width modulation is constantly changed?

Thank you.

Regards
PG
 
PG,

Vout is of no significance to what you are trying to understand above. Remember that you are ultimately charging a battery which has voltage determined by its charge state (and loading too). For all practically purposes, you can view this as a very large capacitor at the output, with a charge equal to the battery voltage. Think of the converter as operating at the maximum power point and then dumping all that power (times an efficiency factor, or course) into the battery or any loads connected at the output. The controller will set whatever duty cycle is needed to operate at that point.
 
Thank you, Steve.

Vout is of no significance to what you are trying to understand above.

You are right. But who knows someone might ask me about this. Then I can't tell them Vout is of no significance! :) On the other hand, it might help me with other concepts. Although, to me, it seems quite reasonable whatever I said in my previous post. But how can I be sure because many of the things in the past, as you would remember, which seemed quite reasonable to me were proven utterly wrong?! :)

Regards
PG
 
Last edited:
What Steve said is absolutely correct. In standard buck, the input voltage is fixed, but the output voltage can be regulated by varying the duty cycle. In MPPT, the output voltage is nearly fixed by the battery, and the input voltage can be regulated by varying the duty cycle.
 
Then I can't tell them Vout is of no significance! :)
Yes, poor choice of words on my part. Basically, what you want to understand about Vout is that it is more or less fixed, or slowly changing. The value of Vout does determine the average output coil current, because the input power times efficiency is equal to output voltage times output current.

As NorthGuy pointed out. Even though most buck or boost converters control the output with fixed input voltage, this situation is different because the output is fixed and you are controlling the input voltage and power. The buck converter has the steady state relation Vout=D Vin and I1=D I2, if we assume perfect efficiency. This gives you an approximate idea of what value of D will be needed. However, the feedback controller will figure out the precise value needed including dynamic effects and efficiency factors.

I think those kind of answers would be good enough for questions you may get.
 
Thank you, NG, Steve.

So, my reasoning was not wrong. If we are using a battery as a load to mppt then the Vout is determined by voltage of the battery. But if it were a resistor instead of a battery then Vout will vary.

The buck converter has the steady state relation Vout=D Vin and I1=D I2, if we assume perfect efficiency where I1 is input current and I2 is output current.

I have read that mppt chargers are recent addition to category of solar chargers and before that PWM chargers were very popular which are less efficient than mppt ones. I have tried to find some good source which describes how pulse width modulation charger works but I couldn't find any good source. Could you please point me to some good source, or if possible, could you briefly describe it yourself? I think it would be good thing to have overall understanding of its operation and knowing shortcomings of PWM chargers will highlight the importance of using mppt. You might find this text useful.

It has been mentioned that lead acid batteries are used for solar energy. Any special reason for this choice? Why not lithium-ion batteries? One of the reasons for not using Li-ion might be their high price. .When it comes to solar energy, do both lead acid and sealed lead acid batteries share the same place?

I understand that when a battery is connected to a charger then the voltage, Vout, at the output terminals of charger is same as that of the battery, as you have also told me. I'm still little confused so let's look at it from a different point of view. Let's suppose we have two batteries; the one is rated at 36 V and is fully charged, and the other is rated 12V and is sitting at 10 V. The positive terminal of one battery is connected to positive terminal of the other battery and the same goes for negative terminals. The 36V battery should be able to push current through the 12V battery because it sits at higher voltage. We have also connected a voltmeter which will read 10V at the start. But why? We know that resistance of one ohm means drop of one volt per ampere, i.e. 1Ω=1V/A where one volt is one joule per coulomb and ampere is flow of charge of one coulomb per unit time through a certain point. Think of 12 volt battery which sits at 10v as a resistance. Please have a look here. The 36 volt battery is pushing the current clockwise and 12volt battery counterclockwise and the winner is going to be 36 volt battery. We can see that 36-10=26volt. Where are these 26 volts going? They are being used to charge up the battery but then why isn't the voltmeter reading 26 volts? How do we calculate the resistance of 12V battery? I think that I know the answer but for some reason I don't know how to put it together. Please guide me. Thanks.

This is the charging profile for a lead acid battery cell. I don't think a battery internally can control the amount of current during its charging. As we can see that the current needs to be closely monitored and gradually decreased in Stage 2. There should be some external mechanism or device which regulates the current going into the battery. Obviously, such a device called battery charger or regulator. But how would a regulator determine that battery has entered Stage 2 in order to tightly control the current?

Although I have made this query before, I'm still confused so I will give it another try. Why don't we connect a load, such as electric heater, directly to the panel? We need to consider two important points about a solar panel first. First a solar panel behaves like a current source. A current source is always concerned about passing a fixed amount of current through a resistance and in order to do that it can adjust the voltage (its pressure) around the resistance. Secondly, a solar panel's maximum power is rated for Vmpp and Impp which is mostly calculated at 1000W/m^2 at 25C. Suppose the heater resistance is 20. We know that V=IR=(1.5)(20)=30V, and Power=VI=(30)(1.5)=45W. But from the figure we can see that the panel is still willing to provide more voltage (strong push or more pressure) if it is offered a suitable resistance. It appears that that suitable resistance is 33Ω. If we had used resistance or heather of 33Ω then power obtained would be almost (50)(1.5)=75W. We would only be able to utilize this extra power of 30W (75-45) if the heater's resistance can be adjusted. Or, the easier way would be to use an mppt tracker. Suppose, the tracker steps down Vmpp to 30V on its output terminal and steps up the current to 2.5A then you would be able to get maximum power even with your 33Ω heater. We should also consider another issue. If we were using a light bulb instead of heater then there would be other issues. First, if we had connected light bulb directly to the panel then in the first place we would be wasting some power and on the other hand light from the bulb would continuously vary. If we had connected light bulb using an mppt even then brightness will vary during different times of the day. So this tells us another advantage of using a battery an intermediate energy storage device. Do I make sense?

Thank you very much for the help.

Regards
PG

References:
1: http://www.freesunpower.com/chargecontrollers.php
2: books.google.com/books?id=7AAWH_63HuAC&pg=PA164&dq=pwm+charger&hl=en&sa=X&ei=7L41U6qYNevs0gWD5YGwAg&ved=0CDEQ6AEwAQ#v=onepage&q&f=false
 

Attachments

  • pro_11.jpg
    pro_11.jpg
    178.9 KB · Views: 618
  • pro_batt.JPG
    pro_batt.JPG
    17.8 KB · Views: 593
  • solar specs.jpg
    solar specs.jpg
    189.9 KB · Views: 615
  • pro_iv.jpg
    pro_iv.jpg
    58.5 KB · Views: 622
  • clead1.jpg
    clead1.jpg
    47.1 KB · Views: 1,018
Last edited:
If you connect 36V battery to 12V battery, the voltage will be obviously the same. The voltage of 36V battery will drop (as any battery does under load) and the voltage of 12V battery will rise (as with any battery being charged). The 36V battery will be charging the 12V battery. The resulting voltage will depend on the size of the batteries.

If 36V battery is much bigger, it'll overcharge the 12V battery - water in the electrolyte will be decomposed into hydrogen and oxigen and an explosion may result if there's a spark (or in case of li-ion battery it'll be an explosion for other reasons).

If 12V battery is bigger, it'll overload the 36V battery. Quick discharge will release a lot of heat, electrolyte will evaporate and lead will melt, but hopefully, nobody get hurt.

Sure it also depends on the states of charge of these batteries.

Lead-acid batteries are very common, they're much cheaper and safer than li-ion. Sealed batteries are more expensive and last less than flooded ones. But they're no perfect by any means.
 
Status
Not open for further replies.
Back
Top