Programmable or arbitrary slew rate of square wave - Page 1
Forum section: electronics / projects

author: ricko_uk
author_rank: Super Contributor
timestamp: December 14, 2020, 09:46:05 am
content: Hi,excluding a DAC type solution, is there any way to have a square wave have a either programmable or fixed but arbitrary slew rate?Thank you

author: David Hess
author_rank: Super Contributor
timestamp: December 14, 2020, 08:44:55 pm
content: Quote from: ricko_uk on December 14, 2020, 09:46:05 amTexas Instruments has an application note showing one way to implement a fixed slew rate:https://www.ti.com/lit/ug/tidu026/tidu026.pdfA more practical method uses a programmable current source and current sink to drive a capacitor or integrator with the output buffered. A complex example of this using differential pairs can be found in the Tektronix PG508 pulse generator. The Tektronix PG505 does it with a diode bridge which can be very fast.

author: bson
author_rank: Unknown
timestamp: December 14, 2020, 10:41:07 pm
content: Either with a programmable current source, or a fixed current source and programmable load impedance...

author: Alex Eisenhut
author_rank: Super Contributor
timestamp: December 14, 2020, 10:52:29 pm
content: Curious Marc has just such a beastie on his operating table...

author: ricko_uk
author_rank: Super Contributor
timestamp: December 14, 2020, 11:39:39 pm
content: Thank you allThe programmable current source driving a capacitor seems simple and good enough solution. I will most likely go with that one.But I am not clear about is the programmable load impedance. I googled it and could not find much info. Are there programmable load impedance ICs? Or how do you implement it?Thank you

author: tggzzz
author_rank: Super Contributor
timestamp: December 15, 2020, 12:02:10 am
content: Quote from: ricko_uk on December 14, 2020, 09:46:05 amI expect you want a rectangular wave rather than the special case of a square wave. Have a look at a Tektronix 115; you can find the manual and schematics on the TekWiki.Some outputs are shown here:https://entertaininghacks.wordpress.com/2018/05/08/digital-signal-integrity-and-bandwidth-signals-risetime-is-important-period-is-irrelevant/

author: bson
author_rank: Unknown
timestamp: December 15, 2020, 12:12:36 am
content: Quote from: ricko_uk on December 14, 2020, 11:39:39 pmVery crudely, it could just be an NFET or NJFET with the gate connected to a DAC output.

author: SiliconWizard
author_rank: Super Contributor
timestamp: December 15, 2020, 12:49:02 am
content: What's your intended application and what are you going to do with the output? Obviously the impedance of the load will matter here. So if you go for a current source and capacitor, you're going to have to take the additional load into account. Depending on your requirements, this extra load may not be negligible. And if you're not going to load the output, then I don't see the point. (Oh and even a scope proble would act as a load that *may* not be negligible depending on your circuit and intended slew rate range.) Just a thought.

author: ricko_uk
author_rank: Super Contributor
timestamp: December 15, 2020, 05:18:46 am
content: Thank you allSiliconWizard, drive coils to make weak magnetic fields for experiments. The inductance is small but don't have the value yet. They are air coils of 30 to 50mm diameter and up to 50 turns. So the theoretical inductance, as rough value range is 40 to 400uH.

author: Berni
author_rank: Super Contributor
timestamp: December 15, 2020, 06:08:49 am
content: In that case you also might want to drive it as a current source, since that's what determines the field in the coil.In this case a voltage limited current source into the coil would generate that waveform by itself. Applying DC voltage to a coil makes it ramp according to the voltage and inductance. So if the current is limited at some point it hits it and becomes a straight DC current.Tho the downside of that is that the ramping slewrate becomes dependent on the coil inductance.

author: jonpaul
author_rank: Super Contributor
timestamp: December 15, 2020, 10:38:21 am
content: Hello to OP:Impossible to assisit as your OP is very vague.So all the solutions are specualting on what you really need.PLEASE DEFINE your question more precisely:Min/max Zo? Load?Voltage/current max?Freq /PRF?Min/max sleweg a 5V 1 MHz drive into 50 Ohm with 1v/uS slew is a differnet requiemnt than 10v/nS.What is your end application/system requirment?Jon

author: Zero999
author_rank: Super Contributor
timestamp: December 15, 2020, 09:28:18 pm
content: What sort of slew rates are you after, at what voltages?If it's fairly slow, then how about a rail-to-rail op-amp?

author: ricko_uk
author_rank: Super Contributor
timestamp: December 18, 2020, 12:28:56 am
content: Thank you all!!Zero999, thank you for the schematic and the simulation. Very much appreciated!!I tried running it but it says cannot find UniversalOpAmp. I reinstalled it and also googled for solution but what I tried did not work. I replaced it with a UniversalOpAmp2 that I found in the component library but it does not run. It doesn't give any error. It just leave the output window black with no output/graph.Any suggestions how to fix it?JonPaul,haven't received the coils yet so I can only give you some rough values:- coil inductance 40 to 400uH- voltages 1V to 12V (variable PSU)- current no idea until I get the coils and measure the magnetic field. I think it might be 100mA absolute max- frequency from 1Hz to 30Hz square/rectangular wave- the rise time is between 100ns to 200us (a factor of 2000 because it is an experimental device)Thank you all again!

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: December 18, 2020, 02:02:22 am
content: Ricko_uk,Here is a variation on the model that was shared by Zero999. I have replaced the op-amp with an LTC6241.This circuit does give you a slew rate that is proportional to the control voltage, but the amplitude is determined by the op-amp supply. It goes rail-rail.Regards,Jay_Diddy_BSlew rate squarewave_JDB.asc(1.91 kB - downloaded 56 times.)

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: December 18, 2020, 02:59:23 am
content: Hi,Since the load is inductive, it will cause the current to be slew rate limited.Look at this model:The current slew rate is controlled by the amplitude of the voltage source. The peak current is determined by the current limit.I have attached the model.Jay_Diddy_Bslew model.asc(1.54 kB - downloaded 49 times.)

author: ricko_uk
author_rank: Super Contributor
timestamp: December 18, 2020, 04:36:37 pm
content: Thank you Jay, very much appreciated your suggestion and also your simulation!Also Zero999, I managed to also run your now. So thank you both!With Zero999 I can control the slew rate with the voltage source which is quite handy. How is that done by Jay's solution? I assume I need to replace I2 and I3 with voltage controlled current source?Also is the idea of the diodes to protect the circuits that would implement the current limiters I3 and I2?Thank you

author: SiliconWizard
author_rank: Super Contributor
timestamp: December 18, 2020, 04:43:49 pm
content: Quote from: ricko_uk on December 18, 2020, 12:28:56 amDo you actually need the voltage across the coil to be a square wave, or the current?Try and see how much current would be needed to get a square wave voltage @10 Hz, 12 V across a 400 µH inductor. That's gigantic. (If the current can't get high enough, the voltage across the inductor will quickly drop, and won't be anything like a square wave at those low frequencies.) Did I miss anything though?

author: ricko_uk
author_rank: Super Contributor
timestamp: December 18, 2020, 05:09:53 pm
content: Oops, yes I should have specified that. It is the current that needs to be square wave.

author: SiliconWizard
author_rank: Super Contributor
timestamp: December 18, 2020, 05:20:08 pm
content: Quote from: ricko_uk on December 18, 2020, 05:09:53 pmOK, that becomes doable. Now this is the dual of the above, and you need to control the slew rate of the current and not the voltage.Keep in mind that with a 400 µH inductor, you'll need a min. voltage of 4 V/mA, so neglecting any possible drop-out voltage, at max 12 V, you won't be able to source more than 3 mA (for a 100 ns rise time.)

author: ricko_uk
author_rank: Super Contributor
timestamp: December 18, 2020, 08:40:44 pm
content: Thank you SiliconWizzard,that is just at the edge so I will design it and run it at 15V. So thank you for pointing that out.

author: SiliconWizard
author_rank: Super Contributor
timestamp: December 18, 2020, 09:55:33 pm
content: Quote from: ricko_uk on December 18, 2020, 08:40:44 pmThis is the worst case for your specs, for an ideal inductor. This comes from: V = L.di/dt. Now as your coils will NOT be ideal, they will have all kinds of parasitics, like series resistance. So yes your compliance voltage must be higher than this minimum.

author: ricko_uk
author_rank: Super Contributor
timestamp: December 18, 2020, 11:25:51 pm
content: Yes, and raising the voltage in the system is very easy at this stage of the design.Thank you as always!

author: djerickson
author_rank: Regular Contributor
timestamp: December 20, 2020, 12:21:01 pm
content: We music synth nerds have a function called 'glide' or 'slew limiter' which is similar to what you ask for. Makes your synth sound like Keith Emerson. It is used to allow musical glide between notes. I have a Befaco Slew Limiter (built from a kit, Eurorack of course) which has nice capabilities including:Voltage or manual control over the rise and fall timesIndependent rise and fall timesExponential control, so several decades of slew time controlDesigned for mS to several second slew timesPrecision (mV) control over the voltage levelsNot super precise control over the slew rateI think it is a very clever design that could be made faster (microsecond times) by reducing the R and C values and using faster op-amps. The schematic is on their web page. They sell it assembled or as a kit.http://www.befaco.org/slew-limiter/Cheers,Dave Ericksonwww.djerickson.comCheck out my DIY SMU project:www.djerickson.com/diy_smu

author: ricko_uk
author_rank: Super Contributor
timestamp: December 20, 2020, 06:51:22 pm
content: Thank you djerickson!I had a look at their schematic herehttps://befaco.org/docs/Slew_Limiter/Slew_Limiter_V1_2_Schematic.pdfIs the slew rate limiter IC1D or IC1C? And what are the 4 BJTs for and how do they work?Thank you

author: djerickson
author_rank: Regular Contributor
timestamp: December 21, 2020, 08:00:20 pm
content: IC1D is the slew limiter. The two NPNs are a differential pair (emitters connected). The PNPs are a second differential pair to deal with signal levels that are the opposite polarity.If you redraw it as a traditional NPN diff pair, and remove the PNPs for now, then what's left is a classic exponential voltage-to-current converter. Ignore the overall feedback through R20 for now. And assume that a fixed negative voltage is applied to R18. Slew control voltage is applied to the base of T1, Output current is the Collector of T4. The output current doubles for every +18.3mV of base voltage change, thanks to bipolar transistor physics. This circuit is is how analog synthesizer VCOs do volt-per-octave (exponential) conversion from a keybord to a tone.IC1C's job is to provide the current to the pair of emitters such that the collector of T1 gets the same as the input current thru R18. It always at 0.0V. When both bases are 0.0V, the diff pair is balanced, and so the collector currents are the same, which is equal to the input current thru R18. C3 helps stabilize IC1C.Most applications fo rhtis circuit use a fixed DC voltage applied to R18 which sets the output current with 0.0V control. But in this case the input signal that you want to slew-limit is applied here. The effect is that the circuit acts as an exponential multiplier.Iout = 2^(Vb / 18.3mV) * Iinwhere Iin is the current through R18. Iout is the collector of T4, applied to integrator IC1D.IC1A is a -100 gain amplifier that amplifies the difference between the input and the output.The SHAPE pot makes the slew resonse exponental (set to R7) or linear (set to R13/R20), or somewhere in between. For a large input signal (1 to 5V) and the SHAPE pot set to the R13/R20 end, IC1A output saturates until the loop balances with Vout = Vin.To make it go faster, reduce C4, maybe C4, maybe use faster opamps. The maximum speed wil be limited by the saturating high gain amp and the two nested integrators: IC1C and IC1D. I'd say build a Spice model and play. Or just buy the kit and play.Good luck,Dave

author: ricko_uk
author_rank: Super Contributor
timestamp: December 22, 2020, 11:57:42 pm
content: Thank you djerickson for the detailed explanation!