Maker Pro
Maker Pro

Buck Converter with PİC16F877A

emrebay

Dec 27, 2018
16
Joined
Dec 27, 2018
Messages
16
hi guys i have a homework but i couldn't drive the mosfet on highside would you help me?
İ think grounds are must be diffrent but i couldn't find a solution
i have signal at Gate and Source as you see but it is doesn't work
Adsız31.png
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
Can you clean up your schematic first?

See here.

edit: I would also add:
  1. Draw your batteries up the same way (+ve to the top is conventional)
  2. Don't draw long lines to ground symbols. Insert a new one.
 
Last edited:

emrebay

Dec 27, 2018
16
Joined
Dec 27, 2018
Messages
16
hi guys i have a homework but i couldn't drive the mosfet on highside would you help me?
İ think grounds are must be diffrent but i couldn't find a solution
i have signal at Gate and Source as you see but it is doesn't work
View attachment 44313
I forgot the 24V
 

Attachments

  • Adsız31.png
    Adsız31.png
    57.7 KB · Views: 5

emrebay

Dec 27, 2018
16
Joined
Dec 27, 2018
Messages
16
Can you clean up your schematic first?

See here.

edit: I would also add:
  1. Draw your batteries up the same way (+ve to the top is conventional)
  2. Don't draw long lines to ground symbols. Insert a new one.
i don't have much time i think you can understand the ways can you help me for drive mosfet pls
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
I also don't have much time.

The difficulty reading your schematic probably exceeds that in finding the problem.

I'm happy to help, but I'm not prepared to redraw your schematic.

Who knows, maybe your poor drafting skills are hiding an obvious error that you could spot of your schematic wasn't somewhat akin to a bowl of spaghetti.

Maybe someone else has time to waste.
 

emrebay

Dec 27, 2018
16
Joined
Dec 27, 2018
Messages
16
I also don't have much time.

The difficulty reading your schematic probably exceeds that in finding the problem.

I'm happy to help, but I'm not prepared to redraw your schematic.

Who knows, maybe your poor drafting skills are hiding an obvious error that you could spot of your schematic wasn't somewhat akin to a bowl of spaghetti.

Maybe someone else has time to waste.
its not about my skills i was drew it quickly so now can you help me?
Adsız31.png
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,722
Joined
Nov 17, 2011
Messages
13,722
This is homework, so you will not be presented a ready solution. This is how you can go on to eliminate your mistakes and find a working circuit:

To control a MOSFET the control voltage is applied between gate and source. It is not so in your circuit:
upload_2018-12-29_14-49-51.png
BAT 1 and BAT3 are in series and form effectively a single battery with no other purpose than driving a current through R2 (draw the loop yourself if you like to get a clear image of this).
U2 does nothing more than shunt part of that current through R4 by connecting it in parallel to R3. Do not let you get fooled by the ground symbol at the bottom of R4 and U2 pin 3: there is no way current can flow into that ground node as there is no way current flowing into that node can return to the batteries BAT1 and BAT3.
On the contrary: photocouplers are used in such an application typically to de-couple differengt circuit grounds to avoid current flowing between them - which is what U2 does perfectly here.

Considering the above:
  • Replace BAT1 and BAT3 by a single battery (just for simplicity). Let's call this BAT4 (to avoid mixing up names with your current schematic)
  • Where do you have to connect the '-' of BAT4 to allow it to control MOSFET Q1 (consider my first statement).
  • How would you connect U2 to allow control of the MOSFET's gate by BAT4 (for a first step forget R2, R3 and R4)?
  • Having set up the basic control circuit (control of Vgs by U2 and BAT4), which resistor(s) do you need to ensure Q1 is really off when it should be?
  • N which resistor circuit can you limit the inrush current to Q1's gate when it is turned on?

Spoiler: These search terms may help: high side mosfet control photocoupler
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
The stuff with bat1 and bat3 doesn't make any sense to me. The batteries seen to be rendered ineffectual by R3 that will limit the voltage to about 1/3V.

For a high side switch, why are you not using a P channel MOSFET?
 

emrebay

Dec 27, 2018
16
Joined
Dec 27, 2018
Messages
16
The stuff with bat1 and bat3 doesn't make any sense to me. The batteries seen to be rendered ineffectual by R3 that will limit the voltage to about 1/3V.

For a high side switch, why are you not using a P channel MOSFET?
i tried but i failed can you create a schematic? i didn't yet buy components so its doesn't matter if it is works in isis then i will buy the components
btw i tried with IR series and i tried with transistor but its doesn't work... (
 

emrebay

Dec 27, 2018
16
Joined
Dec 27, 2018
Messages
16
This is homework, so you will not be presented a ready solution. This is how you can go on to eliminate your mistakes and find a working circuit:

To control a MOSFET the control voltage is applied between gate and source. It is not so in your circuit:
View attachment 44352
BAT 1 and BAT3 are in series and form effectively a single battery with no other purpose than driving a current through R2 (draw the loop yourself if you like to get a clear image of this).
U2 does nothing more than shunt part of that current through R4 by connecting it in parallel to R3. Do not let you get fooled by the ground symbol at the bottom of R4 and U2 pin 3: there is no way current can flow into that ground node as there is no way current flowing into that node can return to the batteries BAT1 and BAT3.
On the contrary: photocouplers are used in such an application typically to de-couple differengt circuit grounds to avoid current flowing between them - which is what U2 does perfectly here.

Considering the above:
  • Replace BAT1 and BAT3 by a single battery (just for simplicity). Let's call this BAT4 (to avoid mixing up names with your current schematic)
  • Where do you have to connect the '-' of BAT4 to allow it to control MOSFET Q1 (consider my first statement).
  • How would you connect U2 to allow control of the MOSFET's gate by BAT4 (for a first step forget R2, R3 and R4)?
  • Having set up the basic control circuit (control of Vgs by U2 and BAT4), which resistor(s) do you need to ensure Q1 is really off when it should be?
  • N which resistor circuit can you limit the inrush current to Q1's gate when it is turned on?

Spoiler: These search terms may help: high side mosfet control photocoupler

thank you but i really have two days for this project i tried diffrent ways whole month but i couldn't be succesful and i am not good at english can you create a schematic Mrs.Kalpp
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
Perhaps you should show us the circuit you tried with a P-channel MOSFET, it would be much easier to fix.

Bob
 

emrebay

Dec 27, 2018
16
Joined
Dec 27, 2018
Messages
16
This is homework, so you will not be presented a ready solution. This is how you can go on to eliminate your mistakes and find a working circuit:

To control a MOSFET the control voltage is applied between gate and source. It is not so in your circuit:
View attachment 44352
BAT 1 and BAT3 are in series and form effectively a single battery with no other purpose than driving a current through R2 (draw the loop yourself if you like to get a clear image of this).
U2 does nothing more than shunt part of that current through R4 by connecting it in parallel to R3. Do not let you get fooled by the ground symbol at the bottom of R4 and U2 pin 3: there is no way current can flow into that ground node as there is no way current flowing into that node can return to the batteries BAT1 and BAT3.
On the contrary: photocouplers are used in such an application typically to de-couple differengt circuit grounds to avoid current flowing between them - which is what U2 does perfectly here.

Considering the above:
  • Replace BAT1 and BAT3 by a single battery (just for simplicity). Let's call this BAT4 (to avoid mixing up names with your current schematic)
  • Where do you have to connect the '-' of BAT4 to allow it to control MOSFET Q1 (consider my first statement).
  • How would you connect U2 to allow control of the MOSFET's gate by BAT4 (for a first step forget R2, R3 and R4)?
  • Having set up the basic control circuit (control of Vgs by U2 and BAT4), which resistor(s) do you need to ensure Q1 is really off when it should be?
  • N which resistor circuit can you limit the inrush current to Q1's gate when it is turned on?

Spoiler: These search terms may help: high side mosfet control photocoupler
i think i should connect "-" of BAT4 to Source and the second question's answer is U2 should be connect to Gate
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,722
Joined
Nov 17, 2011
Messages
13,722
That is so far o.k.
What about BAT4's '+' pole? and how is it related to U2 and the gate of Q1?
Show us your modified circuit diagram, that's a lot easier to understand than a verbal description.

thank you but i really have two days for this project i tried diffrent ways whole month but i couldn't be succesful and i am not good at english can you create a schematic Mrs.Kalpp
I could, but that is not how we operate on this forum. It is your homework, not ours and you'll learn the most by solving the task by yourself.
It is not our fault you waited so long before asking for help - but we're happy to support you.

btw.: it is "Mr. Kapp", not "Mrs. Kalpp"
 

emrebay

Dec 27, 2018
16
Joined
Dec 27, 2018
Messages
16
What about BAT4's '+' pole? and how is it related to U2 and the gate of Q1?
BAT4's + pole should be connect to R2 but i couldn't make Q1's gate's connection, should i connect R3 and Q1's
and i think grounds should be diffrent
Adsız31.png Gate?
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
Perhaps you need to think what has to be done to turn the mosfet on and off.

Look at what you're doing with the optocoupler and make sure it changes the state of the mosfet.
 

emrebay

Dec 27, 2018
16
Joined
Dec 27, 2018
Messages
16
Perhaps you need to think what has to be done to turn the mosfet on and off.

Look at what you're doing with the optocoupler and make sure it changes the state of the mosfet.
yes thats my problem i wrote to this site for this, i couldn't find a solution for drive to mosfet, I tried so hard for that, can you help me more just for this time i just have a few days i still didn't buy components
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,722
Joined
Nov 17, 2011
Messages
13,722
Look at what you're doing with the optocoupler and make sure it changes the state of the mosfet.
It does in this circuit, but in a way probably not intended: optocoupler=on -> MOSFET ) off.
I think that the intention is optocoupler=on -> MOSFET=on is what @emrebay wants (is that so?) . That would be the fail-safe setup as the MOSFET will be off whenever it is not actively turned on.

Think of the optocoupler (or photocoupler @(*steve*) is that an AE vs. BE thing?) as a switch. You'll want to switch BAT4's positive voltage to the gate of the MOSFET. Your circuit does that but only when the optocoupler is off. In that case BAT4 voltage is divided by R2, R3 and R4 which is really not necessary and will slow down the MOSFET as the gate capacitance is charged rather slowly.
A play of thought to get you started:
  • Remove R2, R3 and R4 and replace the optocoupler by a switch to control Q1 by BAT4. Then you should immediately see how the optocoupler needs to be connected to Q1. This is your turn-on circuit.
  • Now you will need a resistor to limit inrush current from BAT4 to Q1's gate. Your choice of 10 Ω is not bad. Where will you place it?
  • Next consider the MOSFET's gate charge when the optocoupler is turned off. This charge will keep the MOSFET on when it should be off. A well placed resistor can discharge the Gate to BAT4's negative pole.
From this verbal description you should be able to construct the circuit. I'll have to leave the design of the schematic to you. You can upload it for us to check it.


and i think grounds should be diffrent
That's what I told you in post #7. Why haven't you then separated them? You're still using the same gnd for all parts of the circuit. Note that this is not necessarily wrong when done correctly, but can lead to confusion where current flow is possible in this circuit. I suggest you remove gnd from the isolated part of the circuit (right side of U2 and connected components) completely. It is not required here.
 
Last edited:

emrebay

Dec 27, 2018
16
Joined
Dec 27, 2018
Messages
16
It does in this circuit, but in a way probably not intended: optocoupler=on -> MOSFET ) off.
I think that the intention is optocoupler=on -> MOSFET=on is what @emrebay wants (is that so?) . That would be the fail-safe setup as the MOSFET will be off whenever it is not actively turned on.

Think of the optocoupler (or photocoupler @(*steve*) is that an AE vs. BE thing?) as a switch. You'll want to switch BAT4's positive voltage to the gate of the MOSFET. Your circuit does that but only when the optocoupler is off. In that case BAT4 voltage is divided by R2, R3 and R4 which is really not necessary and will slow down the MOSFET as the gate capacitance is charged rather slowly.
A play of thought to get you started:
  • Remove R2, R3 and R4 and replace the optocoupler by a switch to control Q1 by BAT4. Then you should immediately see how the optocoupler needs to be connected to Q1. This is your turn-on circuit.
  • Now you will need a resistor to limit inrush current from BAT4 to Q1's gate. Your choice of 10 Ω is not bad. Where will you place it?
  • Next consider the MOSFET's gate charge when the optocoupler is turned off. This charge will keep the MOSFET on when it should be off. A well placed resistor can discharge the Gate to BAT4's negative pole.
From this verbal description you should be able to construct the circuit. I'll have to leave the design of the schematic to you. You can upload it for us to check it.



That's what I told you in post #7. Why haven't you then separated them? You're still using the same gnd for all parts of the circuit. Note that this is not necessarily wrong when done correctly, but can lead to confusion where current flow is possible in this circuit. I suggest you remove gnd from the isolated part of the circuit (right side of U2 and connected components) completely. It is not required here.
but my problem is i don't know how can i use two diffrent ground at isis
the red ground should be diffrent from black grounds
Adsız32.png
 
Last edited:

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,722
Joined
Nov 17, 2011
Messages
13,722
but my problem is i don't know how can i use two diffrent ground at isis
It might have helped had you stated this in the beginning. For simulation it is o.k. to use a single ground as you did.

Your circuit is getting worse compared to the one in post #14:
  • Why did you insert BAT1?
  • There is no direct connection from BAT 4 to the source of Q1.
  • The optocoupler is still shunting the gate of Q1 to source. It is not used as a switch to turn on the gate-source voltage of Q1.
Re-read my post #17 where I explained the correct setup.
 

emrebay

Dec 27, 2018
16
Joined
Dec 27, 2018
Messages
16
It might have helped had you stated this in the beginning. For simulation it is o.k. to use a single ground as you did.

Your circuit is getting worse compared to the one in post #14:
  • Why did you insert BAT1?
  • There is no direct connection from BAT 4 to the source of Q1.
  • The optocoupler is still shunting the gate of Q1 to source. It is not used as a switch to turn on the gate-source voltage of Q1.
Re-read my post #17 where I explained the correct setup.
i have another circuit, why this signals like that ,is it about duty values?
adsız33.png
 
Top