Skip to content

Add Drilling cycles (G81, G82 and G83)#16103

Closed
FNeo31 wants to merge 10 commits intoMarlinFirmware:bugfix-2.0.xfrom
FNeo31:bugfix-2.0.x
Closed

Add Drilling cycles (G81, G82 and G83)#16103
FNeo31 wants to merge 10 commits intoMarlinFirmware:bugfix-2.0.xfrom
FNeo31:bugfix-2.0.x

Conversation

@FNeo31
Copy link

@FNeo31 FNeo31 commented Dec 4, 2019

Description

Add Canned Drilling cycles (G81, G82 and G83)
(need to repeat the G code cycle each position no need to cancel for this reason)
Prepare the develop of 5 axis CNC milling (without RTCP for now)

Increase the number of variables for custom menu (from 5 to 20) and custom CNC Users preset variables to easy probing and define Zeros (G54 to G59)

Need to optimizations in some sections

Benefits

Add Canned Drilling cycles (G81, G82 and G83)

Increase the number of variables for custom menu (from 5 to 20)

Related Issues

[FR] Add Drilling canned cycles to Marlin 2.0 #14448
Add G81 and G83 drilling cycles #14225

@boelle boelle changed the title Bugfix 2.0.x - Add Drilling cycles (G81, G82 and G83) Add Drilling cycles (G81, G82 and G83) Dec 7, 2019
@AJMartel
Copy link
Contributor

AJMartel commented Dec 23, 2019

Great work, I like this idea.
Your pull request would probably get more support if you were not using all the custom menus.
Have you thought of implementing your own CNC menu?
It could be used exactly like CUSTOM_USER_MENUS.
The code below is based off of menu_custom.cpp and should get you started:

CNC menu
/**
 * Marlin 3D Printer Firmware
 * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
 *
 * Based on Sprinter and grbl.
 * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
 *
 * This program 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.
 *
 * This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

//
// CNC Menu
//

#include "../../inc/MarlinConfigPre.h"

#if HAS_LCD_MENU && ENABLED(CNC_DRILLING_CYCLE)

#include "menu.h"
#include "../../gcode/queue.h"

#ifdef CNC_SCRIPT_DONE
  #define _DONE_SCRIPT "\n" CNC_SCRIPT_DONE
#else
  #define _DONE_SCRIPT ""
#endif

void _lcd_cnc_gcode(PGM_P const cmd) {
  queue.inject_P(cmd);
  #if ENABLED(CNC_SCRIPT_AUDIBLE_FEEDBACK) && HAS_BUZZER
    ui.completion_feedback();
  #endif
  #if ENABLED(CNC_SCRIPT_RETURN)
    ui.return_to_status();
  #endif
}

void menu_cnc() {
  START_MENU();
  BACK_ITEM(MSG_MAIN);
  #if defined(CNC_DESC_1) && defined(CNC_GCODE_1)
    ACTION_ITEM_P(PSTR(CNC_DESC_1), []{ _lcd_cnc_gcode(PSTR(CNC_GCODE_1 _DONE_SCRIPT)); });
  #endif
  #if defined(CNC_DESC_2) && defined(CNC_GCODE_2)
    ACTION_ITEM_P(PSTR(CNC_DESC_2), []{ _lcd_cnc_gcode(PSTR(CNC_GCODE_2 _DONE_SCRIPT)); });
  #endif
  #if defined(CNC_DESC_3) && defined(CNC_GCODE_3)
    ACTION_ITEM_P(PSTR(CNC_DESC_3), []{ _lcd_cnc_gcode(PSTR(CNC_GCODE_3 _DONE_SCRIPT)); });
  #endif
  #if defined(CNC_DESC_4) && defined(CNC_GCODE_4)
    ACTION_ITEM_P(PSTR(CNC_DESC_4), []{ _lcd_cnc_gcode(PSTR(CNC_GCODE_4 _DONE_SCRIPT)); });
  #endif
  #if defined(CNC_DESC_5) && defined(CNC_GCODE_5)
    ACTION_ITEM_P(PSTR(CNC_DESC_5), []{ _lcd_cnc_gcode(PSTR(CNC_GCODE_5 _DONE_SCRIPT)); });
  #endif
  #if defined(CNC_DESC_6) && defined(CNC_GCODE_6)
    ACTION_ITEM_P(PSTR(CNC_DESC_6), []{ _lcd_cnc_gcode(PSTR(CNC_GCODE_6 _DONE_SCRIPT)); });
  #endif
  #if defined(CNC_DESC_7) && defined(CNC_GCODE_7)
    ACTION_ITEM_P(PSTR(CNC_DESC_7), []{ _lcd_cnc_gcode(PSTR(CNC_GCODE_7 _DONE_SCRIPT)); });
  #endif
  #if defined(CNC_DESC_8) && defined(CNC_GCODE_8)
    ACTION_ITEM_P(PSTR(CNC_DESC_8), []{ _lcd_cnc_gcode(PSTR(CNC_GCODE_8 _DONE_SCRIPT)); });
  #endif
  #if defined(CNC_DESC_9) && defined(CNC_GCODE_9)
    ACTION_ITEM_P(PSTR(CNC_DESC_9), []{ _lcd_cnc_gcode(PSTR(CNC_GCODE_9 _DONE_SCRIPT)); });
  #endif
  #if defined(CNC_DESC_10) && defined(CNC_GCODE_10)
    ACTION_ITEM_P(PSTR(CNC_DESC_10), []{ _lcd_cnc_gcode(PSTR(CNC_GCODE_10 _DONE_SCRIPT)); });
  #endif
  #if defined(CNC_DESC_11) && defined(CNC_GCODE_11)
    ACTION_ITEM_P(PSTR(CNC_DESC_11), []{ _lcd_cnc_gcode(PSTR(CNC_GCODE_11 _DONE_SCRIPT)); });
  #endif
  #if defined(CNC_DESC_12) && defined(CNC_GCODE_12)
    ACTION_ITEM_P(PSTR(CNC_DESC_12), []{ _lcd_cnc_gcode(PSTR(CNC_GCODE_12 _DONE_SCRIPT)); });
  #endif
  #if defined(CNC_DESC_13) && defined(CNC_GCODE_13)
    ACTION_ITEM_P(PSTR(CNC_DESC_13), []{ _lcd_cnc_gcode(PSTR(CNC_GCODE_13 _DONE_SCRIPT)); });
  #endif
  #if defined(CNC_DESC_14) && defined(CNC_GCODE_14)
    ACTION_ITEM_P(PSTR(CNC_DESC_14), []{ _lcd_cnc_gcode(PSTR(CNC_GCODE_14 _DONE_SCRIPT)); });
  #endif
  #if defined(CNC_DESC_15) && defined(CNC_GCODE_15)
    ACTION_ITEM_P(PSTR(CNC_DESC_15), []{ _lcd_cnc_gcode(PSTR(CNC_GCODE_15 _DONE_SCRIPT)); });
  #endif
  #if defined(CNC_DESC_16) && defined(CNC_GCODE_16)
    ACTION_ITEM_P(PSTR(CNC_DESC_16), []{ _lcd_cnc_gcode(PSTR(CNC_GCODE_16 _DONE_SCRIPT)); });
  #endif
  #if defined(CNC_DESC_17) && defined(CNC_GCODE_17)
    ACTION_ITEM_P(PSTR(CNC_DESC_17), []{ _lcd_cnc_gcode(PSTR(CNC_GCODE_17 _DONE_SCRIPT)); });
  #endif
  #if defined(CNC_DESC_18) && defined(CNC_GCODE_18)
    ACTION_ITEM_P(PSTR(CNC_DESC_18), []{ _lcd_cnc_gcode(PSTR(CNC_GCODE_18 _DONE_SCRIPT)); });
  #endif
  #if defined(CNC_DESC_19) && defined(CNC_GCODE_19)
    ACTION_ITEM_P(PSTR(CNC_DESC_19), []{ _lcd_cnc_gcode(PSTR(CNC_GCODE_19 _DONE_SCRIPT)); });
  #endif
  #if defined(CNC_DESC_20) && defined(CNC_GCODE_20)
    ACTION_ITEM_P(PSTR(CNC_DESC_20), []{ _lcd_cnc_gcode(PSTR(CNC_GCODE_20 _DONE_SCRIPT)); });
  #endif
  END_MENU();
}

#endif // HAS_LCD_MENU && CUSTOM_CNC_MENUS

@thinkyhead thinkyhead force-pushed the bugfix-2.0.x branch 2 times, most recently from 6a1a2d4 to 022b6b9 Compare January 5, 2020 07:54
@thinkyhead thinkyhead force-pushed the bugfix-2.0.x branch 9 times, most recently from f94b384 to bd550bb Compare January 15, 2020 07:27
@FNeo31 FNeo31 closed this Mar 24, 2020
@FNeo31 FNeo31 deleted the bugfix-2.0.x branch March 24, 2020 15:19
@FNeo31 FNeo31 restored the bugfix-2.0.x branch March 24, 2020 15:19
@FNeo31 FNeo31 deleted the bugfix-2.0.x branch March 24, 2020 18:03
@FNeo31 FNeo31 restored the bugfix-2.0.x branch March 24, 2020 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments