From f7083b9491dd14cc4d167b67a51555df865c02c8 Mon Sep 17 00:00:00 2001 From: cprezzi Date: Thu, 11 May 2017 19:58:41 +0200 Subject: [PATCH] Added 4.axes (A) and moved default settings to defaults.h and cpu-map.h --- doc/markdown/settings.md | 8 ++ doc/media/Thumbs.db | Bin 0 -> 29696 bytes grbl-lpc/current_control.cpp | 2 +- grbl/config.h | 157 ++--------------------------------- grbl/cpu_map.h | 156 +++++++++++++++++++++++++++++++++- grbl/defaults.h | 92 +++++++++++++++++++- grbl/gcode.c | 64 +++++++------- grbl/gcode.h | 3 +- grbl/grbl.h | 2 +- grbl/jog.c | 4 +- grbl/motion_control.c | 3 + grbl/motion_control.h | 3 + grbl/nuts_bolts.h | 6 +- grbl/planner.c | 1 + grbl/report.c | 3 + grbl/settings.c | 33 +++++++- grbl/settings.h | 2 +- grbl/stepper.c | 43 +++++++++- grbl/system.c | 3 + 19 files changed, 385 insertions(+), 200 deletions(-) create mode 100644 doc/media/Thumbs.db diff --git a/doc/markdown/settings.md b/doc/markdown/settings.md index 4b54746..f653c8c 100644 --- a/doc/markdown/settings.md +++ b/doc/markdown/settings.md @@ -51,6 +51,7 @@ $27=1.000 $30=1000. $31=0. $32=0 +$33=5000 $100=250.000 $101=250.000 $102=250.000 @@ -63,6 +64,9 @@ $122=10.000 $130=200.000 $131=200.000 $132=200.000 +$140=0.000 +$141=0.000 +$142=0.000 ``` #### $x=val - Save Grbl setting @@ -227,6 +231,10 @@ When enabled, Grbl will move continuously through consecutive `G1`, `G2`, or `G3 When disabled, Grbl will operate as it always has, stopping motion with every `S` spindle speed command. This is the default operation of a milling machine to allow a pause to let the spindle change speeds. +#### $33 - Spindle/Laser PWM frequency + +This sets the PWM frequency. + #### $100, $101 and $102 – [X,Y,Z] steps/mm Grbl needs to know how far each step will take the tool in reality. To calculate steps/mm for an axis of your machine you need to know: diff --git a/doc/media/Thumbs.db b/doc/media/Thumbs.db new file mode 100644 index 0000000000000000000000000000000000000000..4715c4bb659ef25684f9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N%~SnusBK(ztxbDA(pYZ5HAqm zl%g_~OI=Gp0?lFQNTpj1 z88VlkojB(6R`Seq#>&f$nc(f`y&Fs-7EemT#}X*Dm_*oZSa>E0ZuodfvXKMW23J%2 z>XN&dY*rLAA!(k1Rv6knmrBMPGC0lu7|;F-J-3RTN2c_r^R2wgObpSz2LosJtWR~dUoc&rfZ(rn2?1S?QNBe0fMKJW$oEcz% zEQazBjpMKj`Sa}VyO7lLV}3v0vQRfKJ~46VCi_IC>mPvvj35|6nVY|?B$qKfwmod| z{{1r7Tje<6F=C^85wrSx`)x5{x+0*=@bR`$%A+IDUCMFIODIR -#define STEP_PORT LPC_GPIO2->FIOPIN -#define X_STEP_BIT 0 -#define Y_STEP_BIT 1 -#define Z_STEP_BIT 2 -#define STEP_MASK ((1<FIODIR -#define DIRECTION_PORT LPC_GPIO0->FIOPIN -#define X_DIRECTION_BIT 5 -#define Y_DIRECTION_BIT 11 -#define Z_DIRECTION_BIT 20 -#define DIRECTION_MASK ((1<FIODIR -#define STEPPERS_DISABLE_PORT LPC_GPIO0->FIOPIN -#define X_DISABLE_BIT 4 -#define Y_DISABLE_BIT 10 -#define Z_DISABLE_BIT 19 -#define STEPPERS_DISABLE_MASK ((1<FIODIR -#define LIMIT_PIN LPC_GPIO1->FIOPIN -#define LIMIT_PORT LPC_GPIO1->FIOPIN -#define X_LIMIT_BIT 24 // X-MIN=24, X-MAX=25 -#define Y_LIMIT_BIT 27 // Y-MIN=26, Y-MAX=27 -#define Z_LIMIT_BIT 29 // Z-MIN=28, Z-MAX=29 -#define LIMIT_MASK ((1<FIODIR + #define STEP_PORT LPC_GPIO2->FIOPIN + #define X_STEP_BIT 0 + #define Y_STEP_BIT 1 + #define Z_STEP_BIT 2 + #define A_STEP_BIT 3 + //#define B_STEP_BIT 8 + //#define C_STEP_BIT 9 + #define STEP_MASK ((1<FIODIR + #define DIRECTION_PORT LPC_GPIO0->FIOPIN + #define X_DIRECTION_BIT 5 + #define Y_DIRECTION_BIT 11 + #define Z_DIRECTION_BIT 20 + #define A_DIRECTION_BIT 22 + //#define B_DIRECTION_BIT 13 + //#define C_DIRECTION_BIT NotUsed + #define DIRECTION_MASK ((1<FIODIR + #define STEPPERS_DISABLE_PORT LPC_GPIO0->FIOPIN + #define X_DISABLE_BIT 4 + #define Y_DISABLE_BIT 10 + #define Z_DISABLE_BIT 19 + #define A_DISABLE_BIT 21 + //#define B_DISABLE_BIT 29 + //#define C_DISABLE_BIT NotUsed + #define STEPPERS_DISABLE_MASK ((1<FIODIR + #define LIMIT_PIN LPC_GPIO1->FIOPIN + #define LIMIT_PORT LPC_GPIO1->FIOPIN + #define X_LIMIT_BIT 24 // X-MIN=24, X-MAX=25 + #define Y_LIMIT_BIT 27 // Y-MIN=26, Y-MAX=27 + #define Z_LIMIT_BIT 29 // Z-MIN=28, Z-MAX=29 + #define A_LIMIT_BIT 28 // reuse p1.28, as z-min is not often used + //#define B_LIMIT_BIT NotUsed + //#define C_LIMIT_BIT NotUsed + #define LIMIT_MASK ((1< 62.5kHz + // #define SPINDLE_TCCRB_INIT_MASK (1< 7.8kHz (Used in v0.9) + // #define SPINDLE_TCCRB_INIT_MASK ((1< 1.96kHz + #define SPINDLE_TCCRB_INIT_MASK (1< 0.98kHz (J-tech laser) + + // NOTE: On the 328p, these must be the same as the SPINDLE_ENABLE settings. + #define SPINDLE_PWM_DDR DDRB + #define SPINDLE_PWM_PORT PORTB + #define SPINDLE_PWM_BIT 3 // Uno Digital Pin 11 + */ + +#endif + /* #ifdef CPU_MAP_CUSTOM_PROC // For a custom pin map or different processor, copy and edit one of the available cpu diff --git a/grbl/defaults.h b/grbl/defaults.h index ff30f8a..a3d12db 100644 --- a/grbl/defaults.h +++ b/grbl/defaults.h @@ -32,15 +32,33 @@ #define DEFAULT_X_STEPS_PER_MM 250.0 #define DEFAULT_Y_STEPS_PER_MM 250.0 #define DEFAULT_Z_STEPS_PER_MM 250.0 + #define DEFAULT_A_STEPS_PER_MM 160.0 + //#define DEFAULT_B_STEPS_PER_MM 160.0 + //#define DEFAULT_C_STEPS_PER_MM 160.0 #define DEFAULT_X_MAX_RATE 500.0 // mm/min #define DEFAULT_Y_MAX_RATE 500.0 // mm/min #define DEFAULT_Z_MAX_RATE 500.0 // mm/min + #define DEFAULT_A_MAX_RATE 500.0 // mm/min + //#define DEFAULT_B_MAX_RATE 500.0 // mm/min + //#define DEFAULT_C_MAX_RATE 500.0 // mm/min #define DEFAULT_X_ACCELERATION (10.0*60*60) // 10*60*60 mm/min^2 = 10 mm/sec^2 #define DEFAULT_Y_ACCELERATION (10.0*60*60) // 10*60*60 mm/min^2 = 10 mm/sec^2 #define DEFAULT_Z_ACCELERATION (10.0*60*60) // 10*60*60 mm/min^2 = 10 mm/sec^2 + #define DEFAULT_A_ACCELERATION (10.0*60*60) // 10*60*60 mm/min^2 = 10 mm/sec^2 + //#define DEFAULT_B_ACCELERATION (10.0*60*60) // 10*60*60 mm/min^2 = 10 mm/sec^2 + //#define DEFAULT_C_ACCELERATION (10.0*60*60) // 10*60*60 mm/min^2 = 10 mm/sec^2 + #define DEFAULT_X_CURRENT 0.6 // amps + #define DEFAULT_Y_CURRENT 0.6 // amps + #define DEFAULT_Z_CURRENT 0.0 // amps + #define DEFAULT_A_CURRENT 0.0 // amps + //#define DEFAULT_B_CURRENT 0.0 // amps + //#define DEFAULT_C_CURRENT 0.0 // amps #define DEFAULT_X_MAX_TRAVEL 200.0 // mm NOTE: Must be a positive value. #define DEFAULT_Y_MAX_TRAVEL 200.0 // mm NOTE: Must be a positive value. #define DEFAULT_Z_MAX_TRAVEL 200.0 // mm NOTE: Must be a positive value. + #define DEFAULT_A_MAX_TRAVEL 1.0 // mm NOTE: Must be a positive value. + //#define DEFAULT_B_MAX_TRAVEL 1.0 // mm NOTE: Must be a positive value. + //#define DEFAULT_C_MAX_TRAVEL 1.0 // mm NOTE: Must be a positive value. #define DEFAULT_SPINDLE_PWM_FREQ 5000 // Hz #define DEFAULT_SPINDLE_RPM_MAX 1000.0 // rpm #define DEFAULT_SPINDLE_RPM_MIN 0.0 // rpm @@ -71,19 +89,33 @@ #define DEFAULT_X_STEPS_PER_MM 160.0 #define DEFAULT_Y_STEPS_PER_MM 160.0 #define DEFAULT_Z_STEPS_PER_MM 160.0 + #define DEFAULT_A_STEPS_PER_MM 160.0 + //#define DEFAULT_B_STEPS_PER_MM 160.0 + //#define DEFAULT_C_STEPS_PER_MM 160.0 #define DEFAULT_X_MAX_RATE 24000.0 // mm/min #define DEFAULT_Y_MAX_RATE 24000.0 // mm/min #define DEFAULT_Z_MAX_RATE 24000.0 // mm/min + #define DEFAULT_A_MAX_RATE 24000.0 // mm/min + //#define DEFAULT_B_MAX_RATE 24000.0 // mm/min + //#define DEFAULT_C_MAX_RATE 24000.0 // mm/min #define DEFAULT_X_ACCELERATION (2500.0*60*60) // 10*60*60 mm/min^2 = 10 mm/sec^2 #define DEFAULT_Y_ACCELERATION (2500.0*60*60) // 10*60*60 mm/min^2 = 10 mm/sec^2 #define DEFAULT_Z_ACCELERATION (2500.0*60*60) // 10*60*60 mm/min^2 = 10 mm/sec^2 - #define DEFAULT_X_CURRENT 0.0 // amps - #define DEFAULT_Y_CURRENT 0.0 // amps + #define DEFAULT_A_ACCELERATION (2500.0*60*60) // 10*60*60 mm/min^2 = 10 mm/sec^2 + //#define DEFAULT_B_ACCELERATION (2500.0*60*60) // 10*60*60 mm/min^2 = 10 mm/sec^2 + //#define DEFAULT_C_ACCELERATION (2500.0*60*60) // 10*60*60 mm/min^2 = 10 mm/sec^2 + #define DEFAULT_X_CURRENT 0.6 // amps + #define DEFAULT_Y_CURRENT 0.6 // amps #define DEFAULT_Z_CURRENT 0.0 // amps - #define DEFAULT_A_CURRENT 0.0 // amps + #define DEFAULT_A_CURRENT 0.0 // amps + //#define DEFAULT_B_CURRENT 0.0 // amps + //#define DEFAULT_C_CURRENT 0.0 // amps #define DEFAULT_X_MAX_TRAVEL 300.0 // mm NOTE: Must be a positive value. #define DEFAULT_Y_MAX_TRAVEL 200.0 // mm NOTE: Must be a positive value. - #define DEFAULT_Z_MAX_TRAVEL 50.0 // mm NOTE: Must be a positive value. + #define DEFAULT_Z_MAX_TRAVEL 1.0 // mm NOTE: Must be a positive value. + #define DEFAULT_A_MAX_TRAVEL 1.0 // mm NOTE: Must be a positive value. + //#define DEFAULT_B_MAX_TRAVEL 1.0 // mm NOTE: Must be a positive value. + //#define DEFAULT_C_MAX_TRAVEL 1.0 // mm NOTE: Must be a positive value. #define DEFAULT_SPINDLE_PWM_FREQ 5000 // Hz #define DEFAULT_SPINDLE_RPM_MAX 1000.0 // rpm #define DEFAULT_SPINDLE_RPM_MIN 0.0 // rpm @@ -109,6 +141,49 @@ #define DEFAULT_HOMING_PULLOFF 1.0 // mm #endif +#ifdef DEFAULTS_FABKIT + // Paste default settings definitions here. + #define DEFAULT_X_STEPS_PER_MM 80.0 + #define DEFAULT_Y_STEPS_PER_MM 80.0 + #define DEFAULT_Z_STEPS_PER_MM 640.0 + #define DEFAULT_X_MAX_RATE 30000 // mm/min + #define DEFAULT_Y_MAX_RATE 4500 // mm/min + #define DEFAULT_Z_MAX_RATE 1200 // mm/min + #define DEFAULT_X_ACCELERATION (4000.0*60*60) // 5000*60*60 mm/min^2 = 5000 mm/sec^2 + #define DEFAULT_Y_ACCELERATION (250.0*60*60) // 5000*60*60 mm/min^2 = 5000 mm/sec^2 + #define DEFAULT_Z_ACCELERATION (150.0*60*60) // 5000*60*60 mm/min^2 = 5000 mm/sec^2 + #define DEFAULT_X_CURRENT 1.5 // amps + #define DEFAULT_Y_CURRENT 1.5 // amps + #define DEFAULT_Z_CURRENT 1.5 // amps + #define DEFAULT_A_CURRENT 0.0 // amps + #define DEFAULT_X_MAX_TRAVEL 680.0 // mm + #define DEFAULT_Y_MAX_TRAVEL 460.0 // mm + #define DEFAULT_Z_MAX_TRAVEL 150.0 // mm + #define DEFAULT_SPINDLE_PWM_FREQ 50000 // Hz + #define DEFAULT_SPINDLE_RPM_MAX 0.7 // rpm + #define DEFAULT_SPINDLE_RPM_MIN 0.08 // rpm + #define DEFAULT_STEP_PULSE_MICROSECONDS 1 + #define DEFAULT_STEPPING_INVERT_MASK 0 + #define DEFAULT_DIRECTION_INVERT_MASK 2 + #define DEFAULT_STEPPER_IDLE_LOCK_TIME 255 // msec (0-254, 255 keeps steppers enabled) + #define DEFAULT_STATUS_REPORT_MASK 0 // WPos enabled + #define DEFAULT_JUNCTION_DEVIATION 0.01 // mm + #define DEFAULT_ARC_TOLERANCE 0.002 // mm + #define DEFAULT_REPORT_INCHES 0 // false + #define DEFAULT_INVERT_ST_ENABLE 0 // false + #define DEFAULT_INVERT_LIMIT_PINS 1 // false + #define DEFAULT_SOFT_LIMIT_ENABLE 0 // false + #define DEFAULT_HARD_LIMIT_ENABLE 0 // false + #define DEFAULT_INVERT_PROBE_PIN 0 // false + #define DEFAULT_LASER_MODE 1 // true + #define DEFAULT_HOMING_ENABLE 1 // false + #define DEFAULT_HOMING_DIR_MASK 1 // move positive dir + #define DEFAULT_HOMING_FEED_RATE 60.0 // mm/min + #define DEFAULT_HOMING_SEEK_RATE 6000.0 // mm/min + #define DEFAULT_HOMING_DEBOUNCE_DELAY 250 // msec (0-65k) + #define DEFAULT_HOMING_PULLOFF 1.0 // mm +#endif + #ifdef DEFAULTS_SHERLINE_5400 // Description: Sherline 5400 mill with three NEMA 23 Keling KL23H256-21-8B 185 oz-in stepper motors, // driven by three Pololu A4988 stepper drivers with a 30V, 6A power supply at 1.5A per winding. @@ -127,6 +202,7 @@ #define DEFAULT_X_MAX_TRAVEL 225.0 // mm NOTE: Must be a positive value. #define DEFAULT_Y_MAX_TRAVEL 125.0 // mm NOTE: Must be a positive value. #define DEFAULT_Z_MAX_TRAVEL 170.0 // mm NOTE: Must be a positive value. + #define DEFAULT_SPINDLE_PWM_FREQ 5000 // Hz #define DEFAULT_SPINDLE_RPM_MAX 2800.0 // rpm #define DEFAULT_SPINDLE_RPM_MIN 0.0 // rpm #define DEFAULT_STEP_PULSE_MICROSECONDS 10 @@ -172,6 +248,7 @@ #define DEFAULT_X_MAX_TRAVEL 200.0 // mm NOTE: Must be a positive value. #define DEFAULT_Y_MAX_TRAVEL 200.0 // mm NOTE: Must be a positive value. #define DEFAULT_Z_MAX_TRAVEL 200.0 // mm NOTE: Must be a positive value. + #define DEFAULT_SPINDLE_PWM_FREQ 5000 // Hz #define DEFAULT_SPINDLE_RPM_MAX 10000.0 // rpm #define DEFAULT_SPINDLE_RPM_MIN 0.0 // rpm #define DEFAULT_STEP_PULSE_MICROSECONDS 10 @@ -217,6 +294,7 @@ #define DEFAULT_X_MAX_TRAVEL 290.0 // mm NOTE: Must be a positive value. #define DEFAULT_Y_MAX_TRAVEL 290.0 // mm NOTE: Must be a positive value. #define DEFAULT_Z_MAX_TRAVEL 100.0 // mm NOTE: Must be a positive value. + #define DEFAULT_SPINDLE_PWM_FREQ 5000 // Hz #define DEFAULT_SPINDLE_RPM_MAX 10000.0 // rpm #define DEFAULT_SPINDLE_RPM_MIN 0.0 // rpm #define DEFAULT_STEP_PULSE_MICROSECONDS 10 @@ -261,6 +339,7 @@ #define DEFAULT_X_MAX_TRAVEL 425.0 // mm NOTE: Must be a positive value. #define DEFAULT_Y_MAX_TRAVEL 465.0 // mm NOTE: Must be a positive value. #define DEFAULT_Z_MAX_TRAVEL 80.0 // mm NOTE: Must be a positive value. + #define DEFAULT_SPINDLE_PWM_FREQ 5000 // Hz #define DEFAULT_SPINDLE_RPM_MAX 10000.0 // rpm #define DEFAULT_SPINDLE_RPM_MIN 0.0 // rpm #define DEFAULT_STEP_PULSE_MICROSECONDS 10 @@ -306,6 +385,7 @@ #define DEFAULT_X_MAX_TRAVEL 290.0 // mm NOTE: Must be a positive value. #define DEFAULT_Y_MAX_TRAVEL 290.0 // mm NOTE: Must be a positive value. #define DEFAULT_Z_MAX_TRAVEL 100.0 // mm NOTE: Must be a positive value. + #define DEFAULT_SPINDLE_PWM_FREQ 5000 // Hz #define DEFAULT_SPINDLE_RPM_MAX 10000.0 // rpm #define DEFAULT_SPINDLE_RPM_MIN 0.0 // rpm #define DEFAULT_STEP_PULSE_MICROSECONDS 10 @@ -351,6 +431,7 @@ #define DEFAULT_X_MAX_TRAVEL 740.0 // mm NOTE: Must be a positive value. #define DEFAULT_Y_MAX_TRAVEL 790.0 // mm NOTE: Must be a positive value. #define DEFAULT_Z_MAX_TRAVEL 100.0 // mm NOTE: Must be a positive value. + #define DEFAULT_SPINDLE_PWM_FREQ 5000 // Hz #define DEFAULT_SPINDLE_RPM_MAX 10000.0 // rpm #define DEFAULT_SPINDLE_RPM_MIN 0.0 // rpm #define DEFAULT_STEP_PULSE_MICROSECONDS 10 @@ -394,6 +475,7 @@ #define DEFAULT_X_MAX_TRAVEL 190.0 // mm NOTE: Must be a positive value. #define DEFAULT_Y_MAX_TRAVEL 180.0 // mm NOTE: Must be a positive value. #define DEFAULT_Z_MAX_TRAVEL 150.0 // mm NOTE: Must be a positive value. + #define DEFAULT_SPINDLE_PWM_FREQ 5000 // Hz #define DEFAULT_SPINDLE_RPM_MAX 10000.0 // rpm #define DEFAULT_SPINDLE_RPM_MIN 0.0 // rpm #define DEFAULT_STEP_PULSE_MICROSECONDS 10 @@ -433,6 +515,7 @@ #define DEFAULT_X_MAX_TRAVEL 500.0 // mm NOTE: Must be a positive value. #define DEFAULT_Y_MAX_TRAVEL 750.0 // mm NOTE: Must be a positive value. #define DEFAULT_Z_MAX_TRAVEL 80.0 // mm NOTE: Must be a positive value. + #define DEFAULT_SPINDLE_PWM_FREQ 5000 // Hz #define DEFAULT_SPINDLE_RPM_MAX 1000.0 // rpm #define DEFAULT_SPINDLE_RPM_MIN 0.0 // rpm #define DEFAULT_STEP_PULSE_MICROSECONDS 10 @@ -472,6 +555,7 @@ #define DEFAULT_X_MAX_TRAVEL 1000.0 // mm NOTE: Must be a positive value. #define DEFAULT_Y_MAX_TRAVEL 1000.0 // mm NOTE: Must be a positive value. #define DEFAULT_Z_MAX_TRAVEL 1000.0 // mm NOTE: Must be a positive value. + #define DEFAULT_SPINDLE_PWM_FREQ 5000 // Hz #define DEFAULT_SPINDLE_RPM_MAX 1000.0 // rpm #define DEFAULT_SPINDLE_RPM_MIN 0.0 // rpm #define DEFAULT_STEP_PULSE_MICROSECONDS 10 diff --git a/grbl/gcode.c b/grbl/gcode.c index d4fd2c7..8290484 100644 --- a/grbl/gcode.c +++ b/grbl/gcode.c @@ -80,7 +80,7 @@ uint8_t gc_execute_line(char *line) uint8_t coord_select = 0; // Tracks G10 P coordinate selection for execution // Initialize bitflag tracking variables for axis indices compatible operations. - uint8_t axis_words = 0; // XYZ tracking + uint8_t axis_words = 0; // XYZA tracking uint8_t ijk_words = 0; // IJK tracking // Initialize command and value words and parser flags variables. @@ -296,7 +296,7 @@ uint8_t gc_execute_line(char *line) legal g-code words and stores their value. Error-checking is performed later since some words (I,J,K,L,P,R) have multiple connotations and/or depend on the issued commands. */ switch(letter){ - // case 'A': // Not supported + case 'A': word_bit = WORD_A; gc_block.values.xyza[A_AXIS] = value; axis_words |= (1< MAX_TOOL_NUMBER) { FAIL(STATUS_GCODE_MAX_VALUE_EXCEEDED); } gc_block.values.t = int_value; break; - case 'X': word_bit = WORD_X; gc_block.values.xyz[X_AXIS] = value; axis_words |= (1< WCS = MPos - G92 - TLO - WPos - gc_block.values.ijk[idx] = gc_state.position[idx]-gc_state.coord_offset[idx]-gc_block.values.xyz[idx]; + gc_block.values.ijk[idx] = gc_state.position[idx]-gc_state.coord_offset[idx]-gc_block.values.xyza[idx]; if (idx == TOOL_LENGTH_OFFSET_AXIS) { gc_block.values.ijk[idx] -= gc_state.tool_length_offset; } } else { // L2: Update coordinate system axis to programmed value. - gc_block.values.ijk[idx] = gc_block.values.xyz[idx]; + gc_block.values.ijk[idx] = gc_block.values.xyza[idx]; } } // Else, keep current stored value. } @@ -567,10 +567,10 @@ uint8_t gc_execute_line(char *line) for (idx=0; idx G92 = MPos - WCS - TLO - WPos - gc_block.values.xyz[idx] = gc_state.position[idx]-block_coord_system[idx]-gc_block.values.xyz[idx]; - if (idx == TOOL_LENGTH_OFFSET_AXIS) { gc_block.values.xyz[idx] -= gc_state.tool_length_offset; } + gc_block.values.xyza[idx] = gc_state.position[idx]-block_coord_system[idx]-gc_block.values.xyza[idx]; + if (idx == TOOL_LENGTH_OFFSET_AXIS) { gc_block.values.xyza[idx] -= gc_state.tool_length_offset; } } else { - gc_block.values.xyz[idx] = gc_state.coord_offset[idx]; + gc_block.values.xyza[idx] = gc_state.coord_offset[idx]; } } break; @@ -585,17 +585,17 @@ uint8_t gc_execute_line(char *line) if (axis_words) { for (idx=0; idxcondition |= PL_COND_FLAG_RAPID_MOTION; // Set rapid motion condition flag. - if (axis_command) { mc_line(gc_block.values.xyz, pl_data); } + if (axis_command) { mc_line(gc_block.values.xyza, pl_data); } mc_line(gc_block.values.ijk, pl_data); memcpy(gc_state.position, gc_block.values.ijk, N_AXIS*sizeof(float)); break; @@ -1033,7 +1033,7 @@ uint8_t gc_execute_line(char *line) settings_write_coord_data(SETTING_INDEX_G30,gc_state.position,false,true); break; case NON_MODAL_SET_COORDINATE_OFFSET: - memcpy(gc_state.coord_offset,gc_block.values.xyz,sizeof(gc_block.values.xyz)); + memcpy(gc_state.coord_offset,gc_block.values.xyza,sizeof(gc_block.values.xyza)); system_flag_wco_change(); break; case NON_MODAL_RESET_COORDINATE_OFFSET: @@ -1051,27 +1051,27 @@ uint8_t gc_execute_line(char *line) if (axis_command == AXIS_COMMAND_MOTION_MODE) { uint8_t gc_update_pos = GC_UPDATE_POS_TARGET; if (gc_state.modal.motion == MOTION_MODE_LINEAR) { - mc_line(gc_block.values.xyz, pl_data); + mc_line(gc_block.values.xyza, pl_data); } else if (gc_state.modal.motion == MOTION_MODE_SEEK) { pl_data->condition |= PL_COND_FLAG_RAPID_MOTION; // Set rapid motion condition flag. - mc_line(gc_block.values.xyz, pl_data); + mc_line(gc_block.values.xyza, pl_data); } else if ((gc_state.modal.motion == MOTION_MODE_CW_ARC) || (gc_state.modal.motion == MOTION_MODE_CCW_ARC)) { - mc_arc(gc_block.values.xyz, pl_data, gc_state.position, gc_block.values.ijk, gc_block.values.r, + mc_arc(gc_block.values.xyza, pl_data, gc_state.position, gc_block.values.ijk, gc_block.values.r, axis_0, axis_1, axis_linear, bit_istrue(gc_parser_flags,GC_PARSER_ARC_IS_CLOCKWISE)); } else { - // NOTE: gc_block.values.xyz is returned from mc_probe_cycle with the updated position value. So + // NOTE: gc_block.values.xyza is returned from mc_probe_cycle with the updated position value. So // upon a successful probing cycle, the machine position and the returned value should be the same. #ifndef ALLOW_FEED_OVERRIDE_DURING_PROBE_CYCLES pl_data->condition |= PL_COND_FLAG_NO_FEED_OVERRIDE; #endif - gc_update_pos = mc_probe_cycle(gc_block.values.xyz, pl_data, gc_parser_flags); + gc_update_pos = mc_probe_cycle(gc_block.values.xyza, pl_data, gc_parser_flags); } // As far as the parser is concerned, the position is now == target. In reality the // motion control system might still be processing the action and the real tool position // in any intermediate location. if (gc_update_pos == GC_UPDATE_POS_TARGET) { - memcpy(gc_state.position, gc_block.values.xyz, sizeof(gc_block.values.xyz)); // gc_state.position[] = gc_block.values.xyz[] + memcpy(gc_state.position, gc_block.values.xyza, sizeof(gc_block.values.xyza)); // gc_state.position[] = gc_block.values.xyza[] } else if (gc_update_pos == GC_UPDATE_POS_SYSTEM) { gc_sync_position(); // gc_state.position[] = sys_position } // == GC_UPDATE_POS_NONE diff --git a/grbl/gcode.h b/grbl/gcode.h index 6cdc61b..7ecc60d 100644 --- a/grbl/gcode.h +++ b/grbl/gcode.h @@ -149,6 +149,7 @@ #define WORD_X 10 #define WORD_Y 11 #define WORD_Z 12 +#define WORD_A 13 // Define g-code parser position updating flags #define GC_UPDATE_POS_TARGET 0 // Must be zero @@ -206,7 +207,7 @@ typedef struct { float r; // Arc radius float s; // Spindle speed uint8_t t; // Tool selection - float xyz[3]; // X,Y,Z Translational axes + float xyza[N_AXIS]; // X,Y,Z,A Translational axes } gc_values_t; diff --git a/grbl/grbl.h b/grbl/grbl.h index ef1c324..2f1e740 100644 --- a/grbl/grbl.h +++ b/grbl/grbl.h @@ -23,7 +23,7 @@ // Grbl versioning system #define GRBL_VERSION "1.1f" -#define GRBL_VERSION_BUILD "20170131" +#define GRBL_VERSION_BUILD "20170511" // Define standard libraries used by Grbl. #include diff --git a/grbl/jog.c b/grbl/jog.c index 553af77..c0ba594 100644 --- a/grbl/jog.c +++ b/grbl/jog.c @@ -33,11 +33,11 @@ uint8_t jog_execute(plan_line_data_t *pl_data, parser_block_t *gc_block) #endif if (bit_istrue(settings.flags,BITFLAG_SOFT_LIMIT_ENABLE)) { - if (system_check_travel_limits(gc_block->values.xyz)) { return(STATUS_TRAVEL_EXCEEDED); } + if (system_check_travel_limits(gc_block->values.xyza)) { return(STATUS_TRAVEL_EXCEEDED); } } // Valid jog command. Plan, set state, and execute. - mc_line(gc_block->values.xyz,pl_data); + mc_line(gc_block->values.xyza,pl_data); if (sys.state == STATE_IDLE) { if (plan_get_current_block() != NULL) { // Check if there is a block to execute. sys.state = STATE_JOG; diff --git a/grbl/motion_control.c b/grbl/motion_control.c index db382bf..a3186cd 100644 --- a/grbl/motion_control.c +++ b/grbl/motion_control.c @@ -227,6 +227,9 @@ void mc_homing_cycle(uint8_t cycle_mask) #ifdef HOMING_CYCLE_2 limits_go_home(HOMING_CYCLE_2); // Homing cycle 2 #endif + #ifdef HOMING_CYCLE_3 + limits_go_home(HOMING_CYCLE_3); // Homing cycle 3 + #endif } protocol_execute_realtime(); // Check for reset and set system abort. diff --git a/grbl/motion_control.h b/grbl/motion_control.h index 0f7531e..e7fa545 100644 --- a/grbl/motion_control.h +++ b/grbl/motion_control.h @@ -31,6 +31,9 @@ #define HOMING_CYCLE_X bit(X_AXIS) #define HOMING_CYCLE_Y bit(Y_AXIS) #define HOMING_CYCLE_Z bit(Z_AXIS) +#define HOMING_CYCLE_A bit(A_AXIS) +//#define HOMING_CYCLE_B bit(B_AXIS) +//#define HOMING_CYCLE_C bit(C_AXIS) // Execute linear motion in absolute millimeter coordinates. Feed rate given in millimeters/second diff --git a/grbl/nuts_bolts.h b/grbl/nuts_bolts.h index f78481b..f90bb88 100644 --- a/grbl/nuts_bolts.h +++ b/grbl/nuts_bolts.h @@ -30,11 +30,13 @@ #define SOME_LARGE_VALUE 1.0E+38 // Axis array index values. Must start with 0 and be continuous. -#define N_AXIS 3 // Number of axes +#define N_AXIS 4 // Number of axes #define X_AXIS 0 // Axis indexing value. #define Y_AXIS 1 #define Z_AXIS 2 -// #define A_AXIS 3 +#define A_AXIS 3 +//#define B_AXIS 4 +//#define C_AXIS 5 // CoreXY motor assignments. DO NOT ALTER. // NOTE: If the A and B motor axis bindings are changed, this effects the CoreXY equations. diff --git a/grbl/planner.c b/grbl/planner.c index 4839bbf..131c068 100644 --- a/grbl/planner.c +++ b/grbl/planner.c @@ -336,6 +336,7 @@ uint8_t plan_buffer_line(float *target, plan_line_data_t *pl_data) position_steps[X_AXIS] = system_convert_corexy_to_x_axis_steps(sys_position); position_steps[Y_AXIS] = system_convert_corexy_to_y_axis_steps(sys_position); position_steps[Z_AXIS] = sys_position[Z_AXIS]; + position_steps[A_AXIS] = sys_position[A_AXIS]; #else memcpy(position_steps, sys_position, sizeof(sys_position)); #endif diff --git a/grbl/report.c b/grbl/report.c index e0508c2..f748d6e 100644 --- a/grbl/report.c +++ b/grbl/report.c @@ -578,6 +578,9 @@ void report_realtime_status() if (bit_istrue(lim_pin_state,bit(X_AXIS))) { serial_write('X'); } if (bit_istrue(lim_pin_state,bit(Y_AXIS))) { serial_write('Y'); } if (bit_istrue(lim_pin_state,bit(Z_AXIS))) { serial_write('Z'); } + if (bit_istrue(lim_pin_state,bit(A_AXIS))) { serial_write('A'); } + //if (bit_istrue(lim_pin_state,bit(B_AXIS))) { serial_write('B'); } + //if (bit_istrue(lim_pin_state,bit(C_AXIS))) { serial_write('C'); } } if (ctrl_pin_state) { #ifdef ENABLE_SAFETY_DOOR_INPUT_PIN diff --git a/grbl/settings.c b/grbl/settings.c index 4900ffc..ed3aabb 100644 --- a/grbl/settings.c +++ b/grbl/settings.c @@ -109,18 +109,33 @@ void settings_restore(uint8_t restore_flag) { settings.steps_per_mm[X_AXIS] = DEFAULT_X_STEPS_PER_MM; settings.steps_per_mm[Y_AXIS] = DEFAULT_Y_STEPS_PER_MM; settings.steps_per_mm[Z_AXIS] = DEFAULT_Z_STEPS_PER_MM; + settings.steps_per_mm[A_AXIS] = DEFAULT_A_STEPS_PER_MM; + //settings.steps_per_mm[B_AXIS] = DEFAULT_B_STEPS_PER_MM; + //settings.steps_per_mm[C_AXIS] = DEFAULT_C_STEPS_PER_MM; settings.max_rate[X_AXIS] = DEFAULT_X_MAX_RATE; settings.max_rate[Y_AXIS] = DEFAULT_Y_MAX_RATE; settings.max_rate[Z_AXIS] = DEFAULT_Z_MAX_RATE; + settings.max_rate[A_AXIS] = DEFAULT_A_MAX_RATE; + //settings.max_rate[B_AXIS] = DEFAULT_B_MAX_RATE; + //settings.max_rate[C_AXIS] = DEFAULT_C_MAX_RATE; settings.acceleration[X_AXIS] = DEFAULT_X_ACCELERATION; settings.acceleration[Y_AXIS] = DEFAULT_Y_ACCELERATION; settings.acceleration[Z_AXIS] = DEFAULT_Z_ACCELERATION; + settings.acceleration[A_AXIS] = DEFAULT_A_ACCELERATION; + //settings.acceleration[B_AXIS] = DEFAULT_B_ACCELERATION; + //settings.acceleration[C_AXIS] = DEFAULT_C_ACCELERATION; settings.max_travel[X_AXIS] = (-DEFAULT_X_MAX_TRAVEL); settings.max_travel[Y_AXIS] = (-DEFAULT_Y_MAX_TRAVEL); settings.max_travel[Z_AXIS] = (-DEFAULT_Z_MAX_TRAVEL); + settings.max_travel[A_AXIS] = (-DEFAULT_A_MAX_TRAVEL); + //settings.max_travel[B_AXIS] = (-DEFAULT_B_MAX_TRAVEL); + //settings.max_travel[C_AXIS] = (-DEFAULT_C_MAX_TRAVEL); settings.current[X_AXIS] = DEFAULT_X_CURRENT; settings.current[Y_AXIS] = DEFAULT_Y_CURRENT; settings.current[Z_AXIS] = DEFAULT_Z_CURRENT; + settings.current[A_AXIS] = DEFAULT_A_CURRENT; + //settings.current[B_AXIS] = DEFAULT_B_CURRENT; + //settings.current[C_AXIS] = DEFAULT_C_CURRENT; write_global_settings(false); } @@ -343,7 +358,11 @@ uint32_t get_step_pin_mask(uint8_t axis_idx) { if ( axis_idx == X_AXIS ) { return((1<steps[X_AXIS] >> st.exec_segment->amass_level; st.steps[Y_AXIS] = st.exec_block->steps[Y_AXIS] >> st.exec_segment->amass_level; st.steps[Z_AXIS] = st.exec_block->steps[Z_AXIS] >> st.exec_segment->amass_level; + st.steps[A_AXIS] = st.exec_block->steps[A_AXIS] >> st.exec_segment->amass_level; + //st.steps[B_AXIS] = st.exec_block->steps[B_AXIS] >> st.exec_segment->amass_level; + //st.steps[C_AXIS] = st.exec_block->steps[C_AXIS] >> st.exec_segment->amass_level; #endif #ifdef VARIABLE_SPINDLE @@ -433,6 +439,41 @@ extern "C" void TIMER1_IRQHandler() if (st.exec_block->direction_bits & (1<steps[A_AXIS]; + #endif + if (st.counter_a > st.exec_block->step_event_count) { + st.step_outbits |= (1<step_event_count; + if (st.exec_block->direction_bits & (1<steps[B_AXIS]; + #endif + if (st.counter_b > st.exec_block->step_event_count) { + st.step_outbits |= (1<step_event_count; + if (st.exec_block->direction_bits & (1<steps[C_AXIS]; + #endif + if (st.counter_c > st.exec_block->step_event_count) { + st.step_outbits |= (1<step_event_count; + if (st.exec_block->direction_bits & (1<