Guest User

Untitled

a guest
Mar 13th, 2016
1,737
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.   config.h - compile time configuration
  3.   Part of Grbl
  4.  
  5.   Copyright (c) 2012-2015 Sungeun K. Jeon
  6.   Copyright (c) 2009-2011 Simen Svale Skogsrud
  7.  
  8.   Grbl is free software: you can redistribute it and/or modify
  9.   it under the terms of the GNU General Public License as published by
  10.   the Free Software Foundation, either version 3 of the License, or
  11.   (at your option) any later version.
  12.  
  13.   Grbl is distributed in the hope that it will be useful,
  14.   but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16.   GNU General Public License for more details.
  17.  
  18.   You should have received a copy of the GNU General Public License
  19.   along with Grbl.  If not, see <http://www.gnu.org/licenses/>.
  20. */
  21.  
  22. // This file contains compile-time configurations for Grbl's internal system. For the most part,
  23. // users will not need to directly modify these, but they are here for specific needs, i.e.
  24. // performance tuning or adjusting to non-typical machines.
  25.  
  26. // IMPORTANT: Any changes here requires a full re-compiling of the source code to propagate them.
  27.  
  28. #ifndef config_h
  29. #define config_h
  30. #include "grbl.h" // For Arduino IDE compatibility.
  31.  
  32.  
  33. // Default settings. Used when resetting EEPROM. Change to desired name in defaults.h
  34. #define DEFAULTS_GENERIC
  35.  
  36. // Serial baud rate
  37. #define BAUD_RATE 115200
  38.  
  39. // Default cpu mappings. Grbl officially supports the Arduino Uno only. Other processor types
  40. // may exist from user-supplied templates or directly user-defined in cpu_map.h
  41. #define CPU_MAP_ATMEGA328P // Arduino Uno CPU
  42.  
  43. // Define realtime command special characters. These characters are 'picked-off' directly from the
  44. // serial read data stream and are not passed to the grbl line execution parser. Select characters
  45. // that do not and must not exist in the streamed g-code program. ASCII control characters may be
  46. // used, if they are available per user setup. Also, extended ASCII codes (>127), which are never in
  47. // g-code programs, maybe selected for interface programs.
  48. // NOTE: If changed, manually update help message in report.c.
  49. #define CMD_STATUS_REPORT '?'
  50. #define CMD_FEED_HOLD '!'
  51. #define CMD_CYCLE_START '~'
  52. #define CMD_RESET 0x18 // ctrl-x.
  53. #define CMD_SAFETY_DOOR '@'
  54.  
  55. // If homing is enabled, homing init lock sets Grbl into an alarm state upon power up. This forces
  56. // the user to perform the homing cycle (or override the locks) before doing anything else. This is
  57. // mainly a safety feature to remind the user to home, since position is unknown to Grbl.
  58. #define HOMING_INIT_LOCK // Comment to disable
  59.  
  60. // Define the homing cycle patterns with bitmasks. The homing cycle first performs a search mode
  61. // to quickly engage the limit switches, followed by a slower locate mode, and finished by a short
  62. // pull-off motion to disengage the limit switches. The following HOMING_CYCLE_x defines are executed
  63. // in order starting with suffix 0 and completes the homing routine for the specified-axes only. If
  64. // an axis is omitted from the defines, it will not home, nor will the system update its position.
  65. // Meaning that this allows for users with non-standard cartesian machines, such as a lathe (x then z,
  66. // with no y), to configure the homing cycle behavior to their needs.
  67. // NOTE: The homing cycle is designed to allow sharing of limit pins, if the axes are not in the same
  68. // cycle, but this requires some pin settings changes in cpu_map.h file. For example, the default homing
  69. // cycle can share the Z limit pin with either X or Y limit pins, since they are on different cycles.
  70. // By sharing a pin, this frees up a precious IO pin for other purposes. In theory, all axes limit pins
  71. // may be reduced to one pin, if all axes are homed with seperate cycles, or vice versa, all three axes
  72. // on separate pin, but homed in one cycle. Also, it should be noted that the function of hard limits
  73. // will not be affected by pin sharing.
  74. // NOTE: Defaults are set for a traditional 3-axis CNC machine. Z-axis first to clear, followed by X & Y.
  75. #define HOMING_CYCLE_0 (1<<Z_AXIS)                // REQUIRED: First move Z to clear workspace.
  76. #define HOMING_CYCLE_1 ((1<<X_AXIS)|(1<<Y_AXIS))  // OPTIONAL: Then move X,Y at the same time.
  77. // #define HOMING_CYCLE_2                         // OPTIONAL: Uncomment and add axes mask to enable
  78.  
  79. // Number of homing cycles performed after when the machine initially jogs to limit switches.
  80. // This help in preventing overshoot and should improve repeatability. This value should be one or
  81. // greater.
  82. #define N_HOMING_LOCATE_CYCLE 1 // Integer (1-128)
  83.  
  84. // After homing, Grbl will set by default the entire machine space into negative space, as is typical
  85. // for professional CNC machines, regardless of where the limit switches are located. Uncomment this
  86. // define to force Grbl to always set the machine origin at the homed location despite switch orientation.
  87. // #define HOMING_FORCE_SET_ORIGIN // Uncomment to enable.
  88.  
  89. // Number of blocks Grbl executes upon startup. These blocks are stored in EEPROM, where the size
  90. // and addresses are defined in settings.h. With the current settings, up to 2 startup blocks may
  91. // be stored and executed in order. These startup blocks would typically be used to set the g-code
  92. // parser state depending on user preferences.
  93. #define N_STARTUP_LINE 2 // Integer (1-2)
  94.  
  95. // Number of floating decimal points printed by Grbl for certain value types. These settings are
  96. // determined by realistic and commonly observed values in CNC machines. For example, position
  97. // values cannot be less than 0.001mm or 0.0001in, because machines can not be physically more
  98. // precise this. So, there is likely no need to change these, but you can if you need to here.
  99. // NOTE: Must be an integer value from 0 to ~4. More than 4 may exhibit round-off errors.
  100. #define N_DECIMAL_COORDVALUE_INCH 4 // Coordinate or position value in inches
  101. #define N_DECIMAL_COORDVALUE_MM   3 // Coordinate or position value in mm
  102. #define N_DECIMAL_RATEVALUE_INCH  1 // Rate or velocity value in in/min
  103. #define N_DECIMAL_RATEVALUE_MM    0 // Rate or velocity value in mm/min
  104. #define N_DECIMAL_SETTINGVALUE    3 // Decimals for floating point setting values
  105.  
  106. // If your machine has two limits switches wired in parallel to one axis, you will need to enable
  107. // this feature. Since the two switches are sharing a single pin, there is no way for Grbl to tell
  108. // which one is enabled. This option only effects homing, where if a limit is engaged, Grbl will
  109. // alarm out and force the user to manually disengage the limit switch. Otherwise, if you have one
  110. // limit switch for each axis, don't enable this option. By keeping it disabled, you can perform a
  111. // homing cycle while on the limit switch and not have to move the machine off of it.
  112. // #define LIMITS_TWO_SWITCHES_ON_AXES
  113.  
  114. // Allows GRBL to track and report gcode line numbers.  Enabling this means that the planning buffer
  115. // goes from 18 or 16 to make room for the additional line number data in the plan_block_t struct
  116. // #define USE_LINE_NUMBERS // Disabled by default. Uncomment to enable.
  117.  
  118. // Allows GRBL to report the real-time feed rate.  Enabling this means that GRBL will be reporting more
  119. // data with each status update.
  120. // NOTE: This is experimental and doesn't quite work 100%. Maybe fixed or refactored later.
  121. // #define REPORT_REALTIME_RATE // Disabled by default. Uncomment to enable.
  122.  
  123. // Upon a successful probe cycle, this option provides immediately feedback of the probe coordinates
  124. // through an automatically generated message. If disabled, users can still access the last probe
  125. // coordinates through Grbl '$#' print parameters.
  126. #define MESSAGE_PROBE_COORDINATES // Enabled by default. Comment to disable.
  127.  
  128. // Enables a second coolant control pin via the mist coolant g-code command M7 on the Arduino Uno
  129. // analog pin 4. Only use this option if you require a second coolant control pin.
  130. // NOTE: The M8 flood coolant control pin on analog pin 3 will still be functional regardless.
  131. // #define ENABLE_M7 // Disabled by default. Uncomment to enable.
  132.  
  133. // This option causes the feed hold input to act as a safety door switch. A safety door, when triggered,
  134. // immediately forces a feed hold and then safely de-energizes the machine. Resuming is blocked until
  135. // the safety door is re-engaged. When it is, Grbl will re-energize the machine and then resume on the
  136. // previous tool path, as if nothing happened.
  137. // #define ENABLE_SAFETY_DOOR_INPUT_PIN // Default disabled. Uncomment to enable.
  138.  
  139. // After the safety door switch has been toggled and restored, this setting sets the power-up delay
  140. // between restoring the spindle and coolant and resuming the cycle.
  141. // NOTE: Delay value is defined in milliseconds from zero to 65,535.
  142. #define SAFETY_DOOR_SPINDLE_DELAY 4000
  143. #define SAFETY_DOOR_COOLANT_DELAY 1000
  144.  
  145. // Enable CoreXY kinematics. Use ONLY with CoreXY machines.
  146. // IMPORTANT: If homing is enabled, you must reconfigure the homing cycle #defines above to
  147. // #define HOMING_CYCLE_0 (1<<X_AXIS) and #define HOMING_CYCLE_1 (1<<Y_AXIS)
  148. // NOTE: This configuration option alters the motion of the X and Y axes to principle of operation
  149. // defined at (http://corexy.com/theory.html). Motors are assumed to positioned and wired exactly as
  150. // described, if not, motions may move in strange directions. Grbl assumes the CoreXY A and B motors
  151. // have the same steps per mm internally.
  152. // #define COREXY // Default disabled. Uncomment to enable.
  153.  
  154. // Inverts pin logic of the control command pins. This essentially means when this option is enabled
  155. // you can use normally-closed switches, rather than the default normally-open switches.
  156. // NOTE: If you require individual control pins inverted, keep this macro disabled and simply alter
  157. //   the CONTROL_INVERT_MASK definition in cpu_map.h files.
  158. // #define INVERT_ALL_CONTROL_PINS // Default disabled. Uncomment to enable.
  159.  
  160. // Inverts select limit pin states based on the following mask. This effects all limit pin functions,
  161. // such as hard limits and homing. However, this is different from overall invert limits setting.
  162. // This build option will invert only the limit pins defined here, and then the invert limits setting
  163. // will be applied to all of them. This is useful when a user has a mixed set of limit pins with both
  164. // normally-open(NO) and normally-closed(NC) switches installed on their machine.
  165. // NOTE: PLEASE DO NOT USE THIS, unless you have a situation that needs it.
  166. // #define INVERT_LIMIT_PIN_MASK ((1<<X_LIMIT_BIT)|(1<<Y_LIMIT_BIT)) // Default disabled. Uncomment to enable.
  167.  
  168. // Inverts the spindle enable pin from low-disabled/high-enabled to low-enabled/high-disabled. Useful
  169. // for some pre-built electronic boards.
  170. // NOTE: If VARIABLE_SPINDLE is enabled(default), this option has no effect as the PWM output and
  171. // spindle enable are combined to one pin. If you need both this option and spindle speed PWM,
  172. // uncomment the config option USE_SPINDLE_DIR_AS_ENABLE_PIN below.
  173. // #define INVERT_SPINDLE_ENABLE_PIN // Default disabled. Uncomment to enable.
  174.  
  175. // Enable control pin states feedback in status reports. The data is presented as simple binary of
  176. // the control pin port (0 (low) or 1(high)), masked to show only the input pins. Non-control pins on the
  177. // port will always show a 0 value. See cpu_map.h for the pin bitmap. As with the limit pin reporting,
  178. // we do not recommend keeping this option enabled. Try to only use this for setting up a new CNC.
  179. // #define REPORT_CONTROL_PIN_STATE // Default disabled. Uncomment to enable.
  180.  
  181. // When Grbl powers-cycles or is hard reset with the Arduino reset button, Grbl boots up with no ALARM
  182. // by default. This is to make it as simple as possible for new users to start using Grbl. When homing
  183. // is enabled and a user has installed limit switches, Grbl will boot up in an ALARM state to indicate
  184. // Grbl doesn't know its position and to force the user to home before proceeding. This option forces
  185. // Grbl to always initialize into an ALARM state regardless of homing or not. This option is more for
  186. // OEMs and LinuxCNC users that would like this power-cycle behavior.
  187. // #define FORCE_INITIALIZATION_ALARM // Default disabled. Uncomment to enable.
  188.  
  189. // ---------------------------------------------------------------------------------------
  190. // ADVANCED CONFIGURATION OPTIONS:
  191.  
  192. // Enables minimal reporting feedback mode for GUIs, where human-readable strings are not as important.
  193. // This saves nearly 2KB of flash space and may allow enough space to install other/future features.
  194. // GUIs will need to install a look-up table for the error-codes that Grbl sends back in their place.
  195. // NOTE: This feature is new and experimental. Make sure the GUI you are using supports this mode.
  196. // #define REPORT_GUI_MODE // Default disabled. Uncomment to enable.
  197.  
  198. // The temporal resolution of the acceleration management subsystem. A higher number gives smoother
  199. // acceleration, particularly noticeable on machines that run at very high feedrates, but may negatively
  200. // impact performance. The correct value for this parameter is machine dependent, so it's advised to
  201. // set this only as high as needed. Approximate successful values can widely range from 50 to 200 or more.
  202. // NOTE: Changing this value also changes the execution time of a segment in the step segment buffer.
  203. // When increasing this value, this stores less overall time in the segment buffer and vice versa. Make
  204. // certain the step segment buffer is increased/decreased to account for these changes.
  205. #define ACCELERATION_TICKS_PER_SECOND 100
  206.  
  207. // Adaptive Multi-Axis Step Smoothing (AMASS) is an advanced feature that does what its name implies,
  208. // smoothing the stepping of multi-axis motions. This feature smooths motion particularly at low step
  209. // frequencies below 10kHz, where the aliasing between axes of multi-axis motions can cause audible
  210. // noise and shake your machine. At even lower step frequencies, AMASS adapts and provides even better
  211. // step smoothing. See stepper.c for more details on the AMASS system works.
  212. #define ADAPTIVE_MULTI_AXIS_STEP_SMOOTHING  // Default enabled. Comment to disable.
  213.  
  214. // Sets the maximum step rate allowed to be written as a Grbl setting. This option enables an error
  215. // check in the settings module to prevent settings values that will exceed this limitation. The maximum
  216. // step rate is strictly limited by the CPU speed and will change if something other than an AVR running
  217. // at 16MHz is used.
  218. // NOTE: For now disabled, will enable if flash space permits.
  219. // #define MAX_STEP_RATE_HZ 30000 // Hz
  220.  
  221. // By default, Grbl sets all input pins to normal-high operation with their internal pull-up resistors
  222. // enabled. This simplifies the wiring for users by requiring only a switch connected to ground,
  223. // although its recommended that users take the extra step of wiring in low-pass filter to reduce
  224. // electrical noise detected by the pin. If the user inverts the pin in Grbl settings, this just flips
  225. // which high or low reading indicates an active signal. In normal operation, this means the user
  226. // needs to connect a normal-open switch, but if inverted, this means the user should connect a
  227. // normal-closed switch.
  228. // The following options disable the internal pull-up resistors, sets the pins to a normal-low
  229. // operation, and switches must be now connect to Vcc instead of ground. This also flips the meaning
  230. // of the invert pin Grbl setting, where an inverted setting now means the user should connect a
  231. // normal-open switch and vice versa.
  232. // NOTE: All pins associated with the feature are disabled, i.e. XYZ limit pins, not individual axes.
  233. // WARNING: When the pull-ups are disabled, this requires additional wiring with pull-down resistors!
  234. //#define DISABLE_LIMIT_PIN_PULL_UP
  235. //#define DISABLE_PROBE_PIN_PULL_UP
  236. //#define DISABLE_CONTROL_PIN_PULL_UP
  237.  
  238. // Sets which axis the tool length offset is applied. Assumes the spindle is always parallel with
  239. // the selected axis with the tool oriented toward the negative direction. In other words, a positive
  240. // tool length offset value is subtracted from the current location.
  241. #define TOOL_LENGTH_OFFSET_AXIS Z_AXIS // Default z-axis. Valid values are X_AXIS, Y_AXIS, or Z_AXIS.
  242.  
  243. // Enables variable spindle output voltage for different RPM values. On the Arduino Uno, the spindle
  244. // enable pin will output 5V for maximum RPM with 256 intermediate levels and 0V when disabled.
  245. // NOTE: IMPORTANT for Arduino Unos! When enabled, the Z-limit pin D11 and spindle enable pin D12 switch!
  246. // The hardware PWM output on pin D11 is required for variable spindle output voltages.
  247. //#define VARIABLE_SPINDLE // Default enabled. Comment to disable.
  248.  
  249. // Used by the variable spindle output only. These parameters set the maximum and minimum spindle speed
  250. // "S" g-code values to correspond to the maximum and minimum pin voltages. There are 256 discrete and
  251. // equally divided voltage bins between the maximum and minimum spindle speeds. So for a 5V pin, 1000
  252. // max rpm, and 250 min rpm, the spindle output voltage would be set for the following "S" commands:
  253. // "S1000" @ 5V, "S250" @ 0.02V, and "S625" @ 2.5V (mid-range). The pin outputs 0V when disabled.
  254. #define SPINDLE_MAX_RPM 1000.0 // Max spindle RPM. This value is equal to 100% duty cycle on the PWM.
  255. #define SPINDLE_MIN_RPM 0.0    // Min spindle RPM. This value is equal to (1/256) duty cycle on the PWM.
  256.  
  257. // Used by variable spindle output only. This forces the PWM output to a minimum duty cycle when enabled.
  258. // When disabled, the PWM pin will still read 0V. Most users will not need this option, but it may be
  259. // useful in certain scenarios. This setting does not update the minimum spindle RPM calculations. Any
  260. // spindle RPM output lower than this value will be set to this value.
  261. // #define MINIMUM_SPINDLE_PWM 5 // Default disabled. Uncomment to enable. Integer (0-255)
  262.  
  263. // By default on a 328p(Uno), Grbl combines the variable spindle PWM and the enable into one pin to help
  264. // preserve I/O pins. For certain setups, these may need to be separate pins. This configure option uses
  265. // the spindle direction pin(D13) as a separate spindle enable pin along with spindle speed PWM on pin D11.
  266. // NOTE: This configure option only works with VARIABLE_SPINDLE enabled and a 328p processor (Uno).
  267. // NOTE: With no direction pin, the spindle clockwise M4 g-code command will be removed. M3 and M5 still work.
  268. // NOTE: BEWARE! The Arduino bootloader toggles the D13 pin when it powers up. If you flash Grbl with
  269. // a programmer (you can use a spare Arduino as "Arduino as ISP". Search the web on how to wire this.),
  270. // this D13 LED toggling should go away. We haven't tested this though. Please report how it goes!
  271. // #define USE_SPINDLE_DIR_AS_ENABLE_PIN // Default disabled. Uncomment to enable.
  272.  
  273. // With this enabled, Grbl sends back an echo of the line it has received, which has been pre-parsed (spaces
  274. // removed, capitalized letters, no comments) and is to be immediately executed by Grbl. Echoes will not be
  275. // sent upon a line buffer overflow, but should for all normal lines sent to Grbl. For example, if a user
  276. // sendss the line 'g1 x1.032 y2.45 (test comment)', Grbl will echo back in the form '[echo: G1X1.032Y2.45]'.
  277. // NOTE: Only use this for debugging purposes!! When echoing, this takes up valuable resources and can effect
  278. // performance. If absolutely needed for normal operation, the serial write buffer should be greatly increased
  279. // to help minimize transmission waiting within the serial write protocol.
  280. // #define REPORT_ECHO_LINE_RECEIVED // Default disabled. Uncomment to enable.
  281.  
  282. // Minimum planner junction speed. Sets the default minimum junction speed the planner plans to at
  283. // every buffer block junction, except for starting from rest and end of the buffer, which are always
  284. // zero. This value controls how fast the machine moves through junctions with no regard for acceleration
  285. // limits or angle between neighboring block line move directions. This is useful for machines that can't
  286. // tolerate the tool dwelling for a split second, i.e. 3d printers or laser cutters. If used, this value
  287. // should not be much greater than zero or to the minimum value necessary for the machine to work.
  288. #define MINIMUM_JUNCTION_SPEED 0.0 // (mm/min)
  289.  
  290. // Sets the minimum feed rate the planner will allow. Any value below it will be set to this minimum
  291. // value. This also ensures that a planned motion always completes and accounts for any floating-point
  292. // round-off errors. Although not recommended, a lower value than 1.0 mm/min will likely work in smaller
  293. // machines, perhaps to 0.1mm/min, but your success may vary based on multiple factors.
  294. #define MINIMUM_FEED_RATE 1.0 // (mm/min)
  295.  
  296. // Number of arc generation iterations by small angle approximation before exact arc trajectory
  297. // correction with expensive sin() and cos() calcualtions. This parameter maybe decreased if there
  298. // are issues with the accuracy of the arc generations, or increased if arc execution is getting
  299. // bogged down by too many trig calculations.
  300. #define N_ARC_CORRECTION 12 // Integer (1-255)
  301.  
  302. // The arc G2/3 g-code standard is problematic by definition. Radius-based arcs have horrible numerical
  303. // errors when arc at semi-circles(pi) or full-circles(2*pi). Offset-based arcs are much more accurate
  304. // but still have a problem when arcs are full-circles (2*pi). This define accounts for the floating
  305. // point issues when offset-based arcs are commanded as full circles, but get interpreted as extremely
  306. // small arcs with around machine epsilon (1.2e-7rad) due to numerical round-off and precision issues.
  307. // This define value sets the machine epsilon cutoff to determine if the arc is a full-circle or not.
  308. // NOTE: Be very careful when adjusting this value. It should always be greater than 1.2e-7 but not too
  309. // much greater than this. The default setting should capture most, if not all, full arc error situations.
  310. #define ARC_ANGULAR_TRAVEL_EPSILON 5E-7 // Float (radians)
  311.  
  312. // Time delay increments performed during a dwell. The default value is set at 50ms, which provides
  313. // a maximum time delay of roughly 55 minutes, more than enough for most any application. Increasing
  314. // this delay will increase the maximum dwell time linearly, but also reduces the responsiveness of
  315. // run-time command executions, like status reports, since these are performed between each dwell
  316. // time step. Also, keep in mind that the Arduino delay timer is not very accurate for long delays.
  317. #define DWELL_TIME_STEP 50 // Integer (1-255) (milliseconds)
  318.  
  319. // Creates a delay between the direction pin setting and corresponding step pulse by creating
  320. // another interrupt (Timer2 compare) to manage it. The main Grbl interrupt (Timer1 compare)
  321. // sets the direction pins, and does not immediately set the stepper pins, as it would in
  322. // normal operation. The Timer2 compare fires next to set the stepper pins after the step
  323. // pulse delay time, and Timer2 overflow will complete the step pulse, except now delayed
  324. // by the step pulse time plus the step pulse delay. (Thanks langwadt for the idea!)
  325. // NOTE: Uncomment to enable. The recommended delay must be > 3us, and, when added with the
  326. // user-supplied step pulse time, the total time must not exceed 127us. Reported successful
  327. // values for certain setups have ranged from 5 to 20us.
  328. // #define STEP_PULSE_DELAY 10 // Step pulse delay in microseconds. Default disabled.
  329.  
  330. // The number of linear motions in the planner buffer to be planned at any give time. The vast
  331. // majority of RAM that Grbl uses is based on this buffer size. Only increase if there is extra
  332. // available RAM, like when re-compiling for a Mega or Sanguino. Or decrease if the Arduino
  333. // begins to crash due to the lack of available RAM or if the CPU is having trouble keeping
  334. // up with planning new incoming motions as they are executed.
  335. // #define BLOCK_BUFFER_SIZE 18  // Uncomment to override default in planner.h.
  336.  
  337. // Governs the size of the intermediary step segment buffer between the step execution algorithm
  338. // and the planner blocks. Each segment is set of steps executed at a constant velocity over a
  339. // fixed time defined by ACCELERATION_TICKS_PER_SECOND. They are computed such that the planner
  340. // block velocity profile is traced exactly. The size of this buffer governs how much step
  341. // execution lead time there is for other Grbl processes have to compute and do their thing
  342. // before having to come back and refill this buffer, currently at ~50msec of step moves.
  343. // #define SEGMENT_BUFFER_SIZE 6 // Uncomment to override default in stepper.h.
  344.  
  345. // Line buffer size from the serial input stream to be executed. Also, governs the size of
  346. // each of the startup blocks, as they are each stored as a string of this size. Make sure
  347. // to account for the available EEPROM at the defined memory address in settings.h and for
  348. // the number of desired startup blocks.
  349. // NOTE: 80 characters is not a problem except for extreme cases, but the line buffer size
  350. // can be too small and g-code blocks can get truncated. Officially, the g-code standards
  351. // support up to 256 characters. In future versions, this default will be increased, when
  352. // we know how much extra memory space we can re-invest into this.
  353. // #define LINE_BUFFER_SIZE 80  // Uncomment to override default in protocol.h
  354.  
  355. // Serial send and receive buffer size. The receive buffer is often used as another streaming
  356. // buffer to store incoming blocks to be processed by Grbl when its ready. Most streaming
  357. // interfaces will character count and track each block send to each block response. So,
  358. // increase the receive buffer if a deeper receive buffer is needed for streaming and avaiable
  359. // memory allows. The send buffer primarily handles messages in Grbl. Only increase if large
  360. // messages are sent and Grbl begins to stall, waiting to send the rest of the message.
  361. // NOTE: Buffer size values must be greater than zero and less than 256.
  362. // #define RX_BUFFER_SIZE 128 // Uncomment to override defaults in serial.h
  363. // #define TX_BUFFER_SIZE 64
  364.  
  365. // Toggles XON/XOFF software flow control for serial communications. Not officially supported
  366. // due to problems involving the Atmega8U2 USB-to-serial chips on current Arduinos. The firmware
  367. // on these chips do not support XON/XOFF flow control characters and the intermediate buffer
  368. // in the chips cause latency and overflow problems with standard terminal programs. However,
  369. // using specifically-programmed UI's to manage this latency problem has been confirmed to work.
  370. // As well as, older FTDI FT232RL-based Arduinos(Duemilanove) are known to work with standard
  371. // terminal programs since their firmware correctly manage these XON/XOFF characters. In any
  372. // case, please report any successes to grbl administrators!
  373. // #define ENABLE_XONXOFF // Default disabled. Uncomment to enable.
  374.  
  375. // A simple software debouncing feature for hard limit switches. When enabled, the interrupt
  376. // monitoring the hard limit switch pins will enable the Arduino's watchdog timer to re-check
  377. // the limit pin state after a delay of about 32msec. This can help with CNC machines with
  378. // problematic false triggering of their hard limit switches, but it WILL NOT fix issues with
  379. // electrical interference on the signal cables from external sources. It's recommended to first
  380. // use shielded signal cables with their shielding connected to ground (old USB/computer cables
  381. // work well and are cheap to find) and wire in a low-pass circuit into each limit pin.
  382. // #define ENABLE_SOFTWARE_DEBOUNCE // Default disabled. Uncomment to enable.
  383.  
  384. // Force Grbl to check the state of the hard limit switches when the processor detects a pin
  385. // change inside the hard limit ISR routine. By default, Grbl will trigger the hard limits
  386. // alarm upon any pin change, since bouncing switches can cause a state check like this to
  387. // misread the pin. When hard limits are triggered, they should be 100% reliable, which is the
  388. // reason that this option is disabled by default. Only if your system/electronics can guarantee
  389. // that the switches don't bounce, we recommend enabling this option. This will help prevent
  390. // triggering a hard limit when the machine disengages from the switch.
  391. // NOTE: This option has no effect if SOFTWARE_DEBOUNCE is enabled.
  392. // #define HARD_LIMIT_FORCE_STATE_CHECK // Default disabled. Uncomment to enable.
  393.  
  394.  
  395. // ---------------------------------------------------------------------------------------
  396. // COMPILE-TIME ERROR CHECKING OF DEFINE VALUES:
  397.  
  398. #ifndef HOMING_CYCLE_0
  399.   #error "Required HOMING_CYCLE_0 not defined."
  400. #endif
  401.  
  402. #if defined(USE_SPINDLE_DIR_AS_ENABLE_PIN) && !defined(VARIABLE_SPINDLE)
  403.   #error "USE_SPINDLE_DIR_AS_ENABLE_PIN may only be used with VARIABLE_SPINDLE enabled"
  404. #endif
  405.  
  406. #if defined(USE_SPINDLE_DIR_AS_ENABLE_PIN) && !defined(CPU_MAP_ATMEGA328P)
  407.   #error "USE_SPINDLE_DIR_AS_ENABLE_PIN may only be used with a 328p processor"
  408. #endif
  409.  
  410. // ---------------------------------------------------------------------------------------
  411.  
  412.  
  413. #endif
RAW Paste Data