Welcome! Log In Create A New Profile

Advanced

GRBL on NUCLEOF401 (cortex-M4 cpu)

Posted by adc_dc 
GRBL on NUCLEOF401 (cortex-M4 cpu)
October 25, 2017 04:36AM
Hi guys,
I am new in the forum, but I read it before every now and then.

A bit of time ago I obtained a NUCLEOF401RE board, that is quite cheap but powerful, and I played with it and with GRBL and some motors I had, and I started porting the GRBL v.0.9 code on the cortex processor.

After a bit (or a lot grinning smiley) of work I have been able to port the code, and I did a bit of testing with some GCODE files and control software on host(GCODEController or UGS). These test, up till now were positive, but I realize that I would need more testing and if someone knows good stress tests I'd appreciate it very much.

Moreover, if somebody owns a NUCLEOF401RE board, and would like to use it, here is the repository link with a bit of informations:

grbl_port_opencm3

Some nice features of this port:

- the 32-bit processor runs at 48 MHz (and it may run at 84 MHz, but for now I used an easily manageable frequency), while normally the arduino's CPUs run at16 MHz, if I am not wrong.
- I tried to use the same pinout used by GRBL to have the possibility to re-use the existing motor driving shields with just few reconnections
- I used libopencm3 library, to make the code portable also on other supported board, as an example most of the boards that have STM32 processors.
- the settings and other informations are stored in a NVM "Non Volatile Memory", i.e. in a flash and managed without any information loss, or so it seems from my tests

For any question feel free to contact me here or on the project. smiling smiley

Edited 1 time(s). Last edit at 10/25/2017 10:29AM by adc_dc.
Re: GRBL on NUCLEOF401 (cortex-M4 cpu)
October 25, 2017 09:46AM
Thanks for sharing your work. I don't have a nucleo board right now but they certainly have a lot of untapped potential. Keep it up!
Re: GRBL on NUCLEOF401 (cortex-M4 cpu)
October 25, 2017 10:28AM
Quote
obelisk79
Thanks for sharing your work. I don't have a nucleo board right now but they certainly have a lot of untapped potential. Keep it up!

Thanks!! I hope it could be useful to many peoples. I already have in mind small improvements, but I hope sharing the project may suggest bigger improvements smiling smiley
Re: GRBL on NUCLEOF401 (cortex-M4 cpu)
November 01, 2017 08:21PM
You may find more interest in a CNC forum since GRBL is not a firmware for 3d printers and there are no shields available that would create a 3d printer controller (someone is working on one though). As you may already know, there's CNC shield that will work with nucleo board:

https://github.com/omuzychko/StepperHub/raw/master/stepperHub.jpg

Edited 2 time(s). Last edit at 11/01/2017 08:26PM by newbob.
Re: GRBL on NUCLEOF401 (cortex-M4 cpu)
November 01, 2017 11:27PM
newbob RD3D is not being designed for the Nucleo.

I am working on a one-off design for the Nucleo F446RE I just got in the mail today however.

I'm not planning on releasing any information for it until I can at least say I have something that works though, if at all.

Edited 1 time(s). Last edit at 11/01/2017 11:28PM by obelisk79.
Re: GRBL on NUCLEOF401 (cortex-M4 cpu)
November 03, 2017 08:51AM
Thanks newbob for your hints,
effectively I am using that shield to make some tests with a cheap scope, some driver and a stepper motor I have.
Indeed, as I pointed out in the first post, I have tried to keep the pinout as similar to the arduino as possible to use a shield... that is practically the one you posted.
There are just a couple of inputs that are reconnected on the morpho pins (the non-arduino connectors) or something similar, but not the driver outputs that are the most important thing to drive with the shield. The reason for this is explained in the wiki of the repository.

In the mean time, a friend of mine that was building a corexy tried my code with is corexy "skeleton" and some basic GCODE tests, with good results.

@obelisk79: if you want to try this port on your NUCLEOF446RE you may do it quite easily, because one good thing is that it uses the libopencm3 that allows to easily recompile for another target, and the pinout of the two boards is not so different (I should re-check it, but at a first view it seemed very similar).
In this case the difference to change should be:

  1. the memory sizes to be used for flash and ram
  2. the sectors numbers and addresses of the flash used to store/retrieve the settings.

Instead, if you want to port another type of code like Marlin, you may still read the wiki linked above to know which issues you may face, and have a possible solution to them.

Edit: @newbob I am giving a better look at the repo you linked (thanks), and it seems an ok CNC controller, but it's a bit different because it does not get GCODE commands (as far as I have seen) and it's not based on open libraries.

Edited 1 time(s). Last edit at 11/03/2017 09:03AM by adc_dc.
Re: GRBL on NUCLEOF401 (cortex-M4 cpu)
November 03, 2017 09:43AM
adc_dc,

I believe all NUCLEO64 boards have the exact same pinout, so yes should be very easy to port between the two boards.

Also, they are based on the same processor architecture. The morpho connectors on the board have enough I/O that the peripheral board I'm currently designing should remain relatively compact and feature-rich. I've almost finished with component selections and schematics. The next part will be the actual board design/layout.

This is my first PCB design so I'm nervous about giving out much in the way of details.
Re: GRBL on NUCLEOF401 (cortex-M4 cpu)
November 03, 2017 10:48AM
Quote
obelisk79
This is my first PCB design so I'm nervous about giving out much in the way of details.

Well, I know the feeling, it's very understandable.

About a shield for the nucleo, my suggestion is to take care about input pins and EXTI lines interrupts (see the wiki for more details). You want to avoid to have on the same interrupt line, 2 inputs pin that use interrupt .

Also, I have just checked the memory map and there is just 128 kB of SRAM instead of the 96 kB of the F401RE, while the addresses are identical, so the build is practically identical.

If you want I can pass you a build already done, or you may want to play with the pinout configuration for your shield and recompile. All the instruction are on the README and the wiki, but for any question I will answer here or on gitter.
Re: GRBL on NUCLEOF401 (cortex-M4 cpu)
December 08, 2017 01:52AM
I made a while ago a port with Teacup to F411RE. There is also an experimental branch for F401 and F446.
I used also the CNC shield V3. Maybe it's a look worth.

[github.com]


Triffid Hunter's Calibration Guide --> X <-- Drill for new Monitor Most important Gcode.
Re: GRBL on NUCLEOF401 (cortex-M4 cpu)
December 08, 2017 10:42AM
Thanks for that Wurstnase
Sorry, only registered users may post in this forum.

Click here to login