Gbrl mega5x issues

I’m currently in the process of building a new controller. I have an Arduino mega 2560 board with ramps 1.4 along with 5 stepper drivers plugged into it. I have loaded the gbrl mega 5x on to the board but I’m having issues.

I can get x y and z to run my test motor but the x2 and y2 will not spin up the motor. I checked the config file and n_axis is set to 5 and so is the Linear axis. The values for x2 and y2 are set in the config as A and B but they will not run for some reason. I’m not sure if I’m missing something in the config file or what. Any help would be appreciated.

1 Like

X2 and y2 still get the x and y instructions, respectively. A and b are rotational axes, so change this back to x and y.
It’s kinda goofy, but x and x2 are both the x axis.

Thank you Tony. I will give that a shot once I can get the board to take a new image. I keep on getting access denied even after a reboot.

Thanks again Tony that did the job. I just assumed the axis value had to be different and some place in the code it told it to give the code to both X and A. Now time to finish up the settings and switch over to this new controller and see what kind of accuracy and performance I can get out of it. Thanks to everybody here I’m learning a lot when it comes to this code and Arduino based boards.

One last question. Is there a place some place in a config file that I need to set how much power each motor gets or will they just take what they are given?

I’m pretty sure you’ll have to set those with the screw on your drivers. The only version of grbl in aware of that you can do this in the software was modified to run on the rambo. I’m sure you could get that one and change all the pin maps, but that’s a lot of work.

You should be able to find some instructions pretty quick by googling something like “set current on drv8825”.

Of course, if you’ve been told something different already, I’ll take another look. That’s just from memory.

Also, a lot of times the reason i can’t get into a board to flash it is that I’ll forget it’s connected to my gcode sender (and i can’t connect to it in the gcode sender because it’s still talking to the programmer).

I was having to switch ports and reset the board. I think my computer was holding open the port for some reason.

I just tried homing with the one motor connected and I got nothing but I’m not sure if this is because I do not have the limit switched hooked up and they are set to an open or closed in the software. I’m waiting on another motor to use for testing purposes before I go and pull off my Rambo board and replace it with this new one. I want to make sure everything is working as best as I can before I officially disconnect what I’m currently using.

My plan is to keep most of the settings as they are on my current setup and adjust as needed such as steps per mm. I will start with the 100 it currently is and go from there.

Are you making the switch just to use grbl, or to play with arduino and learn some more?

Here’s the thread I referenced above that works well for rambo. Only one change (that isn’t obvious) if you need to use inches in your programs.

Nm… last few posts didn’t show on my browser before posting.

1 Like

A combination of a few things. I’m already using the gbrl for Rambo but that project seems to be dead currently so no new updates any time soon. So because I want to stick with gbrl I decided to learn a new skill and build my own controller using the mega5x (seems to be updated on a regular basis) to be able to keep the duel end stops. I have some ideas for my wood shop if I can really learn this stuff well. I do have a tech background and can understand most code just have not written any actual programming in 15-20 years. Mostly just write sql code and report writing for my job.

I’m thinking of things for my wood shop like an automated stop for my miter saw or possibly design a new table saw fence that sits on a lead screw and is driven by a stepper motor for repeatable cuts down to a fraction of a MM. of course these things are pipe dreams but you have to shoot for something

1 Like

There are dozens of automated table saw fence videos on YouTube, but I really like this guy.

Good luck with the projects, and be sure to share your progress in the off topic sub. Pretty wide variety of people and projects there, but we all love power tools and micro controllers!

4 Likes

Do you happen to know if the limit switches when used in a ramps board require that all 3 pins be used? When I tried to use just two pins and activate the switch I didn’t get an indication of it activating. Also when I hit the homing button none of the motors actually spin. I’m not sure if this is a setting or if because it can not detect the limit switches it will not actually move the motors.

Pretty much all cnc cntroller firmware defaults to movement disabled on startup, and also no movement on an axis until it is homed (or gcode override is configured and sent). So any movement commands sent before homing will be ignored, unless you send $X to manually unlock movement.

You can test your end stops by sending ? in the terminal. Grbl should respond with a status report containing a bitmask that has the status of all endstops. It should look something like “Pn:001010”. If you don’t see it, you may need to first send “$10=3” to enable status reporting, then “?” for a fresh status report. The mask represents your endstops from X1 to the probe, 1=triggered and 0=open (default order for grblmega5x is: X1-X2-Y1-Y2-Z-PROBE). So in the above example Y1 and Z are triggered, the rest including the probe are open.

Like M119 with marlin, it’s best to use the status report to verify all of them are triggering as expected before attempting the first homing operation (also use it to verify the probe works before breaking a bit).

Usually switches have comm, NC, and NO terminals, and you connect just comm and one or the other depending on your needs. As such, GRBL has configuration to use either NC or NO switches. IIRC on the grblmega5x fork I was using, NO was the default. V1 firmware uses NC, which is better because it allows easy detection of wire/switch failures. Rarely would all 3 wires be connected to a switch; only time I’ve seen so called “3-wire endstops” is on optical sensors, buffered switches, etc (ie, not just a switches).

So if you went from using v1 firmware to grbl, your endstops may be wired with the wrong convention. This would making homing not work. If that’s the case, reversing the endstop logic in the firmware config is the best way to fix it.

[edited: sorry if you read it earlier… my brain got crosswired and I wrote up the marlin procedure to check enstops. It’s now fixed with the relevant GRBL methods.]

1 Like

I understand the no movement in startup and I clear the alarm first thing. I am
Able to get the motors to spin up with no issue. I currently do not have the endstops installed and when I hit the homing button nothing happens. I’m using openbuilds controller and all endstops are reading as open currently.

I will try the steps you mentioned and see what comes up.

Ok. Even if the endstops are not installed they should read as all open or all closed am I correct to think this?

I tried the ? and just got a bunch of cordinates so I ran the $10 = 3 and get the same thing and nothing like you mentioned about the PN:010010. I would assume even if the endstops are not installed I should get PN:00000 or PN:11111.

image

Now I do find it strange that openbuilds is indicating that all the input pins are off. I have to go check my other setup but I believe they are supposed to read as all open and when activated read as triggered.

image

Turns out that the pins show as off until triggered in open builds controller.

Hmm, AFAIK the pin states were added to the status report starting with grbl 1.1. Doesn’t make sense your board has 1.0 firmware, because AFAIK all the grblmega5x flavors are based off of 1.1. It could just be the way openbuilds works; I’m not at all familiar with it.

I think I’m going to scrap this current board and get an actual Arduino and not a knockoff in a kit. I’m having issues connecting to the board half the time and detecting the firmware. I think I’m just going to plunk down the $40 for the real Arduino and get myself a ramps 1.6 board as well. I do not mind spending the extra money if I end up with a better quality and reliable setup when all said and done.

If you are looking for a board on a budget, these days there are better options than ramps. Of course if it is not an skr or rambo that v1 supports, there will be a little work configuring firmware to work. However something for example like the SKR2 could work for not much more money than mega+ramps, but you get a much more modern 32bit mcu:

https://www.amazon.com/BIGTREETECH-Printer-Control-Smoothieboard-Upgrade/dp/B082YTYDCK/ref=sr_1_6?crid=1HMT76V7IJHMC&keywords=skr&qid=1663080896&sprefix=skr%2Caps%2C137&sr=8-6

I trying to stick with gbrl and keep my duel endstops. I use Vectric vcarve for my software and the post processor for Marlin has some issues and gbrl seems to be a pretty widely used. Now I am new to Al of this and I could be wrong and SKR board I know nothing about or what firmware is available for it so my knowledge is very limited.