Programmable voltage ramp with 10mV precission

Thread Starter

Sergi Martori

Joined Nov 22, 2018
10
Hello, this is my first post here :)

I'm working on project that needs to be supplied with voltage ramps to execute some tests. That ramps goes from -5V to 20V, or 6V to 42V, for exemple, and ramps should be stepped, with 10mV steps. I've been looking for days for a feasible solution, and I don't have any idea how to do it..

Maybe a OpAmp with a DAC or something similar can be the solution, I don't know. I require some help please.

Thank you!!
 

AlbertHall

Joined Jun 4, 2014
12,625
6V to 42V is a range of 36V and in 10mV steps that's 3600 steps so a 12 bit DAC (4096 steps) and an opamp would do the job.
How much current does the output need to supply?
 

Thread Starter

Sergi Martori

Joined Nov 22, 2018
10
6V to 42V is a range of 36V and in 10mV steps that's 3600 steps so a 12 bit DAC (4096 steps) and an opamp would do the job.
How much current does the output need to supply?
It'll be no more than 10-15 mA.

Can you indicate me some reference circuit? or some configuration to search.

Thanks! :)
 

Thread Starter

Sergi Martori

Joined Nov 22, 2018
10
I have an arduino controlling the system, in the future is planned to change to more advanced controller, but at that stage, i think that its enough
 

danadak

Joined Mar 10, 2018
4,057
You could use PWM approach in Arduino. But its Vcc would have to
be driven by a reference to get absolute accurate steps. Best to
use OpAmp after PWM filter to buffer the filter output..

Note if you want a fast ramp thats a filter/ripple compromise.

Attached some info on filter design.

Regards, Dana.
 

Attachments

danadak

Joined Mar 10, 2018
4,057
16 Bit PWM in Arduino.

Or do a SW PWM to whatever res you want. Of course there
are noise jitter issues when reaching for the sky.

Regards, Dana.
 

Thread Starter

Sergi Martori

Joined Nov 22, 2018
10
The ramp will be very slow. Like 3-5 ms in each step, thats why i want to have the control XD.

I'm going to read the files you attachad, thanks danadak!
 

danadak

Joined Mar 10, 2018
4,057
This pretty easy to do on a PSOC (everything on chip except R & C) -

upload_2018-11-23_21-46-49.png

Uses only small portion of chip capability.


Regards, Dana.
 

Thread Starter

Sergi Martori

Joined Nov 22, 2018
10
but what about when the ramp, will be the same resolution having the amplifier with 40V output?

I'm trying the circuit that you post, it's working fine for one first aproximation I think, but the filter should be better, the ripple with a first order filter (and with order 2, with 2 C and 2 R, in the image) is too much.
Then, I found this post: https://www.allaboutcircuits.com/te...s-filter-a-pwm-signal-into-an-analog-voltage/ where explains the same problem. Do you think that connecting the filter output with a DAC will be enought for my purposes?

Really thank you!
 

Attachments

danadak

Joined Mar 10, 2018
4,057
The res will still be 16 bits, 1 LSB = 40V / 16 bits =~ .6 mV.

Filter design is a tradeoff of ripple vs settling time. The two ap notes
I posted earlier cover this.

Regards, Dana.
 

ebp

Joined Feb 8, 2018
2,332
I think PWM is likely to be unsatisfactory.
A 16 bit divider with an input clock of 16 MHz has a period of about 4 ms - right in the middle of your target step dwell time. You essentially have no time for a filter to settle and you will need a filter with very low cutoff frequency to get the ripple down to to some reasonably low fraction of 10 mV. You do have the advantage that if you are generating a ramp the settling time of the filter from one ramp step to the next will be short relative to what it would be for arbitrary changes in input duty cycle.

I think you would be much better off using DACs, probably with serial input. You may find it convenient to use more than one DAC to better manage the bipolar output range (that is, variable offset from 0 V), though a single DAC of at least 13 bits might be sufficient (13 bits at 10 mV per count is 82 V; 12 bits won't be enough for a range of -5 to +42 V = 4700 steps). The other consideration is that using a precision voltage reference for a true ADC is simple. With PWM, it is somewhat more of an issue since the reference must in some fashion become the power supply for the switch. You would need only sufficient filtering to deal with possible glitch energy, so settling time would be very much shorter.
 

danadak

Joined Mar 10, 2018
4,057
A L-C needs 3 stages of L-C LPF to do .1 db ripple. Maybe 1 more
stage would be needed.

https://www-users.cs.york.ac.uk/~fisher/cgi-bin/lcfilter

Note this was done at 10 Khz, really needs to be done at lower
clk rate. I missed the 4 mS ebp mentioned ? What is your settling
time spec ?

Have to admit, a single digit uS settling time for a 16 bit DAC pretty
attractive, but price is a problem.

One more question, do you need relative or absolute accuracy for DAC out ?

Regards, Dana.

PS : Just saw your settling time step.
 
Last edited:

danadak

Joined Mar 10, 2018
4,057
One other question, does your ramp always start at 0 and go the full range ?

If so a gated current source driving a simple cap could accomplish goal. Ignoring
for the moment C tolerance, T sensitivity, same for current source. No filter needed,
C is an integrator. There would be challenges in the gate circuit to achieve 16 bit
accuracy, eg. feed thru, transient response.....

Regards, Dana.
 
Last edited:

Thread Starter

Sergi Martori

Joined Nov 22, 2018
10
Note this was done at 10 Khz, really needs to be done at lower
clk rate. I missed the 4 mS ebp mentioned ? What is your settling
time spec ?

Have to admit, a single digit uS settling time for a 16 bit DAC pretty
attractive, but price is a problem.

One more question, do you need relative or absolute accuracy for DAC out ?
There are different test cases, this is one example table of the ramps:
upload_2018-11-26_17-46-24.png

I think I can shift the ramp to properly rank of voltages with another power supply or DC/DC converter.
These are test cases from ISO that I'm working on, thats why i need to be accurate.

For now, the arduino is working well with 16 bit resolution pwm (it needs a special library)

What is the frequency of the Arduino 16-bit PWM signal?
For accomplish this resolution arduino has to use the Timer1, that has the 16bit resolution. Arduino clock runs at 16MHz
 

ebp

Joined Feb 8, 2018
2,332
I would seriously consider using two 12 bit ADCs, one to generate steps and the other to provide an offset voltage for the output amplifier. I haven't looked for such things in a long time, but I suspect there are some fairly inexpensive dual (or more) 12 bit DACs with serial (i2c, spi, etc) interface that are probably less expensive than a single 16 bit DAC. There may be some 14 bit DACs at reasonable prices.

Just did a quick web search; didn't look at details but there are lots of dual 12 bit DACs at low prices, some with internal reference.
 
Top