gin66 / FastAccelStepper

A high speed stepper library for Atmega 168/328p (nano), Atmega32u4, Atmega 2560, ESP32, ESP32S2, ESP32S3, ESP32C3, ESP32C6 and Atmel SAM Due
MIT License
301 stars 70 forks source link

ESP32: Why is the limit on 200kHz and not @ 500kHz? #210

Closed pmneo closed 10 months ago

pmneo commented 10 months ago

I'm currently playing around with your library, but I'm asking why this is limited to 200kHz? I have adjusted StepperISR_esp32.cpp

void StepperQueue::adjustSpeedToStepperCount(uint8_t steppers) { max_speed_in_ticks = 32; // This equals 500kHz @ 16MHz }

And this works out of the box and my oscilloscope shows a stable 500kHz signal.

So can you tell me the reason of the limit?

Thanks

gin66 commented 10 months ago

never tried and I prefer a conservative approach. besides there are some reasons (opinion):

pmneo commented 10 months ago

Thank you for this information. But would it be an option to allow this via a special define without modifying your lib?

So the user of your lib can decide for himself if he wants to take the risk or not?

gin66 commented 10 months ago

Is Arduino IDE in the meantime able to define a compile time preprocessor variable ? Last time I have checked, it was not able. Platformio has no problem with it. Besides…arduino library manager is broken for looong time now, so best to avoid Arduino IDE entirely.

An alternate solution: extend the api for esp32 only to increase the speed limit via function e.g. stepper->setAbsoluteSpeedLimit(uint16_t max_speed_in_ticks, bool allow_unsafe_values=false)

pmneo commented 10 months ago

A boolean param would be nice! Than you very much!Am 30.11.2023 20:16 schrieb gin66 @.***>: Is Arduino IDE in the meantime able to define a compile time preprocessor variable ? Last time I have checked, it was not able. Platformio has no problem with it. Besides…arduino library manager is broken for looong time now, so best to avoid Arduino IDE entirely. An alternate solution: extend the api for esp32 only to increase the speed limit via function e.g. stepper->setAbsoluteSpeedLimit(uint16_t max_speed_in_ticks, bool allow_unsafe_values=false)

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

gin66 commented 10 months ago

included in 0.30.8