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
283 stars 67 forks source link

Compatibility with external driver / period length? #186

Closed neutebach closed 1 year ago

neutebach commented 1 year ago

Hi,

I'm trying to drive a not very complicated application (3D printing filament rewinder) that is basically just a linear guide with a NEMA17 and spindle the speed of which is calculated and updated multiple times a second, based on the speed that the winder is winding the filament. The speed in steps/s is calculated in an interrupt routine that is triggered by a sensor 6 times per rotation of the winder. I had the system working with another "library" for step generation that a colleague of mine wrote himself, so I cannot link to it, but I want to switch for various reasons.

Long story short; the axis moves only very slowly, roughly and most notably only a fraction of the distance it's supposed to. The external driver is an igus D1 (click for manual), in the manual it says that the max frequency it will accept is 25kHz at a minimum of 40µs per step. My first theory is that the period of each step generated by this lib is on the brink of being too short for the driver to register which means that a lot of steps are lost. Could this be the case?

thanks for having a quick look at this. best regards, Niklas

gin66 commented 1 year ago

No issue with the period. The minimum length is not stated. There is only one issue mentioned, which may require to apply a direction pin delay (10us between dir change and step)

Questions:

neutebach commented 1 year ago

thanks for your quick response. I'm using a Controllino Maxi (based on Arduino Mega - ATmega2560) It should output 24V. I'll have a look at the interrupt routines and see if that makes a difference.

neutebach commented 1 year ago

As I'm pretty sure the problem lies within my code, I'll close this issue. I don't have the time to dive into it unfortunately since it's a work project and it has worked before pretty ok, which means I can't justifiy putting more effort into it. Thank you though.