Solved - Single PWM -> positive and negative analog voltage output?

I am very much a newcomer to electronics but have built (not designed) a couple of larger systems (2x25W Class A stereo amp and a Flight Computer)

The Flight Computer (I fly sailplanes as a hobby) have aspired me to get more knowledge of it all, i2c/ sensor data and input/output possibilities.

In our sailplane we have an instrument called a electronic vario meter, it indicate vertical movement of the aircraft. Since its electrical it displays information from a VDC output, V+/V- for corresponding up/down movement. We have analouge variometer onboard that move by air pressure alone, the electric vario display same data via computed signal.

I am trying to learn how to make this display vertical movement based on sensory data. Since it respond to VDC and I have PWM-data on hand I want to convert the PWM data through a DAC in order to get VDC.

Is there a way to achieve both positive and negative VDC output from a single PWM source? I assume there is but what would be the preferred (simply) method to do so? Two PWM outputs maybe, one converting 0-127bits to -2,5-0VDC, and the other convering the remaining bits to 0-2,5V, each through its own DAC?

I have no expectations that you tell me in detail how2, that is not my intent. Pointers would however be appreciated :) I have searched converting PWM/VDC and found good information related to that topic, but none that cover my question specifically.

TIA

Not quite sure where the PWM comes in because you would already have the duty-cycle information in your code which would be an 8-bit variable (0-255). If this is the case, then all that's needed is an 8-bit, ±2.5V dual supply DAC.

Thank you for your reply Lloyd :)

We use today in our glider a self-built Flight Computer with a 7" touchscreen (link to designers project page - http://www.openvario.org/doku.php?id=projects:series_00:top ) It is based on a Cubieboard, Mainboard Shield, an RJ45 inout shield and a sensor-PCB which gather most of the data. (GPS is fed by an external device)

Having built this FC have aspired us to learn more about signal obtaining, data processing and output options.

My first experiment was to get a read-out from the electrical vario mentioned in the first post and the datastream for this would be digital. I did yesterday use the Arduino Fade program to influence the electrical vario via a RC low pass filter and got that to work.

Now I want to tinker getting the vario move according to both negative/positive voltage through a single circuit. Your dual supply DAC reference might help me in that direction :)

Not sure if I understand it right, but here is a diagram (untested) that changes 5volt PWM into +/- 2.5volt.
Leo…
PWM to +- 2v5.png

I think R3 to R6 should be 22k to balance the DC offset (creating similar impedance on the two inputs, though at 10k scale, I doubt that would matter).

Offset can be adjusted in software. PWM 128 should give 0volt, but is could also be 127 or 129. Leo..

Wawa:
Not sure if I understand it right, but here is a diagram (untested) that changes 5volt PWM into +/- 2.5volt.
Leo…
PWM to +- 2v5.png

That circuit tries to give -2.5 to +7.5V out, it is a non-inverting amplifier with a gain of 2.

Use a differential amplifier circuit with gain 1, input reference 2.5V and output reference 0V.

MarkT: That circuit tries to give -2.5 to +7.5V out, it is a non-inverting amplifier with a gain of 2.

Look again. R3,R3 is like a single 5k resistor connected to a 2.5volt source. R4,R6 is also 5k (easier build with all 10k resistors). Leo..

This is very helpful guys - thank you for your ideas and I will look into them :)

I have so far familiarized myself with the instrument on hand and established the following: Max/min deflection is reached at approx +/-1,4VDC. Using the Arduino Fading sketch and feeding that PWM ouput into the RC-filer I was able to command the instrument at will in one direction. Flipped voltage to get movement the other direction.

My step forward now is to build a circuit that takes a 0-255PWM signal output and convert this into ±1.5V.

Regarding sourcing an 8-bit, ±2.5V dual supply DAC: I searched a little and got hits on i.e MAX522 etc, would this IC be appropriate for this particular task? I can adjust max voltages either way either through components or code, that is secondary at this point.

The goal of this excercise is to build a simple system that will sense static air pressure and display sink/climb data through the instrument.

So both terminals of the instrument are 'floating' (one is not grounded)?

If you connect one terminal to a voltage divider, e.g. 2x 1kohm. And the other one to the filtered PWM signal. Then you have deflection both ways. Leo..

Wawa: So both terminals of the instrument are 'floating' (one is not grounded)?

Correct. The instrument (vario) have a 4-pin input where the outer two pins are designated GND while I have only applied voltage to the inner two (V+/V-) I got no indication on the vario with 0V connected to GND.

Wawa: If you connect one terminal to a voltage divider, e.g. 2x 1kohm. And the other one to the filtered PWM signal. Then you have deflection both ways.

Very interesting :) Thank you very much!

I have now read a little about voltage dividers, Kirchhoffs Law and tried to wrap my head around the circuit required, ref image attachment which is my first attempt. Have I understood this right?

My thinking is that I have a 5V and 0V line out feeding the RC Lowpass filter where the 0V line connect between R2/R3 to create 0V reference splitting 5V span into ±2.5V.

Not quite, need this arrangement.

See this paper also (sorry about the long link)
http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=17&cad=rja&uact=8&ved=0ahUKEwjyuN22n_rLAhWBeCYKHZAgBMIQFghrMBA&url=http%3A%2F%2Fwww.phys.ufl.edu%2F~reitze%2Fteaching%2Fspring2007%2Flectures%2Foscilloscope.pdf&usg=AFQjCNG9Etv-J1-8xIDnik6AKATYcu1hMg&sig2=R5L5PdTtfMUFVL09XN6jiA

I meant this.
Instrument between the PWM signal and the voltage divider.
This can only work if the instrument doesn’t need much drive current.
Otherwise opamp buffers must be used.
Leo…
Unknown_instrument.png

That will give 2.5V +/- 2.5V. 1Ks are too strong there, I'd go with 100Ks.

CrossRoads: That will give 2.5V +/- 2.5V. 1Ks are too strong there, I'd go with 100Ks.

That will still give +/- 2.5volt. You can always restrict the PWM range in software to output +/- 1.4volt.

Problem is that we don't know the input impedance of the instrument. Leo..

Why not add a split rail +/- powered summing amp at the end of that to shift the 0 to 5V dc output of you RC LPF to +/- Analog out ?

You must have missed post#3 :) Leo..

Right.

Leo, ref your post#3 schematic:

Which device did you have in mind, I have encircled it in red.
The rest of the circuit I can read fine but the details of the marked device escapes me.

I have also added the image of the actual device I am playing with (CAF021.jpg) and also a visualiziation how the VDC-signal affect the instrument gauge.

PWM2v5v2.png

CAF-021.jpg