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

BIQU BX printer config #4950

Merged
merged 13 commits into from
Jan 29, 2022
Merged

BIQU BX printer config #4950

merged 13 commits into from
Jan 29, 2022

Conversation

adelyser
Copy link
Contributor

BIQU BX STM32H743

Add the BIQU BX printer config.

Signed-off-by: Aaron DeLyser bluwolf@gmail.com

@adelyser adelyser changed the title STM32H7 - BIQU BX config BIQU BX printer config Dec 6, 2021
step_pin: PG13
dir_pin: !PG12
enable_pin: !PG14
microsteps: 16
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You do not use interpolate, which is good acc. to #4977
Why this low microsteps?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This actually does use interpolate, the default is True.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acc to #4977 it seems preferable to use higher microsteps and set interpolate: false
The BIQU BX SKR SE-BX should not even break a sweat with this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While the BIQU BX definitely doesn't have a problem with this config, testing shows that the printer is crazy loud using the spreadcycle mode. For default, I decided to leave it as stealthchop because most users will find it annoying and want to quiet it down anyways.

uart_pin: PG10
diag_pin: ^PB11
run_current: 0.800
hold_current: 0.525
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might want to refer to #4977
Same for the rest of the hold_current references

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the hold_current


[tmc2209 extruder]
uart_pin: PI8
interpolate: false
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason to explicitly mention interpolate here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This disabled interpolate, as the default is true

Comment on lines 265 to 390
G4 P90000
G28 Z

M190 S{params.BED}
M105
M82
G90
G21
M83
G92 E0

# Set LED to Red for nozzle heating
SET_LED LED=led BLUE=0.0 RED=1.0 GREEN=0.0
M117 Heating Nozzle
G0 X2 Y0 F6000
G0 Z0.4
M109 S{params.NOZZLE}
M105
# Set LED to white for printing
SET_LED LED=led BLUE=1.0 RED=1.0 GREEN=1.0
M117 Printing

# Purge Line
G1 X120 E30 F1200
G1 Y1
G1 X2 E30 F1200
G92 E0

G1 Z1.0 F600
G92 E0
G0 F9000

[gcode_macro PRINT_END]
gcode:
M400 ; wait for buffer to clear
M104 S0 ; turn off hotend
M140 S0 ; turn off bed
G92 E0 ; zero the extruder
G1 E-4.0 F3600 ; retract
# Get Boundaries
{% set max_x = printer.configfile.config["stepper_x"]["position_max"]|float %}
{% set max_y = printer.configfile.config["stepper_y"]["position_max"]|float %}
{% set max_z = printer.configfile.config["stepper_z"]["position_max"]|float %}

# Check end position to determine safe directions to move
{% if printer.toolhead.position.x < (max_x - 20) %}
{% set x_safe = 20.0 %}
{% else %}
{% set x_safe = -20.0 %}
{% endif %}

{% if printer.toolhead.position.y < (max_y - 20) %}
{% set y_safe = 20.0 %}
{% else %}
{% set y_safe = -20.0 %}
{% endif %}

{% if printer.toolhead.position.z < (max_z - 2) %}
{% set z_safe = 2.0 %}
{% else %}
{% set z_safe = max_z - printer.toolhead.position.z %}
{% endif %}

# Commence PRINT_END
G91 ; relative positioning
G0 Z{z_safe} F3600 ; move nozzle up
G0 X{x_safe} Y{y_safe} F20000 ; move nozzle to remove stringing

M106 S0 ; turn off fan
G90 ; absolute positioning
G0 X{max_x / 2} Y{max_y} F3600 ; park nozzle at rear


[gcode_macro CANCEL_PRINT]
description: Cancel the actual running print
rename_existing: CANCEL_PRINT_BASE
gcode:
TURN_OFF_HEATERS
PRINT_END
CANCEL_PRINT_BASE

[gcode_macro M600]
gcode:
{% set X = params.X|default(50)|float %}
{% set Y = params.Y|default(0)|float %}
{% set Z = params.Z|default(10)|float %}
SAVE_GCODE_STATE NAME=PAUSE_state
PAUSE
G91
G1 E-0.8 F2700
G0 Z{Z}
G90
M83
G0 X{X} Y{Y} F3000

[gcode_macro RESUME]
rename_existing: RESUME_BASE
gcode:
RESTORE_GCODE_STATE NAME=PAUSE_state
RESUME_BASE
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Macros should only be defined if they are needed to support specific printer functions (https://github.com/Klipper3d/klipper/blob/master/docs/Example_Configs.md 5.iv)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PRINT_START macro is definitely needed to support this printer. This is due to how the ABL is setup and the macro implemented "mimmics" the printers current Marlin behaviour for consistent probing of the bed.

I also setup all the other macros based on user feedback on the stock printer. Should I remove those anyway?

Thanks for the feedback!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know this printer, so I guess this is fine. Final call is on Kevin anyway

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with removing all the macros except PRINT_START. That one is important for printer usability.

@KevinOConnor
Copy link
Collaborator

Some feedback:

  • The example config should not specify a pressure_advance setting.
  • Specifying "interpolate=false" doesn't seem to make sense.
  • I don't understand the comment at the top of the file regarding the display requiring the mcu to set the initial pins. We typically only use the mcu initial pins setting to set pins that must be set in order to communicate with the host. If there is some other necessary setting, it really should be in the printer.cfg file and not in "make menuconfig".
  • The example macros look complex to me. It's generally preferable to keep the example configs similar to ease long term maintenance. I think the goal of the example configs should be to get an initial starting point for users - not to customize the printer for them.

-Kevin

@KevinOConnor
Copy link
Collaborator

Also, the extruder rotation_distance looks very unusual. It's generally preferable to specify a gear_ratio for extruders using a gearing mechanism.

-Kevin

@adelyser
Copy link
Contributor Author

@KevinOConnor Thanks for the feedback.

  • I will remove the pressure advance setting, you are correct that shouldn't be in there.
  • I will remove the interpolate setting
  • So the GPIO pins need to be set so they are active when the printer boots, not when Klipper connects. The TFT Screen, specific to the BIQU BX printer, has an HDMI switcher and the backlight controlled from the mainboard LTDC driver in Marlin. These GPIOS are required to be set, or you will not see anything on the screen during bootup, or until Klipper connects.
  • The only macro really needed is the PRINT_START macro. This printer comes with an ABL probe and there's a specific sequence needed to get it to work properly, which PRINT_START handles. I can remove all the other macros, or trim them out to be the basic macros needed.
    -The weird thing about the rotational distance, I tried using the gear ratio method and my extrusion values were noticeably off. This was what I came up with to get a valid extrusion value that worked. I don't know what was going on with the gear ratio, but it was off.

@KevinOConnor
Copy link
Collaborator

Thanks.

These GPIOS are required to be set, or you will not see anything on the screen during bootup, or until Klipper connects.

I understand the gpios need to be set. I don't understand why they need to be set in "make menuconfig" instead of in "output_pin" settings in printer.cfg?

The weird thing about the rotational distance, I tried using the gear ratio method and my extrusion values were noticeably off.

You should be able to count the number of teeth on the extruder gearing mechanism and then apply that to your existing rotation_distance. So, for example, if it is 50:17 gear ratio, then you would replace rotation_distance: 3.433 with gear_ration: 50:17 and rotation_distance: 10.097 (3.433 * 50 / 17 == 10.097).

-Kevin

@adelyser
Copy link
Contributor Author

@KevinOConnor Thanks for the response.

I understand the gpios need to be set. I don't understand why they need to be set in "make menuconfig" instead of in "output_pin" settings in printer.cfg?

So these need to be set in the firmware because you want the display, while the RPI is booting, when the printer is turned on. The RPI is attached to the backside of the TFT and powered with the printer power. If these are put into the printer.cfg file, you get no display until klipper connects. If there is an error with klipper connecting, still no display, which is is a bad experience. It acts as if the printer isn't doing anything but running the fans.

You should be able to count the number of teeth on the extruder gearing mechanism and then apply that to your existing rotation_distance. So, for example, if it is 50:17 gear ratio, then you would replace rotation_distance: 3.433 with gear_ration: 50:17 and rotation_distance: 10.097 (3.433 * 50 / 17 == 10.097).

I totally understand what you're saying and I fully understand the calculations. At first, I did use a gear ratio of 7:1, with a rotation_distance of 24.03 (correct values for the H extruder, 932 esteps provided by BIQU). The extruder was over-extruding while printing. Changing that to 3.433, fixed the extrusion issue. I toggled it back and forth a couple times to confirm, and I don't know why it wasn't working correctly.

@KevinOConnor
Copy link
Collaborator

So these need to be set in the firmware because you want the display, while the RPI is booting, when the printer is turned on.

This isn't what the comment in the example config file says. If this is a "nice to have" then the comment should say that - for example, "Note: In order to update the TFT70-BX display when the micro-controller first starts, add PB5 and PE5 ...".

Changing that to 3.433, fixed the extrusion issue.

That indicates something is very wrong and should be investigated. The only thing Klipper does with the rotation_distance is multiply it with full_steps_per_rotation and gear_ratio to get an internal step_distance. Updating the config with gear_ratio: 7:1 and rotation_distance: 24.031 results in an identical internal state.

-Kevin

@adelyser
Copy link
Contributor Author

@KevinOConnor Ok, updated everything.

I changed the verbage for the note at the top. I also added the gear ratio back in. I agree that it "should" be identical to what I had, but it wasn't I didn't spend any time trying to figure out why. A lot of example show to just set the rotation_distance based on esteps, so that's what I ended up doing.

I also had to add a G90 at the end of print_start, as slicers such as Cura and S3D expect that and it was causing move errors.

@mental405 mental405 assigned mental405 and unassigned mental405 Jan 28, 2022
@KevinOConnor KevinOConnor merged commit c15d38b into Klipper3d:master Jan 29, 2022
@KevinOConnor
Copy link
Collaborator

Thanks.

-Kevin

@nicedevil007
Copy link

@adelyser I have a problem with your default config and hope you can help ? #5236

small side question: did you figure out how to get the whole display to show the klipperscreen or are you using anything else?

@diggit diggit mentioned this pull request Feb 7, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Feb 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants