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.

Friends, help to find out the bug of this charger

Status
Not open for further replies.
just now i've finished the assembly of it on the new pcb without the q4 part. it's 1:30 at night and i'll power it on in the next morning after a good sleep. I'll let you know...
 

Brian,
I dont know what exactly is happening...

I have developed several ckt using 317. all the same way... but right now it's getting HOT and nothing....

The most simple ckt for 317 (or 338 in high A) is the following (dont worry about values) for a fixed or variable voltage settings. But it is also not working. I tried with different bridge rectifiers and also used hand made bridge using 4 diodes just for sure... nothing.. all the same... even i have removed the 317 and also then again the bridge gets too hot (seems current passing). I checked the pcb for defect... but found nothing... not even soldering problems like tiny short... dont understand... what's happening to my life...:cry::cry::cry:

Mishu~
 

If as you say, the wiring is not at fault there can only be two other explanations. One is that there is an unseen short (not a solder joint) and the other is that you have instability.

Is the tab of the 317 screwed to anything and if it is, what?

If you have an oscilloscope, look at the output voltage and check it has no signal on it. If you do not have an oscilloscope, try placing an AM radio close to the wiring and switch on. You should expect a slight rise in background 'mush' because of the wiring acting as an antenna but if you hear buzzing or find strong signals that are only there when the power is on, you have an instability problem. I suspect this is also the cause of problems when the 338 is in use.

Can you attach a photograph of the unit so I can see the construction and wiring lengths.

Brian.
 

brian,
found some bug...

i first removed the q4 part. also no amp. then i took a connection from mega output pins for driving q1,2,3 and added 3 leds for visual indication of transistor driving. i then turned it on. the r1 again blown out. but i also discovered that there is high voltage in the input and base of the q1. i found that as per software, the q1 holds for a while then the q2 comes and when it detects no current flowing (since no load) it switches to q3 immidiately. meanwhile, when the q2 or q3 is working, the led of q1 is also lit but with low light. i suspect there is enough current and volt for driving q1 still then. but q2's led does not lit when q3 is on. there is no hidden shorts between the Qs, i'm sure. i put jumpers in the place of diodes for Qs. so i just cut off the jumper of q1 and it is working fine. no more r1 blow and everything is ok then. but the only trouble is whn i trim for the voltage, i can go down to 1v but max volt gets 11.7. I used 220 as r1 and for trim i used 10k multi turn trim pots. (all time i use it). but i should use either 5k pot of 680ohm instead of 220 as r1... both for 13.8 and 14.6 v gets max 11.7v which will be solved (theoritically it cames 50+v). and at the time of that 3 sec holdoff, it now became unavailavle. still no use of q4 for the time being.

ideas???

also giving you the pics in pdf file...

infact i am thinking to avoid the 3 sec if it is really impossible. that case i'll directly drive 14.6v and then after taking reading, it'll down to 13.8... but hold off is a good way for stabilizing...

Mishu~
 

same thing is happening after adding the 680ohm in the place of r1. max voltage is 11.7 to highest 12. but if i turn the pot, it works... imean the volt gets down and i have set it to 8v, 9v, etc.... but when i made the batt term part (not the batt term, but the final output) short, no current flow... terminal voltage = 0v shown but no current flown... but regulator and bridge got hot... seems working...

dont understand...
 

brian,
i was out of the city for these days again... i'll be in my work place next morning and i will then add a new 317 (since i am suspecting it may have gone...) with 680ohm as r1 and 10k pot. so max voltage will not cross the limit of 317's input-output differential. then i'll try to put a low resistance to check current pass. i am sure that the atmega can read milivolts as it was reading values form lm35. the whole thing is really becoming a pain and at the same time, interesting...

i used 10k before feeding to Qs. no diodes (the diodes are shorted with jumpers)

once i can switch between two different voltages using logic, then i'll think of the part of 3 sec hold off. can you just tell me one thing?? what would happen if say all of the Qs are off... means only R1 then all the fixed resistor / pots for voltage setting are disconnected... (All Qs off )
 

Sorry for not replying, my mother died yesterday and I have had to travel to arrange funeral etc. I will reply in full later, at the moment I am trying to use internet on mobile phone - not easy!
Brian.
 

Dear Brian,
That's very sad news... may she rest in peace in heaven... and i really can't find any word to express from my vocabulary... Please be patient and take time... i hope your best.... feel free to share if you have any thing to share (you are welcome to consider me as one of your junior friends who are closer ones...)

Sincerely,
Mishu~
 

betwixt said:
Sorry for not replying, my mother died yesterday and I have had to travel to arrange funeral etc. I will reply in full later, at the moment I am trying to use internet on mobile phone - not easy!
Brian.
I'm really sorry to hear that, I hope you are okay.
Wish you the best.
 

guys,
i finally made a prototype (since it was not working, i split up the job and did the very first psu...). The previous psu based on 317. with atmega based VA meter. For V, i am doing a voltage devider network (accordingly to the previous schematic) for scaling 20v to 5v and taking 10 adc readings with averaging them. For Current, i was doing the following...
Code:
[Batt - ]------|--[Shunt as .22Ω]------GND
               |
               |---[Atmega ADC]
but i'm a bit confused... should i use the following??
Code:
[Batt - ]------|--[Shunt as .22Ω]------GND
               |
               |--[1MΩ]---[Atmega ADC]
i mean from the shunt, should there be a 1M series resistor before feeding to mega?
i am also planning to add .1uF ceremic cap just to filter out the noise...

my code is the following...
take ADC reading.
multiply by 4.89 [resolution coefficient] (for 1A, .2V)
devide the result by 200 (since in ampere and .22ohm)
the result is now in A.

but code is not a factor at this moment before the ckt. so please advice in the 1MΩ in feeding...

Mishu~
 

Hi Mishu~

I'm still not back in action yet but I have been following messages on my mobile phone.

You should put some resistor in series with the ADC to protect it against over driving but 1MΩ is far too high. I do not have the data sheet with me but I would imagine the input current of the ADC would cause a significant drop in measured voltage.

If you are choosing 1MΩ so the capacitor provides better filtering, I suggest dropping the resistor value and increasing the capacitor value. Maybe 1KΩ and 47µF or something similar.

Brian.
 

Dear Brian,
last message was just a notice on the works on going... you take your time... i'm awaiting...

meanwhile, i'm still putting the latest news as it will help all who are reading this thread...

i put the 1MΩ and got a reading of about 1A. Well, the battery is a SLA of 7ah and it got from 12V to 13V after 24hrs. i've checked with a clamp meter at DC and AC (after the transformer) for current where the current is ofcourse less than 1A. Then i put a volt meter across the shunt .22Ω. The voltage was .035mV. So here are the math for me...

From general experience, I'm assuming that 1A gives 100mV in 0.1Ω. So for .22, it will give around 220mV. (not doing the fractions).
So after taking a measurement on the shunt using the volt meter, since i got .035V, thus my current is...

I=V/R = .035/.22 = 159mA.

if this is right, then i'm getting a result which is comletely wrong... (1.2 - 1.3A). So i need to lower the input feed resistance value (except the cap since cap i'm intended to use .1uF ceremic). say somewhere around 10k... i'll try with 10k will let you guys know...
 

guys,
is there any wrong in this schematic??? i dont think so... the relay is working according to the code. but i'm not sure about the rest.... constant 20volt... what ever the logic is....

i'm planning for a new schematic again... i'm getting frustated... what the bullshit is happening...

Mishu~

ps. the relay is taking .9w. thus i need a big amp 12v source for the releay... shit!!!
 

I made a dummy test using lm317 and the previous controller ckt with the last power ctk. I disconencted the PA0 (JP5-pin6) for Current measurement as it was faulty. means as there was no input resistor. then I turned the whole thing on and then found it is working. the way i wanted. but new trouble arised. few days back i tried with the same controller ctk where it worked for 48hrs continious. but now it cannot work due to overheating. it shuts down due to thermal of the regulator. the 7812 got too hot. it was providing power to the relay and 7805. so i just removed the 7805 from there and connected it directly after the bridge of the power board. just like 7812. now 7812 is cool enough but 7805 gets too hot as well as mega32. i dont know what actually is happening... i understood it was the thermal shout down of the 7805. but why it is getting too hot and also the mega32?? because few days back, it was working damn fine for 48hrs continious...

any ideas guys??

Added after 13 minutes:

even i now just turned the backlit off (disconnected) of the LCD and then also removed all the connections from and to the power board to the controller board. except the power in for 7805. then i turned it on and just within seconds, the 7805 got damn hot. the 7812 did not got so... and then i again let it cool. then connected the 7805 to the output of 7812 and turned on. same happened. 7805 and 7812 got hot. seems 7805 is transferring a serious high current. but how?? i mean i found no short anywhere in the controller ckt. and all the cables were removed... even the mega32 got hot also...

Added after 1 hours 8 minutes:

problems again... new one... yet the old one not solved...

as 7805 got heat, i did a manual for testing purpose... the relay worked as it should be. then also the 13.8v worked. then when i tried to calibrate 14.6v, it failed. it reached max 10.2v and then stopped. i'm planning to change the whole thing in different way... cost doesnt matter to me here... so i'm planning to use 2 relay. one for 3sec hold off, and another one for 13.8/14.6v selection... kind of toggle between 2. i'm making the pcb again. also making the corrected pcb for controller... then if it continious like the same, then i have to conclude that i have born with no luck at all...
 

hi guys,
i hve finally made the pcb for this schematic. hope this will work... if not, then i have some problem with my luck...
 

I still think you are over-complicating your schematic, the relays are not needed. Whatever the underlying problem is, has nothing to do with the electrical design, it must be something else.

As for the overheating 7805, you can reduce the load on it by powering the LCD backlight directly from the output of the bridge rectifier if you increase the series resistor value. There isn't really any need to regulate the backlight voltage as small changes will not be noticeable. Is there a capacitor directly between the 7805 input pin and it's ground pin? There should be one as close to the regulator as possible.

I have never used ATmega processors but I'm surprised it gets hot. My largest PIC projects use much more complex microprocessors and run at 48MHz but still stay cold.

I think I warned you about the low output voltage a while ago. The problem is that the resistor from the ADJ pin to ground (the variable ones) has a maximum value of 5K and using the formula for output voltage, it cannot reach high enough with that value. You can use a higher value variable resistor but that will make the adjustment more sensitive to the resistor setting. A better solution is to assume the variable is set half way (2.5KΩ) and work what the total value should be to give the voltage you want. Then subtract 2.5K from that value and use a fixed resistor of that value in series. In other words, make the combined value correct with the control half way, you then have some control each way to fine tune it.

A thought on the ATmega overheating - as I stated, I am not familiar with them so this is only an idea: What do you do with all the unconnected pins? If they are disconnected, is it possible they are floating inputs and causing random signals to be seen? Best design practice is to make them outputs and drive them all low or alternatively, make them all inputs and add pull-down resistors to each pin to keep them at a steady logic level. Making them outputs will save lots of resistors!

I am still partially out of action for the next week but I will keep looking in to see how you get on. Hopefully, after October 19 everything will be back to normal.

Brian.
 

Brian,
Thanks a lot for the reply...

as i said, i even turned the lcd backlit off (disconnected the power cable) and also removed all the cables those used to read values and send logic outputs. means the board was running free... but it got hot (both reg and uC). couple of days before, i used the same for a lm317 based psu with no logic but adc read. it was fine then...

the reg is now getting power after the bridge and then at output, there is a 10uF cap. means cap at output pin and gnd. the input is coming from after bridge where there is a 3x2200uF caps.

about control logic, the regulator is working beautiful with 13.8v. since 2 pots for 2 voltage. both are oky... but one is giving 13.8 after the setup. another one cannot do so... but i need two voltage...alternatively...

for the same reason i am now planning to make an approach with relay just for first holdoff and then alternate between pots. let's see...

about the controller board, it was okey few days back... but not okey...
 

about controller board, so far i think, it was malfuntioned due to no input resistance at adc0. there was no protection resistors. new design (revised) has been assembled and it is working so far ok...

now i am assembling the power board. only the regulator and 2 pots left. tomorrow i'll do it. then i believe it will be fine... will let you guys know...
 

Guys,
Good news for all... finally it is working. Except an around 30mA error in Current reading. (I used a DMM at shunt 0.1ohm and got 076mV where the ADC result showed 073mA. [it should be 076mA].) My bascom code for ADC is following...

Code:
For I = 1 To 10 Step 1                          'taking 10 readings
               Adc0 = Getadc(0)
               Adc1 = Getadc(1)
               Temp_iin = Adc0 * 4.89                       'adc * resolution = 5000mV [Note: at 3A, shunt voltage = 600mV]
               Temp_iin = Temp_iin / 100                    'scale at 0.1V. So Iin = 1A at 0.1V
               Iin = Temp_iin + Iin

               Temp_vin = Adc1 * 4.89                       'adc * resolution = 5000mV
               Temp_vin = Temp_vin / 1000                   'scale at 5v
               Temp_vin = Temp_vin * 4                      'scale up 5v to 20v
               Vin = Temp_vin + Vin
               Waitms 100
            Next I
Vin = Vin/10
Iin = Iin/10
except this tiny error, everything is fine... i'm attaching the schematic here. And I just have found that lm338 has the pinouts as.. 1->Adj. 2->Vin, 3->Vout. Though in the datasheet (and so in schematic) it is 2->Vout and 3->Vin. I just swapped them using a wire and it is okey. I dont know how it happened. I used 338 plastic 3pin package like 317. and though the datasheet says different, but it has the same pinout as 317. (atleast my one...). Now i need feedback guys...

Mishu~
 

Hi ~mishu.

I've been away for a while due to family problems but I'm back at home with a computer instead of using a mobile phone now so the internet is much easier to use!

The errors are probably due to three things:

1. real voltage errors because of tiny voltages dropped in the wiring. The actual measurement is between the ADC inputs and the ground pin of the ATmega. If any voltage is dropped between the sense resistor and the ATmega it will appear as a residual measurement, you will have to factor it into the equation.

2. You are using floating point math so why not use a more accurate conversion factor. Instead of 4.89 you could use 4.88758.

3. Full scale measurement is 5V, derived form the ATmega VCC pin, you will probably find it is not exactly 5V but close to it. 7805 regulators are not not made to very tight specification and it only has to be out by 0.005V to give an ADC error of one digit.

In a design I made a few years ago, I used two adjustments to ADC measurements to correct for the problems you are seeing, the code went something like:

Measurement = (ReadADC() + Offset) * ScaleFactor;

The Offset was to make a shorted input read zero and the ScaleFactor was to make full-scale reading accurate.

Was the reversed connections to the LM338 the reason for burning resistors ??

Brian.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top