From 5e9289e419c8d9fc6f72199f6edb28d5141de854 Mon Sep 17 00:00:00 2001 From: Stefan de Bruijn Date: Mon, 19 Apr 2021 19:57:10 +0200 Subject: [PATCH] Fixed spindle sync for all VFD spindles (#868) * Implemented H2A spindle sync fix. Untested. * Changed the spindle sync fix to be in the VFD code. * Update Grbl.h Co-authored-by: Stefan de Bruijn Co-authored-by: bdring --- Grbl_Esp32/src/Grbl.h | 2 +- Grbl_Esp32/src/Spindles/VFDSpindle.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Grbl_Esp32/src/Grbl.h b/Grbl_Esp32/src/Grbl.h index 550fbcc5..3f949aae 100644 --- a/Grbl_Esp32/src/Grbl.h +++ b/Grbl_Esp32/src/Grbl.h @@ -22,7 +22,7 @@ // Grbl versioning system const char* const GRBL_VERSION = "1.3a"; -const char* const GRBL_VERSION_BUILD = "20210413"; +const char* const GRBL_VERSION_BUILD = "20210419"; //#include #include diff --git a/Grbl_Esp32/src/Spindles/VFDSpindle.cpp b/Grbl_Esp32/src/Spindles/VFDSpindle.cpp index 4e9d949a..463a0933 100644 --- a/Grbl_Esp32/src/Spindles/VFDSpindle.cpp +++ b/Grbl_Esp32/src/Spindles/VFDSpindle.cpp @@ -567,6 +567,10 @@ namespace Spindles { set_speed_command(rpm, rpm_cmd); + // Sometimes sync_rpm is retained between different set_speed_command's. We don't want that - we want + // spindle sync to kick in after we set the speed. This forces that. + _sync_rpm = UINT32_MAX; + rpm_cmd.critical = (rpm == 0); if (xQueueSend(vfd_cmd_queue, &rpm_cmd, 0) != pdTRUE) {