Using opto isolated PWM to drive analogue input voltage

Thread Starter

allibut

Joined Jul 18, 2012
32
Hi, I have a motor driver which takes a 0-5V input speed control voltage. I'm driving this with an STM32 ARM GPIO line through an opto isolator.

I have a nice clean rect. wave input to the FOD817B and an RC filter on the output. It seems to work more or less as expected but it's not all that linear with respect to the PWM ratio.

Below is the cct and a graph of the input and output. The input is measures with a DVM which averages the 4kHz pulse train and gives a nice linear increase. The output clips a bit below 5V as expected due to VCE0 of about 0.14V. The output ripple is a fairly linear ramp up and down except for a little squiggle at the change-over. The RC is a bit too short.

lin(x) on the graph is a linear regression between 2000 and 18000 rpm. The "rpm" being the theoretically expected speed from which the PWM ratio is derived at 10V for 24000rpm range.

Since the opto is switching a digital signal I was expecting the output to be a lot more linear than this. The charging and discharge paths are not the same and I think this is pumping up the cap at higher mark/space ratios.

The motor driver is a Chinese VFD for which there is no spec for the input: I have no idea what I'm driving but guess it would fairly high input impedance.

Can anyone suggest how this could be improved without major additional complexity?

TIA.
 

Attachments

Last edited:

ericgibbs

Joined Jan 29, 2010
18,767
hi a,
What is the loading on the Vin signal.?
Looks non-linear increase.???
E

Corrected plot.
Increased 1uF to 10uF in order to emphasize non-linearity
 

Attachments

Last edited:

Thread Starter

allibut

Joined Jul 18, 2012
32
Thanks for the sim.
As I said, the manufacturer does not give any info on that input. However, testing with DMM with the unit powered off shows 20k. There is an alternative input method of connecting the 10V supply to ground via a 10k pot.
BTW the aim is o/p linearity w.r.t. PW ratio, not Vpic. I'm not expecting the opto to have a linear tx funciton.
 
Last edited:

BobTPH

Joined Jun 5, 2013
8,816
Thanks for the sim.
As I said, the manufacturer does not give any info on that input. However, testing with DMM with the unit powered off shows 20k. There is an alternative input method of connecting the 10V supply to ground via a 10k pot.
You cannot measure the impedance of an input that way. If you want to measure it, give it 5V through a 10K resistor and measre the voltage drop.

Bob
 

Thread Starter

allibut

Joined Jul 18, 2012
32
What is the loading on the Vin signal.?
Sorry to lack of clarity, that input in not connected in the test. I'm testing the output of the RC with no external load. Like I said I assumed that input was high ( relative to my 1k resistors ) and was concerned that the output was already very non linear.

With Vin connected, it is very similar just about 7-8% lower through most of the range.
 
Last edited:

Thread Starter

allibut

Joined Jul 18, 2012
32
The output of my cct as shown in the schematic. ie output of the RC filter.
This is labelled Vin : the nomenclature of the chinese VFD input voltage.
Here is the graph with the VRD connected to my cct and turned on. Not really different except a slight drop in potential due to the load.

I'd like to improve the linearity between 2000 and 20000 rpm.
 

Attachments

Thread Starter

allibut

Joined Jul 18, 2012
32
Thanks e. I know that's good solution but it does add quite a bit of complexity.
I tried Ian's suggestion and it's flat within about 1% " Good enough is Perfect ".;)

Many thanks to Ian for putting me straight. I don't know why I didn't keep it that way around now. Not thinking clearly.
Anyway finally got this doing what is required. Thanks to all for the useful ideas :)
 

Ian0

Joined Aug 7, 2020
9,679
For it to be perfect, both positive and negative should be driven by the same impedance. Ideally, you would buffer the output of the opto with a CMOS gate. But you can get near enough if the pulldown resistor (1k) is small in comparison with the filter resistor. Your remaining error is probably due to the fact that the opto switches on a lot faster than it switches off.
 
Top