-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Babystepping and linear advance on I2S stepper stream #4
Comments
@vivian-ng Sorry I didn't get back to most message, I've been out of this for a while, far too many other things to do. Linear advance and baby stepping are indeed currently not supported, when I wrote the I2S code it was just a proof of concept and that pretty much where it remained. The code for I2S stepping is fairly straightforward there is a lot of it that can be abstracted away. You can pretty much abstract away the entire i2s.cpp and only consider that there is a ring buffer of steps. IIRC the stream is configured to run at 250khz to make each step 4us. So each entry in the ring buffer represent 4us, if the bit is set to 1 then it's going to send a step to the driver for 4us if it's 0 it's not. And you just need to keep the buffer full all the time. In the current code the stepper ISR is entirely disabled and we use the notification that one of the buffer in the ring has been consumed to plan the next ~4000 steps (here a step is a discrete 4us time period not a stepper step) baby stepping is probably just adding an entry at the end of the buffer. For Linear advance i'm not too sure because I haven't had a look, but I guess it's just about the same, just need to schedule the steps when they are needed. P.S: I'm doing this from memory so I might be forgetting something |
@simon-jouet Thank you for chipping into the discussion. I think anyone attempting to implement this will need both an understanding of the I2S code (in terms of how it deals with the stepper pulses) and more importantly, how is babystepping and linear advance and other stuff in Maybe we should post a FR in Marlin repo to see if anyone wants to give it a try. |
As of today, babystepping and linear advance does not work on I2S stepper stream. In Marlin, the pins file for the MRR ESPE will
#undef LINEAR_ADVANCE
, and if you try to do babystepping on the LCD, it will trigger a reset.According to this comment,
I don't think anyone other than @simon-jouet, the author of the Marlin ESP32 HAL's I2S code, has that kind of good understanding of the I2S stepper timing to be able to resolve this. So it may take a while for this issue to be resolved. Of course, the good thing about open source software is that anyone is free to give a try at finding a solution to this. Feel free to use this thread for discussions on this, and hopefully, a report of success somewhere in the future.
The text was updated successfully, but these errors were encountered: