Grbl on RAMBo w/ Dual Endstops!

I thin grbl keeps track of motor assignment based on the cpu.h file, which has been set up to coincide with Ryan’s instructions for marlin. So if you wire it up as in the V1 instructions, the order for the masks and assignments does make sense and you can change the origin and homing location/direction through the config file and the bit masks.
I think you had extra work to rechart the masks because you changed the order of the motor plugs on the board, right?

It’s more likely that I changed the physical location of the motors, I may have arbitrarily designated them 1 or 2.

1 Like

You are also homing bottom right, which already is diverging from defaults. Your info is still very valuable to others who are not using cookie cutter builds. Even for those who have default configs, it is a good read for those interested in understanding the fw on a more fundamental level.

1 Like

Newbie alert. Is this the master thread for transitioning to GRBL with dual endstops on the RAmbo 1.4 board?

I’m keen to switch but I’m wondering if this is production-ready and by that I mean, runnable without too much effort or gigantic issues.

Ahhh, that makes sense. I agree, though, that it’s helpful. I started charting mine right before I realized that I didn’t understand where the bitmask numbers came from.

Sure is. If you’re running on v1s marlin build, this is ready to pop onto your rambo board and set your config numbers. SHOULD be pretty straightforward, but as we’ve seen if you made any changes from the V1 setup you may have to do some thinking and troubleshooting.

Also I think I should mention here that I just downloaded a fresh copy to go their the config and cpu map to see what I screwed up (my laser was always full on or full off) and I saw that it had been updated in the last week or so to make the laser pwm work correctly. Loaded it up and BOOM, like a charm. The mx2 row… Second from the left is the pwm, second from the right is the laser enable. Thanks for the fix!

Out of curiosity, since I’m wanting to go ahead and mill PCBs with this, what is the Z probe pin? I switched to grbl so I could make height maps of my maybe not so flat copper boards.

The z probe goes to mega D15… which is T2 on a ramps board. I connected mine bare… no filtering and it works fine.

Milling pcbs on an mpcnc is pure joy. My favorite is watching the drill operation run. It is amazing how fast and clean routers can drill pcb.

Fwiw… if your design does not have fine pitch traces, you can usually get away without surface compensation. One of the bigger items with milling pcb… is precisely setting up workspace for a 2 sided job. For the pitches I have worked with so far… using a pair of drilled 1mm holes as been good enough. Ideally though, having a hard jaw and stop to key in x and y zero is best… but then also requires really square stock.

1 Like

I’m transitioning from Marlin on a Rambo 1.4 board. Just a few notes of hiccups I found along the way:

  1. To compile the code, you need to specify a 2560 board, not an Uno.
  2. The serial rate has to be 115200, not 250000

A few questions:

  1. My z-homing direction currently up, but needs to be down to hit the touchplate. $23=27 by default, but if I change it to 3, 4, or 7, z still is homing the wrong direction. How do I set home to be toward the bed? The Z+ commands work correctly (i.e. the router moves up). (edit- this was resolved below)

  2. Is it possible with GRBL to pause the work, raise the bit to clean it, and resume? (edit- apparently in cncjs if you hit pause and then cycle start, it does a few more commands and then pauses and releases to manual control. I could raise the bit, clean it, and lower it, and hit run again to continue)

$23 = 3 and 4 should definitely move the z in different directions for homing. All I can suggest there is to disconnect and reconnect, and check the settings to see if the updated values stuck.

I know if you send a tool change command to cncjs in tne gcode, it raises the bit and stops execution. I run a macro that touches off a switch and sets the z height, then resume. I haven’t noticed any extra moves, but I’ve never tried just pausing it, either. What is the cycle start?

I have a cycle start button at the top of my cncjs screen. Next to it is a feed hold button.

I think I see my problem. My G28.2 homing command for the z axis isn’t being recognized. Can you show your macro for doing the touchplate?
Edit- using the probe widget did the trick.

So, is the very first post over 1.5 years ago still the latest updated instructions or is there another howto post?

I would say that reading through this thread will get you mostly working.
Things I learned:
You interact with the EEPROM using dollar sign ($) commands. E.g. $20=0 removes soft limits, and I had to do that.
Don’t mess with $23 with dual endstops- you might rack your machine (er, um, possibly twice…).
Mine was 27 as the default and that works fine with the stock machine with zero in the lower-left.

I just reloaded this to my rambo a couple weekends ago. Downloaded from the repo (which seems to have some updates), unzipped, found the grbl folder (in my documents, not C for some reason) replaced it with the new one, changed 3 linear axes to 5 (so I can work in inches and not have errors with ijk moves), save, upload, done.
I did the rest of the grbl setup via console for size and speeds. None of the steppers needed to be reversed.
Good luck!

1 Like

A few other things I’ve learned:

  1. I don’t have a limit switch on my z axis but I want to have soft limits on travel. It turns out if you set the zmax to 0, it will ignore that axis when testing for soft limits. Type the code below in the console:

$132 = 0

  1. GRBL seems much more responsive and doesn’t have any downsides that I can see so far. Thanks to John Boiles and everyone who has worked on this port.

Here is how I set up my workflow:

steps to start job on cncjs:
home x and y axes
jog to origin on piece
note global x and y coordinates (write down in case you have to restart things or come back with a new file for finishing, for example).
zero x and y on the workspace coordinates
move over piece (if necessary to set z height)
either manually zero z using paper or use probe to zero z

To pause the job and fix bit, hit pause, then hit cycle start (with machine still running!). It will run a few cycles and then pause again.
raise z a fixed amount and put back down again.

to restart with a finish pass later, repeat above steps

Before I realized this existed, I started updating the MEGA 5x branch to work with my MPCNC build using and MKS Gen 1.4 board. Are there advantages to using this fork vs the mainline MEGA 5x repo? I have read through the whole thread and haven’t been able to figure that out.

It’s ready to drop on a rambo, config files have been figured out, so there’s that. The digipots have already been implemented. The autosquare has already been implemented. I don’t know if either of those are in the main branch.

Not sure what I’m doing wrong. I have the Rambo 1.4 and followed the wiki. When I hit upload in Arduino, I get this:


Arduino: 1.8.13 (Windows 10), Board: “Arduino Uno”

In file included from C:\Users\a035125\Documents\Arduino\libraries\grbl/grbl.h:44:0,

             from C:\Users\a035125\Documents\Arduino\libraries\grbl\examples\grblUpload\grblUpload.ino:27:

C:\Users\a035125\Documents\Arduino\libraries\grbl/nuts_bolts.h:50:0: warning: “max” redefined

#define max(a,b) (((a) > (b)) ? (a) : (b))

In file included from sketch\grblUpload.ino.cpp:1:0:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:93:0: note: this is the location of the previous definition

#define max(a,b) ((a)>(b)?(a):(b))

In file included from C:\Users\a035125\Documents\Arduino\libraries\grbl/grbl.h:44:0,

             from C:\Users\a035125\Documents\Arduino\libraries\grbl\examples\grblUpload\grblUpload.ino:27:

C:\Users\a035125\Documents\Arduino\libraries\grbl/nuts_bolts.h:51:0: warning: “min” redefined

#define min(a,b) (((a) < (b)) ? (a) : (b))

In file included from sketch\grblUpload.ino.cpp:1:0:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:92:0: note: this is the location of the previous definition

#define min(a,b) ((a)<(b)?(a):(b))

In file included from C:\Users\a035125\Documents\Arduino\libraries\grbl/grbl.h:44:0,

             from C:\Users\a035125\Documents\Arduino\libraries\grbl\examples\grblUpload\grblUpload.ino:27:

C:\Users\a035125\Documents\Arduino\libraries\grbl/nuts_bolts.h:55:0: warning: “bit” redefined

#define bit(n) (1 << n)

In file included from sketch\grblUpload.ino.cpp:1:0:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:124:0: note: this is the location of the previous definition

#define bit(b) (1UL << (b))

In file included from C:\Users\a035125\Documents\Arduino\libraries\grbl\grbl.h:48:0,

             from C:\Users\a035125\Documents\Arduino\libraries\grbl\coolant_control.c:21:

C:\Users\a035125\Documents\Arduino\libraries\grbl\coolant_control.c: In function ‘coolant_init’:

C:\Users\a035125\Documents\Arduino\libraries\grbl\cpu_map.h:534:31: error: ‘DDRH’ undeclared (first use in this function); did you mean ‘DDR’?

#define COOLANT_FLOOD_DDR DDRH

                           ^

C:\Users\a035125\Documents\Arduino\libraries\grbl\coolant_control.c:26:3: note: in expansion of macro ‘COOLANT_FLOOD_DDR’

COOLANT_FLOOD_DDR |= (1 << COOLANT_FLOOD_BIT); // Configure as output pin.

^~~~~~~~~~~~~~~~~

C:\Users\a035125\Documents\Arduino\libraries\grbl\cpu_map.h:534:31: note: each undeclared identifier is reported only once for each function it appears in

#define COOLANT_FLOOD_DDR DDRH

                           ^

C:\Users\a035125\Documents\Arduino\libraries\grbl\coolant_control.c:26:3: note: in expansion of macro ‘COOLANT_FLOOD_DDR’

COOLANT_FLOOD_DDR |= (1 << COOLANT_FLOOD_BIT); // Configure as output pin.

^~~~~~~~~~~~~~~~~

In file included from C:\Users\a035125\Documents\Arduino\libraries\grbl\grbl.h:44:0,

             from C:\Users\a035125\Documents\Arduino\libraries\grbl\coolant_control.c:21:

C:\Users\a035125\Documents\Arduino\libraries\grbl\coolant_control.c: In function ‘coolant_get_state’:

C:\Users\a035125\Documents\Arduino\libraries\grbl\cpu_map.h:535:31: error: ‘PORTH’ undeclared (first use in this function); did you mean ‘PORT0’?

#define COOLANT_FLOOD_PORT PORTH

                           ^

C:\Users\a035125\Documents\Arduino\libraries\grbl\nuts_bolts.h:59:30: note: in definition of macro ‘bit_istrue’

#define bit_istrue(x,mask) ((x & mask) != 0)

                          ^

C:\Users\a035125\Documents\Arduino\libraries\grbl\coolant_control.c:39:20: note: in expansion of macro ‘COOLANT_FLOOD_PORT’

 if (bit_istrue(COOLANT_FLOOD_PORT,(1 << COOLANT_FLOOD_BIT))) {

                ^~~~~~~~~~~~~~~~~~

In file included from C:\Users\a035125\Documents\Arduino\libraries\grbl\grbl.h:48:0,

             from C:\Users\a035125\Documents\Arduino\libraries\grbl\coolant_control.c:21:

C:\Users\a035125\Documents\Arduino\libraries\grbl\coolant_control.c: In function ‘coolant_stop’:

C:\Users\a035125\Documents\Arduino\libraries\grbl\cpu_map.h:535:31: error: ‘PORTH’ undeclared (first use in this function); did you mean ‘PORT0’?

#define COOLANT_FLOOD_PORT PORTH

                           ^

C:\Users\a035125\Documents\Arduino\libraries\grbl\coolant_control.c:61:5: note: in expansion of macro ‘COOLANT_FLOOD_PORT’

 COOLANT_FLOOD_PORT &= ~(1 << COOLANT_FLOOD_BIT);

 ^~~~~~~~~~~~~~~~~~

C:\Users\a035125\Documents\Arduino\libraries\grbl\coolant_control.c: In function ‘coolant_set_state’:

C:\Users\a035125\Documents\Arduino\libraries\grbl\cpu_map.h:535:31: error: ‘PORTH’ undeclared (first use in this function); did you mean ‘PORT0’?

#define COOLANT_FLOOD_PORT PORTH

                           ^

C:\Users\a035125\Documents\Arduino\libraries\grbl\coolant_control.c:89:9: note: in expansion of macro ‘COOLANT_FLOOD_PORT’

     COOLANT_FLOOD_PORT |= (1 << COOLANT_FLOOD_BIT);

     ^~~~~~~~~~~~~~~~~~

exit status 1

Error compiling for board Arduino Uno.

This report would have more information with
“Show verbose output during compilation”
option enabled in File -> Preferences.

I think you need to change your Arduino board type, looks like it’s trying to compile for an Uno

Try following the steps from the Reprap wiki to add the Rambo to your list of boards, then select it before running the upload script.

https://reprap.org/wiki/Rambo_firmware

Jump to the “Board manager” section.

Anyone know off the top of their head whether it would be difficult to get this working on an archim 1.0?

The archim is 32 bit. So a simple fork isn’t going to cut it. There is a grbl_esp32 that uses a 32 bit processor, but I think it was nearly rewritten from scratch.