Thursday, 12 June 2014

BMPPT Solar Charger (3)

In pursuit improving my Boost MPPT charger, I have done the following:

  1. Update the software to use in-built PWM functionality of Arduino Uno. I've found out increasing frequency of the PWM is easy-as (simply add a line of code!!). The converter is now no longer making audible noise. Also, I get back most of the computing power of the Uno, instead of fully dedicated PWM routine. The negative of increasing PWM frequency is reduced efficiency. In my case, running 31kHz has reduced efficiency by 1%!
  2. Use MOSFET gate driver: this has increased efficiency by 2 - 3%, not bad! My inexperience made me choosing MOSFET gate driver without under-voltage lock-out, which caused the converter unstable during start-up. After much troubleshooting, I've found out the MOSFET gate driver locks the MOSFET to ON position during low voltage start-up, which cause the whole circuit short-circuited. This is now rectified by choosing another driver with under-voltage lock-out;
  3. Inductor: I've wound my own inductor using proper gapped core ETD34 core with much thicker copper wire. This has increased the current capacity and reduced EMI (so they said). However, no increased efficiency whatsoever compared to my old cowboy inductor.

I'm a bit disappointed that I haven't managed increased the efficiency significantly. I suspect my measurement method is inaccurate. As I simply read the watt reading from the el-cheapo watt-meter at the input. As the current is rippling, actual watt figure is probably different. So, next time I need to measure it properly using oscilloscope. None of the component is hot this time, so surely it's better than 90%.

New Schematic:

New software, click here. Note that the software includes my customised voltage selection during start-up. This is to accomodate my lead-acid 24V battery charging for the UPS. Yup, that's right, my shed is now off-grid too!

Thursday, 8 May 2014

Arduino Uno Shield Boost MPPT Cost

So, how much it cost exactly my home-made Arduino Uno shield for Boost MPPT charger? Have I reached my original goal to create the el-cheapo version of Genasun boost MPPT lithium charger?

If I didn't account for:

  • Hundreds of hours spending time in this project (I'm a slow learner),
  • Buying an awesome picoscope USB oscilloscope (to find out what was wrong with my boost converter due to my lack of knowledge),
  • PCB making infrastructure (solder, etching, etc etc).

Then the answer is absolutely yes! So far, components only cost me AUD65.80. If I were to get Genasun, that would cost me USD300!! Yes yes, it would financially much more beneficial if I were to buy the Genasun in the first place and not spending hundreds of hours and testing equipment... but... I learnt a lot from this project.

Breakdown of component cost as follow:

Total minimum purchase cost is shown above, as the minimum retail quantity was not one. I purchased them all from RS components.

There are components not shown in the cost table above (i.e. resistors and some diodes) because I've used my left-over components from my previous adventure. I ended up buying new Arduino Uno board, because I've blown up my original Uno freebie due to my own stupid mistake (literally, there was smoke coming out from the board after a 'POP'). So stupid, I won't share.

I can't share my board layout as it's riddled with problem, i.e. power jack is sitting on top of the USB connector, and the current sensing pad size is slightly wrong. I 'designed' the board using Microsoft Word, how silly is that?

Too bad, no one (that I can find in Google) has made buck/boost Arduino shield, nor boost only version that I can buy. So, until then, I'll be still using mine in the near future. 

Tuesday, 6 May 2014

Boost MPPT Charger Details (1)

So, meanwhile fresh in my mind, I'd better document how the software works. Following flow chart is the simplified version of my Boost MPPT charger Arduino Uno code:

Would I code this differently? Of course! But, the code as-is, works well. It has been tested with me trying to break it to find bugs. After various testing, this code has been fine tuned. For example, 5000 cycle times for the PWM. Too little, causing the MPPT tracking stuck in lower power, no idea why. Too large, not good for the speed of MPPT tracking. Plugging in and out battery meanwhile the sun is full shining was also tested (to make sure the code handles overvoltage, etc etc).

If I have more time, I would code using Arduino PWM in-built feature next time. I've just found out (after all of this), that I can change the PWM frequency. Heck, the more I spend time on this project, the more things I find can be improved.

What testings did I do? In brief:

Accuracy of MPPT tracking:
Very well, thank you very much. I did this by temporarily breaking the connection and reconnect the solar panel with another DC-DC converter. I noted down the power consumption of the input in-line power meter, immediately prior the converter becomes unstable, and compare this against my Arduino-Uno Boost MPPT charger input power consumption. Very close indeed. I should be honest, the test wasn't very scientific, as I only tested 2 points, i.e. at 30W and at 55W.

Efficiency of the charger:
as noted before, at least 87%. But, this is only true for power consumption above 17-ish Watt. Below this, the efficiency drops significantly (due to various reasons beyond the scope of today's blog :) ). At 3W, it's only 40% efficient. Note though, I need to repeat this efficiency test to get more accurate results. As the input power figure does jump around +/-1W due to the Perturb and Observe algorithm. I need to slow down the MPPT tracking to get the efficiency figure correctly. Why jumping around that much? Well, see next point.

Resolution of the MPPT tracking:
In theory, at 17V input, with 270uH, and 1us resolution of the 'onTime', I only can increase or decrease panel current by 63mA at a time (+/- 1W at 17V). Calculation as follow:

As stated in previous point, in practice, the input power does jump around +/- 1W at 17-ish panel voltage. Nice to see practice and theory agrees with each other.

Thursday, 1 May 2014

Mengisi Batere Sepeda Listrik dengan Tenaga Surya

Setelah tes lebih lanjut, sepeda listrik sang penulis sekarang bisa langsung di-isi dari panel surya, dengan rangkaian penjejak titik daya maksimum (atau MPPT ingglisnya). Spesifikasi:

Panel surya: 12V 80W (20.7V tegangan tanpa beban)
Pengisi batere: bikinan sang penulis sendiri (lihat artikel sebelumnya)
Batere sepeda: 36V 11.6Ah Lithium (NMC dari Panasonic)
Sepeda listrik: Hasil konversi.

Dengan rangkaian penjejak titik daya maksimum, sang penulis sekarang bisa lega karena tenaga panel surya diperes semaksimal mungkin. Sayang dong, kalau tenaga listrik yang dihasilkan tak terpakai secara maksimum?


Rangkaian pengisi batere bisa menaikkan tegangan panel surya yang lebih rendah dibanding tegangan beban (batere).

Setelah coba-coba, ternyata kalau panel surya diposisikan ke arah matahari, bedanya lumayan banyak. Contoh, jam 9 pagi, surya panel diposisikan menghadap langsung ke matahari, dayanya naik ke sekitar 60 Watt, dibanding 35 Watt kalau menghadap ke atas (posisi matahari siang bolong). Ya, masalahnya, siapa yang sempet merubah panel surya seharian?

Thursday, 17 April 2014

Rangkaian Penjejak Titik Daya Maksimum

Rangkaian berikut dipakai untuk nge-boost voltase panel surya, lalu digunakan untuk mengisi baterai. Contoh, menggunakan surya panel 12V untuk mengisi baterai 36V yang biasa digunakan untuk sepeda listrik:

Arduino Uno digunakan untuk mengendalikan rangkaian di atas. Kodenya dapat ditemukan di sini.

Rangkaian di atas sudah di-tes di lapangan dan dapat menjejak panel surya sampai 25Watt. Seharusnya dapat digunakan sampai 75W (panel surya 12V), tapi belum di-tes berhubung awan tebal ketika tes :) . Efisiensi lebih dari 87%.

Berhubung semuanya dikontrol oleh Arduino, rangkaian di atas bisa jadi super fleksibel. Contoh, ketika batere sudah penuh, kode yang di link di atas secara otomatis menghentikan pegisian batere, ke mode 'trickle charge'.

BMPPT Solar Charger (2)

Rightio, that peaking current that I previously reported? Well, that was me being un-educated that inductor in the 'fly-back mode' requires air-gap. Without the air-gap, my toroidal inductor was very quick went in to saturation and giving me much smaller inductance. I've found an excellent article here explaining it. Thanks to Dremmel, I simply cut air-gap cowboy style to my toroidal inductor.

That simple problem, paragraph above, took me literally hundreds of hours of troubleshooting, and couple of re-soldering activities due to burnt PCB tracks and components. Ouch...

But, I'm happy to report, by simply adding air-gap, now my BMPPT charger works properly. It actually works better than I anticipated (good problem to have). It tracks my solar panel very well up-to 25W output (during test day, it was very cloudy, couldn't test it all the way to the rated 80W). Efficiency during test also OK-ish (> 87%), even to include the Arduino board power consumption.

So, here it is the final schematic. Input capacitor (C1), and smooting capacitor (C3) were added after various tests:

Do note that exact component values are not critical. These components were selected because I was trying to re-use components that I already have. Final board photo, not looking that pretty:

Oh, the code for the Arduino Uno is here.

Charging current and final trickle voltage is all adjustable through software. The code linked above is to charge my 36V 11.6Ah lithium battery, i.e. charging stops at 42V. I didn't put current limit in the software.

Monday, 24 March 2014

BMPPT Solar Charger (1)

Update on my quest to design and build my own BMPPT electric bike lithium battery charger:
Searching what is out there in the first place:

  1. Genasun: Looks really good, but with USD300 price tag (due to custom voltage). Ouch, for stingy people like me;
  2. SPV1020, or complete with development board STEVAL-ISV009V1: Looks very promising, until I read the details that it only goes up to 40V. Not high enough for my e-Bike battery (I need 42V at the end of the charge);
  3. BMPPT 60 from GSL electronics: only good for 48V battery, not for my 36V battery.

So, the existing one in the market, either too expensive, or not suitable for my 36V battery. After researching into my options, I decided to go forward with Arduino Uno as the controller. Arduino Due would be definitely better (purely due to faster analog sampling time), but that's extra AUD70 that I don't want to spend. Besides, I already have the Uno in hand.

First thing, here's the simplified schematic of the boost controller. Nothing fancy:

What is not shown above is the voltage divider network and current sensing circuit to be fed to the Arduino Uno board. In the simulation above, you can see actual values. The pulse signal is mimicking the Uno Digital Output. The MOSFET symbol is incorrect, but hey, you get the idea. The inductor acts like the current source, and the switching circuit (by MOSFET) maintains the current by switching ON and OFF. Circuit above simulated using Falstad. I originally designed the system using following logic:

After doing the actual test, it's not looking good. It drew high peaking current with poor efficiency. After doing some investigation, I suspect the analog sampling is unreliable and causing my detection logic went hay-wire. So, I have no option but to go PWM mode. I am aware that SPV1020 also using PWM technique, but I'm struggling to get a good logic. Lots of trial and error at the moment. Will update...

Tuesday, 25 February 2014

Solar Charging for Electric Bike (2)

The cheap-skate version of my lithium battery solar charger was a success IF (there is a big IF) I monitor it continously, i.e. the output power of the converter (and losses) is less than the solar panel output power (Watt). I had to do this by changing the CC (Constant Current) setting.

The problem is, everytime the solar panel power (Watt) drops below the required output power (let say due to passing clouds), the DC-DC converter (CC-CV) becomes unstable. I'm guessing this is because the converter is trying to suck out even more current out of the panel. For example:

At 9 o'clock in the morning, I set the CC of the converter so that the output power of the solar panel reaches 39.4W (out of 80W rated Wp). When I tried to increase more power, the converter suddenly became unstable (making humming noise) and output of the solar panel drops to around 15 - 20W (jumping erratically). I had to decrease the CC setting all the way down in order to re-stablise the converter, and then turning it back up. unplugging and replugging the load didn't stabilise the converter.

Later, I found out that installing huge capacitor (I tried 15,000uF, definitely can do with less) at the converter input can help to stabilise the converter. Although, you still have to unplug the load and replug it back in.

So, in short, I was the slave labour to mimic the MPPT. By 12 mid-day, I managed to squeeze 67W out of the solar panel. The converter is pretty hot at this point of time (still touch-able) even with extra heatsink that I installed.

From my test, between 9am to 3pm (this time of day of the year), without any cloud, the panel can comfortably supply at least 40W (out of the specified 80Wp), so I don't need to fiddle much with the CC setting of the converter. Obviously, in practice, even the slightest cloud passing will throw this converter out of whack. So slave labour still required to monitor.

Oh, converter effeciency is around 89%, using power consumption figure from my in-line power meters. Not too far from the acclaimed 92% from the product website.

Next step, is to design and build my own BMPPT solar charger, as there is no way I can do this MPPT manually all the time. The current one in the market that fits my battery pack (36V 11.6Ah) simply doesn't exist. Either Genasun or GSL don't fit my charging profile. From googling the web, the Tim Nolan's one inspired me to make mine from Arduino Uno. Watch this space!

Ah VS Wh for Lithium Battery State of Charge

Following previous post, I've found out the in-line power meter that I bought from eBay does not count Ah and Wh properly. This one only counts properly when output current and power is constant. When the output drops to zero, the Ah and Wh also drops to zero. What the??

So, I managed to find this one from Altronics (Manson), and work as expected. Definitely not worth to buy el-cheapo in-line power meter, for any model (after googling around). Save yourself lots of trouble and get the manson one instead. So, here's my final circuit:

Trying to minimise my loss, I use the crap-o-meter to display Volt, Ampere, and Watt for solar panel output. The good one, I use for coulomb-counting for battery charging. I wasn't sure whether to use Ah or Wh to calculate the State of Charge of my Lithium battery pack. My original thought was using Wh, as surely energy is better indicator? However, I trust white paper more than some Joe-Blog opinion (like myself). ALL white paper that I found so far, mention 'Coulomb counting' (i.e. counting Ah) is one way to monitor your state of charge, so that what I'll do for my battery pack. One of example of the white paper can be found here.

From my own testing, charging using Ah seems more accurate than using the Wh. Here is the example:

I used 6.864Ah or 248.02Wh in one of my commuting day last week. I got this figure from my 'cycle analyst' installed in my electric bike.

When charging (with constant current 1.2A most of the time), I stopped the charging at 6.6Ah or 259.6Wh according to my Manson in-line power meter (using my solar charging circuit). At this time, the voltage of the battery pack was 41.78V. After almost 2-day rest of the battery, my battery pack voltage was 41.4V (using cycle analyst).

Hence, from the above, definitely use Ah, NOT Wh counting for reliable discharge and charging of your lithium battery pack.

As you may already know, most lithium battery pack specify both in Ah and Wh. For example, my battery pack says 36V, 11.6Ah, 416Wh. However, from my usage so far, there is a few Watt discrepancy between the actual Wh and Ah (by simply multiplying it with 36). So, again, using Ah, not Wh for battery State of Charge, is definitely more accurate.

Wednesday, 5 February 2014

Pengisi Baterai Lithium Bertenaga Matahari

Walau pengisi baterai bertenaga matahari mulai menjamur, sayangnya sistem yang ada di pasaran (yang menggunakan 'pelacakan titik daya maksimum') sejauh ini khusus untuk baterai 'aki'. Untuk sistem pengisi baterai lithium yang banyak dipakai sepeda listrik, sistemnya masih jarang. Jadi, harga sistemnya masih mahal, contoh: 

Nah, ide saya:

1. Panel surya, 12V 80W;
2. Konverter DC-DC;
3. Pengukur Ah and Wh ;
4. Baterai 36V 11.6Ah, Panasonic cells

Alasan memilih sistem ini:

  1. konverter DC-DC di atas tidak memiliki 'pelacakan titik daya maksimum'. Tapi, berhubung saya ketiban untung dapat panel surya murah dengan daya yang lebih dari cukup, mudah-mudahan konverter ini bisa mencukupi. Lagipula, harga konverter di atas jauh lebih murah.
  2. Walaupun konverter di atas bukan ditujukan untuk mengisi baterai lithium, namun konverter ini bisa diatur sehingga maksimum tegangannya 42V. Sayangnya nggak ada 'auto off'. Melihat banyak artikel dari mbah Google, katanya tidak disarankan untuk mengisi baterai lithium dalam posisi ini (42V tanpa 'cut-off').
  3. Karena resiko di atas, saya menggunakan pengukur Wh (Watt-Hour). Jadi, bisa monitor berapa banyak 'tenaga' yang sudah masuk ke baterai.

Harganya sejauh ini bersaing dengan harga PLN-nya negara maju:

Solar Charging for Electric Bike

Thanks to absolute bargain I found from gumtree, now I can charge my electric bike battery using solar panel. Unfortunately, I can’t find any suitable charger system off-the-shelf. My requirement:

  1. MPPT (with booster) to charge e-bike battery directly from the solar panel. In my case, 12V solar panel to charge 36V lithium battery (Panasonic cells).
  2. Cost of the total system (solar panel plus chargers). If the whole system cost way too high ($/kWh of its lifetime), I’d rather charge them from the grid.

The closest one I got so far is but the price is a bit steep for me (must order the custom voltage for me). I'll put this on the back-burner when everything else fails :).

So, my idea #1 so far:

1. Solar Panel, 12V 80W (it only cost me AUD110!!);
2. DC-DC converter, CVCC (constant voltage constant current) (Ref #1 below);
3. Ah and Wh meter (Ref #2 below);
4. eBike battery (mine is 36V 11.6Ah with Panasonic cells)

Reasoning behind my selection:

  1. There is no MPPT in the DC-DC converter above. However, considering the cheap as chips unit, and plenty of 'oomph' in my solar panel, me think this should be OK.
  2. It's not a dedicated lithium charger. Although I can set the CV (Constant Voltage) to 42V, I'm not sure what is the degrading effect of leaving 'trickle' (float) charge at 42V. Reading many articles regarding 'float' charge of lithium batteries, I've come to conclusion "simply don't do it". Although, from my experience with the supplied charger, once it's topped up to 42V, it stays in this state for a long time. When I left the battery unused (after full top-up) for almost 2 days, the voltage is still 41-ish volt.
  3. Due to unknown risk above, I've decided to use the Ah (complete with Wh) meter. So I can monitor the charging accurately.

My idea #2 is to buy el-cheapo 12V to 240V inverter and use my supplied charger. However, I like the idea setting the charging current of idea #1 :).

Cost so far:

Not too bad. Definitely comparable to my grid-connected charger. Figures maybe optimistic (as in, the ability to charge everyday) :).

Results? Well, I need to wait until I get the converter first!