I designed a programmable constant current power supply to control two solenoids(electromagnetic).For the solenoid to open and close proportionally(it can move between fully open to fully closed and in between) i need to change the current from 0 Amps to 0.5 Amps under 24V. My problem is after few runs the opamp tend to heat up and it malfunctions(sometimes one valve stop working) and once the op-amp burnt up(literally smoke came out and was split in the middle)
What am I doing wrong and how to fix it ?
FYI: the Arduino and 24V power supply grounds are connected even though its not clear in this diagram.
Opamp data sheet : http://www.ti.com/lit/ds/symlink/lm358.pdf