DC motor driver speed and direction controller

Hi,

I require a DC motor driver/controller to control a small 2-3A, 12VDC electric motor. The motor driver/controller I require needs to have forward and reverse input control (from two seperate switches) and would need to apply no output to the motor (motor stationary) when neither of the forward or reverse switches are not activated. I would also require a potentiometer input to the driver/controller in order to vary the output speed of the electric motor. I would like to do all this without the use of Arduino etc.

Any recommendations of a suitable device?

1 Like

Hi Brock
You will need some electronics for speed control. A couple of ways to do this.

  1. vary the voltage applied to the motor in a linear fashion. This could be done simply by using an adjustable regulator (LM317) driving a large series transistor to provide the current. This has some disadvantages. The motor torque at low speed is reduced dramatically. The maximum voltage available for the motor will be supply voltage minus 1.8V, 1.2V for the 317 and 0.6V for the pass transistor base bias. Lastly but not least under low voltage low speed high current conditions the pass transistor will get hot, probably requiring a hefty heat sink.
  2. PWM control. This would be the preferred method as torque is maintained at low speeds and 1 (or more) mosfet is turned hard on minimising heat generation. If you did not want to use an Arduino or similar to generate PWM there are ready made small DC motor speed controllers out there. I don’t know what Core have in stock along these lines but others have this sort of thing too.

Direction change switching. I would not recommend 2 switches as there is a very real chance both could be ON which I think could short the supply. You would need a DPDT switch centre off. That is ON-OFF-ON to change voltage connection to the motor. That way you cannot have the motor switched both directions at once. Make sure the flywheel diode connects between the misfit drain and positive motor supply with cathode t0 positive motor supply. That way the diode is correct polarity irrespective of which way the motor is connected.

No matter which way you go some electronics are going to be required to control speed or a very large rheostat.
Cheers Bob

2 Likes

Yes a PWM output driver/controller is what I am looking for with all of the initial requirements I listed. Hopefully someone from Core Electronics can answer what they have avaliable… I see there are these exact drivers/controllers listed on sites like Ebay, Banggood, Grandado etc. but I would like something a bit more reputable and rhobust.

A DPDT switch would be fine in the ideal world however it may not be possible to integrate into the external controls I need. The direction switches will be installed in a foot switch and foot switch contact configurations are very limited with all the foot switches I have looked at online. Ideally the foot switch would be center off and left and right accordingly (3 positions) foot switch. I’d rather have the controller changing the output polarity from an assigned input rather than changing polarity through input switches but that’s not super critical.

1 Like

Something like this:
Pololu High-Power Simple Motor Controller G2 24v19 Australia (core-electronics.com.au)

1 Like

Jeff, that is the closest I’ve seen to what I require so far seeing as it has a potentiometer speed input for motor control. Only thing that’s not clear is its direction control. I see it says bidirectional but cannot see any description on how the motor direction is controlled.

1 Like

You will need to decide how your direction information will be made available to the controller. Using two separate switches will make this difficult. Generally, this type of controller can be configured so that the pot range controls speed from 0 to +max, or from -max to +max. The user’s manual for the device will show how this is done. However when there are multiple analog channels available you have different options. For instance, if one channel is configured as forward speed and one channel configured as a reverse speed, then you can control direction by switching the V+ input between the respective pots. If the unselected side is left floating then pull down resistors will be required.

2 Likes

The potentiometer will be a set and forget component for 90% of the time for what I require it to do, I cannot be constantly adjusting this, I need to be able to control the electric motor direction with simple switches.

What I am trying to achieve is momentarily “jogging” a geared DC electric motor via a foot control. The motor will turn only whilst the momentary CW or CCW foot switch is pressed.

Having the direction governed by the potentiometer range will not work for me unfortunately, it must be done by a discrete input or the likes.

Hey Brock,

Welcome to the forums!

Bob has made some excellent points regarding using 2 switches and selecting methods of controlling the motors.

From your most recent post, I would recommend using a microcontroller as a ‘middle-man’ to hold variables for the speed that will be sent to the motor and ensuring that there is a consistent logic being used for the pedals.

For an easy well-documented motor driver (2A max) I would take a look at the LN298.
Jeff’s Pololu recommendation is also a very strong contender or another here by Pololu.

Liam.

I think this is getting a bit too excessive for what I require to be honest. I am trying to keep the controller as simple as possible and I am not too sold on the idea of adding an additional microcontroller. Having both direction inputs active at once can easily be solved by N/C interlock contacts on the CW and CCW foot switch contacts.

Surely something like the below link exists out there made by a rebutable manufacturer?

1 Like

Hi Brok
Will post a suggested simple circuit for you soon (in the next hour or so) when I draw it.
Cheers Bob

1 Like

Hi Brok,

You can get away with a couple of relays for directional control.

And a cheapo PWM motor driver on the motor power supply rail:
https://www.ebay.com.au/itm/DC-3V-35V-PWM-DC-Motor-Speed-Controller-Adjustable-LED-10khz-Dimmer-Fan-AU/124384121540?hash=item1cf5df12c4:g:Pk0AAOSwVRZfhqDM

You can even get these all in one:

I don’t think core have any all in one motor drivers you can control without a micro-controller. Except maybe some of the big expensive ones, that have multiple control input options.

1 Like

Hi Oliver, thanks for your suggestions. I could do the very same as the relays are doing with a SPDT switch on each of the CW and CCW foot contacts to achieve electric motor direction control with forward and reverse polarity of the motor. This was my initial thought before I needed to add speed control and wanted something all in one PCB.

The potentiometer needs to be externally mounted from the PCB also for my intended use. The problem is finding something that has all of this that is a “reputable” (reputable, being the keyword) manufacturer not a no name branded component. Once everything is finalised the PCB will be required to be completely potted in resin/epoxy for water protection as it will be installed in a marine environment. Once this is done there is no turning back hence my need for reliable components.

Hi Brock
Herewith a suggested circuit which I think would do the job.


I have used 2 DPDT relays. One to switch the motor off. The low value resistor is to provide electric braking for the motor. I thought if you are jogging, any motor overrun would not be desirable. It is arranged that either foot switch will operate this relay.

Motor direction is controlled by relay 2 and runs one way in the default position. Operating S 2 energises this relay and reverses motor polarity. Actual required direction achieved by reversing motor connections.

I have not considered the motor flywheel diode as this should be part of the motor speed control.

The relays referred to in that video are single pole hence the need for 2. They would still not turn the motor off It would default to 1 direction. You have indicated you don’t wish to continually adjust speed. Once set you want to turn the motor on and off maybe reversing direction.

The diode is essential so either foot switch can turn the motor on without interfering with the other. Fit diodes across the relays if you wish but they may be already fitted inside the relay. If so watch relay polarity.

I have suggested this method as you may have trouble finding suitable switches to fit inside a foot pedal and you still have tom turn the motor off.

From my observations most self contained reversing motor drives are H bridge and still have to be provided with PWM signals from somewhere. The fully self contained ones appear to be for robotic use with their own everything and I thought maybe a bit exotic for your intended use.
Cheers Bob

3 Likes

The arrangement I suggested does not involve adjusting the pots. Set them to the speed you need for each direction, and then switch between them using the foot switch for direction control.

2 Likes

Hi Brock.
This one may suit you better.


This can use SPDT switches in the foot pedal. I don’t know if you are using 2 separate pedals or have 1 with 2 switches in.

“At rest” the both ends of the motor are connected via NC switch connections. Connected to M- which does not matter.

When one switch is made this end of the motor connects to M+ and the other end to M- via NC contacts at rest. doing the opposite reverses the situation. If both switches are pressed together somehow both ends of the motor are connected and the motor will not rotate. They would now be connected to M+ which once again does not matter.

The 2 diodes are to catch the reverse voltage spike at the motor during the time the switch is in transit from open to close and will ensure instant motor braking. They should be fast acting schottky types. Ordinary power types will not do in this situation.

These diodes may cause a bit of “cogging” at slow speeds. That is the motor will tend to stop and start rapidly. If this is a problem remove these diodes. The NC contacts of the switch will provide complete braking and the diodes are only to overcome the slight delay while the switch operates.
Please let us know how you get on.
Cheers Bob

URGENT PS!!!;
The diode D1 anode connects to the line above it That is to M- the same point as D2.
AS IS THERE IS A SHORT BETWEEN M+ AND M-.
MY STUPID MISTAKE. Must of had a senior moment.

1 Like

Hi all.
Add on to post above.

I must have been having a brain snap when I wrote this. Surprised no one has picked up on it yet.
This statement is quite wrong, the diodes are the wrong polarity to have any braking effect. They will however absorb the potentially high negative voltage spike when the switch breaks. This spike will only appear across the motor and nowhere else as the motor is effectively disconnected while the switch is in transit and if not a problem the diodes can probably safely be omitted. Once the switch makes (in it’s normally closed position) the motor is effectively shorted and maximum braking will occur.

This should not occur either due to diode polarity. This normally happens when the motor is “braked” between PWM pulses during times of low duty cycle.

Sorry about my mental black out.
Cheers Bob

1 Like

Another add on.
The last circuit using SPDT switch has a bit of a shortcoming. When either of the run switches is released there will be a short circuit across the motor. While this is well and good for braking, if the motor is running at speed there would be a possible burn out of the motor due to excessive current flow. This would be a far better circuit.


Once again the diodes should be fast schottky power diodes. These are commonly available with the 2 diodes in 1 package, common anode or in this case common cathode.
The diodes effectively isolate the NC contacts of the switches but allow the low value resistor to appear across the motor as a current limiter (≈2A). This will soften the braking effect slightly but will prevent the possibility of motor burn out.

Foot switches I have dealt with have had SPDT switches fitted by default. This circuit should allow these switches to be used in your application without modification.
Cheers Bob

1 Like

Hi Bob, the diagram you have drawn is exactly what I had drawn and planned to use before wanting to add speed control with a PWM controller and using inputs itstead of switching the motor load through the foot switches however since finding out there is nothing reputable that is avaliable and not over complicated to do what I need it to do I will now be going back to my initial plan of switching the motor load through the foot pedal switches. You are correct each side of the foot switch has a SPDT switch. I plan to use the below PWM controller for now which will be upsteam of the foot control. Its still a cheap unbranded (non reputable) component but can’t find much to suit all my needs especially with the external potentiometer. Over running won’t be a problem, the output shaft will be spinning at a maximum of 15RPM at full 12vdc.

Jeff, I understand what you are saying now, apologies I misread your second post. I think that is getting a bit too off track for what I need to achieve though. I’m trying to keep this simple. There are heaps of these cheap PWM forward and reverse controllers online like the one i posted earlier but nothing rhobust and reliable. Same goes for small geared dc motors too, just cheap chinese stuff…

1 Like

Hi Brock
Yes Can understand tour frustration. Used to be a Co called Oatley Electronics who used to design and make this sort of thing. Also Jaycar used to market Silicone Chip designs in Kit form but these seem to have disappeared. What is more disappointing is when you purchase a “Name” brand product only to find it is a rebadged Chinese bit of crap.
Cheers Bob

1 Like

Hi Brock.
Add on.
Speaking of Silicone Chip designs I found one

Altronics are a Perth based company but I think still have a store in Auburn, Sydney. Don’t know the address but it was behind the old Locomotive Hotel. Hotel on Parramatta Rd. This I think is in Kit form but I think they used to supply built and tested (for a fee of course).
Cheets Bob

3 Likes