Skip to content

Mergemaster - #149

Merged
beniroquai merged 3 commits into
masterfrom
mergemaster
Aug 11, 2026
Merged

Mergemaster#149
beniroquai merged 3 commits into
masterfrom
mergemaster

Conversation

@beniroquai

Copy link
Copy Markdown
Contributor

No description provided.

Extend set_galvo_scan with three new parameters:
- overscan_samples: linear ramp extension to compensate galvo lag
- laser_blanking: gate laser pin during imaging window only
- hw_pixel_clock: use RMT peripheral for hardware-equidistant pixel clock

Also improves docstring with detailed parameter descriptions and updates the example JSON payload.
Copilot AI lite review requested due to automatic review settings August 11, 2026 11:05
@beniroquai
beniroquai merged commit 353737c into master Aug 11, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the UC2 REST client APIs to support newer firmware capabilities: closed-loop/encoder feedback for motor axes (via CANopen SDO bridging) and enhanced galvo scanning configuration plus direct XY positioning.

Changes:

  • Add motor closed-loop axis feedback utilities (SDO read/write helpers, feedback/calibration/reset APIs) and async axis fault event callbacks.
  • Extend galvo scan configuration payload with overscan, laser blanking, and optional hardware pixel clock parameters.
  • Add galvo direct positioning (set_position) and re-enable laser_trigger forwarding for arbitrary-point scans.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
uc2rest/motor.py Adds async axis-event callback plumbing and new CANopen SDO-based closed-loop/encoder feedback APIs.
uc2rest/galvo.py Expands scan configuration options, adds a static positioning API, and forwards laser_trigger for point scanning.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread uc2rest/motor.py
Comment on lines +58 to +60
# Register callback for async closed-loop axis fault events (design v2):
# {"axisEvent":{"axis":n,"fault":"STALL","posErrSteps":-142,...}}
self._parent.serial.register_callback(self._callback_axis_event, pattern="axisEvent")
Comment thread uc2rest/galvo.py
Comment on lines +153 to +161
path = '/galvo_act'
payload = {
"task": path,
"galvo": {
"x": int(x),
"y": int(y)
}
}
return self._parent.post_json(path, payload, timeout=timeout)
Comment thread uc2rest/motor.py
Comment on lines +252 to +254
if not isinstance(resp, dict) or resp.get("status") != "ok":
return None
return True if op == "w" else resp.get("value", None)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants