Arduino Mega 2560, Grbl-Mega, Cncjs - Can't make movement

Hey Guys,

First of all thanks for taking the time to give me your thoughts;

I’ve recently acquired a CNC that we have been using at work - an MPCNC, that just isn’t getting used here and I would love the upgrade for home. When I got it, I knew he had Marlin on the Arduino and had been just using a SD card to put files in. At home I have a PC that is dedicated to the CNC I have there, and use Cncjs desktop application to send any files etc.

When I got the new CNC, I started by installing grbl-Mega on the Arduino, and I’ve now got everything wired the way it was (I did not think I would need to make any changes just changing the Marlin to grbl?). However, when I initialize everything two motors do not energize (one x-axis motor, and the z-axis motor). The other 3 motors initialize, however they are non-responsive to any movement commands that I send through cncjs.

I honestly wasn’t sure if my issue lied with the Arduino, Wiring, or the switch from Marlin to Grbl? I figured this would be the best place to get an idea of that. Prior to starting my switch over, the CNC was working just fine and making moves off of a small know/screen panel so I don’t think it’s an issue of drivers or anything like that failing.

Thanks for your time, Ian.

[attachment file=“Image from iOS (2).jpg”]

Adding a picture if there’s any other images I can provide that would be useful just let me know.

That looks like a RAMPS setup to me… maybe I’m missing something?

Attached is a GRBL picture

 

GRBL-1_x.jpg

Erwin,

You’re correct - I was assuming I could just install Grbl firmware and still use that - so with the RAMPS board it will have to be using Marlin? (I wish I could’ve been a bit more help in describing what this was assembled with but unfortunately I did not purchase everything initially)

Sorry if these are dumb questions, the last CNC I built was using a Arduino Uno and CNC Shield V3.0 and I’ve been very happy with that, so once I picked the new one up my plan was just to get everything going as my old machine was.

 

Yep. Also - can’t exactly tell by your wiring, make sure you use the correct RAMPS firmware depending on whether you’re using dual endstops or not.

No need to apologize, unless you’re “perfect” we all have similar issues when it comes to learning new things! :wink:

 

1 Like

Erwin,

Getting closer over here, hoping you can help me down the home stretch; only issue I’m having now is - I want to run my second X Stepper off of E0, and second Y off of E1.

So I’ve gotten it back to Marlin, and tested it without having the dual motors set-up - everything working just fine. So I went back and trued to make the dual steppers true;

 

#define X_DUAL_STEPPER_DRIVERS
#if ENABLED(X_DUAL_STEPPER_DRIVERS)
#define INVERT_X2_VS_X_DIR true // Set ‘true’ if X motors should rotate in opposite directions
//#define X_DUAL_ENDSTOPS
#if ENABLED(X_DUAL_ENDSTOPS)
#define X2_USE_ENDSTOP XMAX
#define X_DUAL_ENDSTOPS_ADJUSTMENT 0
#endif
#endif

#define Y_DUAL_STEPPER_DRIVERS
#if ENABLED(Y_DUAL_STEPPER_DRIVERS)
#define INVERT_Y2_VS_Y_DIR true // Set ‘true’ if Y motors should rotate in opposite directions
//#define Y_DUAL_ENDSTOPS
#if ENABLED(Y_DUAL_ENDSTOPS)
#define Y2_USE_ENDSTOP YMAX
#define Y_DUAL_ENDSTOPS_ADJUSTMENT 0
#endif
#endif

And I believe I did all of that correct, I do want it to be true as it’s a belt not leadscrew. I do not have any endstops, I don’t really think I need them - I’ve got the printed pieces to get it all square and that’s good with me. My issue is on comiling I get the following error;

 

Arduino: 1.8.9 (Windows Store 1.8.21.0) (Windows 10), Board: “Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)”

In file included from sketch\MarlinConfig.h:40:0,

from sketch\Marlin.h:35,

from sketch\stepper_dac.cpp:44:

pins.h:790:8: error: #error “No E stepper plug left for Y2!”

#error “No E stepper plug left for Y2!”

 

If there’s anything else I can provide to help please let me know. I know there’s the preconfigured file over on the github (MPCNC_Ramps_T8_16T_LCD_32step_DualEndstop) but I thought without any endstops it would be harder to work backwards from that?

 

 

You should just use my dual firmware all the edits are already done for you.

You need to add pins to the firmware, see my firmware for more info.

1 Like

I’m up and running now, thanks guys. Didn’t think the pre-made would be that easy - thanks for doing all the footwork and being so responsive around here Ryan.

1 Like

What he said :slight_smile:

There are some things we need to know to finalize the FW and wiring:

Are your X1/X2 and Y1/Y2 stepper harnesses “series” connected? The dual endstop FW won’t care in terms of being able to move the steppers, but do not home X-Y using series connected steppers. If you want the dual endstop functionality of self-squaring X-Y homing, then the RAMPS will require different harnesses (each motor will require its own driver), check out the dual endstop section of Ryan’s site for RAMPS:

https://www.v1engineering.com/auto-square-dual-endstops/