Giter VIP home page Giter VIP logo

grbl's Introduction

GitHub Logo


Click the Release tab to download pre-compiled .hex files or just click here


Grbl is a no-compromise, high performance, low cost alternative to parallel-port-based motion control for CNC milling. This version of Grbl runs on an Arduino with a 328p processor (Uno, Duemilanove, Nano, Micro, etc).

The controller is written in highly optimized C utilizing every clever feature of the AVR-chips to achieve precise timing and asynchronous operation. It is able to maintain up to 30kHz of stable, jitter free control pulses.

It accepts standards-compliant g-code and has been tested with the output of several CAM tools with no problems. Arcs, circles and helical motion are fully supported, as well as, all other primary g-code commands. Macro functions, variables, and most canned cycles are not supported, but we think GUIs can do a much better job at translating them into straight g-code anyhow.

Grbl includes full acceleration management with look ahead. That means the controller will look up to 16 motions into the future and plan its velocities ahead to deliver smooth acceleration and jerk-free cornering.

  • Licensing: Grbl is free software, released under the GPLv3 license.

  • For more information and help, check out our Wiki pages! If you find that the information is out-dated, please to help us keep it updated by editing it or notifying our community! Thanks!

  • Lead Developer: Sungeun "Sonny" Jeon, Ph.D. (USA) aka @chamnit

  • Built on the wonderful Grbl v0.6 (2011) firmware written by Simen Svale Skogsrud (Norway).


Official Supporters of the Grbl CNC Project

Official Supporters


Update Summary for v1.1

  • IMPORTANT: Your EEPROM will be wiped and restored with new settings. This is due to the addition of two new spindle speed '$' settings.

  • Real-time Overrides : Alters the machine running state immediately with feed, rapid, spindle speed, spindle stop, and coolant toggle controls. This awesome new feature is common only on industrial machines, often used to optimize speeds and feeds while a job is running. Most hobby CNC's try to mimic this behavior, but usually have large amounts of lag. Grbl executes overrides in realtime and within tens of milliseconds.

  • Jogging Mode : The new jogging commands are independent of the g-code parser, so that the parser state doesn't get altered and cause a potential crash if not restored properly. Documentation is included on how this works and how it can be used to control your machine via a joystick or rotary dial with a low-latency, satisfying response.

  • Laser Mode : The new "laser" mode will cause Grbl to move continuously through consecutive G1, G2, and G3 commands with spindle speed changes. When "laser" mode is disabled, Grbl will instead come to a stop to ensure a spindle comes up to speed properly. Spindle speed overrides also work with laser mode so you can tweak the laser power, if you need to during the job. Switch between "laser" mode and "normal" mode via a $ setting.

    • Dynamic Laser Power Scaling with Speed : If your machine has low accelerations, Grbl will automagically scale the laser power based on how fast Grbl is traveling, so you won't have burnt corners when your CNC has to make a turn! Enabled by the M4 spindle CCW command when laser mode is enabled!
  • Sleep Mode : Grbl may now be put to "sleep" via a $SLP command. This will disable everything, including the stepper drivers. Nice to have when you are leaving your machine unattended and want to power down everything automatically. Only a reset exits the sleep state.

  • Significant Interface Improvements: Tweaked to increase overall performance, include lots more real-time data, and to simplify maintaining and writing GUIs. Based on direct feedback from multiple GUI developers and bench performance testing. NOTE: GUIs need to specifically update their code to be compatible with v1.1 and later.

    • New Status Reports: To account for the additional override data, status reports have been tweaked to cram more data into it, while still being smaller than before. Documentation is included, outlining how it has been changed.
    • Improved Error/Alarm Feedback : All Grbl error and alarm messages have been changed to providing a code. Each code is associated with a specific problem, so users will know exactly what is wrong without having to guess. Documentation and an easy to parse CSV is included in the repo.
    • Extended-ASCII realtime commands : All overrides and future real-time commands are defined in the extended-ASCII character space. Unfortunately not easily type-able on a keyboard, but helps prevent accidental commands from a g-code file having these characters and gives lots of space for future expansion.
    • Message Prefixes : Every message type from Grbl has a unique prefix to help GUIs immediately determine what the message is and parse it accordingly without having to know context. The prior interface had several instances of GUIs having to figure out the meaning of a message, which made everything more complicated than it needed to be.
  • New OEM specific features, such as safety door parking, single configuration file build option, EEPROM restrictions and restoring controls, and storing product data information.

  • New safety door parking motion as a compile-option. Grbl will retract, disable the spindle/coolant, and park near Z max. When resumed, it will perform these task in reverse order and continue the program. Highly configurable, even to add more than one parking motion. See config.h for details.

  • New '$' Grbl settings for max and min spindle rpm. Allows for tweaking the PWM output to more closely match true spindle rpm. When max rpm is set to zero or less than min rpm, the PWM pin D11 will act like a simple enable on/off output.

  • Updated G28 and G30 behavior from NIST to LinuxCNC g-code description. In short, if a intermediate motion is specified, only the axes specified will move to the stored coordinates, not all axes as before.

  • Lots of minor bug fixes and refactoring to make the code more efficient and flexible.

  • NOTE: Arduino Mega2560 support has been moved to an active, official Grbl-Mega project. All new developments here and there will be synced when it makes sense to.

List of Supported G-Codes in Grbl v1.1:
  - Non-Modal Commands: G4, G10L2, G10L20, G28, G30, G28.1, G30.1, G53, G92, G92.1
  - Motion Modes: G0, G1, G2, G3, G38.2, G38.3, G38.4, G38.5, G80
  - Feed Rate Modes: G93, G94
  - Unit Modes: G20, G21
  - Distance Modes: G90, G91
  - Arc IJK Distance Modes: G91.1
  - Plane Select Modes: G17, G18, G19
  - Tool Length Offset Modes: G43.1, G49
  - Cutter Compensation Modes: G40
  - Coordinate System Modes: G54, G55, G56, G57, G58, G59
  - Control Modes: G61
  - Program Flow: M0, M1, M2, M30*
  - Coolant Control: M7*, M8, M9
  - Spindle Control: M3, M4, M5
  - Valid Non-Command Words: F, I, J, K, L, N, P, R, S, T, X, Y, Z

Grbl is an open-source project and fueled by the free-time of our intrepid administrators and altruistic users. If you'd like to donate, all proceeds will be used to help fund supporting hardware and testing equipment. Thank you!

Donate

grbl's People

Contributors

0xpit avatar alpharesearch avatar beardicus avatar binaryconstruct avatar buserror avatar chamnit avatar daapp avatar diara628 avatar eliteeng avatar ewidance avatar henols avatar hin avatar jgeisler0303 avatar kfoltman avatar martinstingl avatar michmerr avatar paulkaplan avatar poelstra avatar protoneer avatar robgrz avatar rustyoz avatar scottrcarlson avatar shapeoko avatar silasb avatar simen avatar tmpvar avatar usbcnc avatar winder avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grbl's Issues

Inital Active State: Alarm

Props on the good work for this Project!

I followed your instructions on the how to build and run GRBL video. I built the project in coocox. Set the Bootpin 0 to High and flashed the created .hex file with ST Flash Loader Demonstrator via serial connection.

I connected pc to board usb (shows up as STM Serial Com12) and used Universal Gcode Sender to connect to GRBL ( Com12, Baud11520, Firmware GRBL). This is the output i get from consol:

**** Connected to COM12 @ 115200 baud ****

Grbl 1.1f ['$' for help]

$$
$G
$0=10
$1=0
$2=7
$3=7
$4=0
$5=0
$6=0
$10=1
$11=0.010
$12=0.002
$13=0
$20=0
$21=0
$22=1
$23=3
$24=25.000
$25=500.000
$26=250
$27=1.500
$30=100
$31=0
$32=0
$100=400.000
$101=400.000
$102=400.000
$110=600.000
$111=600.000
$112=600.000
$120=45.000
$121=45.000
$122=45.000
$130=200.000
$131=300.000
$132=50.000
ok
[verbose]GrblFeedbackMessage{message='[GC:G0 G54 G17 G21 G90 G94 M5 M M9 T0 F0 S0]', distanceMode='G90', units='G21'}
[GC:G0 G54 G17 G21 G90 G94 M5 M M9 T0 F0 S0]
ok
[verbose]<Alarm|MPos:0.000,0.000,0.000|FS:0,0|Pn:P|WCO:0.000,0.000,0.000>
[verbose]<Alarm|MPos:0.000,0.000,0.000|FS:0,0|Pn:P|Ov:100,100,100|A:S>
[verbose]<Alarm|MPos:0.000,0.000,0.000|FS:0,0|Pn:P>
[verbose]<Alarm|MPos:0.000,0.000,0.000|FS:0,0|Pn:P>
[verbose]<Alarm|MPos:0.000,0.000,0.000|FS:0,0|Pn:P>
[verbose]<Alarm|MPos:0.000,0.000,0.000|FS:0,0|Pn:P>
[verbose]<Alarm|MPos:0.000,0.000,0.000|FS:0,0|Pn:P>
[verbose]<Alarm|MPos:0.000,0.000,0.000|FS:0,0|Pn:P>
[verbose]<Alarm|MPos:0.000,0.000,0.000|FS:0,0|Pn:P>
[verbose]<Alarm|MPos:0.000,0.000,0.000|FS:0,0|Pn:P>
[verbose]<Alarm|MPos:0.000,0.000,0.000|FS:0,0|Pn:P|WCO:0.000,0.000,0.000>
[verbose]<Alarm|MPos:0.000,0.000,0.000|FS:0,0|Pn:P|Ov:100,100,100|A:S>


From there on the output just loops and the Machine status from UGCS is Active State: Alarm.

My question is, did i do something wrong and how can i resolve it?Or is this a code/port based problem?

Thanks for your work on the project :) cheers

Variable Spindle issue

To control my STM32F103 I use bCNC.
The STM32 is programmed with the latest firmware as is.

Now I tried some gray scale images but it seems the laser is on of off, nothing in between.
Did I miss something in the code as VARIABLE_SPINDLE is defined in the config.h file.
A have it connected to pin A8 is mentioned in the file cpu_map.h

Is variable spindle speed implemented?

PINOUT

Hi there

first thanks for your work to port GRBL to the STM32!

i've managed to Flash mine and run it.

the only Thing i've not found out yet is the pinout:

from this Picture:

http://wiki.stm32duino.com/images/a/ae/Bluepillpinout.gif

i've seen the labled Pins in relationship to arduino

but if i connect for instance A2 as X-step and A5 as X-dir the stepper doesnt move... Any idea?

Serial Transmission corrupts some characters

Hi,

with my setup (STM32 Blue Pill) some chars sent over USB get corrupted in transmission. eg. I get the occasional [BRB:] instead of PRB, sometimes status messages have some wrong characters (both in text and numbers). I have yet to find an error in the transmission from the PC to grbl.

I'm using a single USB cable which is relatively short, though this shouldn't affect the data anyways as USB normally uses CRC. Is CRC disabled for incoming messages like in vUSB? This would explain why (so far) only messages from the PC have been corrupted.

Martin

Porting to F469

Hi @usbcnc
I want to port to STM32F469-DIS
Is there a good way to get started?
It seems that to modify PIN Map, Right?
Thanks to your help.

Arduino IDE environment

thanks @usbcnc for porting to such platform , however I've tried to change it and uploaded to my board regards to instructions , I think it little be handy , do you have plan to port it base on Roger Clarck repo, its very stable now ?

Self-compiled project works not reliable

Hello USBCNC,

I flashed an older hex file you provided here on a blue pill STM32F103C8T6 board, installed ST's VCP driver and did a first test.
I streamed a pretty big g-code file (860.000 lines, running time ~2hours) using bCNC -> this works without a problem.

However, the same test using a self-compiled file only works for a few minutes but after some random time (between 5 and 15 minutes) it hangs.

I already tried different compiler options and optimization levels but can't get it to work reliable.
A next test is to use an older compiler. I currently use 6.3.1-2017q2 and I think you used 4.9-2015q3 as I saw here.

Do you have any further ideas ?

I'm interested in a stable and reliable GRBL STM32 port, so any help is highly appreciated.

Thanks and best regards,
lakeroe

coolant on PB3 doesn´t work

i try to connect a relay to PB3 fora coolant fan ,but thisnot work.if i change thr pin for coolant from PB3 to PA9 this work perfectly.
why happen that?
thank you for your work!!
and if you can help me with this!!!

Why only 30khz??

Why is the pulse rate still limited to 30khz on a much faster board??

step_pulse_time should be uint16_t instead of uint8_t

In file stepper.c, there is:
#ifndef WIN32
uint8_t step_pulse_time; // Step pulse reset time after step rise

For STM32, step_pulse_time is then filled with
#elif defined(STM32F103C8)
st.step_pulse_time = (settings.pulse_microseconds)*TICKS_PER_MICROSECOND;

As TICKS_PER_MICROSECOND = 72, it is not possible to assign more than 3 usec to the parameter pulse_microseconds because (settings.pulse_microseconds)*TICKS_PER_MICROSECOND would exceed 255.
To solve this, we should define step_pulse_time as uint16_t or we should apply a prescaler for the timer (for stm32F103).

Homing issue: Alarm 7

Has anyone tried homing and knows if it works?

I have limit triggers that I know works with the atmega-version. So the hardware should not be a problem.

When I view "?" output it reports the triggers correctly in all axis.
I have the triggers at a high level and goes to a low when triggered.
As soon as I try the $H it homes the axis and pulls off, but then locks up and reports Alarm 7.

I've tried to enable the safety door, but it does not make a difference.

error:2 annoyed

Every thing works fine and very nice. there are only error:2 and error:11 are annoyed.
By Universal gcode sender shows error:2. So try writing small program in C for only reading serial data to see what, find error:2 and error:11 in my reading loop. these quite weird for me. I try to find what the cause of these problems, but cannot position them.
Can any one help?

coolant flood on PA 9

i try to enable PB3 for a coolant ,and nothingh works,so i assign PA 9 for this function(turn on-off a fan whit M8-M9 commands)i tested ,and allseems work fine,i not have many knowledge about this board,so this is not the way to activate a fan coolant please excuse and let me know the righ way to do that.thank you so much!!!

pinout for cnc laser

sorry to open ticket for my question but actually I've tired to build cnc laser controller with Arduino compatible STF103CT6 board , however I've bit lost to assign the pins to the boards ,little hint really appreciated

expected bug in handling TIM3 (pulse width) in stepper.c

In TIM2_IRQHandler from stepper.c, after DIRECTION pins are written, interrupts on TIM3 are enabled with code
NVIC_EnableIRQ(TIM3_IRQn);
Still, TIM3->CNT is not reset to 0. As TIM3 was not disabled (only reset to 0 by his IRQ handler), CNT can have any value.
So we can't be sure that the step pulse will have the expected delay.
To solve this, I think you have to force a reload of TIM3 registers and clear interrupts just before enabling interrupt again.
So add
TIM3->EGR = TIM_PSCReloadMode_Immediate;
TIM_ClearITPendingBit(TIM3, TIM_IT_Update);
just before
NVIC_EnableIRQ(TIM3_IRQn);

Then, I think also that lines
TIM3->SR &= ~(1<<0); // clear UIF flag
TIM3->CNT = 0;
can be removed from TIM3_IRQHandler

What about a short instruction?

For instance:

  • by default all input pins with pull-up,
  • you can remap CTRL_ pins only within pb5-pb9 (or pa5-pa9),
  • you can remap limit pins only within pb10-pb15 (or pa10-pa15),
  • e.t.c

How to toggle USB VCP and serialport by an IO pin?

USEUSB was defined symbols in configuration, there is still free IO pins left.
It's because I want try ESP8266 websocket connection and keep USB VCP support, toggle it by a jumpper or a switch on the panel. @usbcnc could you support it as enhancement? or the both port working together maybe a good idea?

Compiled on Linux but usb device fails

I managed to compile the project on Linux with gcc and Make but after flashing stm32f103c8t6 with hex file USB fails to enumerate. I tried to use 1.8k resistor from 3.3v to pa12 but that didnt do anything. On other hand generic maple hex uploads and shows fine as USB device even without resistor.

I tried several forks of this project but same thing happens. Am I missing something? Do I need to do something else as well?

CoIDE dont exist but project compiles fine on Linux with eabi toolchain.

Jog command check at line 857 in gcode.c quite weird

My Stm32f103 for Jog is OK, but if look at the code at line 857 in gcode.c. I find it quite not correct for condition check. This finds when I use this parser to make gcode analysis in my project on Linux. I get " invalid jog command error". Please see for the "bit instruction" as below.

if (command_words & ~(bit(MODAL_GROUP_G3) |
bit(MODAL_GROUP_G6 | bit(MODAL_GROUP_G0)) )) ->#note: this is quite not correct
{ FAIL(STATUS_INVALID_JOG_COMMAND) };

Missing files for makefile

Hi, files are missing for making makefile works.
/STM32F103C8T6.ld (linker file)
/build/grbl-stm32.map
Please find included Archive.zip

Additionnally, makefile should refer to the correct buildddir and not debug dir:
BUILDDIR = build

Perhaps an issue with PB3, PB4, PA15

In order to use those pins, the code has to ask a remap of pin and to activate a clock (RCC_APB2Periph_AFIO).

Therefore in main.c you currently have
RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1 | RCC_APB2Periph_GPIOA | RCC_APB2Periph_AFIO, ENABLE);

Still this line is active only if you are using UART1 instead of USB.
Quite similar line of code exist for "limits" and "controls" files but not in stepper.c
So I expect (but not tested it), that it will not be possible to use those pins for step, dir or enable stepper when USB is used instead of uart1.
It would be better to add a line in main.c in order to ALWAYS activate RCC_APB2Periph_AFIO

Spindle enable pin issue

Hello,

for my application I need a separate spindle enable pin. With default settings PB13 is not working as expected. For this reason I uncommented following line in config.h
#define USE_SPINDLE_DIR_AS_ENABLE_PIN
This leads to an compilation error and I had to add "&& !defined(CPU_MAP_STM32F103)" in line 123 in grbl.h
Now it compiles fine and PB13 works as expected.
I just don't know if this is the intended way to do ...

Best regards,
lakeroe

Coolant Flood Bit on GPIOB pin 2

Maybe not such a big deal, but using pin 2 for the coolant bit might not be so good since it's also the boot pin. Perhaps move it?

I'm very new to this architecture so i'm sorry if I'm mistaken.

USB problem on Maple Mini

On Maple mini board, PB9 is used to reset usb port throught a stage with 2 transistors. Unitialised state acts as an output to '1' and drive those transistors, resetting USB port.

Since PB9 is unused on current pin mapping, it coulb be initialsed ans output to 0, and leaved as is...
I've tested in main loop. Maple mini is properly enumarated on USB now.

....
#else
int main(void)
#endif
{#if defined (STM32F103C8)
	GPIO_InitTypeDef GPIO_InitStructure;
#ifdef LEDBLINK
	RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC, ENABLE);
	GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
	GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
	GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13;
	GPIO_Init(GPIOC, &GPIO_InitStructure);     
#endif

	// init PB9 as out port for maple mini
	RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE);
	GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
	GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
	GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9;
	GPIO_Init(COOLANT_FLOOD_PORT, &GPIO_InitStructure);
	GPIO_WriteBit(GPIOB, GPIO_Pin_9, Bit_RESET);
....

It seems that this fork does not support STEP_PULSE_DELAY

Normal (AVR) GRBL code supports #define STEP_PULSE_DELAY (in stepper.c)
This parameter allows to add a delay between setting the DIRECTION pins and the start of the STEP pulse in the stepper.c file.
This can be important because many stepper drivers ask for such a delay.
I would like to use some cheap clone of TB6600 drivers and I noticed that the used optocoupler on the DIR signal is much lower than the optocoupler on the STEP signal. I expect I need a delay of about 10usec to let the driver get the right direction when the pulse start.

Do you plan to support this parameter in the future?

Note: I think it could be done without using a new timer, just by using an interrupt on a compare of an existing timer.

Thanks in advance for your reply.

chip name problem

did not find stm32f103c8 chip in coide 2.0.6 (Build id: 20170117-2.0.6). Which version do you use? I suppose it have to be stm32f103c8t6 to work well.
2017-02-16_11-26-07
2017-02-16_11-26-22
my other projects in stm32f103c8t6 (the board is the same as yours) are opened and work.

Question: does it have better performace then the avr version?

Hello,

I have a few stm32f1 around but i am in doubt if them would perform really better then the avr

From your account i see that you made both the mega version then this. Which is your experience about? The more powerful stm32 outperform the tiny 8bit? Which would you suggest for a new design?

Strange errors if "Hard limits" are enabled

I've always had strange errors in bCNC when zeroing X, Y or Z axis or pressing the stop button several times in a row. The errors only happen if "Hard limits" are enabled ($21=1). After some debugging I found that EXTI15_10_IRQHandler() in limits.c gets triggered although it should not. I think the problem is somehow related to USB connected to pins PA11/PA12 and the Y/Z limit switches connected to PB11/PB12. After changing the Y/Z limit switches to PA1/9 the problem is gone.

So maybe that's worth some more debugging ...

Small bug found (I think)

I've found a small bug resulting in a slightly different behaviour than the original GRBL.
In system.c (line 480) "sys_rt_exec_alarm |= (code);" has to be changed to "sys_rt_exec_alarm = (code);"

@usbcnc
Do you mind making this change and also my other findings (#29, #36, #38) to your GitHub repository ?
Otherwise they are not very useful ...

This still needs some more investigations: #39

Best regards,
lakeroe

Direction Pins beyond 7

Mapping direction pins to pins higher than 7 doesn't work.
The following changes will fix this:
planner.h, line 63
uint8_t direction_bits; --> PORTPINDEF direction_bits;
stepper.c, line 106
uint8_t direction_bits; --> PORTPINDEF direction_bits;

best regards
thkais

Probing ALARM:PROBE

Hi,

I try to solve this problem now for one and a half days. I designed my own CNC machine and homeing it is no problem. But when I start UGS it gives me an ALARM:PROBE but my Probe is not probing nor touching anything to close a circuit.

image

When I start probing (after homing, repositioning to my workpice and putting the axes to 0) I get a bunch of errors.

image

image

I tried different versions of UGS, tried to invert the probe pin. A pull down resistor is not needed (I read it in several forums but maybe I am mistaken?). I followed this tutorial.

I use an STM103 (source code) and no Arduino as a controller for grbl. When I put the Probing pin to Ground the error goes away and I can start probing.

Here are my settings:

$0 = 64    (Step pulse time, microseconds)
$1 = 0    (Step idle delay, milliseconds)
$2 = 7    (Step pulse invert, mask)
$3 = 7    (Step direction invert, mask)
$4 = 0    (Invert step enable pin, boolean)
$5 = 0    (Invert limit pins, boolean)
$6 = 0    (Invert probe pin, boolean)
$10 = 0    (Status report options, mask)
$11 = 0.010    (Junction deviation, millimeters)
$12 = 0.002    (Arc tolerance, millimeters)
$13 = 0    (Report in inches, boolean)
$20 = 0    (Soft limits enable, boolean)
$21 = 1    (Hard limits enable, boolean)
$22 = 1    (Homing cycle enable, boolean)
$23 = 0    (Homing direction invert, mask)
$24 = 25.000    (Homing locate feed rate, mm/min)
$25 = 500.000    (Homing search seek rate, mm/min)
$26 = 250    (Homing switch debounce delay, milliseconds)
$27 = 4.000    (Homing switch pull-off distance, millimeters)
$30 = 10    (Maximum spindle speed, RPM)
$31 = 0    (Minimum spindle speed, RPM)
$32 = 0    (Laser-mode enable, boolean)
$100 = 640.000    (X-axis travel resolution, step/mm)
$101 = 640.000    (Y-axis travel resolution, step/mm)
$102 = 640.000    (Z-axis travel resolution, step/mm)
$110 = 600.000    (X-axis maximum rate, mm/min)
$111 = 600.000    (Y-axis maximum rate, mm/min)
$112 = 600.000    (Z-axis maximum rate, mm/min)
$120 = 40.000    (X-axis acceleration, mm/sec^2)
$121 = 40.000    (Y-axis acceleration, mm/sec^2)
$122 = 40.000    (Z-axis acceleration, mm/sec^2)
$130 = 250.000    (X-axis maximum travel, millimeters)
$131 = 150.000    (Y-axis maximum travel, millimeters)
$132 = 90.000    (Z-axis maximum travel, millimeters)

MANY Thanks and have a nice day.

Missing STM32F103C8T6.ld

I've tried to build code from repository (using make), but build process fails because of missing file. Where I can find it? And, perhaps, it worth to include it in order to enable building without IDE. This is especially important taking into account that CooCox is not working under OS'es other than Windows.

reset button

If you press the reset button during the G4 delay (idle state), this will not stop the program execution.
motion-control.c

// Kill steppers only if in any motion state, i.e. cycle, actively holding, or homing.
// NOTE: If steppers are kept enabled via the step idle delay setting, this also keeps
// the steppers enabled by avoiding the go_idle call altogether, unless the motion state is
// violated, by which, all bets are off.
if ((sys.state & (STATE_CYCLE | STATE_HOMING | STATE_JOG)) ||
(sys.step_control & (STEP_CONTROL_EXECUTE_HOLD | STEP_CONTROL_EXECUTE_SYS_MOTION))) {
if (sys.state == STATE_HOMING) {
if (!sys_rt_exec_alarm) {system_set_exec_alarm(EXEC_ALARM_HOMING_FAIL_RESET); }
} else { system_set_exec_alarm(EXEC_ALARM_ABORT_CYCLE); }
st_go_idle(); // Force kill steppers. Position has likely been lost.

}

Additional A B C axis

Hello!
I've added additional axes.
The 4 axles work! 5 and 6 havn't checked yet.
So far, it has not done thorough testing (including limits, max step frec etc.).
I would like to clarify where the delay time (the frequency of updating the output STEP signals) is set (tune), because 4 axes output frequency will be lower than for 3 axis, and for 6 - more lower, right?
So, where can I change maximum step rate (sampling rate)?, for example, set the maximum output frequency for 4 axes two times lower (90kHz) than now for 3 axis (180kHz), to be sure that all operations will succeed.
One more question: whether it is necessary to expand any buffers, if so, which ones.
In the attachment, a project with modifications for 4 axes (without "grblwin" folder because of it size).
In the config.h (line 51) - // Define additional A, B and C axis

Sincerely, Yaroslav.
grbl-edge ABC.zip

2017-05-04 00-57-39

The code does not allow to modify the pins used for limits (and control)

Pins used for detecting limits on X,YZ trigger interrupts. The interrupts are linked to a specific NVIC_IRQChannel (EXTI15_10_IRQn ).
So all 3 pins have to be in the range 10 to 15.

This should be at least documented in cpu_map.h.

A similar issue exists for pins used for controls (range must be 5 to 9).

I found this issue when I had to redefine the pins used for step/dir/enable because I had to use 5 volt compliant pins for the stepper drivers I am using .

Wrong link to the releases in the home page

Link to the releases (on the home page) will redirect you to the original gnea/grbl releases - not to the releases of this project. It is quite misleading...

However, no releases in this project... :-)

Hex file or other compiled binary will be good as CooCox IDE is only for Windows. Linux users cannot compile this project simply.

RPM

Is there any way to add an IR sensor that can use one of the pins and to display the RPM of the spindle?
Thank you.

Possible incompatibility with Coide 2.0.6

I tried to build project with CoIDE 2.06, since 2.x is now the main download.

stm32grbl11d.coproj needs to be adapted because Coide needs now complete device name : "STM32F103C8T6" instead of "STM32F103C8" for 1.x version .

Changes must be done at 2 places in the file, and needs to be edited BEFORE opening it with CoIDE.
Defines section needs also to be adated by ADDING (not replacing) a -DSTM32F103C8T6 .

Now the project builds.. but USB is not enumerated as serial port. I need to compare with a build done with 1.x.

My Sample project file is included, but needs further testing.

grbl-stm32.zip

ADDITIONAL 4th AXIS and other changes

Changes

  1. 4th axis was added (tested)
  2. grbl.h issue#36 (not tested)
  3. main.c issue#38 (tested)
  4. planner.h issue#41
  5. probe.c uint16_t probe_invert_mask
  6. serial.c, serial.h, usb_endp.c issue#46 now can use old and changed code by chooseing #define USB_CHANGED_DEBUG in serial.h (tested not in depth)
  7. system.c issue#40
  8. system.c EXTI_InitStructure.EXTI_Trigger is Rising_Falling instead of EXTI_Trigger_Falling (for NC and NO buttons. Need more tests)
  9. stepper.c issue#41
  10. stepper.c issue#49
  11. stepper.c (config.h) NEW: STP_DRIVERS_ENABLE_DELAY (tested. see description in config.h)
  12. stepper.c (config.h) issue#48 STEP_PULSE_DELAY now works (tested, but need more tests)
  13. stepper.c issue#50 (tested)
  14. system.c GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable, ENABLE); // to enable PA15, PB3, PB4 pins (tested)

LedBlink does not work

LedBlink function in main() doens not seems to be called anywhere, so led stays off...

door, reset, feed hold and start inputs doesn't work

system.c
WORK (modified code):

void EXTI9_5_IRQHandler(void)
{
	EXTI_ClearITPendingBit(EXTI_Line5 | EXTI_Line6 | EXTI_Line7 | EXTI_Line8);
	uint8_t pin = system_control_get_state();
	if (pin)
	{
		if (bit_istrue(pin,CONTROL_PIN_INDEX_RESET))
		{
			mc_reset();
		}
		else if (bit_istrue(pin, CONTROL_PIN_INDEX_CYCLE_START))
		{
			bit_true(sys_rt_exec_state, EXEC_CYCLE_START);
		}
		else if (bit_istrue(pin, CONTROL_PIN_INDEX_FEED_HOLD))
		{
			bit_true(sys_rt_exec_state, EXEC_FEED_HOLD);
		}
#ifdef ENABLE_SAFETY_DOOR_INPUT_PIN
		else if (bit_istrue(pin, CONTROL_PIN_INDEX_SAFETY_DOOR))
		{
			bit_true(sys_rt_exec_state, EXEC_SAFETY_DOOR);
		}
#endif
		NVIC_ClearPendingIRQ(EXTI9_5_IRQn);
	}
}

doesn't work (The original version):

void EXTI9_5_IRQHandler(void)
{
	uint8_t pin = system_control_get_state();
	if (pin) 
	{ 
		if (bit_istrue(pin,CONTROL_PIN_INDEX_RESET)) 
		{
			mc_reset();
		}
		else if (bit_istrue(pin, CONTROL_PIN_INDEX_CYCLE_START))
		{
			bit_true(sys_rt_exec_state, EXEC_CYCLE_START);
		}
#ifndef ENABLE_SAFETY_DOOR_INPUT_PIN
		else if (bit_istrue(pin, CONTROL_PIN_INDEX_FEED_HOLD))
		{
			bit_true(sys_rt_exec_state, EXEC_FEED_HOLD);
		}
#else
		else if (bit_istrue(pin, CONTROL_PIN_INDEX_SAFETY_DOOR))
		{
			bit_true(sys_rt_exec_state, EXEC_SAFETY_DOOR);
		}
#endif
		NVIC_ClearPendingIRQ(EXTI9_5_IRQn);
}
}

G-Code G4 not working correctly

In my application the G-Code "G4 P3" did not work correctly.
I think the problem is caused by the _delay_ms function in main.c.
If I change line 196 from
SysTick->LOAD = (u32)72000000 / 8000; // Loading time

to
SysTick->LOAD = (u32)72000000 / 8000 * x; // Loading time

everything works fine.

Best regards,
lakeroe

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.