Replies: 1 comment 2 replies
-
The first part of the algorithm seems to be the standard integer approximation of a normal linear acceleration. I.e. v = a*t which is equivalent to v = sqrt(2as). The usual stepper algorithms try to calculate the next period on each and every step which is quite demanding. When I did TeensyStep I looked at the code of the fantastic GRBL which is able to control 3 steppers at about 30kHz with a lame Uno. The trick is that GRBL doesn't recalculate the period at every step but at fixed time intervals. TeensyStep is doing the same. The second part seems to try to smoothen the abrupt changes of the acceleration (jerk). There probably are use cases where this is necessary, for me it never was important.
AcceleratorWriting an accelerator should be pretty straight forward. As you probably saw, the library calls
No, this is all handled by the library, it doesn't care about the details of the accelerator. Everything should just work. But of course Murphy's law is always valid... TimerToolRegarding using the TeensyTimerTool: Compatibility
Sure, adding custom accelerators is the whole point in the accelerator structure of the lib. You don't even need to change the library, you simply can "plug in" your accelerator. Placing a
at the beginning of your sketch should be all you need to do. See TeensyStep.h for details. If it turns out to work I can also pull the accelerator into the library of course. Hope that helps |
Beta Was this translation helpful? Give feedback.
-
I recently tried to build a stepper controller based on Austin D (2005) -- the same algorithm (at least partially) used by Mike McCauley's AccelStepper. It offers a very smooth acceleration to top-speed. The main issue with my code: it's blocking code. At some point I would like to start an attempt at creating an efficient non-blocking implementation with interrupts for teensy.
I see two rather obvious options - both would be centered around projects of yours:
It would probably be a bit of a headache to support the more advanced features of TeensyStep (i.e., synchronization of several motors), but for a single motor it should be quite straight-forward. The logic mostly boils down to this. I would be interested in your opinion on this. Is this something that could be compatible with TeensyStep?
Cheers,
Florian
Beta Was this translation helpful? Give feedback.
All reactions