GRBL running on Ramps

What signal is on D4 when the spindle is enabled? Can I hook it directly to the enable on my brushless spindle controller? It needs ground to enable

Hi, I havenā€™t tested this feature but I think that when spindle is enabled D4 = 5v.

To control your spindle you have to make a board, (transistor + relay) something like this :

ā‚¬ 0,72 | One 1 canal 5 V 12 V mĆ³dulo de relĆ© Placa de protecciĆ³n para Arduino con soporte optoacoplador disparador de alto y bajo nivel

 

I have the same issue here. Goto cpu_map.h, L361, change it to TCCR5B seems to fix this issue.

#define SPINDLE_TCCRB_REGISTER TCCR5B

 

ah, and did anyone have success with dual axis and bCNC?
I could not figure out so far how to set the cloned axis settings e.g. $104 and $114. In the controller configuration thre is only the default x/y/z axis $101 -103

edit: in bCNC one can go to console (top right) and use $104=something and $$ to see if it was successful

bad luck today. keep loosing posts. Now even the complete post that was already there vanished after edit :frowning:

So again the post which was before the other:

I have 2 end-stops in NC mode.

If I use $5=0 I get alert xyxy, I can the trigger each endstop and the alert for it goes away.

If I use $5=1, I get alert xyzxy why that? shouldnā€™t this be only z as i have zmin zmax not connected?

If I use a2 jumpers and close zmin zmax (signal - ground) I keep getting XYXY and this does not change when triggering any of the endstops.

So there seems to be more to do than this.

What exactly was the necessary adaption in limits.c in this case?

Ā 

a separate post (to not lose the others).

In ugs file>firmware, I get the settings in the console, however the dialogue stays empty and I can not import the settings.

Any ideas how to solve this?

Ā 

Should we move Pablo CasaƱaā€™s firmware from #74877 to a GitHub repo so that we can collaborate on it together? Maybe as a fork of https://github.com/fra589/grbl-Mega-5X on someoneā€™s GitHub account?

Iā€™d love to see if I could hook this up on my Rambo board. I recently used CNCjs with Grbl on a friendā€™s machine and it was a much nicer experience than Marlin. The ability to pause cuts immediately, define a work offset, and get real-time position updates were really great.

Based on Pabloā€™s comment ā€œlast version was published 4 mouths agoā€ and his code from #74877. Iā€™m pretty sure he was starting from fra589/grbl-Mega-5X version ec53762. If anyone wants to see his changes I made a commit for them in my fork.

I also took a stab at rebasing on top of fra589/grbl-Mega-5X:edge to pick up the handful of changes to that repo in the last 6 months. My current (untested) branch is here. Now to see if I can hook it up to my Rambo!

Great! I was thinking the same as I try to collect FOSS solutions in a tutorial.

For my machine with NC dual-endstops, I need to edit limits.c and we could try to establish different branches just as for the marlin firmware for the different controller board / machine setups.

I had a look in the config.h (as I at first didnā€™t like to edit limits.c - I thought it would be better to be able to change the config instead the source), and I found

// Inverts select limit pin states based on the following mask. This effects all limit pin functions,
// such as hard limits and homing. However, this is different from overall invert limits setting.
// This build option will invert only the limit pins defined here, and then the invert limits setting
// will be applied to all of them. This is useful when a user has a mixed set of limit pins with both
// normally-open(NO) and normally-closed(NC) switches installed on their machine.
// NOTE: PLEASE DO NOT USE THIS, unless you have a situation that needs it.
// #define INVERT_LIMIT_PIN_MASK ((1<<X_LIMIT_BIT)|(1<<Y_LIMIT_BIT)) // Default disabled. Uncomment to enable.

l250 in config.h

To me, this looked like solving my problem just leaving $5=0 and activating this.
Sad enough, doing so I get a compile time error that this feature is not implemented (from line 199 in limits.c) - so Iā€™ll have a look at it.

HI,

I solved my issue via config.h, without touching limits.c (which I think is preferable).

I propose the following adaption in config.h l.264

// Only enable the following line if you have - (min) limit switches attached
ā€” (delete this)//#define INVERT_MAX_LIMIT_PIN_MASK ((1<<AXIS_1) | (1<<AXIS_2) | (1<<AXIS_3))

//----
//uncomment the following (INVERT_MIN_LIMIT_PIN_MASK) for nc endstops (default mpcnc setup with normally closed min limit
//switch on x (AXIS_1), cloned x (AXIS_4), y (AXIS_2) and cloned y (AXIS_5)
//Do NOT use $5=1 as it won't work (keep $5=1)
#define INVERT_MIN_LIMIT_PIN_MASK ((1<<AXIS_1) | (1<<AXIS_2) | (1<<AXIS_4) | (1<<AXIS_5))
//----

// Only enable the following line if you have + (max) limit switches attached
//#define INVERT_MAX_LIMIT_PIN_MASK ((1<<AXIS_1) | (1<<AXIS_2) | (1<<AXIS_3))
#endif

So replace the line which comes from 3 axis grbl, and replace by explanation an 5x version.

This is already taken into account in limits.c code l.199 ff.

Ā 

@John Boiles would you add the change to one of your branches, such that we have a ā€˜stableā€™ grbl-Mega-5x-mpcnc in a github?

1 Like

This seems like really useful work would you be willing to fork the original project on github and add your mpcnc code so this can be found and worked on more easily by the community? Iā€™m only at the start of my cnc build but based on my experience with smaller cnc machines grbl seems like a superior firmware for the machine and this kind of work makes the mpcnc and lowrider much more appealing to a wider audience with the extra flexability.

@alexp thanks for the info! Youā€™re running a RAMPS board correct? I think Iā€™ll need to figure out the right pins for my RAMBO board as well. Not sure how similar the pinouts are. Iā€™m hoping to pick this up again soon!

You also need to set the digipots for the current on the rambo board. I think the pinouts wonā€™t be bad, but they use the port variables, IIRC. So youā€™ll need to do a little homework to find the right pins.

@alexp: it was kind of hard to understand your changes with the code formatting on this forum. Is this what you did?

https://github.com/johnboiles/grbl-Mega-5X/pull/1

@jeffeb3 yeah I looked for a bit today and got a bit confused by the way the GRBL code lists pins. Iā€™ve started trying to map out the different pins though. Any sense on whatā€™s the worst that could happen if i set the wrong pins?

Without looking at the datasheets for the various parts, Iā€™m not really sure. Thereā€™s always a chance youā€™ll let the magic smoke out, but I doubt thatā€™s possible. You could toast the atmega if, for example, you tried to set an endstop pin high and it was shorted to ground. There might also be a combo that could break a driver, but that seems less likely.

Can you just get it right the first time? :slight_smile:

Hi Alex, Its easier change your endstops to NO than change the firmware.

To import my MPCNC settings you have to work with UGS platform 2.0. I work with this program 6 mouths ago and works pretty well.
Upload the last version #78315 and follow the instructions.

I John, great idea! Thankyou for your work, I donā€™t know how works Github to upload o modify something so thankyou.

There is another post with all problems solved, with this version I have been working 6 mouths ago.

Good luck with your Rambo modification.

Hi all,

sorry, I have had a huge workload on other projects and was offline for a few weeks.

I documented my changes in the tutorial. John, I think your changes on github are correct.

Status uptdate from my side:

Iā€™m happy to be running on grbl with bCNC as frontend.

Opted for blender-cam (instead of freecad) because Iā€™m usually do my constructions in there (mesh based). COnversion to freecat (shpae based) does not work well for larger meshes.

Blender-cam is great and offers grbl output- Start reading here

Ā 

Ā 

Iā€™ve mapped out all the pins in a spreadsheet (see column E ā€˜Grbl (proposed)ā€™). If someone had some time, Iā€™d love a second set of eyes to verify it against the RAMBo schematic to check my work. In the spreadsheet I also compare against the Marlin RAMBo pins as an additional check.

Now on to looking at how to set the digipots and mircostep setting.