Update 1: I have attached the .asc file for the simulation.
Thanks for clicking my post. I am trying to building a circuit that can do this:
output = (input1
2+input2
2)
0.5After some googling, I decided to use AD633 to do this. I basically copied the squaring and square rooting examples from the datasheet and added a summing circuit:
Here are the examples from the datasheet:
However, the simulation results are very strange:
It can be seen that the output from the summing section is correct (V(sum)), but the output from the square rooting section is wrong, and it is stuck at -8.01V. The datasheet says: 'The 1N4148 diode is required to prevent latchup, which can occur in such applications if the input were to change polarity, even momentarily.' Seems to me this is probably a 'latchup', as you can see from the results that the voltage before the diode is -15V. It seems the diode tried to prevent the 'latchup' but failed. What I don't understand is the input to this section has always been negative, why would this happen? By the way, I have simulated the square rooting section by its own and it works fine.
I produced this circuit on a breadboard and the results were similar to the simulations. The squaring+summing and the square rooting works fine by themselves, but they clearly don't like each other when connected together. I have tried switching to different op-amps and/or diodes. Some of them works better than others, but this 'latchup' can still happen sometime, especially when the input signal is very low.
What am I doing wrong?
Thanks for your time.
I have attached the datasheet for AD633 as well.