From 4e749580d9e6c271b8bc10ca2a2974c911f692d3 Mon Sep 17 00:00:00 2001 From: Holger Weber Date: Sat, 7 Mar 2026 22:03:21 +0100 Subject: [PATCH] Added max accl speed of stepper to configuration. --- include/EggDuino.h | 1 + src/Config_Web.cpp | 1 + src/Helper_Functions.cpp | 4 ++-- src/main.cpp | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/EggDuino.h b/include/EggDuino.h index f6a19f9..c1d6b81 100644 --- a/include/EggDuino.h +++ b/include/EggDuino.h @@ -100,6 +100,7 @@ extern int g_iPenEnablePin; extern int g_iServoPin; extern int g_iRotMicrostep; extern int g_iPenMicrostep; +extern int g_iMaxAcclSpeed; extern String g_sHostname; extern String g_sWifiSsid; extern String g_sWifiPassword; diff --git a/src/Config_Web.cpp b/src/Config_Web.cpp index 181cb38..b73daf6 100644 --- a/src/Config_Web.cpp +++ b/src/Config_Web.cpp @@ -350,6 +350,7 @@ ConfigParameter configParameters[] = { {"int", "penEnablePin", &g_iPenEnablePin, "Pen Stepper Enable Pin", kDefaultPenEnablePin, "", false}, {"int", "rotMicrostep", &g_iRotMicrostep, "Rotational Stepper Microsteps", kDefaultRotMicrostep, "", false}, {"int", "penMicrostep", &g_iPenMicrostep, "Pen Stepper Microsteps", kDefaultPenMicrostep, "", false}, + {"int", "iMaxAcclSpeed", &g_iMaxAcclSpeed, "max. Stepper acceleration speed", 10000, "", false}, {"int", "servoPin", &g_iServoPin, "Servo Pin", kDefaultServoPin, "", false}, {"text", "Name", &g_sHostname, "Name", 0, "EggDuino", false}, {"text", "wifiSsid", &g_sWifiSsid, "WLAN SSID", 0, "", false}, diff --git a/src/Helper_Functions.cpp b/src/Helper_Functions.cpp index bb4e22b..445489f 100644 --- a/src/Helper_Functions.cpp +++ b/src/Helper_Functions.cpp @@ -87,7 +87,7 @@ void initHardware() g_pStepperRotate->setDirectionPin(g_iRotDirPin); g_pStepperRotate->setEnablePin(g_iRotEnablePin); - g_pStepperRotate->setAcceleration(10000); + g_pStepperRotate->setAcceleration(g_iMaxAcclSpeed); g_pStepperRotate->setAutoEnable(false); } @@ -99,7 +99,7 @@ void initHardware() // penMotor.setAcceleration(10000.0); g_pStepperPen->setDirectionPin(g_iPenDirPin); g_pStepperPen->setEnablePin(g_iPenEnablePin); - g_pStepperPen->setAcceleration(10000); + g_pStepperPen->setAcceleration(g_iMaxAcclSpeed); g_pStepperPen->setAutoEnable(false); } diff --git a/src/main.cpp b/src/main.cpp index 7aa7595..a5a196b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -82,6 +82,7 @@ int g_iRotMicrostep = kDefaultRotMicrostep; int g_iPenMicrostep = kDefaultPenMicrostep; float fROT_STEP_CORRECTION = 16.0 / kDefaultRotMicrostep; // devide EBB-Coordinates by this factor to get EGGduino-Steps float fPEN_STEP_CORRECTION = 16.0 / kDefaultPenMicrostep; // devide EBB-Coordinates by this factor to get EGGduino-Steps +int g_iMaxAcclSpeed = 10000; String g_sHostname = "EggDuino"; String g_sWifiSsid = ""; String g_sWifiPassword = "";