! --Stepper direction

Basic Information:

Printer Model: Mendel90
MCU / Printerboard:BTT Manta 8P/CB1 with TMC2209 drivers
klippy.logStart printer at Sat Jan 28 22:30:27 2023 (1674945027.4 189.7)
===== Config file =====
[virtual_sdcard]
path = ~/printer_data/gcodes
on_error_gcode =
CANCEL_PRINT

[pause_resume]

[display_status]

[gcode_macro CANCEL_PRINT]
description = Cancel the actual running print
rename_existing = CANCEL_PRINT_BASE
variable_park = True
gcode =

{% if printer.pause_resume.is_paused|lower == 'false' and park|lower == 'true'%}
PAUSE
{% endif %}
TURN_OFF_HEATERS
M106 S0
CANCEL_PRINT_BASE

[gcode_macro PAUSE]
description = Pause the actual running print
rename_existing = PAUSE_BASE
gcode =
{% if printer.virtual_sdcard.is_active == True %}
{% if printer.pause_resume.is_paused == False %}
PAUSE_BASE
_TOOLHEAD_PARK_PAUSE_CANCEL
{% endif %}
{% endif %}

[gcode_macro RESUME]
description = Resume the actual running print
rename_existing = RESUME_BASE
gcode =
{% if printer.pause_resume.is_paused %}

{% set extrude = printer['gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL'].extrude_extrude %}

{% if 'VELOCITY' in params|upper %}
{% set get_params = ('VELOCITY=' + params.VELOCITY)  %}
{%else %}
{% set get_params = "" %}
{% endif %}

{% if printer.extruder.can_extrude|lower == 'true' %}
M83
G1 E{extrude} F2100
{% if printer.gcode_move.absolute_extrude |lower == 'true' %} M82 {% endif %}
{% else %}
{action_respond_info("Extruder not hot enough")}
{% endif %}
RESUME_BASE {get_params}
{% endif %}

[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
variable_retract_extrude = 10.0
variable_extrude_extrude = 11.0
gcode =

{% set x_park = printer.toolhead.axis_minimum.x|float + 5.0 %}
{% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %}
{% set z_park_delta = 2.0 %}

{% set max_z = printer.toolhead.axis_maximum.z|float %}
{% set act_z = printer.toolhead.position.z|float %}
{% if act_z < (max_z - z_park_delta) %}
{% set z_safe = z_park_delta %}
{% else %}
{% set z_safe = max_z - act_z %}
{% endif %}

{% if printer.extruder.can_extrude|lower == 'true' %}
M83
G1 E-{retract_extrude} F2100
{% if printer.gcode_move.absolute_extrude |lower == 'true' %} M82 {% endif %}
{% else %}
{action_respond_info("Extruder not hot enough")}
{% endif %}
{% if "xyz" in printer.toolhead.homed_axes %}
G91
G1 Z{z_safe} F900
G90
G1 X{x_park} Y{y_park} F6000
{% if printer.gcode_move.absolute_coordinates|lower == 'false' %} G91 {% endif %}
{% else %}
{action_respond_info("Printer not homed")}
{% endif %}

[stepper_x]
step_pin = PE2
dir_pin = PB4
enable_pin = !PC11
microsteps = 16
rotation_distance = 40
endstop_pin = ^PF3
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_y]
step_pin = PF12
dir_pin = PF11
enable_pin = !PB3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PF4
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_z]
step_pin = PD7
dir_pin = !PD6
enable_pin = !PF10
microsteps = 16
rotation_distance = 8
endstop_pin = ^PF5
position_endstop = 0
position_max = 270

[extruder]
step_pin = PC9
dir_pin = PC8
enable_pin = !PD1
microsteps = 16
rotation_distance = 33.500
nozzle_diameter = 0.4
filament_diameter = 3.0
heater_pin = PE3
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PA1
control = pid
pid_kp = 22.2
pid_ki = 1.08
pid_kd = 114
min_temp = 0
max_temp = 250

[heater_bed]
heater_pin = PB7
sensor_type = Generic 3950
sensor_pin = PA0
control = watermark
min_temp = 0
max_temp = 130

[fan]
pin = PE6

[mcu]
serial = /dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00

[printer]
kinematics = cartesian
max_velocity = 300
max_accel = 3000
max_z_velocity = 5
max_z_accel = 100

Fill out above information and in all cases attach your klippy.log file. Pasting your printer.cfg is not needed
When pasting code or config snippets use the code tags </> in the menu above

Describe your issue:

First full power connect of new board /old printer. First homing attempt X-stepper is going the wrong direction. I suspect the Y, Z and Extruder will also be reversed. Can I correct this in the printer config ? So far the bed and extruder heat controls work

To invert the value of a pin, use the “!” character.

So, to invert the direction your X Axis stepper is going in, use the “!” character to change direction the “dir_pin” in the [stepper_x] statement commands the stepper to move like:

[stepper_x]
step_pin = PE2
dir_pin = !PB4    ### - Note the "!" before the "PB4"
enable_pin = !PC11
microsteps = 16
rotation_distance = 40
endstop_pin = ^PF3
position_endstop = 0
position_max = 235
homing_speed = 50

Where did you get the printer.cfg file that you’re working with? Is it for the controller board or for the controller board/printer combination?

Thank you for your reply… I did find that ! function in the command ref after posting. Did stop the wrong direction but I likely have something else wrong as it doesn’t move at all now. Learning to hash through the log file will probably clarify somethings.
I am totally new at this as the printer died 6 years ago with the original Marlin / Melzi setup.

I started with the sample config from BigTreeTech Manta 8P repository and have been picking away at it for a day or two. I expect to be at this a while. Just solving one config item at a time !

Can I make a suggestion? If you’re new to Klipper and you’re trying to bring up a board that is/isn’t native to the printer, I think you should not run with any macros until you have basic movements figured out.

Macros, especially if they’re just copied in and you don’t understand their functionality, can cause a multitude of problems that can be difficult for the experts (and I don’t count myself among them) to resolve.

You can comment them out by putting a “#” in front of them and then bring them online when you have movement figured out followed by heating up the bed and the extruder and moving filament through the extruder.

Good luck - let us know how you make out.

Understood. I am starting with what I thought was a pretty plain config and I didn’t add any macros. The only edits have been to thermistor types and uncommenting the TMC2209 stepper drivers.

I have got the bed and hotend warming and temp reporting. PID settings someday after basic movement is sorted. The ‘to do list’ is long right now ! Among them is posting questions properly .

It sounds like you’re doing fine.

The only suggestion I would make in terms of posting is to not paste the whole printer.cfg file, instead upload the file like klippy.log

We all know what it’s like to have a long list of things to do with getting a 3D printer where you want it to be.

Good luck and let us know how your progressing.

Progress ! Sorted the stepper direction issue and the limit switches work as they should.

The next one to sort is the Z-Axis speed. The generic config had the rotation as ‘8’. It worked but not correctly. I’ve set the rotation distance to 1 as it is using a M6 threaded rod for the axis. However this causing a severe ‘growl’ from the motors. The original melzi board wiring had the 2 motors wired in series and I am now running them in paralell … Any ideas on how to progress from here ?

Interesting, there was a discussion on the wiring of Z Axis stepper motors in series and parallel here:

If you read through what I wrote there, you’ll see that wiring the Z Axis steppers in series might be the right thing to do in this case.

The second thing I’d recommend (maybe do this first) is put some light machine oil on your lead screws and see if that makes things quieter.

Lubrication isn’t a problem here. It seems almost like a stall. At the 8 rotation distance they worked fine except slow and inaccurate. Being new to the separate ,tuneable drivers with stealthchop etc., I’m wondering if it is in that configuration I’ve got it wrong. I’m going to disable the stealth chop, and micro step and see if that helps. I raised the run current with no effect.

I mention stall as it seems the motors get out of phase with each other. Previous setup was on 12 volts in series and this is 24 volts and parallel.

I think you want StealthChop operation and you should enable it with the parameter:

stealthchop_threshold: 999999

in your [tmc2209 stepper_z statement.

Let me know how that (along with disabling microstepping works - with it disabled, you’ll get half the resolution of a traditional printer with an 8mm leadscrew).

Upped the run current from 0.65 to 1.0 to 2.0 and problem solved !

Back to basics; degreased and relubricated guide rods and lead screws after seeing the gantry skewing a bit. The higher run current also promped a shutdown on driver over temp !

"TMC ‘stepper_z’ reports error: DRV_STATUS: c01b0103 otpw=1(OvertempWarning!) ot=1(OvertempError!) t120=1 cs_actual=27 stealth=1 stst=1
Once the underlying issue is corrected, use the
“FIRMWARE_RESTART” command to reset the firmware, reload the
config, and restart the host software.
Printer is shutdown

I am really starting to like this firmware ! Been awhile but I don’t recall Marlin/Melzi being particularly verbose.

Fans are the next challege - How to get the extruder fan running when the Hotend is started.
Thermistor control for a chassis/electronics fan.
Print cooling fan at Hot end.

Fans are the next challege - How to get the extruder fan running when the Hotend is started.

Easy peasy. Here’s the printer.cfg statement I use to turn on the heatsink fan when the extruder is more than 30C:

[heater_fan heatsink_fan]
pin: <FanPinHere>
max_power: 1.0
fan_speed: 1
kick_start_time: 0
heater: extruder
heater_temp: 30.0

I’m going to add the same type of fan for the main controller board.

Tried my first print in 6+ years ! … another config issue and I’m lost on where the setting might be.

Print started 190 mm from the bed ! and .3mm from Z home. Where do I set the print start position ? I’ve looked in Slic3r for a configuration point with no success. Nothing in the printer config looks likely and the sample gcode there is sliced for a different bed size.

As ‘everything’ is new including me I’m lost on where to look. Suggestions ?

In other news most things are sorted out. New M6 z-axis rods on order as one has slight damage. Once I get printing cable chains to tidy the rewire are first up.

@Bill good work and continued luck on your printer rebuild.

I see that you had some mechanical issues with your lead screw setup. You may have moved past it already, but if not, this website has been of enormous help to me when I was building my core XY:

Prusa has several calculators on this page.

Look about 1/3 of the way down for: Steps per millimeter - leadscrew driven systems

Results are in steps/mm, so you’ll have to convert that back to Klipper-speak. IMHO, I prefer the newer Klipper way of stepper settings as it is much easier.

Thanks for the encouragement ! The whole problem comes down to a mechanical one. The machine had 4-5 years hard use and then sat for 6 years, being moved out of the way, piled upon and ultimately retiring to the Great White North with me. Thread damage, congealed grease in worn out linear bearings, and some self inflicted wounds by impatience all brought me to this place.

I agree that Klipper speak makes more sense, as does the whole sw/fw approach compared to the Marlin/Melzi/Arduino of 10 years ago.

1 Like

While waiting for new threaded rods I tried using new M6 nuts [steel instead of OEM brass] No change !
Noticed that the double tap at Z-home endstop was okay as it was slower speed. Experimented with max Speed of Z axis - No change !

Incresed the current for the driver and down direction was better than up [home]. Increased again to the sweet spot and growling and stalls completely absent !

I can now get to leveling up the bed and settings that waited on a solution to this Z Axis problem.

Thanks to all for your help.

1 Like

What was the actual solution?
Could you please mark that post by clicking the checkbox SOLUTION ?

Parallel Z-Axis motor current with TMC2209 Drivers

[tmc2209 stepper_z]
uart_pin: PF9
diag_pin: PF5
run_current: 2.0

New linear bearings also reduced load on carriage.

1 Like