Home > Dalek Project > Motor Control System
Modified:22:22, 22 October 2013

The motor control system is based around a PIC controller. I decided to design one rather than buy one since I wanted the following extra features:

  • A high current output - that could be increased if needed.... it was.... up to 30A!!
  • Switchable between manual control from the internal joystick and the RC receiver
  • The option for an Emergency stop should sensors be included in the bumper later on

So it took a couple of attempts, first an analogue version from op-amps, it worked a treat but was unflexible. Then a PIC version that could be tailored and adjusted at will - it seemed the obvious choice.

There were 4 motors to control initially. They were allocated to the joysticks as follows:

Left Joystick:
x - axis = Rotate the head
y - axis = Left motor control

Right Joystick:
x - axis = Raise/lower Eyestalk
y - axis = Right motor control

The power drivers for the head and eyestalk use an H-bridge driver whereas the main motors have relays to reverse the direction. This was because of the large current required for the main motors a full H-bridge would have been large.

The main function of the controller is to convert pulse widths from 1 to 2 ms into PWM control from 0 to 100% ratio in 2 directions. Below are the ranges of speeds against pulse width time.

The controller for the main motors uses a relay to control the direction. It operates as follows:
The following circuit below was designed and used to control both the H-Bridge amd the Relay versions with only slight modifications. These are detailed below, but first a brief description of the circuit.
The PIC controller takes inputs from the joystick. When Rem.En. goes high then control is passed to the RC channel. In this way, the RC transmitter can over-rode the joysticks should someone be inside and loose control.
The circuit can be broken down into simple functional blocks. The 50Hz astable and spike generator simulate the same signals as the RC signal thus simplifying programming. The potentiometer alters the pulse width which is cleaned up by the buffer. The logic decoders are included for safety. PICs on occasion can hiccup when they start up and thus can produce unpredictable signals. This could be catastrophic for an H-bridge driver so logic was employed to ensure this couldn't happen. LEDs were included to show status.
The following 2 sections show how the controller was used and connected for driving the main motors with a 30A Darlington array, and driving the head and eye motors using an H-Bridge driver.
This version the outputs include a relay drive to change direction. Since the relays were automotive high current types they were only single pole, so 2 had to be used. A single PWM outout was used for the Darlington Driver.
Only 2 of the outputs are used.
  • The Mdrv output which is the PWM signal driving the Darlington drivers.
  • The RevRla output which switches the relays to change direction.

It may seem a primative and noisy way of providing direction control but it has advantages.

  • A very simple and cheap drive section.
  • An audible feedback of relays clicking and responding
OK confession time - you may have noticed that the Darlingtons used were TIP122's - 3A drivers making 9A in all. During a test run there was a small step to climb over. I gave it maximum speed and as it hit the step and strained pathetically, 3 bangs from behind were heard - the anihilation of such pitful drivers, (shown left) what was I thinking!

Now replaced with TIP142 giving a maximum drive of 30A - hasn't been destroyed yet!

I did for a while try using a couple of MOSFETs to drive the main motors.

To cut a long story short I had such problems driving them properly at high currents that it proved much simpler to just go back to the Darlingtons.


The only changes are as follows:

  • R4 is changed for D3, a protection diode against the relay EMF
  • The outputs change their name and allocation
  • The outputs are connected to an H-Bridge driver.
There were two types of H bridge tried. A darlington version driving the head motors and a MOSFET type driving the eyestalk motor. I'm pretty sure I found the MOSFET one better. Both are shown here.
The PCB layouts are shown left. They are the same for both versions with just a change in one component and a slightly different programming.

The 4 PCBs for the motor controls were all mounted above the relay board with all the other PCBs.

Written and Constructed by Phil Townshend 2009
Tel./Fax: 01202 474720
Tel: 07714 096258

Contact us by email.
www.edutek.ltd.uk - Working Electronics For Students & Teachers