Author Topic: Converting PWM to analog  (Read 1150 times)

0 Members and 1 Guest are viewing this topic.

Offline stafilTopic starter

  • Regular Contributor
  • *
  • Posts: 205
  • Country: us
Converting PWM to analog
« on: March 28, 2020, 03:16:35 am »
Hi,

Any traps for young players in the circuit below? I am trying to convert a 3.3V PWM signal to a ballpark 4V-12V analog signal. Looks fine in LTSPice, but wanted to double check with somebody experienced.
« Last Edit: March 28, 2020, 05:54:25 am by stafil »
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19918
  • Country: gb
  • 0999
Re: Converting PWM to analog
« Reply #1 on: March 28, 2020, 10:54:30 am »
It won't give a 4V to 12V analogue signal, but 0 to 13.2V. Connecting a P-channel like that will also result in oscillation, because it will add a considerable amount of gain to the loop. It will need some phase compensation.

R7 isn't needed.

The BSS84 will fry with 500mA of continuous drain current.
https://www.onsemi.com/pub/Collateral/BSS84-D.PDF
 

Offline stafilTopic starter

  • Regular Contributor
  • *
  • Posts: 205
  • Country: us
Re: Converting PWM to analog
« Reply #2 on: March 28, 2020, 07:02:36 pm »
It won't give a 4V to 12V analogue signal, but 0 to 13.2V. Connecting a P-channel like that will also result in oscillation, because it will add a considerable amount of gain to the loop. It will need some phase compensation.

R7 isn't needed.

The BSS84 will fry with 500mA of continuous drain current.
https://www.onsemi.com/pub/Collateral/BSS84-D.PDF

Thanks!

Any pointers regarding the oscillation and the phase compensation!

Good catch regarding BSS84! Thanks!
 

Offline Jwillis

  • Super Contributor
  • ***
  • Posts: 1716
  • Country: ca
Re: Converting PWM to analog
« Reply #3 on: March 31, 2020, 05:13:51 am »

Thanks!

Any pointers regarding the oscillation and the phase compensation!

Good catch regarding BSS84! Thanks!

The mosfet is a capacitive load which can cause overshoots, ringing, and even oscillation. By putting a low value resistor in seines with the output . This will  isolate the op-amp output and feedback network from the capacitive load .  Or If you are concerned about gain accuracy you can use a R-C series snubber circuit from output to ground.
 
The following users thanked this post: stafil

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19918
  • Country: gb
  • 0999
Re: Converting PWM to analog
« Reply #4 on: March 31, 2020, 01:12:33 pm »

Thanks!

Any pointers regarding the oscillation and the phase compensation!

Good catch regarding BSS84! Thanks!

The mosfet is a capacitive load which can cause overshoots, ringing, and even oscillation. By putting a low value resistor in seines with the output . This will  isolate the op-amp output and feedback network from the capacitive load .  Or If you are concerned about gain accuracy you can use a R-C series snubber circuit from output to ground.
You'll get the same result with a BJT. It's because the transistor increase the voltage gain of the circuit. Adding a resistor in series with the op-amp's inverting input and a capacitor between the inverting-input and the output, forming an integrator, will reduce the high frequency gain of the op-amp and increase the stability.
 
The following users thanked this post: stafil


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf