1
0
mirror of https://github.com/bdring/Grbl_Esp32.git synced 2025-09-01 10:23:19 +02:00

Merge pull request #398 from bdring/Devt

Merging SpindleClass changes
This commit is contained in:
bdring
2020-05-07 16:51:22 -05:00
committed by GitHub
10 changed files with 57272 additions and 8 deletions

View File

@@ -0,0 +1,51 @@
/*
3axis_v4.h
Part of Grbl_ESP32
Pin assignments for the ESP32 Development Controller, v4.1 and later.
https://github.com/bdring/Grbl_ESP32_Development_Controller
https://www.tindie.com/products/33366583/grbl_esp32-cnc-development-board-v35/
2018 - Bart Dring
2020 - Mitch Bradley
Grbl_ESP32 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.
Grbl 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 Grbl_ESP32. If not, see <http://www.gnu.org/licenses/>.
*/
#define MACHINE_NAME "Spindle class Test"
#define X_STEP_PIN GPIO_NUM_12
#define X_DIRECTION_PIN GPIO_NUM_14
#define Y_STEP_PIN GPIO_NUM_26
#define Y_DIRECTION_PIN GPIO_NUM_15
#define Z_STEP_PIN GPIO_NUM_27
#define Z_DIRECTION_PIN GPIO_NUM_33
#define LIMIT_MASK B111
#define X_LIMIT_PIN GPIO_NUM_17
#define Y_LIMIT_PIN GPIO_NUM_4
#define Z_LIMIT_PIN GPIO_NUM_16
// OK to comment out to use pin for other features
#define STEPPERS_DISABLE_PIN GPIO_NUM_13
#define SPINDLE_TYPE SPINDLE_TYPE_RELAY
#define SPINDLE_OUTPUT_PIN GPIO_NUM_25 // labeled SpinPWM
//#define SPINDLE_ENABLE_PIN GPIO_NUM_25 // labeled SpinEnbl
/*
#define SPINDLE_TYPE SPINDLE_TYPE_BESC
#define SPINDLE_OUTPUT_PIN GPIO_NUM_27 //
*/

View File

@@ -115,11 +115,11 @@ Some features should not be changed. See notes below.
//#define CONNECT_TO_SSID "your SSID"
//#define SSID_PASSWORD "your SSID password"
//CONFIGURE_EYECATCH_BEGIN (DO NOT MODIFY THIS LINE)
#define ENABLE_BLUETOOTH // enable bluetooth
//#define ENABLE_BLUETOOTH // enable bluetooth
#define ENABLE_SD_CARD // enable use of SD Card to run jobs
#define ENABLE_WIFI //enable wifi
//#define ENABLE_WIFI //enable wifi
#define ENABLE_HTTP //enable HTTP and all related services
#define ENABLE_OTA //enable OTA
@@ -457,7 +457,7 @@ Some features should not be changed. See notes below.
// NOTE: Only use this for debugging purposes!! When echoing, this takes up valuable resources and can effect
// performance. If absolutely needed for normal operation, the serial write buffer should be greatly increased
// to help minimize transmission waiting within the serial write protocol.
// #define REPORT_ECHO_LINE_RECEIVED // Default disabled. Uncomment to enable.
//#define REPORT_ECHO_LINE_RECEIVED // Default disabled. Uncomment to enable.
// Minimum planner junction speed. Sets the default minimum junction speed the planner plans to at
// every buffer block junction, except for starting from rest and end of the buffer, which are always

View File

@@ -121,15 +121,15 @@
#endif
#ifndef DEFAULT_SPINDLE_OFF_VALUE
#define DEFAULT_SPINDLE_OFF_VALUE 0.0 // $34 Percent (extended set)
#define DEFAULT_SPINDLE_OFF_VALUE 0.0 // $34 Percent of full period(extended set)
#endif
#ifndef DEFAULT_SPINDLE_MIN_VALUE
#define DEFAULT_SPINDLE_MIN_VALUE 0.0 // $35 Percent (extended set)
#define DEFAULT_SPINDLE_MIN_VALUE 0.0 // $35 Percent of full period (extended set)
#endif
#ifndef DEFAULT_SPINDLE_MAX_VALUE
#define DEFAULT_SPINDLE_MAX_VALUE 100.0 // $36 Percent (extended set)
#define DEFAULT_SPINDLE_MAX_VALUE 100.0 // $36 Percent of full period (extended set)
#endif
#ifndef DEFAULT_SPINDLE_RPM_MAX

View File

@@ -379,6 +379,14 @@ uint8_t limits_get_state() {
// NOTE: Used by jogging to limit travel within soft-limit volume.
void limits_soft_check(float* target) {
if (system_check_travel_limits(target)) {
// TODO for debugging only 3 axes right now
grbl_msg_sendf(CLIENT_SERIAL,
MSG_LEVEL_INFO,
"Soft limit error target WPOS X:%5.2f Y:%5.2f Z:%5.2f",
target[X_AXIS] - gc_state.coord_system[X_AXIS],
target[Y_AXIS] - gc_state.coord_system[Y_AXIS],
target[Z_AXIS] - gc_state.coord_system[Z_AXIS]);
sys.soft_limit = true;
// Force feed hold if cycle is active. All buffered blocks are guaranteed to be within
// workspace volume so just come to a controlled stop so position is not lost. When complete

View File

@@ -4,6 +4,14 @@
#ifndef _machine_h
#define _machine_h
/*
PWM
Tested on arc_arrow.nc
*/
#ifndef MACHINE_FILENAME
// !!! For initial testing, start with test_drive.h which disables

View File

@@ -90,7 +90,7 @@ typedef struct {
// Planner data prototype. Must be used when passing new motions to the planner.
typedef struct {
float feed_rate; // Desired feed rate for line motion. Value is ignored, if rapid motion.
float spindle_speed; // Desired spindle speed through line motion.
uint32_t spindle_speed; // Desired spindle speed through line motion.
uint8_t condition; // Bitflag variable to indicate planner conditions. See defines above.
#ifdef USE_LINE_NUMBERS
int32_t line_number; // Desired line number to report when executing.

View File

@@ -42,7 +42,7 @@ typedef struct {
uint8_t override_ctrl; // Tracks override control states.
#endif
float spindle_speed;
uint32_t spindle_speed;
} system_t;
extern system_t sys;

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,23 @@
G17
G0Z12.700
S500M3
G0X0.000Y0.000
G0X13.599Y24.932Z5.080
G1Z-2.000F152400.0
G1Y58.857
X62.091
Y24.932
X13.599
G0Z5.080
S1000M03
G4P3
G0X15.472Y27.568Z5.080
G1Z-2.000F152400.0
G1Y57.424
X59.341
Y27.568
X15.472
G0Z5.080
G53G0Z-2
G0X0.000Y0.000
M5

File diff suppressed because it is too large Load Diff