Saturday, January 10, 2009

Well my code was unreliable...

It worked around 1 time in 10, think its down to the overheads of Arduino not outputting the right frequencies.

This link has a assembly version of the routine which when uploaded to Arduino works flawlessly, perfect.  Add some buttons to control exposure lengths and perhaps a display and it would be a pretty good product.

Will try to get on the hardware again next week.

Thursday, January 8, 2009

First draft of code

void shoot()
{
  pulsetrain();
  delayMicroseconds(63200);
  pulsetrain();
}

void pulse()
{
  digitalWrite(irled, HIGH);
  delayMicroseconds(13);
  digitalWrite(irled, LOW);
  delayMicroseconds(13);
}

void pulsetrain()
{
  for (int i = 0; i < 77; i++){//initial pulse
    pulse();
  }
   
  delayMicroseconds(27830); //wait for datapulse

  for (int i = 0; i < 15; i++){//next pulse
    pulse();
  }  
   
  delayMicroseconds(1580); //wait for datapulse
   
  for (int i = 0; i < 16; i++){//next pulse
    pulse();
  } 
   
  delayMicroseconds(3580); //wait for datapulse
   
  for (int i = 0; i < 16; i++){//next pulse
    pulse();
  }  
}

Not enough time...

Well works been mental last couple of days so I havent made any hardware progress, but whilst surfing I found the link below

Nikon ML-L3 Remote

Which is superb, can use the arduino (with some coding) to automatically time the shutter to predetermined exposures when using the barn door (or shoot timelapse). I'll pick some IR LED's up from the electronics shop tomorrow.

Off to ponder how to code this up - shouldnt be too tricky.

Tuesday, January 6, 2009

Gearbox internals

Stripped the gearbox apart in an explosion of gears to get the brushed DC motor out, spent an hour putting them all back in the right place - should be ready to make the coupling and bits over the next couple of days...



Gearbox and drive

Ok to begin with I plan to make a barn door tracker, although as suggested on the EQplatform list by Nils Olof not a conventional one.

"If I were in your place, I believe I would use a base board inclined  
perpendicular to the polar axis, with adjustable supports, and a movable  
sector driven by a threaded rod and wires along the circular rim. But I  
haven't actually tried such a design, and there are many possibilities." - Nils Olof 

I liked this idea, albeit with some of my own changes which I think should work - basically a really slow record player with a ball mount for the digital camera which is then aligned perpendicular to the polar axis.

To start with how slow do you need to go? If google is right (I'm a trusting fool), then 1 sidereal day = 23.9344696 hours, multiplied by 60 and inverted gives you the required RPM for the table which is 0.000696346 RPM - or pretty chuffing slow. 

So after a bit of poking around some scrap copiers I found the following

Which is 0.1 RPM motor which is a little DC motor with a 120 000 :1 gearbox attached - which is miles too fast but at 120 000 gearbox ratio I need to drive the input at 83.561492.

Next up I have a stepper motor which, driver and microcontroller which I intend to mount onto the gearbox input shaft to drive it at the right RPM

So thats a simple stepper motor 1.8deg/step, an appropriate driver board and an arduino which is a atmel based microcontroller that you can program in quite a high level easily

http://www.arduino.cc/

The code I have on the board at the mintue simply drives the stepper in one direction at one speed but its not tricky to add some buttons to make the mount move back and forwards and fine adjust the speed.  The code used at the mintue is below, its not currently set to drive at the correct RPM:-

/*
 * Stepper driver routine
 */

int clockPin = 5; // Clock
int dirPin = 6; // Step Direction
int startfreq = 1000;
int topfreq = 125;

int test = 0;

void setup() // run once, when the sketch starts
{
  pinMode(clockPin, OUTPUT);
  pinMode(dirPin, OUTPUT);
  digitalWrite(dirPin, HIGH); // set direction
}

void loop() // run over and over again
{  
  if (test == 0){
  for (int i = startfreq; i > topfreq; i--){// accelerate motor from stationary to required speed
  digitalWrite(clockPin, HIGH); // need to do this to prevent stalling at higher speeds
  delayMicroseconds(i);
  digitalWrite(clockPin, LOW);
  delayMicroseconds(i);
  }
  test = 1;
  } else {
  digitalWrite(clockPin, HIGH);// run motor at required speed after acceleration
  delayMicroseconds(topfreq);  
  digitalWrite(clockPin, LOW);
  delayMicroseconds(topfreq);  
  }
}

First post...

This blog is to track my foray into astrophotography, starting with a Nikon D40 SLR and an under-construction barn door tracker.