Drexel University's Logo

Clayton McNeil

HUBO Lab Motor Controller Programming Guide


Home
About Me
Tutorials
Media Archive
Resources

Introduction

To coordinate its various motors and motions, the Hubo utilizes a distributed control system (DCS). This means that instead of one centralized computer controlling everything at the lowest levels, control is divided into several sub-controllers that are then orchestrated by a main controller. Below is a simplified diagram of how all the different controllers connect together.

Diagram of Distributed Control System

In the simplest of descriptions, the purpose of any controller is to take a set of inputs and use them to achieve desired outputs and/or behaviors. In a DCS, these inputs and outputs are split into smaller sets that each has a specialized controller. Using the layout of controllers illustrated above, we can begin to understand how the concept is applied to the Hubo.

Typically, the overarching desired behavior for a humanoid is some sort of complex motion such as walking or dancing. Without a DCS, the main controller (in this case a PC104 computer stack) would not only be responsible for running the model which determines what position each joint should be in, it would also have to directly control the corresponding motors and making sure they get to where they are supposed to be. As one might suspect, this adds needless complication and overhead. With a DCS, instead of the main controller worrying about both where the motor should be /and/ how it gets there, the main controller essentially delegates the latter task to a sub-controller called a motor controller (MC). The task then becomes a sub-process of the main process (which is completing the complex motion). Although this intermediate step may initially seem unnecessary, its benefits quickly become apparent once the technical intricacies of controlling multiple motors are revealed.

The MCs used on the Hubo are all custom, printed circuit boards (PCBs) designed by the HUBO Lab. The main functional difference between them is how many channels or motors they can control. Other than that, each MC board contains a Texas Instruments F2811 Digital Signal Processor (DSP) chip, which provides intelligence for the controller, along with all the connectors and the support circuitry required to make everything work. Communication between the PC104 computer stack and the MC is accomplished using a Controller-area network (CAN bus).

Overview and Assumptions:

The primary purpose of this tutorial is to explain the process and code required to turn a fully populated, single channel HUBO Lab MC into something that can actually be connected to a motor and function. Unfortunately, the concept of MCs, in general and specifically relating to the ones developed by the HUBO Lab, is far too large in scope to be comprehensively covered here. This also applies to the topics of DSP/Microcontroller programming and the TI F2811 system architecture. Although the purpose of this tutorial necessitates a great deal of discussion about all of these things, an attempt will be made to minimize tangential information in order to ensure that the tutorial remains clear and concise.

To these ends, this tutorial includes a list of assumptions being made about the reader. Although it is not required that the reader be an expert in all the subjects and reference materials listed, he or she should at least be comfortable with them. If during course of going through this tutorial something becomes confusing, the reader should not hesitate to refer back to this list and its contents. It cannot be overstated that when working with electrical devices and motors such as those demonstrated in this tutorial, the consequences of overconfidence can be costly and dangerous.

Now then, without further delay, please note that this tutorial assumes the following:
  1. The reader has a basic understanding of how brushless DC motors function.
  2. The reader is familiar with safely using a power supply and connecting it to a circuit.
  3. The reader has an understanding of the C programming language.
  4. The reader is familiar with the information contained in the following Texas Instrument materials:
    • TMS320x281x DSP System Control and Interrupts Reference Guide
    • TMS320x281x DSP Enhanced Controller Area Network Reference Guide
    • TMS320x281x DSP Analog to Digital Converter Reference Guide
    • TMS320x281x DSP Event Manager Reference Guide
This tutorial also includes a list of equipment and software required to complete it. More detailed explanations of each item will be presented where it is first used, if necessary.
  1. HUBO Lab single channel motor controller board, fully populated and electrically functional.
  2. Maxon EC Powermax 30, 100W (PN: 309758) or 200W (PN: 305015) Brushless DC Motor with Encoder MR, Type ML (PN: 225780).
  3. All the necessary wires/cables (with appropriate connectors) for connecting the motor, encoder, hall sensor and power to the motor controller board.
  4. Power supplies to provide the required 12V and 48V, current limited is recommended.
  5. Copy of Texas Instrument’s Code Composer Studio (this tutorial uses version 3.1) and On-Chip Flash Programmer Plug-in.
  6. Texas Instruments F2811 compatible, 14-pin JTAG Emulator (list available here).
  7. A second computer or device capable of connecting to a CAN bus with the motor controller and transmitting messages. For example, one of Kvaser's many USB-CAN products.

Table of Contents


Home | About Me | Tutorials | Media Archive | Resources