I would like to select gain of differential amp's gain by a controller. I used N channel Mosfets and you can see on attached sch. each of them is working individually. But when I connect them together, the output singal becomes sine wawe. Op amp is TL082. Power supply of opamp is +-18V and I apply -18 and +18V to gates of mosfets.
Could you please tell me if there would be another mosfet connection to select gain?
but each of feedback circuits works properly when they are not connectoed parallel to eachother by mosfets. But the connection of mosfet's are correct? In addition this sytem will generate negative output as well. So current direction will change. Does Mosfet let current flow in both direction? Maybe this is the problem
MOSFETs basically do. The schematic suggests that you are using MOSFETs with separate substrate terminal. If they are biased correctly, they can work as bidirectional switch.
I fear the discussion becomes meaningless without detail information about the MOSFETs.
IRLML2502 is absolutely unsuitable for the application. It has a huge output capacitance (100 - 200 pF) and a substrate diode shorting reverse voltage above 0.5V.