Add more debug output ISSUES

- Add debug output in calc
- disable test mode for testing with encoder
- set loglevel to DEBUG

extend feature currently only works well in testing mode with buttons
issues when running with encoder:
 movement gets extended extremely often due to encoder travel
 interval and rarely does reach target - compared to trigger with
 buttons
 -> while debugging noticed that the current speed gets negative
 and the xISR gets stuck so moves infinitely or not at all

 ideas:
 - rounding issue?
 - SPEED increment also has to be adjusted or set to 0 as step
   increment?
This commit is contained in:
jonny_l480
2023-03-26 11:41:46 +02:00
parent 1c59e0097b
commit 279ac0e07e
4 changed files with 11 additions and 7 deletions

View File

@@ -85,7 +85,7 @@ extern "C" {
//----- stepper config -----
//--------------------------
//enable stepper test mode (dont start control and encoder task)
#define STEPPER_TEST
//#define STEPPER_TEST
#define STEPPER_STEP_PIN GPIO_NUM_18 //mos1
#define STEPPER_DIR_PIN GPIO_NUM_16 //ST3
#define STEPPER_EN_PIN GPIO_NUM_0 //not connected (-> stepper always on)

View File

@@ -34,7 +34,7 @@ extern "C"
#define SPEED 10 //35, 100, 50 rev
#define ACCEL_MS 800.0 //ms from 0 to max
#define DECEL_MS 800.0 //ms from max to 0
#define DECEL_MS 500.0 //ms from max to 0
#define STEPPER_STEPS_PER_ROT 1600
#define STEPPER_STEPS_PER_MM STEPPER_STEPS_PER_ROT/4

View File

@@ -87,7 +87,7 @@ extern "C" void app_main()
esp_log_level_set("switches-analog", ESP_LOG_WARN);
esp_log_level_set("control", ESP_LOG_INFO);
esp_log_level_set("stepper", ESP_LOG_DEBUG);
esp_log_level_set("Dendostepper", ESP_LOG_DEBUG); //stepper lib
esp_log_level_set("DendoStepper", ESP_LOG_DEBUG); //stepper lib
esp_log_level_set("calc", ESP_LOG_WARN); //stepper lib
#ifdef STEPPER_TEST