GRBL STM32duino?

Post here first, or if you can't find a relevant section!
madias
Posts: 35
Joined: Thu Dec 26, 2019 11:51 pm
Answers: 1

GRBL STM32duino?

Post by madias »

After fighting (G31 probe command ) with really bad designed and closed source USB-parallel Adapters for my CNC (in particular: NC200 / RTM200) and due the fact, that GRBL is using the old fashioned ATmega328 i researched a bit about a GRBL conversation for ARM (better STM32), but I'm a little bit disappointed:
The ARM development seemed to be fell asleep for more than 3 years ( https://github.com/usbcnc/grbl) and the only STM32 thing I found on the old forum:
https://stm32duinoforum.com/forum/viewt ... rt_10.html
https://github.com/Alfrederson/cncstm32

So, I try to sum up:
Is anybody using a STM32 for a CNC?
Is anybody using GRBL on STM32?
Is anybody using 'GRBL on stm32duino?
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: GRBL STM32duino?

Post by ag123 »

i've been dragging my feet on that, but i think making something GRBL with even the pill boards is a good idea.
i may actually try it but i've not 'got there' yet.
i think stm32's suite of hardware e.g. timers, spi, i2c, adc, sdio etc may be useful for 'beyond GRBL' uses, not to mention its 32 bit arm core

note that more recently stm32 based 3d printer boards etc has been found in the wild
there is this bigtreetech that sell some stm32 based 3d printer boards
https://www.aliexpress.com/store/group/ ... 83450.html
https://www.aliexpress.com/item/3304255 ... 1c39Fk6tmv

they apparently maintain this github repository
https://github.com/bigtreetech
https://github.com/bigtreetech/BIGTREETECH-SKR-mini-E3
https://github.com/bigtreetech/BIGTREETECH-SKR-PRO-V1.1

for some reason i can't seem to access their web site or if it is indeed the correct web
http://www.bigtree-tech.com/
i'm not sure if this web is related
https://www.biqu.equipment/collections/control-board
this shield looks quite interesting
https://www.biqu.equipment/collections/ ... ard-3d0320
no schematics etc
the a better web is found on
https://osoyoo.com/2017/04/07/arduino-u ... 3-0-a4988/
i'm not too sure if they are after all the same thing
it seemed rather feasible to pair the cnc shield with say a blue pill etc
use dupont pins and wires if need be
i think some nucleo boards has the arduino headers, but just not sure if the pins would be allocated nicely
and olimex has a full uno style board with a stm32f103rb
https://www.olimex.com/Products/Duino/S ... e-hardware
probably modeled after the maple
zoomx
Posts: 28
Joined: Fri Dec 20, 2019 10:12 am
Location: Near Mt.Etna

Re: GRBL STM32duino?

Post by zoomx »

ag123 wrote: Thu Feb 06, 2020 5:39 pm
this shield looks quite interesting
https://www.biqu.equipment/collections/ ... ard-3d0320
no schematics etc
the a better web is found on
Image

Code: Select all

cnc shield v3 engraving machine 3D Printer 4pcs A4988 driver


One, Introduction
This expansion board as a driver expansion board, can be used for engraving machines, 3D printers.
It is a total of four slots, can drive four A4988 stepper motor. Each road stepper motors only need two IO ports. In other words, six IO ports can be well managed three stepper motors. Very convenient to use.
 
Two, UNO for module IO port correspondence introduction.
IO corresponding figure above
 
UNO--------------------- expansion board
8 ------------------------ EN ( stepper motor driver enable , active low )
7 ----------------------- Z.DIR (Z -axis direction control )
6 ----------------------- Y.DIR (Y -axis direction control )
5 ----------------------- X.DIR (X -axis direction control )
4 ---------------------- Z.STEP (Z -axis stepper control )
3 ---------------------- Y.STEP (Y -axis stepper control )
2 ---------------------- X.STEP (X -axis stepper control )
 
/ / The following is a simple stepper motor control procedures,
 
# define EN 8 / / stepper motor enable , active low
# define X_DIR 5 / / X -axis stepper motor direction control
# define Y_DIR 6 / / y -axis stepper motor direction control
# define Z_DIR 7 / / z axis stepper motor direction control
# define X_STP 2 / / x -axis stepper control
# define Y_STP 3 / / y -axis stepper control
# define Z_STP 4 / / z -axis stepper control
/ *
/ / Function : step . function: to control the direction of the stepper motor , the number of steps .
/ / Parameters : dir direction control , dirPin corresponding stepper motor DIR pin , stepperPin corresponding stepper motor " step " pin , Step number of step of no return value.
 
* /
void step (boolean dir, byte dirPin, byte stepperPin, int steps)
{
digitalWrite (dirPin, dir);
delay (50);
for (int i = 0; i
digitalWrite (stepperPin, HIGH);
delayMicroseconds (800);
digitalWrite (stepperPin, LOW);
delayMicroseconds (800);
}
}
void setup () {/ / The stepper motor used in the IO pin is set to output
pinMode (X_DIR, OUTPUT); pinMode (X_STP, OUTPUT);
pinMode (Y_DIR, OUTPUT); pinMode (Y_STP, OUTPUT);
pinMode (Z_DIR, OUTPUT); pinMode (Z_STP, OUTPUT);
pinMode (EN, OUTPUT);
digitalWrite (EN, LOW);
}
void loop () {
step (false, X_DIR, X_STP, 200); / / X axis motor reverse 1 ring, the 200 step is a circle.
step (false, Y_DIR, Y_STP, 200); / / y axis motor reverse 1 ring, the 200 step is a circle.
step (false, Z_DIR, Z_STP, 200); / / z axis motor reverse 1 ring, the 200 step is a circle.
delay (1000);
step (true, X_DIR, X_STP, 200); / / X axis motor forward 1 laps, the 200 step is a circle.
step (true, Y_DIR, Y_STP, 200); / / y axis motor forward 1 laps, the 200 step is a circle.
step (true, Z_DIR, Z_STP, 200); / / z axis motor forward 1 laps, the 200 step is a circle.
delay (1000);
}
Never tested!
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: GRBL STM32duino?

Post by ag123 »

thanks !
madias
Posts: 35
Joined: Thu Dec 26, 2019 11:51 pm
Answers: 1

Re: GRBL STM32duino?

Post by madias »

Ok, thanks for your answers.
I own my CNC since November last year and I'm really surprised, that there are so many firmware / control software / CAMS's. ... out. There is no semi standard like on 3D printing: Repetier & Marlin as standard firmware, Cura, Slic3r and (these strange $$$ thing - $implyfy or something) as GCODE creators and a handful of control software. (I ended up with a nearly "untouched" Anycubic I3 Mega + Cura + Repetier Host).

On CNC sector this is extremely diversified: No real "semi" standard, maybe only those old "Mach3 compatibility" things and GRBL.
At the moment I use "Estlcam" for creating GCODE and as control software on my own build ATMEGA328 parallel - usb converter with "estlcam" firmware (another one, sadly not open source...). Basic things are working good, even auto leveling. I think I'm going to test and use this system for a while, so I'm going to see what I'm missing for myself. Maybe I'm only really impressed by GRBL and this way of how to work:
https://www.youtube.com/watch?v=KeKRUd5ZZHw
https://www.youtube.com/watch?v=BjSKQNicTjo
But I also created double sided PCB with simple alignment pins and auto leveling.
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: GRBL STM32duino?

Post by ag123 »

for the on board firmware i think GRBL is still a most popular, apparently Marlin et.al. can also be used for CNC, but i'd guess they are 'designed' for 3d printing firstly. nevertheless, it is g-codes after all. just different g-codes perhaps
https://all3dp.com/2/best-cnc-software-for-arduino/

found something interesting about cnc
https://www.youtube.com/watch?v=y60q6U7NjTQ
madias
Posts: 35
Joined: Thu Dec 26, 2019 11:51 pm
Answers: 1

Re: GRBL STM32duino?

Post by madias »

I think Marlin (and even Repetier) didn't ever do the jump to the CNC world, both of them can be used for years for CNCing. It's all about the programs and the supported firmware and on the "freeware/open-source sector" there's GRBL. But here it ends. There are plenty much control software and I do not have the time to try and test them all. Only one, which looks promising: bCNC -> https://github.com/vlachoudis/bCNC

The Maslow is a funny thing :) Like a vertical Kossel, what I didn't understand how the Z-way works... Sadly (or luckily) I do not have to room for such a big machine. But to be honest: Cutting out such big things can also be done with a simple "overhead template router" (I'm missing the word for "Oberfräse").
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: GRBL STM32duino?

Post by ag123 »

i went ahead and got a piece of a clone CNC Shield V3.0
https://www.aliexpress.com/wholesale?Ca ... hield+V3.0
as it feels pretty much like a $1 board, hope when i've time on hand i'd patch (dupont) wires between a stm32 pill board & it
and try to put grbl on it, technically i'd think it is bed motor (y-axis), frame horizontal motor (x axis) and the vertical spindle motor (z-axis) for the 3 axis
so there seem to be one extra motor which i'd think it may be handy to place a stepper on the bed for an additional rotational axis, it may perhaps be useful.

a popular spindle motors seem to be '775 motor' which purportedly offers 100w of power
https://www.aliexpress.com/wholesale?ca ... =775+motor
a cnc seem somewhat easier to self-built as retail parts are rather easily available. for 3d printers sometimes, one'd need to confront parts such as hot ends, extruders, heated bed etc. they are also widely available just that the number of parts apparently seem a little more than do a small desktop cnc miller

there are also some of these rather funky x-y tables which it seemed can be improvised for cnc purposes if one is lazy to work with the much more accurate ball screws, linear rails etc. accordingly, those are rather wobbly which may cause poor mills
https://www.aliexpress.com/wholesale?Se ... =xy++table

and sure enough there are no lack of people who would try just that :lol:
https://www.youtube.com/watch?v=wlr1LsVJCdU
https://www.youtube.com/watch?v=r0NEwr2NBt0
https://www.youtube.com/results?search_ ... e+cnc+mill
madias
Posts: 35
Joined: Thu Dec 26, 2019 11:51 pm
Answers: 1

Re: GRBL STM32duino?

Post by madias »

I bought this one (free EU shipping so no taxes or something for me):
https://www.aliexpress.com/item/33003313338.html
I opposite to other 3040 (or 3020) this one has SFU1204 ball screws % NEMA23.
The 500W spindle is "ok". Good enough for wood and good enough for PCBs
Stepper & spindle boards are also "ok". So you can work for a while, NEMA23 are outstanding.
The frame can also be bought "naked" - it's a good thing to start a own build CNC: https://www.aliexpress.com/item/32840788044.html

There are STM32 based "MACH3 control boards" for very cheap, like this: https://www.aliexpress.com/item/4000183542000.html
I own this (its a STM32F103RCT6 so not bad!), but to be honest, I didn't tried it. I don't know how to program it - but in worst case you only need to solder 2 connections on the chip (DIO/DCLK). But they looks to be a solid base for a CNC interface - you only need 3 driver cartridges. Even a cheap TB6600 will do the job better than every A4988 thing. https://www.aliexpress.com/item/32957327440.html
ll those 1 Euro "CNC Shields" are made for toys, basically those A4988 or DRV8825 cannot handle the force you need even for wood carving.

I played a little bit with my own build Estlcam control device and the autolevelling function of Estlcam, results are not bad (especially because my drill/carve bit isn't good enough for such small things): The upper left square is for a STM32F103CBxx, the right one a ATmega328, big one a ATmega1280, down right a SD-card holder, up right a USB mini connector) Drilled with 100-200 feed rate, 2 passes (40% overlap). Silk overlay wasn't autolevelled.
https://photos.app.goo.gl/QFB3GtjqLJ43he52A
Attachments
pcb-mill-test.JPG
pcb-mill-test.JPG (93.96 KiB) Viewed 13083 times
Last edited by madias on Tue Feb 11, 2020 11:22 pm, edited 3 times in total.
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: GRBL STM32duino?

Post by ag123 »

the milling looks ok, i'd guess some tune up e.g. making sure the bed is level and to reduce vibrations (i've read placing a flat wooden board on it would help)
https://www.youtube.com/watch?v=uwDjeviDlvU
and to probe that with a wire probe so that perhaps the cnc can account for uneven surfaces. i'm not too sure if it does that after all,
perhaps the host s/w need to use that data.
https://www.youtube.com/watch?v=Bb45IQl5VCE
but i'd guess all these tuning and calibration takes a lot of tests and iterative refinements
oh and the Estlcam autoleveling one looks very good and nice, so autoleveling matters

i think it would be quite possible to put GRBL on stm32f103 so that it is a familiar firmware set, i got that CNC shield V3 (clone) as an intended pair up.
no intents on using a shield, but rather i'd make do with 'dupont wires',
https://www.youtube.com/watch?v=eI3fxTH6f6I
this has the additional benefit that one can patch the pins whichever way one needs rather than being locked up to specific pins
however, as meddling with those stuff would take lots of time and effort, i'd simply just wait for the slow boat for the $1 board to arrive. even then i may sit on it till i think i'm game to work that. there are quite many things on the wish 'to do' list that i've never got to them eventually.

but literally i've one of these 3018 cnc, in the same way i'd need to get it assembled and work it
https://www.youtube.com/watch?v=xdeWQQZEtH0

i think making GRBL work on stm32f103 is a good thing, after getting it work work on the atmega328 stuff, i'd think i can then try the next step which is to swap that and use the stm32 + CNC shield V3 combo
Last edited by ag123 on Tue Feb 11, 2020 11:44 pm, edited 2 times in total.
Post Reply

Return to “General discussion”