Skip to content

Feature: Add setpoint check before applying strengths #106

@JeanLucPons

Description

@JeanLucPons

Description, motivation and use case
In order to avoid that a set of magnet are only partially set, pyAML should check that all power supply setpoint and achievable.

Proposed solution

  • Add a valid range to each powerconverter as in the example.
  • Add a setpoint_check() method to MagnetModel that will basically compute_hardware_values() and check that all values are in the expected range. If one setpoint is out of range, a PyAMLException should be raised.
  • Modify control/abstract_impl.py and add setpoint_check() calls when needed.
- type: pyaml.magnet.cfm_magnet
  name: SH2B-C04
  mapping:
    - [B0, SH2B-C04-H]
    - [A0, SH2B-C04-V]
    - [A1, SH2B-C04-SQ]
  model:
    type: pyaml.magnet.linear_cfm_model
    multipoles: [B0,A0,A1]
    units: [rad,rad,m-1]
    pseudo_factors: [1.0,-1.0,-1.0]
    curves:
      - type: pyaml.configuration.csvcurve
        file: sr/magnet_models/SH2_h_strength.csv
      - type: pyaml.configuration.csvcurve
        file: sr/magnet_models/SH2_v_strength.csv
      - type: pyaml.configuration.csvcurve
        file: sr/magnet_models/SH2_sq_strength.csv
    matrix:
      type: pyaml.configuration.csvmatrix
      file: sr/magnet_models/SH_matrix.csv
    powerconverters:
      - type: tango.pyaml.attribute
        attribute: srmag/ps-corr-sh2/c04-b-ch1/current
        range: [-2.0,2.0]  # Power supply range
        unit: A
      - type: tango.pyaml.attribute
        attribute: srmag/ps-corr-sh2/c04-b-ch2/current
        range: [-2.0,2.0]  # Power supply range
        unit: A
      - type: tango.pyaml.attribute
        attribute: srmag/ps-corr-sh2/c04-b-ch3/current
        range: [-2.0,2.0]  # Power supply range
        unit: A

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions