forked from LinuxCNC/linuxcnc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaxis_mm_scurve.ini
More file actions
275 lines (244 loc) · 8.68 KB
/
axis_mm_scurve.ini
File metadata and controls
275 lines (244 loc) · 8.68 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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
# ========================================================
# S-CURVE MOTION PLANNING CONFIGURATION EXAMPLE
# ========================================================
#
# This file demonstrates how to configure S-curve (jerk-limited)
# motion planning in LinuxCNC. S-curve planning produces smoother
# acceleration profiles that can reduce machine vibration and
# improve surface finish.
#
# IMPORTANT: S-curve planning is OPTIONAL.
# Traditional trapezoidal acceleration is used when:
# - PLANNER_TYPE = 0, OR
# - MAX_LINEAR_JERK = 0
#
# NOTE: If MAX_LINEAR_JERK is not specified, it defaults to 1e9 (1 billion),
# which effectively disables jerk limiting while still using S-curve calculations.
# This produces motion similar to trapezoidal but not identical.
#
# ========================================================
[EMC]
VERSION = 1.1
MACHINE = scurve_example
DEBUG = 0
[DISPLAY]
JOG_AXES = XYZ
GEOMETRY = XYZ
DISPLAY = axis
CYCLE_TIME = 0.200
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
MAX_FEED_OVERRIDE = 2.0
PROGRAM_PREFIX = M-Codes
INTRO_GRAPHIC = linuxcnc.gif
INTRO_TIME = 5
EDITOR = gedit
[EMCMOT]
EMCMOT = motmod
COMM_TIMEOUT = 1.0
COMM_WAIT = 0.010
BASE_PERIOD = 150000
SERVO_PERIOD = 1000000
[TASK]
TASK = milltask
CYCLE_TIME = 0.010
[HAL]
HALUI = halui
HALFILE = axis_mm_scurve.hal
[TRAJ]
# --------------------------------------------------------
# S-curve Planner Configuration
# --------------------------------------------------------
# PLANNER_TYPE: Select the acceleration profile shape
# 0 = Trapezoidal (traditional - constant acceleration)
# 1 = S-curve (smoother - limited jerk/derivative of acceleration)
# Default: 0 (trapezoidal)
#
# NOTE: This parameter can be changed at RUNTIME via HAL pin:
# ini.traj_planner_type (allows switching on-the-fly)
PLANNER_TYPE = 1
# MAX_LINEAR_JERK: Maximum rate of change of acceleration
# Units: machine-units/second^3 (e.g., mm/s^3 or inch/s^3)
#
# Setting this to 0 disables S-curve planning regardless of PLANNER_TYPE
# If not specified, defaults to 1e9 (effectively no jerk limiting)
# Maximum allowed value is 1e9 (values above are automatically clamped)
#
# Recommended starting values (adjust based on your machine):
# - Light/rigid machines: 1000-10000
# - Heavy/flexible machines: 100-1000
# - Very rigid machines: 10000-100000
#
# Higher values = sharper acceleration changes (closer to trapezoidal)
# Lower values = smoother acceleration changes (more gradual)
#
# NOTE: This parameter can be changed at RUNTIME via HAL pin:
# ini.traj_max_jerk (allows tuning on-the-fly)
MAX_LINEAR_JERK = 10000.0
# --------------------------------------------------------
# Standard TRAJ parameters (still required with S-curve)
# --------------------------------------------------------
COORDINATES = X Y Z
LINEAR_UNITS = 1.0
ANGULAR_UNITS = 1.0
CYCLE_TIME = 0.010
DEFAULT_LINEAR_VELOCITY = 100.0
MAX_LINEAR_VELOCITY = 300.0
DEFAULT_LINEAR_ACCELERATION = 500.0
MAX_LINEAR_ACCELERATION = 1000.0
NO_FORCE_HOMING = 1 #to be able to run gcodes and MDI without homing
ARC_BLEND_ENABLE = 1
ARC_BLEND_FALLBACK_ENABLE = 0
ARC_BLEND_OPTIMIZATION_DEPTH = 50
ARC_BLEND_RAMP_FREQ = 20
ARC_BLEND_GAP_CYCLES = 4
[EMCIO]
EMCIO = io
CYCLE_TIME = 0.100
[KINS]
# 5axiskins misnomer 1 more joint for W
KINEMATICS = trivkins
JOINTS = 3
[RS274NGC]
# File containing interpreter variables
PARAMETER_FILE = scurve_example.var
# ========================================================
# JOINT CONFIGURATION
# ========================================================
# Each joint can have its own jerk limit. If not specified,
# the joint uses the axis/trajectory jerk limits.
[JOINT_0]
TYPE = LINEAR
HOME = 0.0
MAX_VELOCITY = 300.0
MAX_ACCELERATION = 1000.0
HOME_SEQUENCE = 0
# MAX_JERK: Maximum jerk for this joint
# Units: machine-units/second^3
# Default: 0.0 (disabled, uses trapezoidal)
#
# This should match or be higher than the trajectory jerk
# to avoid limiting coordinated motion.
MAX_JERK = 10000.0
#MIN_LIMIT = -200.0 #disabled to give more space for testing g-codes
#MAX_LIMIT = 200.0 #disabled to give more space for testing g-codes
# ========================================================
# HOMING CONFIGURATION FOR S-CURVE
# ========================================================
# WARNING: When using S-curve motion (PLANNER_TYPE=1), you MUST set
# HOME_SEARCH_VEL and HOME_LATCH_VEL significantly SLOWER than you
# would with trapezoidal motion planning.
#
# S-curve motion requires MORE DISTANCE to decelerate due to the
# jerk-limited acceleration profile. If homing velocities are too
# high, the axis may overshoot and hit hard limits or sensor limits.
#
# RECOMMENDED: Start with 50% or less of the velocities you would
# use with trapezoidal planning, then increase cautiously.
#
# Example homing configuration (adjust for your machine):
#HOME_SEARCH_VEL = 5.0 # Velocity for initial limit switch search
#HOME_LATCH_VEL = 1.0 # Velocity for precise homing (slower)
#HOME_OFFSET = 0.0 # Distance from switch to home position
#HOME_USE_INDEX = NO # Use encoder index pulse for homing
#HOME_IGNORE_LIMITS = NO # Ignore limit switches during homing move
# ========================================================
[JOINT_1]
TYPE = LINEAR
HOME = 0.0
MAX_VELOCITY = 300.0
MAX_ACCELERATION = 1000.0
MAX_JERK = 10000.0
#MIN_LIMIT = -200.0 #disabled to give more space for testing g-codes
#MAX_LIMIT = 200.0 #disabled to give more space for testing g-codes
HOME_SEQUENCE = 0
# WARNING: S-curve homing requires SLOWER velocities than trapezoidal!
# See JOINT_0 for detailed homing configuration examples.
#HOME_SEARCH_VEL = 5.0
#HOME_LATCH_VEL = 1.0
[JOINT_2]
TYPE = LINEAR
HOME = 0.0
MAX_VELOCITY = 200.0
MAX_ACCELERATION = 800.0
MAX_JERK = 10000.0
#MIN_LIMIT = -100.0 #disabled to give more space for testing g-codes
#MAX_LIMIT = 100.0 #disabled to give more space for testing g-codes
HOME_SEQUENCE = 0
# WARNING: S-curve homing requires SLOWER velocities than trapezoidal!
# See JOINT_0 for detailed homing configuration examples.
#HOME_SEARCH_VEL = 4.0
#HOME_LATCH_VEL = 0.8
# ========================================================
# AXIS CONFIGURATION
# ========================================================
[AXIS_X]
#MIN_LIMIT = -200.0 #disabled to give more space for testing g-codes
#MAX_LIMIT = 200.0 #disabled to give more space for testing g-codes
MAX_VELOCITY = 300.0
MAX_ACCELERATION = 1000.0
# MAX_JERK: Maximum jerk for coordinated motion on this axis
# Units: machine-units/second^3
# Default: 0.0 (disabled)
MAX_JERK = 10000.0
[AXIS_Y]
#MIN_LIMIT = -200.0 #disabled to give more space for testing g-codes
#MAX_LIMIT = 200.0 #disabled to give more space for testing g-codes
MAX_VELOCITY = 300.0
MAX_ACCELERATION = 1000.0
MAX_JERK = 10000.0
[AXIS_Z]
#MIN_LIMIT = -100.0 #disabled to give more space for testing g-codes
#MAX_LIMIT = 100.0 #disabled to give more space for testing g-codes
MAX_VELOCITY = 200.0
MAX_ACCELERATION = 800.0
MAX_JERK = 10000.0
# ========================================================
# TUNING GUIDELINES
# ========================================================
#
# 1. START WITH TRAPEZOIDAL (PLANNER_TYPE=0)
# - Verify your machine works correctly with traditional planning
# - Note any vibration or resonance issues
#
# 2. ENABLE S-CURVE WITH CONSERVATIVE VALUES
# - Set PLANNER_TYPE = 1
# - Start with low MAX_LINEAR_JERK (e.g., 100-500)
# - Jerk should typically be 10-100x your acceleration value
#
# 3. GRADUALLY INCREASE JERK
# - Increase MAX_LINEAR_JERK in steps of 2-3x
# - Test with simple moves and observe:
# * Motor current/torque
# * Vibration levels
# * Following errors
# * Surface finish quality
#
# 4. FIND OPTIMAL VALUE
# - Too low: Motion becomes sluggish, cycle time increases
# - Too high: Approaches trapezoidal behavior, loses smoothness
# - Optimal: Smooth motion without excessive deceleration
#
# 5. VERIFY COORDINATED MOTION
# - Test circular interpolation (G2/G3)
# - Check complex 3D toolpaths
# - Verify axis jerk limits don't constrain trajectory jerk
#
# ========================================================
# TROUBLESHOOTING
# ========================================================
#
# SYMPTOM: No difference between PLANNER_TYPE=0 and PLANNER_TYPE=1
# SOLUTION: Verify MAX_LINEAR_JERK > 0 and MAX_JERK > 0 for all joints/axes
#
# SYMPTOM: Motion is too slow with S-curve enabled
# SOLUTION: Increase MAX_LINEAR_JERK value
#
# SYMPTOM: Following errors increase with S-curve
# SOLUTION: Decrease MAX_LINEAR_JERK or increase PID I-gain
#
# SYMPTOM: Vibration/resonance at certain speeds
# SOLUTION: Adjust MAX_LINEAR_JERK to avoid resonant frequencies
# Consider using different jerk values for different axes
#
# ========================================================