Motor Controller Hardware

The motor controllers used in the vehicle have been completely redesigned from previous competitions. The speed controllers used in ORCA VII are derived from the 'OSMC' controller design, modified for the restricted space and lower current requirements of our vehicle.

Speed control of a DC motor is achieved by using the classic H-bridge topology. In an H-bridge, four switching components are used to alternately connect each of the motor terminals to either the positive or negative supply rails. By adjusting the duty cycle of the various switches, the _average_ voltage applied to the motor terminals may be adjusted from full positive to full negative, permitting smooth control from full forward to full reverse.

Because ORCA VI used a 24V for traction power, the previously used 'Super Rooster' speed controllers were no longer suitable. Instead we used commercial controller produced by Vantec. These controllers proved tremendously problematic, and made the vehicle almost impossible to control. Both the 'Super Rooster' and the 'Vantec' controllers accept as input standard 'RC servo' signals. The 'Super Rooster' controllers would accept the RC servo signals, process them using a microcontroller, and then the microcontroller would command the H bridge state. The issue with the Vantec controllers is that the RC servo signal was translated into H-bridge switch states via analog processing and analog components. The transfer function between RC servo input and output average voltage was tremendously non-linear and subject to variation between controllers and with controller temperature. In the end, it was simply impossible for the slow control loops running in the main computer to maintain a stable path through the water.

At the same time that we were using the Vantec controllers, we had intended to design and build our own controllers, and this intent was described in the ORCA VI journal paper. We never had sufficient time to complete our own controllers, thus the use of the Vantecs. We have now completed our controller design.

The ORCA VII motor controllers are derived from the Open Source Motor Controller, an H bridge design published on the web for the use of robot enthusiasts. The 'home' of the OSMC is at and the company Robot Power sells commercial versions of the device and also mirrors various support files for the OSMC.

The OSMC is a simple and robust H bridge amplifier capable of operating over a wide input voltage range and at rather high currents. An H-bridge has 4 switched legs, and the OSMC uses 4 MOSFET devices in parallel for each leg. An HIP4081 driver chip provides gate drive for all of these MOSFETS, providing the necessary high gate voltage to drive the devices into saturation, and providing the 'high side' gate drive voltages by means of a floating capacitor supply. Various protection components, including TVS diodes and Zener diodes are used to protect the components from various motor transients. 12V power for the fan, the HIP4081, and other components is provided by a DC-DC converter from the main DC supply voltage. The OSMC is an H-bridge alone, and does not accept standard control inputs, but rather accepts inputs directly to the HIP4081, using the HIP4081 truth table.

On the down side, the OSMC is also quite large, at 3.15 by 4.5 inches (80 by 114 mm) with substantial thickness needed for both components and a cooling fan. In the standard OSMC, a two layer board is used, all through hole components are used, and the power transistor components stand up vertically, providing poor heat sinking and requiring the cooling fan. In the standard design, a separate control board (the MOB) is used to provide the needed H-brigde control signals.

We decided that a smaller board was desired, that we could use surface mount components, and that we wanted to use the submarine bulk-head plates as heat sinking. Additionally we decided to integrate the microcontroller onto the H-bridge controller board itself, so that standard servo signals or direct serial line commands could be sent to the board. We wanted the option of closed loop current feedback, so that we could command specific control values to the motor, and have the speed controllers locally compensate for things like changes in supply voltage. Finally, we wished to provide for the options of direct serial control, servo control, bussed serial control, and 'local' control of the output.

The final H-bridge controller, as implemented in ORCA-VII, uses the same HIP4081 driver and gate drive components as the OSMC. However this top level topology is about the only thing that has remained constant. The ORCA-VII controller consists of 4 MOSFETS in H-bridge configuration, driven by the HIP4081. The 4 MOSFETS are mounted below a circuit board, with leads bent upward, permitting the MOSFETS to be mounted directly against a mounting plate/heat sink. The MOSFETS, gate drive passive components, DC rail capacitors, TVS devices, and 12V and 5V power supplies are all mounted on a two layer board. The capacitors selected are designed for high ripple current, and are paralleled by ceramic SMD capacitors for increased high frequency decoupling. Main power input is provided by Deans UltraPower connectors directly soldered to the power circuit board.

The HIP4081 and all of its support components are placed on a daughterboard. This provides the effect of a 4 layer board, but using the much less expensive 2 layer boards, and additionally provides some additional area to mount thin components. On the same daughterboard, we mounted an ATMEGA32 microcontroller, to provide the necessary local PWM generation. The microcontroller accepts several inputs and outputs, including a 4 leg DIP switch, a potentiometer, analog rail voltage and current inputs, and isolated servo and serial inputs. Five LEDs are provided for diagnostic output. The digital inputs are provided through analog devices ADUM1400 series isolators, protecting the main system computer from a failure in the traction control circuitry. Based upon the state of the DIP switches, the ATMEGA32 generates PWM in response to the following inputs: servo timed inputs on SERVO pin, serial line commands on the USART pins, or the local potentiometer setting. The latter permits testing of the H-bridge system without an external computer to supply commands.

PWM Theory

In order to control a DC motor and provide for forward, reverse, and intermediate speeds, variable voltage, variable polarity direct current needs to be applied to the motor terminals. The output of a suitably powered amplifier would be sufficient to drive a DC motor. However producing clean variable voltage DC is difficult and inefficient. The natural inductance of the motor windings provides for a different approach.

When voltage is applied to an inductor, the current changes at a rate proportional to the applied voltage and inversely proportional to the inductance. If a variable duty cycle square wave voltage is applied to an inductor, then the current through the inductor will essentially be driven by the _average_ applied voltage, with some ripple at the square wave carrier. Apply a sufficiently high frequency square wave to the motor, and the effect is the same as applying smooth DC voltage. Adjusting the width of the square wave pulses changes the average voltage, thus 'pulse width modulation' or PWM. Switching between two or three distinct applied voltage levels is easy and efficient. PWM amplifiers are regularly > 99% efficient.

The PWM waveform produced by the ORCA-VII motor controllers is different from the PWM paradigms commonly used for DC motor control. The two common PWM methods are 'locked antiphase' and 'sign magnitude'.

In locked antiphase, opposite legs of the H-bridge are always switched in opposite polarity, ensuring that the full supply voltage is applied to the terminals of the motor, either in the forward or reverse direction. By adjusting the duty cycle appropriately, any desired average voltage may be synthesized. The benefit of locked antiphase is that only a single channel of PWM needs to be synthesized, and there is no 'zero cross' distortion; a 50% duty cycle means 0V output, 100% duty cycle means full forward, and 0% means full reverse. The significant downside of locked antiphase is that the only voltages applied to the motor are full positive or full negative, and at low DC current levels, a significant AC ripple is present at the PWM frequency.

The common solution to this high ripple issue is the use of 'sign magnitude' PWM. In this PWM paradigm, one leg of the half bridge is forced to conduct 'low', and only the other leg switched. When the other leg is high, then the supply voltage is applied to the motor terminals. When the second leg is driven low, then both motor terminals are coupled to the same DC rail, and the voltage applied to the windings is zero. Ripple is only introduced to the extent that current is required. Direction is controlled by selecting which bridge leg is held fixed; this can introduce a zero cross distortion. Additionally, one of the transistors on the fixed leg is sitting unused, resulting in uneven heating. It is desirable to ensure that there is a transistor conducting in both bridge legs in order to maintain a continuous current flow path, even when the motor is driven at '0V'.

The solution used in the ORCA-VII motor controllers is based upon the 'phase correct' PWM paradigm, which is native to the ATMEGA32 devices.

In phase correct PWM, the two half bridges are essentially driven in phase, with the duty cycle of the left and right bridges adjusted in _opposite_ directions depending upon the desired direction and amplitude. When the left half bridge is driven more positive, the right half bridge is driven more negative. However at the time=0 reference point _both_ half bridges will be positive (placing 0V on the motor terminals), and half a PWM cycle, both half bridges will be negative (again placing 0V on the motor terminals.

The transitions between positive and negative are modulated, applying full supply voltage to the motor terminals _twice_ per PWM period. Both the high and low transistors are used to conduct current when 0V is applied to the windings, resulting in more even transistor heating. For a given PWM frequency, and given transistor switching rate, the pulsing frequency applied to the motor terminals is doubled, thus reducing ripple relative to standard sign-magnitude PWM. Because of the balanced modulation scheme, zero cross error is greatly reduced, with the deadtime of the H-bridge being the only source of zero cross error.


The new controllers have proven suitable and reliable. Using these new controllers, ORCA-VII is much more easily controlled. When the same thrust value is commanded to both left and right thruster, the vehicle essentially drives straight. This clean open loop performance reduces the load on feedback control loops, and releases control overhead to actually run the mission.

  Copyright 1998-2006 MIT.
Last updated on January 27, 2006.
Contact us at