2025-11-04 16:42:17 +01:00
2025-12-17 10:51:20 +01:00
2025-11-04 16:42:17 +01:00
2025-12-16 16:19:20 +01:00

MSCB (Midas slow control bus) high voltage divider SCSHV 20 voltage

This repository contains the driver code and "default" Midas frontend for the Midas slow control bus (MSCB) SCSHV 20 high voltage divider.

Requirements

Requires a Midas installation with the environment variable MIDASSYS pointing to the built Midas artifacts and headers.

Build

Clone this repository, enter the cloned directory, and then build via CMake.

cmake -S "$(pwd)" -B <directory-to-build-in> -DBUILD_FRONTEND=ON
cmake --build <directory-to-build-in> --clean-first -- -j8

Run

/build/driver/scshv20_fe -e flame

Including in Custom Frontend

To include this driver in a custom frontend, you should ensure the environment variable MIDASSYS points to your system install and include a snippet in your CMakeLists.txt similar to the following:

# If the path to the scshv20 repository is outside of the frontend
# repository, you also need to provide a location for the scshv20
# artifacts as a second argument to `add_subdirectory`
# e.g. `./device/scshv20`
add_subdirectory(
    <path-to-scshv20-repository>
)

add_executable(
  <frontend-name>
  <frontend-code-path-1>
  <frontend-code-path-2>
  :
)

set_property(
  TARGET
    <frontend-name>
  PROPERTY
    CXX_STANDARD 11
)

target_include_directories(
  <frontend-name>
  PRIVATE
    $ENV{MIDASSYS}/drivers
    $ENV{MIDASSYS}/include
)

target_link_libraries(
  <frontend-name>
  scshv20
  <additional-library-1>
  <additional-library-2>
  :
)

Configuration

Description from device/scshv20.cxx:

  • Specify all scshv20 drivers in the DEVICE_DRIVER structure for the EQUIPMENT.

  • Start and then stop the frontend executable a first time to create the ODB structure

  • In the /Equipment//Settings/<device_n>/DD/SCSHV20 of each SCSHV20 device

  • Specify y if the device is used

  • ALWAYS Specify the MSCB name and the Pwd of the MSCB submaster of the rightmost slot (Node 0 is handling the network communication of the entire crate)

  • Specify the Group Addr (default for SCSHV20 is 2000)

  • Specify the "unique" Node Addr of the slot position NOTE: Node address must not be configured on the MSCB submaster of the module. The node address is automatically assigned to the module when inserted into the slot!! Use the msc program. Use command "scan" to verify the current adress of the device.

  • Specify the SCSHV20 Name (usually _ e.g.: hvflame_1 for the first is taken)

  • Specify the ODB Offset for the first HV channel of the module e.g.: for the first SCSHV20 offset is 0, for the second offset is 20.

  • Specify if the module should be accessed read only.

  • If HandlePowerOn is set to y all channels of the module set with non zero demand will be reset to the ODB demand value when a power on condition is detected.

  • HV power will be turned on when channel 160 (HV enable) of the module is set to 1. Specify if the "HV enable" command should be sent as group command by setting "Group HV_enable" y. If not each "HV enable" channel of each module of the device will be enabled separately when the module is initialized.

  • Specify "Voltage Limit" [V] and "Current Limit" [uA]. Maximum channel voltage is 300V and current 1000uA. Current SCSHV20 crate is a prototype version with limited power due to a 600W power supply.

  • Start the frontend and check if drivers are OK

  • Set the DD/SCSHV20/"Voltage limit" to 2-5 V above the highest possible value to be set when adjusting APD settings.
    NOTE: After changing a module's "Voltage Limit" restart the Midas front-end program. FE program will set ODB "Voltage Limit[ch]" and Chxx_Umax of all HV channels higher than the module's "Voltage limit" to this voltage limit. NOTE: If "Voltage Limit[ch]" and Chxx_Umax of a HV channel are lower than the "Voltage limit" of the module they will not be modified at all when "Voltage Limit" of the module is increased. To be able to set a higher voltage, modify the channels voltage limit in /Equipment//Settings/Voltage Limit[ch] and set the HV channels voltage again in the ODB. NOTE: Restart deltat after changing "Voltage Limit[ch]" of a HV channel.

  • Set the DD/SCSHV20/"Current limit" to 5-10 uA above the highest possible value to be reached by HV channel regulation.
    NOTE: After changing a module's "Current Limit" restart the Midas front-end program. FE program will set ODB "Current Limit[ch]" and Chxx_Imax of all HV channels higher than the module's "Current limit" to this current limit. NOTE: If "Current Limit[ch]" and Chxx_Imax of a HV channel are lower than the "Current limit" of the module they will not be modified at all when "Current limit" of the module is increased. To be able to "set" a higher current e.g. after tripping, modify the channels current limit in /Equipment//Settings/Current Limit[ch] and then set the HV channels voltage again in the ODB.

S
Description
Driver for MSCB high voltage dividers SCSHV20
Readme
63 KiB
Languages
C++ 97.2%
CMake 1.9%
C 0.9%