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

No longer require endstop for gear stepper #100

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Klipper_Files/Extra module/ercf.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def handle_connect(self):
if self.gear_stepper is None:
raise config.error(
"Manual_stepper gear_stepper must be specified")
self.ref_step_dist=self.gear_stepper.rail.steppers[0].get_step_dist()
cmroche marked this conversation as resolved.
Show resolved Hide resolved
self.ref_step_dist=self.gear_stepper.steppers[0].get_step_dist()

def get_status(self, eventtime):
encoder_pos = float(self._counter.get_distance())
Expand Down Expand Up @@ -401,7 +401,7 @@ def cmd_ERCF_UNLOAD(self, gcmd):
def cmd_ERCF_SET_STEPS(self, gcmd):
ratio = gcmd.get_float('RATIO', 1., above=0.)
new_step_dist = self.ref_step_dist / ratio
stepper = self.gear_stepper.rail.steppers[0]
stepper = self.gear_stepper.steppers[0]
if hasattr(stepper, "set_rotation_distance"):
new_rotation_dist = new_step_dist * stepper.get_rotation_distance()[1]
stepper.set_rotation_distance(new_rotation_dist)
Expand Down
2 changes: 0 additions & 2 deletions Klipper_Files/ercf_hardware.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ microsteps: 16 # Please do not go higher than 16, this can cause 'MCU Timer too
full_steps_per_rotation: 200 #200 for 1.8 degree, 400 for 0.9 degree
velocity: 35
accel: 150
#Right now no pin is used for the endstop, but we need to define one for klipper. So just use a random, not used pin
endstop_pin: P0.10

[tmc2209 manual_stepper gear_stepper]
# Adapt accordingly to your setup and desires
Expand Down
4 changes: 1 addition & 3 deletions Klipper_Files/ercf_software.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -815,9 +815,7 @@ gcode:
{% if printer["gcode_macro _ERCF_PAUSE"].is_paused|int == 0 %}
{% set selector_homed = 0 %}
{% if printer["gcode_macro _ERCF_VAR"].sensorless_selector|int == 1 %}
{% if printer.query_endstops.last_query["manual_stepper gear_stepper"] == 1 %}
cmroche marked this conversation as resolved.
Show resolved Hide resolved
{% set selector_homed = 1 %}
{% endif %}
{% set selector_homed = 1 %}
{% else %}
{% if printer.query_endstops.last_query["manual_stepper selector_stepper"] == 1 %}
{% set selector_homed = 1 %}
Expand Down