Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Klipper3d/klipper.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2022-09-04 05:20:20 +0300
committerKevin O'Connor <kevin@koconnor.net>2022-09-05 18:22:40 +0300
commit35e2472bbc1d160eee157690e6baf5a111dc59e0 (patch)
tree0217e1b04f472c7a3724513a323a97e55e8fa172
parent9f8f3cd77d97339bd825053b064ae4d08d5d6902 (diff)
motan: Improve reading of initial step position data
Seed the initial position from the first read position, even if it is some time into the capture. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r--scripts/motan/readlog.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/motan/readlog.py b/scripts/motan/readlog.py
index 513ad7264..f49f0b593 100644
--- a/scripts/motan/readlog.py
+++ b/scripts/motan/readlog.py
@@ -217,6 +217,8 @@ class HandleStepQ:
inv_freq = tdiff / cdiff
step_dist = jmsg['step_distance']
step_pos = jmsg['start_position']
+ if not step_data[0][0]:
+ step_data[0] = (0., step_pos, step_pos)
for interval, raw_count, add in jmsg['data']:
qs_dist = step_dist
count = raw_count
@@ -316,6 +318,8 @@ class HandleStepPhase:
if cdiff:
inv_freq = tdiff / cdiff
step_pos = jmsg['start_mcu_position']
+ if not step_data[0][0]:
+ step_data[0] = (0., step_pos)
for interval, raw_count, add in jmsg['data']:
qs_dist = 1
count = raw_count