Jump to content

  •  

CNers have asked about a donation box for Cloudy Nights over the years, so here you go. Donation is not required by any means, so please enjoy your stay.

Photo

OnStep on arduino based 3d printer board?

This topic has been archived. This means that you cannot reply to this topic.
22 replies to this topic

#1 gma

gma

    Vostok 1

  • -----
  • topic starter
  • Posts: 150
  • Joined: 12 Dec 2016

Posted 01 July 2017 - 11:49 AM

Has anyone loaded up OnStep on one of the Adruino based 3d printer motherbords? Like this one?

https://smile.amazon...trol board 2560

 

These are attractive as they already include several of the requirements for mount control:

1 - An Arduino 2560
2 - 6 stepper motor controllers

3 - USB interface

4 - several inputs (for temp sensors and limit switches)

 

Plus - 

5 - cheap LCD panels are available and plug straight into the board.

 

These can be had for less than $20 (!!!) if you order direct from China.

 

The firmware (one being Marlin) on these boards is updated via the Arduino IDE. It looks like it might be possible with minimal dev work (mostly mapping pins?) to use these off-the-shelf with OnStep. With 6 stepper drivers, you could double up motors on the axis, and still have two drivers left for focus and filter wheel. Inputs for encoders might get tricky though.

 

Just wondering if anyone has given this a try.

 

 



#2 Pinbout

Pinbout

    ISS

  • *****
  • Posts: 26,796
  • Joined: 22 Feb 2010

Posted 01 July 2017 - 02:49 PM

RAC tried many combos of motors / drivers to get the right combo for good tracking to take pics. So the installed drivers may not be that great. But if you do try it ...for $20, let us know



#3 Biff

Biff

    Mercury-Atlas

  • *****
  • Posts: 2,707
  • Joined: 04 Sep 2005

Posted 01 July 2017 - 05:21 PM

You can get a mega2560 + drivers for under $20 on the "bay" too and using that is a well documented build. Not sure there is anything to gain trying to use the board you mentioned. Actually it could possibly require much more time investment to map everything out and it looks like you would lose the ability to add bluetooth as well. I just built an onstep setup (it's just pieced together on the bench) but it went together fairly easily.  



#4 RAC

RAC

    Viking 1

  • -----
  • Posts: 759
  • Joined: 30 Sep 2011

Posted 01 July 2017 - 05:45 PM

I would highly recommend using a Teensy 3.2 and the TMC2100 drivers. These drivers run stepper motors like servos, they are so smooth. I haven't changed anything on my scope drive system after finding this combo worked so well.

 

Stepper motor vibrations are the devil. The TMC2100 drivers are amazing!

Jupiter.jpg



#5 ccs_hello

ccs_hello

    Voyager 1

  • *****
  • Posts: 10,739
  • Joined: 03 Jul 2004

Posted 01 July 2017 - 07:23 PM

(Set aside the merit of different DIY stepper drive designs for astro tracking/GOTO mounts, long story...)

 

OnStep is using Arduino Mega2560 r3 board + stepper motor drivers.  Former can be obtained from fleabay for $8.40 shipped. 

 

The link in post #1 is a CNC controller board -- motor drivers not included.  Indeed some versions can be obtained for $20ish shipped.

However, please bear in mind, it comes with its own firmware, supporting G-code decoding etc., not suitable for astro use

and is not the way OnStep using ATmega2560 board.

 

Clear Skies!

 

ccs_hello



#6 TonyStar

TonyStar

    Viking 1

  • *****
  • Posts: 753
  • Joined: 25 May 2013

Posted 01 July 2017 - 08:52 PM

I have also used Teensy 3.2 and TMC2100 for my Onstep hardware config (following RAC and Howard Dutton's recommendations) and they work really well. I find that is really the stealthChop mode making the difference. So smooth I also use the same driver in my arduino focuser.

I doubt the A4982 drivers on the board you mention are as smooth as the TMC2100.

Also, if you want to achieve high goto speeds (>3 deg/sec) you need the Teensy and steppers with very low inductance.



#7 RAC

RAC

    Viking 1

  • -----
  • Posts: 759
  • Joined: 30 Sep 2011

Posted 01 July 2017 - 11:49 PM

BTW I'm running my TMC2100/stepper motors at 45 volts.



#8 gma

gma

    Vostok 1

  • -----
  • topic starter
  • Posts: 150
  • Joined: 12 Dec 2016

Posted 02 July 2017 - 02:51 AM

(Set aside the merit of different DIY stepper drive designs for astro tracking/GOTO mounts, long story...)

 

OnStep is using Arduino Mega2560 r3 board + stepper motor drivers.  Former can be obtained from fleabay for $8.40 shipped. 

 

The link in post #1 is a CNC controller board -- motor drivers not included.  Indeed some versions can be obtained for $20ish shipped.

However, please bear in mind, it comes with its own firmware, supporting G-code decoding etc., not suitable for astro use

and is not the way OnStep using ATmega2560 board.

 

Clear Skies!

 

ccs_hello

Yes, it is a CNC controller board - consisting of an Mega2560 with stepper motor drivers on the same board. The "firmware" is just assembled code uploaded to the Arduino - no different than OnStep. It just happens to be pre-assembled on a single board with connectors, etc. (and that is the entire appeal). I don't see what makes this not suitable for astro use. 



#9 ccs_hello

ccs_hello

    Voyager 1

  • *****
  • Posts: 10,739
  • Joined: 03 Jul 2004

Posted 02 July 2017 - 05:48 AM

One correction, post #1's link (the $54 one from AMZ) CNC controller board does come with motor drivers.

(The $20 one does not.)

 

Note that Arduino has these characteristics:

- the main microcontroller comes with pre-loaded Arduino bootloader such that after the uC boot-up, it immediately gets into the Arduino executive environment (run-time Arduino environment)

- fixed and common pin out for Arduino family of peripherals

- has the necessary support circuitry (mainly USB-serial with DTR "reset" toggle) to interface with PC's Arduino IDE (Arduino user program download, serial console for debugging or serial I/O)

 

(BTW Onstep runs under Arduino framework, that's why in its github, there are few .ino files in its codebase.)

 

That CNC controller (and many other CNC USB controllers) does not.  The microcontroller runs its own realtime executive, and at the same time

takes in G-code CNC instructions.  It is not Arduino.

 

The only common place in both cases is: they use the same hardware part: microcontroller: ATmega2560.  The $3 IC.

 

Of course, one can

(1) use specialized programmer to reprogram the CNC controler's ATmega2560 (thru ICSP, the SPI interface) to be running Arduino bootloader

(2) cut few PCB traces (verify if there isn't any hardware pin assignment conflict in between Arduino Mega 2560's and CNC Controller's.)

     E.g., CNCUSB's ATmega2560 direct-communicates with the USB port, while Arduino always goes thru a separate USB-serial circuitry

and

(3) add a new USB-serial circuitry as PC Arduino IDE's interface with the core Arduino microcontroller (in this case, ATmega2560) .

 

Clear Skies!

 

ccs_hello



#10 TonyStar

TonyStar

    Viking 1

  • *****
  • Posts: 753
  • Joined: 25 May 2013

Posted 02 July 2017 - 09:53 AM

I run my setup at 12V off a cheap (and light) 10000 mAh Li-Ion battery. It lasts about 7 hours. I could easily double that with a better battery. My scope is a 13.1" ultralite travelscope so I mind keeping the weight and power consumption as low as possible.  



#11 gma

gma

    Vostok 1

  • -----
  • topic starter
  • Posts: 150
  • Joined: 12 Dec 2016

Posted 02 July 2017 - 11:40 AM

Marlin firmware that runs on this board can be found here: https://github.com/M...Firmware/Marlin. It's Arduino based. Replace the code (which is easily done via the Arduino IDE - BTDT), and gcode is out of the picture.

 

I think I will pick one up and play around with it. My only problem is I haven't built or used an OnStep mount, so my inexperience will make it difficult to gauge performance and identify the source of trouble or poor performance - is it my newbie made mount, motors, code, the controller board itself, or a characteristic of OnStep? It may be hard to tell.



#12 Biff

Biff

    Mercury-Atlas

  • *****
  • Posts: 2,707
  • Joined: 04 Sep 2005

Posted 02 July 2017 - 02:01 PM

I would highly recommend using a Teensy 3.2 and the TMC2100 drivers. These drivers run stepper motors like servos, they are so smooth. I haven't changed anything on my scope drive system after finding this combo worked so well.

 

Stepper motor vibrations are the devil. The TMC2100 drivers are amazing!

attachicon.gifJupiter.jpg

Any reason you say the Teensy 3.2 > mega2560 ? I used the 2560 because I had a couple spares in my 3d printer parts bin but seems to work just fine with the bluetooth interface.

 

I'm thinking about trying the TMC2100's. What microstepping are you using. Running at the 1/256 rate would severely limit slew rate says the onstep excel spreadsheet. Oddly the A4988's I have running 1/16 microsteps are a LOT smoother than the DRV8825's I've tried. The DRV8825's really cog the motor to the fullsteps whether running 1/16 or 1/32. The motors are also more powerful and at the same time generate less heat with the A4988's. FWIW I did confirm same current with an ammeter and I'mm running at 18V.



#13 TonyStar

TonyStar

    Viking 1

  • *****
  • Posts: 753
  • Joined: 25 May 2013

Posted 02 July 2017 - 02:35 PM

You run the TMC2100 at 16 m-step not 256. You should use that number in the excel spreadsheet. The Teensy has a faster clock rate compared to the Atmega.


Edited by TonyStar, 02 July 2017 - 03:11 PM.


#14 hjd1964

hjd1964

    Ranger 4

  • *****
  • Posts: 375
  • Joined: 24 May 2012

Posted 02 July 2017 - 09:12 PM

The Teensy3.2 is just all around better.  Not only clock speed(72/96 MHz) but 32bit, interrupt priority levels, fifo serial, 32 bit timers, pins are 3.3V logic with 5V tolerance. The Teensy3.2 also has a crystal oscillator for accurate tracking and the Mega2560 doesn't (needs PPS GPS or RTC for most accurate tracking.)  The Teensy3.2 can power a ESP8266 WiFi (3.3V reg.) the Mega2560 can't.  The Teensy3.2 is smaller which can help when integrating the controller into some mounts.  I don't mean to imply there is a major improvement in performance over the Mega2560 OnStep, just a little smoother operating, more flexible, and a bit less hassle to implement.  The Mega2560 can get the job done and costs less (and/or is easier to obtain) which is a big deal for some users.  Finally, some OnStep users have started testing on the Teensy3.5 which adds more speed (120MHz,) hardware floating point, more flash, more EEPROM, more pins, etc.

 

As for stepper drivers, I have a drawer full of retired DRV8825's and A4988's (and a pair of THB7128's.)  All were replaced by SSS TMC2100's and TMC2130's, performance wise there is no contest.  In my experience the only advantage of a DRV8825 or A4988 is lower cost.  So for some they are desirable for this reason and those folks might have to settle for a bit more noise and/or hassle (hacking the DRV8825 for decay mode control for example) but the result can be very good if all goes well.  The chances of getting an excellent result (noise/tracking/slew speed/power use) with SSS TMC2100's is better in my experience though.

 

Notes:

The TMC2130 (similar to the TMC2100 with additional features and SPI configuration) is supported by Teensy3.2 OnStep's only (no testing done on the Mega2560.)

Since the TMC2100 doesn't like to micro-step mode switch on the fly (tri-state mode control design) some drives will require  step speeds that exceed the limits of a Mega2560, the Teensy3.2 can help with this.


Edited by hjd1964, 02 July 2017 - 09:16 PM.


#15 gma

gma

    Vostok 1

  • -----
  • topic starter
  • Posts: 150
  • Joined: 12 Dec 2016

Posted 06 July 2017 - 03:22 PM

It looks like the RAMPS 1.4 design (which these are based) has three sets of pins for "AUX" use, as well as four dedicated for servo control (I'm using servos for focusing now, so this is a plus for me)

 

So bluetooth and possibly wifi may not be off the table with these boards

 

https://www.thingive...om/thing:138279

 

Hmmm. Ordered a board and TMC2100 drivers today - will let you know how it goes. Might prove a good solution for people that want an off-the-shelf OnStep solution.



#16 gma

gma

    Vostok 1

  • -----
  • topic starter
  • Posts: 150
  • Joined: 12 Dec 2016

Posted 06 July 2017 - 03:24 PM

RAMPS 1.4 with TMC2130 control
http://hackaday.com/...ting-the-gears/



#17 kbahey

kbahey

    Lift Off

  • -----
  • Posts: 14
  • Joined: 25 Jan 2017

Posted 06 December 2017 - 04:18 PM

There is new information on OnStep and RAMPS 1.4.

 

Howard Dutton, the author of OnStep, announced that he will working on the RAMPS1.4/ArduinoMega2560 as the basis for a variant of OnStep.

 

This would be a lower cost solution with less components to order and solder.

 

Very useful for those who want to save time and effort.

 

Why did Howard change his mind, specially when his comment about praises the Teensy over the Arduino Mega2560?

 

Because things have changed:

 

  • OnStep used to have 2 steppers, but now (with OnStep Max), it supports up to 4 (RA/Alt, Dec/Az, Focuser, Focuser/Rotator). The RAMPS1.4 has room for 5 stepper motors.
  • With TMC2100 and TMC2208, the limitation of DRV8825 puts on slew speed is no longer there.

 

That leaves the lack of a crystal oscillator. For the RAMPS solution, an RTC is needed. There is the RTC DS3231 module available on eBay for $2 or so, some with pins on them.

 

Hopefully, this would be a simple JST cable to connect to the Mega, or worse case, soldering the module would not be too daunting.


Edited by kbahey, 06 December 2017 - 05:38 PM.


#18 kbahey

kbahey

    Lift Off

  • -----
  • Posts: 14
  • Joined: 25 Jan 2017

Posted 08 December 2017 - 02:38 PM

Support for RAMPS1.4 boards has landed in the Alpha branch on github.

 

You can see the code here

 

Here is how to build it:

 

- Clone the repository from github

git clone https://github.com/hjd1964/OnStep.git 

- Switch to the Alpha branch

git branch Arduino-Mega2560-Teensy3.1-Alpha 

- Edit the file: Config.Mega2560Alt.h

 

Change the line:

#define Mega2560Alt_OFF 

To:

#define Mega2560Alt_ON

- Edit the file Config.Ramps14.h

 

Change the line:

#define Ramps14_OFF 

To:

#define Ramps14_ON

- From the Arduino IDE choose Tools -> Board -> Ardiuno/Genuino Mega or Mega 2560

 

- Load the Onstep.ino sketch

 

- Click on Verify in the IDE

 

That is it. Please join the mailing list at https://groups.io/g/onstep, and report your findings back to Howard.


Edited by kbahey, 08 December 2017 - 02:55 PM.


#19 telfish

telfish

    Mercury-Atlas

  • *****
  • Posts: 2,649
  • Joined: 17 Nov 2010

Posted 04 January 2018 - 04:39 PM

Started putting this together, am using exact same board as in the Onstep WIKI and a genuine 2560 Arduino. Have loaded the sketch after enabling the 2560 and Ramps options . Not sure if that is correct. Left everything else as is for now.

 

Added two 8255 drivers to the X and Y axis and connected two steppers to the headers. Connected 12 volts to one of the green connections on the left hand side. Connected the ramps board to the Arduino, no other pins connected as I thought plugging it together would make all connections apart from the steppers and things like LED's.

 

Powered everything up and launched SGP set options in ASCOM to com port and entered all the fields.

 

Pressed connect and it connects and shows a Ra and DEC in the control panel. So far so good.

 

However when I ask the test bench steppers to slew I get no response. Is there anything I have done wrong so far or missed?

 

Regards Terry.

 

Tried posting to the Onstep.io board but even though I am signed in I have no ability to post or respond to others posts.


Edited by telfish, 04 January 2018 - 04:48 PM.


#20 gregj888

gregj888

    Gemini

  • -----
  • Posts: 3,002
  • Joined: 26 Mar 2006

Posted 04 January 2018 - 10:31 PM

Terry,

 

Did you unpark the mount?  

 

Download Howard's "Sky Planaterium" and use it to get things going.  Out of the box, you need to unpark the mount and turn on tracking. 

 

There is an Ifdef you can set to negat this, but I don't remember what it is.  I posted it either on this forum or the Onstep Yahoo group, but haven't set it on mine either.

 

Greg



#21 telfish

telfish

    Mercury-Atlas

  • *****
  • Posts: 2,649
  • Joined: 17 Nov 2010

Posted 05 January 2018 - 07:17 AM

Thanks Greg will give that a go. Many thanks.



#22 gregj888

gregj888

    Gemini

  • -----
  • Posts: 3,002
  • Joined: 26 Mar 2006

Posted 05 January 2018 - 11:17 PM

Try adding the line below at the top of config.h

 

#define AUTOSTART_TRACKING_ON

 

Depending on the version (3.1 beta ?) , it may get you going on startup.



#23 telfish

telfish

    Mercury-Atlas

  • *****
  • Posts: 2,649
  • Joined: 17 Nov 2010

Posted 06 January 2018 - 09:54 AM

Turns out for the ramps board you only need the ramps define on and the 2560 off. Apparently you can only have one on and having the 2560 on was causing the issue.




CNers have asked about a donation box for Cloudy Nights over the years, so here you go. Donation is not required by any means, so please enjoy your stay.


Recent Topics






Cloudy Nights LLC
Cloudy Nights Sponsor: Astronomics