+ Post New Thread
Results 1 to 10 of 10

26th January 2020, 21:14 #1
 Join Date
 Sep 2008
 Location
 cambridge
 Posts
 7,147
 Helped
 519 / 519
 Points
 34,398
 Level
 45
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?

Advertisement

26th January 2020, 22:49 #2
Awards:
 Join Date
 Jul 2009
 Location
 Aberdyfi, West Wales, UK
 Posts
 13,676
 Helped
 4539 / 4539
 Points
 83,156
 Level
 70
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.PLEASE  no friends requests or private emails, I simply don't have time to reply to them all.
It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.
1 members found this post helpful.

27th January 2020, 07:22 #3
 Join Date
 Sep 2008
 Location
 cambridge
 Posts
 7,147
 Helped
 519 / 519
 Points
 34,398
 Level
 45
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..

27th January 2020, 08:10 #4
Awards:
 Join Date
 Apr 2014
 Posts
 16,466
 Helped
 3736 / 3736
 Points
 81,186
 Level
 69
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.
KlausPlease don´t contact me via PM, because there is no time to respond to them. No friend requests. Thank you.

Advertisement

27th January 2020, 08:49 #5
 Join Date
 Feb 2012
 Location
 L.A. USA Zulu 8
 Posts
 3,705
 Helped
 881 / 881
 Points
 19,304
 Level
 33
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 4resistor ladder network with an op amp buffer to generate a 16 step D/A output.Zapper
Curmudgeon Elektroniker

27th January 2020, 10:15 #6
 Join Date
 Sep 2008
 Location
 cambridge
 Posts
 7,147
 Helped
 519 / 519
 Points
 34,398
 Level
 45
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.

27th January 2020, 17:38 #7
 Join Date
 Feb 2012
 Location
 L.A. USA Zulu 8
 Posts
 3,705
 Helped
 881 / 881
 Points
 19,304
 Level
 33
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 fullscale 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).
Zapper
Curmudgeon Elektroniker

Advertisement

1st February 2020, 19:41 #8
 Join Date
 Sep 2008
 Location
 cambridge
 Posts
 7,147
 Helped
 519 / 519
 Points
 34,398
 Level
 45
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 4bit 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
http://ww1.microchip.com/downloads/e.../40001824B.pdf

1st February 2020, 20:28 #9
 Join Date
 Feb 2014
 Posts
 987
 Helped
 339 / 339
 Points
 6,893
 Level
 19
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 5bit 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 10bit DACs
3x 5bit DACs
6x HighSpeed Comparators
10bit ADC with 17 channels
Zero Cross Detect (ZCD)
3x Programmable Ramp Generator (PRG)
3x 10bit PWMs
3x 16bit PWMs
2x 100mA I/Os
3x Capture, Compare, PWM (CCP)
3x Complementary Output Generator (COG)
4x Configurable Logic Controller (CLC)
EUSART
I2C/SPILast edited by asdf44; 1st February 2020 at 20:52.
1 members found this post helpful.

2nd February 2020, 00:09 #10
Awards:
 Join Date
 Jul 2009
 Location
 Aberdyfi, West Wales, UK
 Posts
 13,676
 Helped
 4539 / 4539
 Points
 83,156
 Level
 70
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 tristate control of the pins too.
Brian.PLEASE  no friends requests or private emails, I simply don't have time to reply to them all.
It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.
+ Post New Thread
Please login