generating a -10v...+10v control signal from an arduino

Filter PWM output to produce a smooth 0-5volt analogue signal. The centre point of your 24 volt battery configuration to be connected to arduino ground. All OpAmps to be powered by +/- 12 volts. Feed the 0-5volt analogue to a unity gain OpAmp/comparator with +2.5 volt fixed offset. This will produce -2.5 to +2.5 volt output. Now feed this to OpAmp with gain of 4 to produce the required -10 to +10 volt drive signal. Probably could be done with a single Opamp/comparator but using two makes it simpler to calibrate.

If your PWM filter reduces the 100% signal to less than 5 volts, let's say 4.5, then the 50% PWM value should be 2.25 so you need to alter the 1st stage bias voltage to +2.25 and the output will be -2.25 to +2.25. By altering the gain of the second stage to 4.44 you get back to the -10 to +10 output.