Skip to content
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

Pressure advance calibration tool #4115

Open
wants to merge 29 commits into
base: master
Choose a base branch
from

Conversation

legend069
Copy link

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
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
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
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
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
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
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
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
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

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
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
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
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
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
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants