2011-09-17

But what to call it?


Board with no name?
Originally uploaded by Mickut
My automation project for tedious astrophotography tasks reached a new milestone today as I assemebled my new control board for functionality tests. The board has two main duties, one is to control the dew-heater bands and the other, main reason for this, is to control the EL-foil luminosity while taking flat frames. My astro-camera has a mechanical shutter with a limited speed, so the flat frame exposures have to be at least 2.5 seconds to eliminate the shutter movement below a few ADUs. As the LRGB filters pass a lot of light, the light has to be fairly dim to reach such a long exposure with a sensitive camera. Unfortunately, the narrow-band filters are just that: narrow. Using the same low setting on a 7nm SII filter (deep red near infrared) the not-so-warm light of the EL foil is diminished to extinction resulting in almost one minute flat frame exposures. Taking 30-60 exposures at one minute each doesn't sound like something I want to do at 6am, I can now make the light brighter for the narrow band filters keeping the exposure shorter, and brightening the light for wideband filter for extending the exposure.


Board bottom
Originally uploaded by Mickut
I drew the board in KiCad a while ago, and kept upgrading new features, most notably the extra IO-lines were added when I noticed I had an extra ATMega644. A bit of an overlook at the datasheets left me with a grave error in the schema, I had connected the VCCIO pin of the FT232RL to the VUSB instead of VCC network, so I had to cut the trace on the board and jump the SOIC-28 leg to VCC on the ICSP header. Unfortunately I realized this only after my order had already been sent back from iTead Studios, so hacking was necessary.

This would have been relatively easy, but I had found out that the ATMega644 can run an Arduino compatible bootloader called Sanguino and all I needed was a way to reset the board while programming. I had forgotten the reset switch completely, although one can pull down the reset pin on the ICSP just the same. The Arduino also supports auto-reset over FT232RL by connecting the DTR# -pin to ATMega reset thru a series capacitor (pulsing the reset). Not so fortunately the DTR# -pin is one pin over from the VCCIO and in between there's RST# pin that I don't want to touch at all. Plenty of light, magnification and a narrower soldering tip was used to make the bits of wire go to the right spots without solder bridges.

The auto-reset isn't fully reliable, I might have used a wrong value cap in the series. The Sanguino bootloader installation made almost miss a heart beat, as it didn't say what it was doing while writing the bootloader. As you can see, my board relias on the internal clock source of the ATMega, and the first thing Arduino IDE does when flashing the bootloader is setting the fuses to use an external clock source. This caused a few minutes of frustration wondering why nothing works, until I realised my ATMega needed a temporary heart transplant. With a 12MHz oscillator I was able to reset the fuses and then it was time to adjust the Sanguino bootloader code and flashing settings to match my setup. Now I'm able to upload Arduino sketches onto my board and they run jst fine, serial data receive excluded (this seems to be a known bug in Sanguino).

My actual test-code is just basic C-code with avr-libc and avr-gcc. Being able to upload the code thru the Arduino bootloader makes field-upgrades easier, though, since now there's no need to carry the programmer device along. The test-code sets the PWM channels at 50% duty cycle, the fast channels at 4kHz, slow channels at 13Hz and the servo channels at 50Hz with 16bit OCR1 registers for accurate positional control (ICR is set at 19999). The board takes around 10-20mA when operating without load, the possible servos are the only external load on the VCC line keeping the LM7805 from heating up too much. The FETs are N-channel IRF540N, saturating at 4.7 volts, so I can drive them directly with the uC outputs with minimal protective circuitry around the FET. Possible flywheel diodes for inductive loads are omitted, they can be added closer to load if necessary.  A bit of probing and coding proved that the circuit works now pretty much as planned, I was able to connect over USB-serial to the uC and change the PWM duty cycle from my computer, and the EL-foil changed its brightness just as expected (non-linearly). For the EL-foil I'm also using a current limiting resistor inline with the load, the 2.2ohm 50W resistor heats up to around 20C above ambient, very close to my estimates on theoretical power dissipation.

Now it's time to call it a day/night, start thinking about those free IO-lines on the side and plan the firmware and PC-side code a bit further into reality.

Oh, what to call it? The ability to use the Arduino IDE after all (when the Sanguino UART bugs are fixed) kind of necessitates something Arduinoish and the astrophotography background should somehow be present in the name as well. Thusfar the best name I've been able to come up with is Astruino, and that's what I shall call it from now on.

No comments:

Post a Comment