Minor fixes
Backlash dir mask #37 Spindle enable #41 Compiler fix for gcc-9 Tweaked some values Reorganized filespull/89/head
|
@ -217,10 +217,10 @@
|
|||
<Option compilerVar="CC" />
|
||||
</Unit>
|
||||
<Unit filename="HAL\USART\FIFO_USART.h" />
|
||||
<Unit filename="HAL\USART\USART.c">
|
||||
<Unit filename="HAL\USART\Usart.c">
|
||||
<Option compilerVar="CC" />
|
||||
</Unit>
|
||||
<Unit filename="HAL\USART\USART.h" />
|
||||
<Unit filename="HAL\USART\Usart.h" />
|
||||
<Unit filename="Libraries\CRC\CRC.c">
|
||||
<Option compilerVar="CC" />
|
||||
</Unit>
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
*/
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm32f4xx_it.h"
|
||||
#include "USART.h"
|
||||
#include "Usart.h"
|
||||
#include "FIFO_USART.h"
|
||||
#include "Limits.h"
|
||||
#include "Stepper.h"
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "USART.h"
|
||||
#include "Usart.h"
|
||||
|
||||
|
||||
/* Queue structure */
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
along with STM32F4_HAL. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include "USART.h"
|
||||
#include "Usart.h"
|
||||
#include "FIFO_USART.h"
|
||||
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include "ServerTCP.h"
|
||||
#include "Platform.h"
|
||||
#include "Print.h"
|
||||
#include "USART.h"
|
||||
#include "Usart.h"
|
||||
#include <string.h>
|
||||
|
||||
|
||||
|
|
8
Makefile
|
@ -33,7 +33,7 @@ INCLUDES := $(SOURCES) SPL/inc
|
|||
#---------------------------------------------------------------------------------
|
||||
# options for code generation
|
||||
#---------------------------------------------------------------------------------
|
||||
FLAGS := -mfloat-abi=hard -mcpu=cortex-m4 -gdwarf-2 -mfpu=fpv4-sp-d16 -mthumb
|
||||
FLAGS := -mfloat-abi=hard -mcpu=cortex-m4 -gdwarf-2 -mfpu=fpv4-sp-d16 -mthumb -Wno-misleading-indentation
|
||||
CFLAGS := -O2 -g1 -std=c11 -Wall -Wextra $(INCLUDE) -fno-common -fsingle-precision-constant -fdata-sections -ffunction-sections -fomit-frame-pointer -mlittle-endian -DUSE_STDPERIPH_DRIVER -DSTM32F411xE -DSTM32F411RE -D__FPU_USED -DARM_MATH_CM4 -Wimplicit-fallthrough=0
|
||||
CXXFLAGS := $(CFLAGS)
|
||||
|
||||
|
@ -97,11 +97,11 @@ export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib)
|
|||
|
||||
export OUTPUT := $(CURDIR)/$(TARGET)
|
||||
|
||||
.PHONY: $(BUILD) clean flash
|
||||
.PHONY: all clean flash
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
$(BUILD):
|
||||
@[ -d $@ ] || mkdir -p $@
|
||||
all:
|
||||
@[ -d $(BUILD) ] || mkdir -p $(BUILD)
|
||||
@make --no-print-directory -C $(BUILD) $(OUTPUT).elf $(OUTPUT).bin $(OUTPUT).hex $(OUTPUT).lst -f $(CURDIR)/Makefile -j2
|
||||
@$(SIZE) $(OUTPUT).elf
|
||||
|
||||
|
|
20
README.md
|
@ -1,4 +1,4 @@
|
|||
![GitHub Logo](https://github.com/Schildkroet/GRBL-Advanced/blob/software/en.nucleo-F4.jpg?raw=true)
|
||||
![GitHub Logo](https://github.com/Schildkroet/GRBL-Advanced/blob/software/doc/en.nucleo-F4.jpg?raw=true)
|
||||
|
||||
***
|
||||
Grbl-Advanced is a no-compromise, high performance, low cost alternative for CNC milling. This version of Grbl-Advanced runs on a STM32F411 Nucleo Board.
|
||||
|
@ -38,12 +38,12 @@ Uses Dynamic TLO when $14=2
|
|||
|
||||
#### I2C EEPROM
|
||||
Added support for external EEPROM (e.g. ST M24C08). Uncomment 'USE_EXT_EEPROM' in Config.h.
|
||||
![EEPROM](https://github.com/Schildkroet/GRBL-Advanced/blob/software/eeprom.png?raw=true)
|
||||
![EEPROM](https://github.com/Schildkroet/GRBL-Advanced/blob/software/doc/eeprom.png?raw=true)
|
||||
|
||||
#### ETHERNET Support
|
||||
GRBL-Advanced can be controlled with USB or ETHERNET. For ETHERNET an additional W5500 Module is required. Then uncomment ETH_IF in Platform.h. The default IP Address is 192.168.1.20.
|
||||
Use [Candle 2](https://github.com/Schildkroet/Candle2) as control interface.
|
||||
![W5500](https://github.com/Schildkroet/GRBL-Advanced/blob/software/w5500.png?raw=true)
|
||||
![W5500](https://github.com/Schildkroet/GRBL-Advanced/blob/software/doc/w5500.png?raw=true)
|
||||
|
||||
#### Attention
|
||||
By default, settings are stored in internal flash memory in last sector. First startup takes about 5-10sec to write all settings.
|
||||
|
@ -62,7 +62,7 @@ By default, settings are stored in internal flash memory in last sector. First s
|
|||
* 96 MHz CPU frequency
|
||||
* 512 KB Flash
|
||||
* 128 KB SRAM
|
||||
---
|
||||
|
||||
* [STM32 Nucleo F446RE](https://www.st.com/en/evaluation-tools/nucleo-f446re.html)
|
||||
* STM32F446RE in LQFP64 package
|
||||
* ARM®32-bit Cortex®-M4 CPU with FPU
|
||||
|
@ -81,8 +81,16 @@ By default, settings are stored in internal flash memory in last sector. First s
|
|||
* Flash HEX created in bin/Release
|
||||
|
||||
#### Linux
|
||||
* Install Build Essentials, [GNU ARM Embedded Toolchain](https://developer.arm.com/open-source/gnu-toolchain/gnu-rm) and [texane st-util](https://github.com/texane/stlink)
|
||||
* Run 'make' and 'make flash' in Terminal
|
||||
* Download [GNU ARM Embedded Toolchain](https://developer.arm.com/open-source/gnu-toolchain/gnu-rm)) and unpack it to /opt. In makefile update path to toolchain.
|
||||
* Run following commands:
|
||||
```
|
||||
sudo apt install build-essential stlink-tools
|
||||
```
|
||||
* Clone repository and run following commands:
|
||||
```
|
||||
make clean
|
||||
make all flash
|
||||
```
|
||||
|
||||
***
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include <string.h>
|
||||
#include "Print.h"
|
||||
#include "Config.h"
|
||||
#include "USART.h"
|
||||
#include "Usart.h"
|
||||
#include "FIFO_USART.h"
|
||||
#include "Settings.h"
|
||||
#include "GrIP.h"
|
||||
|
|
Przed Szerokość: | Wysokość: | Rozmiar: 58 KiB Po Szerokość: | Wysokość: | Rozmiar: 58 KiB |
Przed Szerokość: | Wysokość: | Rozmiar: 161 KiB Po Szerokość: | Wysokość: | Rozmiar: 161 KiB |
Przed Szerokość: | Wysokość: | Rozmiar: 486 KiB Po Szerokość: | Wysokość: | Rozmiar: 486 KiB |
Przed Szerokość: | Wysokość: | Rozmiar: 422 KiB Po Szerokość: | Wysokość: | Rozmiar: 422 KiB |
Przed Szerokość: | Wysokość: | Rozmiar: 180 KiB Po Szerokość: | Wysokość: | Rozmiar: 180 KiB |
|
@ -399,7 +399,7 @@
|
|||
// correction with expensive sin() and cos() calcualtions. This parameter maybe decreased if there
|
||||
// are issues with the accuracy of the arc generations, or increased if arc execution is getting
|
||||
// bogged down by too many trig calculations.
|
||||
#define N_ARC_CORRECTION 6 // Integer (1-255)
|
||||
#define N_ARC_CORRECTION 4 // Integer (1-255)
|
||||
|
||||
|
||||
// The arc G2/3 g-code standard is problematic by definition. Radius-based arcs have horrible numerical
|
||||
|
|
|
@ -1798,6 +1798,9 @@ uint8_t GC_ExecuteLine(char *line)
|
|||
Spindle_SetState(SPINDLE_DISABLE, 0.0);
|
||||
Coolant_SetState(COOLANT_DISABLE);
|
||||
}
|
||||
// Reset tool change - May not be in accordance with LinuxCNC
|
||||
TC_Init();
|
||||
|
||||
Report_FeedbackMessage(MESSAGE_PROGRAM_END);
|
||||
}
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ void MC_Init(void)
|
|||
{
|
||||
for(uint8_t i = 0; i < N_AXIS; i++)
|
||||
{
|
||||
dir_negative[i] = DIR_NEGATIV ^ (settings.homing_dir_mask & (1<<i));
|
||||
dir_negative[i] = (settings.homing_dir_mask >> i) & 0x1;
|
||||
}
|
||||
|
||||
MC_SyncBacklashPosition();
|
||||
|
@ -351,6 +351,8 @@ void MC_Dwell(float seconds)
|
|||
// executing the homing cycle. This prevents incorrect buffered plans after homing.
|
||||
void MC_HomigCycle(uint8_t cycle_mask)
|
||||
{
|
||||
Stepper_WakeUp();
|
||||
|
||||
// Check and abort homing cycle, if hard limits are already enabled. Helps prevent problems
|
||||
// with machines with limits wired on both ends of travel to one limit pin.
|
||||
// TODO: Move the pin-specific LIMIT_PIN call to limits.c as a function.
|
||||
|
|
|
@ -173,6 +173,12 @@ void Spindle_SetState(uint8_t state, float rpm)
|
|||
GPIO_SetBits(GPIO_SPINDLE_DIR_PORT, GPIO_SPINDLE_DIR_PIN);
|
||||
}
|
||||
|
||||
#ifdef INVERT_SPINDLE_ENABLE_PIN
|
||||
GPIO_ResetBits(GPIO_SPINDLE_ENA_PORT, GPIO_SPINDLE_ENA_PIN);
|
||||
#else
|
||||
GPIO_SetBits(GPIO_SPINDLE_ENA_PORT, GPIO_SPINDLE_ENA_PIN);
|
||||
#endif
|
||||
|
||||
// NOTE: Assumes all calls to this function is when Grbl is not moving or must remain off.
|
||||
if(settings.flags & BITFLAG_LASER_MODE) {
|
||||
if(state == SPINDLE_ENABLE_CCW) {
|
||||
|
|
|
@ -69,7 +69,7 @@
|
|||
#ifdef MAX_STEP_RATE_HZ
|
||||
#define STEP_TIMER_MIN (uint16_t)(F_TIMER_STEPPER / MAX_STEP_RATE_HZ)
|
||||
#else
|
||||
#define STEP_TIMER_MIN (uint16_t)((F_TIMER_STEPPER / 60000))
|
||||
#define STEP_TIMER_MIN (uint16_t)((F_TIMER_STEPPER / 90000))
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -395,7 +395,7 @@ void Stepper_MainISR(void)
|
|||
st.exec_segment = &segment_buffer[segment_buffer_tail];
|
||||
|
||||
// Initialize step segment timing per step and load number of steps to execute.
|
||||
// Limit ISR to 50 KHz
|
||||
// Limit ISR frequency
|
||||
if(st.exec_segment->cycles_per_tick < STEP_TIMER_MIN) {
|
||||
st.exec_segment->cycles_per_tick = STEP_TIMER_MIN;
|
||||
}
|
||||
|
|
|
@ -490,7 +490,7 @@ void System_FlagWcoChange(void)
|
|||
// serves as a central place to compute the transformation.
|
||||
float System_ConvertAxisSteps2Mpos(const int32_t *steps, const uint8_t idx)
|
||||
{
|
||||
float pos;
|
||||
float pos = 0.0;
|
||||
|
||||
#ifdef COREXY
|
||||
if(idx == X_AXIS) {
|
||||
|
@ -503,7 +503,11 @@ float System_ConvertAxisSteps2Mpos(const int32_t *steps, const uint8_t idx)
|
|||
pos = steps[idx]/settings.steps_per_mm[idx];
|
||||
}
|
||||
#else
|
||||
pos = steps[idx]/settings.steps_per_mm[idx];
|
||||
if(settings.steps_per_mm[idx] != 0)
|
||||
{
|
||||
pos = steps[idx] / settings.steps_per_mm[idx];
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
return pos;
|
||||
|
|
|
@ -29,6 +29,9 @@
|
|||
#include "defaults.h"
|
||||
|
||||
|
||||
#define TOOL_SENSOR_OFFSET 70.0 // mm
|
||||
|
||||
|
||||
static uint8_t isFirstTC = 1;
|
||||
static int32_t toolOffset = 0;
|
||||
static int32_t toolReferenz = 0;
|
||||
|
@ -119,7 +122,7 @@ void TC_ProbeTLS(void)
|
|||
MC_Line(position, &pl_data);
|
||||
|
||||
// Move down with offset (for tool)
|
||||
position[Z_AXIS] = (settings.tls_position[Z_AXIS] / settings.steps_per_mm[Z_AXIS]) + 90.0;
|
||||
position[Z_AXIS] = (settings.tls_position[Z_AXIS] / settings.steps_per_mm[Z_AXIS]) + TOOL_SENSOR_OFFSET;
|
||||
MC_Line(position, &pl_data);
|
||||
|
||||
// Wait until queue is processed
|
||||
|
|
|
@ -78,7 +78,6 @@
|
|||
#define DEFAULT_HOMING_DEBOUNCE_DELAY 250 // msec (0-65k)
|
||||
#define DEFAULT_HOMING_PULLOFF 1.0 // mm
|
||||
#define DEFAULT_TOOL_CHANGE_MODE 0 // 0 = Ignore M6; 1 = Manual tool change; 2 = Manual tool change + TLS
|
||||
#define DEFAULT_TOOL_SENSOR_OFFSET 100.0 // mm
|
||||
#endif
|
||||
|
||||
|
||||
|
|