mirror of
https://github.com/bdring/Grbl_Esp32.git
synced 2025-08-29 17:19:50 +02:00
Delete esp32_printer_controller.cpp
This commit is contained in:
@@ -1,183 +0,0 @@
|
||||
/*
|
||||
esp32_printer_controller.cpp (copy and use your machine name)
|
||||
Part of Grbl_ESP32
|
||||
|
||||
copyright (c) 2020 - Bart Dring. This file was intended for use on the ESP32
|
||||
|
||||
...add your date and name here.
|
||||
|
||||
CPU. Do not use this with Grbl for atMega328P
|
||||
|
||||
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_ESP32 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. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
=======================================================================
|
||||
|
||||
This is a template for user-defined C++ code functions. Grbl can be
|
||||
configured to call some optional functions, enabled by #define statements
|
||||
in the machine definition .h file. Implement the functions thus enabled
|
||||
herein. The possible functions are listed and described below.
|
||||
|
||||
To use this file, copy it to a name of your own choosing, and also copy
|
||||
Machines/template.h to a similar name.
|
||||
|
||||
Example:
|
||||
Machines/my_machine.h
|
||||
Custom/my_machine.cpp
|
||||
|
||||
Edit machine.h to include your Machines/my_machine.h file
|
||||
|
||||
Edit Machines/my_machine.h according to the instructions therein.
|
||||
|
||||
Fill in the function definitions below for the functions that you have
|
||||
enabled with USE_ defines in Machines/my_machine.h
|
||||
|
||||
===============================================================================
|
||||
|
||||
*/
|
||||
|
||||
#ifdef USE_MACHINE_INIT
|
||||
/*
|
||||
machine_init() is called when Grbl_ESP32 first starts. You can use it to do any
|
||||
special things your machine needs at startup.
|
||||
*/
|
||||
# define STEPPERS_DISABLE_PIN_X 138
|
||||
# define STEPPERS_DISABLE_PIN_Y 134
|
||||
# define STEPPERS_DISABLE_PIN_Z 131
|
||||
# define STEPPERS_DISABLE_PIN_A 139
|
||||
|
||||
# define FAN1_PIN 13
|
||||
# define FAN2_PIN 142
|
||||
# define FAN3_PIN 143
|
||||
|
||||
# define BED_PIN 4
|
||||
# define NOZZLE_PIN 2
|
||||
|
||||
void machine_init() {
|
||||
// Enable steppers
|
||||
digitalWrite(STEPPERS_DISABLE_PIN_X, LOW); // enable
|
||||
digitalWrite(STEPPERS_DISABLE_PIN_Y, LOW); // enable
|
||||
digitalWrite(STEPPERS_DISABLE_PIN_Z, LOW); // enable
|
||||
digitalWrite(STEPPERS_DISABLE_PIN_A, LOW); // enable
|
||||
|
||||
// digitalWrite(FAN1_PIN, LOW); // comment out for JTAG debugging
|
||||
|
||||
digitalWrite(FAN2_PIN, LOW); // disable
|
||||
digitalWrite(FAN3_PIN, LOW); // disable
|
||||
|
||||
digitalWrite(BED_PIN, LOW); // disable
|
||||
digitalWrite(NOZZLE_PIN, LOW); // disable
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef USE_CUSTOM_HOMING
|
||||
/*
|
||||
(user_defined_homing) is called at the begining of the normal Grbl_ESP32 homing
|
||||
sequence. If user_defined_homing() returns false, the rest of normal Grbl_ESP32
|
||||
homing is skipped if it returns false, other normal homing continues. For
|
||||
example, if you need to manually prep the machine for homing, you could implement
|
||||
user_defined_homing() to wait for some button to be pressed, then return true.
|
||||
*/
|
||||
bool user_defined_homing(uint8_t cycle_mask) {
|
||||
// True = done with homing, false = continue with normal Grbl_ESP32 homing
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef USE_KINEMATICS
|
||||
/*
|
||||
Inverse Kinematics converts X,Y,Z cartesian coordinate to the steps
|
||||
on your "joint" motors. It requires the following three functions:
|
||||
*/
|
||||
|
||||
/*
|
||||
inverse_kinematics() looks at incoming move commands and modifies
|
||||
them before Grbl_ESP32 puts them in the motion planner.
|
||||
|
||||
Grbl_ESP32 processes arcs by converting them into tiny little line segments.
|
||||
Kinematics in Grbl_ESP32 works the same way. Search for this function across
|
||||
Grbl_ESP32 for examples. You are basically converting cartesian X,Y,Z... targets to
|
||||
|
||||
target = an N_AXIS array of target positions (where the move is supposed to go)
|
||||
pl_data = planner data (see the definition of this type to see what it is)
|
||||
position = an N_AXIS array of where the machine is starting from for this move
|
||||
*/
|
||||
void inverse_kinematics(float* target, plan_line_data_t* pl_data, float* position) {
|
||||
// this simply moves to the target. Replace with your kinematics.
|
||||
mc_line(target, pl_data);
|
||||
}
|
||||
|
||||
/*
|
||||
kinematics_pre_homing() is called before normal homing
|
||||
You can use it to do special homing or just to set stuff up
|
||||
|
||||
cycle_mask is a bit mask of the axes being homed this time.
|
||||
*/
|
||||
bool kinematics_pre_homing(uint8_t cycle_mask))
|
||||
{
|
||||
return false; // finish normal homing cycle
|
||||
}
|
||||
|
||||
/*
|
||||
kinematics_post_homing() is called at the end of normal homing
|
||||
*/
|
||||
void kinematics_post_homing() {}
|
||||
#endif
|
||||
|
||||
#ifdef USE_FWD_KINEMATICS
|
||||
/*
|
||||
The status command uses forward_kinematics() to convert
|
||||
your motor positions to cartesian X,Y,Z... coordinates.
|
||||
|
||||
Convert the N_AXIS array of motor positions to cartesian in your code.
|
||||
*/
|
||||
void forward_kinematics(float* position) {
|
||||
// position[X_AXIS] =
|
||||
// position[Y_AXIS] =
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef USE_TOOL_CHANGE
|
||||
/*
|
||||
user_tool_change() is called when tool change gcode is received,
|
||||
to perform appropriate actions for your machine.
|
||||
*/
|
||||
void user_tool_change(uint8_t new_tool) {}
|
||||
#endif
|
||||
|
||||
#if defined(MACRO_BUTTON_0_PIN) || defined(MACRO_BUTTON_1_PIN) || defined(MACRO_BUTTON_2_PIN)
|
||||
/*
|
||||
options. user_defined_macro() is called with the button number to
|
||||
perform whatever actions you choose.
|
||||
*/
|
||||
void user_defined_macro(uint8_t index) {}
|
||||
#endif
|
||||
|
||||
#ifdef USE_M30
|
||||
/*
|
||||
user_m30() is called when an M30 gcode signals the end of a gcode file.
|
||||
*/
|
||||
void user_m30() {}
|
||||
#endif
|
||||
|
||||
#ifdef USE_MACHINE_TRINAMIC_INIT
|
||||
/*
|
||||
machine_triaminic_setup() replaces the normal setup of trinamic
|
||||
drivers with your own code. For example, you could setup StallGuard
|
||||
*/
|
||||
void machine_trinamic_setup() {}
|
||||
#endif
|
||||
|
||||
// If you add any additional functions specific to your machine that
|
||||
// require calls from common code, guard their calls in the common code with
|
||||
// #ifdef USE_WHATEVER and add function prototypes (also guarded) to grbl.h
|
Reference in New Issue
Block a user