| Part 1: | Getting Started with the HUBO Lab Motor Controller and Making Connections |
Getting Started:
Before examining the different aspects of the HUBO Lab Motor Controller, it is helpful to review its general purpose. The single channel variant used in this tutorial is designed to connect to a CAN bus and then process motor commands received over it. These motor commands are then used to guide the behavior of a Maxon EC Powermax Brushless DC Motor, pictured below.
The term ‘motor controller’ comes from the fact that the board is placed in control of the motor to which it is attached. This is not a trivial responsibility. Because the motor is brushless, it automatically requires some sort of electric switching to keep it rotating. In addition, this tutorial will also cover the topics of controlling the motor’s position and speed.
As with many other motor controllers, the principle means of driving the motor will be pulse width modulation (PWM). The basics of PWM call for turning power to the motor on and off for varying durations. This produces an average voltage in a similar way as pedaling a bike for a length of time and then letting it coast produces an average speed. This yields the benefit of no power being loss as heat due to voltage regulation.
Two examples of PWM signals and the average voltage they produce.
In order to properly control the motor, information about its state is needed. The following is a list of the different sensing apparatus used to obtain this information.
The three Hall Effect Sensorsinside the motor are used to determine the position of the rotor relative to the electromagnetic coils. Hall effect sensors work by varying their output voltage in response to changes in a magnetic field. As the permanent magnets on the rotor spin, there will be a change in the voltages of each sensor. These voltages can then be used to in conjunction with a state table provided by the manufacturer to determine the rotor’s position. This is then used to determine which coils need to be energized in order to keep the rotor spinning.
The Encoder provides the relative position of the rotor, meaning that whatever position it starts in is considered degree zero. The Encoder MR, Type ML, used in this tutorial does this by sending out two square pulses, one of which is 90 degrees out of phase, every time the rotor moves a certain number of degrees. Depending on whether the second pulse is plus or minus out of phase, which itself is dependent on the direction the rotor is spinning, a counter is either incremented or decremented. Using this counter and the number of degrees per pulse (determined from the encoder’s resolution), the position of the rotor can be found.
The Limit Switch is used to indicate a ‘home’ position for the motor. This is often important because without setting or knowing the starting position of the rotor, it is impossible to determine its absolute position in space using a relative encoder. For the sake of simplicity, this tutorial will not go over using a limit switch.
Making the Connections:
Most of the connections to the motor controller are fairly straight forward assuming that all the cables and wires have been equipped with their appropriate connectors. (Unfortunately, it is presently outside the scope of this tutorial to elaborate on how to add the proper connectors if they are missing.) With the exception of the JTAG Emulator, all of the other connections are labeled on the board as shown below and designed in such a way that they can only be oriented in one way.
Because the JTAG Emulator (discussed in the next part) has the potential for being connected backwards and causing damage to the board, it is important be especially conscientious when making this connection. As the board is shown in the picture above, pin 1 of the JTAG Emulator header is to the right and should be matched with pin 1 of JTAG Emulator’s cable, which is often indicated by a red line or wire.
Other connections that should be given special attention are the 12V and 48V power connections. Not only is it easy to put these connectors in backwards, which could cause a potentially dangerous short, it is also very easy to reverse these connections and connect the 48V connector where the 12V connector should go. The consequence of this would likely be some sort of damage to the board and therefore highly recommended that all connections be double checked before any power is applied to the board. It is also suggested that only a supply with current limiting protection be used.
Lastly, it is worth pointing out that while the MC board is designed to take 48V, it does not actually need 48V to function. In reality, the MC board only requires approximately 25V to spin the rotor when there is no load on it. This is something to consider if a 48V power supply is not available.
Continue to Part 2, Setting up Texas Instruments’ Code Composer Studio and the JTAG Emulator...