Skip to content

Commit cb95241

Browse files
committed
XYZ references changed to ABC
1 parent da5c65b commit cb95241

File tree

9 files changed

+105
-105
lines changed

9 files changed

+105
-105
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
# is connected.
2929
# FUSES ........ Parameters for avrdude to flash the fuses appropriately.
3030

31-
DEVICE ?= atmega328p
31+
DEVICE ?= atmega2560
3232
CLOCK = 16000000
3333
PROGRAMMER ?= -c avrisp2 -P usb
3434
SOURCE = main.c motion_control.c gcode.c spindle_control.c coolant_control.c serial.c \

grbl/config.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
// Default cpu mappings. Grbl officially supports the Arduino Uno only. Other processor types
4040
// may exist from user-supplied templates or directly user-defined in cpu_map.h
41-
#define CPU_MAP_ATMEGA328P // Arduino Uno CPU
41+
#define CPU_MAP_ATMEGA2560 // Arduino Uno CPU
4242

4343
// Define realtime command special characters. These characters are 'picked-off' directly from the
4444
// serial read data stream and are not passed to the grbl line execution parser. Select characters
@@ -72,8 +72,8 @@
7272
// on separate pin, but homed in one cycle. Also, it should be noted that the function of hard limits
7373
// will not be affected by pin sharing.
7474
// 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.
75+
#define HOMING_CYCLE_0 (1<<C_AXIS) // REQUIRED: First move Z to clear workspace.
76+
#define HOMING_CYCLE_1 ((1<<A_AXIS)|(1<<B_AXIS)) // OPTIONAL: Then move X,Y at the same time.
7777
// #define HOMING_CYCLE_2 // OPTIONAL: Uncomment and add axes mask to enable
7878

7979
// Number of homing cycles performed after when the machine initially jogs to limit switches.
@@ -238,7 +238,7 @@
238238
// Sets which axis the tool length offset is applied. Assumes the spindle is always parallel with
239239
// the selected axis with the tool oriented toward the negative direction. In other words, a positive
240240
// 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.
241+
#define TOOL_LENGTH_OFFSET_AXIS C_AXIS // Default z-axis. Valid values are X_AXIS, Y_AXIS, or Z_AXIS.
242242

243243
// Enables variable spindle output voltage for different RPM values. On the Arduino Uno, the spindle
244244
// enable pin will output 5V for maximum RPM with 256 intermediate levels and 0V when disabled.

grbl/cpu_map/cpu_map_atmega2560.h

+12-12
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,19 @@
4242
#define STEP_DDR DDRA
4343
#define STEP_PORT PORTA
4444
#define STEP_PIN PINA
45-
#define X_STEP_BIT 2 // MEGA2560 Digital Pin 24
46-
#define Y_STEP_BIT 3 // MEGA2560 Digital Pin 25
47-
#define Z_STEP_BIT 4 // MEGA2560 Digital Pin 26
48-
#define STEP_MASK ((1<<X_STEP_BIT)|(1<<Y_STEP_BIT)|(1<<Z_STEP_BIT)) // All step bits
45+
#define A_STEP_BIT 0 // MEGA2560 Digital Pin 22
46+
#define B_STEP_BIT 1 // MEGA2560 Digital Pin 23
47+
#define C_STEP_BIT 2 // MEGA2560 Digital Pin 24
48+
#define STEP_MASK ((1<<A_STEP_BIT)|(1<<B_STEP_BIT)|(1<<C_STEP_BIT)) // All step bits
4949

5050
// Define step direction output pins. NOTE: All direction pins must be on the same port.
5151
#define DIRECTION_DDR DDRC
5252
#define DIRECTION_PORT PORTC
5353
#define DIRECTION_PIN PINC
54-
#define X_DIRECTION_BIT 7 // MEGA2560 Digital Pin 30
55-
#define Y_DIRECTION_BIT 6 // MEGA2560 Digital Pin 31
56-
#define Z_DIRECTION_BIT 5 // MEGA2560 Digital Pin 32
57-
#define DIRECTION_MASK ((1<<X_DIRECTION_BIT)|(1<<Y_DIRECTION_BIT)|(1<<Z_DIRECTION_BIT)) // All direction bits
54+
#define A_DIRECTION_BIT 7 // MEGA2560 Digital Pin 30
55+
#define B_DIRECTION_BIT 6 // MEGA2560 Digital Pin 31
56+
#define C_DIRECTION_BIT 5 // MEGA2560 Digital Pin 32
57+
#define DIRECTION_MASK ((1<<A_DIRECTION_BIT)|(1<<B_DIRECTION_BIT)|(1<<C_DIRECTION_BIT)) // All direction bits
5858

5959
// Define stepper driver enable/disable output pin.
6060
#define STEPPERS_DISABLE_DDR DDRB
@@ -67,13 +67,13 @@
6767
#define LIMIT_DDR DDRB
6868
#define LIMIT_PORT PORTB
6969
#define LIMIT_PIN PINB
70-
#define X_LIMIT_BIT 4 // MEGA2560 Digital Pin 10
71-
#define Y_LIMIT_BIT 5 // MEGA2560 Digital Pin 11
72-
#define Z_LIMIT_BIT 6 // MEGA2560 Digital Pin 12
70+
#define A_LIMIT_BIT 4 // MEGA2560 Digital Pin 10
71+
#define B_LIMIT_BIT 5 // MEGA2560 Digital Pin 11
72+
#define C_LIMIT_BIT 6 // MEGA2560 Digital Pin 12
7373
#define LIMIT_INT PCIE0 // Pin change interrupt enable pin
7474
#define LIMIT_INT_vect PCINT0_vect
7575
#define LIMIT_PCMSK PCMSK0 // Pin change interrupt register
76-
#define LIMIT_MASK ((1<<X_LIMIT_BIT)|(1<<Y_LIMIT_BIT)|(1<<Z_LIMIT_BIT)) // All limit bits
76+
#define LIMIT_MASK ((1<<A_LIMIT_BIT)|(1<<B_LIMIT_BIT)|(1<<C_LIMIT_BIT)) // All limit bits
7777

7878
// Define spindle enable and spindle direction output pins.
7979
#define SPINDLE_ENABLE_DDR DDRH

grbl/defaults/defaults_generic.h

+12-12
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,18 @@
2828
#define defaults_h
2929

3030
// Grbl generic default settings. Should work across different machines.
31-
#define DEFAULT_X_STEPS_PER_MM 250.0
32-
#define DEFAULT_Y_STEPS_PER_MM 250.0
33-
#define DEFAULT_Z_STEPS_PER_MM 250.0
34-
#define DEFAULT_X_MAX_RATE 500.0 // mm/min
35-
#define DEFAULT_Y_MAX_RATE 500.0 // mm/min
36-
#define DEFAULT_Z_MAX_RATE 500.0 // mm/min
37-
#define DEFAULT_X_ACCELERATION (10.0*60*60) // 10*60*60 mm/min^2 = 10 mm/sec^2
38-
#define DEFAULT_Y_ACCELERATION (10.0*60*60) // 10*60*60 mm/min^2 = 10 mm/sec^2
39-
#define DEFAULT_Z_ACCELERATION (10.0*60*60) // 10*60*60 mm/min^2 = 10 mm/sec^2
40-
#define DEFAULT_X_MAX_TRAVEL 200.0 // mm
41-
#define DEFAULT_Y_MAX_TRAVEL 200.0 // mm
42-
#define DEFAULT_Z_MAX_TRAVEL 200.0 // mm
31+
#define DEFAULT_A_STEPS_PER_MM 250.0
32+
#define DEFAULT_B_STEPS_PER_MM 250.0
33+
#define DEFAULT_C_STEPS_PER_MM 250.0
34+
#define DEFAULT_A_MAX_RATE 500.0 // mm/min
35+
#define DEFAULT_B_MAX_RATE 500.0 // mm/min
36+
#define DEFAULT_C_MAX_RATE 500.0 // mm/min
37+
#define DEFAULT_A_ACCELERATION (10.0*60*60) // 10*60*60 mm/min^2 = 10 mm/sec^2
38+
#define DEFAULT_B_ACCELERATION (10.0*60*60) // 10*60*60 mm/min^2 = 10 mm/sec^2
39+
#define DEFAULT_C_ACCELERATION (10.0*60*60) // 10*60*60 mm/min^2 = 10 mm/sec^2
40+
#define DEFAULT_A_MAX_TRAVEL 200.0 // mm
41+
#define DEFAULT_B_MAX_TRAVEL 200.0 // mm
42+
#define DEFAULT_C_MAX_TRAVEL 200.0 // mm
4343
#define DEFAULT_STEP_PULSE_MICROSECONDS 10
4444
#define DEFAULT_STEPPING_INVERT_MASK 0
4545
#define DEFAULT_DIRECTION_INVERT_MASK 0

grbl/gcode.c

+15-15
Original file line numberDiff line numberDiff line change
@@ -334,9 +334,9 @@ uint8_t gc_execute_line(char *line)
334334
// case 'D': // Not supported
335335
case 'F': word_bit = WORD_F; gc_block.values.f = value; break;
336336
// case 'H': // Not supported
337-
case 'I': word_bit = WORD_I; gc_block.values.ijk[X_AXIS] = value; ijk_words |= (1<<X_AXIS); break;
338-
case 'J': word_bit = WORD_J; gc_block.values.ijk[Y_AXIS] = value; ijk_words |= (1<<Y_AXIS); break;
339-
case 'K': word_bit = WORD_K; gc_block.values.ijk[Z_AXIS] = value; ijk_words |= (1<<Z_AXIS); break;
337+
case 'I': word_bit = WORD_I; gc_block.values.ijk[A_AXIS] = value; ijk_words |= (1<<A_AXIS); break;
338+
case 'J': word_bit = WORD_J; gc_block.values.ijk[B_AXIS] = value; ijk_words |= (1<<B_AXIS); break;
339+
case 'K': word_bit = WORD_K; gc_block.values.ijk[C_AXIS] = value; ijk_words |= (1<<C_AXIS); break;
340340
case 'L': word_bit = WORD_L; gc_block.values.l = int_value; break;
341341
case 'N': word_bit = WORD_N; gc_block.values.n = trunc(value); break;
342342
case 'P': word_bit = WORD_P; gc_block.values.p = value; break;
@@ -345,9 +345,9 @@ uint8_t gc_execute_line(char *line)
345345
case 'R': word_bit = WORD_R; gc_block.values.r = value; break;
346346
case 'S': word_bit = WORD_S; gc_block.values.s = value; break;
347347
case 'T': word_bit = WORD_T; break; // gc.values.t = int_value;
348-
case 'X': word_bit = WORD_X; gc_block.values.xyz[X_AXIS] = value; axis_words |= (1<<X_AXIS); break;
349-
case 'Y': word_bit = WORD_Y; gc_block.values.xyz[Y_AXIS] = value; axis_words |= (1<<Y_AXIS); break;
350-
case 'Z': word_bit = WORD_Z; gc_block.values.xyz[Z_AXIS] = value; axis_words |= (1<<Z_AXIS); break;
348+
case 'X': word_bit = WORD_X; gc_block.values.xyz[A_AXIS] = value; axis_words |= (1<<A_AXIS); break;
349+
case 'Y': word_bit = WORD_Y; gc_block.values.xyz[B_AXIS] = value; axis_words |= (1<<B_AXIS); break;
350+
case 'Z': word_bit = WORD_Z; gc_block.values.xyz[C_AXIS] = value; axis_words |= (1<<C_AXIS); break;
351351
default: FAIL(STATUS_GCODE_UNSUPPORTED_COMMAND);
352352
}
353353

@@ -469,19 +469,19 @@ uint8_t gc_execute_line(char *line)
469469
// [11. Set active plane ]: N/A
470470
switch (gc_block.modal.plane_select) {
471471
case PLANE_SELECT_XY:
472-
axis_0 = X_AXIS;
473-
axis_1 = Y_AXIS;
474-
axis_linear = Z_AXIS;
472+
axis_0 = A_AXIS;
473+
axis_1 = B_AXIS;
474+
axis_linear = C_AXIS;
475475
break;
476476
case PLANE_SELECT_ZX:
477-
axis_0 = Z_AXIS;
478-
axis_1 = X_AXIS;
479-
axis_linear = Y_AXIS;
477+
axis_0 = C_AXIS;
478+
axis_1 = A_AXIS;
479+
axis_linear = B_AXIS;
480480
break;
481481
default: // case PLANE_SELECT_YZ:
482-
axis_0 = Y_AXIS;
483-
axis_1 = Z_AXIS;
484-
axis_linear = X_AXIS;
482+
axis_0 = B_AXIS;
483+
axis_1 = C_AXIS;
484+
axis_linear = A_AXIS;
485485
}
486486

487487
// [12. Set length units ]: N/A

grbl/nuts_bolts.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727

2828
// Axis array index values. Must start with 0 and be continuous.
2929
#define N_AXIS 3 // Number of axes
30-
#define X_AXIS 0 // Axis indexing value.
31-
#define Y_AXIS 1
32-
#define Z_AXIS 2
30+
#define A_AXIS 0 // Axis indexing value.
31+
#define B_AXIS 1
32+
#define C_AXIS 2
3333
// #define A_AXIS 3
3434

3535
// CoreXY motor assignments. DO NOT ALTER.

grbl/report.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,9 @@ void report_grbl_settings() {
243243
#else
244244
printPgmString(PSTR(" ("));
245245
switch (idx) {
246-
case X_AXIS: printPgmString(PSTR("x")); break;
247-
case Y_AXIS: printPgmString(PSTR("y")); break;
248-
case Z_AXIS: printPgmString(PSTR("z")); break;
246+
case A_AXIS: printPgmString(PSTR("a")); break;
247+
case B_AXIS: printPgmString(PSTR("b")); break;
248+
case C_AXIS: printPgmString(PSTR("c")); break;
249249
}
250250
switch (set_idx) {
251251
case 0: printPgmString(PSTR(", step/mm")); break;

grbl/settings.c

+21-21
Original file line numberDiff line numberDiff line change
@@ -79,18 +79,18 @@ void settings_restore(uint8_t restore_flag) {
7979
if (DEFAULT_HARD_LIMIT_ENABLE) { settings.flags |= BITFLAG_HARD_LIMIT_ENABLE; }
8080
if (DEFAULT_HOMING_ENABLE) { settings.flags |= BITFLAG_HOMING_ENABLE; }
8181

82-
settings.steps_per_mm[X_AXIS] = DEFAULT_X_STEPS_PER_MM;
83-
settings.steps_per_mm[Y_AXIS] = DEFAULT_Y_STEPS_PER_MM;
84-
settings.steps_per_mm[Z_AXIS] = DEFAULT_Z_STEPS_PER_MM;
85-
settings.max_rate[X_AXIS] = DEFAULT_X_MAX_RATE;
86-
settings.max_rate[Y_AXIS] = DEFAULT_Y_MAX_RATE;
87-
settings.max_rate[Z_AXIS] = DEFAULT_Z_MAX_RATE;
88-
settings.acceleration[X_AXIS] = DEFAULT_X_ACCELERATION;
89-
settings.acceleration[Y_AXIS] = DEFAULT_Y_ACCELERATION;
90-
settings.acceleration[Z_AXIS] = DEFAULT_Z_ACCELERATION;
91-
settings.max_travel[X_AXIS] = (-DEFAULT_X_MAX_TRAVEL);
92-
settings.max_travel[Y_AXIS] = (-DEFAULT_Y_MAX_TRAVEL);
93-
settings.max_travel[Z_AXIS] = (-DEFAULT_Z_MAX_TRAVEL);
82+
settings.steps_per_mm[A_AXIS] = DEFAULT_A_STEPS_PER_MM;
83+
settings.steps_per_mm[B_AXIS] = DEFAULT_B_STEPS_PER_MM;
84+
settings.steps_per_mm[C_AXIS] = DEFAULT_C_STEPS_PER_MM;
85+
settings.max_rate[A_AXIS] = DEFAULT_A_MAX_RATE;
86+
settings.max_rate[B_AXIS] = DEFAULT_B_MAX_RATE;
87+
settings.max_rate[C_AXIS] = DEFAULT_C_MAX_RATE;
88+
settings.acceleration[A_AXIS] = DEFAULT_A_ACCELERATION;
89+
settings.acceleration[B_AXIS] = DEFAULT_B_ACCELERATION;
90+
settings.acceleration[C_AXIS] = DEFAULT_C_ACCELERATION;
91+
settings.max_travel[A_AXIS] = (-DEFAULT_A_MAX_TRAVEL);
92+
settings.max_travel[B_AXIS] = (-DEFAULT_B_MAX_TRAVEL);
93+
settings.max_travel[C_AXIS] = (-DEFAULT_C_MAX_TRAVEL);
9494

9595
write_global_settings();
9696
}
@@ -299,25 +299,25 @@ void settings_init() {
299299
// Returns step pin mask according to Grbl internal axis indexing.
300300
uint8_t get_step_pin_mask(uint8_t axis_idx)
301301
{
302-
if ( axis_idx == X_AXIS ) { return((1<<X_STEP_BIT)); }
303-
if ( axis_idx == Y_AXIS ) { return((1<<Y_STEP_BIT)); }
304-
return((1<<Z_STEP_BIT));
302+
if ( axis_idx == A_AXIS ) { return((1<<A_STEP_BIT)); }
303+
if ( axis_idx == B_AXIS ) { return((1<<B_STEP_BIT)); }
304+
return((1<<C_STEP_BIT));
305305
}
306306

307307

308308
// Returns direction pin mask according to Grbl internal axis indexing.
309309
uint8_t get_direction_pin_mask(uint8_t axis_idx)
310310
{
311-
if ( axis_idx == X_AXIS ) { return((1<<X_DIRECTION_BIT)); }
312-
if ( axis_idx == Y_AXIS ) { return((1<<Y_DIRECTION_BIT)); }
313-
return((1<<Z_DIRECTION_BIT));
311+
if ( axis_idx == A_AXIS ) { return((1<<A_DIRECTION_BIT)); }
312+
if ( axis_idx == B_AXIS ) { return((1<<B_DIRECTION_BIT)); }
313+
return((1<<C_DIRECTION_BIT));
314314
}
315315

316316

317317
// Returns limit pin mask according to Grbl internal axis indexing.
318318
uint8_t get_limit_pin_mask(uint8_t axis_idx)
319319
{
320-
if ( axis_idx == X_AXIS ) { return((1<<X_LIMIT_BIT)); }
321-
if ( axis_idx == Y_AXIS ) { return((1<<Y_LIMIT_BIT)); }
322-
return((1<<Z_LIMIT_BIT));
320+
if ( axis_idx == A_AXIS ) { return((1<<A_LIMIT_BIT)); }
321+
if ( axis_idx == B_AXIS ) { return((1<<B_LIMIT_BIT)); }
322+
return((1<<C_LIMIT_BIT));
323323
}

grbl/stepper.c

+34-34
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ static segment_t segment_buffer[SEGMENT_BUFFER_SIZE];
7777
// Stepper ISR data struct. Contains the running data for the main stepper ISR.
7878
typedef struct {
7979
// Used by the bresenham line algorithm
80-
uint32_t counter_x, // Counter variables for the bresenham line tracer
81-
counter_y,
82-
counter_z;
80+
uint32_t counter_a, // Counter variables for the bresenham line tracer
81+
counter_b,
82+
counter_c;
8383
#ifdef STEP_PULSE_DELAY
8484
uint8_t step_bits; // Stores out_bits output to complete the step pulse delay
8585
#endif
@@ -324,15 +324,15 @@ ISR(TIMER1_COMPA_vect)
324324
st.exec_block = &st_block_buffer[st.exec_block_index];
325325

326326
// Initialize Bresenham line and distance counters
327-
st.counter_x = st.counter_y = st.counter_z = (st.exec_block->step_event_count >> 1);
327+
st.counter_a = st.counter_b = st.counter_c = (st.exec_block->step_event_count >> 1);
328328
}
329329
st.dir_outbits = st.exec_block->direction_bits ^ dir_port_invert_mask;
330330

331331
#ifdef ADAPTIVE_MULTI_AXIS_STEP_SMOOTHING
332332
// With AMASS enabled, adjust Bresenham axis increment counters according to AMASS level.
333-
st.steps[X_AXIS] = st.exec_block->steps[X_AXIS] >> st.exec_segment->amass_level;
334-
st.steps[Y_AXIS] = st.exec_block->steps[Y_AXIS] >> st.exec_segment->amass_level;
335-
st.steps[Z_AXIS] = st.exec_block->steps[Z_AXIS] >> st.exec_segment->amass_level;
333+
st.steps[A_AXIS] = st.exec_block->steps[A_AXIS] >> st.exec_segment->amass_level;
334+
st.steps[B_AXIS] = st.exec_block->steps[B_AXIS] >> st.exec_segment->amass_level;
335+
st.steps[C_AXIS] = st.exec_block->steps[C_AXIS] >> st.exec_segment->amass_level;
336336
#endif
337337

338338
} else {
@@ -352,37 +352,37 @@ ISR(TIMER1_COMPA_vect)
352352

353353
// Execute step displacement profile by Bresenham line algorithm
354354
#ifdef ADAPTIVE_MULTI_AXIS_STEP_SMOOTHING
355-
st.counter_x += st.steps[X_AXIS];
355+
st.counter_a += st.steps[A_AXIS];
356356
#else
357-
st.counter_x += st.exec_block->steps[X_AXIS];
357+
st.counter_a += st.exec_block->steps[A_AXIS];
358358
#endif
359-
if (st.counter_x > st.exec_block->step_event_count) {
360-
st.step_outbits |= (1<<X_STEP_BIT);
361-
st.counter_x -= st.exec_block->step_event_count;
362-
if (st.exec_block->direction_bits & (1<<X_DIRECTION_BIT)) { sys.position[X_AXIS]--; }
363-
else { sys.position[X_AXIS]++; }
359+
if (st.counter_a > st.exec_block->step_event_count) {
360+
st.step_outbits |= (1<<A_STEP_BIT);
361+
st.counter_a -= st.exec_block->step_event_count;
362+
if (st.exec_block->direction_bits & (1<<A_DIRECTION_BIT)) { sys.position[A_AXIS]--; }
363+
else { sys.position[A_AXIS]++; }
364364
}
365365
#ifdef ADAPTIVE_MULTI_AXIS_STEP_SMOOTHING
366-
st.counter_y += st.steps[Y_AXIS];
366+
st.counter_b += st.steps[B_AXIS];
367367
#else
368-
st.counter_y += st.exec_block->steps[Y_AXIS];
368+
st.counter_b += st.exec_block->steps[B_AXIS];
369369
#endif
370-
if (st.counter_y > st.exec_block->step_event_count) {
371-
st.step_outbits |= (1<<Y_STEP_BIT);
372-
st.counter_y -= st.exec_block->step_event_count;
373-
if (st.exec_block->direction_bits & (1<<Y_DIRECTION_BIT)) { sys.position[Y_AXIS]--; }
374-
else { sys.position[Y_AXIS]++; }
370+
if (st.counter_b > st.exec_block->step_event_count) {
371+
st.step_outbits |= (1<<B_STEP_BIT);
372+
st.counter_b -= st.exec_block->step_event_count;
373+
if (st.exec_block->direction_bits & (1<<B_DIRECTION_BIT)) { sys.position[B_AXIS]--; }
374+
else { sys.position[B_AXIS]++; }
375375
}
376376
#ifdef ADAPTIVE_MULTI_AXIS_STEP_SMOOTHING
377-
st.counter_z += st.steps[Z_AXIS];
377+
st.counter_c += st.steps[C_AXIS];
378378
#else
379-
st.counter_z += st.exec_block->steps[Z_AXIS];
379+
st.counter_c += st.exec_block->steps[C_AXIS];
380380
#endif
381-
if (st.counter_z > st.exec_block->step_event_count) {
382-
st.step_outbits |= (1<<Z_STEP_BIT);
383-
st.counter_z -= st.exec_block->step_event_count;
384-
if (st.exec_block->direction_bits & (1<<Z_DIRECTION_BIT)) { sys.position[Z_AXIS]--; }
385-
else { sys.position[Z_AXIS]++; }
381+
if (st.counter_c > st.exec_block->step_event_count) {
382+
st.step_outbits |= (1<<C_STEP_BIT);
383+
st.counter_c -= st.exec_block->step_event_count;
384+
if (st.exec_block->direction_bits & (1<<C_DIRECTION_BIT)) { sys.position[C_AXIS]--; }
385+
else { sys.position[C_AXIS]++; }
386386
}
387387

388388
// During a homing cycle, lock out and prevent desired axes from moving.
@@ -548,17 +548,17 @@ void st_prep_buffer()
548548
st_prep_block = &st_block_buffer[prep.st_block_index];
549549
st_prep_block->direction_bits = pl_block->direction_bits;
550550
#ifndef ADAPTIVE_MULTI_AXIS_STEP_SMOOTHING
551-
st_prep_block->steps[X_AXIS] = pl_block->steps[X_AXIS];
552-
st_prep_block->steps[Y_AXIS] = pl_block->steps[Y_AXIS];
553-
st_prep_block->steps[Z_AXIS] = pl_block->steps[Z_AXIS];
551+
st_prep_block->steps[A_AXIS] = pl_block->steps[A_AXIS];
552+
st_prep_block->steps[B_AXIS] = pl_block->steps[B_AXIS];
553+
st_prep_block->steps[C_AXIS] = pl_block->steps[C_AXIS];
554554
st_prep_block->step_event_count = pl_block->step_event_count;
555555
#else
556556
// With AMASS enabled, simply bit-shift multiply all Bresenham data by the max AMASS
557557
// level, such that we never divide beyond the original data anywhere in the algorithm.
558558
// If the original data is divided, we can lose a step from integer roundoff.
559-
st_prep_block->steps[X_AXIS] = pl_block->steps[X_AXIS] << MAX_AMASS_LEVEL;
560-
st_prep_block->steps[Y_AXIS] = pl_block->steps[Y_AXIS] << MAX_AMASS_LEVEL;
561-
st_prep_block->steps[Z_AXIS] = pl_block->steps[Z_AXIS] << MAX_AMASS_LEVEL;
559+
st_prep_block->steps[A_AXIS] = pl_block->steps[A_AXIS] << MAX_AMASS_LEVEL;
560+
st_prep_block->steps[B_AXIS] = pl_block->steps[B_AXIS] << MAX_AMASS_LEVEL;
561+
st_prep_block->steps[C_AXIS] = pl_block->steps[C_AXIS] << MAX_AMASS_LEVEL;
562562
st_prep_block->step_event_count = pl_block->step_event_count << MAX_AMASS_LEVEL;
563563
#endif
564564

0 commit comments

Comments
 (0)