-
Notifications
You must be signed in to change notification settings - Fork 73
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
Concept of low level access #86
Comments
The high level interface is for running a motor from position A to position B with a speed bound to parameters for maximum speed and acceleration. Additional feature is, that the position B, maximum speed and acceleration can be adjusted, while the motor is running towards B. The issue is, that position B will always be reached with speed ~0 and while the stepper is running, the exact relation of position, speed, acceleration is not known to the application. Consequently a g-code interpreter (and especially for more than one axes) with the high level interface will be very difficult. (https://github.com/gin66/FastAccelStepper#usage-for-multi-axis-applications) The low level interface gives way more control and - as long as interrupts can be serviced in time - will be timer exact. Just that the ramp generation of FastAccelStepper will not be used at all. For this
For esp32 TICKS_PER_S = 16_000_000 aka 16MHz. One command is either a command to issue a defined amount of steps, or a pause (steps = 0). For example:
If a step is needed every 10ms, then
Or alternatively this would work, too:
Hope this helps to understand the principle.
The application should then repeatedly call It's obvious, that this will be a lot of work. As pointed out in the Readme. Perhaps you can have a look at the marlin project. |
Thank you for that explanation. It has become a lot clearer. So ticks represents the pause between pulses and steps how many pulses shall be generated with that particular spacing. Is there a particular reason to limit the ticks to uint16 on an ESP32? For the AVR it makes sense for a 16bit timer. You mentioned the limitation on serving interrupts. It's there something I should be careful off? I'm no expert in programming. I'll do some tests later this evening. I'm quite sure that will pop up a lot more questions as I progress. |
Several reasons for 16bit:
As stated in the readme: do not block for long time the interrupts. And for esp32 in addition: do not write to the flash, while the stepper is running. For example, try to let the stepper run continuously and initiate an ota update. The system will work, but the stepper will run quite bumpy….. |
should add to documentation |
Hi Gin66,
first of all, thank you very much for the fantastic FastAccelStepper lib. And that you finally convinced me to use the ESP32 chip. I'm using your lib with great success with the high level interface.
However, for my next development phase I want to implement something like a G-Code interpreter. In essence I need to chain commands together without the stepper coming to a halt in between commands. However, it is very likely that some ramps are still needed to glue the segments together. My input segments will be something like distance & time, or distance & speed. I want it to be piece-wise linear. Meaning, that it accelerates / decelerates as quick as possible and then travels the remaining distance with a constant speed. If I understood correctly that is what the low level interface is there for. Or can this be achieved as well with the high level interface? Polling for
isRunning()
is probably not working for me.I tried to wrap my head around the low level examples, but frankly speaking, I'm completely lost in-between ticks and steps. Could you please elaborate what the concept under the hood is? Especially, what the parameters of the
struct stepper_command_s cmd = {.ticks = curr_ticks, .steps = steps, .count_up = direction};
exactly mean?Thank you very much,
elims
The text was updated successfully, but these errors were encountered: