# Tutorial: Driving Multiple LRAs

### Introduction

There are many applications that may look to use multiple actuators for haptic feedback, but the ideal design would only use a single driver to keep design complexity and cost to a minimum. We’ve previously discussed why it is difficult to drive more than one actuator at a time, however, as long as the actuators don’t need to be driven at the same time then it is possible to use a single haptic driver.

It's possible to drive multiple LRAs from a single source, one at a time

Driving multiple different LRAs, one at a time, is the focus of this tutorial. And although we are using the M20-200 as a starting point, the concepts can easily be used in an independent design.

As the DRV2605 has only one pair of output pins for the drive signal, the only way to drive one of several actuators is to route the drive signal to our chosen actuator. In order to achieve this, we’ll discuss two possible approaches - the first using MOSFETs as simple switches to connect (disconnect) the chosen actuator(s). The second uses analogue switches, essentially replicating the design of the Haptic Grip.

Both these methods require additional output pins available on the processor, which will also need modifications to your program to ensure the correct actuator is selected (as you might expect). In addition, there are trade-offs for each design, which we highlight below.

Finally, we propose an alternative approach which involves modifying the Haptic Grip. As this alters the hardware of the grip itself, it’s not recommended - but helps illustrate the flexibility of the software that enables the different Modes of Operation.

### Initial Testing: Simple Breadboard Circuits

This method can provide a quick proof-of-concept as it can be easily built on a breadboard using relatively common and cheap MOSFETs.

The idea is to connect several LRAs in parallel, each with a MOSFET between a terminal and one of the drive signals (either + or -). Each MOSFET is designed to act as a switch, the process ensures all the switches are open (creating an open circuit for all parallel branches) with the exception of the MOSFET that connects the chosen LRA.

Example schematic for multiple LRAs in parallel

To build and use this circuit, you will need to:

• Ensure the Haptic Grip is unplugged from the Haptic Controller
• Use one of the External Actuator terminals (the Molex or screw block) to connect the Haptic Controller to the breadboard
• Connect your LRAs and MOSFETs as per the circuit above
• Connect the gate of each MOSFET to a spare digital output pin on the Haptic Shield (see the pin mapping diagram here)
• Load the Development Mode onto the Arduino (download here, the guide to changing Modes of Operation on page 18 of the User Manual here)
• Add your code to select your chosen actuator using the digitalWrite(); function, take note of whether your MOSFETs are NPN or PNP - for an N-type transistor the switch will be ‘closed’ when the gate is high, mixing up your transistor and signals can cause you to accidentally attempt to drive all the LRAs (but one)
• Ensure your code only switches on one LRA at a time
• Ensure your selected output motor is an LRA, you can use the code motor.selectMotor(3); if your LRA is a C10-100, or similar.

If you wanted to add some extra protection, you could add a line in the code to check that only one of the output pins connected to MOSFETs will be high (if using N-type) right before playing the haptic effect.

### Prototyping: Replicate The Haptic Grip’s Routing Hardware

The Haptic Grip houses four different actuators, and rather than using the simple MOSFET approach above, analogue switches route the drive signal to the desired actuator. Although these parts are less likely to be lying around your lab, this solution is more elegant and will likely resemble the final design.

One of the major advantages is that analogue switches typically have extremely low resistances, meaning there is a much lower voltage drop. This minimises the losses in the drive circuitry and helps keep the amplitude and efficiency up. In addition, they have mutually exclusive outputs, meaning it is possible to create a circuit that which cannot accidentally drive more than one MOSFET at once.

Drain terminals D1 and D2 can act as inputs or outputs

You can view the schematic and PCB images of the Haptic Grip (and Haptic Shield) in full in our Documents and Resources section. The switches used are the ADG884 from Analog Devices, which use a single logical input to either connect the two pins of ‘source terminal’ A or the two pins of source terminal B to the two pins of the ‘drain terminal’. These can be used in either direction, i.e. with the source terminals as inputs and the drain terminal as an output (choice of two input sources) or with the source terminals as outputs and the drain terminal as an input (choice of two output directions).

The Haptic Grip actually uses an analogue switch for each actuator, using the drain terminal as the output to the motor and one of the source terminals as the input. The unused source terminal is connected to itself, thereby removing the actuator from the circuit when not in use.

An alternative design would be to use the source terminals as outputs, each connected to their own actuator. This would mean a single chip (and logic signal) could control two actuators. However, this design becomes problematic if using more than two actuators, as cascading multiple analogue switches will reduce the drive voltage, draw more power, and could potentially connect multiple LRAs at once if poorly designed.

We recommend replicating our design below, for a full explanation you can contact our engineers here.

A snippet of the Hatpci Grip schematic

Remember, you’ll need to make similar changes to your code as described in the MOSFET method above to ensure that the DRV2605 is correctly set to drive an LRA. As this method requires additional code to correctly set the analogue switches, we’d expect you to be in Development Mode, where you can use the same motor.selectMotor(3); if you are using C10-100s.

One final note on using multiple switches is that using multiplexing can save on the number of digital pins required. The Haptic Grip uses the SN74LVC1G139 2-to-4 line decoder, whereby using only two inputs we can select from four mutually exclusive events. In simpler terms, this means we only need two digital pins to activate any one of our four actuators:

 Decoder Input Outputs B A Y3 Y2 Y1 Y0 L L L H H H L H H L H H H L H H L H H H H H H L

This type of logic fits our application perfectly, and with only three spare digital pins on the Arduino we could extend this circuit to support 8 actuators, four would support 16, and so on.

### Drawbacks And Limitations

The main two limitations of the above are fairly obvious, and we’ve already touched on them. First, as the drive signal passes through additional components (which don’t have zero resistance) there is some performance loss. Analogue switches perform better on this front, but if you have multiple levels of switches you lose the same amount of voltage each time, thereby limiting the complexity.

In addition, there is a higher component count - especially if using our recommended design of a dedicated analogue switch from each actuator. The chips themselves are very energy efficient when not in use, however, for complicated or battery powered designs this might be an important consideration.

### Alternative Method: Modifying The Haptic Grip

As a final solution, it is possible to drive multiple LRAs by modifying the Haptic Grip. As this can damage the hardware and may be difficult to rectify, we obviously do not recommend this approach - but it may help those who have no alternative.

By opening and peeling back the rubber part of the Haptic Grip you can access the PCB. From here, you can see that some of the solder pads for the motor connections are accessible. This allows you to desolder one of the actuators and replace it with your chosen LRA.

You can then use the Haptic Feedback Evaluation Kit as normal, including all of the Modes of Operation, provided you make one small amendment to the code. In the motor.h file, each actuator's’ parameters are stored in a table - including whether the actuator is an ERM or an LRA. You will need to update this table to reflect the changes you’ve made in the hardware.

For example, if you have replaced the 308-102 with a second C10-100 then you should copy line 87 and paste it to line 86 (but keep the first integer to indicate the position in the array, in this case, ‘2’):

Example changes in Development Mode's motor.h file

Again, this is not a recommended approach and the above alternatives are much better designs that use the evaluation kit as intended. If you have any questions about this topic, including alternative designs for more complicated applications or driving multiple LRAs simultaneously, please don’t hesitate to contact us here.