From 58ad1ba50933ef048b62552504408bed54f81eb0 Mon Sep 17 00:00:00 2001 From: Simen Svale Skogsrud Date: Thu, 4 Mar 2010 21:18:55 +0100 Subject: [PATCH] minor edits after verifying refactored grbl on real hardware --- Makefile | 2 +- config.h | 11 ++++++----- gcode/braid_cut2d.gcode | 2 +- main.c | 1 + motion_control.c | 1 - script/stream | 2 +- stepper.c | 31 ++++++++++++++----------------- 7 files changed, 24 insertions(+), 26 deletions(-) diff --git a/Makefile b/Makefile index b2eab6a..36073c0 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ DEVICE = atmega168 CLOCK = 16000000 PROGRAMMER = -c avrisp2 -P usb -OBJECTS = main.o motion_control.o gcode.o spindle_control.o wiring_serial.o serial_protocol.o stepper.o +OBJECTS = main.o motion_control.o gcode.o spindle_control.o wiring_serial.o serial_protocol.o stepper.o FUSES = -U hfuse:w:0xd9:m -U lfuse:w:0x24:m # Tune the lines below only if you know what you are doing: diff --git a/config.h b/config.h index c34171f..f772f37 100644 --- a/config.h +++ b/config.h @@ -23,9 +23,10 @@ #define VERSION "0.5" -#define X_STEPS_PER_MM (94.488188976378*16) -#define Y_STEPS_PER_MM (94.488188976378*16) -#define Z_STEPS_PER_MM (94.488188976378*16) +#define MICROSTEPS 8 +#define X_STEPS_PER_MM (94.488188976378*MICROSTEPS) +#define Y_STEPS_PER_MM (94.488188976378*MICROSTEPS) +#define Z_STEPS_PER_MM (94.488188976378*MICROSTEPS) #define STEP_PULSE_MICROSECONDS 30 @@ -74,12 +75,12 @@ #define LIMIT_MASK ((1<steps_x = labs(steps_x); line->steps_y = labs(steps_y); @@ -83,28 +82,26 @@ void st_buffer_line(int32_t steps_x, int32_t steps_y, int32_t steps_z, uint32_t TIMSK1 |= (1<rate); - counter_x = -(current_line->maximum_steps/2); + counter_x = -(current_line->maximum_steps >> 1); counter_y = counter_x; counter_z = counter_x; iterations = current_line->maximum_steps; @@ -213,7 +210,7 @@ void st_flush() sei(); } -// Configures the prescaler and ceiling of timer 1 to produce the given pace as accurately as possible. +// Configures the prescaler and ceiling of timer 1 to produce the given rate as accurately as possible. void config_step_timer(uint32_t microseconds) { uint32_t ticks = microseconds*TICKS_PER_MICROSECOND;