Introduction

Infineon's  DC Motor Control shieldDC Motor Control shield (see PDF product brief here) can be used to drive the most popular sort of motors (permanent magnet DC or PM DC motors, also known as Brushed DC motors or DC motors).  This post is an introduction to the board and shows how to use it. It can be used for small DC motors all the way up to large extremely powerful 250W motors. The actual devices on the board are intended for automotive or industrial applications such as pumps but the shield can be used for a wide range of applications – such as robots! Meet the robot called XMP-2:

 

Although it is designed in an Arduino shield outline, it is possible to use it with any microcontroller with a few pins connected. For this reason, it is best to also purchase some single-in-line (SIL) header pins and jumper cables.

inf-motor-front.jpg

 

Motors and Half Bridge Introduction

Some commonly encountered small DC motors are shown below (for other types of motors, click here). Any motor that functions at 6V or higher (up to 40V) can be used with the Infineon shield.

dc-motors.jpg

 

The ‘Half Bridge’ is a useful piece of functionality because it can be used to set a node of a circuit to a high voltage or a low voltage. Its design looks (at a high level) like two semiconductor devices (BJT or MOSFETs) on top of each other, and the output node is connected to the center of them.

half-bridge.png

This seemingly simple function can be a bit more difficult to implement, to take care of some additional needs. For example both devices must never turn on simultaneously otherwise high current will flow and destroy the devices. Therefore some protection is desirable to ensure this can never happen even during transitions when one device needs to power off while the other switches on. The node may have an accidental short to ground or to the supply, and this could also destroy things, so again further protection is needed. Inductive loads may need to be handled (e.g. motors) so protection is needed to prevent high voltage spikes from destroying things.

 

How can a half bridge be used? One simple use is to connect a load (such as a lamp or a DC motor) to the controlled node, and the other end can go to 0V or the supply voltage. This uses half of the half bridge.

 

Another use is to connect one end of the load to the controlled node, and connect the other end of the load to another half bridge. This completes the bridge to form a H-bridge (because it looks like the character ‘H’). This allows bidirectional control of motors.

h-bridge.png

Yet another way is to connect various brushless DC (also known as BLDC) motor winding configurations to separate half bridges and control them in sequence.

 

Another use is for driving stepper motors, again using multiple half bridges.

 

For all of the above uses, the half-bridges provide the output power to the load. Separate functionality is needed to actually co-ordinate the half bridges (conveniently just shown as “input control” on one of the diagrams above. As an example for driving a DC motor, PWM control functionality may be used as an input to the half bridges. For BLDC motors functionality may be needed to synchronise the half bridge outputs with the rotation of the motor shaft (for example by using magnetic sensors).

 

Board Detail

There are plenty of bad half bridge and H-bridge circuits on the Internet. See this post which discusses this topic in more detail.

The Infineon design uses a BTN8982 device with in-built protection to suit automotive needs. It will handle overload conditions (e.g. an output shorted to the vehicle chassis) for example.

 

The board looks extremely well made. This is the other side of the board (the top side was shown earlier):

inf-motor-rear.jpg

 

To use the board in a H-bridge mode, connect up a DC motor to the two output connections, and connect up a suitable supply (6..40V depending on the motor requirement). Then, a microcontroller (3.3V or 5V logic level) can be connected as shown:

how-to-use.png

 

If you are using an Arduino, Frederick ( fvan ) has written some code here: Infineon DC Motor Control Shield - Observations, Modifications & Tests

 

For quick testing, the round pads can be used with 4mm banana plugs as shown here:

inf-motor-4mm.jpg

 

(The pads are large to handle the huge current (tens of amps) that some motors may require.) Otherwise, use ring terminals or just directly solder to the board. Another approach is to fit sockets for 4mm banana plugs, some will fit nicely:

motor-shield-banana-sockets.jpg

 

The code needs to enable the driver by setting the INH pins high. Then, the IN_1 and IN_2 pins can be used to control the motor. The motor will be stopped when both pins are low, or when both pins are high. Set either IN_1 or IN_2 high to drive the motor in one direction or the other.

 

To perform PWM, do a similar thing but pulse either IN_1 or IN_2 with the desired pulse width modulation pattern.

 

To see what the output looked like when switching on a motor, a motor was connected up and the output probed with an oscilloscope:

no-ind.png

The slew rate can be adjusted within a small range if desired by modifying a resistor on the board per half bridge.

 

Another great piece of functionality is that current can be measured. There are two pins on the board (shown in pink in one of the diagrams above) that output a signal that corresponds to current through the device.

This is what it looks like for the small motor that I tested (blue is the input to the half bridge from the microcontroller, the yellow trace is the current measurement signal):

sense-meas.png

An ADC could be used to measure this signal amplitude whenever the motor is switched on. With the motor switched off, there is an offset that would be stored and then subtracted. If the voltage is high (between 4V and 6.5V) then this signals an error condition. Of course, this should be scaled before connecting to the desired ADC.

 

Using the Board

What can the board be used for? One application is to use it for constructing a wheeled robot. The Infineon board is extreme overkill for the small example here, but it is nice to know that the same code and same circuitry can be scaled for various sized robots. Besides, I wanted a demonstrator ‘bot for industrial scenarios.

 

As mentioned earlier, the motor driver is one part of the required functionality. Some control aspect is needed too. Furthermore, PWM alone tends to be of limited use without closed loop control (i.e. a feedback mechanism).

 

In an earlier post (see here) an analog method was used to provide one control loop to maintain a desired speed regardless of load on the motor. The desire was now to implement such a solution in software – and possibly the best board for this is the XMOS startKIT (explained here).

xmos-board-annotated.jpg

 

Two of the Infineon motor shields were used; the large 50V capacitor (designed to suit most motors) was replaced with a smaller one to suit the smaller motors I was using. Connections were directly soldered to the pads.

inf-motor-changed-cap.jpg

 

The end result is shown in the video in the introduction. XMP-2 is an open source robot and all details will be published and it uses off-the-shelf parts where possible. It is still being fully constructed!

 

Summary

728x90_banner.jpg

It is exciting to see Infineon bringing out all these interesting boards. The RGB LED Lighting ShieldRGB LED Lighting Shield was used to good effect in the Holiday Lights challenge last month, and hopefully the DC Motor Shield will find good use in the Enchanted Objects design challenge which is now enrolling (click here).