Author Topic: Nfet vs Pfet for external device switching  (Read 8168 times)

0 Members and 1 Guest are viewing this topic.

Offline ajb

  • Super Contributor
  • ***
  • Posts: 2867
  • Country: us
Re: Nfet vs Pfet for external device switching
« Reply #25 on: April 29, 2023, 07:12:23 pm »

The LM321 is no good for 100kHz. If it's just a squarewave, there's no need for an op-amp. You're better off going back to the 5V supply and using a 74HCT gate to get 5V from the 3.3V output.
Aside from the speed issue with the selected op amp, the output impedance of the circuit (1k-6kR depending on potentiometer setting) is rather high.  I would assume the laser driver to have an input impedance on the order of 10k-50kR, so you might see something like a 10% reduction from the expected output power (assuming the driver even supports analog power control on the PWM input, and is relatively linear).  You'd be better off putting the potentiometer between the PWM signal source and the input of the op amp, with probably no more than 200R on the output. 
 

Offline 3dgeoTopic starter

  • Frequent Contributor
  • **
  • Posts: 290
  • Country: au
Re: Nfet vs Pfet for external device switching
« Reply #26 on: April 29, 2023, 07:30:50 pm »
You've got the resistor values backwards.
:palm:

If the voltage is reduced to 12V, the MOSFET gate drive will be reduced. Remember the shifting transistor acts as a current sink, which will fall out of regulation, once the supply voltage drops too low.

Mostly I still have no idea how that works... But as I understand with 12V supply (VIN) gate voltage will swing between 12V(VIN) and 0.82V, that is (VIN - 11.18V), right? And with voltages below 11.18V it just swing between VIN and 0?

The LM321 is no good for 100kHz. If it's just a squarewave, there's no need for an op-amp. You're better off going back to the 5V supply and using a 74HCT gate to get 5V from the 3.3V output.

You are right, MCU can sink 5V so no need for 74HCT as well.

Aside from the speed issue with the selected op amp, the output impedance of the circuit (1k-6kR depending on potentiometer setting) is rather high.  I would assume the laser driver to have an input impedance on the order of 10k-50kR, so you might see something like a 10% reduction from the expected output power (assuming the driver even supports analog power control on the PWM input, and is relatively linear).  You'd be better off putting the potentiometer between the PWM signal source and the input of the op amp, with probably no more than 200R on the output. 

Thank you for your reply, I will remove Opamp and will go with LDO.
 

Offline 3dgeoTopic starter

  • Frequent Contributor
  • **
  • Posts: 290
  • Country: au
Re: Nfet vs Pfet for external device switching
« Reply #27 on: April 29, 2023, 08:04:18 pm »
I totally forgot how annoying it is to prevent false trigger with open-drain output and still have option to limit PWM upper voltage.
What maximum frequency that Opamp can handle? 1K/10K?
 

Offline ajb

  • Super Contributor
  • ***
  • Posts: 2867
  • Country: us
Re: Nfet vs Pfet for external device switching
« Reply #28 on: April 29, 2023, 08:41:20 pm »
The maximum frequency for an op amp is obtained from the Gain-Bandwidth Product.  Divide that by the gain of the amplifier and that's your max frequency.  LM321 has a GBW of 1MHz, so you can operate it at 1MHz with a gain of 1, or a at 200kHz with a gain of 5, or 667KHz with your gain of 1.5.  Note that this is assumes a sine wave.  The maximum square wave frequency that the amplifier can handle while still getting something that looks like a square wave at the output will be substantially lower, depending on your rise/fall time requirements.  Rise time is approximately 0.35 divided by the bandwidth, but what this means for your circuit depends on what the laser does with the input signal.
 
The following users thanked this post: 3dgeo

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 22023
  • Country: gb
  • 0999
Re: Nfet vs Pfet for external device switching
« Reply #29 on: April 29, 2023, 09:33:08 pm »
The maximum frequency for an op amp is obtained from the Gain-Bandwidth Product.  Divide that by the gain of the amplifier and that's your max frequency.  LM321 has a GBW of 1MHz, so you can operate it at 1MHz with a gain of 1, or a at 200kHz with a gain of 5, or 667KHz with your gain of 1.5.  Note that this is assumes a sine wave.  The maximum square wave frequency that the amplifier can handle while still getting something that looks like a square wave at the output will be substantially lower, depending on your rise/fall time requirements.  Rise time is approximately 0.35 divided by the bandwidth, but what this means for your circuit depends on what the laser does with the input signal.
The slew rate limits the LM321's ability to output a 100kHz 5V squarewave, before the bandwidth is an issue.

4
Mostly I still have no idea how that works... But as I understand with 12V supply (VIN) gate voltage will swing between 12V(VIN) and 0.82V, that is (VIN - 11.18V), right? And with voltages below 11.18V it just swing between VIN and 0?
Go back to the circuit I posted in my previous post.
https://www.eevblog.com/forum/projects/nfet-vs-pfet-for-external-device-switching/msg4837529/#msg4837529

Q1 is a common emitter amplifier. It behaves like a voltage controlled current sink. The voltage across R1 is VBE below V2. The current through R1 is proportional to the voltage across it. Assuming the hFE of Q1 is very high, the collector current is nearly equal to the emitter current, which is flowing through R1. The collector current is purely dependant on R1 and V2, until R2 becomes so high, the voltage drop across it exceeds V1 + the voltage drop across R1.
« Last Edit: April 30, 2023, 08:43:14 am by Zero999 »
 
The following users thanked this post: 3dgeo

Offline 3dgeoTopic starter

  • Frequent Contributor
  • **
  • Posts: 290
  • Country: au
Re: Nfet vs Pfet for external device switching
« Reply #30 on: May 03, 2023, 07:27:01 am »
The maximum frequency for an op amp is obtained from the Gain-Bandwidth Product.  Divide that by the gain of the amplifier and that's your max frequency.  LM321 has a GBW of 1MHz, so you can operate it at 1MHz with a gain of 1, or a at 200kHz with a gain of 5, or 667KHz with your gain of 1.5.  Note that this is assumes a sine wave.  The maximum square wave frequency that the amplifier can handle while still getting something that looks like a square wave at the output will be substantially lower, depending on your rise/fall time requirements.  Rise time is approximately 0.35 divided by the bandwidth, but what this means for your circuit depends on what the laser does with the input signal.

100kHz was a bit overstatement, I'm sure 1kHz to 10kHz will do. I still haven't came up with simpler and more effective solution.

Q1 is a common emitter amplifier. It behaves like a voltage controlled current sink. The voltage across R1 is VBE below V2. The current through R1 is proportional to the voltage across it. Assuming the hFE of Q1 is very high, the collector current is nearly equal to the emitter current, which is flowing through R1. The collector current is purely dependant on R1 and V2, until R2 becomes so high, the voltage drop across it exceeds V1 + the voltage drop across R1.

That makes sense, thank you for all your help, though as I've said analog is not my horsy  :horse:
Your old post where you posted signal and output picture came in handy.

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf