How getting rid of staircase from DAC?

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How can I reconstruct (smoothen) an analog signal from a DAC (AT90PWM3)?
Because when I use an RC or a low pass filter (2nd order) it changes the shape of the signal.
How do I keep the shape of the signal the same while getting rid of the staircase in the analog signal? ( when using PWM -> from dc pulses to analog without staircase.)
(signal in picture is at low frequency - 444Hz.)

Attachment(s): 

RES

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

http://www.lmgtfy.com/?q=dac+sta...

First entry - just need to get your LPF time constant right - lower C probably...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Try using a slightly larger capacitor value on the PWM output. Each step will not rise or fall as much during the off period of the PWM duty cycle.

I'm not sure how adding a low-pass filter changes the shape of the signal. The small waves on the outline of the blue sine wave are high-frequency components of the PWM process. A low-pass first or second order filter with a cut-off frequency of 8KHz or so would remove these components and make the sine wave smoother.
A PWM signal is always going to have more high-frequency components than a DAC signal. The DAC holds the voltage at the 'stairstep' level while the PWM signal is always rising and falling around the 'stairstep' level.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I thought RES wanted to keep the staircase, but wanted the slope to be a straight line rather than stepped.

But the requirement is not clear....

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Better low pass filter (parameters must be carefully chosen).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Looks like a 64 point sine wave? To get a smooth sine wave, you need to get rid of everything above 444 hz. Try a 1st order filter f=1/(twopi*RC) at 444hz. If its still steppy, add another section but make the 2nd stage R 10x bigger and the C 10x smaller. (Higher impedance so it doesnt load down the 1st stage). The sawtooth is trickier, because its the sum of the fundamental and 15 or 20 harmonics each one octave higher than the previous. Lets say you are spitting out 64 samples at 28khz sample rate. You need a 14khz filter that rolls off down to a LSB in one octave. Thats about a 6th or 7th order filter. But it might work just great with the same old 2nd order passive RC, but at 12 or 14 khz. Try it.

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Whatever filter I place behind the DAC, the signal converts to a sine shape, IRL and in a simulator. :cry:

Attachment(s): 

RES

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So you are saying that you are trying to generate a sawtooth but without the steps being so visible? Obviously one way is to simply use a DAC with more bit resolution. In the ramp in your original scope picture it looks like there are maybe something like 64 or 128 steps from trough to peak. That suggests you are using just a 6 or 7 bit DAC?