Page 2 of 3

Re: Barn door tracker?

Posted: Tue Jan 21, 2020 8:35 pm
by maceemiller
Star Dad wrote: Tue Jan 21, 2020 6:15 pm
SkyHiker wrote: Tue Jan 21, 2020 3:22 am I recommend using a small stepper motor and an Arduino. With digital control you can avoid having to use circularly curved screws which simplifies the mechanics. I have built three kinds one of which was dual-axis and autoguided for a 10" Dob. Look on the AF, user Camelhat.
Please take this with the humor I mean to convey. Only a true geek would say that using an Arduino , a stepper motor, and software can "avoid having to use circularly curved screws ". The screw that took all of 5 minutes to bend to its proper shape. ROFL! I LOVE it SkyHiker! :worship:
If I'm honest, i dont get what humour you are trying to convey?

I am slowly learning from this thread and looking forward to it clicking in my head.

Re: Barn door tracker?

Posted: Tue Jan 21, 2020 10:01 pm
by ARock
maceemiller wrote: Tue Jan 21, 2020 8:35 pm I am slowly learning from this thread and looking forward to it clicking in my head.

I started with Arduino and Steppers for astronomy as well. Some links that I bookmarked...

1. Stepper motor basics from the Arduino forums.
https://forum.arduino.cc/index.php?topic=284828.0

2. In addition to an Arduino and a Stepper motor you need a "driver chip". There are many, and you need to pick one which works with the stepper you choose. But here is a good example of how to connect a particular one, the DRV8825
https://www.pololu.com/product/2133
You can get the driver chips with pins soldered on ebay for very cheap.

3. A stepper driver board for the DRV8825. This is a board to connect the driver chip DRV8825 above and the arduino without any soldering. Different driver chips have different such boards. It does not allow you to change microstepping mode on the fly.
https://www.ebay.com/itm/42-CH-Stepper- ... 2159700787

4. If you want to add a stepper motor to EQ your mount and add guiding to it, here is a good example. It will work even if you dont do guiding (the default is tracking). You need to change a few numbers to adapt the code for your particular mount.
https://forum.arduino.cc/index.php?topic=245679.0

Re: Barn door tracker?

Posted: Tue Jan 21, 2020 10:51 pm
by maceemiller
ARock wrote: Tue Jan 21, 2020 10:01 pm
maceemiller wrote: Tue Jan 21, 2020 8:35 pm I am slowly learning from this thread and looking forward to it clicking in my head.

I started with Arduino and Steppers for astronomy as well. Some links that I bookmarked...

1. Stepper motor basics from the Arduino forums.
https://forum.arduino.cc/index.php?topic=284828.0

2. In addition to an Arduino and a Stepper motor you need a "driver chip". There are many, and you need to pick one which works with the stepper you choose. But here is a good example of how to connect a particular one, the DRV8825
https://www.pololu.com/product/2133
You can get the driver chips with pins soldered on ebay for very cheap.

3. A stepper driver board for the DRV8825. This is a board to connect the driver chip DRV8825 above and the arduino without any soldering. Different driver chips have different such boards. It does not allow you to change microstepping mode on the fly.
https://www.ebay.com/itm/42-CH-Stepper- ... 2159700787

4. If you want to add a stepper motor to EQ your mount and add guiding to it, here is a good example. It will work even if you dont do guiding (the default is tracking). You need to change a few numbers to adapt the code for your particular mount.
https://forum.arduino.cc/index.php?topic=245679.0
Thankyou. Wow, my heads gone at the mo....so much to try and digest.

Re: Barn door tracker?

Posted: Wed Jan 22, 2020 2:31 pm
by SkyHiker
Star Dad wrote: Tue Jan 21, 2020 6:15 pm
SkyHiker wrote: Tue Jan 21, 2020 3:22 am I recommend using a small stepper motor and an Arduino. With digital control you can avoid having to use circularly curved screws which simplifies the mechanics. I have built three kinds one of which was dual-axis and autoguided for a 10" Dob. Look on the AF, user Camelhat.
Please take this with the humor I mean to convey. Only a true geek would say that using an Arduino , a stepper motor, and software can "avoid having to use circularly curved screws ". The screw that took all of 5 minutes to bend to its proper shape. ROFL! I LOVE it SkyHiker! :worship:
Of course it's easy to bend a screw but a bent screw cannot be turned while a straight one can. So a straight screw gives you more design options. Instead of having to drive a cog wheel around the screw you can turn the screw itself, which involves fewer moving parts to deal with.

In my design all that I used was a $3 mass produced microstepper with internal gears that is sold with a controller board. The motor axle was pushed into a blob of epoxy putty on the screw, that's all, a T nut for the screw, no other parts needed. A stepper has the advantage of being very precise and easy to program for those who are familiar with programming.

Re: Barn door tracker?

Posted: Wed Jan 22, 2020 2:50 pm
by SkyHiker
I started with a stepper driver library from some Arduino site but I found out later that this generic library was not good. Always follow the stepper motor manufacturer's pulse scheme, that works best. Also, program against a time line to avoid numerical errors. The one disadvantage of a straight screw is that you have to start from a predetermined initial position because that's what the math is based on but it's not much of an issue really.

Here's a bunch of 5 stepper motors plus controller boards for a whole $12 on Amazon, . It runs on 5V from the Arduino, no other power needed. For development it all runs off your laptop's USB port.

Re: Barn door tracker?

Posted: Wed Jan 22, 2020 6:13 pm
by Star Dad
maceemiller wrote: Tue Jan 21, 2020 8:35 pm
Star Dad wrote: Tue Jan 21, 2020 6:15 pm
SkyHiker wrote: Tue Jan 21, 2020 3:22 am I recommend using a small stepper motor and an Arduino. With digital control you can avoid having to use circularly curved screws which simplifies the mechanics. I have built three kinds one of which was dual-axis and autoguided for a 10" Dob. Look on the AF, user Camelhat.
Please take this with the humor I mean to convey. Only a true geek would say that using an Arduino , a stepper motor, and software can "avoid having to use circularly curved screws ". The screw that took all of 5 minutes to bend to its proper shape. ROFL! I LOVE it SkyHiker! :worship:
If I'm honest, i dont get what humour you are trying to convey?

I am slowly learning from this thread and looking forward to it clicking in my head.
Just to be clear - I am smiling at SkyHikers solution. I too have a tendency to take tech to it's highest form to solve a simple problem. I actually admire him for the Arduino/stepper motor solution. Only wish I had thought of it. :D I have an Arduino sitting on my desk right now - and I'm trying to come up with a problem in need of an arduino solution.

And SkyHiker is right - I have two gears - one on the motor and one that rotates around a brass threaded rod four times slower than the motor. I was surprised that there were no glitches because of the bending of the rod - ie the gears rotated smoothly despite the threads being compressed on one side and expanded on the other. As the gears rotate the threaded rod slowly pushes open the hinge.

Re: Barn door tracker?

Posted: Sun Jan 26, 2020 8:06 pm
by maceemiller
So, got some materials ready to start building but a little confused as to what motor to buy. Any recommendations on a cheap motor to work with the drive bolt?

Re: Barn door tracker?

Posted: Mon Jan 27, 2020 6:14 pm
by maceemiller
Hi all. So while I'm waiting to see what motor I should use I've been getting on with my trap :)

I've NO skills when it comes to woodwork (I'm a landscaper/bricklayer.....i prefer dirt and cement) yet I'm happy where I'm at in this build....

Re: Barn door tracker?

Posted: Mon Jan 27, 2020 7:24 pm
by maceemiller
One tip that was told to me today was, after the rod is bent, run a nut up and down the thread a few times.....

I didnt quite understand at the time as to why yet I get it now.....

When the rod is bent it slightly compresses the threads on the inside curve and stretches the threads on the outside curve. Running a nut up and down a few times "realigns" the threads making the movement smoother.

I did this and found about 10 threads binded a little halfway on the rod....now its smooth as silk which, hopefully will make the gear turn without any resistance :)

Re: Barn door tracker?

Posted: Tue Jan 28, 2020 11:13 pm
by vpres
maceemiller wrote: Mon Jan 27, 2020 6:14 pm Hi all. So while I'm waiting to see what motor I should use I've been getting on with my trap :)

I've NO skills when it comes to woodwork (I'm a landscaper/bricklayer.....i prefer dirt and cement) yet I'm happy where I'm at in this build....
I am working on this build and another similar to it which can be found at https://www.thingiverse.com/thing:2377686

I have all the pieces made and/or purchased and am now ready to assemble.

But, I Have hit a snag. The person who posted this build gives the following code for the arduino nano.

Arduino code.

#include<AccelStepper.h>
#define HALFSTEP 8
#define motorPin1 3 // IN1 on the ULN2003 driver 1
#define motorPin2 4 // IN2 on the ULN2003 driver 1
#define motorPin3 5 // IN3 on the ULN2003 driver 1
#define motorPin4 6 // IN4 on the ULN2003 driver 1

AccelStepper stepper1(HALFSTEP, motorPin1, motorPin3, motorPin2, motorPin4);

int buttonmode = 2;
boolean Motortoggle = 0;
const int SwitchPin = 12; // the number of the pushbutton pin
const int ledPin = 13; // the number of the LED pin
// variables will change:
int Switchstate = 0; // variable for reading the pushbutton status

void setup() {
Serial.begin(9600);

stepper1.setMaxSpeed(261.41);
stepper1.setAcceleration(50.0);
stepper1.setSpeed(261.41);
//stepper1.moveTo(20000);
// initialize the LED pin as an output:
pinMode(SwitchPin, INPUT_PULLUP);
pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input:
digitalWrite(SwitchPin, HIGH);
}

void loop() {
// read the state of the switch value:
Switchstate = digitalRead(SwitchPin);
if (Switchstate == LOW) {
stepper1.runSpeed();
digitalWrite(ledPin, HIGH);
} else {
stepper1.stop();
digitalWrite(ledPin, LOW);
}
}

Unfortunately, I do not know how to load the code onto the nano. I have installed marlin code onto an arduino board before, but can't figure this out at all!!

Hope somebody can help me.

Re: Barn door tracker?

Posted: Wed Jan 29, 2020 5:46 am
by ARock
Follow the instructions here

https://www.arduino.cc/en/Guide/ArduinoNano

I use the Arduino Desktop IDE, this means downloading and installing it. The link for it is in the page above.
Try the blink example as described above, before you try your own code file. The page includes instructions on what to do if your nano is old and needs an old bootloader.

Re: Barn door tracker?

Posted: Fri Jan 31, 2020 1:23 pm
by vpres
When I paste the above code into the arduino IDE window and upload it, I get the following messages:

Sketch uses 6696 bytes (21%) of program storage space. Maximum is 30720 bytes.
Global variables use 278 bytes (13%) of dynamic memory, leaving 1770 bytes for local variables. Maximum is 2048 bytes.
Invalid library found in C:\Users\Vern\Documents\Arduino\libraries\sketch_jan27a: no headers files (.h) found in C:\Users\Vern\Documents\Arduino\libraries\sketch_jan27a
Invalid library found in C:\Users\Vern\Documents\Arduino\libraries\sketch_jan27a: no headers files (.h) found in C:\Users\Vern\Documents\Arduino\libraries\sketch_jan27a


Can sombody please tell me what this means and how to correct the problem?

Thanks.

Re: Barn door tracker?

Posted: Sat Feb 01, 2020 5:05 am
by ARock
Most likely you need the AccelStepper library which is not included by default. So you need to install it.
Try Tools->Manage Libraries, search for AccelStepper click on the item and install it.
If you have any problems try the AccelStepper website
http://www.airspayce.com/mikem/arduino/AccelStepper/
They have a google group to ask questions linked on that page.

Re: Barn door tracker?

Posted: Sat Feb 01, 2020 2:38 pm
by maceemiller
Hi all.

So, continuing with my DIY barn door I've stripped down an old printer I had. Seems i have 2 motors, a load of cogs (gears) and a belt....

....this will take some time to figure out but slowly I'm getting there....

Re: Barn door tracker?

Posted: Sat Feb 01, 2020 6:06 pm
by maceemiller
Sorry to double post yet is there a calculation on how gears work to either slow down or speed up? I'm guessing it depends on the motors RPM in the first place....

Re: Barn door tracker?

Posted: Sat Feb 01, 2020 6:15 pm
by vpres
ARock wrote: Sat Feb 01, 2020 5:05 am Most likely you need the AccelStepper library which is not included by default. So you need to install it.
Try Tools->Manage Libraries, search for AccelStepper click on the item and install it.
If you have any problems try the AccelStepper website
http://www.airspayce.com/mikem/arduino/AccelStepper/
They have a google group to ask questions linked on that page.
The AccelStepper library is installed

Re: Barn door tracker?

Posted: Sat Feb 01, 2020 8:34 pm
by vpres
I have found the problem. I was burning a file called star_tracker, but kept getting a message bout missing headers in a file called sketch_jan27a. There was an error in that file so I copied and pasted the correct code there and copiled again.

Thanks to everyone for the help.

Re: Barn door tracker?

Posted: Sat Feb 01, 2020 9:11 pm
by maceemiller
vpres wrote: Sat Feb 01, 2020 8:34 pm I have found the problem. I was burning a file called star_tracker, but kept getting a message bout missing headers in a file called sketch_jan27a. There was an error in that file so I copied and pasted the correct code there and copiled again.

Thanks to everyone for the help.
I'm sorry but I have no idea what you mean

Re: Barn door tracker?

Posted: Tue Feb 04, 2020 9:16 pm
by maceemiller
Hi all.

So, I've just bought a motor speed controller unit and it works perfectly to control the stepper motor i salvaged out of an old HP printer....

Now this is a dumb question and one I believe I know the answer to but I have to ask.....

....whilst running the unit via the 9v battery, every now and again the motor slowed, ever so slightly then sped back up.

I know it's a tiny battery and I know it's not brand new....I wouldn't use a battery like this anyway for powering my trap yet am I better using a 9v plugged in power supply to receive a more constant voltage?

Re: Barn door tracker?

Posted: Wed Feb 05, 2020 9:33 pm
by Star Dad
I would say yes to that. I actually used a plug on the wires to the electronic case so that I could switch from battery to ac/DC converter. That way I can have both.