Arduino code, (or library) to drive a NEMA 17 Stepper for AZ drive

62 views
Skip to first unread message

Lawrence E. Mayfield

unread,
Jun 12, 2023, 11:58:04 AM6/12/23
to Society of Amateur Radio Astronomers
Please excuse the length of the text below.... I write like I speak, lol...

Remember when I was trying to drive the AZ system with a linear actuator driving a slider crank mechanism for AZ? Well, my actuator was fubar an and I decided a more traditional system of worm gear and elec. motor would be quicker. I have a stepper driver TB6600 with 32 step microstepping I want to use as well although that may be to fine for this use as it takes time to do all those steps.  I am currently at 1/8 which gives me 1600 steps per revolution of the stepper motor. My optical encoder has 600 pulses in quadrature (x4)  and a gear step up ratio of 15:1 gives me 36000 counts per revolution of the worm gear out put.  should give me some arc seconds of resolution. If any of this makes any sense, lol.  

I have my new in-progress of fab, telescope, with  NEMA 17 stepper motor in hand as well as another stepper test unit to fiddle with. The AZ drive version has a 51:1 reduction planetary gear box which will feed a worm gear box with 100:1 reduction connected the AZ drive system. I think I have the stepper motor rpm figured to 3.54 rpm for tracking at my location.  I want to test the stepper for speed, rotation, and emergency stopping, via limit switches for safety aspects.    I have been, for the last few days fiddling with the Arduino code  to get this done. I have found several published codes, but, when I put in the parameters to get it done with simple things like rotate in CCW and CW directions, slow speed and fast speeds and  a go to location via number of pulse steps, I cannot get get it to work, lol, it will not verify.  I have the Arduino web site  reference s location book marked. Oh, I am using a Arduino MEGA 2560 board which also has an integrated ESP 8266 wifi capability for data transfer ot base station computer.   My problem is that when I try the code as downloaded and put it into the Arduino IDE, version 2.1.0, it will not pass the code verification operation. And yet when it look on the Arduino code references the statements, etc. all fit, the code and vice versa.  In fact, the code I have right now does not use a library either.

So, what I am seeking is one or more of you folks who has an Arduino  code that works with your setup to send it to me for my efforts of just trying to get the system to accept my efforts. So that I can move on to the part where I try to read the rotary encoder for angle traversed during that test. 

Please note that I do not want or need the signal processing part of anybody's code, just an  AZ drive system motor control. In fact if you have a library stepper code that works just the location where I can download it would be great as well. 

 Thanks in advance to any and all who can provide library web location assistance or  for any code itself

larry (now 81.45 years old and getting to 82 at warp speed, lol)
Pahrump, NV

Jim Hannon

unread,
Jun 12, 2023, 1:20:53 PM6/12/23
to sara...@googlegroups.com

I am currently working on some Arduino code to run the stepper motor for a optical telescope focuser. I use the Arduino accelstepper library to drive to motor. I have it working except for a few minor bugs.

Not verifying means the compiler is unhappy with something in the code. It should be possible to find the problem by looking at  the error messages at the bottom of the window. I could have a look if you can send me the error messages.

Jim Hannon

--
--
You received this message because you are subscribed to the Google
Groups "Society of Amateur Radio Astronomers" group.
To post to this group, send email to sara...@googlegroups.com
To unsubscribe from this group, send email to
sara-list-...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/sara-list?hl=en
---
You received this message because you are subscribed to the Google Groups "Society of Amateur Radio Astronomers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sara-list+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sara-list/fcdd5a1d-fb7f-498c-9484-9dcec17aa3aan%40googlegroups.com.
-- 
WB0TXL
Web Site  http://www.ocrslc.net/
Blog  htps://jimhannon.wordpress.com/
YouTube Channel https://www.youtube.com/channel/UCz0wapCwlH6IOGE_EFk-Y4A
Lat 42.19868 Lon -91.65438

Anthony

unread,
Jun 12, 2023, 4:28:38 PM6/12/23
to sara...@googlegroups.com
This is for an optical telescope focuser? 
I'm not sure if this will help but there are many sources that sell auto-focusers and the software right out of the box, for optical telescopes; which are mainly used for astrophotography or solar photography. 

It could be easier than developing your own software and electromechanical drive, just in my opinion, but it's also fun to build your own as well. Unfortunately, I possess the skills to do so.  ;-D
Here are a few auto-focusers, some expensive, others not so expensive; depending on your focuser diameter 1.25, 2 or 3" etc. 

I own several of the PrimaluceLab auto focusers with temperature probes. 













Larry Mayfield

unread,
Jun 12, 2023, 7:45:05 PM6/12/23
to sara...@googlegroups.com

Larry, me, is not working with optics. Jim Hannon wrote an answer to my question regards Arduino code work.so he is probably the one to chat with about optical telescope focusers?

Larry, Pahrump

You received this message because you are subscribed to a topic in the Google Groups "Society of Amateur Radio Astronomers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sara-list/R_NgCRvlthY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sara-list+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sara-list/CAKU65Twd1Bf8LmH4zGaA0s0u%2BkTHamOQpj%2BD-XPdC1K9kXCjxA%40mail.gmail.com.

Anthony

unread,
Jun 12, 2023, 8:26:18 PM6/12/23
to sara...@googlegroups.com

mike....@gmail.com

unread,
Jun 12, 2023, 9:50:01 PM6/12/23
to Society of Amateur Radio Astronomers
Larry,

As I understand, you are having trouble with the Arduino IDE.  

Can you blink a LED?   Have your chosen a  blink LED demo program and actually done that.
This proves that you have chosen the correct IDE parameters for board and such.   And  it compiles and downloads to the 2560.

>>>"Arduino MEGA 2560 board which also has an integrated ESP 8266 wifi capability"
This sounds like a special board made for 3D printers.   It may take a different loading program  OR  an specific Arduino lib file.

>>>>" it will not pass the code verification operation"
Sounds like you are missing some libraries.  Check the errors and try to interpret them.  Don't be shy about typing them into Google.

I personally only use  arduino when I have to.  

 Have you looked at ONSTEP  telescope controller? 

73
Mike W9YS

Larry Mayfield

unread,
Jun 14, 2023, 3:58:06 PM6/14/23
to sara...@googlegroups.com

Problem was my botched code, lol.  Ot it fixed and it verified and compiled.   Thanks!

 

larry

Reply all
Reply to author
Forward
0 new messages