# Ramping a reference voltage up from, or down to zero volts, over ~200us

1. ## Ramping a reference voltage up from, or down to zero volts, over ~200us

Hi,
Please assist us in ramping a reference voltage down to zero volts, or back up to the reference voltage. This being done at random times, on demand. The ramp should be over some 200us. It should be linear, but its not too bad if its not that straight….it could even be say in 10 steps (up or down).

The reference voltage could be any level from 0V to 0.5V.

….So eg it could be at, say, 0.23V…and every now and again we would need to ramp it down to zero volts….then some time later, ramp it back up to 0.23V.

Would you agree that the attached method is the best way?

It just uses a microcontroller to PWM the buffered reference voltage…(please ignore RC values) variable PWM to make it ramp over 200us…as discussed, it could be 10 steps, so 10 different duty cycles inside the 200us ramp time.
Please confirm there are no nice analog modules which do this, and no nice sub circuits which can do it better than this?

•

2. ## Re: Ramping a reference voltage up from, or down to zero volts, over ~200us

Why not just use the PWM signal alone and a buffer at the output (if needed). 200uS is fairly quick for a ramp to go from top/bottom/top using 10 steps of PWM, it implies each step is only 20uS. Far from impossible but maybe tricky and the PWM rate would also have to be quite high.

Maybe consider a simple timed on/off pulse charging or discharging a capacitor. If you use a constant current feed it will make a linear ramp.

Brian.

1 members found this post helpful.

3. ## Re: Ramping a reference voltage up from, or down to zero volts, over ~200us

Thanks, i think we will need a negatiove supply to get a good ramp down from 0.5V..

4. ## Re: Ramping a reference voltage up from, or down to zero volts, over ~200us

Hi,

15 equal resistors in a string connected to GND and Vref.
Connect a 16:1 analog mux to each tap, including GND and Vref.
Control the 4 MUX digital inputs in counter style UP and DOWN.
(15 steps within 200us = 75 kHz, simple for any ucontroller or PLD or discrete counter)

Use a filter at the MUX analog output if you like.
... gives almost perfect results from true GND up to true Vref.(without negative supply)

Add a buffer (rail to rail Opamp) if you like.
Good results down to some millivolts without negative supply.

Klaus

•

5. ## Re: Ramping a reference voltage up from, or down to zero volts, over ~200us

Can you use a microcontroller with a DAC output (not PWM)?
Or use an external DAC?
Or, if you have four spare digital outputs on the micro, you could use a simple 4-resistor ladder network with an op amp buffer to generate a 16 step D/A output.

6. ## Re: Ramping a reference voltage up from, or down to zero volts, over ~200us

Thanks,
Klaus your solution looks great, i will try it now.

I had come up with the attached (LTspice sim and pdf schem) but it is not as good as yours since it needs a +/-5V supply, and the ramp is a little less linear than i'd like, plus subject to capacitor value tolerance.....plus the vbe tolerance of the current source....also, the ramp varies in time as the reference voltage is at lower values................so your method looks superb. Thanks Again.

7. ## Re: Ramping a reference voltage up from, or down to zero volts, over ~200us

Below is the simulation of a example circuit using 4 resistors in a binary ladder network to give the 16 steps.
It is shown connected to the 5V outputs of a binary counter (outputs 1, 2, 3, and 4), but it could be connected to an accurate reference voltage through a 4:1 analog mux if more accuracy is needed.
The value of R8 determines the full-scale voltage relative to the reference voltage.

The sim only shows a counter up, but it obviously can be used going down also.

That would give similar results to Klaus's approach but only requires four resistor (and a 4:1 mux if needed).

•

8. ## Re: Ramping a reference voltage up from, or down to zero volts, over ~200us

Thanks,
I put a circuit together for the stepwise ramping voltage using a 4-bit Binary counter, and an analog multiplexor as per Klaus’s kind email.
Unfortunately I was told that we cant do it like that, (too expensive, too many components) and should just do it with a microcontroller with a DAC output.
In fact, we actually need two stepwise ramping voltages as in the attached. (the ramp is over 200us). One ramp goes up whilst the other simultaneously goes down. The ramps may go up to or down from a level which may not always be the same for every “ramp episode”.
Do you know if its possible to do this from the two DAC outputs of say a PIC16F18856?
LTspice sim and waveform schem attached.

PIC16F18856

9. ## Re: Ramping a reference voltage up from, or down to zero volts, over ~200us

Yep Micro Dac seems like the best option.

I see only one 5-bit DAC. Seems like you need 2. Though the PWM controllers could be used as dacs if you really needed to use this part.

EDIT: I'd look at this line Treez, it actually has 3 programmable ramp generators...and basically everything you'd ever need for your power applications (You can make an entire hybrid analog/digital controller for almost any application with this thing and its \$2).

https://www.microchip.com/wwwproducts/en/PIC16F1778
3x Op Amps
3x 10-bit DACs
3x 5-bit DACs
6x High-Speed Comparators
Zero Cross Detect (ZCD)
3x Programmable Ramp Generator (PRG)
3x 10-bit PWMs
3x 16-bit PWMs
2x 100mA I/Os
3x Capture, Compare, PWM (CCP)
3x Complementary Output Generator (COG)
4x Configurable Logic Controller (CLC)
EUSART
I2C/SPI

1 members found this post helpful.

10. ## Re: Ramping a reference voltage up from, or down to zero volts, over ~200us

If you have pins to spare, you can also configure them as complimentary outputs to the ones forming a DAC.
You can also produce more than n^2 combinations of n outputs by using tri-state control of the pins too.

Brian.

--[[ ]]--