-
-
Notifications
You must be signed in to change notification settings - Fork 19.2k
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
Direct Stepping feature #17853
Direct Stepping feature #17853
Conversation
9c5a980
to
e09190c
Compare
I managed to rebase and squash this using the good old merge-and-reset trick. No problemo. To update your working copy:
|
e09190c
to
89b426e
Compare
9ce6240
to
0abc7c6
Compare
Co-Authored-By: colinrgodsey <[email protected]>
0abc7c6
to
304a23a
Compare
Awesome, thanks! |
Does the error checking and R_UDR read earlier before doing the buffer_pos management.
Example of host transmission for SP_4x2_256: https://gist.github.com/colinrgodsey/f35e4f33eb3cdd80cfb985362703db03 |
Remove the table offsets as it doesnt seem to help with the sound much at all. Also adding in forgotten adv configuration to lower the block buffers if SD is enabled
finally got a real print going: https://twitter.com/colinrgodsey/status/1259264651235225601 Had some issues with stepd to clear up, but it should be good to use for testing now, with a few caveats:
Also with my current testing, I'm using the SP_4x2_256 format at 61440 steps/s. Works just fine on the mega2560. |
Once this is merged, will you put together an "easy" install package for OctoPrint setups? It would be great to see some of those older simpler machines get some new life. |
ddf47ab
to
1c56326
Compare
1c56326
to
919265b
Compare
@thinkyhead yeah absolutely. Once we get everything squared away on the marlin side, ill make a dpkg script or something for stepd to get it all more convenient |
e614762
to
62f07aa
Compare
Ok, so to get this ready to deploy I've applied some cleanup to match our fun standards, and…
|
@thinkyhead was watching the changes come in, looks good, and thanks for cleaning that up! Didn't think about the hidden "this", makes lots of sense. I'll have to see if i can get the steprate even higher now. |
Looks like there's some syntax issues in the new static serialpagemanager. got em fixed on my side. ill do some testing and commit em up 👍 |
Headless test was fine. Started a real test print (60kHz), seems fine so far 👍 |
Test print was fine until I got a nasty filament jam. cries in PLA |
Ouch. I just read a painful amount of information about |
Once this is published, prepare for a lot of users asking |
Yea, typename is a pretty brutal addition to C++... i guess it makes sense, but it sucks having to use it basically everywhere. And.... yea, getting the marlin changes done i think will probably be the "easy" part of this whole venture. Usability and support will be another journey. |
This makes for informative reading, if you haven't already… The Klipper universe has me installing simulavr, which I should have installed long before now anyway… |
Managed to get everything running up to 69,632 Hz. The harmonic noise starts to get pretty interesting at that speed... (still not loud, but Id like to aim for a white noise characteristic). Might play around with introducing some sort of entropy there for table-lookup offsets. |
I look forward to giving it a proper run once I have a free day to get everything set up. |
amazing stuff. really. so you worked that out 3 years ago? think i found the G6 in the recent bugfix, right? So this is just installing an octo addon and it will basically work? im not really into that raspberry/linux stuff, my friend bought me a pie zero... thats shitty from the beginning. and i always wondered, how that stepping workload could be moved away from the controller so sad that it took so long to publish that feature. is nobody interested? lucky for me, that im just printing for one year now. but that work seems to be a mature improvement right? |
As the recent Marlin board are more strong, like ESP32, STM32F4, etc. they have FPU in CPU. Are they capable to do the calculation on board instead of host machine? |
Always had been. Only AVR and STM32G0 can struggle a bit when you go above 100mm/s, depending on other circumstances. |
Description
This is a revival of the Marlin 1 PR for "stepper chunks" #7047
Direct Stepping allows a host device to issue direct stepper movements that are defined in a binary format that is written ahead of time by the host device to a page in the device RAM.
The mechanism provided for loading the binary data onto the device is the "page manager". The page manager provided here uses a parallel protocol over the USB serial connection to write pages to the device RAM, and is decoupled from the normal serial g-code pipeline. This allows the host device to preload pages as fast as possible without waiting on the g-code pipeline.
Once a page is written by the device, it can be triggered using the G6 g-code which references the page index that should be used for that move. Depending on the page format, direction arguments may need to be provided in the G6 code.
Page Formats
Each format has different tradeoffs and performance characteristics. This PR includes 3 different page formats that should cover a general range of use cases, as well as an abstraction for creating different formats. The naming scheme for the formats follow this general pattern:
The three provided formats:
The segment-based compression still provides total geometric accuracy, but breaks the motion into tiny line segments for the sake of page size. The compressed segment value is then used in a lookup table to produce the actual steps the device will take.
SP_4x4D_128 is a good format for movements which may be very quick and change direction often (multiple times per 1024 steps). SP_4x2_256 is a good general purpose format that seems optimal for 3d printing. SP_4x1_512 may not be able to reach the same step rate as the other two, but provides total motion accuracy.
More detailed description of the page formats and the serial page manager protocol will be provided soon on the RepRap wiki: https://reprap.org/wiki/Direct_Stepping
G6 Code
The g-code used to trigger the direct stepping motion references the index of the written page, and varies slightly if the format is directional:
Benefits
Ultimately this feature is about offloading the kinematics, physics and planning to an external device. This allows Marlin to run more in a deterministic and constant-time state by pushing the bulk of the complexity and mathematics on to a more powerful general purpose computing device.
Testing
Testing can be done using step-daemon.
WARNING: Position sync in step-daemon is not entirely finished and movements made with the control panel may be lost. At this moment, homing is required to sync step daemon and the device. Always home before issuing movement commands.