Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 03:15 13 Dec 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Electronics : 150V 45A MPPT - roll your own

     Page 41 of 50    
Author Message
rogerdw
Guru

Joined: 22/10/2019
Location: Australia
Posts: 854
Posted: 12:32pm 20 Jul 2022
Copy link to clipboard 
Print this post

  Solar Mike said  Check to make sure those small power supplies don't have a resistor in the output -ve connection, some use this for current limiting. If so then the output cannot be connected to the main battery 0v junction as it will short out the resistor.


Thanks Solar Mike, I've checked out my modules and the -ve connection does go straight through so I will use mine  ...  but I will use the 12V version.


  Quote  The 12-5v regulator chip; I use the common smd 3 terminal regulators and soldered to a small piece of pcb as the heatsink, at <100ma load they don't run hot.


Okay thanks. I do have some modules a bit like what Klaus linked to above  ...  but I think I've decided I'll just use a std smd 3 terminal regulator soldered to the board.


  Quote  Probably same thing, here is an example where the main 0v copper pour has 60 + amps running in it, the 0v gnd plane connection to the CPU and low power circuits are separated by a 0.5mm gap back to the common Battery 0v connection.
This keeps the noise down in the low power circuits.


Thank you. I know I've worked on boards with that type of layout and wondered just why they were designed that way seeing they were at the same potential  ...  but now I understand a little better.


  Murphy's friend said  2oz boards? you must have deep pockets . My MPPT uses a 1oz PCB and this handles 50Amp just fine. The power track layout is similar to yours.


Nah not deep pockets  ...  it's just that if spending a few dollars more gets me a better quality starting point, then I'll take that while I can.

Both of these projects are fairly substantial investments in time, effort and money  ...  so I'm happy to pay a premium for the boards  ...  and it's still only a tiny portion of what the overall freight will be  ...  that's a killer.
Cheers,  Roger
 
Murphy's friend

Guru

Joined: 04/10/2019
Location: Australia
Posts: 652
Posted: 03:33pm 20 Jul 2022
Copy link to clipboard 
Print this post

  rogerdw said  

Nah not deep pockets  ...  it's just that if spending a few dollars more gets me a better quality starting point, then I'll take that while I can.

Both of these projects are fairly substantial investments in time, effort and money  ...  so I'm happy to pay a premium for the boards  ...  and it's still only a tiny portion of what the overall freight will be  ...  that's a killer.


You may be surprised when you find out just how many "few" dollars more large 2 oz boards cost.
I use one of warpspeed's tricks and reinforce the smaller track at the mosfet legs with solder lug tags. The solder mask layer needs to accomondate these of course. The main track area to the caps easily handles 50 Amp with 1 oz copper.
2 oz board will be harder to solder at the caps, you need a 60W+ iron there.

Freight is only a killer if you use their courier service. Slow mail is more reasonable for me - I refuse to pay more for freight than the goods cost.
 
nickskethisniks
Guru

Joined: 17/10/2017
Location: Belgium
Posts: 458
Posted: 06:21am 09 Oct 2022
Copy link to clipboard 
Print this post

Peter, are you willing to give your code for making the charge controller as a normal cvcc battery charger?
Thanks
 
poida

Guru

Joined: 02/02/2017
Location: Australia
Posts: 1424
Posted: 10:10pm 10 Oct 2022
Copy link to clipboard 
Print this post

HI Nicks

sure I could do this.
I already have built a cc-cv charger for the ebike.

I think it will work quite well but it will not be
a general purpose power supply, with all the protections designed into them.
What I refer to is the likely bad things that will happen when the output
is shorted.

The ebike charger code works quite slowly, it does not respond to changes in battery voltage very fast at all.

I use the simplest control loop there is which is
every 100th second, if battery is below setpoint increase PWM width by one clock cycle. Else reduce it by one cycle.
Also I check for current limit. If it's exceeded, reduce by 5 cycles.
Eventually the PWM width will settle to what is needed.
The ebike is set at 7.5 A max charge current and 54.6V charge voltage.
Neither of these values are ever exceeded.
I plug it in and it runs at 7.5A for a while then the current backs off after 54.6V is measured at the output, running down to near enough to zero when I check it
in the morning.
Is this the kind of behavior you want from the firmware?
wronger than a phone book full of wrong phone numbers
 
nickskethisniks
Guru

Joined: 17/10/2017
Location: Belgium
Posts: 458
Posted: 11:49am 12 Oct 2022
Copy link to clipboard 
Print this post

Hi Peter, is it different from the mppt code we are Running?
Before I used your code I used that kind of loop also in my regulator but without speed limitation. Just as fast as possible with bad coding. So I can  recycle that code, but I expect yours is written better and with some Bells and wistles . Response was not that fast but it worked.
Is there a reason you limit regulation speed? I'm sure this could be Faster even with the 328. Or is the DAC not stable enough with higher sample rates?

Yesterday I managed to set up regulation with a TL494 ic. But it was painfull setting up the compensation networks. I just did with trial and error. Voltage mode is not that difficult but it's the combination with current limitation. Doing this with uC is less difficult but  less responsive.
A hardware comparator with a sr flipflop can do short circuit protection.

I want to set something up to shift energy from a 24V battery bank to a 48V battery and the other way around.
 
poida

Guru

Joined: 02/02/2017
Location: Australia
Posts: 1424
Posted: 11:08pm 12 Oct 2022
Copy link to clipboard 
Print this post

here is the code I use for the ebike charger.

As usual, PWM is on pin D9

I have a potentiometer for setting output voltage and a pot for setting max output current.
The code will drive a serial LCD (20x4) and show
the input volts and thermistor temporature (I put it on the heatsink)
the set Volts and amps, the measured volts and amps and a Watt.hour total
of the charge.

Reading the code will show which analog inputs are what.
D4 is the 9600 baud output going to one of my "serial" LCDs

I played with PID control for a while but I use the simple bang/bang control.
PID is used with the charge regulator I made for my Ducati 900
and it runs similar code but not this.

Put good RC low pass filters on all analog inputs and locate them close to the
Nano's pins.

Pin D5 is used to drive a heatsink fan motor. I have it set to run
when over 60 C is reached. Use a 10K NTC thermistor

You will need to determine the calibration factors yourself.

ps1-v3.zip
wronger than a phone book full of wrong phone numbers
 
nickskethisniks
Guru

Joined: 17/10/2017
Location: Belgium
Posts: 458
Posted: 05:40pm 14 Oct 2022
Copy link to clipboard 
Print this post

Thanks!
 
noneyabussiness
Guru

Joined: 31/07/2017
Location: Australia
Posts: 515
Posted: 05:02am 29 Dec 2022
Copy link to clipboard 
Print this post

Hey Pete, finally got some time to play around with this again... problem I'm having is when I try to load the code on the arduino i get this error .. Im assuming its something to do with there latest compiler as I have had this working earlier.. at the moment, it will load but with the errors ive pasted, but no serial data is coming through...

thank you in advance... hope all is well ...









C:\Users\Dads Laptop\Documents\Arduino\mpptv5_highside_NTC\mpptv5_highside_NTC.ino: In function 'void do_data()':
C:\Users\Dads Laptop\Documents\Arduino\mpptv5_highside_NTC\mpptv5_highside_NTC.ino:848:52: warning: invalid conversion from 'volatile char*' to 'char*' [-fpermissive]
      sprintf(bp,"In %5sV %4sA %3sC",fbuf,hbuf,gbuf);
                                                   ^
In file included from C:\Users\Dads Laptop\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/Print.h:24:0,
                from C:\Users\Dads Laptop\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/Stream.h:26,
                from C:\Users\Dads Laptop\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/HardwareSerial.h:29,
                from C:\Users\Dads Laptop\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/Arduino.h:233,
                from sketch\mpptv5_highside_NTC.ino.cpp:1:
c:\users\dads laptop\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7\avr\include\stdio.h:671:12: note:   initializing argument 1 of 'int sprintf(char*, const char*, ...)'
extern int sprintf(char *__s, const char *__fmt, ...);
           ^~~~~~~
C:\Users\Dads Laptop\Documents\Arduino\mpptv5_highside_NTC\mpptv5_highside_NTC.ino:852:17: warning: invalid conversion from 'volatile char*' to 'char*' [-fpermissive]
      sprintf(bp+40,"Out %4sV %4sA %3sC",fbuf,hbuf,gbuf);
              ~~^~~
In file included from C:\Users\Dads Laptop\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/Print.h:24:0,
                from C:\Users\Dads Laptop\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/Stream.h:26,
                from C:\Users\Dads Laptop\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/HardwareSerial.h:29,
                from C:\Users\Dads Laptop\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/Arduino.h:233,
                from sketch\mpptv5_highside_NTC.ino.cpp:1:
c:\users\dads laptop\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7\avr\include\stdio.h:671:12: note:   initializing argument 1 of 'int sprintf(char*, const char*, ...)'
extern int sprintf(char *__s, const char *__fmt, ...);
           ^~~~~~~
C:\Users\Dads Laptop\Documents\Arduino\mpptv5_highside_NTC\mpptv5_highside_NTC.ino:867:17: warning: invalid conversion from 'volatile char*' to 'char*' [-fpermissive]
      sprintf(bp+20,"%5sW Out %6skW",fbuf,hbuf); buf[39] = 'h';
              ~~^~~
In file included from C:\Users\Dads Laptop\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/Print.h:24:0,
                from C:\Users\Dads Laptop\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/Stream.h:26,
                from C:\Users\Dads Laptop\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/HardwareSerial.h:29,
                from C:\Users\Dads Laptop\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/Arduino.h:233,
                from sketch\mpptv5_highside_NTC.ino.cpp:1:
c:\users\dads laptop\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7\avr\include\stdio.h:671:12: note:   initializing argument 1 of 'int sprintf(char*, const char*, ...)'
extern int sprintf(char *__s, const char *__fmt, ...);
           ^~~~~~~
C:\Users\Dads Laptop\Documents\Arduino\mpptv5_highside_NTC\mpptv5_highside_NTC.ino:897:17: warning: invalid conversion from 'volatile char*' to 'char*' [-fpermissive]
      sprintf(bp+60,"%5s%s",fbuf,hbuf);
              ~~^~~
In file included from C:\Users\Dads Laptop\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/Print.h:24:0,
                from C:\Users\Dads Laptop\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/Stream.h:26,
                from C:\Users\Dads Laptop\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/HardwareSerial.h:29,
                from C:\Users\Dads Laptop\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/Arduino.h:233,
                from sketch\mpptv5_highside_NTC.ino.cpp:1:
c:\users\dads laptop\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7\avr\include\stdio.h:671:12: note:   initializing argument 1 of 'int sprintf(char*, const char*, ...)'
extern int sprintf(char *__s, const char *__fmt, ...);
           ^~~~~~~
I think it works !!
 
andymc70

Regular Member

Joined: 30/06/2019
Location: Australia
Posts: 43
Posted: 03:40am 01 Jan 2023
Copy link to clipboard 
Print this post

Hello All
My grid inverter MPPT's have a minimum of 150V, and the home-built one use <100v.
Now I have a 3 x 3.3kwatt solar array, basically 12 panels for each array.
So for my Grid (Mppt's) 2 strings of 6 panels (180V open circuit) and for my home built I have 4 strings of 3 panels (90v open circuit).

So basically what I would like to do is if my battery is not fully charged I can add another solar string to charge the battery and if I don't need the extra string (ie during Summer, feed back into the grid), Come winter I will want all string into the battery's.

What I was wondering is if can I use home-built (mppt) PCB with different components for my Grid (mppts) panels.

I understand I would need to change the Power Mosfets and Diodes to take the large voltage, as well as the Inductor size to make it work.
I have found these items to replace the components.
MBR40250TG
https://docs.rs-online.com/7950/0900766b814b2dca.pdf

IRFB260NPBF
https://4donline.ihs.com/images/VipMasterIC/IC/INFN/INFN-S-A0012490438/INFN-S-A0012837889-1.pdf?hkey=6D3A4C79FDBF58556ACFDE234799DDF0

Thanks
Andy
 
poida

Guru

Joined: 02/02/2017
Location: Australia
Posts: 1424
Posted: 04:31am 01 Jan 2023
Copy link to clipboard 
Print this post

  noneyabussiness said  Hey Pete, finally got some time to play around with this again... problem I'm having is when I try to load the code on the arduino i get this error
..


the error comes from the compiler being quite anal.
it does not want to convert volatile char pointers to
non-volatile char pointers.

I suppose the concept of a pointer being able to be optimised away
never happens if the code uses it.
And the code does use this pointer.

I reproduced your errors when compiling using the latest
program (arduino IDE v.1.8.19)

To stop this annoying error, change line 88
which is
volatile char buf[85],*bp,bcount;         // local text buffer for LCD


to

char buf[85],*bp,bcount;         // local text buffer for LCD


NO errors when compiling now

I uploaded it to my test mppt brainboard and it works fine.
Tell me how it goes for you.
wronger than a phone book full of wrong phone numbers
 
noneyabussiness
Guru

Joined: 31/07/2017
Location: Australia
Posts: 515
Posted: 11:08am 01 Jan 2023
Copy link to clipboard 
Print this post

thank you so much for your help with this Pete... Ill try in the morning...
I think it works !!
 
noneyabussiness
Guru

Joined: 31/07/2017
Location: Australia
Posts: 515
Posted: 12:49am 02 Jan 2023
Copy link to clipboard 
Print this post

bugger ... sorry it still wont access serial data... just comes up blank... Ill try some things today encase thee is a weird library messing it up... Thank you in advance for helping
I think it works !!
 
noneyabussiness
Guru

Joined: 31/07/2017
Location: Australia
Posts: 515
Posted: 04:05am 02 Jan 2023
Copy link to clipboard 
Print this post

ok.. this is weird... loaded up the ino and it would still not access the serial data, respond to " ? " etc... so i left it and came back 5 mins later.. now it is working, its uploading fine so " shouldn't " be the cable but... really strange... it seems to be responding now, so thank you again Peter, ill let you know how i get on..
I think it works !!
 
poida

Guru

Joined: 02/02/2017
Location: Australia
Posts: 1424
Posted: 08:15am 03 Jan 2023
Copy link to clipboard 
Print this post

this version of mppt code uses 115200 baud to communicate via nano serial port
I use 9600 and 115200 interchangeably or on a whim

So to see what speed the mpptv5_highside_NTC code needs
I first try to connect using 9600. no response means
maybe it's 115200

As always, you need to send a newline to terminate all commands sent to the nano.



wronger than a phone book full of wrong phone numbers
 
noneyabussiness
Guru

Joined: 31/07/2017
Location: Australia
Posts: 515
Posted: 09:25am 06 Jan 2023
Copy link to clipboard 
Print this post

hey poida, got a couple of new lcds for this project, code working like expected,  still unsure why it wasn't at the start...

now just sorting out current sensors...

thanks for your help..
I think it works !!
 
noneyabussiness
Guru

Joined: 31/07/2017
Location: Australia
Posts: 515
Posted: 08:51am 07 Jan 2023
Copy link to clipboard 
Print this post

and we have liftoff !!

was at the end of the day, and choke was to small .. but its a start..



I think it works !!
 
poida

Guru

Joined: 02/02/2017
Location: Australia
Posts: 1424
Posted: 10:44am 07 Jan 2023
Copy link to clipboard 
Print this post

let's see the conversion efficiency:
assuming the volts and amps are calibrated to something close enough
for jazz..

IN: 91.5V x 26.9 Amps = 2460 Watts

OUT: 54.2V x 40.0 Amps = 2168 Watts

conversion efficiency = 2168 / 2460 = 88%
which is pretty good given the voltage difference.
When going from 91.5V to 54.1 V that is nearly a 1/2 drop and there
are some losses in this design that get big when the Vin:Vout ratio is large.

This is looking good.

I find with my two arrays, I run them at lower voltage ratios
when under large power loads. More like 75V to 50V and so the efficiency
is a bit better, more like 92%.
I designed the arrays to have max power voltages of about 75-80V.
Open circuit voltages are of the order of 95V.

Since there is a lot of conversion loss, I would be watching the heatsink temperature
and also the choke's temp. That is where all the losses go.

But anyway, it's greatly satisfying to see another mppt running.

here is today's data for the North facing array.
There is also an array that faces East and it contributes a good lot of energy
in the morning too.

There are two Volts scales. One is the battery. The other is the solar panel array's
voltage. That is why the scales are different.
Vout is battery voltage
Vin is array voltage or mppt input voltage
Iout is mppt controller's output current



9am to 11am it's in MPPT mode, getting as much as it can from the array.
The conversion voltage ratio is ranging from 54V (in) to 72V (in) into the battery that was from 51V to 54V.
Then the max battery voltage was achieved and so there is now no need
for lots of power. This means the panel voltage WILL RISE due to the conversion
needing only a fraction of maximum power. So the panel voltages rise to near open circuit from 11am to 12pm (when my other array kicks in and does the heavy lifting)
and after 12:30pm the North facing array takes over and keeps the battery
at it's bulk charge set point all day.

For the period from 12:30pm to stumps, this array provided all that was needed
and could do it using only a fraction of what was available.
So that is why the array voltage was mid point, around 85V, making about 20-25 Amps.
I know that this array is good for about 3000W but that is not needed in this case
with the battery's state of charge and the system's power load (the pool pump was on all day, pulling about 1kW)

I like these mppt controllers. They get most efficient when the battery needs the most energy (i.e. early in the day there will be low Vin:Vout ratio)
and then they look after the battery once it gets to absorb mode.

here is the data for the East facing array:



with these 2 arrays you can see I have more than enough power available
when the sun is out. I live in Melbourne and so that means the sun is not often
out and not much there when he is "out" during 1/2 of the year. Today was a good day.

The East facing array was simply not used at all from 1pm to 5:30pm
since the other array + controller already had the battery at absorb voltage by its self.

Once it got a bit closer to sunset, then both arrays started to work to keep the battery voltage up, as best they could. But soon there was not enough sun and they both signed off for the day.
wronger than a phone book full of wrong phone numbers
 
noneyabussiness
Guru

Joined: 31/07/2017
Location: Australia
Posts: 515
Posted: 11:19am 07 Jan 2023
Copy link to clipboard 
Print this post

most of that loss was in the inductor, as it was getting stinking hot, mosfets were cold. I've already wound a much better one with way less turns and much thicker wire ( my cheapy tester says 120uh)... will be able to test it better tomorrow if sun out( weather man says yes, but who can trust em).. but so far so good...

Re voltage, there is a significant distance to panels, and using 6mm cable I kept the voltage a little higher to keep the losses in it lower.. ( i can deal with heat where it is, easier)

If I can sort this properly( don't see why not but I never count my proverbial chickens) , I might be hitting you up for another couple of boards if you have any spare??

Thank you again for your help with this Pete ...
I think it works !!
 
noneyabussiness
Guru

Joined: 31/07/2017
Location: Australia
Posts: 515
Posted: 11:22am 07 Jan 2023
Copy link to clipboard 
Print this post

oh and was going to ask, what is the " 545 " and the dashes in the corner mean ?? probably been answered before but can't find it in the last 40 odd pages ...
I think it works !!
 
poida

Guru

Joined: 02/02/2017
Location: Australia
Posts: 1424
Posted: 10:48pm 07 Jan 2023
Copy link to clipboard 
Print this post

the "545" in bottom right of the LCD is the PWM width used at that time.
The units are clock cycles, and the max PWM width is 795

With a 20kHz PWM frequency and 16 MHz clock, there is 800 cycles available
for each PWM pulse. We control the width by having the pulse ON for some number
of cycles.

The voltage ratio (Volts Input to Volts Output) is tied very closely to
the PWM width.

In the photo, you have 545 which is 545/800 pulse with or
0.681

The LCD shows Vin = 91.5 and Vout = 54.2

54.2 / 91.5 = 0.592

This is close enough and it suggests there are losses large enough to look at reducing them or maybe the Volts calibration is a bit off.

here are my 2 from today at 9:45am :

East facing array



North array




Finally, the "---" is where it shows how long it has been in either float,absorb or equalisation mode. If it's in mppt mode (i.e. battery voltage not up high enough)
then it shows "---"
The number is minutes.
wronger than a phone book full of wrong phone numbers
 
     Page 41 of 50    
Print this page
© JAQ Software 2024