6/5/09: Step 1

I have my first wire-wrapped board working! It is a modified-CUI design. I don't have the USB port on this board, and I don't have the oscillator. I also placed a 5 bin header (white part above ground lead in the picture immediately following this) for ICSP (In Circuit Serial Programming) using the Pickit 2 programmer. I'm using an 18f4550 microcontroller. The program code I'm using to get the LED turned on is here. The LED is connected into pin RD1 of the microcontroller, and has a 1K resistor in series with the LED. I have not only wire wrapped the connections, but have also soldered them to try to make them more secure. I'm finding that when you wire wrap to a pin on an integrated circuit, you only get 2 or 3 turns of wire around the post, and this isn't enough to make it secure. The splotch on the microcontroller is some glue. I used crazy glue to glue down the ICSP header and the two (+/-) headers. As a last touch, I'm going to trim down the bottom-side leads of the capacitors and resistors.

 

Step 2:

So, what next? My goal in building these circuits is to create a more robust (less prone to falling apart) version of the hardware that Jordan and Matt made. They created hardware drivers for fan motor sleeves, and pager motor sleeves, but the hardware driver is on a solderless breadboard. My goal is to to extend this circuit to drive 8 motors using the circuit design that Matt and Jordan used. Not only do I want to use wirewrapping & soldering, but I want to use more robust connectors. Matt used a connector that is prone to falling off, and Jordan used a connector that isn't bad, but the wire is stiff. In both of these cases, I want to use a modular design too. I'd like to come from the hardware driver to the motor with a pair of wires, and use a robust connector to attach to the circuit board. As needed, I can form a bundle of wires with these pairs of wires. I'll solder wires to the pager motors and fan motors on an individual basis. This should also make it easier to try some new means of attaching the pager motors to the skin (e.g., adhesive pads; I'll just need to figure out a way of mounting a clip on a pager motor). I am only going to drive 8 motors with this hardware driver. My intent is to create a pair of these hardware drivers to control Jordan's sleeves. I want to also create a "master" hardware driver that can connect to these "slave" drivers (which control 8 motors) with an SPI interface. The master driver will use USB to conect back to a controlling computer (e.g., a Windows system).

So, the next step in the game is to add in enough additional circuitry onto this slave driver that will enable control of a single motor.

6/8/09

Matt's schematic is here. I need the following components:

KA334: High Power Dual Op-amp (mouser.com part 512-KA334)

DAC8: Octal 8bit D/A (595-TLC5628CN), purchased through mouser.com

Here's the link to the datasheet.

Voltage regulator (Futurlec-- 7805T 7805T - 5V 1A Positive Regulator; LM7805)

I think this is not needed given that I will be using a 5V power supply. I think the only reason for this component was to step down from the 9V supply that Matt used. Hmmm. Well, not fully. From Matt's schematic, the 9V supply was used as supply (Vcc) input directly to the KA334 op amps. The 5V output of the voltage regulator was used as input to the DAC.

"The 5V power supply does remove the voltage regulator requirement. If you have 5V in your airplane than you don't need the little voltage regulator. If you don't have 5V in your airplane then you will need either a 5V power supply, or just the single voltage regulator chip." Matt Wronski, 6/9/09)

What voltage range was actually used to drive the fans that Matt used?

What was the part number of the fan's that Matt used? These fan's were Sunon MagLev GM0503PFV1-8, F8340S, 5VDC

What was the voltage range used to drive the pager motors that Jordan used?

What was the part number of these pager motors?

Samsung Disk Coin-Type Vibration (Wire Leads) (purchased through pagermotors.com). This part seems to be:

The Op Amp circuit that Matt used was:

From my understanding of op amp's, this should mean that the op amp output is the same voltage as the DAC output. What function does the op amp provide in this circuit?

"... I think it would be nice to remove all those extra Op Amps. However, I think the pager motors require about 0.3 (A)mps, and the DAC only puts out 0.002A per channel. The load of these motors is far too much for the DAC. The Op Amps put out 0.7A, and it was hard to find Op Amps that supplied that much power. Also, the most powerful DAC I could find was called an 8-channel amplifier which that put out only 0.1A at 5V. So it seems that we can't use a DAC to power the pager motors or fans which take even more amps." (Matt Wronski, 6/9/09)

"I think I over estimated the 0.1A DAC in my last email. I can only find a DAC that puts out 0.05A or 50mA.
http://futurlec.com/Maxim/MAX537.shtml (see data sheet)" (Matt Wronski, 6/9/09)

6/9/09

In addition to Matt's reasoning above, another reason to use the op amps is that I'm trying to make this modular driver general purpose so that it can drive various types of motors-- e.g., the pager motors and the fan motors. While the pager motors have a current draw of 0.050A to 0.090A, and we might be able to use just a higher amperage output DAC for this, the fan motors have an amperage draw of 0.14A.

I'm assuming that the voltage range needed for the pager motors (1.5V) was constrained in software by the output of the DAC. I need to check this in the software.

One of my concerns right now is the amount of amperage overall. With the fan motors, they take up to 0.14A per motor, and right now we have 8 motors, giving a maximum of 1.12A. I have two questions: I'm using 30 gauge wire (wire wrapping) to connect components. Is this amount of amperage at 5V going to be an issue with this wire? E.g., will I fry the wire?

Also, is my power supply going to be sufficient? Looking at my power supply, with the 5V supply (USB output), it can provide up to 500mA. Clearly that's not enough. However, with the other settings of the power supply (e.g., 6V), it can provide 1300mA. It seems then that I should use the voltage regulator to change the voltage to 5V from some other voltage (e.g., 6V). Hmmm. I think I may put the voltage regulator on the master modular driver board. That way, I can just have one voltage regulator. What happens if I use my 1.3A power supply, but try to draw more than that? Would this fry the power supply?

What about with the pager motors? They need up to 0.09A per motor, and presently we have 16 motors, giving a maximum of 1.44A. My present power supply is not sufficient. With 64 pager motors (planned), this will need a maximum of 5.76A. Hmmm. What about other, lower amperage, pager motors? This starts to look difficult for powering in a glider (in the maximum case, though it does seem unlikely or infrequent that the motors would all be using this maximum amperage often). Also, in the Phillips research vest with 64 pager motors, they indicated that the system could be driven with relatively low amount of power. What specific pager motor did they use?

6/19/09

I'm trying to figure out what to do with wire gauge on my slave board. Here's the current draft of my schematic (and as an Eagle schematic):

I think I can continue to use wire wrapping (30 gauge wire) for most of the connections. E.g., the "logic" connections from the microcontroller or DAC to other parts. However, for the +/-voltage connections into the slave board, and for the connections to the (four) individual dual op amps, I think I need something heavier for wire connections.

1) Let's consider the case for using the slave board to drive the pager motors.

The pager motors need up to 0.09A per motor.

i) Op Amp wiring.

Each op amp will drive two pager motors. Thus, the current going into each op amp is up to 0.18A. There are two questions for wiring here:

a) Is the 30 gauge wire sufficient to handle the 0.09 amps (i.e., the op amp output)?

According to this reference on wire gauge, the maximum amperage for 30 AWG wire is 0.142A, and so under that rating, each motor can be driven with 30 AWG wire.

b) Is the 30 gauge wire sufficient to handle the 0.18A (i.e., the op amp Vcc and GND)?

According to the same reference on wire gauge, the maximum amperage for 30 AWG wire is 0.142A, and so under that rating, the op amp Vcc and GND need heavier wire than 30 AWG. From the same reference on wire gauge, they need at least 29 AWG, but that is right on the limit (0.182A), so it would seem better to go with 28 AWG or heavier wire.

This would seem to indicate that I can't wire wrap the Vcc and GND coming to each op amp. How am I going to do this wiring?

It would also seem that I need a heavier bus too, which will be used as the destinations for Vcc and GND for each op amp. The +/- busses are going to have to carry 0.18A * 4 = 0.72A. From my wire gauge reference, this would indicate at least 23 AWG wire (and probably heavier to be conservative).

ii) Wiring to the slave board.

As indicated above, each slave board will draw up to 0.72A for the pager motors, and some additional current for each of the other components on the board. What is the current draw for the other components?

PIC 18f4550

DAC

Op Amp (x 4)

LED

Capacitors

Resistors

iii) If I don't have individual slave boards but put the capacity to drive 64 pager motors on one board, this will use 0.72A * 8 = 5.76A.

According to this reference on wire gauge, 14 AWG wire can handle 5.9 A.

2) Let's look at the fan motors.

The fan motors each need up to .14A per motor. Right now I'm planning to use only Matt's fan sleeves and build the jacket with 64 motors using pager motors. But, why not design the circuitry so that it can handle the fan motors with each op amp if needed.

i) Op Amp wiring

Each op amp will drive two fan motors. Thus, the current going into each op amp is up to 0.28A. There are two questions for wiring here:

a) What wire gauge is sufficient to handle the 0.14 amps (i.e., the op amp output)?

According to this reference on wire gauge, the maximum amperage for 30 AWG wire is 0.142A, and so under that rating, we are just on the limit of amperage for 30 AWG wire. 29 AWG wire can handle 0.182A.

b) What wire gauge is sufficient to handle the 0.28A (i.e., the op amp Vcc and GND)?

According to the same reference on wire gauge, 26 AWG wire can handle 0.361A (27 AWG can handle 0.288A).

7/13/09

OK. So, I don't think I've made it clear at this point. I've shifted the design of this driver project. I am now creating a single board to drive up to 64 motors. The "modular" part of this project in terms of having separate boards has been changed to a single board. Having 8 different boards (with an addtional mother master controller board, so, 9 boards) seems like just a lot of boards (and a lot of hardware seeing as I was thinking of having a microcontroller on each of those boards!). So, let's reconstitute my goals here. I want to have a more robust board (i.e., more robust than a breadboard) that will be less prone to falling apart for use in experimental trials with people. I want to have more robust connectors to go from the board to the motors. I also want to have a single board that will be capable of driving different number of different types of motors. That is, I want to use this board to drive (i) Jordan's pager motor sleeves, (ii) Matt's fan motor sleeves, and (iii) my planned 64 motor pager motor jacket.

This controller board is going to have eight blocks of four op amps & DAC's, each block of which can control eight motors. I am figuring that one of these controller block's needs 1.5" by 4.5" of board space (i.e., for the four op amps, one DAC, resistors, and connectors to go to the motors), so I've created a board that is 12" high, and about 7.5" wide. The 12" height can accomodate the 8 motor blocks, and the additional 3" width should be enough for the microcontroller and additional components. I've created power rails with 34 connection points on each side (ground and positive) so hopefully that will be enough connection points for ground and positive. Here's pictures of my initial (empty) controller board:

Darryl Anderson over at the UMD MIE dept helped me putting the holes in the bars I'm using for my power bus. Here's the vernier height gauge he showed me how to use to evenly space the holes on the bars:

There are various issues that are coming up with this controller board:

1) What gauge of wire to use to connect Vcc and ground of the op amps?

I'm going to use 20 AWG (solid core) wire to run from the power rails to the op amps. This is a heavier conductor than needed (e.g., my previous estimates suggested 26 AWG wire would be sufficient even for the pair of fan motors). Scott Norr at the ECE dept recommended 20-22 AWG wire for this part of the circuit, and I found 20 AWG wire at Radio Shack, so will go with that.

2) What gauge of wire to use to go from the op amps to the motors?

I should use a stranded wire to go from the op amps to the motors because this wire is going to flex (i.e., because the motors will be on the sleeves or on a jacket, each worn by a person), and stranded wire is better mechanically for flexing.

There is gong to be a lot of wire coming from the controller board to the motors.

With 64 motors, and six feet of wire per motor (this is a guess; I'm thinking 6' of wire will be about enough to connect from the controller board to the jacket), this gives 64 * 6 = 384' of wire! And that doesn't yet accomodate the ground connections. If we have one ground connection per set of eight motors, that gives an additional 8 * 6' = 48' of wire, for a grand total of 384' + 48' = 432' of wire.

Now, given that I am going to just have a single ground connection back from a set of eight motors (because otherwise, this would mean a total of 384' * 2 = 768' of wire!), we need to ensure that the ground wire can handle the return current from eight motors.

Now, there are two cases we are concerned about right now: the fan motors and the pager motors.

With the fan motors, I actually want to just use 1/2 of a block (of op amp's & DAC) to drive each sleeve. Each sleeve has four motors. This seems simpler to me. My plan is to have a single board connector that provides a connection for each block. This is as opposed to a single board connector for each op amp output (i.e., each motor). A single board connector for each motor would mean 64 connectors that would have to be setup for connecting the planned 64 pager motor jacket. That's alot of connectors! Eight connectors would be far far eaiser, far less prone to making erroneous connections, and far less prone to connector (mechanical or electrical) failure.

So, for the fan motors, the return ground wire for a connector would be carrying at most 0.14 * 4 = .56A.

With the pager motors, the return ground wire for a connector would be carrying at most 0.09 * 8 = 0.72A.

I'm planning to use a board block connector that can accomodate both the ground and individual motors wires. One question here is: Should I use the same wire gauge for the ground and the individual motor wires? Using the same wire gauge would be simpler. According to this reference, 28 AWG wire can handle .83A. Since this seems to be a little too close to our max (0.72A for eight pager motors), it seems reasonable to go up to 26 AWG wire.

3) What type of connectors to use to connect the motor wires to the controller board?

I'm going to use nine position AMP connectors for each motor block: one line each for each motor, and one ground.

4) How to enable multiple reference voltages into the DACs?

The fan motors have a maximum voltage input of 5V and the pager motors have a maximum voltage of 1.5V. Thus, I need either 5V or 1.5V reference voltage into the DAC's depending on whether I'm driving the fan motors or driving the pager motors.

It seems that I could use an analog output pin of the 18f4550 microcontroller on the controller board to set the reference voltage of the DAC(s). However, I'm concerned about the following issue. What if the pager motors are connected to the controller board, and someone makes a mistake in software of selecting the voltage range for the fan motors? It seems like we may fry the pager motors or some parts of the controller board. Not good. It would seem like we need some kind of hardware fail-safe. Can we somehow detect the voltage needed by the particular motors? E.g., can the hardware ask the motors for the voltage that they require?

My plan for this is to use an off-board voltage divider that will connect in via the same type of AMP brand connectors I'm planning for the wires going to the motors. I was hoping to use literally the same connector as for the power, but with an additional three leads but I'm maxing out on the number of positions for the connections (I need 9 positions, and the max for this type of AMP connector is 10 positions). So, I'm going to use a separate 3 position connector for the off-board voltage divider. I should be able to bundle that voltage divider along with the power connector (and 9 position connector) for the motors. So, each block will have two connectors. Failing to connect either of these connectors will result in non-operation of the motors. If the motor power connectors don't connect, the motors won't have power. If the voltage divider doesn't connect, the DAC will not have a reference voltage, and I'm assuming that by default the reference voltage would then be 0V.

This will also give extra flexibility per motor driver block. Each block will then be capable of having its own voltage level for driving motors.

5) This controller board will have a USB connector, but will be self-powered. Does the components for the USB hardware need to vary from that in the CUI board example? That is, so far, I've only tried the CUI USB circuit with USB-powered (non-self-powered) applications.

OK! So, I've now tested the CUI board as self-powered. It works!

6) Do the KA334 op amps need 1K resistors on their positive inputs (pins 6 & 7) or can they have 10K resistors? (The higher resistance would draw less power-- Scott Norr recommends).

I cannot see anything in the KA334 datasheet that gives a specification of current draw for pins 6 & 7. I'm going to assume that 10K resistors are going to be OK.

7/17/09

A few more questions:

1) What is the maximum amperage output of the op amps I'm using?

Output current is up to .7A. Given that my maximum expected amperage draw is .28A for two fan motors (.18A for two pager motors), this would seem to be OK. Plus, I really want tactile actuators (e.g., motors) that draw LESS current, so my future needs for motor amperage would hopefully be on the lower side for current draw.

2) What is the amperage draw of the DAC on the reference voltage?

Fom p. 7 of the DAC datasheet, it says for Vdd=5V and Vref=2V, Iref = +/-10uA.

7/20/09

Here's an updated schematic (Eagle Format) for my 64-motor driver board (here's a PDF format version). I've only put in one block of motors.

7/28/09

I've just had a nasty thought. What if the latency between activating the first motor and activating the 64th motor is too long??? One disadvantage of this monolithic board structure (all 64 motors controlled by a single microcontroller) is that they will be activated serially. If I would have gone with 8 separate boards, I would have gotten some parallelism out of the motor activation. So, at this point, I need to make an estimation of the the latency of the amount of time between activating the first motor and activating the 64th motor.

I'm going to make a lower bound estimate. In Jordan & Matt's code, they call a function "SignalDAC", which activates one motor at a particular strength (DAC amount; related to voltage). 64 times the duration of the call to SignalDAC will be a lower bound on the amount of time to activate all 64 motors with the current monolithic board design.

In PIC microcontrollers, the instruction cycle takes four clock periods. The clock rate on the 18f4550 is 48 MHz.

I have estimated that a call to SignalDAC takes 219.5 µseconds (per call). So, at the bare minimum, we need 64 calls to this function to activate all the motors. This gives a total of 0.014 seconds. i.e., this is 14 milliseconds. If we want to update the motors at 10 Hz, this will give a total of 100 milliseconds in which the motors can be activated. This will give at most a window of 86 milliseconds in which the motors are set to their level, or ramping up to the level at which they have been set, before they are set again.

This assumes that we always set the level for all motors at the same time. Presently, Jordan & Matt's code is not designed to do that. It's designed to connect into the microcontroller once per motor activation using USB, and set that motor level.

Another question here is: How long does it take to connect into the microcontroller, from the host (e.g., Windows) computer, using USB? Just a guess right now, but I suspect that will take at least 100 milliseconds. If it takes 100ms to connect to the microcontroller using USB, and it takes 14 ms to activate all 64 motors, then it would take 114ms (minimum) to activate all motors. This would mean we could not refresh the motors at 10 Hz. Our refresh rate would be more like 5 Hz.

I would like to get an estimate of how long it takes to connect to the microcontroller using USB.

I'm going to use a test program in Microsoft Visual Studio written in C++, and get a time stamp before calling the microcontroller through USB (to do an initialization), and then get the time stamp after. The difference between these two times will be an estimate of how long it takes to access the microcontroller via USB from C++ (I expect a little more overhead using Java).

OK, the results of this are:

780ms-752ms = 28 ms

809ms-775ms = 34 ms

679ms-649ms = 30 ms

107ms-73ms = 34 ms

761ms-723ms = 38 ms

Average = 32.8 ms

So, connecting to the USB using just C++, and setting the level for all motors would take 32.8ms + 14ms = 46.8ms.

If separate connections through USB were used for all 64 motor levels, this alone would take approx. 64 * 32.8ms = 2099.2ms = 2.0992s.

Thus, it's clear that it's not feasible to connect into the USB each time a motor needs to be set. Even if the connection to the USB was made to set the level for a block of 8 motors, this would mean that 8 USB connections would need to be made to set all motors. Eight conections would take 262.4ms. This would limit the update rate for the motors to less than 5Hz, which seems too slow.

Java Testing

Since the Java layer is almost certainly going to add an appreciable amount of time, I should get estimates of making the USB connection using Java.

I'm going to use Jordan's microcontroller setup to run some tests. From the tactilerendering package Main.java test, which does the call "actuateMotorPercent" (actuating a single motor), the timings (for five tests) are each 32ms. Interestingly, this is nearly the same timing as without the Java layer! Note that the granularity of the timing method was about 1ms.

It would also be good to get a timing for activating a single motor on the TN Games vest. Hmmm. Here, I'm getting 0ms delay. With Jordan's code, I think the code only returns from the USB connection when the motor is changed. Possibly here, the call returns from the USB connection before the motor actuation is finished. [My test was using the Java Native call FireEffect with parameters 1, 1 (motor 1, speed 1)]. Hmmm. This actually would seem to be more curious than that. It seems that the actual connection with the USB device is made in parallel while the return to the calling code occurs. I wonder if the DLL setup is done somehow for the DLL invocation to be executing while the return occurs. Even if I put the FireEffect call in an infinite loop, I get the same 0ms delay behavior. Interesting!

Timing Conclusion

I was doing this timing measurement to see if was worthwhile continuing to develop the monolithic 64 motor driver board. It will take approx. 46.8ms. to set levels for all 64 motors through the USB connection. It should still take nearly exactly this amount of time when doing this motor control through the Java interface (JNI). This would mean we could update the motor speeds at least at 10Hz.

8/4/09

I have now got the board ready for its first test. I have one op amp output ready. The board is populated with the MCU, with one DAC, and one op amp. The 3 pin MTA header is set up with the DAC ref voltage just taken from the +5V input. My goal is to test if my wiring so far has been set up correctly.

OK. The PICKit2 has been detected on the board. I have flashed the program memory. Also: My power LED connected into the USB port is turned on. I will now power on the board, with my external +5V source and see if it turns the other LED on, as the program I flashed (here) is supposed to do. It does! The RD1 LED turns on!

Now, moving on to my next test. I want to see if I can control the voltage coming out of the op amp using the DAC. I should be able to obtain from 0V to 5V on the output of the op amp, which is presently connected to the 1st pin of the 9 pin MTA connector for motor block 1.

The next test I want to run is to make sure that the USB wiring is correct. I am going to flash the firmware with this program and run this program on Windows.

OK. When I connect the boad into my Windows laptop using the USB cable, my USB power LED does not light up. Or rather, the USB LED lights up temporarily, then turns off. I tried powering the controller board with external power, first, then connecting the USB cable into the Windows system. The Windows system says "unknown device, and my Windows program does not successfully detect my USB device.

The alternatives at this point seem to be: (a) that I've incorrectly wired some part(s) of the board, and (b) my wire wrapping job is insufficient to make good electrical contacts (that is, I've left many of the connections on the board unsoldered to carry out this test).

I've got it working! I had the USB pins cross-wired! Ooooops! I've got them right now, and the USB led lights when connected to the Windows/host USB connection. Plus, the Windows program above works with the MCU firmware (as linked a few lines above). Next: I need to check to see if the DAC can drive the op amp and vary the voltage output.

8/5/09

I seem to have output on the first op amp now! I am getting 4.47V out of it when I use signal strength=255. Let's try 128 signal strength. That dropped the voltage to 3.78V. So, clearly I have control over this output! Yes! I changed DAC 0 and motor 0 back to 255 signal strength and have 4.47V again! Let's try signal strength=0. That drops the output of the op amp to 0.17V. (This is MOTOR1 output of the 1st op amp, which I have designated as the rightmost op amp on the motor block). Let's try signal strength = 64. That gives 1.92V. Yeah! My first motor block is working!!!

Let's do this systematically. Here's a spreadsheet with voltage outputs for signal strength from 0 to 255. Here's the plot of voltage (Y-axis) against signal strength (input to DAC):

It seems clear there is a bug in there somewhere. The graph should be linear from start to end. Here is the firmware and Windows code I'm currently running.

Reading in the DAC data sheet, it says that the reference voltage max is Vdd - 1.5. I'm using Vdd=5V, so Vdd-1.5=5-1.5=3.5V. This is pretty darn close to the maximum output voltage that I'm seeing with RNG=0 (I'm measuring 3.77V). So, it would seem pretty clear that I should construct a voltage divider that limits the Vref to 3.5V.

Matt used two 1K resistors in his voltage divider. His voltage regulator was providing 2V output.

I would like 5V output max for the fan sleeves. So, I'm going to provide 2.5V reference voltage. I have a Vdd=5V. So, two 10K resistors should do the trick for the voltage divider. The reference current draws about 10uA. The current flow through the two 10K resistors (in series) should be about 250uA.

I now have the new voltage divider in place on the 3 position MTA connector for motor block 1. This should give a Vref of 2.5V. With RNG=0, I'm getting 2.53V output for motor 1, with signal strength=255. Yeah!! This is what I expected. With RNG=1, I am getting: 4.48V output! This isn't quite 2x the low output, but it's better than I was getting before. I'm going to run another systematic test. This will have RNG=1. The spreadsheet with the data is here. The voltage plot is here:

So, what seems to be happening is that 4.48V is the maximum output of each DAC channel. They do say in the data sheet for the DAC that the recommended analog full-scale output is 3.5V. So it seems they are recommending that 3.5V is the maximum DAC output. If this is true, then the max Vref= 1.75V.

If I use RNG=1 in the firmware, then I should use a voltage divider that provides Vref=1.75V for the fans. And, for the pager motors, I should use Vref = .75V.

Hmmm. This will only give the fans we are using up to 3.5V and they need up to 5V. What would it take with the op amps to take in a range from 0 to 3.5V and output the range 0 to 5V?

8/13/09

I've decided to use potentiometers in the first motor block to tune the op amp outputs. Schematic to follow shortly.

I now have 4 of the op amps in motor block 2 working! Here are some pictures of the wiring. I've also glued on more IC sockets, and that probably makes it look more impressive :).