Astro tracker Help

Hi Everybody

I am a novice with arduino, I am building this star tracker for astro photography. Tommy's Star Tracker (TS-2) by tommyent - Thingiverse.
Unfortunately there is no real instuctions for the electronics. I am using using nema 17hs19-2004s1 stepper motor.
I would like to use Arduino Nano for the controller and 2209 driver for the silent aspect.
Would this stepper expantion board work with a 2209 stepper driver or would something different be more suitable.
https://www.aliexpress.com/item/1005001369566025.html?spm=a2g0o.detail.0.0.183c8MDb8MDbBi&mp=1.

Can the Nano and stepper motor be powered with 5 volts from a USB power bank.
Any help would be awesome.

Not for long, and a boost converter is usually required.

In general, steppers are power hungry, very inefficient, and the drivers usually require a power supply in the range of 12V-36V.

I am using using nema 17hs19-2004s1 stepper motor.

Have you verified that this motor satisfies the torque and power requirements of the tracker mount? To get full power, a driver capable of handling more than 2 Amperes/winding is required. Motor power consumption is around 12 watts at 2A current.

  • Rated Current/phase: 2.0A
  • Phase Resistance: 1.4ohms
    = 11.2W

Thanks for the reply. Ok regards the power. I am using the same stepper that the as the original makeer.

This is the same motor used in small 3d printers, so you can use the same driver ( used in these printers ).
The motor has a max current of 2A ( x phase ), you have to set use a lower current ( at 2A the motor will burn ), but lowering the current means also reducing the torque of the motor.
At 1.5A the motor should dissipate 6W ( 1.5Ax1.5Ax1.4ohmx2phases, consider something more to include the driver and the rest of the circuit let's say 10Wmax ).
You should have no problen in driving the stepper at 5V ( stepper is rotating very slow, a step every 67ms and has an internal resistance of 1,4ohm, so is 'quasi-stationary', high voltages are used to achieve high speeds ), consider that the power supply should be able to supply the high peaks of current required by the motor ( 3A for both phases )

P.S.
Nice project... but also lots of pieces to print with good tolerances and surface finish

You won't know that until you have assembled and tested the mount. As mentioned above, good surface finish of moving parts is required.

Thanks for the info. That helps heaps. In have printed assembled it. It should work fine with light camera and lernses up to 150mm. It is not for telescopes and long lenses.
No wot order some parts and wire it up.

Ok thanks

Hi again. I have a Stepper shield arriving today so hopefully that will be sorted.
The next question is the code for the project. The one supplied in the original project needs something added by the looks of it. Can anyone help with this. Also it needs converting for the southern hemisphire. I asume just the rotation direction.
The error is HASHTAG SYMBOL HERE. I have absolutly no idea what this means.
I am a total newbie with this so any help will be vey much appreciated.

// TOMMY'S STAR TRACKER

const int stepPin = 9; // Set the stepping pin to pin 9
const int dirPin = 8; // Set the direct pin to pin 8

(HASHTAG SYMBOL HERE)define DELAY 67.343 // This is the delay in between steps in milliseconds

void setup() {
pinMode (stepPin, OUTPUT); // Set stepPin as output
pinMode (dirPin, OUTPUT); // Set dirPin as output
digitalWrite (dirPin, HIGH); // Set the direction to clockwise
}

void loop() {
digitalWrite (stepPin, HIGH); // Start a stepper pulse
delay (DELAY); // Wait
digitalWrite (stepPin, LOW); // End a stepper pulse
delay (DELAY); // Wait and repeat
}

All that code does is step the motor at a fixed rate, one step every 134 milliseconds.

Apparently, the author is not aware that the decimal fraction is ignored by delay(). The comment about DELAY is wrong, too.

Keep in mind that the Earth rotates in the same direction, regardless of hemisphere.

How many motor rotations does it take to turn the scope / camera mount 1 revolution?

The code only needs to move the camera at the same speed as the rotaion of the earth so that you can do long exposures without getting star trails.
I realise that the earth rotates in the same direction but the stars appears to move in the opposite direction across the sky.

Any help how to fix the errors in the code?

20T stepper motor gear 80T. 4-1 gear ratio so 4 times.

// TOMMY'S STAR TRACKER

const int stepPin = 9; // Set the stepping pin to pin 9
const int dirPin = 8; // Set the direct pin to pin 8
#define interval 67315UL
//how is it calculated:
//24*60*60*1000 how much milliseconds in one Earth rotation = 86164000
//UPD ((23*60+56)*60+4)*1000 = 86164000 ms with respect to other distant stars (means except the Sun)
//200*4*50 how much steps do geared motor for one rotation = 40000
//86164000/40000 how much milliseconds for one step = 2154.1
//if microstepping 16 half pulse period is 2154.1 / 16 / 2 = 67.315625 ms

void setup() {
  pinMode (stepPin, OUTPUT); // Set stepPin as output
  pinMode (dirPin, OUTPUT); // Set dirPin as output
  digitalWrite (dirPin, HIGH); // Set the direction
}

void loop() {
  static uint32_t oldMicros = 0;
  if(micros() - oldMicros >= interval) {
    digitalWrite (stepPin, !digitalRead (stepPin)); // End a stepper pulse
    oldMicros += interval;
  }
}

This modification (for Nano) should step the motor every 134686 microseconds (134.686milliseconds).

unsigned long
  pulseTimer,
  pulseInterval = 134686,
  elapsed,
  pulseLength = 20;

const int stepPin = 9; // Set the stepping pin to pin 9
const int dirPin = 8; // Set the direct pin to pin 8

void setup() {
pinMode (stepPin, OUTPUT); // Set stepPin as output
pinMode (dirPin, OUTPUT); // Set dirPin as output
digitalWrite (dirPin, HIGH); // Set the direction to clockwise

}

void loop()
{
  elapsed = micros() - pulseTimer;
  if(elapsed >= pulseInterval)
  {
    pulseTimer += pulseInterval;  
  }
digitalWrite(stepPin,elapsed < pulseLength);
}
2 Likes

NOTE, Last post EDITED!

how big value returns micros() ?

The original code was 67.343 milliseconds * 2, so 134.686 millis.
134686 micros = 134.686 millis.
delayMicroseconds() function only works up to 16383 micros.
micros() returns up to 2^32 - 1 or 4294967295 microseconds.

so limitation of 16384 is only for that delay, good.
but we doesn't know how "original" sketch get value of 67.343 milliseconds

That's why I was asking about gear ratio but microsteps also comes in to play so....?