pkerspe / ESP-StepperMotor-Server

Turn your ESP32 into a complete stepper motor control server with web UI, REST API and serial control interface
MIT License
225 stars 39 forks source link

jitter on step movements #31

Open denonbw opened 2 years ago

denonbw commented 2 years ago

Hello I have a lot of jitter on step movements. I guess this is the same Problem as in ESP-FlexyStepper library : https://github.com/pkerspe/ESP-FlexyStepper/issues/4 Is there a change to transfer the startAsService to this library as well?

Best regards and thanks for the great library

pkerspe commented 2 years ago

@denonbw thanks for your ticket. When it comes to jitter please also read the FlexyStepper readme: https://github.com/pkerspe/ESP-FlexyStepper It gives some general info on the topic and also helps to identify issues in your main loop. Still I see your request and will see how the API can be modified to be able to set the "start as service" parameters during initilization of the server.

I did not test this, but you can always use the API to access the flexy stepper instances programatically, like this: ESP_FlexyStepper *stepper = stepperMotorServer->getCurrentServerConfiguration()->getConfiguredFlexySteppers()[0];

Now you could call any function on the ESP_FlexyStepper instance directly, including the startAsService function.

But at the end I am not sure if this is of any help. The reason being that the ESPStepperMotorServer implements its own central service in the class "ESPStepperMotorServer_MotionController". This is running as a service and constantly checks if any of the FlexyStepper instances needs to perform a movement and if so triggers the "processMovement" function. (ESPStepperMotorServer_MotionController line 81). So for now what I will implement is a configuration setting to define the CPU Core in which this task is running