grbl for GT2560 Rev A

Hi,

I`ve tried to find a way to stay with my Workflow using Freecad for Developing and Path creation. But there are not postprocessors for Marlin in Freecad. So I decided to run grbl on my GT2560 Rev A board. The first try was with the setup from John Boiles and it looked good but the steppers didn’t moved. So I took a deeper look and can now present a commit with correct pin mappings to run grbl-Mega-5x.

The code is here it is currently only one commit and I havn’t tested the end stops as they are not wired on my machine at the moment. The grbl config you can find here.

Its late and I need some sleep.

Sören

2 Likes

Ok, there was some work missing, but i figured it out and now I have the machine up and running with the settings in the updated gist and the last commit in the following branch https://github.com/monofone/grbl-Mega-5X/tree/mpcnc-gt2560-rev-a

The wiring on the board is straight forward as follows:

Board MPCNC
X Stepper X1 Axis
Y Stepper Y1 Axis
Z Axis Z Axis
Extruder 1 X2 Axis
Extruder 2 Y2 Axis
Xmin X1 max
Xmax X2 max
Ymin Y1 max
Ymax Y2 max
Zmin Probe
Zmax Z max
Coolant and Mist are on Heat-0 and Heat-1

Homing works, the Probe responds and now only the learning for the whole software stack is missing.

Have fun.

Sören

1 Like

Great topic, I was looking for days to wire my GT2560 as cnc, thanks a lot!
Unfortunately, I burn the pwm for the spindle (hotbed). How can I change it in cpu_map.h to use coolant flood or mist pins (heat0 or heat1)?

Thanks,
this gave me the possibility to reuse my GT2560 board. I installed the software and everything runs fine but the steps/mm don’t match my setup. When I try to adapt the controller settings from 200 steps/mm to 100 steps/mm things start to go wrong. I have the impression that only one of the steppers runs at the new rate while the other still runs at 200 steps/mm.
Is there more to change that $100 and $101 ???

Hi Eric,

yes there are additional configs on $103 / $104 grbl Mega 5x has additional mappings for x2 / y2 for all settings.

So if there are settings for single axis the x2 / y2 are behind the settings for z1.

$100 => x
$101 => y
$102 => z
$103 => x’
$104 => y’

Have fun

Hi Soren, any answer for me?

Hi ksdfpr,

you just need to take a look into the cpu_maps.h there are comments about which pin is wired to which functionality. As stated above, coolant and mist are wired to to heat-0 and heat-1 so you just need to swap them out with the hotbed pin. I don’t have the Spindle connected to the board so I don’t use these wires and don’t know if they work. I even don’t know if heat-0/1 are pwm outs.

Works like a charm!!
Thanks

Hi again, Soren,

Im sure that heat-0/1 are pwm outs but I dont know how to assigned it in cpu_map file.

Hi ksdfpr,

I’m sorry, it took me hours to find out th pin mapping from marlin to GT2560 and back to grbl. And I must admit that I only have gone as far as needed to run my setup on the board.

But take a look at this:
the original pins are set here
Original Spindle Setp

And the coolant pins are set here
Coolant pins

That was what I ment with swapping the pins.

After some tries with no result I took the risk to solve the problem hardwarically! The R29 was burnt, I replaced it with R28 and now everything works fine. (M4 command not tried yet).

Silly question: can I use my old lcd2004 to this project, to have basic infos, jog and SD card support?

grbl doesn’t support lcds.

Well… not everything. When I check the PWM setting in LaserGRBL , the laser is always 100% power independent from the Sx command. Anyone knows why?

Is it possible the pin it is assigned to doesn’t support pwm?

No, it has been tested by “fading” arduino example

I guess that there is an error in pin or port assignment in laser mode. Sxxx command does not change the power of my ttl laser at all. I am using the original grbl from this topic… Does anyone is using GT2560 in laser mode to confirm this?

@johnboiles, Do you have any advice for ksdfpr? I know grbl uses the microcontroller notation for pins, and I’m not sure if PWM uses the same port configurations…

1 Like

I dont know if it helps but even without any movement and $32=1 the M3 or M4 lights on the laser

I haven’t poked around with PWM support in GRBL so I can’t be a ton of help I’m afraid. But I can share what I remember about using PWM on AVR chips from 10 years ago before Arduino made it easy. There are only certain pins that support hardware PWM. I don’t remember which. And there’s some extra registers you need to configure to set up the pulse timing (maybe called something like OCCR registers or something). You prob will need to do some datasheet reading.

Arduino made PWM and pin assignments super easy and we’re all spoiled now :smiley:

1 Like