Title

Subtitle

DIY - DC-Motor Speed Controller

Click to edit table header
 
BASIC FUNCTION
Pulse-width controlled DC-motor power controller with soft turn of and turn off. Good for any kind of DC-motor that should be started and turned off gradually
CONTROLS
  • forward/off/reverse
  • accelerator pedal input
  • motor voltage (variable)
  • acceleration (variable)
INPUT
 +10 ... +14VDC (car or motorcycle battery)
OUTPUT
 0V to rated input voltage PWM 0% to 100%
POWER HANDLING
 up to 60 Ampere (720w or about one horse power)
DOWNLOADS

The project

After a kind donation from a friend we suddenly had an electrical "car" in the family.  In Fig. 1 you see my older son sitting in it - at that time 6 years old. Look at the proud grin on his face.

Due to the very old and crude ON/OFF control system there was a need for a more sophisticated speed control. Again - a need for a device that was not available off-the-shelf. However, the summer 2002 was not very rainy so I moved the soldering iron outside not to miss any of the sun.

Background

The best way of getting an idea of this project is to walk through the "prototype" construction, that was one of my summer 2002 projects. The electric car was originally running on a 6 volt hobby accumulator and had two 6 volt motors connected in parallel. Due to the small battery size and the small "wall adapter type" charger, both running and charging times were ridiculous. Since the two motors were also connected mechanically in parallel it was obvious that they could be connected electrically in series. This made it possible to use a low-cost and standard 12 volt motorcycle battery. Since the motor was controlled by two socket connected car-relays it was an easy thing to replace them with two 12 volt models.

Due to the high power and voltage rating of the new battery the operation now became very crude. The car front wheels jumped into free air every time my 6-year son stepped on the accelerator. This was not fun according to him (and even a little frightening according to his 2 year younger brother), so something else than a relay was needed between the battery and the motor. This "need" led finally to this design. I think that someone else might be confronted with this same problem somewhere, so I thought that publishing this project might be worth the effort.

Construction

The construction started by removing the old battery and control wiring (see picture above). The next step was to cut a hole (the rectangular opening) in the car rear to make it possible to service (- adding distilled water to) the new battery without removing it. In this picture the car is still upside down.

Here are some pictures of the electronic board, both from the solder and component side. The circuit can easily be build on a perforated board as long as you keep the high current paths short. The cable in the picture goes directly from the board to the two potentiometers, the other high-current connections are via the screw and spade terminals. It is advisable to mount the quad op-amp in a socket, otherwise the layout is not so critical. Keep the gate leads short to the power MOSFETs  and place the gate resistors close to the devices. Try to follow the same layout order as I did: power connector - power transistors - catch diode - bypass capacitor - the rest of the electronics

Make sure that the high current path from the transistors to the connectors are as thick as possible. I used two parallel tracks and just used lots of extra solder to form the final traces - as you can see in this picture. 

Be careful when cutting traces so that you do not leave any residual copper debris around the cuts. Please be careful and make sure all polarized components mounts the right way around. Be sure to check the supply pins on the op-amp, pin 4 is + and pin 11 is ground.

Here is the finalized controller with the lid still open. Here you can see the two heavy duty external directional relays plus an (bimetallic) over current protector (the third small black box hanging in the wires). It is strongly advisable to use some kind of current limiting component in series with the battery. An ordinary melting slow acting fuse is fine. About 10...20 ampere should be sufficient. The final rating depends of course on the motor and battery rating. All external wiring was performed using crimp and insulation displacement contacts.

In the rear you also can see the two 6 volt motors now connected in series. They are mechanically parallel trough some gearwheels (not visible here).

Functional description

This description refers to the down-loadable schematic. Please download and print it for reference to more easily follow this text.

As you can see from the schematic, both potentiometers can and should be assembled somewhere externally from the electronics box, preferably somewhere in the car's control panel. The wiring can be ordinary non-shielded thin signal-wire cable. Other "external" components are also the two direction relays (if required), the direction switch (FORWARD/OFF/REVERSE) and the accelerator pedal switches. Out of these only the relays carry the full motor current - so wire these accordingly. The accelerator pedal uses two micro switches connected in series. This is for safety reasons, if one fails the other still disconnects. Assemble the switches so that they switch about simultaneously and so that they are protected from any excessive force a small foot can produce.

The schematic is quite straightforward. Just a few explanations are required. There is no voltage regulator since the only IC (the quad op-amp) runs fine directly on the battery voltage. IC1-A forms an oscillator of about 200Hz. This frequency is optimal for most motors. A lower frequency would cause higher vibrations, a much higher a more loud whining from the motor and higher losses in both the motor and MOSFETs.

The distorted triangle wave goes to IC1-B that acts as a voltage comparator. This comparator receives on its + input a scaled dc-voltage which level changes depending of the speed setting. This operation is fully ratio metric and independent of the supply voltage. Another reason that no voltage regulator is needed. The pulse width modulation goes from fully off (0%) to fully on (100%).

IC1-D acts as a voltage follower and impedance buffer. This part is a little tricky and needs further clarification. Capacitor C3's voltage determines the dc-voltage going to the comparator forming the final pulse width controlled signal to the power transistors. This voltage is also buffered using IC1-C not to load C3. IC1-D compares this voltage to the potentiometer voltage and either charges or discharges C3 through the Delta-speed potentiometer. The two diodes D8 and D9 acts as clams so that the voltage across the pot is always the same, either +0.6 or -0.6 volts. Therefore C3 is charged/discharged with a constant current - depending of the pot setting. R2 limits the maximum current and thus the maximum acceleration. Haven't myself seen this kind of circuit before.

Q3 and Q4 forms a voltage following buffer to ensure fast enough switching times at the output transistors heavily capacitive gates. Such high-power MOSFETs have large gate capacitance and an op-amp is too weak for PWM-control even at 200Hz. The fast switching of these devices ensures very low power dissipation and thus heatsink-free operation.

A few words about the direction relay control. Mosfet D6 controls when the relays are allowed to switch. D6 provides gate voltage to this transistor whenever the foot pedal (accelerator) is activated. C7 and R16 forms an important turn-off delay since the selected relay must stay activated until the motors stops - otherwise the motor is shorted through the relay contacts and it would stop abruptly. Therefore D3 provides gate charge to Q6 as long as the PWM is still on. With this arrangement the selected direction relay stays activated as long as the retardation phase continues plus a small delay.

D7 and D8 protects the electronics from battery reversal and are otherwise needed to. The op-amp can be replaced with an equivalent one, as long as the input voltage common mode goes all the way to the negative supply VEE- in this case ground. Q7 acts as a saturating on/off switch for the potentiometer. Never short circuit the potentiometer since Q7 might warm up or be destroyed

Calibration & Testing

There are no actual calibrations to perform. The unit should directly be operational after the construction is finished and checked. Be sure to check all polarities on polarized components. You can change the value of C3 if you want to adjust the speed of acceleration/retardation. Changing C2 alters the PWM frequency. 200Hz is quite optimal for most DC motors in this power range. Going lower adds to the moment ripple, going much higher just increases the switching losses in the semiconductors and also increases the whining sound from the motor.

Useful hints

Set the direction switch (S1) in its center position when parking the car and not using it for a long time. This turns the power off from the electronics and saves the battery. You can add a external voltmeter as shown in the schematics. It ends up handy when determining how much juice is still left in the battery.

Set the same switch in either position (FORWARD/REVERSE) depending in which direction you want to run the car. Step on the foot pedal (accelerator) to drive. Set with the pots a suitable acceleration/retardation and maximum speed.

If you cannot find a three position switch for the S1 you can use a SPST switch that feeds a SPDT switch.

You obviously also need means for charging the battery. I used a male XLR-connector on the side of the car where I conveniently plug the cable form my battery charger. As with any batteries - do not let the battery dry out. Overcharging must also be avoided. Here the voltmeter comes in handy.  This design can be used to slowly start and run any kind of DC-brush motor.

HAPPY DRIVING !

BEWARE - HIGH CURRENT LEVELS INVOLVED!



There is a safety risk due to the high currents even if this project is entirely low voltage. To prevent meltdowns or fire - proper wire thickness must be used, and the use of proper fuse(s) is mandatory!

Fig 1. Proud owner of electric car.

Fig. 2 - Preparations starts with removing the old controller and makign suitable space for the new battery.

Fig. 3 - Detail of the direction relays. There relays are wired (not on the PCB) due to high currents. The type must be automobile grade with 12VDC coils.

Relays wire into position

The finalized electronics. Note the three TO-247 encapsulated parallelled power transistors in the lower right corner. The output is via 6,3mm spade contacts. The transistors dissipate so little power no heatsink is needes.

Solder side of the perfboard. Please note the solder-reinforced double copper traces that carry the high (motor) current. This is very important due to the high motor currents.

The electronics before closing the plastic box.

Closeup of maximum speed and maximum acceleration potentiometers.