Rimbaldo:
Thanks MarkT and jackrae!It worked! I can control it by pwm - low pass filter! I had to adjust the filter though...
I tried the filter with 1k ohm and 1 uF, and although it was stable with no load, over the multimeter, when connected to the control box, the motor oscillated, as the voltage was increasing and decreasing slowly, trying to keep the signal steady..
I raised the capacitor value till 47 uF (electrolytic), and although the response time is slower now, the signal is steady and the motor runs smoothly, exactly the way the pot used to run it.
Thanks for all your help!
No need to experiment, the time-constant of an RC filter is simply R x C. So 1k, 1uF gives 1ms
time-constant (Arduino PWM is about 1kHz or 500Hz, depending on the pin, so the time constant needs
to be a lot more than 1ms. You've ended up with 47ms time-constant which will filter out the PWM to
a percent or two.
You can also deduce that a farad is the same as a second per ohm.