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

Trinamic status (#563)

* Adding extended testing and status

- checks for shorts, opens, temt, p/s issues

* Update

- test function now looks for
  - connectiviy
  - motor power
  - coil shorts
  - temp issues

* Update Machine.h

* Update spi_daisy_4axis_xyyz.h
This commit is contained in:
bdring
2020-08-19 11:32:58 -06:00
committed by GitHub
parent 0956f3edb9
commit 1f27377ce6
2 changed files with 34 additions and 2 deletions

View File

@@ -23,7 +23,7 @@
// Grbl versioning system // Grbl versioning system
#define GRBL_VERSION "1.3a" #define GRBL_VERSION "1.3a"
#define GRBL_VERSION_BUILD "20200813" #define GRBL_VERSION_BUILD "20200819"
//#include <sdkconfig.h> //#include <sdkconfig.h>
#include <Arduino.h> #include <Arduino.h>

View File

@@ -105,7 +105,39 @@ namespace Motors {
case 2: case 2:
grbl_msg_sendf(CLIENT_SERIAL, MSG_LEVEL_INFO, "%s Trinamic driver test failed. Check motor power", _axis_name); grbl_msg_sendf(CLIENT_SERIAL, MSG_LEVEL_INFO, "%s Trinamic driver test failed. Check motor power", _axis_name);
return false; return false;
default: grbl_msg_sendf(CLIENT_SERIAL, MSG_LEVEL_INFO, "%s Trinamic driver test passed", _axis_name); return true; default:
// driver responded, so check for other errors from the DRV_STATUS register
TMC2130_n ::DRV_STATUS_t status { 0 }; // a useful struct to access the bits.
status.sr = tmcstepper->DRV_STATUS();
bool err = false;
// look for open loan or short 2 ground on a and b
if (status.s2ga || status.s2gb) {
grbl_msg_sendf(CLIENT_SERIAL,
MSG_LEVEL_INFO,
"%s Motor Short Coil a:%s b:%s",
_axis_name,
status.s2ga ? "Y" : "N",
status.s2gb ? "Y" : "N");
err = true;
}
// check for over temp or pre-warning
if (status.ot || status.otpw) {
grbl_msg_sendf(CLIENT_SERIAL,
MSG_LEVEL_INFO,
"%s Driver Temp Warning:%s Fault:%s",
_axis_name,
status.otpw ? "Y" : "N",
status.ot ? "Y" : "N");
err = true;
}
if (err)
return false;
grbl_msg_sendf(CLIENT_SERIAL, MSG_LEVEL_INFO, "%s Trinamic driver test passed", _axis_name);
return true;
} }
} }