Skip to content

Pressure advance calibration tool#4115

Open
legend069 wants to merge 31 commits intosupermerill:masterfrom
legend069:pressure_advance
Open

Pressure advance calibration tool#4115
legend069 wants to merge 31 commits intosupermerill:masterfrom
legend069:pressure_advance

Conversation

@legend069
Copy link
Copy Markdown

new pressure advance calibration tool ! - yay :)
i've read how orca does this, and i wanted it to do it differently. not a fan of the "custom gcode lines"
per_objects_gcode i'm hoping to be a powerfull tool that can be used in later features / calibration tools
example;

  • user configures it to add the 'camera snapshot macro' it would take a snapshot per that object
  • user configures it to make the printer 'beep' when it prints that object.
  • configures it to call a klipper macro to change toolhead.

theres a fair few areas where it can be used.

still alot of work to-do!

generates and slices model just fine.
few bugs to workout, mainly with CalibrationPressureAdvDialog.cpp model sizing, handling default values, converting float/percent values, hard coding in where retraction/seams would be, having the values be use input choices(not combo boxes)
per_objects_gcode later can be used to insert the smooth_time bits aswell.

can i please get help with inserting the per_objects_gcode where it's supposed to be ? 🙏
i'm not entirely sure how the Gcode generation works, and how to get it to process each object/volume and layers
would also need to add the "first layer pa"first_pa for the first layer only too(i've noticed during all my PA prints the first layers PA value needs to get set for the first layer speed, otherwise it looks like it has bad layer squish. but it's actually PA doing that.)

-currently generates the model and only writes the PA values at the start of the file(helps verifying it's correct)
note: cmake will throw a fit if you don't rebuild the deps 🙃

supermerill and others added 8 commits December 19, 2023 10:27
gcode now emmits SET_VELOCITY_LIMIT instead of m204 commands with the decleration value
"work arounds" are mentioned a fair bit in Voron discord.
"work around" is also using custom_gcode
figured i'll add it quickly.
updated tooltip for travel_deceleration_use_target and deceleration_factor
removed deceleration_match_to_er_acceleration
improvements for deceleration_factor.
seems to work well now.
updated tooltip for deceleration_factor.
This reverts commit cb1e694.
This reverts commit bfdff0d.
initial upload, still alot of work to-do!
generates and slices model just fine.
few bugs to workout, mainly with CalibrationPressureAdvDialog.cpp model sizing and what not
per_objects_gcode i'm wanting to be a 'powerfull' tool that can be used, later it will be used to insert the smooth_time bits aswell.

need help with inserting the per_objects_gcode where it's supposed to be :upside_down: currently it only writes it all at the start of the file(helps verifying it's correct)
@supermerill
Copy link
Copy Markdown
Owner

Thanks, i'll review it tomorrow.
Do you want it to be merged on the 2.4, 2.5 or directly into the 2.7 branch?
Currently the master is on the 2.4.
and master_dev is on the 2.5.
Maybe I should just rename them master_24 and master_25 like prusa does.

@legend069
Copy link
Copy Markdown
Author

Do you want it to be merged on the 2.4, 2.5 or directly into the 2.7 branch?

that's a good question!
currently alot of users are just jumping from release to release. so i think 2.7 would be best, just to help with debugging and the devs jumping between versions.

@legend069
Copy link
Copy Markdown
Author

another bug i've found is the models will need to be scaled correctly so the selected extrusion roles widths will work correctly(although this might be already fixed in the 2.7 merge) but then scaling the models will "skew" the model slightly so it will no longer be a "perfect" 90° bend

pretty pictures :)
image

to add with the main calibration configure page i would like it to have a " dropdown" row so the user can select the extra calibration tools to make based on selection for "numbers of tests to create" i'm not at all familiar with wxWidgets 😢
Nxwz08Zfai

@supermerill
Copy link
Copy Markdown
Owner

what do you mean by "dropdown row" ?
something like the flow help/details in the width& flow tab in print settings?

@legend069
Copy link
Copy Markdown
Author

what do you mean by "dropdown row" ? something like the flow help/details in the width& flow tab in print settings?

theres been requests to be able to have several PA calibration tests on a single plate.
easiest way i've found is to have the user select them on the main GUI (screenshot below).
number of tests to create = 3 would create two separate rows for the user to adjust parameters for.
clicking generate would then create 3 PA tests each model would have the parameters for the selected ER roles.

Nxwz08Zfai

@supermerill
Copy link
Copy Markdown
Owner

what you can do:
have a box were you select the number of items.
set a callback on this box

    my_combo_box->Bind(wxEVT_COMBOBOX,  [this, my_combo_box](wxCommandEvent&) {
        this->redraw_bars(my_combo_box->GetSelection())
    }, my_combo_box->GetId());

and when the value change:
. if more than before, add a row
. if less than before, remove a row

I think the best is to create a wxFlexGridSizer to store your table.
just set the number of cols.
when you add a line, add all item of the row (same number of Add as the col number)
when you remove a line, call Remove(GetItemCount()-1) the number of col you set.
I think it could work.

@legend069
Copy link
Copy Markdown
Author

I think the best is to create a wxFlexGridSizer to store your table. just set the number of cols. when you add a line, add all item of the row (same number of Add as the col number) when you remove a line, call Remove(GetItemCount()-1) the number of col you set. I think it could work.

sorry for the delay, i haven't had much spare time recently.
i'm not familiar with WxWidgets so this is a real challenge for me. I'm going to need to put aside some more time and mess around with wxFormBuilder to see what would work for the GUI

@supermerill
Copy link
Copy Markdown
Owner

You can left it to me, but then you'll have to describe exactly the behaviour you need (input, output, drawing, etc..).

@FoldZero
Copy link
Copy Markdown

can you make it work for both .4 and .6 noxxles?
Orca currently has an issue with the .6 - looks to be a purely mechanical issue with proper line widths not being set in the generator properly.

@legend069
Copy link
Copy Markdown
Author

can you make it work for both .4 and .6 noxxles? Orca currently has an issue with the .6 - looks to be a purely mechanical issue with proper line widths not being set in the generator properly.

thanks for mentioning that. i've changed nozzle sizes and everything breaks 🙃
with my new changes,
selecting a 0.4mm nozzle the wall count/ect is good
using a 0.8mm nozzle the wall count gets calculated to 6(not my target of 4)the model itself doubles in size, not ideal i know..

but i'll keep messing around with the math to try keep the models the same size+scale for widths for regardless of nozzle_size

@legend069
Copy link
Copy Markdown
Author

You can left it to me, but then you'll have to describe exactly the behaviour you need (input, output, drawing, etc..).

thank you, I should be able to figure out the math/scaling issue to get everything aligned up.
due to the scaling/positioning issues, i think it would be 'easier' to create several models for each nozzle size. this way the models don't change size in xy, they will just have different 'thickness'

as for the GUI, it will just need to have that "dropdown box" so users can select other variables for the other PA test to run(so they can run several tests for 1 plate), how it 'looks' doesn't really matter that much.
planning on including "smooth_time" with it too, but that's an easy enough change with a bool checkbox and some text changes.

made new 3mf models for the new scaling method i'm using
might put them in another folder later
needed a more clear description of path when reading code, considering adding a "wave 90 bend" model, the "wave" style should make it more obvious between PA values instead of focusing on the corner.

removed other border file, easier to use 1 model for the border.
managed to fix scaling issue with different nozzle sizes.
tested with fair few combinations of nozzle sizes, layer height, base layer height, extrusion role widths.
seems solid on that part now.
added "verify" extended feature, this is just for users to see what ER roles need a new PA value

scaling of the borders can still be improved though. it's decent enough for now, but on larger nozzle sizes the borders/numbers get a touch too large and you get "overhangs"

TODO: bug test, for any values that get used if percent/float ect
TODO: find calculation for external/internal bridges, overhang, ironing, support material/interface
TODO: add more info to .html file.
fixed GUI prompt for "unsupported firmware type"

need to figure out the math required for the right border so it will be scaled with the numbers..
math is hard :(
need to re-adjust scale for left/top/bottom now, since larger nozzle sizes can prevent bottom solid layers forming.
@supermerill
Copy link
Copy Markdown
Owner

working on it.

  • i'll rework object_gcode so it work, and add region_gcode.
  • i'll fix the acceleration (currently they won't split fills) and put the ironing one into the object.
    when it's finished, i'll retry your calibration.

legend069 and others added 7 commits June 13, 2024 16:05
updated to 2.5.59.11
adjusted scale in z for the 90_bend models so print would be slightly quicker.
found a couple new bugs with merge regarding the auto arrange
everything else seems to be ok.
allow to write some gcode each layer, when an object began to print.
Useful for calibrations.
allow to write some gcode each time a region start to print something (perimeter, infill, ironing).
Useful for calibrations.
 * fix all step invalidation incoherence
 * rename bridge_internal_* settings to internal_bridge (like orca)
 * reorder entries when they weren't sorted by alphanumeric order.
large improvements.
now possible to config multi-plate testing
changed default values for test.
cleaned code up a fair bit
found //BUG: custom gcode ' between extrusion role changes' should that be before or after region gcode?
@supermerill
Copy link
Copy Markdown
Owner

I've merged your latest changes into the /dev branch
03906fa
I applied this path of mine:

  • move object & region-based config into the object, so the current main config won't change that much.
  • apply ensure_on_bed() so there isn't any sinking model
  • "update plater" only once.
    btw, on my win10, i didn't need to resize my window for the field to appear.

@legend069
Copy link
Copy Markdown
Author

thank you, i think this tool is almost finished, just need more feedback from the users now.
i can't think of any other improvements for it.( until i get the PA injection per ER role completed that is. )

move object & region-based config into the object, so the current main config won't change that much.

i was planning on switching this over aswell, but wasn't sure what other configs might need to be changed. (still need more feedback from users)

apply ensure_on_bed() so there isn't any sinking model

might need to adjust the z scale/position for the numbers

btw, on my win10, i didn't need to resize my window for the field to appear.

that was fixed with the void CalibrationPressureAdvDialog::on_row_change() function, i don't think the flashing can be fixed though

updated to master, adjusted pressure calibration max tests to 10
large improvements.
now possible to config multi-plate testing
changed default values for test.
cleaned code up a fair bit
found //BUG: custom gcode 'between extrusion role changes' should that be before or after region gcode?

adjusted scale in z for the 90_bend models so print would be slightly quicker.
found a couple new bugs with merge regarding the auto arrange
everything else seems to be ok.
found issue with origin point on exported models.
adjusted numbers model to be 1 line width prev was x2 line width
set sizes to exact numbers
removed a bunch of lines and cleaned up.
couple new small features. loads extra number for test ID to bottom right of model.
fixed scaling in xyz
fixed flow calculations for scaling
max height of *5 layer_height
set read only for "number of tests" to create 10 is max(because of test ID feature, this can be fixed later on.)
set read only for "extrusion role" select
updated tooltips
removed some unnecessary text from main config window
on updating row count it auto populates the next rows(this is kinda buggy and could use improving)

i have not done any prints with beta v1.20 yet
up next: fix the welcome page and have it provide usefull information 😃
fixed bugs with default values not getting set.
fixed issue with 'internal_bridge_speed' missing on GUI
small typo in "before_layer_gcode" there is no layer "0"!
added 'false' flag for rotate when adding models, this might fix 45 degree printer bug?
first_layer when generating tests will no longer have gap fill.
first_layer now adds it's PA command correctly and each test has it's independent value
welcome page now autoselects last selected role when running multitest plates.
infill_every_layers for internalinfill is now supported
if your feature_gcode contains firmwares set PA/LA commands it will be auto commented out when exporting .gcode file
added darkmode support for the calibration windows (i still need to test the other calibration windows if they still work, and are clickable)
added support for the support material layerheight
i need to get the switch statement working to help with maintainability then do alot more refactoring

2.7 notes:
compiled 2.7 and made adjustments here so it's ready.
arrangement process, and object modifiers are broken, everything else seems to be ok(have not checked the gcode output)
scrolling in the object list is now very slow/the scrolling action gets a 'queue' if you scroll then stop the GUI keeps going then stops
if a user tries to import a config file that has saved filament overrides
SS will crash.

will need to fix : FullPrintConfig::defaults(); so it generates default values for ALL config options?
@supermerill supermerill added the fix is live in the last release Please download /build the last release and try to reproduce. label Apr 2, 2025
@TheAndr0id
Copy link
Copy Markdown

i was planning on switching this over aswell, but wasn't sure what other configs might need to be changed. (still need more feedback from users)

I don't know if this is the correct place to provide the above feedback, but I guess if anything my feedback will be connected to the PR for the change.

I've been using Ellis' PA tool for a while now and while it works well enough, having something in the slicer that would pull all the settings in sounds great. It's close, but I have some issues/concerns/suggestions.

  • The trailing 0s on the labels are a waste of filament, and the labels in general are too big. A major benefit of Ellis' tests is they are fast and don't use much filament unlike the tower print tests for PA/LA in OrcaSlicer. With the label size this benefit is lost.
  • The test generation doesn't take bed size into consideration. Generates tests that can't be printed because they don't fit on the bed.
  • No control over the pattern spacing like Ellis' tests. I can place more tests in the row with closer spacing and thus spend less time doing multiple prints to cover the range I want to test. (for example I use a 2mm spacing with the Ellis' test)
  • Additional description on what exactly the Extrusion Roles are. Is it just using the speeds/acceleration for the specified role? Flow rate overrides? Sorry, I'm just not understanding...
  • Last used values need to be saved. Having to reenter all the settings every time gets real old quickly.
  • First layers LA should default to off (or "0").
  • I understand pictures are still a todo item, but how to interpret the tests is very important. I'm glad you included the link to Ellis' page as there is some description/direction there.

@legend069
Copy link
Copy Markdown
Author

* The trailing 0s on the labels are a waste of filament, and the labels in general are too big.  A major benefit of Ellis' tests is they are fast and don't use much filament unlike the tower print tests for PA/LA in OrcaSlicer.  With the label size this benefit is lost.

the trailing '0's have been limited to '2'. the numbers can't get any smaller if they do then it would get considered as a "thin wall" and parts of it won't get sliced/printed.

* The test generation doesn't take bed size into consideration.  Generates tests that can't be printed because they don't fit on the bed.

why should it take the bed size into consideration? if the user generates a model that's too big then that's their fault not the software?

* No control over the pattern spacing like Ellis' tests.  I can place more tests in the row with closer spacing and thus spend less time doing multiple prints to cover the range I want to test.  (for example I use a 2mm spacing with the Ellis' test)

this has been fixed and the spacing is calculated based on the thickness of the 90_bend model / other factors.

* Additional description on what exactly the Extrusion Roles are.  Is it just using the speeds/acceleration for the specified role?  Flow rate overrides?  Sorry, I'm just not understanding...

extrusion role = external/internal perimeter ect. you can set different speed, width, fan cooling, layer heights ect per extrusion role. most users calibrate PA for the external and leave it as that, but this negatively impacts the other roles, especially supports/ internal infill if they're done at different heights.

* Last used values need to be saved.  Having to reenter all the settings every time gets real old quickly.

when the PA per extrusion role code is merged i can make the tool pull the values the user has currently saved in their config.

* First layers LA should default to off (or "0").

please explain why.

* I understand pictures are still a todo item, but how to interpret the tests is very important.  I'm glad you included the link to Ellis' page as there is some description/direction there.

i don't have the time/hardware to take high res /close up photos :(
this tool is similar to ellis' but it's still different due to how the spacing/width is done. so the method to interpret the printed results is technically different.

@TheAndr0id
Copy link
Copy Markdown

the trailing '0's have been limited to '2'. the numbers can't get any smaller if they do then it would get considered as a "thin wall" and parts of it won't get sliced/printed.

I just opened an issue ticket #4738 that shows the issue with the extra zeros. With the current release it is printing 4 extra zeros on the labels. I didn't see a way to change that.

* The test generation doesn't take bed size into consideration.  Generate tests that can't be printed because they don't fit on the bed.

why should it take the bed size into consideration? if the user generates a model that's too big then that's their fault not the software?

Initially I would say user experience. It's frustrating to go through all the settings to find out the generated test is not going to work and have to start over. If the user doesn't know how big the generated test is going to be is that the fault of the software or the user? 😄

extrusion role = external/internal perimeter ect. you can set different speed, width, fan cooling, layer heights ect per extrusion role. most users calibrate PA for the external and leave it as that, but this negatively impacts the other roles, especially supports/ internal infill if they're done at different heights.

Thank you, that helps. I've also been playing around a bunch with the test today so I've gotten a better feel for what these roles are.

* First layers LA should default to off (or "0").

please explain why.

If you are running the test to determine LA, how would you know what value to set the first layer LA to? Also since (usually) the first layer is printed very slowly for bed adhesion LA doesn't really do anything at slow print speeds.

* I understand pictures are still a todo item, but how to interpret the tests is very important.  I'm glad you included the link to Ellis' page as there is some description/direction there.

i don't have the time/hardware to take high res /close up photos :( this tool is similar to ellis' but it's still different due to how the spacing/width is done. so the method to interpret the printed results is technically different.

Maybe a diagram with a description? Sometimes photos are hard to explain what one should look for.

If this test has different results than the Ellis test what is the process for interpreting it?

@legend069
Copy link
Copy Markdown
Author

why should it take the bed size into consideration? if the user generates a model that's too big then that's their fault not the software?

Initially I would say user experience. It's frustrating to go through all the settings to find out the generated test is not going to work and have to start over. If the user doesn't know how big the generated test is going to be is that the fault of the software or the user? 😄

lets say that the code gets added to calculate the size of the test, it will then prompt an error and the user will still have to adjust the values again.
the window can be dragged out of the way while the main UI is still accessible, i think the help window says this too.

  • First layers LA should default to off (or "0").

please explain why.

If you are running the test to determine LA, how would you know what value to set the first layer LA to? Also since (usually) the first layer is printed very slowly for bed adhesion LA doesn't really do anything at slow print speeds.

there are some users that print the first layer at 200mm/s
since the first layer is printed at a different speed regardless of the amount it will need it's own LA value.(i would like to get data on users with larger nozzle sizes and how this works here too.)

I understand pictures are still a todo item, but how to interpret the tests is very important. I'm glad you included the link to Ellis' page as there is some description/direction there.

i don't have the time/hardware to take high res /close up photos :( this tool is similar to ellis' but it's still different due to how the spacing/width is done. so the method to interpret the printed results is technically different.

Maybe a diagram with a description? Sometimes photos are hard to explain what one should look for.
If this test has different results than the Ellis test what is the process for interpreting it?

between extrusions 2 and 3 there would normally be "internal infill" there is no overlap in this area they're "perfectly" spaced so the extrusions will be barely touching, if in a perfect world. (i don't think this is in the current release, i had to do some complex math to figure out how to get it like this.)
with more time and experimentation this could be used as a way to "calibrate it". as i've found the gap "fades" through the printed model.
the user should be selecting the value that best resembles "sharp corners", none of the rounded stuff.
the biggest problem

qJenpqUtWb

@TheAndr0id
Copy link
Copy Markdown

lets say that the code gets added to calculate the size of the test, it will then prompt an error and the user will still have to adjust the values again. the window can be dragged out of the way while the main UI is still accessible, i think the help window says this too.

I may very well have missed that help message, and that's on me - but if I missed it, others will as well. I was thinking of a single line status message stating something like "test exceeds available print surface" on the bottom of the window in red/yellow to make it clear that the test isn't going to fit.

It would also help with determining the resolution of the test being created as well. For example, I want to test 0.02 -> 0.03 values, but can I go in increments of 0.005 or even 0.001? I select the value and determining if it will fit would be a simple formula to calculate how long and wide that test would be. Compare that to rect_size(0) and rect_size(1) and report an error/warning message.
(please PLEASE don't make it blink... 😄 )

It makes it much easier to quickly generate test parameters without having to generate the test, find out it doesn't fit, clear the print surface, go back into the test window change values and repeat. Even moving the window out of the way (I work on a smaller screen, there's no way to have the print bed and the test config windows up at the same time...) is a bit of a hassle for the sake of a single line warning message.

  • First layers LA should default to off (or "0").

please explain why.

If you are running the test to determine LA, how would you know what value to set the first layer LA to? Also since (usually) the first layer is printed very slowly for bed adhesion LA doesn't really do anything at slow print speeds.

there are some users that print the first layer at 200mm/s since the first layer is printed at a different speed regardless of the amount it will need it's own LA value.(i would like to get data on users with larger nozzle sizes and how this works here too.)

And that's fair, but wouldn't a value of zero be the safest default? I'm going to change it to zero every time I run the test since I don't want weirdness happening because I used a value I shouldn't.

I may very well be interpreting this test incorrectly, but I've never even considered the first layer in this type of test. I'm always looking at the results of the top layer to see what/where gaps are sharpness of the corners, etc.

In reality, I am currently using K values in the 0.22 - 0.24 range. I have NO idea what a K value of 0.04 will do... (I'm guessing it would not be good)

I understand pictures are still a todo item, but how to interpret the tests is very important. I'm glad you included the link to Ellis' page as there is some description/direction there.

between extrusions 2 and 3 there would normally be "internal infill" there is no overlap in this area they're "perfectly" spaced so the extrusions will be barely touching, if in a perfect world. (i don't think this is in the current release, i had to do some complex math to figure out how to get it like this.) with more time and experimentation this could be used as a way to "calibrate it". as i've found the gap "fades" through the printed model. the user should be selecting the value that best resembles "sharp corners", none of the rounded stuff. the biggest problem

This sounds very similar to the method described in the Ellis test. I wouldn't worry about getting "high def" photos of the tests. If you use modeled extrusion paths (like the image used above) showing a bad result and a good result that would give a starting point of what to look for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix is live in the last release Please download /build the last release and try to reproduce.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants