Skip to content

[TRPD-194][feat] driver keysight: allow to configure rise and fall times - #3569

Open
pieleric wants to merge 2 commits into
delmic:masterfrom
pieleric:feat-driver-keysight-allow-to-configure-rise-and-fall-times
Open

[TRPD-194][feat] driver keysight: allow to configure rise and fall times#3569
pieleric wants to merge 2 commits into
delmic:masterfrom
pieleric:feat-driver-keysight-allow-to-configure-rise-and-fall-times

Conversation

@pieleric

@pieleric pieleric commented Sep 4, 2026

Copy link
Copy Markdown
Member

Use a pulse waveform instead of a square waveform, to have extra settings to control the rise and fall edges time.

Also handle better when an impossible value is requested: just automatically clip, and update the other values from the device if changing the value changed them.

Use a pulse waveform instead of a square waveform, to have extra
settings to control the rise and fall edges time.

Also handle better when an impossible value is requested: just
automatically clip, and update the other values from the device if
changing the value changed them.
Just ensure that they are shown the right way.
Copilot AI lite review requested due to automatic review settings September 4, 2026 13:47
@coderabbitai

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 56 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: c9afe16e-815e-4e88-8e09-1f392dd51662

📥 Commits

Reviewing files that changed from the base of the PR and between 03ea3b1 and e52394f.

📒 Files selected for processing (3)
  • src/odemis/driver/keysight.py
  • src/odemis/driver/test/keysight_test.py
  • src/odemis/gui/conf/data.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the size/M label Sep 4, 2026
@pieleric pieleric changed the title [feat] driver keysight: allow to configure rise and fall times [TRPD-194][feat] driver keysight: allow to configure rise and fall times Sep 4, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

It includes correctness issues in the Keysight driver (retry loop can silently proceed after failing to set waveform, and edge-time minimum selection can be wrong for the active channel).

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR adds configurable rise/fall edge times for the Keysight TrueForm-based blanker, exposing the new parameters in the GUI configuration and validating them through the simulator-backed driver tests.

Changes:

  • Added riseTime and fallTime GUI configuration entries for the e-beam blanker.
  • Extended the Keysight driver with pulse edge-time set/get support and applied pulse-mode configuration on power-on.
  • Updated Keysight driver tests to cover rise/fall time behavior and reflect clipping behavior for duty cycle.
File summaries
File Description
src/odemis/gui/conf/data.py Exposes riseTime/fallTime controls for the blanker configuration UI.
src/odemis/driver/test/keysight_test.py Updates simulator test configuration and adds rise/fall time test coverage.
src/odemis/driver/keysight.py Implements pulse edge-time configuration and adjusts power-on setup / simulator parsing.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 7
  • Review effort level: Lite

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

Comment on lines +650 to +656
for i in range(3):
try:
self.setWaveform(self._channel, "PULS")
break
except TrueFormError as ex:
logging.warning("Failed to set the waveform to pulse, will retry: %s", ex)

Comment on lines +162 to +171
# Detect the minimum edge time, depending on the voltage. Picking a too small value is not
# much of an issue as it will be clipped, but that can be confusing for the user.
edge_min = EDGE_MIN_4V if all(lim[1] - lim[0] <= 4.0 for lim in self._limits) else EDGE_MIN_10V
rise_time = edge_min
self.riseTime = model.FloatContinuous(rise_time, range=(edge_min, self.period.range[1] / 2),
setter=self._set_rise_time, unit="s")

fall_time = edge_min
self.fallTime = model.FloatContinuous(fall_time, range=(edge_min, self.period.range[1] / 2),
setter=self._set_fall_time, unit="s")
# if the waveform is not compatible. The device will also complain when setting the waveform
# if some waveform settings are not compatible.

# Configure the (square) waveform voltages: low = min and high = max
Comment on lines +663 to +671
duty_cyle = self.dutyCycle.value
period = self.period.value
delay = self.delay.value
rise_time = self.riseTime.value
fall_time = self.fallTime.value
try:
self.dutyCycle.value = duty_cyle
except TrueFormError as ex:
logging.warning("Failed to set the duty cycle to %s after power on: %s", duty_cyle, ex)
except TrueFormError as ex:
# Tracking a channel is similar to activating it, so it can have the same issue
# as setting the waveform.
logging.warning("Failed to set the channel %s to track %s, will retry: %s", t, other_c, ex)
Comment on lines +45 to +48
#"limits": [[-4.0, 4.0], [-5.0, 5.0]],
"limits": [[-5.0, 5.0], [-5.0, 5.0]],
#"off_voltage": [0.0, None],
"off_voltage": [0.0, 0.0],
Comment on lines +65 to 66
#self.dev.period.value = 25e-9 #DEBUG
self.dev.power.value = True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants