![]() |
![]() |
![]() |
|
|
|||||||
| Electronic Projects Design/Ideas/Reviews Are you building an electronic project or want to? Maybe you need some assistance? Come and submit your electronic questions here and let our experienced members find a solution. |
|
|
Thread Tools | Display Modes |
|
|
(permalink) |
|
Experienced 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 |
|
|
|
|
|
(permalink) |
|
Super Moderator
|
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. |
|
|
|
|
|
(permalink) |
|
Experienced Member
|
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 by jnnewton; 8th January 2008 at 11:44 AM. |
|
|
|
|
|
(permalink) | ||
|
Super Moderator
|
Quote:
Quote:
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. |
||
|
|
|
|
|
(permalink) | |
|
Experienced Member
|
Quote:
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. |
|
|
|
|
|
|
(permalink) |
|
Super Moderator
|
The output of the microcontroller doesn't really matter - what output do you want on the differential outputs?.
|
|
|
|
|
|
(permalink) |
|
Experienced Member
|
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 |
|
|
|
|
|
(permalink) |
|
Experienced Member
|
The values are not discrete, see attached to avoid confusion (x-axis is time, y is voltage)
|
|
|
|
|
|
(permalink) | |
|
Experienced Member
|
Quote:
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 |
|
|
|
|
|
|
(permalink) | ||
|
Experienced Member
|
Quote:
Quote:
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. |
||
|
|
|
|
|
(permalink) |
|
Experienced Member
|
Why can't you do it like this:
Last edited by Roff; 9th January 2008 at 04:23 PM. |
|
|
|
|
|
(permalink) |
|
Experienced Member
|
Looks promising, what did you use to simulate this? What are the values of the outputs when the input signal is zero?
|
|
|
|
|
|
(permalink) | |
|
Experienced Member
|
Quote:
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. |
|
|
|
|
|
|
(permalink) | |
|
Super Moderator
|
Quote:
|
|
|
|
|
|
|
(permalink) | |
|
Experienced Member
|
Quote:
EDIT: I just realized the signal levels in the first schematic I posted are half what is required. Here's the correction. Last edited by Roff; 9th January 2008 at 08:33 PM. |
|
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Latest |
| The Oscilloscope | ElectroMaster | Electronic Theory | 12 | 3rd February 2008 01:45 PM |
| Using Oscilloscopes | mechie | Electronic Theory | 9 | 29th November 2007 09:48 PM |
| Anybody got information on line driving a c-sync signal? | FusionITR | General Electronics Chat | 8 | 15th April 2006 04:16 PM |
| Differential transformer how to measure this signal | sardineta | Electronic Projects Design/Ideas/Reviews | 18 | 7th October 2004 02:30 PM |
| ground referencing a differential input signal | giaracam | Electronic Projects Design/Ideas/Reviews | 2 | 22nd September 2004 12:41 PM |