- diff --git a/Grbl_Esp32/Machines/spi_daisy_4axis_xyz.h b/Grbl_Esp32/Machines/spi_daisy_4axis_xyz.h
- index 0eefb60..d2ddff2 100644
- --- a/Grbl_Esp32/Machines/spi_daisy_4axis_xyz.h
- +++ b/Grbl_Esp32/Machines/spi_daisy_4axis_xyz.h
- @@ -22,7 +22,8 @@
- 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 TRINAMIC_RUN_MODE TRINAMIC_RUN_MODE_STALLGUARD
- +#define TRINAMIC_HOMING_MODE TRINAMIC_HOMING_STALLGUARD
- #define MACHINE_NAME "SPI_DAISY_4X_XYZ"
- #ifdef N_AXIS
- diff --git a/Grbl_Esp32/Motors/TrinamicDriverClass.cpp b/Grbl_Esp32/Motors/TrinamicDriverClass.cpp
- index ce0cab1..b5a0bcc 100644
- --- a/Grbl_Esp32/Motors/TrinamicDriverClass.cpp
- +++ b/Grbl_Esp32/Motors/TrinamicDriverClass.cpp
- @@ -189,6 +189,25 @@ void TrinamicDriver :: set_mode() {
- }
- }
- +// formats axis values into a string and returns that string in rpt
- +static void report_util_axis_values(float* axis_value, char* rpt) {
- + uint8_t idx;
- + char axisVal[10];
- + float unit_conv = 1.0; // unit conversion multiplier..default is mm
- + rpt[0] = '\0';
- + if (report_inches->get())
- + unit_conv = 1.0 / MM_PER_INCH;
- + for (idx = 0; idx < N_AXIS; idx++) {
- + if (report_inches->get())
- + sprintf(axisVal, "%4.4f", axis_value[idx] * unit_conv); // Report inches to 4 decimals
- + else
- + sprintf(axisVal, "%4.3f", axis_value[idx] * unit_conv); // Report mm to 3 decimals
- + strcat(rpt, axisVal);
- + if (idx < (N_AXIS - 1))
- + strcat(rpt, ",");
- + }
- +}
- +
- /*
- This is the stallguard tuning info. It is call debug, so it could be generic across all classes.
- */
- @@ -199,15 +218,21 @@ void TrinamicDriver :: debug_message() {
- if (tstep == 0xFFFFF || tstep < 1) // if axis is not moving return
- return;
- float feedrate = st_get_realtime_rate(); //* settings.microsteps[axis_index] / 60.0 ; // convert mm/min to Hz
- -
- - grbl_msg_sendf(CLIENT_SERIAL,
- + int32_t current_position[N_AXIS]; // Copy current state of the system position variable
- + float print_position[N_AXIS];
- + memcpy(current_position, sys_position, sizeof(sys_position));
- + system_convert_array_steps_to_mpos(print_position, current_position);
- + char temp[80];
- + report_util_axis_values(print_position, temp);
- + grbl_msg_sendf(CLIENT_ALL,
- MSG_LEVEL_INFO,
- - "%s Stallguard %d SG_Val: %04d Rate: %05.0f mm/min SG_Setting:%d",
- + "%s Stallguard %d SG_Val: %04d Rate: %05.0f mm/min SG_Setting:%d MPos:%s",
- _axis_name,
- tmcstepper->stallguard(),
- tmcstepper->sg_result(),
- feedrate,
- - axis_settings[axis_index]->stallguard->get());
- + axis_settings[axis_index]->stallguard->get(),
- + temp);
- }
- // calculate a tstep from a rate
- diff --git a/Grbl_Esp32/machine.h b/Grbl_Esp32/machine.h
- index 3f987a9..f2e5438 100644
- --- a/Grbl_Esp32/machine.h
- +++ b/Grbl_Esp32/machine.h
- @@ -17,7 +17,7 @@ PWM
- // !!! For initial testing, start with test_drive.h which disables
- // all I/O pins
- // #include "Machines/atari_1020.h"
- -#include "Machines/test_drive.h"
- +#include "Machines/spi_daisy_4axis_xyz.h"
- // !!! For actual use, change the line above to select a board
- // from Machines/, for example: