boost MPPT

Building anything you consider high-tech?? Post it here, let us drool over it.

Re: boost MPPT

Postby TonyB » Thu Sep 04, 2008 10:03 am

I can help you with code, but for the problems regarding connecting to the PC, please ask at picaxe forum.
Please post up your code so i can see what you have done so far.
-TonyB
User avatar
TonyB
 
Posts: 665
Joined: Sun Dec 02, 2007 3:45 am
Location: Australia

Re: boost MPPT

Postby emerson » Fri Sep 05, 2008 1:00 am

hey tony,

its fine for the picaxe. the problem was my USB port. i solved it tanx
i will post the code later. tanx.
emerson
 
Posts: 28
Joined: Fri Jun 27, 2008 7:18 pm

Re: boost MPPT

Postby emerson » Sun Sep 07, 2008 11:29 pm

hey tony

this is a nightmare. i have never done programming in my life, and this is terrible. dt know where to start, where to go, have no idea how to adress the memory, have no clue.

i sent u somethin wat i tried to do, i know its nothing, bt plzz help me out.my project is at stuck..need to present it by nxt week...and............. doest look good

plzzz need ur help.

I have attached something that i have done in txt file.

let me know
Attachments
boost_program2.txt
(629 Bytes) Downloaded 482 times
emerson
 
Posts: 28
Joined: Fri Jun 27, 2008 7:18 pm

Re: boost MPPT

Postby TonyB » Tue Sep 09, 2008 12:25 am

Hi im not too experienced with picaxe but i got this simple code from a friend.

Code: Select all
' picaxe mppt code
' Author: Andrew Sarkis
' Date:8/05/2008
' this is the code for the Constant Voltage tracking method. The sensed voltage is compared to
' a reference voltage  to keep it at the maximum powr point. The predetermined value for


symbol duty = b4  ' variable to control duty cycle with. Stored in byte5.
symbol maxduty = b5
symbol minduty = b6
symbol cv = w4
symbol v1 = b1

maxduty = 200   ' the maximum duty cycle, preset for a period of (49+1)*4*250nS = 50uS 20khz
minduty = 5      ' minimum value for duty cycle
pwmout 2,49,duty  ' initialises pwm signal

for b0 = 1 to 3
high 4      ' turn on/off led for 3 seconds. indicating that the pic is working
pause 500
low 4
next b1

duty = 25   
readadc 1, b1
cv = 185      '75*b1/100

main:

if v1 > cv and duty < maxduty and duty > minduty then
duty = duty + 1
else if v1 < cv and duty < maxduty and duty > minduty then
duty = duty - 1
end if

goto main


This should regulate the solar panel volatge at the maximum power point, however u need to set the reference, which is your maximum power point. This is goint on the ADC pin.
-TonyB
User avatar
TonyB
 
Posts: 665
Joined: Sun Dec 02, 2007 3:45 am
Location: Australia

Re: boost MPPT

Postby emerson » Wed Sep 10, 2008 9:23 am

hi tony,

tanx again for the code.its really helping me. how ever, i have some questions:

1) before getting to the code, i struggled a bit to connect ADC1, ADC2, and pwm2. so i connected ADC1 at terminal6, PWm2 at terminal 5, but now got a problem to connect ADC2 at the 2V output. when i tried to connect ADC2 at Terminal4, i got some funny waveforms with noise and which looks like nothin, coz i couldnt even measure it. when i disconnect it, it is working and i got the 2V. so my question is, where can i connect ADC2 (wat pin or terminal??), according to our design.

2) on the codee, we have "pwmout 2,49,duty", when i compile it like this, i dt get the expected output.its very funny forms. itried to change it to "pwmout 2,49,112", calculating at 20KHz frequency and it works.

3) wats cv?? and why is it equal to cv=185 ??? why in the comment, he is doing 75*b1/100 ???

4) when i first compile it, i got an error on this line "next b1", and the compiler advised to change "b1 to b0" i dt know why??why is it asking me to do that???

5) when we " readadc 1, b1" , wat does it mean exactly??

6) why is duty =25 ????


tanx alot for all ur help. i really appreciate it. i will test the circuit with the cells today n will let u know. tanx

waiting 4ur precious explanation !!!!
emerson
 
Posts: 28
Joined: Fri Jun 27, 2008 7:18 pm

Re: boost MPPT

Postby emerson » Tue Sep 23, 2008 7:07 am

hi,

stil got a problem. iset my pwmout at a freq of 20Kh, 80% duty. i need to use this signal to switch my transistor in the boost converter. the problem is now, b4 i connected my picaxe to the circuit, i got the squarre wave that i want , with the magnitude and duty cycle, everything perfect. then now when i connect the pin5 to the base of my transistor(2N3055), i got a funny wave signal, and the magnitude of the waveform drops so much like close to 0.8V.

Dt know wat the problem is !!! can u plzzz help me out with this, do u know wat the problem is??

do u know a voltage regulator IC that i can use, which takes 4-5V input and delivers 12V and 2-3A ???

i need to know also hw do we connect the ADC1 / ADC2 in a picaxe 08M to have the regulation, since i modified our previous sketch n put a 5.6 ohms /20W to increase the output current coz i need min 20W ( 12V/2A )delivers at the output??


tanx for ur help

cheers.


tanx.
emerson
 
Posts: 28
Joined: Fri Jun 27, 2008 7:18 pm

Re: boost MPPT

Postby emerson » Sat Oct 04, 2008 4:31 am

hi tony!!

good news is my boost converter is working. i got almost 20W output which is quite gud. so my problem now is to know :
1- if picaxe can support a lot of current
2- im using a small resistor at the load (5.6 ohms), so i would like to know how to connect my picaxe ADC1 and ADc2 now plzz???

im glad that im seeing the light now !!!

tanx.
emerson
 
Posts: 28
Joined: Fri Jun 27, 2008 7:18 pm

Re: boost MPPT

Postby SolarOne » Mon Oct 06, 2008 12:07 am

Hi emerson i think in the first page he showed you already in this diagram.

download/file.php?id=100&mode=view

However you will need to modify it and wire a voltage divider on the input like this.

boost2.bmp


Glad to see you getting there 8-)
User avatar
SolarOne
 
Posts: 30
Joined: Mon Dec 03, 2007 4:09 pm

Re: boost MPPT

Postby emerson » Wed Oct 08, 2008 3:53 am

hey solar one!!!

tnx so much for ur help. now i connect my picaxe to the boost converter n got the expected output voltage. but now i wud like to know how should i check to see that my circuit is working and the picaxe is doind da job. coz i switched on, everything n live like dat, and it displays the same output value.

i think ican only feel the impact of regulation if the input voltage is changing isnt !!! meaning since im using solar cells, i think i can visualize the effect of regulation during my tests, when the voltage across da cell is changing, and the output voltage remain at moreless the same value.

that is wat i think or maybe do u have another way to test it ?? plzz coz want so badly to see it working n doing the regulation. plzzz let me know ASAP. i will conected in front of da pc to wait for ur reply. :D

so plz is it a way to know that the regulation is perfect?? plzz let me know. hope is finalllllllyyyyyyyyyyyyyyyyyy working.

waitin 4ur reply . tnx.
emerson
 
Posts: 28
Joined: Fri Jun 27, 2008 7:18 pm

Re: boost MPPT

Postby TonyB » Wed Oct 08, 2008 11:52 am

Hi Emerson,

im glad your seeing progress. Can you please upload some pictures so i can see you setup?
Also, do you have access to an oscilloscope, you will need to see if the outputted PWM duty cycle changes with varying input voltage. if it does, you need to check its going in the right direction.

Also, i suggest you put a 15volt 3amp zener diode in reverse bias on the output to clamp any high voltage spikes (because its a boost converter) if you make an error, or if the duty cycle goes the wrong way. if voltage goes up to high you can damage you components and anything connected on the output.

thanks.

PS: please dont forget the pictures, we want to see. :)
-TonyB
User avatar
TonyB
 
Posts: 665
Joined: Sun Dec 02, 2007 3:45 am
Location: Australia

Re: boost MPPT

Postby emerson » Wed Oct 08, 2008 9:55 pm

hey tony,

tnx, i really appreciate. its all because of u, dat i start seeing the light.

however, i changed the input voltage, but my duty cycle doesnt change, and when connecting the aircraft at the output and use the speed controller,my voltage drops from 13.2 to 8.02V. i check the duty cycle, it still the same. how can i solve that???

tnax for ur help.
emerson
 
Posts: 28
Joined: Fri Jun 27, 2008 7:18 pm

Re: boost MPPT

Postby TonyB » Wed Oct 08, 2008 10:18 pm

i have a feeling your feedback isnt working properly.
i have a feeling your picaxe is just producing a fixed PWM.
Post up your program ill have a look at it for you.
did you connect the input voltage divider to the ADC properly?
-TonyB
User avatar
TonyB
 
Posts: 665
Joined: Sun Dec 02, 2007 3:45 am
Location: Australia

Re: boost MPPT

Postby emerson » Thu Oct 09, 2008 3:15 am

exactly. the feedback isnt working, the regulation is not done and the pwm is fixed. yes, seems like the picaxe is just producing a fixed pwm. im using the same program that you gave me and it still posted here.
i cant attached my schematic, because of " those pixel high, wide, etc..). so i dont know wat can i do, to send it to u. if u have another way, just let me know, so that u can see how i connected my picaxe.

but actually i connected a voltage for ADC1, and another voltage divider at the output for ADC2. but instead of using 2 resistor as specified in the boost schematic, i used directly one resistor of 5.6 Ohms/20W. from there, i connected at the output a voltage divider to get a voltage less than 5V, for ADC2.

i used ADC1 for pin4, and ADC2 for pin6

plzz let me know asap, if you know what the problem is, maybe the code?? or the connection of the picaxe???

tnx
emerson
 
Posts: 28
Joined: Fri Jun 27, 2008 7:18 pm

Re: boost MPPT

Postby TonyB » Fri Oct 10, 2008 9:53 pm

Try and upload some pictures so i can see your connection please.
-TonyB
User avatar
TonyB
 
Posts: 665
Joined: Sun Dec 02, 2007 3:45 am
Location: Australia

Re: boost MPPT

Postby emerson » Sat Oct 11, 2008 3:37 am

hey tony,

i just send the zip file, i encontered a lot of problem to attach it, so decided finally to zip it.
i will be in front of the computer the whole night to heard wat u will say.
did u have a look at the code?? did u see anything wrong??

boost3.JPG


tnx
Attachments
boost3.zip
(37.29 KiB) Downloaded 350 times
emerson
 
Posts: 28
Joined: Fri Jun 27, 2008 7:18 pm

Re: boost MPPT

Postby TonyB » Sat Oct 11, 2008 10:42 am

OK i had a look at the code and i made some changes. Please try this. But i havent tested it.

Code: Select all
' picaxe mppt code
' Author: SOLARFREAKS
' Date:8/05/2008
' this is the code for the Constant Voltage tracking method. The sensed voltage is compared to
' a reference voltage to keep it at the maximum powr point. The predetermined reference value is
'


symbol duty = b4  ' variable to control duty cycle with. Stored in byte5.
symbol maxduty = b5
symbol minduty = b6
symbol cv = w4
symbol v1 = b1

maxduty = 200      ' the maximum duty cycle, preset for a period of (49+1)*4*250nS = 50uS 20khz
minduty = 5         ' minimum value for duty cycle
pwmout 2,49,duty  ' initialises pwm signal

for b0 = 1 to 3
high 4         ' turn on/off led for 3 seconds. indicating that the pic is working
pause 500
low 4
next b1

duty = 25      ' Preset the duty cycle to some random value, not too high.
cv = 136         ' 136/255*3volts = 1.6volts on the reference pin.

main:

readadc 1, b1

if v1 > cv and duty < maxduty and duty > minduty then
duty = duty + 1
else if v1 < cv and duty < maxduty and duty > minduty then
duty = duty - 1
end if

pwmout 2,49,duty

goto main


Basically, if the voltage on the ADC pin drops below 1.6 volts (cv variable in the code), the PWM (or the duty cycle) will decrease, if the voltage rises above cv the PWM increase. This will regulate your input at the maximum power point as set by the resistive voltage divider on the ADC pin.

Please note that this will just regulate your input voltage at the MPP, it will not regulate the output to not exceed 12 volts.

Also please note that the assumed operating voltage for the picaxe is 3volts. If you run your picaxe at a higher/lower voltage than 3 volts you will need to adjust the voltage divider or the reference in the software.
-TonyB
User avatar
TonyB
 
Posts: 665
Joined: Sun Dec 02, 2007 3:45 am
Location: Australia

Re: boost MPPT

Postby TonyB » Sat Oct 11, 2008 11:04 am

Could you also post pictures up of the actual boost converter so we can see what it looks like. Thanks.
-TonyB
User avatar
TonyB
 
Posts: 665
Joined: Sun Dec 02, 2007 3:45 am
Location: Australia

Re: boost MPPT

Postby emerson » Sat Oct 11, 2008 3:39 pm

hey tony,

the program, doesnt compile. At this part,
" for b0 = 1 to 3
high 4 ' turn on/off led for 3 seconds. indicating that the pic is working
pause 500
low 4
next b1"

when compiling, it says it should be b0 instead of b1. so i replaced it.

i also change to following line " cv = 136 ' 136/255*3volts = 1.6volts on the reference pin" to " cv=1532 ' 1532/8332* 8.8volts=1.6Volts'.

my switching frequency is 9.1 KHz, 50% duty cycle, then the pwmout code is pmwout 2, 109, 220. So when subsituting the 220 by the variable duty, the program doesnt work properly anymore.

ok with the new code you gave me, i got the pwm signal with a small ton and a high duty cycle. but still doesnt get any regulation. the pwm is still fixed, even when reducing the input voltage to a certain value.

how does it compare the input voltage to the 1.6V, since the input voltage is the one fixing the ADC value, so its normal that if the input voltage is decreasing, the ADC value will change. so i dont know !!!!

why cv= 136 ???

With the schematic, did u see something that i should change, ameliorate?? are you happy with the components choice?? plzz let me know.for the pics, i dt have a camera and cable with me. will try to do it tonite or tomorrow.

looking fwd to hear from you plzzzz. im so desperate.
emerson
 
Posts: 28
Joined: Fri Jun 27, 2008 7:18 pm

Re: boost MPPT

Postby emerson » Sat Oct 11, 2008 3:58 pm

another question :

" 136/255*3volts = 1.6 " isnt it represent the voltage divider, with 136 and 255 the two resistors?? because i taught that this representing the voltage divider for ADC1, so i adjust mine to 1532/8332*8.8 volts = 1.6 volts. Note that my input voltage is 8.8V. I supply the picaxe with 4.89Volts.

i think we need to put a voltage reference somewhere for example the 1.6V. we have to store it somewhere else, because connecting the voltage divider at Vin, when this changes, we dt anymore have 1.6V as reference and it cant change the duty cycle. i think thats one of the problem too.there is not Voltage refence
tnax
emerson
 
Posts: 28
Joined: Fri Jun 27, 2008 7:18 pm

Re: boost MPPT

Postby TonyB » Sat Oct 11, 2008 4:21 pm

emerson wrote:another question :

" 136/255*3volts = 1.6 " isnt it represent the voltage divider, with 136 and 255 the two resistors??


NO. A value of 255 in the ADC1 register means you have 3volts on the ADC pin.
If you have 1 volt on the ADC pin the ADC will return (255/3)*1 = 85.
if you have 0.5volts on the ADC pin, your ADC register will have a conversion value of 42.

It ranges from 0 -> 255, where 255 represents your Vcc of the picaxe.

Currently, its setup to regulate around 1.6volts on the ADC pin. If we have more than 1.6volts on the ADC (b1 > 136) it will decrease your PWM and visa versa.

Basically, you want 8.8volts on the input. So, you used a 5k|5K voltage divider which will give you 4.4volts on the ADC pin.
Your ADC register goes frmo 0 - > 255 where 255 is Vcc of the picaxe.

So, you need to have a ADC value (b1) equal to (255/4.89)*4.4 = 229. So you need to change cv to 229. That way you can keep the same 5k|5K voltage divider.

BTW, i thought your solar panel was 4 volts???
-TonyB
User avatar
TonyB
 
Posts: 665
Joined: Sun Dec 02, 2007 3:45 am
Location: Australia

PreviousNext

Return to Tech Projects

Who is online

Users browsing this forum: No registered users and 0 guests

cron