Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

buck converter

Status
Not open for further replies.
Thank you.

I didn't study that circuit in great detail, but my quick look at it says that it monitors the battery voltage and charges when the voltage is in the specified range. Comparitors are comparing the voltage to threshold set points. If the battery is out of range, the charging is shut off and the dummy load is switched in by the relay.

Let's forget that circuit because I have started to understand your point. I intend to use 6 V lead acid battery (will try to use a sealed one). This is the charging profile of lead acid battery; 12 V battery consist of 6 cells. This **broken link removed** might also be helpful (https://imagizer.imageshack.com/img921/1062/0p2BD3.jpg). For a 12 V lead acid battery these points should be considered:
  • Constant current until the battery reaches 14.2V
  • Constant voltage at 14.2V until charge current falls below a set threshold.
  • Float the battery at 13.4-13.8V indefinitely.
I believe that I see where I was getting confused. I was under the impression that once a 12 V lead acid battery enters stage 2 then it will regulate its voltage and current on its own. But we need to limit the current flowing into the battery in such a manner so that its voltage, on average, doesn't rise above 14.2 V. If the amount of current flowing into the battery is kept constant, as is the case for stage 1, then the battery will get damaged and might explode. Do I have it right now?

You might use a 18 V solar cell and drive a 5 volt charger, and you might put a 10 V capacitor on the output. In that case, "capacitor may go boom!".

Please have a look on this figure so that you can know how I view the system. Perhaps, you are saying that if a 18 V solar panel is used then it Vmp will lie around, say, 15 V. If the output voltage of the converter is designed to be 5 volt and capacitor Cout is rated at 10 volt then Cout is definitely going to explode because the tracker won't stop pushing more and more current into the converter until its voltage has risen up to 15 V. Do I have it right?

5. You limit it. With lead-acid, on stage 2 (commonly called absorption) you limit it at 2.45V/cell (vary slightly by the mnifacturer). But, when you enter stage 3 (float) you drop the voltage to 2.2V/cell or so. This will produce nearly no current into the battery. You effectively disconnect the battery, but it is still connected. If you have any loads connected (such as your demonstration loads) they continue to get power from your solar panel while battery is mostly unaffected. It is much more difficult with li-ion.

Okay. In stage 2 the cell voltage is 2.45 voltand in stage 3 it's 2.2 volt. It means when the battery enters stage 3, we know 'exract' some energy out of it by connecting some load so that its voltage gets lowered. Obviously, its voltage won't get lowered on its own ignoring the self-discharge.

Best regards
PG

Useful links:
1: https://blog.thelifeofkenneth.com/2013/01/555-constant-current-lead-acid-battery.html
2: **broken link removed**
3: **broken link removed**
4: https://www.eleccircuit.com/auto-battery-charger-by-lm324/
 
Last edited:
It means when the battery enters stage 3, we know 'exract' some energy out of it by connecting some load so that its voltage gets lowered. Obviously, its voltage won't get lowered on its own ignoring the self-discharge.

Yes, it will. When you stop charging, the voltage will start dropping, fast at first, then slower until it gets to about 2.1. Of course, it'll happen a lot sooner if there's a load attached. Typically when you enter float, you would need to change your duty cycle to 0 letting the panel to go to Voc. When the voltage gets to 2.2 you will start operating to maintain it.

You do not really need Cout unless you want to run tests without battery. Cout poses some problems too, such as in-rush current and sparks when battery is connected to it, but probably not at your scale.
 
PG,

The great number of questions and the slow time it is taking you to agree with and get on board with some of these answers is making it obvious to me that you need to do something before you proceed. You need to analyze the buck converter with differential equations and come to an understanding of how it works with switching and transients. You can even solve the resulting equations because the system can be written as a linear approximation. Also, read up on existing descriptions of the circuit using average value arguments. If you don't understand the circuit you can't make any progress.

Anyway, I have no problem answering any number of questions you put forth as best as I can, but I just say this for you to consider a path that might make your work more efficient.

OK, on to these questions.

Let's forget that circuit because I have started to understand your point. I intend to use 6 V lead acid battery (will try to use a sealed one). This is the charging profile of lead acid battery; 12 V battery consist of 6 cells. This **broken link removed** might also be helpful. For a 12 V lead acid battery these points should be considered:
  • Constant current until the battery reaches 14.2V
  • Constant voltage at 14.2V until charge current falls below a set threshold.
  • Float the battery at 13.4-13.8V indefinitely.
I believe that I see where I was getting confused. I was under the impression that once a 12 V lead acid battery enters stage 2 then it will regulate its voltage and current on its own. But we need to limit the current flowing into the battery in such a manner so that its voltage, on average, doesn't rise above 14.2 V. If the amount of current flowing into the battery is kept constant, as is the case for stage 1, then the battery will get damaged and might explode. Do I have it right now?
OK good, you are making progress in understanding and also homing in on your actual design.

Basically you have it correct. However, the constant current region is a region where you have more flexibility. I would not describe that as a constant current region, myself. I would prefer to say that is a region where you have a current limit, which is constant. Many chargers based on solar power can't or do not keep the current constant, but they are still designed to operate safely. As I said before, if you try to demand constant current on the battery charge, you can't do MPPT. The two constraints are not compatible. If you don't understand why, you need to look at the equations and come to grips with it.


Please have a look on this figure so that you can know how I view the system. Perhaps, you are saying that if a 18 V solar panel is used then it Vmp will lie around, say, 15 V. If the output voltage of the converter is designed to be 5 volt and capacitor Cout is rated at 10 volt then Cout is definitely going to explode because the tracker won't stop pushing more and more current into the converter until its voltage has risen up to 15 V. Do I have it right?
No, you don't have it right at all. This is an example of how not understanding the buck converter is slowing you down considerably.

The 18V and 15 V on the input side has nothing to do with the output capacitor voltage, except that it tells you what the maximum possible voltage is on the output side. A buck converter must buck and can't create a voltage greater than the input. However, a boost circuit would allow the output to go much higher than the input.

The problem on the output is that whatever power goes in will essentially go into the battery (with an efficiency factor of course). If you just keep pushing power in and out, the energy in the cap or battery will keep going up, unless there is a load that drains energy at an even faster rate. If unchecked, the output voltage could keep going to the 15V and even up to the 18V, but your battery would not like that, and if a separate charger is used, the input voltage requirement of that charger might be less than 15 V.


Okay. In stage 2 the cell voltage is 2.45 voltand in stage 3 it's 2.2 volt. It means when the battery enters stage 3, we know 'exract' some energy out of it by connecting some load so that its voltage gets lowered. Obviously, its voltage won't get lowered on its own ignoring the self-discharge.
Loading does help discharging, but you also need to control the system and have the ability to prevent too much energy/current/voltage on the battery at all times (stage 1, 2 or 3).
 
Thank you very much, NG, Steve.

The great number of questions and the slow time it is taking you to agree with and get on board with some of these answers is making it obvious to me that you need to do something before you proceed. You need to analyze the buck converter with differential equations and come to an understanding of how it works with switching and transients. You can even solve the resulting equations because the system can be written as a linear approximation. Also, read up on existing descriptions of the circuit using average value arguments. If you don't understand the circuit you can't make any progress.

I totally agree with you and actually I had already realized it and the sole purpose of creating this thread was to understand the buck. But then I decided to postpone the discussion because I was already doing different things and I didn't even grasp the intuitive explanation of mppt. But now I feel I have progressed somewhat. Understanding the buck is my next aim.

By the way, this is what I want to design. I will use P&O algorithm, 6V sealed lead acid battery, 12V solar panel with power of 20W, resistive current sensor IC (not hall effect one), IC based voltage sensor, microcontroller with built-in ADCs and PWM (preferably PIC), MOSFET, buck converter. I don't know what frequencies I will be using for ADC and PWM. But it looks like I have found a code which can help me. Please give it a look and it can help to decide which frequencies should be used.

I need to give this discussion a break for the next two days because I have an exam soon and need to prepare for that. I'm very grateful to both of you for your guidance, and above all your patience!

With best wishes
PG
 
But it looks like I have found a code which can help me.

I think every design is unique and calls for a unique code. Even if you can find other people's code that you could use, I believe it's a very bad idea to copy somebody's else's code. Here's why:

If the code happens to work as you expected, your project is done, but you really haven't learned much.

If the code doesn't work, you spend more time fixing it compared to the time you would spend writing your own. And you still haven't learnt how to write code.

Write your own code, post it on the Internet and let other people copy it.
 
Thank you, NG.

Unfortunately, I don't have enough time to learn everything from scratch. But I can safely say that one thing that I always try to learn every bit. I can use that code as a guide, try to learn every line of it.

Regards
PG
 
By the way, this is what I want to design. I will use P&O algorithm, 6V sealed lead acid battery, 12V solar panel with power of 20W, resistive current sensor IC (not hall effect one), IC based voltage sensor, microcontroller with built-in ADCs and PWM (preferably PIC), MOSFET, buck converter. I don't know what frequencies I will be using for ADC and PWM. But it looks like I have found a code which can help me. Please give it a look and it can help to decide which frequencies should be used.
This is all sounding pretty good to me. I would think PWM frequencies in the 10-100 kHz range would be adequate. The tradeoffs are (i) coil size, in that higher frequency equates to smaller coils and (ii) losses/layout issues which become a problem as frequency goes up. There is probably a wide range that will work and a lot will depend on your processor, the clock frequency of the processor and the PWM capabilities of the chip you choose.

By the way, on the code issue, I agree with Northguy that you should write your own code, but by all means use other code as a guide, if it is available. Personally, I alway find doing my own stuff much easier than trying to figure out other people's stuff. But still, I like to look at other people's stuff to get the concepts and important issues identified.
 
Hello there,

That buck circuit is made using an LM2596 Simple Switcher chip, in the SMD package.

First point, the board surface area is not enough to allow the full 3 amps output continuously. If you intend to use it as 1 amp it's ok, maybe 2 amps, but not 3 amps as it could easily overheat. Adding more heat sink area would be possible but difficult and may not be enough anyway because the mounting scheme would be questionable. Alternately replace the whole chip with the TO220 package and use your own heat sink.

Second, these buck converters use a resistive feedback which is a resistive voltage divider made from a pot and a resistor. The resistor connects from the Feedback pin to ground, and the pot connects from the output to the Feedback pin (usually). As you decrease the pot value by turning the screw, the output voltage goes down. But similarly if you could decrease the resistor (rather than the pot) the output voltage would go up. This means the output voltage is controllable via a change of resistance or alternately stealing current from the current sourced by the pot. If we decrease the pot current we decrease the current getting to the lower resistor and thus the voltage drop is less, and that means less feedback voltage and thus the output voltage goes up to keep the current constant.
So a means to regulate the output with an external source might be to use an NPN transistor with collector to the FB pin and emitter to ground, and drive the base with a varying current level that sets the conduction of the transistor from low to high. This will most likely involve feedback from the output as well, so the base current can be adjusted as needed. So the idea then is measure the output and adjust the current, then repeat.

To get the base current from the uC chip PWM, you would use a resistor and capacitor as a low pass filter, followed by a resistor from that to the base. Try to get a nice smooth voltage from the filter.

I've never done it this way but i have done it using a PNP transistor in the feedback path to regulate current. It works very nicely.
If it did turn out that you had to use a PNP in the output then we'd have to do it a little differently.

If you take a look at the LM2596 chip data sheet you'll see it is a simple chip really, and the circuits made from it are simple too.

If you are worried about using a transistor in this way you should be able to use a digital pot. That way you could control it with pulses from the uC chip.
 
Hi

You can see here that in Figure 1, the output voltage is 10V and the system will operate normally. Now look at Figure 2 in which the load has been removed. I think that the capacitor will explode after some time if it can't handle 20V. Do I have it correct? Please let me know. Thanks.

Regards
PG
 

Attachments

  • buck1.jpg
    buck1.jpg
    37.1 KB · Views: 712
Hi,

That sounds reasonable. We could also look at what happens when the switching frequency happens to be the same as the LC resonant frequency, but that's not typical of a buck circuit

Some buck circuits can cut way back however, and that means it would not be a 50 percent duty cycle anymore so the voltage could lower due to leakage in the cap and very very low duty cycle. That's with feedback of course which your circuit does not yet have.
 
Hi

Could you please help me with the queries below?

Q1: What should be value of voltage across the capacitor in Figure 2? -9.8V or -20V?

Q2: I'm assuming that the voltage across the capacitor is -20V. Being at -20V potential means that the upper plate of the capacitor is at lower potential than its lower plated which is at ground. In such a case, wouldn't the upper plate of capacitor 'sucking' current out of lower plate which is at higher potential? Thank you.

Regards
PG
 

Attachments

  • buck_c_volt.jpg
    buck_c_volt.jpg
    50.9 KB · Views: 719
Last edited:
Q1: Neither one! Voltage on a capacitor can't change instantaneously. If it is +9.8V on the left, the it will be +9.8 volts on the right.

Q2: Why did you think it would change to a different magnitude instantaneously, and why did you think the polarity would change to negative voltage after the switch is closed, again instantaneously?

There is no such thing as one plate sucking current out of the other. Charge is displaced from one plate to the other. The current is continuous in the wire connecting the plates.

The coil current can't change instantaneously either, so that current that was flowing before is also flowing after.
 
Thank you.

Sorry. That was really dumb!:banghead: But you will see that in many diagrams the voltage across the capacitor is given "-" symbol? It's +9.8V and with reference to the ground it's still positive voltage then why negative symbol?

I don't really get why the waveform for I_Cin is drawn the way it is. I'm confused about the waveform during the period when switch is off. It shows that constant negative current is flowing for the "off" duration. Thanks.

Regards
PG
 

Attachments

  • buck_waveform.jpg
    buck_waveform.jpg
    81.8 KB · Views: 741
Last edited:
Hi,

If you have another question where the capacitor voltage is marked as negative when you think it should not be, then you'll need to post that diagram.

Icin is drawn pretty much the way it is, as long as we assume that the source Vin has some built in internal resistance as usual for real life voltage sources. If Vin had no such Rs, then there would be no current into or out of Cin except during turn on and that would be a huge infinite current, so we assume some Rs for Vin.

As the switch turns on, some current starts to flow through the switch and it gets some of that current from Cin because Vin dips down slightly due to the load current. The current builds up as the inductor lets more and more current flow.
When the switch turns off, the capacitor then recharges and this would happen fairly fast because of the low Rs built into Vin. The speed does depend on Rs however.
When looking at the waveform polarity, it's a good idea to also note the current arrow direction for Cin (as well as Cout). When the current is positive it is in the direction of the arrow, and when negative it's the other way. So when Cin provides current to the circuit the current is considered positive, and when it charges the current is considered to be negative.
The current waveshape during the negative periods however may not stay as constant as they seem to indicate, as the cap should charge up to some nominal level and that means the cap current level will decrease (toward zero from the negative) as it is being charged.
 
Last edited:
Thank you.

If you have another question where the capacitor voltage is marked as negative when you think it should not be, then you'll need to post that diagram.

Notice the "-" sign in both these pictures, picture #1, picture #2. Also check simulation provided at the bottom of second link.

References:
For #1: http://www.ecircuitcenter.com/Circuits/smps_buck/smps_buck.htm
For #2: http://www.learnabout-electronics.org/PSU/psu31.php

I have seen minus sign in many other circuit diagrams too. What do you say about minus sign?

Icin is drawn pretty much the way it is, as long as we assume that the source Vin has some built in internal resistance as usual for real life voltage sources. If Vin had no such Rs, then there would be no current into or out of Cin except during turn on and that would be a huge infinite current, so we assume some Rs for Vin.

This is how I see it. If there is no Rs then Cin gets charged instantly by an infinite current during turn off and this will damage the capacitor, and during turn on Cin gets discharged in usual manner assuming Vin dips down. On the other hand, if there is no Rs and assuming Vin doesn't dip down then Cin won't get discharged at all.

As the switch turns on, some current starts to flow through the switch and it gets some of that current from Cin because Vin dips down slightly due to the load current. The current builds up as the inductor lets more and more current flow.

Yes, I can see it. Perhaps, we can say that when the switch is turned on some of Vin gets dropped across Rs. Let's say Vin is 9V which means that before the switch is turned on before Vin and Cin are sitting at the same voltage of 9V. As soon as the switch is turned on, say, 0.5V gets dropped across Rs. It means that Cin will get discharged to 8.5V by providing some current to the load.

Note to self: If Vin doesn't dip down then Cin shouldn't discharge. It should remain at 9V.

The current waveshape during the negative periods however may not stay as constant as they seem to indicate, as the cap should charge up to some nominal level and that means the cap current level will decrease (toward zero from the negative) as it is being charged.

Yes, I agree. I think that this is a better representation.



What would be the voltage across inductor at the point indicated the instant before the switch is opened in Figure 3? Thank you.

Regards
PG
 

Attachments

  • cap_neg1.jpg
    cap_neg1.jpg
    13.1 KB · Views: 710
  • cap_neg2.jpg
    cap_neg2.jpg
    34.9 KB · Views: 774
  • cin121.jpg
    cin121.jpg
    54.7 KB · Views: 732
  • buck333.jpg
    buck333.jpg
    74.6 KB · Views: 891
Notice the "-" sign in both these pictures, picture #1, picture #2. Also check simulation provided at the bottom of second link.

This is not for the capacitor. It is to show that the voltage on the right side of the inductor is less than on the left one - plus on the left side and minus on the right.

What would be the voltage across inductor at the point indicated the instant before the switch is opened in Figure 3?

If it is connected through a conducting diode to ground, what do you think it would be?
 
Thank you.

If it is connected through a conducting diode to ground, what do you think it would be?

The diode won't be conducting just before the switch is opened in Figure 3 (or, as long as the switch is closed). It will only conduct once the switch is open. This means its cathode could be at any voltage such as 15V, 14V, etc. Isn't this so?

Let me try to elaborate a bit. When the switch is just closed, the inductor builds up voltage of 20V across it to resist the change in current but then gradually voltage starts going down like 20-->19.5-->19-->18.5-->18--->17.5 and so on. Actually I wanted to know that to what level the voltage has gone down before the switch is opened. Thanks.

Regards
PG
 
Thank you.



Notice the "-" sign in both these pictures, picture #1, picture #2. Also check simulation provided at the bottom of second link.

References:
For #1: http://www.ecircuitcenter.com/Circuits/smps_buck/smps_buck.htm
For #2: http://www.learnabout-electronics.org/PSU/psu31.php

I have seen minus sign in many other circuit diagrams too. What do you say about minus sign?



This is how I see it. If there is no Rs then Cin gets charged instantly by an infinite current during turn off and this will damage the capacitor, and during turn on Cin gets discharged in usual manner assuming Vin dips down. On the other hand, if there is no Rs and assuming Vin doesn't dip down then Cin won't get discharged at all.



Yes, I can see it. Perhaps, we can say that when the switch is turned on some of Vin gets dropped across Rs. Let's say Vin is 9V which means that before the switch is turned on before Vin and Cin are sitting at the same voltage of 9V. As soon as the switch is turned on, say, 0.5V gets dropped across Rs. It means that Cin will get discharged to 8.5V by providing some current to the load.

Note to self: If Vin doesn't dip down then Cin shouldn't discharge. It should remain at 9V.



Yes, I agree. I think that this is a better representation.



What would be the voltage across inductor at the point indicated the instant before the switch is opened in Figure 3? Thank you.

Regards
PG


Hi,

As Northguy pointed out, those negative signs are for the right side of the inductor. Cant you see that the negative sign is closer to the inductor than to the cap? Sometimes they indicate the voltage across a circuit element with a plus and minus sign, and that indicates the 'floating' voltage across that element. So for that inductor the left side is more positive than the right side, and if they had a voltage associated with those signs like 9v then it would mean at that point in time there was 9v across the inductor where the left side was positive. To see this more clear maybe replace the inductor with a battery.
The better way to represent a voltage across an individual element is to use a long arrow, where the arrow is placed right next to the component. The head of the arrow is placed close to the more positive node, and the tail is placed closer to the more negative node, and the voltage value is placed right next to the long arrow. This method has not yet been adopted universally so we still see plus and minus signs, maybe because they are easier to draw.

In figure 3, the voltage at the left side of the inductor is 20 volts. The voltage at the right side is 10.2 volts. Therefore the voltage across the inductor is 20-10.2=9.8 volts, and because 20>10.2 the left side is positive and the right side is more negative. This does not mean that the right side has a negative voltage with reference to ground, it means it has a negative voltage with reference to the 20v battery.

So sometime the voltages shown are 'floating', in that they are not referenced to ground but rather some other node.

I am including a drawing of the more preferred method of showing the voltage across an element. Note also it is better to show the current arrows much smaller and in one of the leads of the component rather that 'across' the element.
 

Attachments

  • buck334.gif
    buck334.gif
    24.8 KB · Views: 387
Last edited:
The diode won't be conducting just before the switch is opened in Figure 3 (or, as long as the switch is closed). It will only conduct once the switch is open.

Sorry. My mistake. I didn't scroll past the Figure 1.

Let me try to elaborate a bit. When the switch is just closed, the inductor builds up voltage of 20V across it to resist the change in current but then gradually voltage starts going down like 20-->19.5-->19-->18.5-->18--->17.5 and so on. Actually I wanted to know that to what level the voltage has gone down before the switch is opened.

20V is not a voltage accross inductor. It is voltage at the left side of the inductor relative to ground. As MrAl explained, the voltage accross inductor is 20-9.8=10.2V. It'll be dropping for a while, but hopefully the switch gets turned off which will cause the voltage accross the inductor to reverse. The idea is to switch fast enough so that there's a steady current through the inductor.

What's going to happen to the voltage left of the inductor? It depends on the power source. If it is strong, voltage may not drop at all and will stay at 20V minus FET drop, but the voltage to the right of the inductor will be rising. If the source is weak, Cin will be discharging and voltage to the left of the inductor will be dropping, but the voltage at the load may stay steady. Or a combination of these.
 
Thank you, MrAl, NG.

MrAl, your drawing with that arrow is more clear.

20V is not a voltage accross inductor. It is voltage at the left side of the inductor relative to ground. As MrAl explained, the voltage accross inductor is 20-9.8=10.2V. It'll be dropping for a while, but hopefully the switch gets turned off which will cause the voltage accross the inductor to reverse. The idea is to switch fast enough so that there's a steady current through the inductor.

What's going to happen to the voltage left of the inductor? It depends on the power source. If it is strong, voltage may not drop at all and will stay at 20V minus FET drop, but the voltage to the right of the inductor will be rising. If the source is weak, Cin will be discharging and voltage to the left of the inductor will be dropping, but the voltage at the load may stay steady. Or a combination of these.

I believe to find that voltage in Figure 3, we need more information. As is shown, Vin=20V, duty cycle=50% which means Vout=10V. Let's further assume that the value of load is 20 ohm and value of capacitor is 10pF. I'm sure there must be some formula to calculate the required inductor size from this information. I believe once we have the required inductor then that voltage in Figure 3 can be found. Thanks.

Regards
PG

PS: I believe that we also need to know PWM frequency therefore let's assume it's 1kHz.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top