Welcome, Guest. Please login or register.

Username: Password:

Author Topic: AstroEQ running on MKS GEN L (RAMPS 1.4) board  (Read 464 times)

galilei

  • Newbie
  • *
  • Posts: 4
    • View Profile
AstroEQ running on MKS GEN L (RAMPS 1.4) board
« on: August 04, 2018, 22:10:08 »

it should be possible to run AstroEQ on a MKS GEN L board, basically a Mega2650 with an integrated stepper motor driver (5x), designed for DIY 3D printers. The boards are cheaply available on eBay together with DRV8825 stepsticks or other types. They have a good quartz oscilator and various other hardware addons usable for a telescope. Imho a very good basis for a telescope controller without any soldering. The pinout used by AstroEQ must be changed to make this work. Would that be possible?

 
Logged

TCWORLD

  • Administrator
  • *****
  • Posts: 666
    • View Profile
    • AstroEQ
Re: AstroEQ running on MKS GEN L (RAMPS 1.4) board
« Reply #1 on: August 04, 2018, 22:57:00 »

It might be possible, though I can't seem to find any details on the board - e.g. pin-outs of the drivers.
Logged
Tom Carpenter (AstroEQ)

galilei

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: AstroEQ running on MKS GEN L (RAMPS 1.4) board
« Reply #2 on: August 05, 2018, 15:18:59 »

Thomas,

the datasheet for the MKS Gen L is here: https://github.com/makerbase-mks/Datasheet/blob/master/English%20datasheet/MKS%20Gen_L%20DataSheet.pdf

this is the pinmap used by another TC project:

// Pins to Axis1 RA/Azm on RAMPS X
#define Axis1DirPin   55    // Pin A1 (Dir)
#define Axis1DirBit    1    //
#define Axis1DirPORT  PORTF //
#define Axis1StepPin  54    // Pin A0 (Step)
#define Axis1StepBit   0    //
#define Axis1StepPORT PORTF //
#define Axis1_HOME    20    // Pin 20 (Home sw)
#define Axis1_Aux     Aux1  // Pin 29 (ESP8266 GPIO0 or SPI MISO)
#define Axis1_M2      27    // Pin 27 (Microstep Mode 2 or SPI CS)
#define Axis1_M1      25    // Pin 25 (Microstep Mode 1 or SPI SCK)
#define Axis1_M0      23    // Pin 23 (Microstep Mode 0 or SPI MOSI)
#define Axis1_EN      38    // Pin 38 (Enable)

// Pins to Axis2 Dec/Alt on RAMPS Y
#define Axis2DirPin   61    // Pin A7 (Dir)
#define Axis2DirBit    7    //
#define Axis2DirPORT  PORTF //
#define Axis2StepPin  60    // Pin A6 (Step)
#define Axis2StepBit   6    //
#define Axis2StepPORT PORTF //
#define Axis2_HOME    21    // Pin 21 (Home sw)
#define Axis2_Aux     Aux2  // Pin 37 (ESP8266 RST or SPI MISO)
#define Axis2_M2      35    // Pin 35 (Microstep Mode 2 or SPI CS)
#define Axis2_M1      33    // Pin 33 (Microstep Mode 1 or SPI SCK)
#define Axis2_M0      31    // Pin 31 (Microstep Mode 0 or SPI MOSI)
#define Axis2_EN 56 // Pin A2 (Enable)

I can help betatest this if you are doing the change.

Markus
Logged

TCWORLD

  • Administrator
  • *****
  • Posts: 666
    • View Profile
    • AstroEQ
Re: AstroEQ running on MKS GEN L (RAMPS 1.4) board
« Reply #3 on: August 05, 2018, 16:57:54 »

Thanks. I'd found that datasheet, but nowhere in it does it actually contain pin-outs for the motors.

Logged
Tom Carpenter (AstroEQ)

TCWORLD

  • Administrator
  • *****
  • Posts: 666
    • View Profile
    • AstroEQ
Re: AstroEQ running on MKS GEN L (RAMPS 1.4) board
« Reply #4 on: August 06, 2018, 19:16:18 »

Do you know the pinout for the other motor drivers (there are four ports)?

For various reasons, digital pins 30 through 37 of the Arduino Mega can't be used with the AstroEQ firmware.
Logged
Tom Carpenter (AstroEQ)

galilei

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: AstroEQ running on MKS GEN L (RAMPS 1.4) board
« Reply #5 on: August 07, 2018, 15:31:11 »

Thomas,

// For rotator stepper driver on RAMPS Z
#define Axis3DirPin   48    // Pin 48 (Dir)
#define Axis3StepPin  46    // Pin 46 (Step)
#define Axis3_EN      Aux3  // Pin A8 (Enable)

// For focuser1 stepper driver on RAMPS E0
#define Axis4DirPin   28    // Pin 28 (Dir)
#define Axis4StepPin  26    // Pin 26 (Step)
#define Axis4_EN      Aux4  // Pin 24 (Enable)

// For focuser2 stepper driver on RAMPS E1
#define Axis5DirPin   34    // Pin 34 (Dir)
#define Axis5StepPin  36    // Pin 36 (Step)
#define Axis5_EN Aux5 // Pin 30 (Enable)

Any hope of making this work?
Logged

TCWORLD

  • Administrator
  • *****
  • Posts: 666
    • View Profile
    • AstroEQ
Re: AstroEQ running on MKS GEN L (RAMPS 1.4) board
« Reply #6 on: August 07, 2018, 19:46:24 »

Ignore me. That restriction was removed with the V8.x firmware. I made some changed that stopped it causing a problem.

I don't see why it shouldn't be possible to get going.

However, I am completely unimpressed by the lack of even a basic pin map or proper documentation for this thing.
« Last Edit: August 07, 2018, 20:36:05 by TCWORLD »
Logged
Tom Carpenter (AstroEQ)

galilei

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: AstroEQ running on MKS GEN L (RAMPS 1.4) board
« Reply #7 on: August 07, 2018, 23:23:36 »

Logged

pterodyne

  • Sr. Member
  • ****
  • Posts: 90
    • View Profile
Re: AstroEQ running on MKS GEN L (RAMPS 1.4) board
« Reply #8 on: October 04, 2018, 03:20:20 »

Id love to see a build of this that doesn't require me to compile the firmware separately :)    I have a MKS Gen L with Onstep On it.. I would be great to be able to switch back and forth.
Logged

TCWORLD

  • Administrator
  • *****
  • Posts: 666
    • View Profile
    • AstroEQ
Re: AstroEQ running on MKS GEN L (RAMPS 1.4) board
« Reply #9 on: October 06, 2018, 00:03:08 »

I've compiled a test firmware for the RAMPS 1.4 board. If you could download the attached files and copy them into the hex/ folder of the config utility. Then run the utility which should give you a new board in the firmware dropdown - "AstroEQ Ramps 1.4 w/ Mega 2560".

The pin mapping used is as follows:

Code: [Select]
//GPIO Pins:
//VCC (Header Pin 5)
#define gpioPin_0_Define 49  //IO0 - GPIO Pin
#define gpioPin_1_Define 33  //IO1 - GPIO Pin
#define gpioPin_2_Define 41  //IO2 - GPIO Pin
//GND (Header Pin 1)

//PWM Pins:
#define pwmPin_Define 9

//Status Pins:
#define statusPin_Define 13

//Motor Driver Pins:
#define resetPin_0_Define 35 //Unused on RAMPS
#define resetPin_1_Define 37 //Unused on RAMPS

#define dirPin_0_Define 55
#define dirPin_1_Define 61

#define enablePin_0_Define 38
#define enablePin_1_Define 56

#define stepPin_0_Define 54
#define stepPin_1_Define 60

#define modePins0_0_Define 25
#define modePins1_0_Define 27
#define modePins2_0_Define 29
#define modePins0_1_Define 16
#define modePins1_1_Define 17
#define modePins2_1_Define 23

//ST4 Pins:
#define ST4AddPin_0_Define 50
#define ST4AddPin_1_Define 51
#define ST4SubPin_0_Define 53
#define ST4SubPin_1_Define 52

The ST4 pins including that used for the hand-controller are present on the lower 10-pin IDC header on the right hand side of the board. You will need to add a 1k resistor between D49 and D41 which are both on the 10-pin header.

The top 10-pin IDC header is used to output the microstep mode pins. If you add cables from the correct pins on this IDC header to the mode select pins underneath the motor drivers, you should get full functionality. If not you will have to disable gear changing in the config utility, and manually set the jumpers to the correct step mode.

Let me know how it goes or if you need more info.

Logged
Tom Carpenter (AstroEQ)

pterodyne

  • Sr. Member
  • ****
  • Posts: 90
    • View Profile
Re: AstroEQ running on MKS GEN L (RAMPS 1.4) board
« Reply #10 on: October 06, 2018, 04:54:25 »

This is awesome.  Ill test it out as soon as I get a chance..

Thanks!
Logged

pterodyne

  • Sr. Member
  • ****
  • Posts: 90
    • View Profile
Re: AstroEQ running on MKS GEN L (RAMPS 1.4) board
« Reply #11 on: October 06, 2018, 18:16:09 »

I can confirm that this works.  Im using it on the harmonic drive mount from other posts.  Currently using ramps 1.4 MKS Gen L with TMC2130 drivers (configured not in SPI mode).

Really much thanks. 

As a side note, my board for whatever reason needs to have the reset button pressed at the exact moment.  The technique I used is hold the reset button down, release and hit the "done" button in the config utility at the same time.  Anyone seen this?  Mine is a "biqu" no name brand from amazon with CH340 usb chipset. Ive read about it on other forums, but it's hard to say because most of the references are to Mega 2560 clones, not RAMPS all in one boards.
Logged

pterodyne

  • Sr. Member
  • ****
  • Posts: 90
    • View Profile
Re: AstroEQ running on MKS GEN L (RAMPS 1.4) board
« Reply #12 on: October 06, 2018, 18:42:28 »

Ugh.. well that was short lived.  It was slewing around great.  I parked it because I had an axis reversed.  Closed out of eqmod, loaded the config utility, and it no longer saw the com port.  So I unplugged and re plugged a few times, still no com port.  And a windows message that the USB device was not recognized.  Then on 2 other computers, the same.  I guess don't buy cheap clone boards.  Not even sure who made the original.

Logged