Potentiometer Control

Hello.

I’m building an autonomous vehicle from an old electric scooter and have most of the arduino basics done now. GPS, compass and motor controllers are all working off an arduino uno, but I’m now trying hack into the existing wiring so that I can control forward / reverse and speed.

Both of these are controlled via manual potentiometers, there is a knob that sets maximum speed (slow to fast) and a rocker bar for forward / reverse.

The F/R potentiometer is a Tocos (Cosmos) RVQ24YS08-03 30S B502 5k OHM job with three pins: input, output and ground.

I was hoping that I could just remove these and control the motors directly from an arduino, but am confused about current. The scooter circuit runs off 2x12VDC batteries powering a 24V, 3amp motor. I’m guessing that most of the electrical circuit is 12V.

Does anyone know if what I’m trying to do is possible without toasting the arduino? Either removing the potentiometers and controlling the current from an arduino, or controlling the potentiometer from the arduino?

The mechanical solution is simply to strap a motor to the potentiometer, but I’d rather something more elegant if that is possible.

Anyone ever done this before?

Ah right... after some digging, it seems I need a digital potentiometer.

I suppose that was deadly obvious.

Edit: does anyone have any suitable recommendations?

No, a digipot is not required (its almost never required except for audio or precision analog circuitry).

The pot has 0V, 5V and wiper, typically (this you must check with a multimeter). Its not "input, ground, output".

To replace this you need to use a 4k7 resistor (controllers detect a broken connection to the control pot, for safety, usually, so you need to fake this).

Then feed a control voltage to the wire that used to go to the pot wiper. A PWM output into an RC low pass filter will work for this, use R = 100k, C = 1µF

Or you can drive the wiper wire with a DAC.

The motor controller is 24V, and its control circuitry is very likely to be 5V (ie a microcontroller).

But do check the voltages on the existing pot with a multimeter to be sure.

Yeah, about 10 mins after submitting my post I was reading on the pins and saw a different explanation of their function. I had read 0V, 5V, wiper, but then two more articles back to back that said in / out / ground (or some variation of this).

Thanks for confirming.

You’re bang on the money regarding the broken circuit and this has been driving me mad. As soon as the potentiometer is removed, the electrics drops into a diagnostic mode. I had kind of assumed that there was a steady 12v closed circuit that had detected a drop in flow (something like CSMA in networking) and the only way to bypass this was with a digipot.

So all I really need is a 4k7 resistor and a PWM connection?

Thanks for such a clear and knowledgable response!

bluerabbot:
Yeah, about 10 mins after submitting my post I was reading on the pins and saw a different explanation of their function. I had read 0V, 5V, wiper, but then two more articles back to back that said in / out / ground (or some variation of this).

Thanks for confirming.

You’re bang on the money regarding the broken circuit and this has been driving me mad. As soon as the potentiometer is removed, the electrics drops into a diagnostic mode. I had kind of assumed that there was a steady 12v closed circuit that had detected a drop in flow (something like CSMA in networking) and the only way to bypass this was with a digipot.

Whenever you need a voltage, a DAC is the obvious choice. A digipot is only needed for attenuating a time-varying analog signal. Here even a DAC is overkill, low-pass filtered PWM will respond in a fraction of a second
and thats as fast as you need.

You can enhance the circuit so that the output voltage is biased to half-way between the 0V and 5V wires from the controller, so that if the connection from the Arduino fails it defaults to the middle off position.

An emergency stop switch can be wired into the 4k7 resistor part of the circuit as cutting that causes the controller to switch off into fault mode.

So all I really need is a 4k7 resistor and a PWM connection?

Works for me on my electric chaise-longue!

Thanks for such a clear and knowledgable response!