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

Tramming Wizard #20000

Merged
merged 13 commits into from
Nov 7, 2020
Merged

Tramming Wizard #20000

merged 13 commits into from
Nov 7, 2020

Conversation

Speaka
Copy link
Contributor

@Speaka Speaka commented Nov 2, 2020

Work in progress! Help and ideas welcome!

Description

I was tinkering with G35 before and didn't like the workflow very much. Execute command, adjust bed, exec again, see still differences, adjust and so on...
I really like guided adjustment workflows so i decided to develop my own "Bed Tramming Wizard" based on the G35 #16897 command.

Benefits

What's the wizardry?

  1. Call the tool from Menu Advanced
  2. Select the Tramming point from which the adjustments should be calculated.
  3. Click to probe this Point. (Saving measured Z)
  4. Select another point.
  5. Click to probe this
  6. See the difference in measured z distance (and screw turns)
  7. Adjust the bed
  8. Click to probe again <- this is the main benefit
    Repeat 6-8 until point is levelled sufficiently
  9. Select next point and repeat until all is fine

What needs to be done?

  • Clean the code. Correct makros.
  • add specific defines
  • sanity checks
  • Optimize the menu tree and functions
  • Add screw turn adjustment output
  • debug on other machines and displays
  • debug different probe types
  • translation
  • automate most possible steps (Autoprobing)
  • visualize measurements [Datagrid, adjustment bar]

legal notice ;)

I'm definitely no skilled coder and pretty new to marlin. I did a lot of copy pasta to get this running. It works but still has it flaws and a lot of space for improvements.
I'm filing this Draft PR to get some responses, hints and ideas from other users and the team.
Let me know what you think about this feature!

  • Is it worth investing more time?
  • Would you use this?
  • Would a beginner benefit from this. Especially with diy printers this would be helpful in my mind.
  • Whats missing?
  • Whats wrong?

Edit: Didn't see the FRs. Possibly adressing #19480 #18489

@ETE-Design
Copy link
Contributor

Have asked about this feature, cause I don't want to connect a computer to tram it, so would use it :-) Is it made with same GFX like BLTouch Offset?

@Speaka
Copy link
Contributor Author

Speaka commented Nov 2, 2020

I don't have BL-Touch installed, so idk the menu. I will have a look for it (and see what features may be stolen from there)

@ETE-Design
Copy link
Contributor

ETE-Design commented Nov 2, 2020

@thinkyhead Have just tryed to compile with your changes using UBL, but got this error:

Marlin\src\lcd\menu\menu_tramming_wizard.cpp: In function 'bool probe_single_point()':
Marlin\src\lcd\menu\menu_tramming_wizard.cpp:43:77: error: 'selected_point' was not declared in this scope
   const float z_probed_height = probe.probe_at_point(screws_tilt_adjust_pos[selected_point], PROBE_PT_RAISE, 0, true);
                                                                             ^~~~~~~~~~~~~~
Marlin\src\lcd\menu\menu_tramming_wizard.cpp:43:77: note: suggested alternative: 'selectFunc_t'
   const float z_probed_height = probe.probe_at_point(screws_tilt_adjust_pos[selected_point], PROBE_PT_RAISE, 0, true);
                                                                             ^~~~~~~~~~~~~~
                                                                             selectFunc_t
Marlin\src\lcd\menu\menu_tramming_wizard.cpp:45:3: error: 'z_measured' was not declared in this scope
   z_measured[selected_point] = z_probed_height;
   ^~~~~~~~~~
Marlin\src\lcd\menu\menu_tramming_wizard.cpp: In function 'void _menu_single_probe(uint8_t)':
Marlin\src\lcd\menu\menu_tramming_wizard.cpp:50:3: error: 'selected_point' was not declared in this scope
   selected_point = point;
   ^~~~~~~~~~~~~~
Marlin\src\lcd\menu\menu_tramming_wizard.cpp:50:3: note: suggested alternative: 'selectFunc_t'
   selected_point = point;
   ^~~~~~~~~~~~~~
   selectFunc_t
In file included from Marlin\src\lcd\menu\menu_tramming_wizard.cpp:31:0:
Marlin\src\lcd\menu\menu_tramming_wizard.cpp:54:55: error: 'z_measured' was not declared in this scope
   STATIC_ITEM(MSG_LAST_VALUE_SP, SS_LEFT, ftostr42_52(z_measured[0] - z_measured[point])); // Print diff
                                                       ^
Marlin\src\lcd\menu\menu_item.h:314:49: note: in definition of macro 'STATIC_ITEM_INNER_P'
     MenuItem_static::draw(_lcdLineNr, PLABEL, ##V);     \
                                                 ^
Marlin\src\lcd\menu\menu_item.h:345:56: note: in expansion of macro 'STATIC_ITEM_P'
 #define STATIC_ITEM(LABEL, V...)                       STATIC_ITEM_P(GET_TEXT(LABEL), ##V)
                                                        ^~~~~~~~~~~~~
Marlin\src\lcd\menu\menu_tramming_wizard.cpp:54:3: note: in expansion of macro 'STATIC_ITEM'
   STATIC_ITEM(MSG_LAST_VALUE_SP, SS_LEFT, ftostr42_52(z_measured[0] - z_measured[point])); // Print diff
   ^~~~~~~~~~~
Marlin\src\lcd\menu\menu_tramming_wizard.cpp: In function 'void goto_tramming_wizard()':
Marlin\src\lcd\menu\menu_tramming_wizard.cpp:81:3: error: 'selected_point' was not declared in this scope
   selected_point = 0;
   ^~~~~~~~~~~~~~
   selected_point = 0;
   ^~~~~~~~~~~~~~
   selectFunc_t

@thinkyhead thinkyhead changed the title Tramming Wizard WIP Tramming Wizard Nov 3, 2020
@qwewer0
Copy link
Contributor

qwewer0 commented Nov 3, 2020

Is there a way to add movement that take BLTOUCH_HS_MODE into consideration? Like it is in G35.cpp:

current_position.z = (Z_CLEARANCE_BETWEEN_PROBES) + (7 * ENABLED(BLTOUCH_HS_MODE));

And not sure if it is intended or not, but BLTouch pin stays deployed through the whole process with BLTOUCH_HS_MODE enabled.

@thisiskeithb
Copy link
Member

And not sure if it is intended or not, but BLTouch pin stays deployed through the whole process with BLTOUCH_HS_MODE enabled.

That's how BLTOUCH_HS_MODE works. From a few lines up:

// In BLTOUCH HS mode, the probe travels in a deployed state.

@qwewer0
Copy link
Contributor

qwewer0 commented Nov 3, 2020

@thisiskeithb I'm not talking about ASSISTED_TRAMMING, for that it is obvious that it moves with pin deployed, but then it stows after everything is done, so by that, in my understanding it should stow after each measurement in ASSISTED_TRAMMING_WIZARD just like without BLTOUCH_HS_MODE, because if it would timeout to the main screen then it will leave the pin deployed which could be dangerous.

@qwewer0
Copy link
Contributor

qwewer0 commented Nov 3, 2020

I hope that I'm not wrong, and by adding

current_position.z = (Z_CLEARANCE_BETWEEN_PROBES) + (7 * ENABLED(BLTOUCH_HS_MODE));

before

const float z_probed_height = probe.probe_at_point(screws_tilt_adjust_pos[tram_index], PROBE_PT_RAISE, 0, true);

ASSISTED_TRAMMING_WIZARD will move to the point to be measured like ASSISTED_TRAMMING does. (Raising Z axis for BLTOUCH_HS_MODE before XY movement)

Don't know how to contribute to or edit others PR, so this is the best I can do to help.

@Speaka
Copy link
Contributor Author

Speaka commented Nov 3, 2020

It is in probe.cpp here

else if (raise_after == PROBE_PT_STOW)
      if (stow()) measured_z = NAN;   // Error on stow?

So calling probe_at_point() should forward PROBE_PT_STOW instead of PROBE_PT_RAISE with bltouch and it will stow the pin. Correct?

@ETE-Design
Copy link
Contributor

@thinkyhead Seems to be working as expected now 👍

Speaka and others added 2 commits November 4, 2020 21:05
Same Problem as in latest G35 fix. 8bit related
@thinkyhead thinkyhead merged commit 6954772 into MarlinFirmware:bugfix-2.0.x Nov 7, 2020
@hamster65
Copy link

Feature request: If not already implemented, an option to move the print head out of the way while the user turns the screw would be nice. With my setup, I cannot reach the screws of the bed when the print head is above them....

@Speaka
Copy link
Contributor Author

Speaka commented Nov 7, 2020

Added a PR for this. @hamster65
Please try if thius suits your needs.

@hamster65
Copy link

@Speaka Great, thanks! Looks good to me but I cannot test yet because of #19732

@Speaka Speaka deleted the tram_wiz branch November 11, 2020 19:46
FhlostonParadise pushed a commit to FhlostonParadise/Marlin that referenced this pull request Nov 21, 2020
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
vgadreau pushed a commit to vgadreau/Marlin that referenced this pull request Dec 9, 2020
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
tharts pushed a commit to tharts/Marlin that referenced this pull request Jan 6, 2021
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
dpreed pushed a commit to dpreed/Marlin_2.0.x that referenced this pull request Feb 5, 2021
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
kpishere pushed a commit to kpishere/Marlin that referenced this pull request Feb 19, 2021
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
W4tel-BiDi pushed a commit to W4tel-BiDi/Marlin that referenced this pull request Apr 5, 2021
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
thinkyhead added a commit to thinkyhead/Marlin that referenced this pull request Apr 28, 2021
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
thinkyhead added a commit to thinkyhead/Marlin that referenced this pull request Apr 29, 2021
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
thinkyhead added a commit that referenced this pull request Apr 30, 2021
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants