Thursday, March 17, 2011

getting stuck

I found an apparently outdated arduino boot cloner sketch, originally designed for an atmel atmega8 chip here.   I also downloaded the ADABoot, tried to get the most recent one, it was ADABootLoaderR3_9D15.zip, and had the hex files included so I didn't have to compile those.

I edited the PDE and converted it to a multi-load configuration with DIP switch control (168,368,644P) with proper fuse settings and three different bootloaders in PROGMEM tables. The original had been quite space-constrained as it was designed to load on a atmega8, which had very little program flash. I'd add more chips, but those are all I have. Besides, I the more advanced ones would require a completely different type of socket, which I don't have plans to get any time soon.

I went ahead and used the arduino IDE to compile and load, figuring that I wouldn't have to put up with it for long, but I was wrong. Stupid thing kept screwing up too, but I got that figured out.

So I got it to load successfully, and it burned the new bootloader (the right one too, I made it tell me on the serial console which one it was loading) and swapped the atmega168 on my diecimila (which has a busted pin) with one of the two I just burned. No joy, didn't work at all. I have no clue why. Didn't even flash the debug LED at me!

So I swapped them back and tried again. Only now I can't get the chip to talk back to the boot cloner at all! Not even the basic "program enable" command gets a response back now. The fact that it indicated that it burned successfully means that the chip was talking back to the programmer, but it isn't anymore. Maybe I've screwed something up in the software? I've tried any number of things to get it going again at this point, so it's possible.

I've even completely torn the breadboarded circuit apart and put it back together again with the diecimila on the other side of the board because the wiring worked better that way. I've tried the other atmega168 I have. I've added more debug statements to the code. I've added a little delay when pulsing SCK. I've vastly improved error handling and reporting. I've added an additional delay and start button released checking to the error reporting so it doesn't cycle through to burning again instantly. So I know exactly what the problem is: The chip to be burned doesn't talk back. At all. No clue why.

This is the part of this stuff that I hate. I have no real idea what to try next, so anything I try will be random. (Actually, I've done quite a few mostly random things already, as you may have guessed) I've wracked my brains to no avail. I've spent hours on this problem. I've read up on it. I've consulted the datasheet. I've checked and recheck the pinouts, schematic, and wiring connections. Why doesn't it work? I have no idea. It's so simple, yet it has obviously gone wrong somewhere.

I hope that I will soon move on to the next step: triumphant success. If I only knew how to get there from here.

So I write a blog post, and in the process a few things have occured to me:

Go back to the original version of the software, doing it up right this time with a makefile, bootloaders in separate source files, etc.

Run another pin over to TOSC1 (or is it TOSC2?) and put a PWM on it on the assumption that the clock source fuses are screwed up.

I think I'll try the software first, as I'm more comfortable with software anyway. I do wish I'd bought the atmega368 chip that I thought I had instead of the two atmega168's that I actually did though.

Saturday, March 12, 2011

Haven't built the boot cloner yet. Thoughts on measuring heat transfer.

    I've not built the boot cloner, though I have finally gotten the ADAboot bootloader downloaded, and I've got the bootcloner code and correct fuse settings. It's mostly a matter of compiling the boot cloner itself. Todo list for burning bootloader:
        Getting the bootloader reduced to a PROGMEM table.
        Setting the correct fuse/lock values.
        Setting the correct bootloader address.
        Compiling the boot cloner (needs arduino libraries)
        Loading the bootcloner
        building the breadbord.
        burn.
        test.
       
    As for the thermodynamic testing, I want three thermistors working at the same time. Here's my plan:

    One at the top of the heat sink, testing to see if plastic will soften - i.e. is the heat sink effective enough to actually print with this thing mounted in a plastic bracket?

    One just below the heat sink, testing the effectiveness of the thermal barrier. It's a solid steel bolt, even if it is stainless, so we'll see. Initial non-measured testing looked good, but I'd like some numerical results.

    And of course one in the heater block itself to control it's temperature. I'm planning to insulate the heater block itself, and also record the PWM averages so I can have a "heater watts" readout as well. If I can get a few fans working, I would like to try it out with a few different fans as well, see how much active cooling is really needed.

    My primary concern is the "steepness" of the thermal gradient across the bolt seperating the heat sink from the heating block. I want the softening zone to be within the tappered part of the bolt.

    I want to heat it up quickly and then let it sit for five or six minutes to reach equilibrium, which means I'll need to rework the heating code. Maybe even re-enable PID, which requires the 328 chip I haven't burned a bootloader onto yet. Also my 168 chip has a dead pin, and it's one of the analog pins. I don't have enough spare pins to hook up a third thermistor.

    My goal is to get some answers so some design questions, before they result in a broken extruder, ruined print, and downtime. My questions are do I even need to turn down the center part of the thermal barrier? If so, did I do a good enough job? Is the "softening zone" in the tapered part of the barrel? To answer these, I think that I need to test non-turned-down barrel against the turned one, see if it made any difference and if so how much.

    For my model, I'll assume that the heatsink is a uniform temp, the heater block is a uniform temp, and between is a uniform temperature gradient. Then I'll figure out where the "softening zone" is, and calculate the height of the tapered part of the barrel to see if the "softening zone" is low down enough to be in the tapered part of the barrel.

    Of course, the gradient isn't uniform, and a large part of the point of turning the barrel down is to make it be non-uniform. But a uniform gradient should have the "softening zone" higher up, as the thinnest part of the barrel is the bottom of the turned part due to the taper. So if I can prove that the tapered barrel would have the softening zone low enough even if it had a uniform gradient, I'm in good shape.