| Author |
Message |
aq_mishu
Joined: 16 Jul 2007 Posts: 120
|
01 Sep 2009 20:51 Friends, help to find out the bug of this charger |
|
|
|
|
Guys,
I've added the schematic and bascom codes for the whole thing. Now I am a bit confused about the reset pin. also I am not sure about the fuse bits for this uC.
External crystal at 10mhz. and the whole thing is a 12v charger that will do 13.8v and 14.6v. the code is self explanatory. so help me to find the bug. I am getting nothing here... please...
Mishu~
|
|
| Back to top |
|
 |
wizpic
Joined: 23 May 2004 Posts: 380 Helped: 26
|
01 Sep 2009 21:17 charger at pb137 |
|
|
|
|
What is the scematic drawn in, Can't open it
upload jepg or pdf format
|
|
| Back to top |
|
 |
aq_mishu
Joined: 16 Jul 2007 Posts: 120
|
02 Sep 2009 0:49 pb137 battery charger circuit |
|
|
|
|
it was in target3001 program. anyway, i've given the pdf too...
|
|
| Back to top |
|
 |
aq_mishu
Joined: 16 Jul 2007 Posts: 120
|
02 Sep 2009 15:29 Re: Friends, help to find out the bug of this charger |
|
|
|
|
| guys, I need the reply... in a serious trouble...
|
|
| Back to top |
|
 |
betwixt
Joined: 04 Jul 2009 Posts: 386 Helped: 63 Location: Wales, UK
|
02 Sep 2009 19:29 Re: Friends, help to find out the bug of this charger |
|
|
|
|
What a mess!!!
It looks like a very badly designed power supply but it is so badly drawn it's difficult to tell.
Anyway, I would guess, not knowing any of the voltages, that nothing is coming out because there's no way of controlling Q3 bias current.
Brian.
|
|
| Back to top |
|
 |
wizpic
Joined: 23 May 2004 Posts: 380 Helped: 26
|
02 Sep 2009 20:05 Re: Friends, help to find out the bug of this charger |
|
|
|
|
I've had a quick look at the drawing and the code,
I think you need to go back to the drawing board, Like Brian siad the schematic is a mess it's hard to tell whaat is what, It's not the best way to do it the way your trying to control the LM317 and Q3.
Sorry to say your design would not work very good and I would not trust it with my batteries. I woudl use a PID or PWM routine to control the vlotage and the current, There are lots of thing that you have to think about with battery chargers, like current limit,voltage control tempitaure of the battery this all depends on what type of battery your trying to charge.
Have a look here
http://www.siliconchip.com.au/cms/A_103191/article.html This was also published in EPE you still can get the back issues. I found this very interesting reading and give lots of info.
Here some things that I woudl try first, Have you tried by just putting 5V on your 3 inputs this would manually control the charger the same way the AVR does, this then tells you if it's your hardware or your code. But do some more searching on battery charging
That's my 2 cents worth
|
|
| Back to top |
|
 |
aq_mishu
Joined: 16 Jul 2007 Posts: 120
|
03 Sep 2009 14:48 Re: Friends, help to find out the bug of this charger |
|
|
|
|
guys,
i know it is a complete mess. because i am using the CAD just for me... once I can finish the buildup, that's the end... anyway, let me explain a bit...
The goal is to charge a 12V 7A Lead Acid Batt of my bike in two stage... not 3 stage. One is with constant voltage (step 2 of 3 step..) at 14.6V. Once the current consumptions drops below 500mA, it will switch to 13.8V and keep floating.
The bridge will get around 16-20VAC 5-6A current. that will goto 12V and 5V rail also. Next is: lm338. It is a 5A voltage regulator. I'm setting two pot R3, R2 for this job. one will set the 14.6V and other will 13.8V. But inorder to get them work, the ckt must be full, means then must be connected to one at ADJ pin of 338 and other at GND. so I am planning to use the Mega32 to drive the transistor as a switch to turn on either one of the pots of the desired. Also i'm using the TIP2955 as a high current switch between the load and the source. So when the mega32 will turn on, it will wait for 3 sec (thus no voltage at load for 3sec after first power up) and then it'll bias the transistor for passing the current. [i'm not doing the current limitation here because 338 will already not allow more than 5A].
R4 is a .1ohm 5W current sensing shunt. it'll be connected to one of the adc of mega32 and thus i can get the current [High side is the adc voltage and low side is 0 since shunt's location]. so then i can decide for current pass and then i can decide on 14.6v or float. and the PA1 is nothing but to show me the batt terminal voltage. the resistor voltage devider used here is to scale down the voltage from 20V to 5V.
The JP5 is a jumper (basically a spst switch) for display mode. one detals mode, another just a battery charge progress symbol.
JP6 is for calibration. on turning on of any of the pin, it will go to calibration mode for 14.6 or 13.8v. basically cal mode is nothing but i hv to do it manually when the adc will get input and tell me how much voltage is at batt terminal.
that's all i am planning. I figured out that there are mistakes in avr i/o in my schematic. will solve them. but need suggestion.
ohh yes, i tried that article, it asks for $$ for access. anyway, i already have some literature on batt charging. Basically in 3 stage charging, const curr, cons volt and float. but i'm making it into two. for nothing, because it is only need once in a certain time after a long idle of my bike... i dont use it regularly and thus i get stucked with my self starter....
|
|
| Back to top |
|
 |
Google AdSense

|
03 Sep 2009 14:48 Ads |
|
|
|
|
|
|
| Back to top |
|
 |
FvM
Joined: 22 Jan 2008 Posts: 5154 Helped: 767 Location: Bochum, Germany
|
03 Sep 2009 17:03 Friends, help to find out the bug of this charger |
|
|
|
|
As said Q3 can't never turn on. In addition, to correct the Q3 control circuit, at least one more transistor is necessary to drive the switch from the processor logic level.
Regarding ATmega reset pin, it has an internal pull-up and may be left unconnected. It's however needed for the ISP interface, too. I think that you can find suitable reference circuits, from Atmel and others.
|
|
| Back to top |
|
 |
betwixt
Joined: 04 Jul 2009 Posts: 386 Helped: 63 Location: Wales, UK
|
03 Sep 2009 21:32 Re: Friends, help to find out the bug of this charger |
|
|
|
|
Also (sorry to compound the problem even more) - a fully discharged or short circuited battery could destroy the micro. I assume pin 40 is an analog input to sense the charging current but it has no protection whatsoever. At the very least, put a resistor in line with it and if your regulator is only rated at 5A, it might be an idea to put an amplifier in line too. At 5A you would get a maximum of 0.5V sense voltage and considerably less for a partially charged cell. Your ADC will only ever read a tiny number and its resolution will be very low.
What you are attempting do is fine, the implementation and use of technology is what's in question. You could make it simpler, cheaper and more versatile by using PWM for example.
Alternatively - look at an IC called a PB137 it is a lead-acid battery charger in a single 3 pin chip. It is rated at 1.5A but you can parallel them for more.
Brian.
|
|
| Back to top |
|
 |
aq_mishu
Joined: 16 Jul 2007 Posts: 120
|
04 Sep 2009 14:04 Friends, help to find out the bug of this charger |
|
|
|
|
To FVM:->
Can you describe a bit more on the Q3 matter?? infact with a sample schematic type... i cant actuarry get the point... (may be i'm in too hurry...)
And to betwixt:->
Thanks again... but first of all, in my country 9bangladesh) i dont get all parts. even a simple sensor ds18b20 and ds1307 comes very rare... so i am not sure wheahter i'll get that ic. but i'm reading the datasheet to come up new ideas... and ohhh.... again, about sensing, can i then shift the 0.1ohm resistor at the positive terminal and then take differential inputs using 2 adc??? also about amp, i tried to collect single chip instrumentation amplifiers, but again, not in the market... (personally, I hate this market). so can you give me a block diagram type suggestion on sensing with protection?? specially the amplification part.... because ref is 5v. so max input is 5v. and dafinitely i need better resolution. In sim i can work with it, but in practical i may not so i need amp. suggest on it... please...
And finally, thanks to you guys for attending here to help me out.... really thanks a lot.... (because i'm now really learning a LOT)
Added after 2 minutes:
To FVM again:->
I can ommit the T3 infact. but then i need to hold up the power to the battery for atleast 3 seconds before it goes to the battery after the power it gets... how can i do that??? can you suggest??
Added after 3 minutes:
note again to betwixt : ->
I have no idea on pwm and all i have found on the net, they are not for 5A rate... but in max 1A. and i found no way to make them upto 5A... you can still suggest me on that too....
guys, all i need is a 5A charger, automatic, intelligent. and opps, upgradable to any ampere (practical indeed, like 5 to 10 later on).
|
|
| Back to top |
|
 |
betwixt
Joined: 04 Jul 2009 Posts: 386 Helped: 63 Location: Wales, UK
|
04 Sep 2009 16:25 Re: Friends, help to find out the bug of this charger |
|
|
|
|
You can use high side current sensing (sense resistor in the supply side rather than ground) but it makes things more complicated because it has to be differential and the voltages may be rather high for comfort. It is better to use ground side sensing as you do at the moment. The amplifier can be just about any type that can give 5V swing at its output pin, the bandwidth, input leakage and gain are irrelevant in this application. Even the humble 741 op-amp would work.
PWM is a technique for converting the width of pulses into an analog voltage. You could use the voltage to give continuous control of your charging current. There is no limit to the current, commercially PWM is used at thousands of Amps, it all depends on the output circuit you choose. The idea is that your micro produces continuous pulses and a simple filter takes the average voltage from them. Narrow pulses have a longer 'off' and short 'on' so their average is low, wide pulses have short 'off' periods and long 'on' periods so their average is higher. It means you can use software to generate the pulses and produce any voltage from zero (no pulses) to VDD (always on) by simply changing the ratio of 'on' to 'off' in your code. You can use the resulting analog voltage to set your charge current.
I get my PB137 devices from Farnell in the UK but they have a distributor in Bangladesh:
Global Technologies
City Heart Building
13th Floor, Suite 7A
67 Nayapaltan
Dhaka 1000
Bangladesh
Tel: +88-02-8313075
Mobile: +88-0171592761
Email: globtech(at)intechworld.net
Hope this helps. Brian.
|
|
| Back to top |
|
 |
aq_mishu
Joined: 16 Jul 2007 Posts: 120
|
04 Sep 2009 20:53 Re: Friends, help to find out the bug of this charger |
|
|
|
|
hey betwixt,
thank u thanku thanku so so so sovery much for the complete address there...
anyway, the pb137 is for only 13.7v or such right???but what if for say bulk charge and then float charge??? then i have to stick with first 14.6v untill curr drops neat to around 500mA and then 13.8v as float. So may I stick to the older plan???
if, then here is my next plan, using 338 as a voltage regulator (as earlier, with 2 pots briven by mcu. one for 14.6v, and another for 13.8v). and for 2-3sec delay, i can use a relay straight instead of the Q3 there right?? and ohhh... finally about the curr sensing, I am planning to use the simple inverting amp with proper gain and then use a buffer for making the amplified output from negative to positive right??? then i simply can employ an mc1458 (since i need only 2 opamp). and finally to take inputs, like display control, calibration, i just can use switch/jumpers.... but in that case, modification in circuit needs with pullup resostors at the inputs right????
Thanks again for taking the pain for me....
Mishu~
|
|
| Back to top |
|
 |
betwixt
Joined: 04 Jul 2009 Posts: 386 Helped: 63 Location: Wales, UK
|
05 Sep 2009 0:02 Re: Friends, help to find out the bug of this charger |
|
|
|
|
The PB137 will adjust to the charge rate for lead acid batteries automatically.
I have drawn a hybrid of the LM338 regulator and your schematic, sorry it isn't very clear, as you can see it is hand drawn and photographed on my mobile phone! I did not have time to draw it properly. With the values I picked, it should give close to 15V with the lines from the ATMEGA at zero. Sending a logic high on either line will reduce the voltage according to the variable resistor setting. It is reverse voltage protected and it will automatically current limit at about 6A.
You do not need to invert the current sense voltage twice, use a non-inverting amplifier. You might need to use a negative supply rail so it can measure right down to zero, most op-amps have trouble when the input is close to ground and a single supply rail is used.
Brian.
edit after a good nights sleep - sorry it was late when I did the drawing:
The 2400 Ohms resistor should be where the wire directly below the 220 Ohm resistor is. The existing 2400 position should be shorted out.
|
|
| Back to top |
|
 |
aq_mishu
Joined: 16 Jul 2007 Posts: 120
|
05 Sep 2009 11:15 Re: Friends, help to find out the bug of this charger |
|
|
|
|
hey Brian,
Who said it is not clear?? I can see it damn clear even though i am wearing a -4.5D glass.
Anyway, Dafinitely so so so many thanks to you since you are working hard for me.... ummm let me first see and telling you more...
Added after 25 minutes:
Hellow Brian,
First of all, can you tell me the reason of the 0.1uF cap there??
Next, is it now okey?? I have changed the resistor and shorted the rest as per your advice (2400).
In 338 datasheet, i have seen a 10uF cap used between point A and B. Is it necessary here?? Also what is the reason for Q3???
And finally, For that 3 secong delay, can I just use a relay after the output but just before the + terminal of the battery??? instead of the previous TIP2955 (Q3in first drawing)??
Mishu~
|
|
| Back to top |
|
 |
betwixt
Joined: 04 Jul 2009 Posts: 386 Helped: 63 Location: Wales, UK
|
05 Sep 2009 23:09 Re: Friends, help to find out the bug of this charger |
|
|
|
|
-4.5D glass - I wish my eyes were as good as that! I can only focus to 10cm away without aid and I'm starting to walk into things as I get older!
The capacitor is 1uF not 0.1uF, it wasn't clear on my scribbled schematic. The reason for it is to keep the impedance across the output of the regulator low. Inside the 338 and most other regulators there is a high gain amplifier that compares the output voltage to an internal reference. The output of the amplifier controls the amount of current that can flow through the device, hence compensating for changes due to varying loads. Without it, there is a danger of the amplifier going unstable or oscillating.
Q3 does exactly the same as the other two transistors, it pulls the adjustment pin to a lower voltage to drop the voltage at the output pin. Instead of being controlled by the microprocessor, it gets turned on when its base/emitter voltage reaches about 0.6V. That voltage comes from the drop across the 0.1 Ohm sensing resistor so at about 6 Amps load, the transistor starts to conduct and lowers the output voltage to a safer level. Its a kind of extra current limiting circuit to protect against overload.
Instead of using a relay, consider using yet another transistor, connected like the two with variable resistors in their collectors but wired with its collector pin straight to the 338 'Adj' pin. it wont shut the supply off completely but it will drop the voltage to about 1.5V which should make it safe. the two diodes will protect the regulator circuit from being driven 'backwards' by the battery.
You can of course use a relay if that's what you want to do. Power it from the voltage from the bridge rectifier and switch it with another transistor to ground. Put a 4700 Ohm resistor n line with its base and drive it from the microprocessor. You will need to add a diode (1N4001 etc.) across the relay coil with the cathode end to the supply, anode end to the transistor. This will absorb the back voltage kick as the coil switches off.
Blind Brian
|
|
| Back to top |
|
 |
aq_mishu
Joined: 16 Jul 2007 Posts: 120
|
06 Sep 2009 0:14 Friends, help to find out the bug of this charger |
|
|
|
|
| betwixt wrote: |
You can of course use a relay if that's what you want to do. Power it from the voltage from the bridge rectifier and switch it with another transistor to ground. Put a 4700 Ohm resistor n line with its base and drive it from the microprocessor. You will need to add a diode (1N4001 etc.) across the relay coil with the cathode end to the supply, anode end to the transistor. This will absorb the back voltage kick as the coil switches off.
|
There i was intend to use the relay....
Well, so again for sure...
The ckt will ctrl the output current to max 6A to min some mA right??and the Q3 is for that...
Well, so after the correction as you said, (relocating the 2400ohms), it is okey?? I mean did i redraw it properly now?? And about the 10uF cap between A-B (As told in datasheet)???it is required or i just can ommit it?
If I fail to get a 2400ohm, can I go with 2200?? And so for controlling 2 of the voltages as I said, i will bias the Q1,2 by ATMEL right??
Mishu~
Added after 2 minutes:
oppps, about relay, you were telling that so finally i can use total 3 pots for 3 diff voltage... one 14.6, 13.8 and 1.5 right??? or alternate is to use a relay as i told...
Added after 11 minutes:
hey, about the part of q3,
as per datasheet of 338, it says that
Vout = 1.25(1+R2/R1) and thus with the use of 2400, what happens??? can you please check this schematic I attached again for the location of 2400ohm?? and when .6v makes the Q3 conducts, then actually what happens?? I mean how it actually controls the current not flowing over 6A??? or it is shutting down when it sense I=6A??? If shuts down, then for a empty batt, i think it will never start... because hungry batt will try to eat even 10A. but if it limits the curr out, then fantastic. Whatever your hunger is, you have to eat that I feed...
Added after 20 seconds:
hey, about the part of q3,
as per datasheet of 338, it says that
Vout = 1.25(1+R2/R1) and thus with the use of 2400, what happens??? can you please check this schematic I attached again for the location of 2400ohm?? and when .6v makes the Q3 conducts, then actually what happens?? I mean how it actually controls the current not flowing over 6A??? or it is shutting down when it sense I=6A??? If shuts down, then for a empty batt, i think it will never start... because hungry batt will try to eat even 10A. but if it limits the curr out, then fantastic. Whatever your hunger is, you have to eat that I feed...
Added after 34 minutes:
opps.... agiain.... (Lots of questions.... huh...)
Can I also limit the current by using a Limiting resistor (around 5ohms, 5W) for limiting it to 5A??? just to know... (as i said, learning.... that never ends)
|
|
| Back to top |
|
 |
betwixt
Joined: 04 Jul 2009 Posts: 386 Helped: 63 Location: Wales, UK
|
06 Sep 2009 14:25 Re: Friends, help to find out the bug of this charger |
|
|
|
|
That's a lot of questions !
Firstly, your new schematic is correct.
The extra capacitor from points A to B is probably not necessary but it will do no harm if you add one of say 10uF. If you make the value too big it will make the regulator slower to react as the load changes although in the case of a battery charger this probably isn't critical anyway.
The relay can be used if you need to completely isolate the charger from the battery.
The point about adding another transistor across Q1 and Q2 is that if you make it fully conduct, the 338 adjust pin will go to ground and it will only produce 1.5V output. If that is satisfactory, it makes a simpler and cheaper way of 'almost' turning it off than using the relay method.
Q3 actually limits the current to 6A. It does nothing until 6A load is reached then as Q3 starts to conduct it reduces the output voltage to maintain 6A into the battery. It changes the circuit from constant voltage to constant current to prevent the battery and charger overloading.
The formula, as you stated for setting the 338 output voltage is,
Vout = 1.25(1+R2/R1)
R2 is the 2400 resistor and R1 is the 220 resistor so the maximum voltage will be 1.25 *(1+(2400/220)) or 14.88V, this is a suitable maximum for charging a 12V battery, remember that as you drive Q1 and/or Q2 you reduce the voltage to a level set by the variable resistor (think of the variable being in parallel with the 2400 Ohm resistor).
If you change it to 2200 Ohms, the maximum voltage will be 1.25*(1+(2200/220)) which only gives 13.75V which may be too low. You could compensate for using 2200 Ohms by changing the 220 Ohm resistor to 180 Ohms which would give a maximum of 16.53V It is really up to you to decide the highest voltage you are likely to need. The variable resistors will let you drop it to whatever you want but the two fixed resistors will set the maximum.
You can use the outputs of the microprocessor to directly switch Q1 and Q2 on or off. Their emitters are tied to ground so if you inject current from the micro into the base the transistors will effectively become short circuits and let you set the voltage with the VRs.
Incidentally, that was one of the problems with your original design. There was no way of providing the base-emitter voltage to turn the output transistor on.
Brian.
|
|
| Back to top |
|
 |
aq_mishu
Joined: 16 Jul 2007 Posts: 120
|
07 Sep 2009 0:23 Re: Friends, help to find out the bug of this charger |
|
|
|
|
Dear Brian,
Thanks a LOT.... just thanks a LOT....
Well, I'm kinda sick today...(nothing, just a little break in my regular food chain and it happens all the time... need 48hrs in total...)
I'll let you know detail in it after that... meanwhile, i'm planning to use using another Q for making 1.5V for the 3sec holdoff... because isolation is not necessary, just a little hold off... already since I have used diodes there for reverse polarity protection, so i dont care about that.
And well, that sounds cool of hearing constant current.... But sir, I again have a little question (question question question...)... Say, I'm using Q1 for 14.6v. it's working... and then the Q3 also strated working, then 2.4k will get the path from below of 220 through the base of Q3 to ground... right???
either way, when already q1 is working, then again q3 also starts working, then the pot for Q1 and the 2400 will become parallel right?? then???
Added after 49 minutes:
sorry, as i forgot to UL the pic
|
|
| Back to top |
|
 |
aq_mishu
Joined: 16 Jul 2007 Posts: 120
|
08 Sep 2009 7:58 Re: Friends, help to find out the bug of this charger |
|
|
|
|
Dear Brian,
There is a little ammendment... I just got the battery today that is 6.5AH and I'm planning to use it with the batteries of 7AH max. Thus i have to limit the current more... say within 3A. So need to make bit change... what you think?? adding a series resistor (5W) as current limiting resistor??
Mishu~
|
|
| Back to top |
|
 |
pauloynski
Joined: 06 Oct 2004 Posts: 277 Helped: 34 Location: Brazil
|
08 Sep 2009 8:21 Re: Friends, help to find out the bug of this charger |
|
|
|
|
| The 0,1Ω resistor limits the output current. Limitting happens when the voltage on this resistor reaches about 0.6V (when it equals the Vbe of Q3). To limit the current to 3A replace the 0.1Ω resistor by a 0.2Ω one. The equation is: Ilim = Vbe/Rlim or Rlim = 0.6/Ilim. This also means that at full output youŽll have the same voltage sent to the ATmega(0.6V), irrespective of the current you choose.
|
|
| Back to top |
|
 |
betwixt
Joined: 04 Jul 2009 Posts: 386 Helped: 63 Location: Wales, UK
|
08 Sep 2009 14:30 Re: Friends, help to find out the bug of this charger |
|
|
|
|
It's nice to see someone else with schematics on paper all over the desk - it stops me feeling I'm the most untidy person in the World
I think the point you are making is that the current changes path depending on it being in current limit or under microprocessor control. That isn't exactly true but you are on the right lines. The thing to remember is the 338 is an adjustable regulator and the output voltage it produces is set by the voltage on the 'Adj' pin.
Now imagine Q1, Q2 and Q3 do not exist, the only components to set the output voltage are the resistors. The 0.1 Ohm resistor is so small it plays almost no part in setting the voltage so ignore it, the other two resistors are a potential divider, they DO set the output voltage. The purpose of the transistors is to lower the voltage on the 'Adj' pin so the output voltage also decreases, so if all transistors are NOT conducting, only the resistors set the output. For this reason, the resistors are chosen to produce a voltage just a little higher than you actually need.
If Q1 or Q2 conduct, their collector voltages will drop to almost zero and the variable resistors will be in parallel with the 2.4K resistor, reducing it's effective value and dropping the 'Adj' voltage and hence the output voltage. You have control of Q1 and Q2 as they are switched on or off by the microprocessor.
Q3 does exactly the same as Q1 and Q2, it drops the 'Adj' pin voltage if it conducts. The difference is that something else switches it on. That something is the voltage dropped across the 0.1 Ohm resistor. Remember that the transistor will not start to conduct until the voltage between its base and emitter pins reaches about 0.6V and that those pins are connected across the 0.1 Ohm resistor. This means that at 6A, the voltage across the resistor will be 0.6V and the transistor will conduct and pull the output voltage down. It reaches an equilibrium when the reduced voltage, and therefore reduced output current, starts to turn the transistor off again.
To reduce the current at which it starts to limit, Q3 has to conduct sooner so to make it limit at say 3A, the 0.1 Ohm resistor has to be made larger as Pauloynski
explains.
Brian.
|
|
| Back to top |
|
 |
aq_mishu
Joined: 16 Jul 2007 Posts: 120
|
08 Sep 2009 16:32 Re: Friends, help to find out the bug of this charger |
|
|
|
|
Hey Brian,
So i'm finalyzing the ckt with the last drawing (Scenerio 1) and just replacing the 0.1Ω with 0.2Ω right??
and then for 3A current, the voltage drop will be .6V right?? And ofcourse still I need an amp to amplify it before feeding it to uC. so for amp purpose, the amp should be not x10 since .6x10 = 6 >>higher than ref. it should be somewhere like x5 or so.... (if i do so...) is it okey then???
[guys, if the whole charger matter finally works well, i have more things to do...]
|
|
| Back to top |
|
 |
betwixt
Joined: 04 Jul 2009 Posts: 386 Helped: 63 Location: Wales, UK
|
08 Sep 2009 17:23 Re: Friends, help to find out the bug of this charger |
|
|
|
|
Correct.
The amp would need a gain of 8.33 to give 5V out for 0.6V in, but use a slightly lower gain as the 0.6V is only approximate, it depends on the exact characteristics of Q3 and the resistor value tolerance. If you use a lower gain (about 7 would be my choice) it will ensure you don't hit the top ADC limit if the current is a little higher than expected.
If you use a gain of 7, it will full-scale at 0.715V across 0.2 Ohms which corresponds with output current of 3.57 Amps.
Brian.
|
|
| Back to top |
|
 |
aq_mishu
Joined: 16 Jul 2007 Posts: 120
|
09 Sep 2009 3:55 Re: Friends, help to find out the bug of this charger |
|
|
|
|
hey guys,
thanks a lot for all you have done for me... i'll start working on it and will let you know...
|
|
| Back to top |
|
 |
aq_mishu
Joined: 16 Jul 2007 Posts: 120
|
10 Sep 2009 2:06 Re: Friends, help to find out the bug of this charger |
|
|
|
|
Dear Sirs,
As i already have started to work on the hardware, can you tell me one thing??? I'm getting confused each and every time...
I wanna use ATMega32. (It's Big enough and actually mega 8 ok... but...)
I want to use the ISP for programming. So The RESET pin will be used for that job. But at the same time, I want a hardware reset using that RESET pin. So What should I do?? Pull-up of 47k and then switch to GND or bla bla bla... can you again give me a tiny schematic (hand drawn is okey as previous) that will do both normal execution, RESET on normal execution and ISP???
Mishu~
|
|
| Back to top |
|
 |
betwixt
Joined: 04 Jul 2009 Posts: 386 Helped: 63 Location: Wales, UK
|
10 Sep 2009 10:21 Re: Friends, help to find out the bug of this charger |
|
|
|
|
All you have to do is ensure the programming voltage does not get back to the supply rails. I do not use Atmel processors but PIC devices have the same problem. Your simplest solution is to use a diode somewhere between the supply and reset pin to block the higher voltage. Usually, a single diode voltage drop will still satisfy the devices reset voltage limits.
What are you using at the moment to reset the ATmega32 ?
Brian.
|
|
| Back to top |
|
 |
aq_mishu
Joined: 16 Jul 2007 Posts: 120
|
11 Sep 2009 8:04 Re: Friends, help to find out the bug of this charger |
|
|
|
|
hey,
Right now I'm putting it unconnected and keeping a pin/jumper for iSP. but in many schematics, sites, I have seen that it is some kind of...
| Code: |
|-----------------ISP
|
Vcc<----[10k-47kpull-up]----|------[mega Reset PIN]
|
\
|-----[GND]
|
but i'm not sure... because at high voltage in RESET pin, atmel goes in to programming mode. the pullup here is just limiting the current and nothing else... the switch takes it low. but i'm not actually sure...
Currently I just down the vcc and then powe it up again....
Added after 5 hours 33 minutes:
Dear Brian,
Can you tell me what these connectors are called??? I have to add it in my CAD and i'm planning to use connectors for main ckt and uC part to reduce complexity in building the ckt. I use target 3001 for CAD with LPKF CNC for PCB.
Mishu~
|
|
| Back to top |
|
 |
betwixt
Joined: 04 Jul 2009 Posts: 386 Helped: 63 Location: Wales, UK
|
11 Sep 2009 9:13 Re: Friends, help to find out the bug of this charger |
|
|
|
|
The resistor is to isolate the programming voltage from the supply rail. The idea is that the reset pin draws almost no current in normal operation so even 47K can pull the pin right up to the supply voltage. When programming the ATmega you put a higher voltage on the reset pin, supplied from your programming device, but although some current will leak through the resistor, the power line will not rise enough to do any damage elsewhere.
The only thing you need to be careful of is connecting a capacitor from the reset pin to ground. Normally you would add a capacitor so the reset pin rises slower than the supply when you turn the power on. While the processor is running but the reset pin voltage is still climbing, the ATmega will stay in reset mode. This is usually a good idea because it allows the clocks and internal signals time to stabilize before your software starts up. The downside is that the capacitor is also across your programming voltage. I'm not sure if the ATmega just has the voltage placed on the pin or if it carries programming data as well but be aware that the capacitor can have an effect.
The pins have several names but the one I hear most often is "Moles pins" because Molex is a company that makes them. I think the real name is probably 2.54mm PCB headers and shells. They are made in many lengths, straight, right angled and surface mount varieties.
The full information in them is at this web site:
www.molex.com click on 'connectors' then 'wire to board'.
Note that you need a special crimping tool to attach wires to the socket (the plastic shell), I have seen MANY disasters caused by people using pliers or soldering the wires to the terminals.
Brian.
|
|
| Back to top |
|
 |
teodor
Joined: 28 Jul 2007 Posts: 7 Helped: 1
|
11 Sep 2009 18:44 Re: Friends, help to find out the bug of this charger |
|
|
|
|
| betwixt wrote: |
Note that you need a special crimping tool to attach wires to the socket (the plastic shell), I have seen MANY disasters caused by people using pliers or soldering the wires to the terminals.
|
Please ,can you clarify why soldering is a bad practise? From my practice I can conclude that exactly soldering is the most reliable method. We used to crimp the terminals in the past /automated machine crimping/, but now we solder them. Why? We had quite a lot failed connectors due to oxidized copper core /in view of the fact that connectors aren't sealed/ , resulting in higher contact resistance at the crimped junction -> heat -> accelerated oxidizing -> failure. And this is at normal environmental operating conditions, current lower a few times than specified for the connector,after a period of 2-3 years. Since we started using soldering ,problem disappeared. Although it's a tedious,expensive and time consuming task, for thousands of connectors, done by hand, we do not consider going back to crimping.
Best Regards, Teodor
|
|
| Back to top |
|
 |
betwixt
Joined: 04 Jul 2009 Posts: 386 Helped: 63 Location: Wales, UK
|
11 Sep 2009 22:23 Re: Friends, help to find out the bug of this charger |
|
|
|
|
I have had exactly the opposite experience. Soldering gives higher resistance joints than crimping and the heat reduces the springiness of the contact. It also makes a weak spot where the solder wicks up between the wire strands, this is important if the wires will be flexed.
Even if the contacts are soldered, you still have to fold the crimp 'wings' down or it won't fit in the shell.
If you had failures due to oxidization, it would imply your crimps were not folded properly. When fully folded on to the wire it should form a metal to metal compression point which should not let contaminants in to cause problems. I have had experience with tens of thousands of these connectors over many years and I have never seen a single failure of a *properly* fitted crimp. I have seen many failures of wrongly fitted ones, including one that were soldered.
Brian.
|
|
| Back to top |
|
 |