From HFML-FELIX Wiki
Jump to: navigation, search

The power meter daemon

[edit | edit source]
powermeterd
MQTT daemon
powermeterd
measure FELIX power
Language Python
Hosts pi8
Repository unspecified

Introduction

[edit | edit source]

The power meter daemon measures each shot of FELIX it detects and reports the value via MQTT. The powermeter also communicates with the attenuators via MQTT. The daemon will try to protect the powermeter device by inserting 3 dB attenuation while it is measuring (unless the gun is running at 25 MHz). It will not insert the flipper mirror until a mimimum of 3 dB attenuation is inserted. Before extracting the flipper mirror, the daemon will insert all attenuation to protect the users' experiments.

The powermeter can use the integral of the pyro to estimate the power of each shot, if it has noted the ratio between the actual power and the pyro integral before at that wavelength. For that reason, it is advisable to use the power scan feature to record the powermeter/pyro integral ratio over the whole range of interest.

dependencies

[edit | edit source]

The Powermeter daemon depends on these topics for the correct interpretation of the state of the various devices to control.

Topic Description Reason
FELIX/ETH484/ETH484-11/digital/5/state fel mirror out fel selection
FELIX/ETH484/ETH484-11/digital/6/state fel mirror in fel selection
FELIX/ETH484/ETH484-11/digital/7/state flipper mirror state in state machine
FELIX/ETH484/ETH484-11/digital/8/state flipper mirror state out state machine
FELIX/ETH484/ETH484-11/relay/4/state flipper mirror relay state machine
FELIX/ETH484/ETH484-11/digital/1/state lw 5 dB in attenuation
FELIX/ETH484/ETH484-11/digital/3/state lw 3 dB in attenuation
FELIX/ETH484/ETH484-04/digital/+/state sw 10,10,10,5 dB in attenuation
FELIX/ETH484/ETH484-05/digital/+/state sw 3 dB in, lw 10,10,10 dB in attenuation
FELIX/userstation/current current userstation optional, convenience
FELIX/spectrum_analyzer/mean_wavelength spectrum analyzer power offline power indication
FELIX/spectrum_analyzer/spectrum_integral for offline power indication offline power indication

commands

[edit | edit source]
Topic Description Values
FELIX/powermeter/measure_request/command whether the powermeter will actively try to set up for measuring boolean, True means active, False means passive
FELIX/powermeter/protection/command protection of the powermeter by minimum of 3 dB attenuation boolean, True means active, False means inactive
FELIX/powermeter/strict/command whether the protection must be 3 dB exactly boolean, True means strictly 3 dB, False means 3 dB or more is ok
FELIX/powermeter/refresh resend all statusses value does not matter
FELIX/powermeter/log_level set log level string (notset/debug/info/warning/error/critical) or integer (e.g. 20)
FELIX/powermeter/clients/stop this topic is for remote shutdown of clients (the daemon itself takes no action) False to stop clients, True to terminate clients

statusses

[edit | edit source]
Topic Description Values
FELIX/powermeter/state state machine state text
FELIX/powermeter/shot/json packed dictionary of the parameters of this shot (see items below) json string
FELIX/powermeter/shot/timestamp timestamp of this shot double (unix timestamp)
FELIX/powermeter/shot/raw_power power as measured by Thorlabs powermeter float (mJ)
FELIX/powermeter/shot/real_power power corrected for attenuation float (mJ)
FELIX/powermeter/shot/estimated_power power estimated from pyro signal float (mJ)
FELIX/powermeter/shot/attenuation the attenuation used in calculating this shot's real power float (dB)
FELIX/powermeter/sensor the string identifier provided by the attached sensor text
FELIX/powermeter/attenuation the current attenuation float (dB)
FELIX/powermeter/flipper_mirror the position of the flipper mirror boolean, True means in, False means out
FELIX/powermeter/measure_request/state whether the powermeter will actively try to set up for measuring boolean, True means active, False means passive
FELIX/powermeter/protection/state protection of the powermeter by minimum of 3 dB attenuation boolean, True means active, False means inactive
FELIX/powermeter/strict/state whether the protection must be 3 dB exactly boolean, True means strictly 3 dB, False means 3 dB or more is ok
FELIX/powermeter/fel/current which beamline is active, hence which attenuator set will be operated integer, 1 for FEL1/lw, 2 for FEL2/sw
FELIX/powermeter/servers/host_pid server declaration json formatted text {"startdate": "date time", "state": "active or passive", "hostname": "hostname", "pid": pid}
FELIX/powermeter/clients/host_pid client declaration
Note: published by clients, not by this daemon
json formatted text {"hostname": "hostname", "pid": pid,"state":"master or slave","subsystem":"powermeter","starttime":timestamp}
FELIX/powermeter/daemon_time system time of the host the daemon runs on unix timestamp (e.g. 1550680653.91)
FELIX/powermeter/daemon_time/readable system time of the host the daemon runs on human-readable timestamp (e.g. Wed Feb 20 17:37:59 2019)

Programmer's details

[edit | edit source]

State machine logic

[edit | edit source]
  1. beamlinewait
    • fel selection != None -> 1
  2. idle
    • measure request == TRUE -> 3
  3. insert protection
    • measure request == FALSE -> 2
    • >= 3dB inserted -> 4
  4. insert flipper mirror
    • flipper mirror == IN -> 5
    • measure request == FALSE -> 6
  5. measuring
    • <3dB inserted? -> insert 3 dB
    • flipper mirror == OUT -> 4
    • measure request == FALSE -> 6
  6. insert all attenuation
    • all attenuation inserted? -> 2