Author Topic: el cheapo reference generator  (Read 5925 times)

0 Members and 1 Guest are viewing this topic.

Offline dannyfTopic starter

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
el cheapo reference generator
« on: April 07, 2015, 01:16:52 am »
Finally decided to test out various ideas for a reference generator.

It is fashioned after the Linear AN86, closed loop reference generator corrected via an adc.

Wanted to try out the use of pwm as dac - but the code should be written so it is easy to switch to a real dac.

The main control unit is a mcu - PIC24F, with its four pwm output channels -> so I can output deferentially, both positive and negative, under unipolar power source.

Here is the conceptual drawing.
================================
https://dannyelectronics.wordpress.com/
 

Offline dannyfTopic starter

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: el cheapo reference generator
« Reply #1 on: April 07, 2015, 01:20:49 am »
Here is the refgen, running open loop and outputing 200 -> 20 bit total, 10bit lsb @ 3.3Vcc-> we should be getting 639mv output, vs. 624mv.
================================
https://dannyelectronics.wordpress.com/
 

Offline dannyfTopic starter

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: el cheapo reference generator
« Reply #2 on: April 07, 2015, 01:28:06 am »
I only generated one channel of 10-bit pwm output.

Next:

1) combine two channels of pwm output to form a high resolution output;
2) explore higher order pwm filtering.
================================
https://dannyelectronics.wordpress.com/
 

Offline dannyfTopic starter

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: el cheapo reference generator
« Reply #3 on: April 07, 2015, 01:30:36 am »
BTW, the output is very stable -> even at 0.1mv (smallest that my meter can go), it barely moved a single digit.

The low-pass filter has a very long time constant - the readings stopped moving after 30 - 45 seconds -> this is the price to pay for a pwm dac.
================================
https://dannyelectronics.wordpress.com/
 

Offline AlfBaz

  • Super Contributor
  • ***
  • Posts: 2184
  • Country: au
Re: el cheapo reference generator
« Reply #4 on: April 07, 2015, 01:41:08 am »
Seeing you can change the duty cycle between pulses have you tried increasing resolution using this technique?
 

Offline Kalvin

  • Super Contributor
  • ***
  • Posts: 2145
  • Country: fi
  • Embedded SW/HW.
Re: el cheapo reference generator
« Reply #5 on: April 07, 2015, 07:37:11 am »
Dithering might provide few extra bits. "PWM resolution enhancement through dithering technique"

http://www.st.com/st-web-ui/static/active/en/resource/technical/document/application_note/DM00119042.pdf

Dual PWM and higher order PWM analysis:
http://www.openmusiclabs.com/learning/digital/pwm-dac/dual-pwm-circuits/
 

Offline dannyfTopic starter

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: el cheapo reference generator
« Reply #6 on: April 07, 2015, 10:44:17 am »
Quote
Dual PWM and higher order PWM analysis:
http://www.openmusiclabs.com/learning/digital/pwm-dac/dual-pwm-circuits/

That's an interesting circuit. I don't quite buy its argument (for the error cancellation part) but will give it a try. The use of digital gates vs. opamps is helpful.
================================
https://dannyelectronics.wordpress.com/
 

Offline macboy

  • Super Contributor
  • ***
  • Posts: 2254
  • Country: ca
Re: el cheapo reference generator
« Reply #7 on: April 07, 2015, 02:20:25 pm »
If you use PWM for the upper range, you will always have problems with the PWM noise. Remember that you are shooting for a resolution 10 bits (1000 times) better than a single step of your (upper) 10-bit PWM signal. A better idea is a 'real' DAC for the upper x bits and PWM for the lower x bits. Then the residual PWM noise will be down hopefully well below the least significant (20th) bit. The real DAC can be a simple one, just 12 or 14 bits. Make sure it is monotonic and you probably want to use an external reference (or use one with a really good stable internal reference and a ref out pin).

Speaking of the reference, I get the impression that you are just using the 3.3 V supply of the PIC as the reference (filtered PWM output is some % of the supply). This is fine to begin with when playing with code, but when you are serious about making a stable accurate DAC, you will need to use a real, stable reference, and use the PWM signal to switch that reference.

In your first schematic, don't forget that you need to scale the LSB DAC output down by a factor of 1000 or so. You also need some overlap so that you can set and forget the MSB DAC, and adjust only with the LSB one, so for 20 bits of resolution, you probably want two 12 bits DACs giving 4 bits of overlap, or a 14 bit DAC for MSB and 10 bit (PWM one) for LSB. You need that overlap.

Don't forget that the PWM signal will be controlled according to feedback received from an ADC measuring the overall output, so you can't make the RC time constant of the PWM filter too long, or the control loop will need to be made to be horribly slow. You don't want to have to wait several minutes for the final value to settle, and you also need to be able to respond to variations that will be caused by small temperature changes, drafts, etc.

This is not impossible but you are far from it. Fluke used PWM techniques to get down to ppm accuracy in the 5440A/5440B and other calibrators.
 

Offline Kalvin

  • Super Contributor
  • ***
  • Posts: 2145
  • Country: fi
  • Embedded SW/HW.
Re: el cheapo reference generator
« Reply #8 on: April 07, 2015, 02:36:19 pm »
A cheap Microchip Dual 12-bit DAC might be sufficient for a 20-bit design. For example, 8-bits for MSB and 12-bits for LSB. Anyway, PWM solution is an interesting one and worth testing.
 

Offline macboy

  • Super Contributor
  • ***
  • Posts: 2254
  • Country: ca
Re: el cheapo reference generator
« Reply #9 on: April 07, 2015, 02:42:55 pm »
A cheap Microchip Dual 12-bit DAC might be sufficient for a 20-bit design. For example, 8-bits for MSB and 12-bits for LSB. Anyway, PWM solution is an interesting one and worth testing.
No, you must have significant overlap. For 20 bit resolution, use a total of at least 24 bits worth of DACs.
 

Online Andreas

  • Super Contributor
  • ***
  • Posts: 3243
  • Country: de
Re: el cheapo reference generator
« Reply #10 on: April 07, 2015, 08:01:15 pm »
The low-pass filter has a very long time constant - the readings stopped moving after 30 - 45 seconds -> this is the price to pay for a pwm dac.

not really, it needs only some 10 ms when using a integrator:

http://www.edn.com/design/other/4326640/DC-accurate-32-bit-DAC-achieves-32-bit-resolution
http://m.eet.com/media/1133099/14856-figure_1.pdf

With best regards

Andreas
 

Offline Kalvin

  • Super Contributor
  • ***
  • Posts: 2145
  • Country: fi
  • Embedded SW/HW.
Re: el cheapo reference generator
« Reply #11 on: April 08, 2015, 12:40:33 pm »
Just for a reference, here is one thread discussing high resolution (not high precision) PWM DAC:

https://www.eevblog.com/forum/projects/general-purpose-power-supply-design-7488/135/

Discussion starts somewhere at page 4 and continues well beyond page 10.
 

Offline dannyfTopic starter

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: el cheapo reference generator
« Reply #12 on: April 08, 2015, 04:45:29 pm »
Thanks. Nice find.
================================
https://dannyelectronics.wordpress.com/
 

Offline Marco

  • Super Contributor
  • ***
  • Posts: 6717
  • Country: nl
Re: el cheapo reference generator
« Reply #13 on: April 24, 2015, 10:34:38 pm »
Could you do something analogous to Kelvin Varley with PWM? Have 2 16 bit PWMs with R-C filters, add two series resistors and then select between those outputs with a multiplexer to a capacitor with a third PWM signal?

PS. I guess in a much smarter way this is what the EDN "32 bit" PWM DAC does ... calibrators like the Fluke 57LFC seem to just add two PWMs together with resistor dividers instead though, I just don't understand how they can get good monotonicity like that, won't that introduce errors when the LSB PWM DAC ticks over between FFxxFF and 00xx00? It seems to me this can't be linear by design but relies on the quality of the resistor networks and calibration. Or am I not thinking it through right? (I never understood how the EDN circuit worked either, so I probably am.)

PPS. the low pass filter in the 57LFC is painfully clever ... look upon it and despair.
« Last Edit: April 26, 2015, 02:10:50 pm by Marco »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf