-
-
Notifications
You must be signed in to change notification settings - Fork 968
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
pa calib: batch mode for pa pattern #7199
base: main
Are you sure you want to change the base?
Conversation
Add option for batch mode calibration. In this mode a number of tests shall be generated based on a set of acceleration and speeds provided.
Add support for a batch mode calibration: create whole set of tests for a given accelerations and speeds which may help during Adaptive PA calib.
Really nice work so far! Would it be possible to print as many pa tests as possible on one build plate in object-by-object mode? It would help save even more time when testing for adaptive pa, while also keeping the results accurate. (At least that's how it seems in my head) |
This is fantastic, thank you very much for picking this up and doing the work on it! Awesome :) |
A suggestion if I may - the Pa pattern test is of fixed Y size. We also know the build plate size. Could we add a function that arranges as many as possible in the Y direction and spacing the cubes by the Pa pattern test plus some margin? |
@cochcoder, @igiannakas, thank you for suggestions. In theory this is possible, however we could be limited by tool head collision check algorithm we currently have for by-object print sequence which is taking into account vertical projection of the tool head and does not care about approaching angles of the nozzle and part cooling vents. It may not be an actual issue since this test is only 4 layers tall. However we also need to consider a possibility user will have custom cooling like UFO featured at NeedItMakeIt video : |
Clear destination vector so string parse result will contain only the new values.
I don’t think it’s necessary to print by object - the Pa value is set at the start of each line. We could issue the same for print speed and acceleration commands so the test is consistent on a print by layer approach :) |
Somehow, the idea to pack several tests to a single plate is growing on me. I'll check what could be done. |
Manipulate object directly rather than by using gizmos.
Reduce spacing between 'handle' cube and test pattern itself to make print one piece
I'm +1ing the thought for multiple PA pattern tests on one print sheet. I initially thought that was what this pull request was for, but then I watched the little video clip and was surprised it was still spitting out the tests on individual plates still. I think it'd be very nice if we're able to condense the entire adaptive PA testing process in just a couple of print sheets. Doing them 1 at a time takes forever. |
Rework CalibPressureAdvancePattern to work on object rather than whole model.
@jeremytodd1, originally idea of this change was to reduce a manual work associated with tests setup since it was too many manual steps to configure single tests as well as need to manually track how much tests were made and which are left. Small update: it seems we'll going to have multiple tests per plate. I still need to do some cleanup and testing, but most of the changes related to custom gcode generation is done. |
Place multiple test anchor objecs per plate. Tests not properly generated yet since the only custom gcode object is stored per plate
Merge custom generated G-code on per-layer bases to make multiple tests works on a single plate
print purge line at slightly slower rate in order to force update flow and acceleration for test layer pass
I think I've got something worth testing: pa-pattern-batch2.mp4The only problem remains is related to UI: you should slice model either at first plate and switch plates at gcode preview page, or use "slice all" button. Somehow slicing does not work yet if you slice not the first plate. |
It is time to test this PR. On my side I've done few prints on my Creality V3 SE (220x200, 3 patterns per plate) Current implementation enables multiple pattern per plate for rectangular plates only. |
I haven't tested it yet but just noting down some of my experiences with the PA test and the code around it:
I think you've got that covered but thought just to make a note for testing purposes, especially on how these areas are handled. |
I have checked Acceleration and Speed set correctly for each pass (there are commit specifically for this), but I did not pay attention to other parameters assuming they are the same for all tests. |
Remove 'batch mode' checkbox. Always use batch mode for PA pattern Allow empty accels and speeds: default accel/speed will be used in this case
Found a bug. I have PLA silk limited to 8 mm3/s. If I set batch to speed 40,95 and then I slice ok, max vol. speed is 7.73. If I set 40,100 it generates the cubes, then once I click "Slice", it crashes. |
Also, the PA window is resizable, but nothing resizes. Either the elements should be resizable, or the window should not be. |
Maybe it's late to ask, but I have to point out that I find quite cumbersome to be asked to provide speed and acceleration, when the actual parameter used by the adaptive PA algorithm is flow rate and acceleration. Would it be possible to switch from speeds to flow rates, and use the layer height which is set in the usual settings to obtain, internally, the speeds? I think it would be way more user friendly and consistent. |
@buzzhuzz It looks nice! Thank you. |
Sorry for late reply. I had some work to do last month. I'll check bug mentioned by @dewi-ny-je and problem mentioned by @SoftFever somewhere next week. |
This is a good question actually. Despite flow rate being metric which actually defines the print speed, users usually referring to the speed in mm/s as a printing speed metrics. In addition to this, only print speed in mm/s available in print configs. Current implementation uses mm/s as it inherits configuration used previously. Having dedicated text field just for the speeds we might input volumetric speed there and offload volumetric to linear speed recalculations to the calibration flow. It could be implemented and I kind of like switching to volumetric speed as an input for PA calibration routine. @Noisyfox , @igiannakas , what do you think, would it be good change? |
From my point of view
|
It seems I also cannot with your latest build using volumetric inputs. I'll report back once more tests are done. |
hi there! I've been testing this for a little while and got a few inputs for your consideration: Use of volumetric flow vs speed
basically I am in agreement with your comment above here: #7199 (comment) Pressure advance, from when developing adaptive PA, is observed to depend on volumetric flow rate (for which speed is used as a proxy) and acceleration. When not using adaptive PA, typically a user calibrates for a specific speed (usually an in-between the external and internal perimeter speed), at a specific layer height which they mostly print at and with an acceleration that is typical of the external features they print. This gives a good all round calibration when not using adaptive pressure advance. Yes indeed the effect is that print speed + layer height + line width -> flow rate but the user calibrates for a print profile, not a specific flow rate, hence that mental disconnect if that makes sense. By requesting the test being done in terms of flow rate, it is incrementally difficult for the user to set the input parameters, especially if they have no interest in adaptive PA (eg. bambu lab users for which the feature is not appropriate, or for filaments that are infrequently used). When using adaptive PA, the user is intended to calibrate again in the speeds and layer height they use the most. That is because the mathematical model used has zero delta error in predicting a PA when the input parameters match the calibrated model parameters. Eg. there will be no deviation between forecast PA and measured PA for a specific print speed, layer height and acceleration. As such, the user should be using calibration parameters that are as close as possible to the real world use of the printer - eg. if they print external perimeters at 50mm/sec, internal at 150mm/sec and sparse infill at 200mm/sec, a calibration model of 50-100-150-200 should be executed. At the typical layer height they use. Therefore, using flow rate as an input to the calibration process would make the calibration workflow more convoluted:
Therefore I would recommend that this change is reverted to the test. The only benefit this has is to make the calibration model numbers round, while introducing a change that is not immediately intuitive for users. Bugs:
Hope this is useful :) |
@igiannakas are people really printing at a certain speed? I don't think so: I have (and all standard profile follow this approach) a higher than needed speed, which will be limited based on filament profile. This is why I assumed flow rate makes more sense: I have literally no idea of the speeds I'm printing at, I know that PLA is set to 14 mm³/s, ABS 17, either one in Rapido/HF/HS variant does, in my printer, 24 mm³/s. Speeds follow. Knowing speeds is something that dates back to i3 times, when people knew 60 mm/s is standard speed, 90/120 high speed, and 20-30 mm/s the speed for slow/difficult filaments. Now? I wonder. Whoever does batch mode is not unlikely printing using my approach, so I think at least the option to input flow rates (as floats, as you pointed out) makes sense. |
They are - let me explain why: This requires you to avoid certain zones when printing things like external perimeters to avoid creating VFA's and internal features to avoid resonating the motion system. Hence print profiles are tuned to allow for specific speeds with the volumetric flow rate being the overall cap for the filament/hotend combo. What you'll see above are three major zones - a low vibration one up to around 65 or so mm/sec - a resonant zone from 65-105 or so, and a lower resonant but not as low as the first one, from 105 and above. This means that for best quality I need to print below 65mm/sec. Therefore based on the vibrations profile for my printer I have tuned 2 separate profiles
This way I avoid the resonant zone between 65mm/sec or so and 105mm/sec. Part strength: While you can achieve the same by reducing the overall flow limit of the filament, I've found it more useful to be able to tweak the specific print speed of individual features to cater for the strength characteristics I care about. For example if I plan to push Print quality:
Also dont forget material changes in appearance the faster you print - for example this is the reason I've implemented this change here: #5148 So for me, I treat the flow rate as a global speed limit for the material, while using print speeds as the primary parameter to achieve the objectives I need - speed, quality, strength and at what balance with each other, if that makes sense? |
Thank you for your testing and in-depth discussion on calibration approaches. Let me revert volumetric speed configurations and return back to linear speeds in order to complete this PR. We could discuss calibration inputs in separate issue/PR. |
@igiannakas , I've fixed special case when only 1 value is given for either speed or acceleration. Now global config shows actual test values in this case. |
If speeds have to be entered, it makes even more sense to save the last used values so I'll get them without having to calculate them each time. @igiannakas I'm still unsure so many people approach the issue like you, since those resonance graphs are not even obtainable on the vast majority of printers... Probably basic users use speeds without adaptive PA, intermediate use adaptive PA with speeds capped by volumetric flow like me, and very advanced users go back to speeds for optimal optimisation. |
You can get those resonance graphs on any machine running klipper - it’s the shake tune plug in which for the Voron community is very popular tuning wise :) For non klipper machines the orca VFA test does something very similar. I’d strongly recommend any user to be tuning based on speed and using flow as a cap and not go out max speed on all features. You can get some very good prints like that. all of the below were printed on my V2.4 350 with the above strategy :) |
Not really, not all Klipper printers are open to add modules and not all are on the latest klipper, or can be updated to it. Qidis cannot, for example, unless heavy changes are applied. I could use an old SnT on my Q1, but X-3 series cannot. Not to mention that in Qidi forums I see many people asking what to do with those graphs, so even those who can, can't do always much with them. You are a very advanced user (suffice to say you coded the adaptive PA and various patches to klipper, isn't it?) so your point of view tends to be skewed and assume a bit too much from the users.
Ok, this is a stronger point, of course, which everyone can ACTUALLY do, unlike SnT.
yeah they look as clean as my ABS prints on my Q1 Pro without doing anything of those speed and frequency optimisation but simply capping top speed automatically based on layer and max flow rate, so not a great argument to support doing a much more complex tuning for no improvement. Let's put it another way to proceed further: no matter whether we like flows or speeds for this batch PA tuning, do we agree that in both cases having the last set of values inputted by default would save all of us time? I'll save the speed/flow conversion, but if it's precompiled with the latest values, it's a one time only annoyance. You don't have to do the conversion, but still easier to have already there the values you would input again. I think that, considering the amount of typing alone needed to input maybe 9-16 lines (3x3, up to 4x4), offering the previous set of calibration points makes sense. |
Description
Add batch mode for PA pattern calibration: generate a set of tests for a given list of accelerations and printing speeds. Better to use in conjunction with #7178
Screenshots/Recordings/Graphs
pa-pattern-batch-mode.mp4
(screen recorded on a build with both current and #7178 PRs applied)
Tests
Limited testing. Community testers are welcome.