Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

differential signal

Status
Not open for further replies.

jnnewton

Member
I am creating a differential analog signal from the pwm of a dspic30f microcontroller. I have filtered the pwm signal and get a nice analog output using a simple r/c filter. The next step is to get a +/-10V signal from my 0-5V output. I have a couple of ideas and thoughts about how to do this. Any suggestions or comments would be greatly appreciated.

1. Use the single pwm output into an op amp with basically a 2.5V offset. This way the op amp output is 0 when the pwm is at 50%.
A. The drawback i see to this is if the pwm, for whatever reason doesn't come on or stops, the op amp output will go to -2.5 Volts.
1. A solution to this might be to run the op amp output through a switch, so that if the controller quits, the switch opens and the output falls back to zero.
B. Another drawback is startup where the pwm starts at zero, there would be a bit of time that will leave the output at -2.5V. This could also be solved by a switch at the output of the op am.

2. I like this one better: use two pwm channels and drive a fully differential op amp with them. If ch 1 is at 100% duty cycle, 2 at 0% , the input to the amp is 5V, If ch 2 is at 100% and 1 at 0%, the input to the amp is -5V.
A. The drawback is the use of two channels, and the synchronization of the two in software, and possibly the crossing over the zero point.

Please let me know your thoughts on the matter
 
I think you're making this FAR too complicated - all you need is a simple inverting opamp on the final analogue filtered output - exactly as you use for the balanced output from a PA preamplifier.

In your case you would require two opamps, one to give the required output levels, and the other to invert it.
 
From what you said, my output would then always be negative right? This is not the objective. I am trying to output a signal that varies from 10 to -10V from a pwm channel. if I can output a filtered signal from 0-5V and then the first amp has a gain of 2, i now have 0 to 10V, and then if i invert it, i now have 0 to -10V...or did i miss something?

Also, I really want to have the output be 0V when the pwm signal(s) are off.
 
Last edited:
jnnewton said:
From what you said, my output would then always be negative right? This is not the objective. I am trying to output a signal that varies from 10 to -10V from a pwm channel. if I can output a filtered signal from 0-5V and then the first amp has a gain of 2, i now have 0 to 10V, and then if i invert it, i now have 0 to -10V...or did i miss something?

Yes you are missing something, you give the first opamp a gain of 4, and an offset to give an output of 10V to -10V

Also, I really want to have the output be 0V when the pwm signal(s) are off.

Assuming you're filtering to get an AC waveform? (sinewave or whatever) then simply capacitor couple the input to the first opamp - this would also probably remove the requirement for your offset voltage.

But as with many things, as you're not giving us any clue what you're trying to do, it's hard to make suggestions.
 
Assuming you're filtering to get an AC waveform? (sinewave or whatever) then simply capacitor couple the input to the first opamp - this would also probably remove the requirement for your offset voltage.

But as with many things, as you're not giving us any clue what you're trying to do, it's hard to make suggestions.

Sorry, maybe this will help:
I have a servo motor amplifier which accepts a differential voltage as a velocity reference. I am trying to create a circuit to control the drive. I will be sending the voltage (velocity) and watching the encoder coming back to control the position of the motor.
I have just hooked up an instrumentation amp (to get both the gain and the offset. It works ok, but I wanted to try to do something where i can use the fault feature of the microcontroller. It allows an override of the pwm to pull the pins to a pre-defined state (5V or 0V). I would like to pull to 0V.
 
There are two possibilities:
1. both signals vary positively with respect to gnd;
Time Speed Vref+ Vref- Voltage (Vref+ - Vref-)
0 0 0 0 0
1 2700 10 0 10
2 2700 10 0 10
3 0 0 0 0
4 -2700 0 10 -10
5 -2700 0 10 -10
6 0 0 0 0

2. only the first signal varies;
Time Speed Vref+ Vref- Voltage (Vref+ - Vref-)
0 0 0 0 0
1 2700 10 0 10
2 2700 10 0 10
3 0 0 0 0
4 -2700 -10 0 -10
5 -2700 -10 0 -10
6 0 0 0 0
 
The values are not discrete, see attached to avoid confusion (x-axis is time, y is voltage)
 

Attachments

  • Voltage(1).jpg
    Voltage(1).jpg
    19.2 KB · Views: 133
  • Voltage(2).jpg
    Voltage(2).jpg
    17.6 KB · Views: 138
jnnewton said:
I am creating a differential analog signal from the pwm of a dspic30f microcontroller. I have filtered the pwm signal and get a nice analog output using a simple r/c filter. The next step is to get a +/-10V signal from my 0-5V output. I have a couple of ideas and thoughts about how to do this. Any suggestions or comments would be greatly appreciated.

1. Use the single pwm output into an op amp with basically a 2.5V offset. This way the op amp output is 0 when the pwm is at 50%.
A. The drawback i see to this is if the pwm, for whatever reason doesn't come on or stops, the op amp output will go to -2.5 Volts.
1. A solution to this might be to run the op amp output through a switch, so that if the controller quits, the switch opens and the output falls back to zero.
B. Another drawback is startup where the pwm starts at zero, there would be a bit of time that will leave the output at -2.5V. This could also be solved by a switch at the output of the op am.

2. I like this one better: use two pwm channels and drive a fully differential op amp with them. If ch 1 is at 100% duty cycle, 2 at 0% , the input to the amp is 5V, If ch 2 is at 100% and 1 at 0%, the input to the amp is -5V.
A. The drawback is the use of two channels, and the synchronization of the two in software, and possibly the crossing over the zero point.

Please let me know your thoughts on the matter

By "differential signal", do you mean the usual two conductors carrying opposite-phase copies of the signal? In that case, you could just use two unity-gain opamps, with one being inverting (essentially an "unbalanced to balanced converter"). At the receiving end, you would just use an opamp configured as a differential amplifer, or an instrumentation amplifier circuit. (See AN-31 at national.com, for simple differential amp and instrumentation amp opamp circuits.)

If, on the other hand, you just want to change the single-ended 0-5v to single-ended +/-10v, then just capacitively couple the 0-5v to a 4x amplifier. If you can't use AC coupling, maybe you could use an opamp configured as a differential amplifier, with a gain of four, and a reference voltage on the negative input.

That was all just off the top of my head. So I suggest downloading LTspice from linear.com and trying it as a simulation, using a simple ideal voltage source to simulate your 0-5v output.

- Tom Gootee

http:/.www.fullnet.com/~tomg/index.html
 
"differential signal", do you mean the usual two conductors carrying opposite-phase copies of the signal?

no.

If, on the other hand, you just want to change the single-ended 0-5v to single-ended +/-10v, then just capacitively couple the 0-5v to a 4x amplifier. If you can't use AC coupling, maybe you could use an opamp configured as a differential amplifier, with a gain of four, and a reference voltage on the negative input.

No, there is no ac component to the signals after lp filtering. I do not want to use a reference voltage. I am going to put together a dual pwm through a fully differential op amp circuit, the parts will be here in a few days. Whether or not this will work....i don't know.

For some reason I am not getting my objectives across here. when looking at the previously posted pictures of the output required, assume that the time scale on the x axis is in seconds and any section can be varied (slope, time, magnitue).

This is a trapezoidal velocity profile for positioning a servo motor. This is common in industry and used for may applications, both for positioning and velocity control.
 
Why can't you do it like this:
 

Attachments

  • single-ended to diff sch.PNG
    single-ended to diff sch.PNG
    14 KB · Views: 171
  • single-ended to diff waves.PNG
    single-ended to diff waves.PNG
    15.5 KB · Views: 136
  • single-ended to diff.asc
    2 KB · Views: 139
Last edited:
Looks promising, what did you use to simulate this? What are the values of the outputs when the input signal is zero?
 
jnnewton said:
Looks promising, what did you use to simulate this? What are the values of the outputs when the input signal is zero?
I used LTspice (SwitcherCAD III) from Linear Technology. It's free.
When PWM=0, +out=-5, -out=+5. If you want them to both be zero, you have to somehow distinguish between a valid zero volts and an invalid zero volts. Now, if PWM=0 and vcc=0, the outputs will both be zero. So, if you can guarantee that the PWM is always valid when vcc is on, you're OK, except maybe during the vcc transition.
 
jnnewton said:
Looks promising, what did you use to simulate this? What are the values of the outputs when the input signal is zero?

Which was exactly what I proposed, but without the diagram - and why I asked what output you required?.
 
Nigel Goodwin said:
Which was exactly what I proposed, but without the diagram - and why I asked what output you required?.
One schematic is worth several words.:D
EDIT: I just realized the signal levels in the first schematic I posted are half what is required. Here's the correction.
 

Attachments

  • single-ended to diff sch.PNG
    single-ended to diff sch.PNG
    13.9 KB · Views: 145
  • single-ended to diff waves.PNG
    single-ended to diff waves.PNG
    15.5 KB · Views: 138
  • single-ended to diff.asc
    2 KB · Views: 125
Last edited:
Nigel Goodwin said:
Yep! - but I was at work and didn't have time for drawing pictures! :rolleyes:
Work!:confused: I'm retired, vegging out in front of my computer, slowly going broke.:eek:
 
I just realized the signal levels in the first schematic I posted are half what is require
Actually, no it wasn't. If vout- is -5 and vout+ is +5, the net is +10 and vice versa. It was right.

When PWM=0, +out=-5, -out=+5. If you want them to both be zero,
which I do
you have to somehow distinguish between a valid zero volts and an invalid zero volts.
which i don't know how to do.

Now, if PWM=0 and vcc=0, the outputs will both be zero. So, if you can guarantee that the PWM is always valid when vcc is on, you're OK, except maybe during the vcc transition.

The transistion is a problem, it causes the motor to jump, b/c it sees the 5V prior to the pwm. so what i can try is the 5V from an output pin.
 
jnnewton said:
Actually, no it wasn't. If vout- is -5 and vout+ is +5, the net is +10 and vice versa. It was right.

which I do which i don't know how to do.



The transistion is a problem, it causes the motor to jump, b/c it sees the 5V prior to the pwm. so what i can try is the 5V from an output pin.
That might work. If you are lowpass filtering the PWM prior to going to the op amp, you should put the same filter on +5V. If you are not filtering the PWM, you will need to pay attention to op amp bandwidth and slew rate.
 
Status
Not open for further replies.

Latest threads

Back
Top