urgent!!! help with picaxe 08M

BeanieBots

Moderator
I think the divider error might have been my fault. In an earlier post I suggested designing dividers to keep the voltage below 5v assuming a 5v Vcc.
The latest diagram shows 3v so they need to be re-thought.

I guess the 3v comes from the earlier panel voltage of 4.5v?
 

parisien

Member
i see

Hi beaniebots, very very interesting !!!

The Regulator: actually, i have to apologize becoz i drew the wrong one. actually ihave been using the LM350 which is a 3A regulator, and i regulate the output to 4.67V. so im not using 3V, im sorry for that. i put a 0.1uf input and 1uF output.

i put as advised by you a 0.1uF, at each ADC input.

i grounded the whole circuit at the same point.i think i grounded everything, i dont understand wat u meant by " Hope you remembered to star-point it to the correct place on the switcher ground plane".

i replaced the diode the MBRS340 with an 8A SKY diode.
To be honest, i want to say tanx, coz im learning a lot 4m u. its incroyable.

you are right about the increase in current if the duty cycle increases. thats why for the inductor, i wana use one with a high saturation current like 8-10A.

actually my input voltage is 8.8V. so true that we will get around I=v/fL=10A, and will be more at high duty cycle, but the hfe will drop to 5.
you are right, the current will be very small compare to 10A required. But how can i solve that???

you know, ihave never thought about the slow speed of the diode. do u suggest to change 2N3055 and use another one?? or do u have any transistor in mind???

i have seen the shape of a snubber circuit for a boost converter, but i really dont know how to connect it to the circuit and also how to dimension the components. can u plzz help me with that??


didnt understant when u mentioned "The 2N3055 is only good for about 60v.The schottky is about the same.",

the problem to give u the shape at low duty cycle and full is, i didnt design a circuit where i can change my duty cycle. so my duty cycle is fixed.

Another problem that i got is, my losses are high and my efficiency not good. im loosing 1V each time the switch is on which is quite a lot, and the transistors are heating even with a cooler sink. im putting 8.8V and 6A but get ard 2.45A and 13.45V which gives 63% efficiency and i would like to improve.

i tried to improve it by reducing the resistor value at the base of the transistor. it improved , but even though im going below that resisitor value, it doesnt change. im still losing , in fact i dont get a perfect square wave at the collector, as i was supposed to get. my components are really heating. plzz help me to solve that !!!!!

Tanx already for helping me design the snubber circuit and plzz show me also where to connect it.


yes ur right its now time to design a proper switcher using REAL components . i totally agree with you !!!

yes it is meant to be a MPPT controller. To measure the output, im just using a very unefficient, old method which is connect an ammeter in series with the load and a voltmeter in parallel to read both the current and the voltage, then im doin manually the calculation,but i know its not efficient, coz sometimes numbers are running on my eyes and i cant catch them, and cant get efficient measurements (plzzz dont laugh at me plzzzz !!!).

so plzz if u have a better solution of how to do that and to get exact efficient measurements and calculations, plzz let me know. i would really appreciate.

my load as u can see in the schematic, is a fixed load, 5.6 ohms/ 20 W. since im using solar cells, my input voltage and current will change sometimes, therefore i have to regulate to always extract the maximum power from the cells and protect the cells too.

is it possible to do it with variable load?? hw are you going to change the load???


i really want to thank you for all ur explanation and observations, i learnt a lot today, im still learnig, and im even more excited now. thank to you for that.

wait impatiently ur reply.

PS: i have attached the code, given to me by a friend. i do understand some part, but the part for the regulation, i dont. it compiles well, but the duty cycle is fixed and regulation is not done, even when im decreasing the input voltage. so i think something is not right there.

PS: my frequency is 9.1Khz

tnx 4ur help.
 

Attachments

BeanieBots

Moderator
Hmm, that code won't work. It only ever reads the voltage once!
We have a lot of work to do here!

You're never going to get anything better than about 30% efficiency with a darlington pair made from two 2N3055s and driven by a PICAXE output.
You need to use a FET type transistor with low Rds on resistance.
You then need to get a FET driver to interface between the PICAXE PWMout and the FET gate.

I've been doing some experiments myself today with a PICAXE driving a flyback converter. There are two major issues.
1. The PICAXE PWM frequency is very low. 3.9kHz if you want full resolution.
For a buck converter, the output is linear with duty, but for boost and flyback it is not. There is a very small range of duty for a large range of output current.
2. Size of magnetics. The largest transformer core I have (about 2" X 2" with air gap) saturates at about 4A so I can only run at about 1A into the load. Running at about 18kHz gives +/- 100mA (+/- 10%) for a duty change of +/- 1. :eek:

With all the recent interest in MPPT controllers, I am determined to make a PICAXEable one. At the moment I don't think it's impossible but the transformer will need to be the size of a shoe box and even then, it will only cope with about 20W max. I will be ordering some RM14 cores in the next week or so to try to see how small I can get the magnetics.

You have a LOT of work to do if you are going to design this from scratch.
You also have a lot of reading/learning to do.
First step, learn about REAL inductors, transistors and diodes, and the problems they have. Then you will understand why a diode which is OK for 60v might not be enough even if you are only switching 8v:confused:

Anyway, you're miles away from MPPT. Need a working switcher first!
You buying or making the magnetics?
 
Last edited:

parisien

Member
yes, im doing the reading/learning. itried the MJE2955, equivalent of 2N3055, but i didnt get the expected results.will look for another one

i usually buy the inductors,. sometimes i just to finish this project. i just want to make it work firstly, and later improved it, as it has to be.

my mistake, was i took the topic lightely, thinking was too easy without going deep into details.but, im willing the spend any min of myday now to do,coz have to submit it soon,make it work, with the regulation working, and i will take times after submission to really improve it; coz i really want to make it work properly.
 

BeanieBots

Moderator
The 2955 is the PNP COMPLEMT to the NPN 3055. If anything it's the OPPOSITE not an equivalent.
You should look at MOSFETs and forget about bipolar transistors.

This is a VERY ambitious project. From start to finish would make a good thesis for a degree graduate. What level are you?

If this is just a project to demonstrate understanding, then go for much lower power. If you keep the power below a few watts, it will be possible to demonstrate the idea using something like an IRF520 directly driven from a PICAXE PWMout output. Make your inductor much larger so that currents are not too high and can run at a lower frequency. That way you will avoid all the problems with turn on/off times and running in linear mode. Also, even if the efficiency is really poor, nothing will explode in your face.

You can then explain why it is so bad and what can be done to improve things.

The petrol engine is very easy. "Squirt, squeeze, bang, push". That's all there is to it. Now go and make one:eek:

An MPPT controller is a bit more complex than that.
"take energy at one level, convert it to another level (the easy bit) then check to see if your conversion is at optimum rate (not so easy), then change the rate of conversion and see if things improve. If they don't, then make the change in the other direction and repeat.

Give you idea of what you are trying to do.
I have a degree in electronics and have been designing switchmode power supplies for many decades. It took me nearly eight months to design test and prove a little 10W MPPT converter to give 96% efficiency.

To knockup something that does about 70% and makes assumptions such as optimum input voltage could be done in a few hours but that is NOT MPPT.
MPPT is an expression thrown about by people who don't have the faintest idea of what it actually means. Even if you had a fully working switcher and could control its transfer rate, you would still be a long way off from having a true MPPT controller.

I don't mind helping you out but I won't do it for you and I can't help you if you don't know the basics. You need to learn the "language" before you can understand what I tell you.
 
Last edited:

hippy

Ex-Staff (retired)
As BeanieBots says, that code needs a lot of work doing to make it work. If you look at the code, not only does it read an input voltage once at start up, it only reads one of your two analogue voltages, the voltage it does read it ignores, and it never updates the PWM hardware duty. It is no surprise that PWM never changes when you have your hardware running.

As well as getting your hardware right you have to get your software control right as well. The software seems to be as equally important as the hardware in this application - Do you have a written specification for what the software is to do ?

There was a recent thread in this forum on dynamically regulating an output voltage at a fixed value and this seems to be a similar type of project. The lesson from then was the simplest of theoretical schemes can be incredibly hard to implement, get right and fine tune, there being all sorts of interaction between hardware and software. It doesn't surprise me that it can take months to get simple PSU designs right and even longer for MPPT control even for people with years of experience.

That said, you have the right approach; get something working and improve it later. The bulk of the effort will undoubtedly be tweaking things in hardware or software. At the moment you have a static system, the software PWM doesn't alter. I would suggest putting some effort into getting the software doing something better and seeing where that takes you.

We're now 5 pages in, 46 posts, and don't seem to have really touched upon the PICAXE or software aspect of things which is what this forum is primarily here to assist with. In post 24 you said, "im almost finishing with the code now"; obviously not, you have barely started on it.

One additional question; when is this urgent coursework due to be handed in ? That will help people here suggest the best way to move forward with what you have, help you work towards having something worthwhile, even if incomplete, rather than getting stuck on particular aspects to the detriment of the overall project.
 
Last edited:

parisien

Member
tanx for ur comments.

i will go buy an IRFZ48N and try tomorrow to see the result. its a power mosfet transistor.

i understand why now the pwm was fixed. of course the software is important, without it, it cant work. the overal work is to compare, while the characteristics of the cell changing, the current and the voltage ratings and adjust in such away we always get the max output. it plays the role of a regulator.

we can play on the duty cycle to do that, we increasing sometimes the current anddecreasing the voltage (stpe-down converter)or increasing the voltage (step-up) and decreasing the current by keeping the same amount of output power.


yes it is a similar topic. yes i definietely want to get something working and improve it later. i have to submit or present it in 1 week time.
talking about the sofware, yes ur right. i have to make it right, and then improve the hardware.

tanx in advance for ur help.

PS: i read about the AN484, looks quite interesting. I saw also many set-up DC-DC regulator voltage, likes LT1371, LT1370, etc..... isnt doing the same thing as the MPPT?? whats it the difference between those IC set-up converter and picaxe??
 

hippy

Ex-Staff (retired)
If you present your software algorithm I am sure people will be able to help you with the coding to implement that algorithm.

Do not, as already said, expect others to do all the work for you. This is a coursework so I expect it is set to test and measure your abilities to solve problems for yourself rather than your ability to get others to do the work for you. That doesn't mean people here will not help, but they will likely not want to unfairly disadvantage those who have put their own hard work into their coursework. The more specific a question is the more specific the answer is likely to be.
 

BeanieBots

Moderator
PS: i read about the AN484, looks quite interesting. I saw also many set-up DC-DC regulator voltage, likes LT1371, LT1370, etc..... isnt doing the same thing as the MPPT?? whats it the difference between those IC set-up converter and picaxe??
No parisien, in absolutely NO WAY WHATSOEVER is a voltage regulator anything like MPPT.
A PICAXE microcontroller is a microcontroller which can be programmed (by you) to read in signals, do some processing and control some outputs.

It is possible to get a microcontroller (eg PICAXE) to control the regulation of something like a LT1371 so that the combined regulator/controller will behave like a MPPT but I don't think we can go through how to do that within a week when you are missing so many of the basics.

Strongly suggest you opt for something like a traffic-light controller so that you at least have a project which does something and that you can explain fully.
 

hippy

Ex-Staff (retired)
@ parisien : Going right back to the first pge of this thread it's been pointed out that this is a very complicated project you are undertaking and seems to be beyond your current abilities. It was also asked whether you have to create this MPPT controller for coursework or whether you have chosen to do that - you didn't answer that question.

With one week to go you really have to decide what to do now as it seems unlikely you will have anything which resembles an MPPT controller when that deadline arrives.
 

gengis

New Member
No parisien, in absolutely NO WAY WHATSOEVER is a voltage regulator anything like MPPT.
A PICAXE microcontroller is a microcontroller which can be programmed (by you) to read in signals, do some processing and control some outputs.
I've been following this thread because it is something similar to what I'm attempting.

I agree that the project is too complicated for someone with limited experience etc. With parts limitations in the real world, a relatively difficult project, period.

I disagree with the statement that a voltage regulator is not like a MPPT. This is the first I've heard of mppt so I could be wrong . . .

If I understand it, all he basically wants to do is get a regulated boost converter to look at a battery voltage, take that value and set the output voltage of the converter so that the maximum power transfer occurs between the solar panel and battery.

Ideally one would want to measure battery voltage, and current transfer, then make some decisions and use an output to control an adjustable boost converter.

Is my understanding incorrect? Other than the fancy name and price it seems like a smart voltage regulator to me. Or smart battery charger.
 

BeanieBots

Moderator
A MPPT controller regulates POWER. A voltage regulator regulates voltage:rolleyes:

A voltage regulator can be CONVERTED into a MPPT controller by tapping into the voltage feedback path and adjusting it's control voltage in accordance with measured current such that POWER can be controlled.

If you want to get technical:-

Voltage regulator has fixed output voltage at low impedance.
Current regulator has fixed current output at very high impedance
MPPT matches output impedance to input impedance.
 
Last edited:

gengis

New Member
A MPPT controller regulates POWER. A voltage regulator regulates voltage:rolleyes:

A voltage regulator can be CONVERTED into a MPPT controller by tapping into the voltage feedback path and adjusting it's control voltage in accordance with measured current such that POWER can be controlled.

If you want to get technical:-

Voltage regulator has fixed output voltage at low impedance.
Current regulator has fixed current output at very high impedance
MPPT matches output impedance to input impedance.
I get that. Power is the product of voltage and current. Monitoring battery voltage and current would seem to be the minimal requirements for matching the panel to the load for maximum power transfer. I don't think you'd need to know the panel voltage too, but I could be wrong there.

So I think that's all you need, Batt v and charge current - doing it is, of course, a lot more difficult given the constraints of parts and voltages available.
 

gengis

New Member
"Voltage regulator has fixed output voltage at low impedance." except when it is "adjustable" Externally controllable voltage regulators are common enough.

Current regulator ditto
 

BeanieBots

Moderator
Flooby, I think you have grasped the overall concept.
However, A voltage regulator has fixed output voltage at low impedance EVEN when it is adjustable.

Now that we've got that out of the way, let's get back to MPPT.
If you control output voltage into a battery, that is one low impedance trying to control another low impedance. The better the battery and the better the controller, the more impossible it becomes to control.

If you want to control for maximum power, you only actually need to take ONE measurement. That is CURRENT into the battery. Then you simply make your controller adjust to give maximum current. Job done!
 

boriz

Senior Member
So far as I understand it…

A solar MPPT’s job is to make sure that the panel voltage is regulated to a pre-determined ‘ideal’ by adjusting the panel current. All solar panels have a published maximum power point voltage (MPPV). If you can vary the panel current so that the panel voltage remains at MPPV then it is operating at maximum possible efficiency for whatever the current lighting conditions.

So the only required measurement is the panel voltage. Or more precisely, the difference between the panel voltage and the MPPV.

Often the output from a solar MPPT will be charging a battery. So it includes a battery charging circuit (which will usually need some form of voltage control). But that has nothing to do with maximum power point tracking.
 
Last edited:

BeanieBots

Moderator
Boriz, almost but not quite.
Indeed, many (alleged) MPPT controllers (including some of my own) do just that but it is only an approximation. The optimum voltage of a PV depends on the level of illumination. The maximum power voltage quoted for panels is the optimum voltage when the panel itself is running at maximum. At lower light levels, this can be quite a bit lower.
A 100W panel designed for 12v will have a typical OC voltage of 22v a maximum power voltage of about 17v. In subdued light, the OC voltage can drop as low as 15v but it is still possible to extract a few watts by loading the panel as low as 10v. Running at 17v (the "spec" MPPV) would give zero.

Anyway, I'm bored explaining MPPT now.
This thread should have been how to implement a MPPT algorythm in a PICAXE to control a boost converter as a MPPT. Not an attempt at explaining what MPPT is.

What I have explained here are FACTS not my personal oppinions. Facts are not points for debate so I see no point in continuing with a "debate" on what is or what is not a MPPT. So, for those of you who don't know what MPPT is, please refrain from using the term until you do unless it is to ask a relevant question.
 
Last edited:

BeanieBots

Moderator
Boriz, please don't be offended. That was not pointed directly at you.
MPPT is thrown about like a new "buzz word" and mainly by people who haven't got a clue what it means but insist that what they state is the way it works. There's nothing worse than incorrect information published in a public arena. Opinions and debates are fine, but "beliefs" published as fact are just misleading and only help to spread the confusion.
 

boriz

Senior Member
Of course I’m not offended. *removes dagger from heart*. :)

Seriously though. You’re saying that the MPPV changes as the light intensity changes. So each panel will have a characteristic MPPV curve vs light intensity? So to track the MPP you need a microcontroller with this curve stored as an equation or a lookup table? Similar curve for all solar panels?
 

BeanieBots

Moderator
Yes, if you put the MPPV curve in your algoryhtm then controlling input voltage will work. But why do that when you don't need to. Controlling output current will do the job. Hook up any panel (within the working limits of your circuit) and you will get the maximum out of it under any conditions.
 

hippy

Ex-Staff (retired)
Flowchart looks good although I don't know what theory it is based upon so perhaps the best thing to do is to code it up, get the wiring done and see how it performs.
 

parisien

Member
the code that i put online, its based from this flowchart. dt know wat the problem coz the duty cycle doesnt change. i put my reference voltage at 1.6 votls, still doesnt change. im really stuck
 

moxhamj

New Member
Re earlier: "my load as u can see in the schematic, is a fixed load, 5.6 ohms/ 20 W. since im using solar cells, my input voltage and current will change sometimes, therefore i have to regulate to always extract the maximum power from the cells and protect the cells too."

Firstly, re protecting the cells, that should not be a problem. Cells are pretty robust things - you can short them, you can pump current in reverse through them etc.

Re MPPT, the simplest answer here is not to bother. Just oversize the panel.

But if you want to build MPPT, for the sheer technical fun of it, then you need to get a few basics working. There is no point trying to extract 10% more efficiency if your MPPT is only running at 30% efficiency.

So you need a very good switching regulator design, and I don't think you have that yet.

If you did, it might be useful to still think through the flowchart above. What you want are maxiumum watts, not maximum volts nor amps. So measuring volts is only part of the story. In thinking about MPPT I think it helps to use two really big capacitors. You can put them there if you like in a real circuit and it doesn't alter anything. So put 10,000uF across the solar cell, and put 10,000uF across your resistor. When this is working you might have 18V on the solar panel and whatever (5V say) across the resistor.

The job of the switching reg is to translate 18V to 5V without losing power. So you grab a bit of energy from the first big capacitor, put it into an inductor, then take it out of the inductor at a lower voltage and put it into the second capacitor. The first cap goes down a bit, and the second one goes up a bit.

From a picaxe perspective, you want to measure watts, so you need to measure volts on both capacitors, and current into both capacitors. You will need to smooth those values, so you will need dropping resistors, op amp amplifiers and RC filters before you feed your 4 values into a picaxe. Then you will need to multiply volts by amps to get watts.

But you don't need to build anything to think through how this needs to work. Consider a solar panel running at midday in full sun. Your MPPT circuit might have determined that you can get the most power out of that by loading it at 17V. You don't need to know the power curves or anything, all you need to have worked out is that at 17V you get x watts, but if you load it at 17.1V or 16.9V you get less watts.

Let's say a cloud goes over. The volts on that first capacitor starts falling, and if you didn't do anything you would have no volts at all pretty soon because you are drawing too much current out of that first capacitor. So you need to take less power out. How?

Well, your algorithm was happily sitting at 17V, and every now and then it was experimenting by letting the volts go to 17.1 or 16.9, and measuring the watts. Now the cloud has gone over, you find that you get more power at 16.9V. So you let the volts fall to that level by drawing less energy out of the first capacitor (ie by making the pulse width narrower). If you sample too infrequently, you might overshoot, so the cloud goes over and the volts fall to 14V, but you keep sampling, and eventually you find that the new optimum volts is 16.4V.

Technically, you only need to measure watts in one place, not in two, but it is helpful to measure watts in and watts out so you can work out the efficiency of your switcher at various current levels.

And if you do that, you might actually find that your switcher was losing more power than just connecting the panel up to the resistor.

But MPPT is still a fun thing to play with. I built one once out of discrete op amps, by converting the volts and amps into an op amp logarithm circuit, then adding the logs, then doing an antilog. So I have a real appreciation of the beauty and simplicity of picaxe - one multiply instruction replacing about 10 chips!
 

hippy

Ex-Staff (retired)
the code that i put online, its based from this flowchart. dt know wat the problem coz the duty cycle doesnt change. i put my reference voltage at 1.6 votls, still doesnt change. im really stuck
The earlier code derived from the flowchart didn't work because it did not do what the flowchart says should happen as explained earlier.

When you change duty cycle you need to update the hardware which generates the PWM ( see the PWMOUT and PWMDUTY commands ), when you act upon a voltage input you need to read that voltage to know what it currently is ( see the READADC command ).

Otherwise it's like driving a car with your hands and feet off the steering wheel and pedals; you can say turn left, turn right, accelerate, slow down but nothing is going to happen until you actually make it happen.

What PICAXE programming exerience do you already have ?
 

BeanieBots

Moderator
Doc, whilst I agree with almost everything you have said, I still maintain that MPPT is possible by measuring ONLY output current. The only condition when this is not true is when driving loads with negative resistance. For example, if your switcher output fed directly into a flourescent tube where an increase in current would result in a decrease in voltage and hence power. For all other types of load where an increase in current results in an increase in voltage and hence power, then ONLY output current needs to be monitored. The same is true for voltage but controlling voltage into say a battery can be very tricky so I'd not recommend it.

Anyway, to prove things one way or another. This weekend I knocked one up.
Did it work? Sort of, but not really.
Interestingly, the biggest problem I encountered was not one I was expecting.
The topology I chose was flyback because I wanted to drive a nominal 12v load from anything between about 9v and 20v.
So what was the MAJOR problem? (when using a PICAXE).

It's the PWMout resolution.
Power transfer is insignificant at duties below about 40%.
Power transfer is at 100% (of the converter ability) at duties above about 60%.
This gives a VERY small range of duty for controlling the MPPT. So small that the hunting at the input side is unaceptable and makes it amost impossible to control without going totally unstable.
I fully accept that this is a result of my flyback choice. The slightly expotential boost converter would be better if driven at light duty and the linear buck converter would be significantly better. Also, driving a resistive load worked quite well, but most REAL applications dump the energy into a battery, so that is what I concentrated on.

I also fully accept that there will be better algorythms than the one I used.
Mine is nothing cleverer than increase duty (by one), see if current increased, if it did, then increase again, if it didn't, decrease (by one) etc. etc.

I'll start a seperate thread in the next few days describing the hardware and invite anyone to write an algorythm which they think might work with it.
However, please note, the excersise is to determine if a PICAXE can use it's PWMout driving the switcher transistor can be made to work. I have made other MPPTs where the PICAXE set the switcher demand using other techniques which have worked very well, so that is not the point under debate.
 
Last edited:

boriz

Senior Member
“…increase duty (by one), see if current increased, if it did, then increase again, if it didn't, decrease (by one) etc. etc.”

Ahhh. Finally I understand what you mean when you say that the panels MPPV can be tracked by only monitoring the battery charging current. Of course. It’s so obvious once you understand. Thanks BB.
 

BeanieBots

Moderator
Indeed Boriz, it really is easy peasy! Extremely simple:rolleyes:
But then, so is the petrol engine. Now go and build one. Remind me, what was the manifold vacuum advance for again?

Anyway, like I said. I've built a "PICAXE MPPT Experimenter" board so this can be put to bed once and for all.
Please feel free to give me any algorythms you want to try.
I'll post more details later in the week.

It's based around an 18X because I don't believe an 08M has enough resource. With hindsight, for an "experimenter" board, I should have used a 28X1 to capitalise on the extra analog inputs and hardware PWM but the original design was only meant to be a bi-directional capacity meter!

The transformer is a bit too small for the desired application too but I only had an RM8 core to hand. I made the air-gap using mylar tape which may have shrunk a little since my first tests because I'm sure it now saturates earlier than it did when I first started testing. Either that or so much running in saturation has effected the magnetic properties:mad:
Bottom line, max power transfer is under 10W. (PICAXE is too slow for more).

Excluding PICAXE/LCD/op-amp power, the power transfer is better than 90% and that's WITHOUT any FET drivers. Just simple connection to PICAXE. Total yield is better than 85% all up when driven at its sweet spot of 18Khz with 5W transfer. I've not done any diagrams. It was very much design-as-you-build. If requested I'll sketch/scan the important bits later but it's very simple and a description is probably all that's needed. Enough for now.
 

moxhamj

New Member
Beaniebots - re "I still maintain that MPPT is possible by measuring ONLY output current."

You are absolutely correct. Re the output watts, if the load was a resistor, V=IR so you know R and I so you can work out V. And if the load is a battery, you know V and I so you also have enough to work out W=IV.

The only time you wouldn't be able to work it out is a variable resistance load, eg a lightbulb.

The reason for measuring V and I on both the input and the output would be more for experimentation so it is easier to understand what is going on. Eg you have no amps coming out the output - is that because there are no volts on the input, or lots of volts but no amps (ie the PWM has somehow swung to either 100% or 0% due to a code bug). You could do this with 4 multimeters of course. And it would be worth thinking about whether the circuit could get itself tricked by some clouds going over, and somehow swing to 0% or 100% and then if it was at 100% and it went to 99% and still got no output, could it get itself out of that trap? So maybe some limits might need to be set on how far the % PWM can swing?

I have a working circuit that uses the secondary of a big 9V transformer designed for 50Hz. Essentially a big fat inductor. I don't recommend this for beginners though, as you get hundreds of volts on the primary (which you don't use). So the primary wires are left unconnected, but well covered in heatshrink etc. I found the efficiency peaked with a 50:50 duty cycle at 7ms. And it was very sensitive to changing the time. So much so that I think it worked out more efficient to run it in groups of pulses then to turn off completely, rather than to vary the pulse width. At least with this very slow pulse width, special diodes were not needed and the switching losses were minimal.

I am very impressed with beaniebots getting it working at 18Khz.

Another thing I've pondered - say the switcher is running at 90% efficiency - are there are range of light levels where it is more efficient to simply switch the panel directly to the load, eg with a latching relay? And if so, that would need to be in the algorithm as well. I don't know the answer to that one.

It would also make sense to turn off as much as possible at night to conserve power and just keep the picaxe ticking along in a sleep most of the time. So for that, maybe you do need to measure the input volts. Or maybe not, if you wake and try 50:50 pwm for a few secs and see what happens.

Another little thought - any handwound potcore needs to be dipped in varnish or similar. If not, the wires move (they hum or sing depending on the frequency) and eventually rub their insulation off. Then you get shorted turns. At 18Khz you might not hear it singing but it probably rubs faster than at 100hz.

bb, what brand of fet are you using, potcore, wire guage, number of turns, diode etc? 5W is *very* impressive.
 
Last edited:

BeanieBots

Moderator
Doc, I still maintain that current is the only measurement required, even into a variable resistance such as a lightulb. The ONLY required condition is that an increase in current results in an inrease in power and vice versa.

Don't be too impressed by my 5W at 18Khz. Don't forget that I'm a professional electronic design engineer with a particular slant towards switchmode power supplies. My intended DESIGN was to run at about 5kHz and transfer about 12W. My EXCUSE for such a poor result is working with "what I have". Namely the RM8 core with no air gap and using PICAXE to provide the PWM drive. Once testing started I soon realised that saturation started much earlier than expected. I've never tried it that slow before either so this is outside my comfort zone. The other significant factor is the FET. It's just an IRF520 driven DIRECT from the PICAXE. It really needs a proper low impedance driver delivering 10v.

If I was doing this for real, I would not consider a frequency below 50Khz. Probably nearer 250kHz. If you want it small, then a few Mhz.

I agree with all your other points. In particular the one about switching to direct connection. With correct panel choice, it is actually quite hard to beat direct connection under many conditions. Particularly at lower power levels and especially if cost is also taken into account.

I intend to start a seperate thread where we can go into more details about cores, air-gaps, litz wire, FET Ron, FET switch times, turns ratio etc, etc.

Saying that though, please note, the intention is to produce information/guidance for people to be able to 'play' with switchers/MPPT using PICAXE. I do NOT intend to start a tutorial on switchmode design. This is a PICAXE forum. I also intend (where possible) to keep components simple and where possible limited to Rev-Ed products. So don't expect any synchronised rectifier circuits or 5mm square cores running at 20W!

Looking forward to some inovative software contibutions as this is where my skill level is the most lacking.
 
Last edited:

parisien

Member
i do have a very very little experience in picaxe programming code. so do you think its possible to drive a mosfet power transistor like IRFZ48N, with a picaxe and achieve 20-30 W output everytime??

the code dat i wrote for the duty cyclt to change, is it too wrong?? how can i change it to make it work??


tanx,
 

BeanieBots

Moderator
Is 20W - 30W possible?
Using the right magnetics I managed to transfer 3A at 12v (36W) using nothing more than a directly driven IRF520. So, yes, it's possible.
Getting the magnetics right and picking the right frequency to run the FET/inductance combination is another story. Also, the FET on/off times at higher currents gets bad and consequently, so does the I^2.Ron losses. I needed a significant heatsink and was only getting about 60% efficiency.
These problems were covered in my first reply.
If you want efficiency at that sort of power level, you will need a proper FET driver and VERY large magnetics. My caps got quite warm too, so low ESR caps which can handle the current will also be needed to avoid losses there. If they are not capable of handling the current, they will eventually explode. Take my word for it, the smell is something you really do not want to experience.

Although the maximum current of the IRFZ48N is higher than the IRF520, it's gate capacitance is also much higher. This means its on/off transition times will be much longer and hence, so will the power dissipation resulting in less efficiency. Its max voltage is also lower (55v compared to 100v). When using a Irf520, at just a few watts I was seeing voltage spikes in excess of 80v. These would 'pop' an IRFZ48N very quickly. Get (or build) a proper driver and fit a snubber.

I'll leave it to the software experts to give guidance on your code.
 
Last edited:

parisien

Member
im using the IRFZ48N, coz of its low Rds on resistance = 16m. i observed wat ut saying abt the on/off times, coz i took longer to get to 12V output. it started from 9v, go a little bit till 12V. the times was longer. i run the mosfet at 9.1Khz, for 50% duty cycle, and got 13V output. i was initially drawing 5A from the source, and got an efficiency of 77%. i managed to get 34W.

something that i observed, was i tried to put a heatsink on the transistor, coz it was too hot, but that affected my output voltage quite seriously. the output dropped from 12v-8V. was it the heatsink resistor who affected??

as proper FET driver, do u advise then a IRF520??

as magnetics, im using a 100uH/4.5A. i think i can go to 300uH/4.5A. i was using 2capsx4700uF and since they were not hot, i can assume they can handle big currents.

talking abt the snubber , i saw some desing but i dt really know how to design it , how to dimension it?? can u help me with that???

did u drive ur switcher with a picaxe?? was it working as u wanted???

PS: there is something strange to me dat happened. i was busy doing some changes with my picaxe, to fix my duty cycle code, then the current from the source increased so high (ard 10A). i disconnect the source to protect the circuit, put the previous code lines, and then do the test again. and since then my circuit is not working anymore. When i connect the soruce, increased the voltage to reach 8.8V, at something like 4V im already drawing 10 A, which ridiculous, impossible. i have tested all my components to check if there is some short-circuit, but everything seems fine. havent found the problem yet !!!
 

parisien

Member
yes and its blown up. but.......... i used any other transistor like a IRF510, the 2x2N3055 connected in darlington, and its still the same scenario, ie. at 3V, im already drawing 8A. dt know wat the problem is !!!!
 

parisien

Member
guys !!! the code dat i wrote for the duty cyclt to change, is it too wrong?? how can i change it to make it work?? i mean when decreasing my input voltage below the reference which is 1.6V , the duty cycle (increased or decrease) to adjust the ouput power


tanx,
 

BeanieBots

Moderator
Parisien, you are so "off the mark" with this that I really don't know how to advise you. The slow on/off times have nothing to do with how long it will take to get your output up to voltage. It has more to do with blowing up your FET. But you have already discovered that for yourself now.

As for the inductor, it needs to be able to handle the ON CURRENT. Depending on your duty cycle, this can be MANY times bigger than your output current. For a 12v 30W switcher, this should be about 30A. Yes "thirty", and as I've said all along, it's going to be BIG. If/when your little inductor hits saturation, the FET will melt. But you've already discovered that for yourself now.

You MUST go back to the fundamental basics with this before you are going to get anywhere with it.

Heatsinks:-
Calculating the required heatsink is probably the easiest part of designing a switcher. Integrate the Rdson volt-drop for your switch multiplied by (Io+Vt/L) and hence derive the Ron losses. Add to that the integral of the turn on/off times. Use a scope to get actual values rather than those from the datasheet. You will then know the total switch power dissipation. Decide on an acceptable temperature (I usually go for 60C) and then pick the W/C heatsink which will give that temperture in the WORST CASE ambient tempertures.


PS.
If you blew up the FET, you probably also blew up the PICAXE.
Does the PWM output still work?
 
Last edited:
Top