# Direction and Speed control using same throttle

I have a 24VDC permanent magnet motor such as those commonly found on a mobility scooter. I would like to be able to control both the speed and the direction of the motor with the same throttle control without the need to use a reverse switch. Current mobility scooters use whats known as a 'Wigwag' potentiometer or throttle potentiometer to achieve this.

My question is how can I control the speed and direction the of the motor using the same throttle control without a reverse switch?

I have found a simple circuit online which looks useful however this circuit doesn't allow for the modification of the acceleration/deceleration rate or other parameters which I would like to able to modify.

Can I use a micro controller with the throttle voltage as the input and then step up the output currents and voltages somehow?

• Analog voltage to PWM connected to a H bridge. – Ignacio Vazquez-Abrams Jul 16 '16 at 5:15
• Let a microprocessor generate the acceleration/deceleration ramps and PWM signal. A simple pot on an analog input measures (say) 0 to 5V. Simply set (say) 1.0 to 1.5V as Off, voltages below 1 as reverse (0V is the highest reverse speed) and voltages above 1V as Forward (5V being full speed). The choices are somewhat arbitrary but I am guessing you want a lower top speed in reverse... – Brian Drummond Jul 16 '16 at 9:01

There are several reasons your sample circuit are unsuitable:

• You don't have dual power supplies (±24 V) on your scooter.
• The voltage control method is wasteful. At half voltage the output transistors will waste as much power as the motor is using.
• The potentiometer doesn't mechanically run end to end. (See Figure 1.)

Figure 1. A wigwag throttle pot for a mobility scooter. Note that only a small portion of the potentiometer's 330° travel is used - maybe ±30°.

The solutions to this are:

• Design for single rail supply. This will require use of a H-bridge to enable reversing current direction in the motor.

simulate this circuit – Schematic created using CircuitLab

Figure 2. A simplified schematic of a H-bridge. With switches 1 and 4 closed as shown the motor will run in one direction. By opening 1 and 4 and closing 2 and 3 the motor can be made run in the opposite direction. To stop the motor open all switches. In practice the switches will be replaced by transistors.

• Instead of controlling current by gradually turning on Q1/Q2 we will use PWM (pulse-width modulation). In this scheme the motor is pulsed between full power and zero power very quickly and the width of the pulse adjusted in proportion to the desired speed.

Figure 3. A PWM signal going from 80% to 20% to 80% to zero. If the pulse frequency is high relative to the reaction time of the motor then very smooth control is obtained with low losses in the switching transistors.

The best approach will be to use a micro-controller to read the potentiometer, calculate the desired output level using a simple acceleration-limiting algorithm, convert it to PWM and output it to a suitable H-bridge.

simulate this circuit

Figure 4. Crude block diagram of PWM control system.

• Read potentiometer and normalise or scale to, for example, -100 to +100. You should probably add a deadband in the centre to prevent creep or running current through the motor when stopped. e.g.:

0 ------------------------- mid ------------------------- 330°
^ max reverse          max forward ^
-100 -------- 0 ---- 0 -------- +100 scaled output

• Using this strategy will require a definite movement of the wigwag before current is switched on.

• I suspect that the motor will be rather weak and that even with wigwag full-on from rest that acceleration isn't likely to be a problem. If it is then add a routine:

// Very crude pseudo-code!
int v, a, pwm;                 // velocity and acceleration and pwm
ww = getScaledInput;           // wigwag
if (ww > 0) {
if (ww > pwm) {            // we need to accelerate to pwm
pwm = pwm + accel;
}
if (ww < pwm) {            // we need to decelerate
pwm = pwm - accel;
}
if (ww == 0) {             // stop
pwm = 0;
}
}

• If I wanted to drive a motor which draws a full load current of 18A Is this circuit still useful? Is it possible to find an H-bridge circuit which is capable of driving a motor which uses the above full load current? – GrapeApe Jul 19 '16 at 3:44
• Yes and yes. You could consider using a relay to reverse the motor connections for direction and then you just need a big MOSFET to control the PWM. I'll let someone else address that. – Transistor Jul 19 '16 at 21:56