adding logs to debug

This commit is contained in:
sanjayk03-dev
2025-05-23 19:58:44 +05:30
parent d486094373
commit f3422e54d0
2 changed files with 3 additions and 61 deletions

View File

@@ -634,6 +634,7 @@ class RotaryHandler(bbctrl.APIHandler):
is_axis_A = motor_2.get("axis") == "A"
self.log.info("is_axis_A: {} | status: {}".format(is_axis_A, status))
if is_axis_A == status: return
motor_2["axis"] = "Y" if is_axis_A else "A"
@@ -650,6 +651,7 @@ class RotaryHandler(bbctrl.APIHandler):
'travel-per-rev-backup'
]
if all(key in motor_2 for key in required_keys):
self.log.info("Restoring backup values for motor_2")
motor_2['min-soft-limit'] = motor_2['min-soft-limit-backup']
motor_2['max-soft-limit'] = motor_2['max-soft-limit-backup']
motor_2['max-velocity'] = motor_2["max-velocity-backup"]
@@ -675,7 +677,7 @@ class RotaryHandler(bbctrl.APIHandler):
motor_2['max-jerk'] = 750
motor_2['step-angle'] = 0.25714
motor_2['travel-per-rev'] = 360
self.log.info("Updated motor_2: {}".format(motor_2))
config.save(config_data)

View File

@@ -122,50 +122,6 @@
"scale": 25.4,
"default": 5,
"code": "tr"
},
"max-velocity-backup": {
"type": "float",
"min": 0,
"unit": "m/min",
"iunit": "IPM",
"scale": 0.0254,
"default": 5,
"code": "vmb"
},
"max-accel-backup": {
"type": "float",
"min": 0,
"unit": "km/min²",
"iunit": "g-force",
"scale": 35.304,
"default": 10,
"code": "amb"
},
"max-jerk-backup": {
"type": "float",
"min": 0,
"unit": "km/min³",
"iunit": "g/min",
"scale": 35.304,
"default": 50,
"code": "jmb"
},
"step-angle-backup": {
"type": "float",
"min": 0,
"max": 360,
"step": 0.1,
"unit": "degrees",
"default": 1.8,
"code": "sab"
},
"travel-per-rev-backup": {
"type": "float",
"unit": "mm",
"iunit": "in",
"scale": 25.4,
"default": 5,
"code": "trb"
}
},
@@ -186,22 +142,6 @@
"default": 0,
"code": "tm"
},
"min-soft-limit-backup": {
"type": "float",
"unit": "mm",
"iunit": "in",
"scale": 25.4,
"default": 0,
"code": "tnb"
},
"max-soft-limit-backup": {
"type": "float",
"unit": "mm",
"iunit": "in",
"scale": 25.4,
"default": 0,
"code": "tmb"
},
"min-switch": {
"type": "enum",
"values": ["disabled", "normally-open", "normally-closed"],