Drive a constant current on a varying load with an Arduino.!!!

Hi guys, I am relatively new here.

A component I need to drive requires a constant current to operate.

The main issue that I have encountered is that the resistance of said component varies with temperature, so I need to find a way to compensate that and increase or reduce the voltage accordingly to achieve the desired current.

The second issue is that that current needs to be reversible, in the sense that I need currents within ±15mA to drive the device in both directions.

So far, I've managed to create a circuit that compensates using a Shunt to measure current, and a DAC that corrects the voltage based on that value. But I'm quite sure there's got to be an easier or simpler way to do this. I am also quite aware that this in no way allows the system to be reversible with negative currents, but I had thought about using a relay to switch between a positive and a negative power supply.

I'd really appreciate any help, or even examples of related circuits, on how to drive this all off an Arduino and be able to select the current wanted.

I'd really appreciate any help, or even examples of related circuits, on how to drive this all off an Arduino and be able to select the current wanted.

Yes and we would appreciate some real detail instead of wishie washie hand waving explanation of what you have.
What you want to do, and how do you want to do it.

I've managed to create a circuit that compensates using a Shunt to measure current, and a DAC that corrects the voltage based on that value.

So post it.

But I'm quite sure there's got to be an easier or simpler way to do this.

If you post it we can tell you, once we actually know some real details.

No. And arduino can not do it.