home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   sci.electronics.design      Electronic circuit design      143,326 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 142,741 of 143,326   
   piglet to john larkin   
   Re: cheap analog square function?   
   13 Feb 26 20:42:27   
   
   From: erichpwagner@hotmail.com   
      
   On 13/02/2026 8:06 pm, john larkin wrote:   
   > On Fri, 13 Feb 2026 19:36:23 +0000, piglet    
   > wrote:   
   >   
   >> On 13/02/2026 3:40 pm, Christopher Howard wrote:   
   >>> piglet  writes:   
   >>>   
   >>>> If high precision is not needed and only LF response is enough then I   
   >>>> have used PWM techniques:   
   >>>>   
   >>>> Circuit A is the basic squaring concept, relies on modern open-drain   
   >>>> output comparators being pretty good switches to ground. Assumes you   
   >>>> already have a source of sawtooth or triangle waves with defined zero   
   >>>> and peak values in the system.   
   >>>>   
   >>>   
   >>> Could you please explain better how the PWM squarer circuit works? It   
   >>> look like it would be easy to build, but I don't grasp what is going on.   
   >>>   
   >>   
   >> JL has beaten me to it. In full detail: imagine the sawtooth or triangle   
   >> wave swings between 0V and 1V and is nicely linear, i.e. straight   
   >> sloped. The comparator in my circuit (A) compares that with the input   
   >> voltage to be squared Vx. When Vx is 0 the output is always low; when Vx   
   >> is 1V the output is always high; and when Vx is 0.5V the output is   
   >> toggling with 50% duty cycle.  This pulse width modulation can then be   
   >> used to switch the desired output between input Vx and 0V so when Vx is   
   >> 0V then output is zero, when Vx is 1V the output is Vx and when Vx is   
   >> 0.5V the output is 50% of the time that 0.5V and 50% of the time zero or   
   >> in other words an average of 0.25V. The low pass filter averages the   
   >> pulsating output to a steady level.   
   >>   
   >> In circuit (A) the switching isn't done by an explicit analog switch but   
   >> by shorting the output to ground - very conveniently done by choosing a   
   >> comparator with open-drain output.   
   >>   
   >> I had multiple square and root channels so it made sense to have one   
   >> common triwave generator serve them all. Instead of 1V full scale unity   
   >> I scaled to use 5V so ordinary comparators can be used. If you had no   
   >> other need for a sawtooth/triwave elsewhere one could build a   
   >> self-oscillating PWM generator and use that to drive the chopper. Let me   
   >> know if you want that detailed more fully.   
   >>   
   >> piglet   
   >>   
   >   
   > You can do a pretty good voltage-to-PWM with a single opamp and a few   
   > passives.   
   >   
   >   
   > John Larkin   
   > Highland Tech Glen Canyon Design Center   
   > Lunatic Fringe Electronics   
      
   Yep, a comparator will do too and avoid opamp slew rate.   
      
   piglet   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca