PDA

View Full Version : Battery charger - power supply issue affecting ADC



flotulopex
- 1st December 2007, 12:53
Hello,

I'm finishing my 24V lead-acid battery charger and get stuck on a power supply issue.<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=2167&stc=1&d=1196512003">
The circuit works well but there is a strange (to me) voltage drop on the PIC's side while the current raises on the load and this impacts the ADC measurements.

If no load is connected to the circuit, the controlled output voltage range is from 25V to 30,5Volts and there is a clean constant 5V at the VR1's output (VDD) through the full range.
R2 drops the transformer's voltage from 44VDC to around 40VDC at the LM317K's input (to stay within specs).

When the load is connected, as the charging current raises from 200mA up to 1,2Amps (maximum I need), the VDD drops from 5V to 4,8Volts while the load's voltage is then raising from 25V up to 29Volts.

There is a slowly blinking LED (currently I have one, should be two finally) indicating the loading process goes on (timer toggles the LED every 2 seconds).

I check the differents measured values by the PIC via a serial connection. This is actually how I noticed the voltage drop.

Each time the LED is on, the values differ from the trend.

I naturally thought about an overload on VR1. I can measure between 5,54mA and 14,51mA at the VR1'a output wich is far under it's limit (100mA). I the doubt, I replaced it with à 7805 (1A). Same problem.

For a try, I replaced the actual 22V Zener by a 8,3V one; no change.

I then built up a totally appart 5VDC power supply with a second transformator (230:9VAC). Again, the same voltage drop happens as the load raises (this is more than strange!!!).

Does anyone have an idea what I'm doing wrong here?

Acetronics2
- 1st December 2007, 13:34
Bonjour Roger,

Just one question ... Temp of the LP2950 case ???

see the " LP2950 Maximum Rated Output Current " current and remember the input voltage is close to the maximum of the LP ...

the current you draw is ALSO very close to the max ...

also the reason from DS DATASHEET:

''
H - High-Terminal Potentiometer. This is the high terminal of the potentiometer. It is not required that
this terminal be connected to a potential greater than the L-terminal. Voltage applied to the H-terminal
can not exceed the power-supply voltage, VCC, or go below ground.

"

It seems I already had cut and pasted this section .....

We already had this discussion too ... about frying the DS 1804 ...


Amitiés
Alain

flotulopex
- 1st December 2007, 14:14
Bonjour Alain,

Merci de m'aider encore une fois ;)
<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=2168&stc=1&d=1196517384">
When there is no load on the transformator, I have around 13Volts at the VR1. This is maybe just a little to much... At this time, the PIC has nothing to do.

But when on full load, the transformator's voltage drops down the VR1 input's voltage to 7Volts wich is now okay. Now the PIC has to "go to work".

About the DS, I don't understand what you mean; there is nothing connected to the "H" terminal. The DS is 5VDC powered and the maximum voltage I can measure between GND and "W" is 3,45Volts. Do I miss something basic?

How do I "manage" the huge voltage difference from the transformator (with or without load)?

Acetronics2
- 1st December 2007, 14:53
Sorry, Roger

it was :

" W - Wiper of the Potentiometer. This pin is the wiper of the potentiometer. Its position on the resistor
array is controlled by the 3-terminal control port. Voltage applied to the wiper cannot exceed the powersupply
voltage, VCC, or go below ground."

that means voltage on the wiper must not Exceed 5 Volts ... so, your output can't safely exceed 24 + 5 - .8 ( By 500 ! ) = 28 v

you tell 25 to 30v out ... that's 2 v too much !!! I'm oK, only two "little volts" ... but too much ...

I told you on another thread the DS couldn't bear the voltage you want !!!

Alain

Ioannis
- 2nd December 2007, 21:33
Hi boys. If I did the math correctly, at max output 30.5 volts the drop on the 10K DS pot would be around 6.8 Volts. As Alain stated this cannot be tolerated by the DS chip.

I believe that it would be more practicle to use PWM on an output of the PIC, filter it and then feed a Pass transistor instead of the 317. As an example please refer to Elektor December 2001 issue (Digital controlled power supply).

Ioannis

mister_e
- 2nd December 2007, 22:03
Weird idea this Zener Z1 so far...

But yeah i'll second the PWM idea.. maybe just remove the LM317 as well and use a Mosfet/Transistor instead and do everything in software. a 12F683 would be perfect for that.

1 current senses
1 voltage sense
1 PWM and
remaining pins for leds and maybe other safety inputs.

inse
- 3rd December 2007, 07:15
Hello Roger,

one thing I have noticed in your schematic: do you have a ground connection on the OPAMP?
It's ground pin (4) seems to be floating...

Regards,

Ingo

flotulopex
- 3rd December 2007, 09:22
Thank you Ingo,

Good observation!

I corrected the schema and the circuit (I was already noticed about this by Acetronis some hours ago - as I say, better two times than never ;) ).

Weird idea this Zener Z1 so far...
As I'm not an electronician but a real "bricoleur du dimanche". Anyway, why is the use of a Zener this way not a good idea?

Ioannis, your math is absolutely correct but when I take my FLUKE87 or my scope, they both show a maximum of 3,45 volts. This has to be, again, one of this famous frontier between theory and real life :D.

I forgot to ask: what type/model of MOSFET or Transistor would fit my application best please?

Ioannis
- 3rd December 2007, 09:54
Your current is up to 1,2A so any transistor that can handle the double to be safe, could be used. TIP31 (3A) or MJE3055 (10A) are a few examples.

The idea is to design a simple classic linear power supply that would be controlled by your PIC about the voltage and current. That would require A/D converters but to be very fast, a good designed Sigma-Delta converter may have to be used instead off the classic ADC's.

That's what is hidden in the Elektor's article I mentioned.

Ioannis

Acetronics2
- 3rd December 2007, 10:18
Ioannis, your math is absolutely correct but when I take my FLUKE87 or my scope, they both show a maximum of 3,45 volts. This has to be, again, one of this famous frontier between theory and real life :D.

?

Hi,

IF we consider The 317 has a max ref voltage and a max Iadj current ... those readings are possible ... ( your 317 is "not so good" , Roger !!! )
But that also mean ANOTHER 317 could damage the DS 1804 ...

this design won't be good for series production ...

Now, Roger, there's another point to verify ... your PCB tracks !!! are they sufficient to hold the required current ...
And overall ... did you use a "star" config to link your ground tracks ???
( maximum care for R5 ground return path ...)

Alain

flotulopex
- 3rd December 2007, 10:26
I'm searching for this ELEKTOR info - but seems to be available only for members... Still looking for it.

Using PWM, I will generate a voltage variation. If I'm right, a MOSFET can be "voltage" controlled; this is not true for a transistor.

I assume it will be better to use a MOSFET, no?

Acetronics2
- 3rd December 2007, 10:32
I'm searching for this ELEKTOR info - but seems to be available only for members... Still looking for it.


I assume it will be better to use a MOSFET, no?

Hi, Roger

Here : http://www.elektor.fr/magazines/2001/novembre/alimentation-numerique-(1).65895.lynkx

a P mosfet will be easy to use ... a N Mosfet a bit harder ...

But there's some more investigation to do with your circuit before throwing it to the wastebox ...

Alain

Ioannis
- 3rd December 2007, 10:52
I repeat again that, your final design might look like a Linear Power Supply.

As such, a NPN pass transistor is the usual choice. The transistor acts like a voltage follower, so whatever voltage is present at the base, that voltage-0,7 is presented at the emitter, with current amplification of course.

Ioannis

Acetronics2
- 3rd December 2007, 12:44
Hi, Ioannis

just have a look to the NS Datasheet of the LM 350 page 10 ... there is a very simple Pb batt charger design ... easily usable with the 317 or 338 ( Paper datasheets included it in the 1982 Databook release ...).
fits the I - V charging method ... Roger looks for ...

But do not tell Roger ... he is a friend ...

Alain

Ioannis
- 3rd December 2007, 13:23
Hi Alain. Between us, yes there is a simple charger and many more everywhere!

But Roger is looking for something to be controlled by his darling PIC. So, I can understand him trying to emulate a pot with an electronic pot. But this is not going to work as he is expecting... But don't tell him either! He is a friend and might be hurt!

Ioannis

Acetronics2
- 3rd December 2007, 13:38
Hi, Ioannis

Let's be honest ... It CAN work ...

but it will ever be for his own pleasure ... and impossible to sell .

the BTI CCS 9620 SL is the living proof it can work ... It's a dedicated Pic !!! ( probably 16HV xxx )


Always the same : Amateur or pro ... solutions are not the same !!!

Alain

Ioannis
- 3rd December 2007, 13:52
I agree Alain. I usually think on terms of reliable commercial product, that is well in the middle of the specs.

It can work with little tricks and magic, but I won't trust it. Especially with the lead batteries!

On the other hand the idea of the linear power supply is so simple... And prooved reliable.

The Pic will only have to create the Vref and then a comparator will adjust the base voltage of the pass transistor. Thats it!

Ioannis

Acetronics2
- 3rd December 2007, 13:56
He,he

You just forgot the Battery tempco compensation ...

( -20 mv/ cell / deg C ... to be verified ! )

seriously ... a High end Lead Acid Charger is a piece of cake !!!

Alain

Ioannis
- 3rd December 2007, 14:06
Mmm, I really love to have one

piece of cake !!!

Seriously, yes it is. But not the way that Roger is doing it with that pot!

Ioannis

Acetronics2
- 3rd December 2007, 14:14
...

Little Roger will become taller ... if you let him grow ...

We all learnt a way or one other ...

Alain

flotulopex
- 3rd December 2007, 18:16
... but I love my digital pot so much... :( and my lovely PIC too...

Are you all afraid by "parallel alternative technology" where selfmade difficulties make your baby almost impossible to get born?

Well then, tomorow I'll get a power transistor, just to see how it looks like!

But I won't let you sleep until I get it to work either :D

NB: I don't give up my actual circuit anyway... but I put it on hold.

Acetronics2
- 3rd December 2007, 18:19
[QUOTE=flotulopex;47145

... but I put it on hold.[/QUOTE]

Ohhhhhhh .... noooooo !!!

Alain

Ioannis
- 4th December 2007, 08:54
Pssst! Alain, how will we ged rid of this Roger? May be tell him to connect the H of his pot to the +25Volts and wait for the "boom"?

Seriously, Roger, leave it. I know it hurts, but do it! You will find soon the true love!

Ioannis

Acetronics2
- 4th December 2007, 09:37
Weird idea this Zener Z1 so far...

But yeah i'll second the PWM idea.. maybe just remove the LM317 as well and use a Mosfet/Transistor instead and do everything in software. a 12F683 would be perfect for that.

1 current senses
1 voltage sense
1 PWM and
remaining pins for leds and maybe other safety inputs.

Hi,

I didn't remember it at first ... but the 317 can be used as a "switching transistor" for PWM !!! ... just do not use too high a PWM frequency and it will work rather pretty ...

YES ... the "off" state voltage will be 1.25 v ... but, here, no issue with that !!!

do not laugh ! ... I have the proof ... it was ... 18 years ago, for a model train controller !!!

Alain

Ioannis
- 4th December 2007, 10:15
Very nice! State-of-the-art design! PWM with 1,25 offset!

I'd like to have one! He, he.

By the way have a look at the LM2576T-ADJ chip that is a 3A switcher.

Very cheap and very easy! And adjustable too!

Ioannis

Acetronics2
- 4th December 2007, 12:29
Very nice! State-of-the-art design! PWM with 1,25 offset!


Ioannis


Hi,hi ...

no problem here ... due the batt !!! the BY 500 will be reverse polarized during 1.25v level ...so, no current flowing ...

CQFD !

I can mail you a copy of the scheme ... just ask !


Alain

Ioannis
- 4th December 2007, 12:51
I can mail you a copy of the scheme ... just ask !

Yeah, why not. Always collecting ideas!

Ioannis

Acetronics2
- 4th December 2007, 13:37
Yeah, why not. Always collecting ideas!

Ioannis

So, just have a look to LM317 datasheet ... NS gives 2 examples of 317 based switching regulators page 17 ...

some kind of humour ... isn't it ???

Alain

Ioannis
- 4th December 2007, 14:01
He,he. Alain, the great!

Ioannis

wbjunkie
- 14th December 2008, 00:12
BMW have actually made a charger using the PIC16F series PIC
Have posted a pic of the charger in the schematics section (sorry if I got the forum wrong)