2011-02-05 00:55:37 +01:00
|
|
|
/*
|
|
|
|
config.h - compile time configuration
|
|
|
|
Part of Grbl
|
|
|
|
|
|
|
|
Copyright (c) 2009-2011 Simen Svale Skogsrud
|
2011-09-24 15:46:41 +02:00
|
|
|
Copyright (c) 2011 Sungeun K. Jeon
|
2011-02-05 00:55:37 +01:00
|
|
|
|
|
|
|
Grbl is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
Grbl is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with Grbl. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef config_h
|
|
|
|
#define config_h
|
|
|
|
|
2011-09-24 15:46:41 +02:00
|
|
|
// IMPORTANT: Any changes here requires a full re-compiling of the source code to propagate them.
|
|
|
|
|
2011-02-05 00:55:37 +01:00
|
|
|
#define BAUD_RATE 9600
|
|
|
|
|
2011-12-09 02:47:48 +01:00
|
|
|
// Define pin-assignments
|
2011-05-31 13:08:42 +02:00
|
|
|
#define STEPPERS_DISABLE_DDR DDRB
|
|
|
|
#define STEPPERS_DISABLE_PORT PORTB
|
|
|
|
#define STEPPERS_DISABLE_BIT 0
|
2011-02-05 00:55:37 +01:00
|
|
|
|
|
|
|
#define STEPPING_DDR DDRD
|
|
|
|
#define STEPPING_PORT PORTD
|
|
|
|
#define X_STEP_BIT 2
|
|
|
|
#define Y_STEP_BIT 3
|
|
|
|
#define Z_STEP_BIT 4
|
|
|
|
#define X_DIRECTION_BIT 5
|
|
|
|
#define Y_DIRECTION_BIT 6
|
|
|
|
#define Z_DIRECTION_BIT 7
|
|
|
|
|
|
|
|
#define LIMIT_DDR DDRB
|
2011-02-20 00:29:56 +01:00
|
|
|
#define LIMIT_PIN PINB
|
2011-02-05 00:55:37 +01:00
|
|
|
#define X_LIMIT_BIT 1
|
|
|
|
#define Y_LIMIT_BIT 2
|
|
|
|
#define Z_LIMIT_BIT 3
|
|
|
|
|
|
|
|
#define SPINDLE_ENABLE_DDR DDRB
|
|
|
|
#define SPINDLE_ENABLE_PORT PORTB
|
|
|
|
#define SPINDLE_ENABLE_BIT 4
|
|
|
|
|
|
|
|
#define SPINDLE_DIRECTION_DDR DDRB
|
|
|
|
#define SPINDLE_DIRECTION_PORT PORTB
|
|
|
|
#define SPINDLE_DIRECTION_BIT 5
|
|
|
|
|
2011-12-09 02:47:48 +01:00
|
|
|
// Define runtime command special characters. These characters are 'picked-off' directly from the
|
|
|
|
// serial read data stream and are not passed to the grbl line execution parser. Select characters
|
|
|
|
// that do not and must not exist in the streamed g-code program. ASCII control characters may be
|
|
|
|
// used, if they are available per user setup.
|
|
|
|
// TODO: Solidify these default characters. Temporary for now.
|
|
|
|
#define CMD_STATUS_REPORT '?'
|
|
|
|
#define CMD_FEED_HOLD '!'
|
|
|
|
#define CMD_CYCLE_START '~'
|
|
|
|
#define CMD_RESET 0x18 // ctrl-x
|
|
|
|
|
2011-09-30 00:25:48 +02:00
|
|
|
// This parameter sets the delay time before disabling the steppers after the final block of movement.
|
|
|
|
// A short delay ensures the steppers come to a complete stop and the residual inertial force in the
|
|
|
|
// CNC axes don't cause the axes to drift off position. This is particularly important when manually
|
|
|
|
// entering g-code into grbl, i.e. locating part zero or simple manual machining. If the axes drift,
|
|
|
|
// grbl has no way to know this has happened, since stepper motors are open-loop control. Depending
|
|
|
|
// on the machine, this parameter may need to be larger or smaller than the default time.
|
2011-10-07 07:14:21 +02:00
|
|
|
// NOTE: If defined 0, the delay will not be compiled.
|
|
|
|
#define STEPPER_IDLE_LOCK_TIME 25 // (milliseconds) - Integer >= 0
|
2011-09-30 00:25:48 +02:00
|
|
|
|
|
|
|
// The temporal resolution of the acceleration management subsystem. Higher number give smoother
|
|
|
|
// acceleration but may impact performance.
|
2011-09-24 15:46:41 +02:00
|
|
|
// NOTE: Increasing this parameter will help any resolution related issues, especially with machines
|
|
|
|
// requiring very high accelerations and/or very fast feedrates. In general, this will reduce the
|
|
|
|
// error between how the planner plans the motions and how the stepper program actually performs them.
|
|
|
|
// However, at some point, the resolution can be high enough, where the errors related to numerical
|
|
|
|
// round-off can be great enough to cause problems and/or it's too fast for the Arduino. The correct
|
|
|
|
// value for this parameter is machine dependent, so it's advised to set this only as high as needed.
|
|
|
|
// Approximate successful values can range from 30L to 100L or more.
|
|
|
|
#define ACCELERATION_TICKS_PER_SECOND 50L
|
|
|
|
|
|
|
|
// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end
|
|
|
|
// of the buffer and all stops. This should not be much greater than zero and should only be changed
|
|
|
|
// if unwanted behavior is observed on a user's machine when running at very slow speeds.
|
|
|
|
#define MINIMUM_PLANNER_SPEED 0.0 // (mm/min)
|
|
|
|
|
2011-10-07 07:14:21 +02:00
|
|
|
// Minimum stepper rate. Sets the absolute minimum stepper rate in the stepper program and never runs
|
2011-09-24 15:46:41 +02:00
|
|
|
// slower than this value, except when sleeping. This parameter overrides the minimum planner speed.
|
|
|
|
// This is primarily used to guarantee that the end of a movement is always reached and not stop to
|
|
|
|
// never reach its target. This parameter should always be greater than zero.
|
|
|
|
#define MINIMUM_STEPS_PER_MINUTE 800 // (steps/min) - Integer value only
|
|
|
|
|
2011-10-07 07:14:21 +02:00
|
|
|
// Number of arc generation iterations by small angle approximation before exact arc trajectory
|
|
|
|
// correction. This parameter maybe decreased if there are issues with the accuracy of the arc
|
|
|
|
// generations. In general, the default value is more than enough for the intended CNC applications
|
|
|
|
// of grbl, and should be on the order or greater than the size of the buffer to help with the
|
|
|
|
// computational efficiency of generating arcs.
|
|
|
|
#define N_ARC_CORRECTION 25 // Integer (1-255)
|
2011-02-05 00:55:37 +01:00
|
|
|
|
2011-12-09 02:47:48 +01:00
|
|
|
// Time delay increments performed during a dwell. The default value is set at 50ms, which provides
|
|
|
|
// a maximum time delay of roughly 55 minutes, more than enough for most any application. Increasing
|
|
|
|
// this delay will increase the maximum dwell time linearly, but also reduces the responsiveness of
|
|
|
|
// run-time command executions, like status reports, since these are performed between each dwell
|
|
|
|
// time step. Also, keep in mind that the Arduino delay timer is not very accurate for long delays.
|
|
|
|
#define DWELL_TIME_STEP 50 // Integer (milliseconds)
|
2011-02-05 00:55:37 +01:00
|
|
|
|
2011-12-09 02:47:48 +01:00
|
|
|
#endif
|