Skip to content

Comments

Plz1004wh pulse sequence feature#26

Merged
AnnaGiasson merged 9 commits intoAnnaGiasson:masterfrom
cmgriffin:plz1004wh-pulse-sequence-feature
Jun 18, 2025
Merged

Plz1004wh pulse sequence feature#26
AnnaGiasson merged 9 commits intoAnnaGiasson:masterfrom
cmgriffin:plz1004wh-pulse-sequence-feature

Conversation

@cmgriffin
Copy link
Collaborator

@cmgriffin cmgriffin commented Sep 16, 2024

Adds the ability to configure and trigger fast sequences for the Kikusui_PLZ1004WH class. I have been using this for a few months on the bench so most of the bugs have been resolved. Some improvements are still possible but I would like to allow colleagues to start using it without needing to switch to my fork.

New Attributes

This is a simple dataclass that captures the properties of a sequence step, current and trigger in the case of the Kikusui fast sequence
SequenceStep

New Methods

Configure an arbitrary sequence of load current values
def configure_sequence(self,steps: list["Kikusui_PLZ1004WH.SequenceStep"], current_range: str = "HIGH", step_size: float = 1e-3, initialize: bool = True)

Run a sequence that has been defined
def run_sequence(self)

Configure a sequence of load current values that form a pulse
This is essentially a helper function that creates a pulse sequence then calls configure_sequence to send it to the load
def configure_pulse_seqeunce(self, pulse_current: float, pulse_width: float, trig_delay: float, step_size: float = 1e-3, initial_idle_time: float = 10e-3, idle_current: float = 0.0, current_range: str = "HIGH", keep_load_on: bool = False)

@cmgriffin cmgriffin force-pushed the plz1004wh-pulse-sequence-feature branch 2 times, most recently from 11bc249 to bec2370 Compare April 23, 2025 15:37
@cmgriffin cmgriffin force-pushed the plz1004wh-pulse-sequence-feature branch from bec2370 to e69ebdf Compare June 12, 2025 21:20
@cmgriffin cmgriffin changed the base branch from dev to master June 12, 2025 21:21
@cmgriffin cmgriffin marked this pull request as ready for review June 12, 2025 21:35
@cmgriffin cmgriffin requested a review from AnnaGiasson June 12, 2025 21:59
emulated query response in _query_configure_sequence_effect was not correct
misuse of itertools.repeat caused test_configure_pulse_sequence to not behave as expected
Copy link
Owner

@AnnaGiasson AnnaGiasson left a comment

Choose a reason for hiding this comment

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

Looks good, I see no issues with it.
I like the way you structured things, I feel like this should be good for stepped current waveforms, but might be a little annoying to use for ramping. You can always do it with a bit more logic outside the class though. Did you consider an implementation where you specify an array of currents and a fixed sample rate?

Also, learned itertools.batched is a thing; looks like it was added in 3.12. That's a nice one to remember, I've definitely had to implement that with slicing before.

@AnnaGiasson AnnaGiasson merged commit ecdaa67 into AnnaGiasson:master Jun 18, 2025
@cmgriffin
Copy link
Collaborator Author

Thanks!

Did you consider an implementation where you specify an array of currents and a fixed sample rate?

With the fast load sequence for the Kik loads it is a fixed sample rate. Each step in the sequence has a current level and optional trigger pulse so that's the way I structured the sequence you feed into configure_sequence. Something that could be done is to allow configure_sequence to take either list["Kikusui_PLZ1004WH.SequenceStep"] or list[float] which would simplify it where the trigger pulse is not needed. configure_pulse_seqeunce is very much just a wrapper for configure_sequence that could be implemented externally but I figured it was frequently used enough to add it to the class.

Also, learned itertools.batched is a thing; looks like it was added in 3.12. That's a nice one to remember, I've definitely had to implement that with slicing before.

I actually didn't realize itertools.batched was only added in 3.12 so that kind of kills earlier version compatibility. I'm fine with keeping it as is and making the min version 3.12 though if you are.

@cmgriffin cmgriffin deleted the plz1004wh-pulse-sequence-feature branch June 18, 2025 16:52
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