-
Notifications
You must be signed in to change notification settings - Fork 2
/
config.h
87 lines (66 loc) · 2.44 KB
/
config.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/*
config.h - compile time configuration
Part of Grbl
Copyright (c) 2009-2011 Simen Svale Skogsrud
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/>.
*/
/*
Specifics for the CCHS CNC machine:
The X and Y axes:
Steppers have a 1.8degree step: 200 steps per revolution.
The lead of the screw: 0.125inches = 3.175mm.
3.175 is one turn.
So, turns_per_mm = 1/3.175 = 0.3149606299212598.
steps_per_mm = (steps_per_revolution*microsteps)/turns_per_mm
= (200*1)/0.3149606299212598.
= 635, very close to exact.
The Z axis:
*/
#ifndef config_h
#define config_h
#ifndef __AVR_ATmega328P__
#define __AVR_ATmega328P__
#endif
#define BAUD_RATE 9600
// Updated default pin-assignments from 0.6 onwards
// (see bottom of file for a copy of the old config)
#define STEPPERS_ENABLE_DDR DDRC
#define STEPPERS_ENABLE_PORT PORTC
#define STEPPERS_ENABLE_BIT 3 //PC3
#define STEPPERS_RESET_DDR DDRC
#define STEPPERS_RESET_PORT PORTC
#define STEPPERS_RESET_BIT 4 //PC4
#define STEPPING_DDR DDRC
#define STEPPING_PORT PORTC
#define X_STEP_BIT 5 //PC5
#define Y_STEP_BIT 6 //PC6
#define Z_STEP_BIT 7 //PC7
#define X_DIRECTION_BIT 2 //PC2
#define Y_DIRECTION_BIT 1 //PC1
#define Z_DIRECTION_BIT 0 //PC0
//as a default it goes 11000000.
//when X is going down, 11100000.
//#define LIMIT_DDR DDRA
//#define LIMIT_PORT PORTA
//#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
// The temporal resolution of the acceleration management subsystem. Higher number
// give smoother acceleration but may impact performance
#define ACCELERATION_TICKS_PER_SECOND 40L
#endif