About this topic , I have also encountered the same problem, but the thread is closed. I tried to resolve the issue and have made some new progress.
I am using the TMC2209 control chip to drive my Z-axis motor. I have set the motor’s enable pin to the enabled state through “force set the pin” in “make menuconfig” (under the low-level options). This setting is effective. I found that when the driver board is powered on, the motor’s holding torque can completely overcome the weight on the Z-axis. However, when I start Klipper and load the config file, the motor’s enable function is reset. My idea is that if the Z-axis motor’s enable is always on during the entire process of starting Klipper and is never turned off, this should solve the problem.
but how to keep the Z stepper motor enable =1 during the config changes are saved and restart ,This issue has not yet been resolved
Could you share how you have set up your Z axis belts?
My Voron 2.4 has never had an issue - the 20 to 80 teeth reduction pulleys provide quite a bit of mechanical resistance from the stepper motors and, while I can move the gantry frame up and down, it takes quite a bit of force to move them.
Short answer - you can’t fully resolve it with just a software setup.
Why:
There are many different setups how klipper is controlling a stepper driver, it can use SPI, I2C, UART, Step/Dir/Enable/Reset signals.
There are different stepper drivers and each model can have different internal behavior of a Reset sequence.
When you are saving_config or doing FIRMARE_RESTART your CPU is going thru Reset sequence this involves all it’s pins to go in some state and that state is different for each CPU model.
There are different approaches how schematics was design for each printer board.
Sometimes Stepper Driver Reset pin also connected to CPU and when CPU is going thru Reset - that Reset can cascade down to stepper driver reset.
Now when you are trying to achieve always holding motor state - you need to account all of those unknowns.
It’s much easier and reliable approach is to resolve issue on Hardware level which will protect your machine not just from software resets, but including poweer-loss.
I directly use a stepper motor to drive the timing pulley, which in turn drives the timing belt movement, without any reduction mechanism, but
at the rear of the stepper motor, an electromagnetic brake is designed. When powered on, this electromagnetic brake is released under the effect of electromagnetic force. If a power outage occurs, the electromagnetic brake will lock to prevent the Z-axis from falling. However, this function only works in the event of a power outage. When powered, the Z-axis is held in place by the torque provided by the motor’s holding current. However, when I reload the config or trigger an emergency stop, I find that the Z-axis motor’s enable is reset, causing the motor to have no holding force and be in a completely free state. I have modified the firmware through “make menuconfig” (under the low-level options) so that the motor’s enable is active when the board is powered on. But still, when I reload the config or trigger an emergency stop, the enable is reset. Therefore, I need some help on how to keep the Z-axis motor’s enable constant when reloading the config or triggering an emergency stop. Thank you.
the self-locking feature of trapezoidal lead screws and the mechanical approach of gearboxes with high gear ratios can address these issues, but the drawbacks are also clear. These mechanical systems either lead to reduced efficiency of the entire transmission system (the small lead of trapezoidal screws means lower transmission efficiency) or require higher motor speeds with high-ratio gearboxes. However, for stepper motors, performance deteriorates at high speeds (torque drops significantly). Thus, for designing high-performance systems, using the holding force of the motor to counteract the gravitational force in the Z-direction is a better system design.
I you already have hardware solution - then you can try to hook it to Enable_pin so you always have good conditions:
State 1: motor is enabled and brake released
State 2: motor is disabled and brake is engaged.