Shop OBEX P1 Docs P2 Docs Learn Events
PWM Battery charger — Parallax Forums

PWM Battery charger

GarthGarth Posts: 18
edited 2008-06-07 12:28 in Propeller 1
Ok. Here is my first major project. I'm building a charge controller for RE (Renewable Energy) systems. I'm incorporating as much flexibility as as I can into the design.

I'm incorporating the propeller chip as my base mainly because I really want to sink my teeth into this chip. The first phase of this project is to get the controller to charge 2 lead acid batteries (Jameco #318924, 12v 3.2ah) in a series. At first I'll use a 24vdc power supply for my first testing phase. I'll switch to a PV panel(s) or a wind turbine after that.

A couple Notes:

1. I'm utilizing the CTRA and CTRB control registers for PWM control.
2. I am considering switching to a 12 bit ADC (MAX1270) to handle NiMH as well as lead acid.
3. I want to include a LCD display.
4. Additional monitoring for multiple power sources (Some RE installations have solar, wind, and/or hydro sources).
5. I want to tie it to a computer to gather data and remote monitoring.

That's a good start for now. cool.gif I want to know what you all think so please have a look at my schmatic and let me know.

Thanks in advance.
1000 x 583 - 73K

Comments

  • mikestefoymikestefoy Posts: 84
    edited 2008-06-04 08:37
    Garth,

    if your project is a one off for home use, and the purpose is to learn propeller- then fine.

    If its for a commercial application, then there are far better and cheaper solutions.


    a pic16 would eat the task, and cost far less.

    there are loads of application notes on charging batteries.

    http://webdc.transim.com/microchip/

    microchip app note AN1015 "Programmable Lead Acid Battery Charger" may help

    an 80MHz, 8 processor chip is not required to control the charge to a battery.

    choose the appropriate solution for the problem is always a good maxim.

    Mike
  • Ken PetersonKen Peterson Posts: 806
    edited 2008-06-04 12:57
    @Garth:

    You have your 3.3V regulator connected to one Vdd pin on the Prop and the 5V regulator connected to the other Vdd pin. NOT a good idea! Connect your 3.3V regulator to both Vdd pins on the Prop!

    Looks like you're powering your ADC with +5V and the Prop with +3.3V. You should have resistors in your data lines between the ADC and the Prop to avoid damage to the Prop due to the difference in voltage levels. 220 ohm is the recommended value.

    Good luck and happy charging!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • JonathanJonathan Posts: 1,023
    edited 2008-06-04 13:17
    Why is there a full wave rectifier bridge? If the source is PV panels, they are DC anyway. If the wind gen. is AC, then you need a bridge for that.

    Mike, I think the Prop is perfect for this! I am working on a controller for my solar hot tub. While it certainly can be done with other MCU's and perhaps for slightly less cost, the Prop just makes everything so dang easy...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • Ken PetersonKen Peterson Posts: 806
    edited 2008-06-04 13:24
    @Garth: Also, you have a 10K between the 3.3V regulator and Vcc of the EEPROM. This is not necessary. However, you might want to use that 10K as a pullup on the SDA line. Not all EEPROMS function properly without it.

    The full-wave bridge is a good idea.· Allows you to connect it to any source - AC or DC, without careful attention to the polarity.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • scottascotta Posts: 168
    edited 2008-06-04 13:29
    I noticed that you have pin 12 (vdd) connected to the 5 volt supply.

    Scott
  • RsadeikaRsadeika Posts: 3,837
    edited 2008-06-04 13:35
    I have to put in my 2 cents on this one. I was going to try to use the Prop as a battery monitor, but after looking at the info available, I decided to use another processor; what could be easier than working with a provided command like adin/tadin. I have to agree with Mike on this one, somethings are simpler, and less time consuming if you use the right tool to begin with. The Prop will still be used, but not for the battery monitor.

    Ray
  • GreyBox TimGreyBox Tim Posts: 60
    edited 2008-06-04 21:43
    Garth,
    ·
    A few things I did note in addition to the above comments (in order of severity):
    1. No Fuses – anywhere…· This is dangerous. Period.
    2. There is no voltage control for the input to the battery (your battery can explode due to over-charge)
    3. There is no temperature monitoring on the battery (your battery can explode due to over-charge)
    4. No current detection (for PWM control input) – without this, you can’t control the battery’s charge at all… aside from only connecting the solar array to the battery then the voltage exactly matches the charge voltage set-point (this would probably happen twice a day for about three minutes turn.gif.
    5. You are using a relay for PWM (I presume for high speed switching&#8230[noparse];)[/noparse] – this will wear out after a million or ten switches. Think about this - if you are switching at 3kHz, this would take about 30-300 minutes at full relay contact load… (not reliable at all&#8230[noparse];)[/noparse]
    I assume you are planning to use a permanent-magnet wind/hydro generator (output voltage varies based on wind speed or water flow), which matches roughly the characteristics of a solar array.· If not (as in, you intend to use an automotive rectified alternator), you need to build-in a voltage regulator for that as well…
    ·
    I’ve attached a few PDFs for you to read through as well – the big one is split up into three files (because of the forum’s file-size limit).· This is a compilation of the best battery/battery-charger information I’ve ever found.
    ·
    I would recommend that you do some research on MPP (Maximum Power Point) solar chargers, if you are even going to do a smart solar charger (not just a few transistors&#8230[noparse];)[/noparse].· You will probably also benefit from reading up on multi-stage battery chargers (the big PDF has a ton of good info in it&#8230[noparse];)[/noparse]

    A few suggestions:
    1. Use the Propeller as a battery monitor as well (all that extra processing horse-power should be put to GOOD use&#8230[noparse];)[/noparse] – this will give you an idea of “state of charge” and run-time remaining.· You can use that information internally to the Propeller to manage things like load dumping etc. to manage the available power.
    2. Use power MOSFETs instead of relays for high-speed switching (they will last a lot longer)
    3. Look into switching supplies (specifically "4-switch buck-boost"), you can·emulate this function·with the·Propeller-based·charger to squeeze power out of your solar cells even when they are severely shaded (or the wind is just barely blowing, or the stream has only a trickle&#8230[noparse];)[/noparse], or if the solar array, wind, or water turbine are producing a voltage way over your battery charge voltage set-point.
    4. Don’t use a bridge rectifier in your final design – you don’t want to have anything in the “ground” path at all.· A simple diode on the + side will suffice to protect against reverse polarity or solar array power leeching (at night).· Remember every diode junction you go through is one more voltage drop and a loss in efficiency…
    5. Especially if you plan on mounting this to a house or something outside – put a transient voltage suppression (TVS) device on your + input to the circuit from the generation devices to protect the Propeller and the attached loads from things like lightning or surges.
    One thing I’ve joked about in all semi-pro solar installations – is the diversion load.· If you’re going to put in a diversion load – make it do something useful…
    ·
    In a home, have it heat water or turn a circulating fan (things that need to happen anyway).
    In a car, have it keep the engine warm or the interior cool.
    ·
    -Tim

    Post Edited (GreyBox Tim) : 6/4/2008 10:07:14 PM GMT
  • JonathanJonathan Posts: 1,023
    edited 2008-06-05 13:05
    Tim,

    The three part "Mobile POwer FAQ" is telling me it is corrupted when I try to open it. Is there anyway I could get you to email me the entire thing? I'd really like to read it. My address is jpeakall AT madlabs DOT info. It would be much appreciated.

    I just bought an off grid property, so I'm learning all I can.

    Thanks!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • GarthGarth Posts: 18
    edited 2008-06-05 16:06
    WOW! Thanks to everyone for the great responses. I really appreciate it.

    mikestefoy:
    ...choose the appropriate solution for the problem is always a good maxim.
    



    I couldn't agree with you more. I kind of hinted that there are other integrated applications that I will be add later to this project over all. I am taking small bites, for now, and will be adding more later. Thank you for your input.

    Ken Peterson
    You have your 3.3V regulator connected to one Vdd pin on the Prop and the 5V regulator connected to the other Vdd pin.
    



    As the said on the old SCTV show "...that blowed up real good!" lol.gif Thanks. I was really tired and completly missed that.

    Also, you have a 10K between the 3.3V regulator and Vcc of the EEPROM...you might want to use that 10K as a pullup on the SDA line.
    



    That is where I ment to put it. Ughhhh Here again really tired, late night. lol.gif Thanks for catching that.

    Jonathan
    Why is there a full wave rectifier bridge? If the source is PV panels, they are DC anyway. If the wind gen. is AC, then you need a bridge for that.
    



    The power source on the schmatic was general, at the time, to help me get through the initial design. I have corrected that on my current incarnation of the schmatic which I'll post in the next couple of days.

    Rsadeika
    I have to put in my 2 cents on this one. I was going to try to use the Prop as a battery monitor...
    



    As I said above, I'll be intergating others thing into the design at a later date. I don't want to overwhelm myself just yet. LOL lol.gif


    GreyBox Tim
    I can't thank you enough for all the great information and pdf's. It will take me some time to pour over all that great information. I really appreciated it.
    In a home, have it heat water or turn a circulating fan (things that need to happen anyway).  In a car, have it keep the engine warm or the interior cool.
    



    I was pondering over a way to just that, using the excess power in some creative ways. It will be added as I get the different phases stable and working. Thanks again for all the great info.

    Also, the multi-part "Mobile Power FAQ (Victron Energy) and Battery FAQ (Web).zip" was corupted for me as well. Would you please send a copy to my email address as well. gvg451 AT yahoo DOT com.


    Thank again to everyone for the input and sharing of ideas and information. It's good to know that people still wish to help each other out in this crazy world of ours.

    Garth
  • GreyBox TimGreyBox Tim Posts: 60
    edited 2008-06-05 19:59
    Hi All,

    On the zip file thing - I noticed something that Windows is screwing up when it saves the file - it renames the first file as a .zip file (instead of leaving it as a .001 file). This causes it to be seen as corrupted.

    My email accounts have a 1MB file size limit so I can't email it directly to people. If you're still having trouble opening it - use 7zip, which is an open source free software (much better than the Windows internal compressed folders tool or WinZip or WinRAR). This can be found at www.7-zip.org (use the stable 4.57 version).

    -Tim
  • JonathanJonathan Posts: 1,023
    edited 2008-06-05 20:32
    Tim,

    Can't open it with 7-zip either. I poked around and found Victron Energey, but couldn't find the FAQ. Sorry to bother you, but if you have a link that leads to the document, that would be great. It's all your fault we are so interested, you said it's the best you've seen. :0

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • TimmooreTimmoore Posts: 1,031
    edited 2008-06-05 20:37
    this worked for me, download the 3 files (make sure you name the first with 001". Then run the following all as one line

    copy /b "Mobile_Power_FAQ_(Victron_Energy)_and_Battery_FAQ_(Web).zip.001
    " + "Mobile_Power_FAQ_(Victron_Energy)_and_Battery_FAQ_(Web).zip.002" + "Mobile_
    Power_FAQ_(Victron_Energy)_and_Battery_FAQ_(Web).zip.003" "Mobile_Power_FAQ_(Vic
    tron_Energy)_and_Battery_FAQ_(Web).zip

    Then you have a zip file that opens.
  • GreyBox TimGreyBox Tim Posts: 60
    edited 2008-06-05 21:22
    I'm going to email the forum admin to see if I can get an exception to the 2MB limit for this one file...

    -Tim


    Edit: I have confirmed that Timmoore's meathod also works well. -T

    Post Edited (GreyBox Tim) : 6/5/2008 9:32:07 PM GMT
  • GarthGarth Posts: 18
    edited 2008-06-05 21:46
    The
    [noparse][[/noparse]code}copy /b "Mobile_Power_FAQ_(Victron_Energy)_and_Battery_FAQ_(Web).zip.001
    " + "Mobile_Power_FAQ_(Victron_Energy)_and_Battery_FAQ_(Web).zip.002" + "Mobile_
    Power_FAQ_(Victron_Energy)_and_Battery_FAQ_(Web).zip.003" "Mobile_Power_FAQ_(Vic
    tron_Energy)_and_Battery_FAQ_(Web).zip[noparse][[/noparse]/code]

    Worked for me. Just so you know.

    Garth
  • JonathanJonathan Posts: 1,023
    edited 2008-06-05 21:53
    Mmkay, I'm a thickie, so bear with...

    Is the above using 7-zip, or just from the winblows command line?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • GreyBox TimGreyBox Tim Posts: 60
    edited 2008-06-05 22:01
    All,

    Jeremie, the forum admin, has gratiously posted the PDF to the Parallax FTP site at:

    ftp://ftp.parallax.com/Mobile Power FAQ (Victron Energy) and Battery FAQ (Web).pdf

    A big hats off to Jeremie!!

    -Tim
  • GarthGarth Posts: 18
    edited 2008-06-05 22:02
    The standard WinDOZzzzzz comand.
  • JonathanJonathan Posts: 1,023
    edited 2008-06-07 12:28
    Thanks Tim and Jeremie, I appreciate the effort. Good reading too, very informative doc. Anyone know a good forums to discuss batteries, solar power, that sort of thing?

    Jonathan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
Sign In or Register to comment.