Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Universal Battery Charger

Status
Not open for further replies.
See you don't want to share a simple menu and you expected Felixls to share all his hard work
Dude it's not the case I don't want to share the code and I only wanted Felixls to share code becuase it is a real cool project and would of gained loads from it
What is the point of sharing unfinished code ?
It would be no good to man or beast has it is,
Where is the main code and what is it all about? My understanding is that the charging is the main code. The menu is just icing on the cake.
The main code is part of the menu system has with out the menu system you would not be able to select what you want to charge. Like you stated the menu is the icing on the cake beacuse you can't do the icing if you have not got a cake.:lol::-D

Dude, don't make such comments. Look back in the posts even Felixls had the same opinion about your writing. I had given you my website address, where I have shared most of my code under GPL. Its all my hard work written in C. I don't know what you do for a living, but I have a job to do and a family of 4 to feed. Given the bad state of our economy in the US, this battery charger project is not my Top priority. I don't care if it is not done, I'll pay $50 and get something from Radioshack that just does the job of charging batteries. I do these projects in my free time. I hope you got it.
Dude if you read it correctly I said WITHOUT BEEN FUNNYMay be be you donot understand our british lingo and humor:-D Yes I can understand it's all your hard work and it's your hobby. Buying a charger just takes all the fun out of it.:-D

By the way here is some ADC code Freeware (useful to read battery voltage and current), if you want to integrate it into the "Main Code". It is all in C and easy to digest.
The ADC is the easy part and already have the ADC covered so I don't need to convert to PDS. It's just when you read through the AVR450 code so much is happening and it's kind of hard to get your head wraped around it. After all I woudl like this to be spot and and not burn any batteries out.

I'm sorry if you took offence to what I said but that is just me typical brit and I've jsut re-read the whole topic and got you confused with someone else sorry I've been stung once before I did all the work on this project I shared all the code and work and geuss what I never heard from them again. Like I said there is not point at the moment in sharing half finished code you would not gain from it. I work on my projects like building blocks, Get the menu system working on it's own then get the charging routine working on it's own for each type of battery then build it all together, This way you get less bugs
 
Last edited:

I have add permission from Felixls to post part of his code that I got from another forum. But this is all I have of it.
This may help others to start and understand how Felixls charger works, I need to convert this to PDS(picbasic). The aim is to get this routine working on it's own first then add to menu code.Once this part is sorted the rest of the battery types should fall into palce:).
Feel free if you fancy a bash at converting to PDS ;-)
Code:
 //dTdt - La temperatura por minuto excede 1 grado por minuto.
//dVdt - Detección de pico de voltaje. Espera inicial 10 minutes
//High voltage - 1.68 volts por celda
//Timeout - 65 minutes a 1C, 130 minutes a 0.5C, etc.
void chargeNiXX()
{
  //Condiciones de fin

  //Timeout
  If (minutes > timeout)
  {
    Print("#END:TO\n");
    stopCharge();
    Return;
  }  

  // Voltaje máximo
  If (actualvoltage >= voltagecontrol)
  {
    test_voltage++;
    If (test_voltage>=4)
    {
      Print("#END:VM\n");
      stopCharge();
      Return;      
    }
  }  
  Else
    test_voltage = 0;

  If (minutes != last_min)
  {
    last_min = minutes;

    // -dV/dt
    If (minutes >= NDVwait && last_min_volt>0)
    {
      If (adc_voltage <= last_min_volt - 1)
      {
        Print("#END:DVDT\n");
        stopCharge();
        Return;
      }
    }
 
    last_min_volt = adc_voltage;

    // dTdt
    If (last_min_temp > 0 && adc_temperature >= last_min_temp + 3)
    {
      Print("#END:DTDT\n");
      stopCharge();
      Return;
    }
    last_min_temp = adc_temperature;
  }

  If (actualcurrent < chargecurrentcontrol)
    incduty(1);
  Else If (actualcurrent > chargecurrentcontrol)
    decduty(1);
}
 

How do you calculate amount of mAh ? Measure current every 1 sec, sum it all and later divide by 3600 ?
 

The setting of the mAH is done from the menu slection, This set the amount of PWM top provide. The the current is measured continuous and adjusts the PWM to maintain the correc and max current.
 

I know that. I measuring current and adjusting it by PWM it's working fine.
I want to measure the amount of power I put into battery in mAH. How to do it?
 

I know that. I measuring current and adjusting it by PWM it's working fine.
I want to measure the amount of power I put into battery in mAH. How to do it?
Ah I understand now there is away that you can do it, I will have to look trhough my paper work/data sheets
 

So can you tell me how did you do that?
Right now I have interrupt every one second and variable Amp
...
Amp=Amp+Ibat;
...
On Lcd I display it divided by 3600 = Ah. Is that correct ?
 

Wizpic,

Good article about universal battery charger with PIC18F452.

**broken link removed**


Renato
 
  • Like
Reactions: wizpic

    wizpic

    Points: 2
    Helpful Answer Positive Rating
Renato good find this makes interesting reading.

thanks
Wizpic

---------- Post added at 21:51 ---------- Previous post was at 21:25 ----------

RenatoBR after having a quick read through this I thought that this is well documented and very indepth, I found the full version of the article including code

**broken link removed**
 
Firstly sorry for being soooooo d**n late. The stupid state of our economy is killing us, I had to work even on the weekends :-x Anyway, the SLA charging routines are working (at least as per the logic, on the debugger).:smile: I still have to test the same on real-world electronics and batteries. There is still some work to be done to optimize the code, especially the LUT (look up tables) and then I'll share the code with you. Once the SLA is done, it is just a matter of adapting the code for the rest of the battery types and putting a user interface system together. :-D

I found the full version of the article including code
**broken link removed**

By the way, Wizpic, I'm unable to access the file... Could you please share the doc's and the rest of your findings here.
 

eeye here is the file for you.
I've got the Nimh part nealry sorted but I use PDS so I have to convert the C to basic
 

Attachments

  • DT1_Final_Report.pdf
    1.6 MB · Views: 232
Wizpic : Thanks for the prompt reply :grin: Just now downloaded the file and what I see on a very quick note is that it is a "Two-in-one" project. Power supply + Battery charger :cool: I'll have to analyze the code and see how different it is from the SLA routines that I have done (of course based on the links for the Atmel app note that you gave :-D) Thanks again for your active involvement.
 

I thought the sane when I read it. The best of both wolrds plus the source code is there for the PC innterface
 

Publicación de código fuente

**broken link removed**

La licencia es Creative Commons Creative Commons — Attribution-ShareAlike 3.0 Unported

Citar
You are free:
to Share — to copy, distribute and transmit the work
to Remix — to adapt the work

Under the following conditions:
Attribution — You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work).
Share Alike — If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.

Que significa que son libres de copiar, distribuir, transmitir y modificar este trabajo, bajo la única condición de publicar el trabajo realizado, las modificaciones realizadas y reconocer el autor original ( y de donde fue obtenido).

saludos o Regards
Felixls.
 
Publicación de código fuente
...........
La licencia es Creative Commons Creative Commons — Attribution-ShareAlike 3.0 Unported
......
Citar
You are free:
to Share — to copy, distribute and transmit the work
to Remix — to adapt the work
..........
saludos o Regards
Felixls.

Felixls : Thank you for the source code. We appreciate your hard work and we will never copy the code without giving you the credit. You are a very hard worker and a very kind soul. *** bless you and your family.:grin:
 

Hi Felixls,
I appreciate your kind gesture of sharing your code! I hope you have included a one line LCD message stating who wrote the code and designed the project.

Asimov
 

Hi Felixls,
After reading your code for the Digital Power Supply, I have found the following.
(a) The code only checks for current limiting, and does not check for voltage limiting.
(b) There is no kind of short circuit protection detection. The only way the power supply is protected is by the 0.51ohms which will turn on @ 1.3A, which will possibly happen after the connected equipment is destroyed :cry:
(c) There is no provision to store the current settings in memory :sad:
(d) The code can be optimized even more and the size can be reduced​

Other than that I think you did a fine job :cool:
 
  • Like
Reactions: asimov

    asimov

    Points: 2
    Helpful Answer Positive Rating
Hi Felixls,
(a) The code only checks for current limiting, and does not check for voltage limiting.
(b) There is no kind of short circuit protection detection. The only way the power supply is protected is by the 0.51ohms which will turn on @ 1.3A, which will possibly happen after the connected equipment is destroyed :cry:
(c) There is no provision to store the current settings in memory :sad:
(d) The code can be optimized even more and the size can be reduced​

Thanks!

I will try answer:

(a) In this version (1.0) the voltage limit is established by a low pass filtered pwm signal, and has no current regulation (only checks in code for a specific limit).
(b) Well, the power supply is protected by the 0.51 ohms resistor, because @ 1.3A is ~4A, in this situation the transistor disconnect the base of one of the power transistor (tip121). But this protection could be better by implementing other pwm control signal for the current, eg. replacing the signal +5v / 0V. ;)
(c) I think you can implement this, use the internal eeprom, read the datasheet.
(d) Yes!, It was one of my earliest written codes for pic, so the are several optimizations.

Saludos o Regards
Felixls.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top