Saturday, August 08, 2009

Hexamon

So today I discovered two things: I have a transistor in backwards on Uno-version-Dos' drive board and I am out of de-soldering braid. :(

Nevertheless, as the wife was tied up all afternoon today, I was determined to work on robots. I stopped by Trossen Robotics and caught some of the footage of the Mech Warfare event they held at the 2009 RoboGames. Boy, it was really neat. I also caught a note from Alex that indicated they were creating a hexapod league.

It occurred to me that hexapod gaits were simple enough that it might well be a good project for me to get some custom Dynamixel gait code up and running. From there I could branch off and do more complex tasks. Custom gait code is something "I've Been Meaning to Do."(TM).

So, I spent all afternoon assembling the frame below from my Bioloid kits.


Its always shocking to me just how long it takes to do mechanical things. Looking at that pic, I think it should have taken no more than a hour, but it was actually more like four or five hours. Nevertheless, it was a fun afternoon and my head filled with delusions of grandeur as I built it.

I rather like my name too. Its from Eon. I figure I'll wind up letting this bot will ride on a whole line of design flaws, so it seems appropriate.





Wednesday, July 29, 2009

Uno Sensor Board Update

I worked on my sensor board again tonight. I got the sensor portion, as opposed to the led driver portion, working. I had to do a bit more board repair. Apparently, when I swapped the incorrectly routed op-amp outputs and power lines, I damaged a via and disconnected the forward looking opamp from the MCU. I wound up drilling out a couple vias to fix it.

Once I had it going I tried to run a simple test program to show which of the four sensors saw the greatest amount of light. For the test I just used a loose IR LED wired to be always on at about 20 mA. I have moved the code around a bit since last time I talked about it. I don't use the timer interrupts at all now. I just use the ADC conversion complete interrupt. I discovered you can configure the ADC to automatically begin a conversion based off of a number of other interrupts. So I set the ADC to trigger off of Compare Match A for Timer 1. That interrupt is the one that raises the strobe line to the LEDs to begin emitting light for 10us. However, I don't actually have to service the Compare Match A interrupt, the ADC will begin conversion regardless. Instead I can just service the conversion complete interrupt and do everything there. The timing of the conversion is such that the sample and hold should happen somewhere around 7 us into the pulse. I've yet to verify that's really what's happening on the scope however.

Anyway my test program behaved quite oddly and only the forward channel seemed to ever detect anything. After some digging I discovered that there are restrictions on changing the ADC channel while in auto-trigger mode. Two of the three times they list that its OK to change, I could not puzzle out how to get at in code. I wound up actually disabling the auto-trigger bit, a listed time to change the channel, and then reset the bit right after the channel change. That seemed to work. But, it took about more than an hour to figure out what was going on.

I'll chalk it up to a learning experience. I've explored a corner of the AVR that'd I'd never visited before and found an annoying quirk. I'll know better next time and maybe I can get someone past the quirk in the future without them having to puzzle for an hour or more.

Monday, July 13, 2009

Rapid PCB Etching with a Sponge



hack-a-day picked this up from instructables who picked it up from Pulsar. Its a story about etching VERY rapidly, in about 60 seconds, by using a tiny amount of Ferric Chloride and a sponge. I am pretty excited for this technique and will try it very shortly. I found a second error on my LED emitter board so its over-due for a re-etch. Once I've tried it I'll report back here. If you've already tried it, leave a comment and let me know if the technique lives up to it amazing promises.


Update: Unfortunately I must report failure. Tonight at RBNO I tried this technique and found only moderate reduction in etch time for a whole lot more work than an agitated bath. I think that the copper clad the fellow in the instructable is using must be quite thin indeed. I would expect that an agitated bath would run pretty quick as well. For my standard 1oz copper clad it took me 8 or nine minutes of wiping to clear the board. An agitated bath take 10 to 15 minutes, but I don't have to do anything, I just wait for the board to finish.


So, I don't think I'll be using this technique. Its a shame, I was really salivating over a 60 second etch time.

Wednesday, June 10, 2009

Uno V Dos Sensor Board Progress



So tonight I finally got back around to working on Uno V. Dos. The part I really wanted to get working was the multiplexer driver. The idea behind the multiplexer circuit is that the 10us pulse that happens 300 times per a second will redirected to a new IR LED bank after each pulse causing the LED banks to fire one at a time in a ring sequence. To effect that, I set my timer up to generate a 10us pulse 300 times a second on the Timer1 Output Compare A pin (OC1A). That was pretty easy and I was able to see the pulse in TomG's old but still quite capable o-scope.

The pulse goes to the enable pin of the high power 3-to-8 multiplexer chip. Each of the eight outputs goes to a different bank of LEDs. So when that pulse comes in one bank and one bank only will light up for 10 us. Exactly which bank lights up is controlled by the 3 address lines of the multiplexer. I needed to swap out those address lines shortly after the strobe pulse ended when the multiplexer would be disabled, the LEDs off and there would be a goodly wait until the next pulse.

Initially I set my Timer to Fast PWM mode with the TOP controlled by ICR1 and set to about 27,000. The compare register was set to 67. OC1A was configured to set on overflow and clear on compare match. This looked great on the scope and I didn't think I'd need touch those values again. Since OC1A was set to clear on a compare match I figured that of the several timer interrupts, the Compare A Interrupt was the right time adjust my address lines that headed to the multiplexer. Wrong.

For some reason that I still not certain of, the Compare A Interrupt does not seem to fire.  I know I had the Timer 1 Interrupt mask set properly to enable both Compare A and Overflow and I had the Global Interrupts Enabled flag set, but still no joy. Overflow Interrupt, however, worked just fine. Odd. Of course, the way the timer was configured, overflow was a terrible time to mess with the address Lines. It could result in two banks lighting up, each for some percentage of the 10 us time.

Maybe its just a quirk of Fast PWM mode, but by the time I determined that Overflow worked and Compare A didn't it was late and I didn't want to change the mode. I wound up setting the Compare Register to 27000 minus 67 and changing OC1A to clear on overflow and set on compare match. This gave me the same over all signal, it just occurred at the other end of the time period. (26933 through 27000 rather than 0 through 67) It also made overflow the correct time to change the address lines.

Above you can see a picture of my success. The top two pairs of lines are two of the three address lines. The last square wave at the bottom is the strobe pulse signal from the Output Compare pin (OC1A). The Address lines appear double because the o-scope is set to trigger on OC1A and the value of the address lines changes with each pulse. The rapid variation makes the high and the low states blur together and appear to be occurring simultaneously on the o-scope. However the code that actually changes the line first sets them all to zero so that a simple bitwise OR operation can be used to write the new line states all at once. This causes a noticeable glitch in the address line wave shape where all the lines are zero for a time. However, as you can see in the photo the glitch occurs a few microseconds after the LED strobe pulse comes down meaning the LEDs are off. So the glitch does not affect them. What the glitch does do is provide me a nice point of reference that allows me to overcome the blurring of states and confirm that the address lines are changing at the right time. It was a happy glitch to end the evening with!

Thursday, April 23, 2009

Slow Progress



Not a lot of progress this week. All I managed to do was attach my repair wires to fix the reversed power and output on the TI OPA380A chips. I haven't even had a chance to test it. With any luck I did not smoke the chips.

It took me around two or three hours of futzing to put the wires on. Just a bit faster than I could remake the whole board. Of course, if I smoked the chips, I'll be remaking it any way.

On another note I happened to run across a really neat piece of electronics art. I really dig the air-wire scheme it has going on. I can see using the technique in a trophy design.




Wednesday, April 15, 2009

Blunderifc

Well it seems I made another blunder quite some time ago and have only now just seen it. I finally got around to firing up Uno's sensor board for testing. The Transimpedance Amplifiers immediately got hot. After poking around a bit I discovered that the library component that I created for DipTrace has the pins in descending order.. on both side of the SOIC chip. Doh. I got lucky, two of the four pins are N/C on the bad side, but the output and the Vcc got swapped.



You can see where I've begun cutting the traces on one of the four amplifiers. I hate to make this board even more ugly than it is, but if I didn't fry the chips its still a good bit less time to cut traces and solder jumpers than to remake the whole board, even with my new solder paster skills.

Wednesday, April 01, 2009

Side Project: Necklace



My wife had been after me for a while to make her a necklace with a copper pattern. At last I got around to it this past week. I learned a few new things and it was also pretty good solder paste practice.

The necklace itself is four jewel style LEDs that run off an ATtiny13 and are powered by a CR2032 coin cell battery. The program starts the Timer in Normal Mode with a 1024 clock divisor and then goes to sleep. When it wakes up on the timer overflow it increments a variable and goes back to sleep. Once the variable exceeds a threshold the MCU makes the LEDs blink around a bit, resets the variable and goes to sleep once more. The ATtiny13 is clocked at 600kHz and the variable threshold is calibrated to make the LEDs run about once an hour.

It had been my intent to clock the MCU at 128kHz to save the extra power. The first time I tried to set up that clock I had AVR Studio set to the the wrong MCU type. I bricked the MCU. Doh! As I discovered however, with an extra person applying leverage with an exacto knife, you can use an embossing gun to pop the chip off with little to no damage to the PCB.

Having mounted a new chip I tried to set up the clock once more. After the clock was set to 128kHz I could not talk to the chip any more. It seems that little note about making sure the ISP clock is less than 1/4 the MCU clock is for real. My ISP's clock speed is adjustable, but I learned at that moment that 56k was as low as it would go. Another MCU bricked. Doh!

The third chip was the charm because I decided that I could live with 600kHz. The docs say that in sleep mode at 1MHz the chip draws 24uA. I was able to turn off a couple extra peripherals and am running lower than 1Mhz so hopefully I'm doing better than 24uA and will get a decent life out of my coin cell. However, even with the 1024 divisor the chip has to wake up more often than twice a second to increment the variable. I guess we'll see what the ultimate battery life really is.

Saturday, March 07, 2009

Blunder!

I've made an awful blunder in the design of my drive board for Uno. I really wanted to use these nice dual LED holders that I salvaged from a circuit board that TomG gave me. However, I was so excited to get to the part where I used the solder paste that I neglected to do any final fit measurements with the parts on paper or even on the un-soldered board.


The IR leds did not nest as deeply as the original leds and thus stick further out than I was expecting. The result is that my board is 7mm too wide per the Mini-Sumo rules. Now I am looking at desoldering as many components as I can so that I can remount them on a redesigned board. If I break too much stuff during the process I'll have to place another order. Before I start desoldering, however, I think I will power the board up and see if I can get it to work.

Thursday, March 05, 2009

Solder Paste is Cool

So I gave solder paste shot. I really like it. I bought a syringe of no-clean from Howard Electronics Instruments. The syringe comes with a fairly wide tip but the syringe and tip are luer lock type so you can buy all sorts of different width tips for the syringe. I wasn't 100% certain that the syringe would be a luer lock type when I bought it so I skipped buying extra tips. I found that even though the supplied tip is imprecise when the paste reflows even significant errors seem to shrink right up to the pad dimensions. What's better is that if the geometry of your pads is not disturbed by large intersecting traces the part will sqaure up automatically with the pads. (As you'll see below one cap with one pad pretty much engulfed by a wide high-current trace is a bit skewed.. but still not too bad.) Nevertheless I'll probably buy a couple/three boxes of tips.

So below is my board with un-reflowed paste on it.



(Ok I forgot a couple components )

Now here is the after photo


I used the techniue described on Cash Olsen's site (which seems to be down now). I set a skillet to around 100 degrees C, put the circuit on it and let it heat for a few moments. I let the paste flatten out a bit under the effect of the skillet heat. Then I hit each component with a $20 emobossing heat gun at a ~3-4 inch range until the paste reflowed and actually turned silver. This generally took just a few seconds for the small components.

As you can see in the after photo I left the heat gun on the 7805 a little too long and singed the edge of the circuit board. I probabyl got the gun too close. I should have been more patient from a farther distance.

I still need a better pick and place mechnism but that will be for the next board. One step at a time. The solder paste dramaticly speeds the process of soldering components down on the board and I am quite pleased with the technique.

Wednesday, February 18, 2009

Populating SMD Components is Slow


Wow is it slow. I spent most of BDO plodding along soldering down LEDs, resistors and capacitors. I breezed through as many or more through-hole solder joints for the vias in a tiny fraction of the time I spent on the SMDs.

It as slow as point-to-point soldering on a perfboard. I prefer home-etched through-hole boards to point-to-point because of the time difference. If there is a major error in the board it is easy to start over. On a point-to-point board there is a lot of time invested in the assembly.

With my current technique for populating SMDs, I might as well be doing point-to-point. I need to up my game somehow. I'm going to look into solder paste, a reflow skillet and some sort of suction device to manipulate the devices into position.

Sunday, February 15, 2009

Toner Transfer



My skill level is increasing with Toner Transfer. I'm really careful to scrub the snot out of the of board with a Scotch Brite and acetone while wearing gloves. I rinse with only water, still wearing gloves. I'm careful to wrap the board with exactly two layers of bounty. I've gotten the hang of minimum trace widths and separations. I know what I can drill.

Usually, when I go for a dense board, the densest area always gets massive transfer failures. But this time, with all my skills and experience working with me, I transferred a really dense board with very few easily correctable errors. Its pretty darn satisfying to be able to transfer a board like this one.

Tuesday, February 03, 2009

Transimpedance Amplifiers!


Thanks to my buddy Tom I have discovered Transimpedance Amplifiers. These chips wrap up the entire functionality of the circuit I was trying to mimic. They work great. A little expensive at $4.50 but worth it. I'm using TI's OPA380A. Digi-Key has them in single quantities. So, I've now quite successfully breadboarded my IR detection circuit and am ready to commit the design to DipTrace.

I learned a little something about FETs tonight. After getting the detector working well, I tried to up the amperage on my LEDs. At some point I pulled the wire off the gate of the FET to connect it in a different way to the MCU. Suddenly my invisible light LEDs became visible light LEDS. Then they turned black and smoke actually escaped the plastic housing! Apparently I pulled the FET just at the moment the gate was charged. Since the gate is a kind of capacitor, it had no way to discharge once I pulled the wire and thus the FET remained on long past 10us. Since the LEDs are only rated for that amperage for 10us at a time, they promptly smoked. Lesson learned! Anyway the 1.32 amps should be fine. I'll just go with that.

Tuesday, January 27, 2009

Tues Jan 27 RDNO

Well its been another long time since I've updated. I haven't done a thing with that PS2 controller. Much of my effort has been centered around getting the Milwaukee Robotics Club up and running. The first club contest will be Mini-Sumo.

To that end I've been working on getting a detection scheme working that I saw many years ago in Atlanta on the robot Delta Force. Tonight I got the two high-power LEDs running 1.32Amps for 10us, 300 times per a second. And they didn't burn up! It was tough to get higher than that. I ran them with a variety of current limiting resistors and found that the lower the resistance the less voltage the resistor would drop. I think it is likely that I'm not turning my FET on all the way. They are supposed to be TTL compatible, but maybe just barely. Or possibly the voltage drop of the LED starts to get wonky at these high current levels. Still 1.32 Amps is good enough. The sheet says they are rated for 2 Amps for 10us, 300pps.

The detection circuit was much tougher. I don't fully understand the circuit he is using. I am pretty sure that the first stage is a current to voltage converter and the second stage is a regular voltage non-inverting amplifier. However, there are clearly AC aspects to the circuit and those are a bit beyond me. I think the circuit is designed to pick up the momentary current flow that results when the photodiode changes capacitance due to incident light. On my bread-board I was able to get it pretty much working but with only a half to one volt change with a 1 volt bias. I messed about with the circuit quite a bit to try to get a higher voltage swing out, but all I did was demonstrate my ignorance of the fundamentals behind the circuit. Worse, later I *think* discovered a serious wiring error even though the circuit seemed to have been working. After correcting it the circuit seem to have a strange warbling noise that was not present before. However, the circuit seemed to still function, just with the noise added in. It was starting to get late so I left off.

I think my next step is to either make an etched pcb for the detection circuit or do point-to-point on one of Eddy's nice prototype boards. Bread-boards are super great for messing about with the structure of a circuit. But, they are sloppy. Things pull out of the sockets under the weight of o-scope probes, leads get pushed down and into other leads they are not supposed to touch and there is stray capacitance aplenty. And anyway, as was made apparent to me tonight, I am not qualified to mess about with the structure of this circuit. With a soldered-up etched or point to point circuit I am hopeful that I'll get better results.