1

I'm trying to convert a 5V PWM signal to 0-10V through an optocoupler to drive a VFD. The output "0-10V" should be 0V when PWM duty cycle is 0%, and 10V when 100% (linearly !). Here is what I've come up with:

5V PWM to 0-10V

So, when OUT1 is high (5V):

  • 10mA should pass through U9 and saturate the photo-transistor
  • Q1 and Q2 bases are now 12V, so Q1 is opened, and Q2 closed
  • C2 charges through Q1 and RV1, voltage rises

When OUT1 is low (0V):

  • U9 transistor is closed
  • R17 pull Q1 and Q2 base to 0V, so Q1 is closed and Q2 opened
  • C2 discharge through RV1 and Q2, voltage fall

RV1 can be tuned to increase or decrease smoothing (depending on PWM frequency).

Will it works ? I would like to know if I'm heading in the right direction before ordering the parts !

  • This is an isolated PWM DAC. So the input of the RC filter will see a PWM with Vpk =~ 12 V, and the filtered and buffered signal will be the mean value of it: Vo = D × Vpk, where D is the duty cycle. It can work but the PWM output may have a peak value of about 12V. This may be a bit high for your needs. You may fix it with R16 and R17. Also I'd suggest a 2nd RC filter for better ripple performance. Please note that the cutoff freq should be lower than half the PWM freq. – Rohat Kılıç Jan 10 '20 at 23:50
  • @RohatKılıç If I use 2K for R16 and 10K for R17, will I end up with 10V max ? – Nicolas Repiquet Jan 11 '20 at 00:06
  • Probably yes. The totem pole driver is a good choice here as it has unity voltage gain and high input impedance. You could use the other opamp of the LM358, though. Anyway, if the result does not satisfy you then you can play with those resistors until you hit the target. – Rohat Kılıç Jan 11 '20 at 00:15
  • Is there a reason you need isolation? Are you just using it as part of the level shifting circuit or do you actually need it? – ccolton Jan 11 '20 at 00:15
  • @ccolton Dunno If I really need it. My reasoning is that the PWM input signal comes from an expensive piece of equipement (not mine !), and the output goes to a VFD in a pretty harsh industrial environement... So hey, why not throw in a 10 cents optocoupler ? – Nicolas Repiquet Jan 11 '20 at 00:27
  • Can you define load Ω ? and what happens when you cannot get to 0V. What control latency is acceptable? What is PWM freq? What is acceptable jitter? You cannot do a good design without specs. make a list. incl max error budget. – Tony Stewart EE75 Jan 11 '20 at 00:34
  • @TonyStewartSunnyskyguyEE75 Load impedance is in the 5KΩ to 50KΩ range, as it's the 0-10V input of a VFD. 0V means low motor speed, 10V high motor speed (both can be defined in the VFD settings). – Nicolas Repiquet Jan 11 '20 at 00:34
  • So what is your max acceptable Vout error? – Tony Stewart EE75 Jan 11 '20 at 00:35
  • @TonyStewartSunnyskyguyEE75 It doesn't need to be super accurate, as it drives the spindle motor of a metal lathe. So... 5% should be ok ? The PWM frenquency can be changed from 1kHZ to 100kHz. And the duty cycle change is pretty slow : the motor has acceleration and deceleration limits. – Nicolas Repiquet Jan 11 '20 at 00:41
  • you still needs good specs to compare design. with results. even if slack. When it meets spec , its perfect. Look at how they spec a simple resistor. or wide CTR opto-transistor – Tony Stewart EE75 Jan 11 '20 at 00:44
  • @RohatKılıç What can I use the second opamp for ? – Nicolas Repiquet Jan 11 '20 at 00:45
  • @RohatKılıç Got it, you mean replacing the two transistors with the opamp. I'll do that ! – Nicolas Repiquet Jan 11 '20 at 00:51
  • You may want a 2nd order filter http://tinyurl.com/t4creae This has about 1% error – Tony Stewart EE75 Jan 11 '20 at 02:03
  • Some tweaks on filter to improve linearity. http://tinyurl.com/s73s3oh – Tony Stewart EE75 Jan 11 '20 at 02:30
  • @NicolasRepiquet Why can't you ignore the opto (I really doubt you need it) and use something like [this](https://electronics.stackexchange.com/a/474656/38098)? (If you want an opto, it can be easily added. If strongly desired, I can show you how to do that, too.) – jonk Jan 11 '20 at 04:39
  • Thank you all for your help. @TonyStewartSunnyskyguyEE75 your solution looks amazing and that website too ! Thanks again. – Nicolas Repiquet Jan 11 '20 at 20:58

2 Answers2

1

No this circuit wont work. I tried it out and I did not work because of many reasons.

  1. when opto is switched on 12 volts is being provided to the base of Q1 and Q2. therefore, Q1 switches on and provides 12 volts to RC Low Pass filter. But , when opto is switched Off , base of Q1 & Q2 is grounded by 20k resistor which dramatically increases the switch on time of Q2, because of which we get a triangular waveform at the RC network and not a 12volt square wave.

  2. to solve this issue, I reduced r17 to 1k to reduce switching on time of Q2. this created more problems . Now when Opto is switched on , 12 volts gets divided between r16 and r17 and base of transistor now gets 6v at 100% duty cycle. and because Vbe = 0.7v , we are getting 5.3v at the emitter of Q1.

  3. to solve all these issues , use two opto couplers instead of Q1 and Q2 and no need of u9 , r16 and r17. Works flawlessly.

Isolated Push Pull Amplifier

0

I would have omitted the totem pole, because you don't need a low output impedance at this point: there is a 100k resistor after.

Just don't use large values for the resistor in the emitter of the optocouper to avoid slow switching.

This yields to this schematics. I did not draw the opamp at the right: don't change this part.

schematic

simulate this circuit – Schematic created using CircuitLab

[EDIT] I incresed the values of the resistors because the optocoupler has only a minimal 50% ratio.

Charles JOUBERT
  • 889
  • 5
  • 10