Skip to content

Commit

Permalink
added steps_per_rev calculation when setting or reading msres
Browse files Browse the repository at this point in the history
fixes #49
  • Loading branch information
Chr157i4n committed Feb 1, 2024
1 parent 94bea92 commit 7092ad1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/TMC_2209/_TMC_2209_comm.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,7 @@ def read_microstepping_resolution(self):
msresdezimal = 8 - msresdezimal

self._msres = int(math.pow(2, msresdezimal))
self._steps_per_rev = self._fullsteps_per_rev * self._msres

return self._msres

Expand Down Expand Up @@ -552,6 +553,7 @@ def set_microstepping_resolution(self, msres):
self.tmc_uart.write_reg_check(tmc_reg.CHOPCONF, chopconf)

self._msres = msres
self._steps_per_rev = self._fullsteps_per_rev * self._msres

self.set_mstep_resolution_reg_select(True)

Expand Down

0 comments on commit 7092ad1

Please sign in to comment.