Shop OBEX P1 Docs P2 Docs Learn Events
MPPT Using the Prop — Parallax Forums

MPPT Using the Prop

PhilldapillPhilldapill Posts: 1,283
edited 2007-12-13 19:58 in Propeller 1
Hey everybody! I'm pretty new to the Prop and microcontrollers in general so bare with me.
I have a fairly large solar array that was "given" to me(a story for another time). I've read up quite a bit on Maximum Power Point Tracking to increase the available power output from the solar panels. To do this, I plan on using the Propeller, a couple Analog-to-Digital converters, and some high power mosfets. The Propeller, of course, will be the brain of the device and should be responsible for PWM control of the MOSFETS and at the same time, query the ADC's to determine current and voltage levels. From there, it will determine power output and adjust the PWM accordingly. By constantly monitoring the power output(10 times a second or so), I'm thinking I can maximize the efficiency of my panels.
·
Here is were my question(s) come in.
1. Good quality ADC's are expensive! I need to have the highest bit resolution I can from the ADC with a low input ref. voltage.
···· a. Is there any way the Propeller can actually read an analog voltage accurately and turn that into a binary number?(This thing is magical after all...)
···· b. If the Prop can't do the A-to-D thing, does anyone know of an inexpensive, 12-bit minimum ADC I can get?
·
2. I'm using a PWM object from the object exchange to do the PWM. I've made a slight modification to the code so that the duty cycle resolution is now from 0.0% to 100.0% instead of just 0-100(I added another decimal place). Now there are 1000 different duty cycle settings.
···· a. Is there a better way to turn the mosfets on completely and faster than by using the propeller outputs on the gate directly? I've heard of some IC's that are specifically designed for this task but I'm not sure if it's worth it. Your thoughts?
·
This forum is a great resource and I want to preemptively thank all you guys for your help.
·

Comments

  • deSilvadeSilva Posts: 2,967
    edited 2007-12-10 22:14
    (1) For PWM see my "Tutorial" thread and my examples - but PWM is simple.
    (2) When you use a MOSFET, consider that it neeeds quite a high voltage at the gate...
    (2a) For this reason, the switching characteristic of PWM (3V / 0V) may be even a good thing.
    (2b) An alternative is adding an appropriate low pass (cap to ground) at the transistor gate, using it as analogue amplifier rather than as a switch.
    (3) The many times here discussed Delta-Sigma modulation is a fine way for data acquisition at your low rate.
    If I read the tables correctly you could accomplish 21 bits resolution @ 10 Hz smile.gif - if there were no other noise and perfect components i.e. smile.gif

    Edit: as always... I reduced number of typos..

    Post Edited (deSilva) : 12/11/2007 12:17:42 AM GMT
  • PhilldapillPhilldapill Posts: 1,283
    edited 2007-12-10 22:22
    deSilva said...
    (2) When you use a MOSFET, consider that it neeeds quite a high voltage...
    Thanks deSilva! I don't understand what you mean by the mosfet needing high voltage... The Vds I'm putting across is about 30V and the absolute maximum is 35V so my inpute voltage is within the limit. This is a· "logic level" mosfet so the turn on threshold is about 1.5V. Fully turned on is about 3V. From what I understand, one of these mosfet amp chips simply gives the mosfet gate a high burst of current and voltage so the gate charges very quickly, reducing the turn on time. Do you think that the propeller can source enough current fast enough to achieve the same effect?

    These chips are pretty expensive so if I can do it all with the magic prop, I will. Thanks again!
  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-12-10 22:38
    Your understanding of thier primary function is correct, gate driver ICs are to speed up the switching time of power MOSFETS by injecting a high (but controlled) burst of current to overcome the relatively high capacitance of a power MOSFET's gate. Without understanding all the factors and delving into some math, it would be difficult to say whether you need a gate driver. I would first try to use a Propeller I/O pin to directly drive the gate, then scope the output of the MOSFET (do not connect a reactive load to the MOSFET's output·(ie nothing inductive or capacitive)) to see the switching characteristics. If the corners are too rounded (caused by the variable resistivity of the MOSFET during a switching moment), add a gate driver IC. However if your load is reactive, you may find the gate driver IC does not effect the switching chacteristics because the output stage is swamped in trying to overcome the load's reactance.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.

    Post Edited (Paul Baker (Parallax)) : 12/10/2007 10:50:10 PM GMT
  • deSilvadeSilva Posts: 2,967
    edited 2007-12-10 22:49
    Yes, "logic level" MOSFETs will do.. I have lost the orientation wrt the different MOSFET types already years ago smile.gif
  • Nick MuellerNick Mueller Posts: 815
    edited 2007-12-11 00:37
    > If I read the tables correctly you could accomplish 21 bits resolution @ 10 Hz smile.gif - if there were no other noise and perfect components i.e. smile.gif

    That was really a joke!
    Did you read the specs? Did you read Vih Vil? 0.6Vdd..Vdd and Vss..0.3Vss. Voh, Vol
    Now where are those 21 bits?



    Nick

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Never use force, just go for a bigger hammer!

    The DIY Digital-Readout for mills, lathes etc.:
    YADRO
  • deSilvadeSilva Posts: 2,967
    edited 2007-12-11 00:54
    Sorry, I forgot to say that you do not only need perfect components (especially the cap) but also a low temperature...

    The actual resolution will depend on many factors including the quality of the power supply... There is litle experience here what can be accomplished regarding shortcommings of the mechanical build-up.
    I should say: 10 bits is feasible, 12 bits is possible.

    If there is a need to amplify the input signal this will add additional noise...
  • PhilldapillPhilldapill Posts: 1,283
    edited 2007-12-11 00:59
    Thanks guys. For a beginner, I think I'll just stick with the ADC samples I got from Texas Instruments. These are 12 bit with a + and - input and external ref. Pretty good for what I'm doing.
  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-12-11 01:04
    Be sure to read any application notes TI has published on board layout techniques for high precision ADCs. There needs to be appropriate issolation of the analog ground from the digital ground in order to obtain the full accuracy of the chip (this is true for all ADCs greater than 8 bits).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • PhilldapillPhilldapill Posts: 1,283
    edited 2007-12-11 01:08
    Noted. Thanks for the insight Paul!
  • Paul RowntreePaul Rowntree Posts: 49
    edited 2007-12-11 14:40
    Greetings All;
    Aside from the electronic issues that have been answered so well already, I am curious about the use of relatively high-power devices to optimize efficiency of the solar panel. Will the PWM motors be running / adjusting full time ? In the case of a stationary solar panel, the apparent movement of the sun is relatively slow : would a few updates per minute or even per hour (instead of 10Hz) be enough? With even 1000 PWM settings spread across a 8-10 hour sun-day, the best that could be hoped for is about one PWM increment per minute.

    It would be a shame to lose the extra power from the panel in driving the motor hardware unnecessarily.

    Cheers!
  • deSilvadeSilva Posts: 2,967
    edited 2007-12-11 17:48
    Ah, this will be a fine exercise for my other group of students smile.gif

    There is no closed solution, but you can play with EXCEL...
    Consider: When you install some solar cells, looking to the zenith, in Quito, at the 21st of June, they will profit from 70% of the sun's radiation (not considering other efficiency impacts). They will profit from 100% if you rise them up in the early morning to the east and in the evening to the west. If this needs more than 30% of the finally (!) produced energy, you should refrain from such experiments...

    When you adjust the plane each hour, you will be off by +/-7.5° during that hour, which is a mean of 3.8°, leading to a loss of much less than 1%.

    So it seems it does not make much sense to adjust it more often than once an hour.

    It will make more sense when you do not live in Quito and it is not the 21st of June...
  • PhilldapillPhilldapill Posts: 1,283
    edited 2007-12-11 18:47
    Wow. I think I may have done·a poor job at explaining what I'm doing. The solar array I have is stationary(for now at least). It consists of 2'x2' panels mounted on array frames of 12 panels each. Like I said, the array is stationary and doesn't move. What I am trying to do is adjust the amount of charge moving from the panels to the batteries. If I have the panels connected directly to the batteries, the 35V open circuit voltage of the panel is brought down to the 12V of the battery. I believe the optimal working voltage of the panels are around 24V or so. My intent is to have the panels connected directly·to a fairly large capacitor bank(~50,000uF) which will store some charge and act as a buffer for the panels to operate at a particular voltage(24V). The PWM comes in by switching a power mosfet on and off very quickly between the capacitor bank and the load(batteries). The schematic below should aid somewhat in the overall concept.

    You are right deSilva. It is kind of useless to try moving the panels every so often. I haven't done any precise calculations, but I think that the energy gained·minus the energy lost in moving the array is not worth the trouble of designing the physical system. All I'm trying to do now is find the MPPT of the panels with respect to the electrical aspect, not the physical. If any of you guys know about MPPT in detail, I'm all ears. Here is the method I'm thinking about using.

    At an arbitrary time interval, the prop will measure the current flowing through R_Shunt, and the voltage across the C1_Solar_Buffer capacitor(solar panel in parallel). Multiplying these two numbers together(current x voltage) will give the power being delivered to the load(batteries). The Prop will increment the PWM duty cycle to allow more current to flow to the batteries. It will then measure the current/voltage and determine if there was a power increase relative to the last measurement. If there was, it will again, increase the PWM duty and check for another power increase. It will continue to do this until it encounters a power DECREASE. At this point, it will decrease the PWM duty and check/adjust. It continually does this so that it hovers around the maximum power point on the power curve of the panels. In effect, the PWM creates a psuedo resistance in series with the panel and battery, but with negligible power loss due to heat.

    So, THAT is what I'm trying to do in the big picture. I hope that clears things up a bit.· Thanks guys for all the replies in such a short time!
  • PhilldapillPhilldapill Posts: 1,283
    edited 2007-12-11 18:49
    Oh, by the way, that "C2_Load_Buffer" isn't really neded in this case. I just had it there for an inductive load outline and I'm sure it wouldn't help too much with a lead acid battery in parallel.
  • Fred HawkinsFred Hawkins Posts: 997
    edited 2007-12-11 21:17
    I wonder if this National Semi·chip·might be a better solution: http://www.national.com/pf/LM/LM25116.html
    ·
  • LawsonLawson Posts: 870
    edited 2007-12-12 00:14
    I'm seeing one critical component missing from that schematic, an inductor. Since the solar panel outputs a higher voltage than the batteries a Buck DC-DC converter is prolly the simplest and it requires an inductor to work.

    Marty

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Lunch cures all problems! have you had lunch?
  • PhilldapillPhilldapill Posts: 1,283
    edited 2007-12-12 01:51
    Yeah, I've actually thought about wiring all these panels in series, and using a buck converter to bring the voltage down and current up once the wire reaches the charger, thereby reducing the costly high-gauge wire. If we are talking about using an inductor, and a peak current of 50A, do you think it can be done without too much losses? Also, don't I need a heavy duty diode? As for the inductor, I have qty 10, 2.5" toroids coming and a good bit of square, 12gauge magnet wire on hand. What do you think about wrapping the toroids and putting 2 or so in series? I'm thinking, ideally, to use a buck converter, I should have the largest inductance possible in order to reduce the switching frequency for the mosfet which loses energy due to heat. Eh?
  • Ron SutcliffeRon Sutcliffe Posts: 420
    edited 2007-12-12 03:33
    Hi
    Like you, I am new to prop, but not new to Solar panels. Solar panels provide most of our power requirements. (We live aboard our cruising yacht)

    I don’t know what panels you are using in your array and you have not mentioned what type of batteries you are charging (lead acid, glass mat, get etc….)

    There are some great solar charging management systems around and the good ones have a temperature sensor input, so that the ambient temperature in the battery compartment can be monitored. They can be programmed for the different battery types including PWM mode.

    Software to manage Temperature compensation, Bank switching, Float and Equalization periods will go a long way towards extracting the most out of you Solar array.

    Your series/parallel array configuration should be such that the open circuit voltage is ~ 21 volts, for 12 Volts batteries.

    It’s the acceptance rate of the batteries that is important.

    Whilst the voltage goes down from 35 volts to 12 volts (12 volts seems low on charge) the current will increase proportionally. Well nearly but that discussion is definitely off thread.
  • PhilldapillPhilldapill Posts: 1,283
    edited 2007-12-12 05:24
    Thanks Ron. I may be wrong, but a solar panel isn't that different from any other DC power source. You can model is as a voltage source in parallel with a resistance. Another way, and probably more accurate, is to model it as a CURRENT source, in parallel with a resistance, and in series with another resistance. For simplicity, I'm modeling it as the former. Below is an attachment of a typical power curve of any DC power source. Don't mind the actual numbers as this was copied from an arbitrary source. It just shows that at some operating voltage, there is a maximum current x voltage point, ie the maximum power output. Using some calculus, you can derive that the optimum operating voltage should be, ideally, half the open circuit voltage. This is because the load resistance should match the internal resistance of the power source. Matching the load resistance also causes then load to drop half the voltage as well, proving the previous operating voltage subject.

    Anyway, you're right about the 21 volts for a 12V battery. I'm not sure what keeps the battery from losing all the water within the cell though, since applying a constant 21 volts the a battery tends to force it to undergo electrolysis as all the charge has been "charged". The point of the MPPT charger I'm trying to build is to find this optimum power point and get the most energy out of the panels as can be generated. I think Lawson may be right about turning this into a high power buck converter MPPT. My understanding of capacitor charge may be a little wrong, but it seems that the higher voltage within the cap should allow more current to flow, regardless of having the inductor.

    Correct me if I'm wrong, but 1 Coulomb = the amount of charge needed to raise a capacitance of 1 Farad to 1 Volt. If this is the case, a higher voltage in a capacitor means more charge is stored, which in effect means that more current can pass through a load resistance... I'm still working on my BS in EE so forgive my lack of understanding in some of this...(and my rambling!)
  • Ron SutcliffeRon Sutcliffe Posts: 420
    edited 2007-12-12 15:19
    Its the acceptance rate, at which the battery can store the available current. that determines the charge voltage, at any given time. The acceptance rate of the battery is constantly changing(reducing as the battery charges, or to put is another way, the internal resistance of the battery increases as the battery charges....Compensating for temperature again). Likewise the capacity of the array to supply current is constanly changing. Cloud cover, temperature increases will reduce the panels output.

    You simply cannot put more current into the battery than it will accept, without raising the charge voltage above 14.6 or 14.4 in the tropics. If fact a good solar management systems, takes a pause from charging once the the charge gets to around 14V. So that the cells can stabilize before the off load voltage is measured. This requires auto bank switching of course. The controller might float the bank or continue to charge, or alternatively go through a equalization charge based on the banks history cycle before returning to Float.

    Around 21volts is the norminal rated open circuit voltage of many solar panels sold over 60 watts.

    Other Factors such as battery age, it's enviroment which would include its charge discharge cycle, also its discharge rate..etc ..etc

    Finally it comes down to cost. Large battery banks are expensive. The life of battery is dependent on how its used, and to a large extent how well the array its matched to the battery banks capacity and last but not least the good software inside the box.

    Don't get me wrong, this sort of code is worth writing, An Intelligent battery charger, might be a better place to start
    .
    I have built a few for people using BS2 over the years, but its hard to beat the BP solar gear sold in Australia

    Have fun, I am !

    Ron
  • LawsonLawson Posts: 870
    edited 2007-12-13 19:58
    Philldapill said...
    Yeah, I've actually thought about wiring all these panels in series, and using a buck converter to bring the voltage down and current up once the wire reaches the charger, thereby reducing the costly high-gauge wire. If we are talking about using an inductor, and a peak current of 50A, do you think it can be done without too much losses? Also, don't I need a heavy duty diode? As for the inductor, I have qty 10, 2.5" toroids coming and a good bit of square, 12gauge magnet wire on hand. What do you think about wrapping the toroids and putting 2 or so in series? I'm thinking, ideally, to use a buck converter, I should have the largest inductance possible in order to reduce the switching frequency for the mosfet which loses energy due to heat. Eh?

    Sounds like a good plan. You might try using parallel strands of the 12 gauge wire on the toroids to reduce the resistance. Or stacking several cores before the wire is wrapped around. Yea you will need a large diode in the circuit, The circuit that wikipedia shows would directly work for you if the polarity of the supply and load is flipped. Might I suggest putting together a bread board prototype of the DC-DC converter you plan to use?

    Marty

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Lunch cures all problems! have you had lunch?
Sign In or Register to comment.