gin66 / FastAccelStepper

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

i need to output a frequency level of 100khz #109

Closed quangbinhhvac closed 2 years ago

quangbinhhvac commented 2 years ago

Hi gin66, maybe you don't understand what I mean and close the title a bit early I mean when I use ATmega328p and want to output 100khz pulse to control the motor with 1/16 micro. Because with the current 25khz I can only set 1/4. micro

gin66 commented 2 years ago

You can give it a try:

Patch FastAccelStepper.h

#elif defined(ARDUINO_ARCH_AVR)
// AVR:
// tests on arduino nano indicate, that at 40ksteps/s in dual stepper mode,
// the main task is freezing (StepperDemo).
// Thus the limitation set here is set to 25kSteps/s as stated in the README.
#define MIN_DELTA_TICKS (TICKS_PER_S / 25000)

with

#elif defined(ARDUINO_ARCH_AVR)
// AVR:
// tests on arduino nano indicate, that at 40ksteps/s in dual stepper mode,
// the main task is freezing (StepperDemo).
// Thus the limitation set here is set to 25kSteps/s as stated in the README.
#define MIN_DELTA_TICKS (TICKS_PER_S / 100000)

not sure, if this gives reliable operation with one stepper. With two steppers will not work for sure.

gin66 commented 2 years ago

no news are good news