microsoft / microsoft/Qcodes

driver/Decadac Voltage scaling

Open
#904 1 comment 0 reactions 0 assignees View on GitHub
bug driver
Dominant language
Python
Stars
459
Forks
359
Avg merge
3d 6h
Merged PRs (30d)
73

Description

### Problems
The Decadac itself, the slots and the channels initialize with minimum and maximum values for every channel at +-5V:
```
class Decadac(VisaInstrument, DacReader):
def __init__(self, name, address, min_val=-5, max_val=5, **kwargs):
...
class DacSlot(InstrumentChannel, DacReader):
def __init__(self, parent, name, slot, min_val=-5, max_val=5):
...
class DacChannel(InstrumentChannel, DacReader):
def __init__(self, parent, name, channel, min_val=-5, max_val=5):
```
Problems with this are:
- the actual supported hardware limits are [-10,0], [-10, 10] and [0,10]. [-5, 5] is not valid
- it is complicated to set different ranges for different channels

### Hardware limits
The `min_val` and `max_val` attributes have two purposes:
* The Decadac driver scales the supplied voltage from float to an integer according to their values
* they serve as limits for value validation
On the front panel of the decadac is a three state switch, that allows to set the ranges as described above. So any other setting than one of those does not make any sense in terms of conversion. If other ranges are wished for in validation, this should be implemented separately.
-> we should implement hardware limist in three modes -1, 0, 1 corresponding to the three ranges
-> limits for validation should be added independently (but of course compatible)

### Per channel setting
The `min_val` and `max_val` attributes can simply be set per channel to achieve the right scaling. But this leads to problems with validators and ramps that will not update
-> we should add the option to provide `min_val` and `max_val` as dictionary to the constructor and maybe supply a method to change those.

Once there is time I can make a PR. For now I just wanted to share the issue and get feedback, especially from @jenshnielsen and @WilliamHPNielsen who wrote the driver.

Contributor guide

Open the contributing guide

Research direction

Start by reading the Decadac, DacSlot, and DacChannel constructors described in the issue, focusing on how min_val and max_val drive scaling, validation, and ramps. Define the three hardware range modes and determine how independent validation limits and per-channel settings should be represented. Done means the supported hardware ranges and channel-specific configuration work without stale validators or ramps.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
embedded-iot
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.