Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 10:47 30 Nov 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 10 of 50    
Author Message
ryanm
Senior Member

Joined: 25/09/2015
Location: Australia
Posts: 202
Posted: 05:58am 09 May 2020
Copy link to clipboard 
Print this post

Should the main inductor be sized to handle dissapating heat at the rate of the output current or is there something else I'm missing?
 
wiseguy

Guru

Joined: 21/06/2018
Location: Australia
Posts: 1156
Posted: 06:02am 09 May 2020
Copy link to clipboard 
Print this post

Azhaque I re read my response to your capacitor suggestion and I think it comes across as unreasonably harsh. I wrote it in haste having spent many hours on the job checking and re checking for correctness - you had spent just a few minutes looking at it so I apologise for the blunt reply.

The purposes of these forums is really to put ones ego & cleverness aside for a while as we all make mistakes and we certainly dont want to stop feedback from others as they either learn from the replies or we perhaps learn from their suggestions

I have tried the file you enclosed - it would have saved me ~ 8 hours of work.
Thanks to you or/and Nicks help in working it out.

I only started afresh with Altium because I doubted it could be converted from easyeda.

Next time I will know - can I get the PCB file converted too ? - it would help with mounting holes sizes etc.

With regard to a separate connector for powering  we will see what space is available.
Edited 2020-05-09 16:17 by wiseguy
If at first you dont succeed, I suggest you avoid sky diving....
Cheers Mike
 
azhaque
Senior Member

Joined: 21/02/2017
Location: Pakistan
Posts: 117
Posted: 07:25am 09 May 2020
Copy link to clipboard 
Print this post

  wiseguy said  
If we did it your way on the LHS input of the current sensor we have smooth DC on the other side of the current sensors we hav a node jumping from Vin to Vout with current spikes from 0 to 60A ? why would we not see this ?  Iin is the current from the solar Panels not the P-P current of the high side switch.


My worry was the charging current spike at the time of connection. In this scheme the thick wire inside the ACS758 shall experience the full current surge. My fear was that if nothing else, the surge at its least could effect the calibration of the hall sensor, particularly during testing when the circuit is likely to be repeatedly disconnected/reconnected.

At its worst the force generated might cause the hall effect sensor to decide to jump out of the chip altogether   .

azhaque
 
poida

Guru

Joined: 02/02/2017
Location: Australia
Posts: 1420
Posted: 08:39am 09 May 2020
Copy link to clipboard 
Print this post

I am pleased to see things have grown to be something bigger than what I hoped.
I feel confident we will have a robust little charge controller using open source firmware and hardware.
This is my primary goal.

Work on the firmware progresses.
Here is the result so far:

Blue is Vin
Red is Vout
Red/Magenta/whatever is Battery setpoint
Green is power input
Grey is PWM, where max PWM is 8.0 (i.e. PWM/100)
Yellow is an indication of when max power scan occurs.



This is a nice thing to see.
Firstly, on the left there is a steady state, where the code is maintaining the required battery voltage (14V) There is a bit of up and down of the output voltage.
Probably not helped at all by the noisy inputs for the control system.


Then I disconnect the battery.
This happened to the left a bit of 3552 on the X axis.
Immediately the output rises to Vin. This might be a problem..
Then the output drops slowly due to the Vout voltage divider resistors.

I then reconnect the battry. All good.
This happens a bit after 3553.
Then the firmware starts to apply power and it tracks back to the set point.

I then disconnect Vin (i.e. solar array input) and then reconnect.
This happened just after 3752 on the X axis.
It takes one max power search cycle to have the system running back as we want, tracking the battery voltage set point.

This is the kind of robust behavior I want to see.

Marginal cases of loads causing the battery to drop a little or a bit more below the set point do not upset the steady tracking.

This is a good start point for the firmware.
Edited 2020-05-09 18:45 by poida
wronger than a phone book full of wrong phone numbers
 
renewableMark

Guru

Joined: 09/12/2017
Location: Australia
Posts: 1678
Posted: 11:54am 09 May 2020
Copy link to clipboard 
Print this post

  poida said  ..........

..............
Then I disconnect the battery.
This happened to the left a bit of 3552 on the X axis.
Immediately the output rises to Vin. This might be a problem..
Then the output drops slowly due to the Vout voltage divider resistors.

I then reconnect the battry. All good.
This happens a bit after 3553.
Then the firmware starts to apply power and it tracks back to the set point.

I then disconnect Vin (i.e. solar array input) and then reconnect.
This happened just after 3752 on the X axis.
It takes one max power search cycle to have the system running back as we want, tracking the battery voltage set point.

This is the kind of robust behavior I want to see.
...................


Nice! Almost Mark proof.

Re diodes, I just checked mine and they are indeed config for bypass, never looked that closely, but yes they are bypass.

Connected a 5kw 2 series string direct to battery and only got 0.09A, very surprised at that, a big spark was expected, but a very dull outcome.
Cheers Caveman Mark
Off grid eastern Melb
 
poida

Guru

Joined: 02/02/2017
Location: Australia
Posts: 1420
Posted: 06:48am 10 May 2020
Copy link to clipboard 
Print this post

Now it's time to explore aspects of the code.

Every minute, the code determines the pwm width that makes for maximum input power.
The code below is called in the middle of already running code that has the pwm set to somewhere useful and fit for purpose.
This code stops the normal closed loop control and ramps it down to near zero, searches from near zero to maximum pwm, maybe stopping early because output current has exceeded the controller's max current setting, then ramping back down to the pre-existing pwm used prior to calling this code.


void mppt_scan()
 {
  //  find the pwm duty cycle width that gives the highest input power measurement
  // search up to near full pwm duty % or max output current,
  // which ever occurs first.
 
 int i;
 float fa1,fa0,fa2;
 float  power_sum = 0.0,siin,svin,vbat,pwr,prev_pwr;
 float start_pwm;
 
 // maybe buck converter is stopped, PWM output would be disabled
 // so enable it if needed. DO not enable it when running,
 // PWM will be immediately taken to 1
 // and likely ruin the tracking
 if (is_running == 0)
   buck_start();
 
 // get battery voltage
 fa0 = (float)analogRead(0);
 vbat = fa0 * nvd.vout_cal;

 // get start point for search, set max found to zero
 max_pwr = 0.0;
 start_pwm = pwm;        // save the pre-existing pwm value before it gets mangled

 // smoothly ramp down to small pwm from start pwm.
 // 5 cycle pwm width of the 800 cycle wide full power
 // is not a lot. I call it very low power.
 for(i=pwm; i >35; i-=20)
   {
   pwm = i;
   delay(20);
   }

 // search for max power, and record pwm for that power,
 // from something low to nearly full power
 // or until output current limit is exceeded
 // get power available when fed into the battery.
 
 for(i=20; i < 775; i+=20)
   {
   pwm = i;      // very shortly after this,
                 // the pwm width will be set with this new value
   delay(20);    // milliseconds. Let things stabilise a bit.
             //There are large capacitors on the input and output of the converter
                 // so there will be a time delay
                 // and it will be different with all the different builds.
   //
   // get input voltage
   fa1 = (float)analogRead(VIN);
   svin = fa1 * nvd.vin_cal;
   // get input current
   fa1 = (float)(analogRead(IIN) - nvd.z_iin);
   siin = fa1 * nvd.iin_cal;
   // get output current
   fa2 = (float)(analogRead(IOUT) - nvd.z_iout) * nvd.iout_cal;  
   // do not exceed max current setting, if so break out of this loop
   if (fa2 > nvd.imax)
     break;
   // get power
   pwr = svin * siin;
   // do search
   if (pwr > max_pwr)
     {
       max_pwr = pwr;
       max_pwr_pwm = i;
     }
   }
   
 // smoothly ramp back down to start position,
 // down from the search end point down to start_pwm
 for(; i > (start_pwm + 20); i -= 20)
   {
   pwm = i;  
   delay(20);
   }
 }



After this code is run each minute, I use the global variable max_pwr_pwm and then ramp up or down from the present pwm to this new max_pwr value and track from there.

This post is not mainly about the above code.
We have large capacitor arrays on both the input and the output of the controller.
These will slow down the response to any change in pwm.
I have found that the delay values in the above code work well with the capacitors I used. 9 x 450uF on the input and 5 x 450uF on the output.
Maybe some people will think "well, I can fit 9 x 10,000uF on the input. And it will be better, eh!"
I think not. The huge capacitor bank will now not change quickly enough to the new pwm setting when set within the search loop such that the search action will become meaningless.

I think I would like us to settle on capacitor bank sizes and stick with them throughout the development process. Otherwise I would end up writing and rewriting code to suit all the different cap bank sizes and probably achieve very little.

This buck converter runs at 20kHz and the cap bank size is quite adequate for the task. I have seen the output voltage ripple under 45A output and it's only about 0.3V
See the below DSO (40A out, 41V out)
Yellow is Vout
Light Blue is PWM



0.3V on 41V output is not a lot to be worried about.

Can I have agreement we stick with 5 x 450uF on the output and 9 x 450uF on the input?
Edited 2020-05-10 16:58 by poida
wronger than a phone book full of wrong phone numbers
 
Solar Mike
Guru

Joined: 08/02/2015
Location: New Zealand
Posts: 1138
Posted: 09:43am 10 May 2020
Copy link to clipboard 
Print this post

Looks good Poida, those caps seem ok, if you stick to 20Khz and 100 odd volts input, 48v output. Change the voltages, frequency, output ripple and inductance and they all change. You are correct in that having too much output caps versus inductance the voltage feedback time constant gets very long, especially with light loads.

On my designs I don't measure the PV input current, all I care about is adjusting the pwm for max charge current during the bulk phase, concurrently monitoring the battery voltage; 20Khz is pretty low, a higher freq means smaller inductor required, but then pcb layout and mosfet driving require tighter control.

Cheers
Mike
 
mason

Regular Member

Joined: 07/11/2015
Location: Canada
Posts: 86
Posted: 11:06am 10 May 2020
Copy link to clipboard 
Print this post

Hi Poida, I think 470uf are a lot easier to get.
 
renewableMark

Guru

Joined: 09/12/2017
Location: Australia
Posts: 1678
Posted: 11:25pm 10 May 2020
Copy link to clipboard 
Print this post

I'll get whatever needs to be found.
The Aerosharp leftovers I have all seem to be 560uf.

450uf with a quick look seems hard to find.

470uf and 560uf seem to be easy enough to source though.

560
470

5x 450uf=2250uf if using 560uf x 4=2240uf  (pretty close)

9x450uf=4050uf if using 560uf x 7=3920uf    (130uf off, is that close enough?)

If purchasing new 200v should be fine yeah?
RS 470uf 200v

RS 560uf 200v

I can drop off some 560uf's if that helps.
Edited 2020-05-11 09:31 by renewableMark
Cheers Caveman Mark
Off grid eastern Melb
 
Warpspeed
Guru

Joined: 09/08/2007
Location: Australia
Posts: 4406
Posted: 12:02am 11 May 2020
Copy link to clipboard 
Print this post

  Solar Mike said  Looks good Poida, those caps seem ok, if you stick to 20Khz and 100 odd volts input, 48v output. Change the voltages, frequency, output ripple and inductance and they all change. You are correct in that having too much output caps versus inductance the voltage feedback time constant gets very long, especially with light loads.

On my designs I don't measure the PV input current, all I care about is adjusting the pwm for max charge current during the bulk phase, concurrently monitoring the battery voltage; 20Khz is pretty low, a higher freq means smaller inductor required, but then pcb layout and mosfet driving require tighter control.

Cheers
Mike

This is all fraught with problems.  The L/C time constant become very long at light loading, and with a two pole filter, there may be considerable phase shift introduced around filter resonance which can produce voltage feedback instability.

One solution is to filter out the pwm through two separate paths. The main power flow goes through the main switching inductor and bank of filter electrolytics and into the battery, as it already does.

The pwm can be sampled directly by a simple R/C integrator which will be the naked 150 volt pwm straight out of the mosfet and catch diode. The R/C time constant can be whatever is required to average out the pwm duty cycle into a suitable dc feedback voltage with a minimal triangular ripple.  There will only ever be 90 degrees of phase shift at the switching frequency, and correspondingly less at lower frequencies.

The switching inductor and electrolytics can introduce all kinds of dc bounce, voltage hang up, phase shift, and naughty behavior but its the direct pwm duty cycle which represents the TRUE  average dc output voltage, and it will respond very quickly to rapid duty cycle changes.  So let the choke and the electrolytics play their games, and don't worry about it.

If you can make a Bode plot of the whole thing, it will hugely simplify things if the L/C filter resonance and electrolytic  ESR can be eliminated from being inside the voltage feedback loop.
Cheers,  Tony.
 
Solar Mike
Guru

Joined: 08/02/2015
Location: New Zealand
Posts: 1138
Posted: 12:28am 11 May 2020
Copy link to clipboard 
Print this post

  Warpspeed said   ... If you can make a Bode plot of the whole thing, it will hugely simplify things if the L/C filter resonance and electrolytic  ESR can be eliminated from being inside the voltage feedback loop.


An alternative is to take a differential voltage sample externally directly at the battery bank terminals; then all that potential resonance stuff + cable voltage drops are eliminated; most of the commercial quality PV controllers have a remote input connection for this, or use over-sized cable to the controller.


Cheers
Mike
 
poida

Guru

Joined: 02/02/2017
Location: Australia
Posts: 1420
Posted: 03:41am 11 May 2020
Copy link to clipboard 
Print this post

Warp, I'm not going down that road. I am not an E.E.

I want to build a controller with known and predictable input and output capacitance
and build the software from there. I thank you all for pointing out 470uF is common and 450uF is not realistic. I only used the 450uF since I had 40 of them.

I did a real world test today

Heavy overcast skies. Well, I am in Melbourne.

250W panels, 3 in series, by 3 in parallel on the East facing roof
I had to rewire them since they were 2 in series x 6. I only wired up 3 strings
leaving 3 panels unconnected. Output voltage from the array went from 60V to 100V.
This is hooked up to the prototype change controller.

The gold standard as it were is the car port roof with 3 in series x 4, again 250W panels, connected to the Morningstar MPPT 60A controller. This array faces North.

I saw 8.0A from the Morningstar and 6.0A from the prototype measured immediately afterwards. This is as good as it gets. The prototype is doing at least as well as the Morningstar.

3/4 the output from 3/4 the panels in other words.

Further testing and dev. of the software needs to be done.
wronger than a phone book full of wrong phone numbers
 
poida

Guru

Joined: 02/02/2017
Location: Australia
Posts: 1420
Posted: 03:59am 11 May 2020
Copy link to clipboard 
Print this post

  renewableMark said  I'll get whatever needs to be found.
The Aerosharp leftovers I have all seem to be 560uf.

450uf with a quick look seems hard to find.

470uf and 560uf seem to be easy enough to source though.

560
470

5x 450uf=2250uf if using 560uf x 4=2240uf  (pretty close)

9x450uf=4050uf if using 560uf x 7=3920uf    (130uf off, is that close enough?)

If purchasing new 200v should be fine yeah?
RS 470uf 200v

RS 560uf 200v

I can drop off some 560uf's if that helps.


All those combinations above will be close enough.

If you want to drop off the 560uF caps, don't spend any time taking them off the board, I can do that easily. I call that mid-working-week therapy.

200V caps will do the job.
Edited 2020-05-11 14:00 by poida
wronger than a phone book full of wrong phone numbers
 
poida

Guru

Joined: 02/02/2017
Location: Australia
Posts: 1420
Posted: 04:19am 11 May 2020
Copy link to clipboard 
Print this post

Apples v apples now.

I just tested the car port array output, into the Morningstar then the prototype.

typical values were 6.0A in at about 90V, 9.0A out at 55V

The prototype was as close to the MS MPPT output as I could measure within about 0.2A

This is even better news. It lives, Igor! It lives!
Edited 2020-05-11 14:19 by poida
wronger than a phone book full of wrong phone numbers
 
poida

Guru

Joined: 02/02/2017
Location: Australia
Posts: 1420
Posted: 05:10am 11 May 2020
Copy link to clipboard 
Print this post

..for those who want to see data:

Blue is vin
Grey is battery setpoint
Red is vout
Light Blue is PWM
Orange is Power input
Green is power output (the difference is the loss of the dc-dc conversion process
Purple is when a max power scan occurs.



There is a large variance in the pwm and Vin (which follows of course)

I will spend some time looking at the closed loop MPPT code and how it relates to this variance.

The Morningstar does not do this. It's output is much more smoother.
wronger than a phone book full of wrong phone numbers
 
poida

Guru

Joined: 02/02/2017
Location: Australia
Posts: 1420
Posted: 05:45am 11 May 2020
Copy link to clipboard 
Print this post

  Solar Mike said  Looks good Poida, those caps seem ok, if you stick to 20Khz and 100 odd volts input, 48v output. Change the voltages, frequency, output ripple and inductance and they all change. You are correct in that having too much output caps versus inductance the voltage feedback time constant gets very long, especially with light loads.

On my designs I don't measure the PV input current, all I care about is adjusting the pwm for max charge current during the bulk phase, concurrently monitoring the battery voltage; 20Khz is pretty low, a higher freq means smaller inductor required, but then pcb layout and mosfet driving require tighter control.

Cheers
Mike


I have tried 40kHz with the prototype and it worked fine with too small to measure switching loss increase. As you know the same inductor at 40kHz will permit 2x the current than at 20kHz so that might be useful later on.

I like the 20kHz pwm since it gives me 0-800 dynamic range to play with.

I think a closed loop tracking output current is similar to the closed loop tracking input current, assuming near constant dc-dc conversion efficiency.
So tracking on input power is good enough even though we all want to maximise the current going into the battery. This is probably true for most power levels.
In marginal cases such as very low power, maybe one is better than the other.
My view is mppt controllers spend the vast majority of time converting middle of the road power levels. It is not for long I have seen the Morningstar mppt deliver 60A into the battery. Typical periods when this happens are for a few minutes.
Then it's back to 70% power or something due to the battery getting to absorb voltage already.

I think a 45A converter is a good size to take on as a project.
wronger than a phone book full of wrong phone numbers
 
renewableMark

Guru

Joined: 09/12/2017
Location: Australia
Posts: 1678
Posted: 05:45am 11 May 2020
Copy link to clipboard 
Print this post

Poida, are the caps you are using from the boards I dropped off around xmas time?

Just check they are not 560uf 450v, I gave you three and kept three, all the one here are 560uf 450v
Cheers Caveman Mark
Off grid eastern Melb
 
poida

Guru

Joined: 02/02/2017
Location: Australia
Posts: 1420
Posted: 06:58am 11 May 2020
Copy link to clipboard 
Print this post

the 3 boards had a mixture of 450 and 560 uF. Maybe 10 450 and 5 or so 560 per board.
I think one board had all 450uF but can't be sure.
Those boards gave me the caps for this project.
wronger than a phone book full of wrong phone numbers
 
renewableMark

Guru

Joined: 09/12/2017
Location: Australia
Posts: 1678
Posted: 07:12am 11 May 2020
Copy link to clipboard 
Print this post

Bugger me, I didn't know there was a mix of caps in them, they are so tightly packed in you can't see most of them.

So if we get to within 100uf or so then that's close enough yeah?
Are we better going a tad under or over?

(keeping in mind the tolerances for these are pretty loose)
Cheers Caveman Mark
Off grid eastern Melb
 
azhaque
Senior Member

Joined: 21/02/2017
Location: Pakistan
Posts: 117
Posted: 07:45am 11 May 2020
Copy link to clipboard 
Print this post

  wiseguy said  so I apologise for the blunt reply.


No offence taken at all Wise.

You didn't tell us explicitly whether the converted file that I posted, was useful or otherwise.

Also if OK, please share the Altium file so that I can test importing it into Easyeda.

Regards

azhaque
 
     Page 10 of 50    
Print this page
© JAQ Software 2024