View Full Version : Opto-isolated PWM signal

07 February 2011, 2245
Can you opto-isolate a PWM signal? I get the basic idea of opto-isolating something, and the basic idea of PWM. At least I think I do. :o So I'm thinking it boils down to frequency of the PWM and whether the opto-isolation device can operate at the frequency required.

I have a 5V microcontroller that has PWM outputs that I want to use to drive the 0-5V input on my Sevcon controllers. My motors have speed sensors on them so I'm going to build a closed loop system where I can set one motor speed to be a percentage of the other and keep them synced up or running at different speeds.

I want the microcontroller isolated from the drive system. What information do I need to gather to be able to get the right parts? Or what do I need to do to best achieve this?

07 February 2011, 2313
Hi Dave, your opto PWM outputs to the Sevcons don't need to be particularly high frequency, just enough to overcome 'lumps' between the on / offs, a few KHz should more than do it.
Don't know if the Sevcon will take PWM directly. If not, a simple RC filter will fix.
Information needed? ..
What's the motor's speed sensor output, i.e. opto / magnetic / other?
How many pulses per revolution?
Is it isolated? (almost certainly)

07 February 2011, 2341
I think it's a magnetic sensor, but not sure on the pulses per rev. There's no real info on it, but it does appear to be isolated. I'm just planning on getting it and then scoping the output to see what I get. (It's supplied attached to the motor, so I'm not selecting it specifically.)

I'm planning on using an Arduino microcontroller which has a PWM frequency of 490Hz, with 8 bit resolution. The Arduino will read the speed sensor data from each motor, (probably via a frequency to analog converter), and then determine the PWM level required to balance them, or set one to be faster or slower than the other according to steering input. (This isn't a bike project by the way.) I think I've got that all set in my mind. THe problem I'm having is to pick an opto isolator that will work with the PWM signal. I realize I'm making an assumption that the Sevcon will work with a PWM signal, but glad to hear that an RC filter would fix that.

So if one pulse could be as small as 1/255 * 1/490 = 8us(?) I'd need an opto-isolator that can turn on and off within that time? Just picking one at random from SparkFun I found one that has a rise time of 3us and a fall time of 5us. At htis point though I have no real idea what I'm doing it's all just pure guesswork!! :o

08 February 2011, 0005
FWIW, there is a much simpler approach to this.
Feed +5V to both ends of a linear pot (via buffer resistors) and ground the wiper.
Take the two pot ends as your two Sevcon inputs.
Moving the pot towards either end of center would progressively 'slow' that input.
If necessary you could 'shape' the response of the pot steering by paralleling resistors from wiper to each end.

I know this approach isn't a 'project' and doesn't have as much fun factor but it is simple :)

Edit: Not feed +5v to both ends but feed your throttle signal (0-5V) to both ends!