forked from DCC-EX/EX-Turntable
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.example.h
More file actions
209 lines (180 loc) · 8.53 KB
/
config.example.h
File metadata and controls
209 lines (180 loc) · 8.53 KB
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
/*
* © 2022 Peter Cole
*
* This is the configuration file for Turntable-EX.
*/
/////////////////////////////////////////////////////////////////////////////////////
// Define a valid (and free) I2C address, 0x60 is the default.
//
#define I2C_ADDRESS 0x60
/////////////////////////////////////////////////////////////////////////////////////
// Define the mode for Turntable-EX.
// TURNTABLE : Use this for normal, 360 degree rotation turntables (Default).
// TRAVERSER : Use this for vertical or horizontal traversers, or turntables that do
// do not rotate a full 360 degrees.
//
#define TURNTABLE_EX_MODE TURNTABLE
// #define TURNTABLE_EX_MODE TRAVERSER
/////////////////////////////////////////////////////////////////////////////////////
// Enable sensor testing only, prevents all Turntable-EX operations.
// Uncomment this line to disable all normal Turntable-EX operations in order to test
// and validate that homing and limit sensors activate and deactivate correctly.
// Note that you can enable sensor testing interactively in the serial console with <T>
//
// #define SENSOR_TESTING
/////////////////////////////////////////////////////////////////////////////////////
// Define the active state for the homing sensor.
// LOW = When activated, the input is pulled down (ground or 0V).
// HIGH = When activated, the input is pulled up (typically 5V).
//
#define HOME_SENSOR_ACTIVE_STATE LOW
//#define HOME_SENSOR_ACTIVE_STATE HIGH
/////////////////////////////////////////////////////////////////////////////////////
// REQUIRED FOR TRAVERSER MODE ONLY
// Define the active state for the limit sensor.
// LOW = When activated, the input is pulled down (ground or 0V).
// HIGH = When activated, the input is pulled up (typically 5V).
//
#define LIMIT_SENSOR_ACTIVE_STATE LOW
/////////////////////////////////////////////////////////////////////////////////////
// Define the active state for the phase switching relays.
// LOW = When activated, the input is pulled down (ground or 0V).
// HIGH = When activated, the input is pulled up (typically 5V).
//
#define RELAY_ACTIVE_STATE HIGH
/////////////////////////////////////////////////////////////////////////////////////
// Define phase switching behaviour.
//
// PHASE_SWITCHING options:
// AUTO : When defined, phase will invert at PHASE_SWITCH_START_ANGLE, and revert
// at PHASE_SWITCH_STOP_ANGLE (see below).
// MANUAL : When defined, phase will only invert using the Turn_PInvert command.
//
// Refer to the documentation for the full explanation on phase switching, and when
// it is recommended to change these options.
//
#define PHASE_SWITCHING AUTO
// #define PHASE_SWITCHING MANUAL
/////////////////////////////////////////////////////////////////////////////////////
// Define automatic phase switching angle.
//
// If PHASE_SWITCHING is set to AUTO (see above), then when the turntable rotates
// PHASE_SWITCH_ANGLE degrees from home, the phase will automatically invert.
// Once the turntable reaches a further 180 degrees, the phase will automatically
// revert.
//
// Refer to the documentation for the full explanation on phase switching, and how to
// define the angle that's relevant for your layout.
//
#define PHASE_SWITCH_ANGLE 45
/////////////////////////////////////////////////////////////////////////////////////
// Define the stepper controller in use according to those available below, refer to the
// documentation for further details on which to select for your application.
//
// ULN2003_HALF_CW : ULN2003 in half step mode, clockwise
// ULN2003_HALF_CCW : ULN2003 in half step mode, counter clockwise
// ULN2003_FULL_CW : ULN2003 in full step mode, clockwise
// ULN2003_FULL_CCW : ULN2003 in full step mode, counter clockwise
// A4988 : Two wire drivers (eg. A4988, DRV8825, TMC2208)
//
// NOTE: If you are using a different controller than those already defined, refer to
// the documentation to define the appropriate configuration variables. Note there are
// some controllers that are pin-compatible with an existing defined controller, and
// in those instances, no custom configuration would be required.
//
#define STEPPER_DRIVER ULN2003_HALF_CW
// #define STEPPER_DRIVER ULN2003_HALF_CCW
// #define STEPPER_DRIVER ULN2003_FULL_CW
// #define STEPPER_DRIVER ULN2003_FULL_CCW
// #define STEPPER_DRIVER A4988
//
// When using a two wire driver (eg. A4988, DRV8825, TMC2208), it may be necessary to invert
// the direction pin. This is likely required when using a TMC2208. This has no effect on
// ULN2003.
//#define INVERT_DIRECTION
//
// When using a two wire driver (eg. A4988, DRV8825, TMC2208), it may be necessary to invert
// the step pin. If so, uncomment this line. This has no effect on ULN2003.
//#define INVERT_STEP
//
// When using a two wire driver (eg. A4988, DRV8825, TMC2208), it may be necessary to invert
// the enable pin behaviour if you wish to have the stepper driver disabled when not moving.
// This has no effect on ULN2003.
//#define INVERT_ENABLE
/////////////////////////////////////////////////////////////////////////////////////
// Define the various stepper configuration items below if the defaults don't suit
//
// Disable the stepper controller when idling, comment out to leave on. Note that this
// is handy to prevent controllers overheating, so this is a recommended setting.
#define DISABLE_OUTPUTS_IDLE
//
// Define the acceleration and speed settings.
#define STEPPER_MAX_SPEED 200 // Maximum possible speed the stepper will reach
#define STEPPER_ACCELERATION 25 // Acceleration and deceleration rate
//
// If using a gearing or microstep setup with larger than 32767 steps, you need to set the
// gearing factor appropriately.
// Step counts sent from EX-CommandStation will be multiplied by this number.
#define STEPPER_GEARING_FACTOR 1
/////////////////////////////////////////////////////////////////////////////////////
// If dealing with steppers that have a lot of slop, it can be beneficial to force
// rotating in one direction only. Enable one (and one only) of the below options if
// a single rotation direction is required.
// NOTE this does not apply in TRAVERSER mode.
//
// #define ROTATE_FORWARD_ONLY
// #define ROTATE_REVERSE_ONLY
/////////////////////////////////////////////////////////////////////////////////////
// Define the LED blink rates for fast and slow blinking in milliseconds.
//
// The LED will alternative on/off for these durations.
#define LED_FAST 100
#define LED_SLOW 500
/////////////////////////////////////////////////////////////////////////////////////
// ADVANCED OPTIONS
// In normal circumstances, the settings below should not need to be adjusted unless
// requested by support ticket, or if Tinkerers or Engineers are working with alternative
// stepper drivers and motors.
//
// Enable debug outputs if required during troubleshooting.
// Note you can enable debug output interactively in the serial console with <D>
//
// #define DEBUG
//
// Define the maximum number of steps homing and calibration will perform before marking
// these activities as failed. This step count must exceed a single full rotation in order
// to be useful.
// #define SANITY_STEPS 10000
//
// Define the minimum number of steps the turntable needs to move before the homing sensor
// deactivates, which is required during the calibration sequence. For high step count
// setups, this may need to be increased.
// #define HOME_SENSITIVITY 300
//
// Override the step count determined by automatic calibration by uncommenting the line
// below, and manually defining a specific step count.
// #define FULL_STEP_COUNT 4096
//
// Override the default debounce delay (in ms) if using mechanical home/limit switches that have
// "noisy" switch bounce issues.
// In TRAVERSER mode, default is 10ms as these would typically use mechanical switches.
// In TURNTABLE mode, default is 0ms as these would typically use hall effect sensors.
// #define DEBOUNCE_DELAY 10
/*
* Defines added for RT_EX_Turntable all in one board.
*/
// uncomment this to use default settings for RT_EX-Turntable all in on board
//#define USE_RT_EX_TURNTABLE
#ifdef USE_RT_EX_TURNTABLE
// Set the stepper driver to two wire driver on RT_EX-TURNTABLE board
#ifdef STEPPER_DRIVER
#undef STEPPER_DRIVER
#endif
#define STEPPER_DRIVER A4988
// TMC2209 needs the enable pin inverted.
#define INVERT_ENABLE
// This allows use of 1/64 and 1/128 microsteps
#define SANITY_STEPS 30000
// This allows moving far enough during calibration from home when using 1/64 and 1/128 microsteps
#define HOME_SENSITIVITY 600
#endif