Skip to content

DiamondLightSource/mfbcontrol

Repository files navigation

CI Coverage

License

mfbcontrol

Python soft IOC to run the Modulation Feedback control loop using a PandABox.

The MFB control loop takes BPM positions as input and drives a piezo motor to achieve the position of maximum beam intensity.

A PandABox with a FMC ACQ427ELF is dedicated to this purpose, if the target PandABox is shared, make sure the blocks CLOCK1, PCAP, COUNTER1, PGEN1, CALC1 and FMC_OUT are not affected and fully owned by this application.

The BPM channels A, B, C and D should be connected to channel 1, 2, 3 and 4 of the FMC ADC.

The FMC DAC channel 1 should be connected to the target piezo motor amplifier.

Source https://github.com/DiamondLightSource/mfbcontrol
Releases https://github.com/DiamondLightSource/mfbcontrol/releases

Quickstart

The following command starts an IOC in which the initial gain is -0.3, the threshold of the beam intensity to start controlling is 0.5 and the modulation signal generated is a cosine wave with frequency 121Hz and amplitude 0.07V.

mfbcontrol-ioc PV-PREFIX panda-host --control-gain -0.3 --min-sig 0.5 --mod-freq 121 --mod-amp 0.07

PVs provided

PV-PREFIX:ENABLE

Enable/disable for the control loop.

PV-PREFIX:AMP

The modulation signal amplitude in Volts.

PV-PREFIX:FREQ

The modulation signal frequency in Hertz.

PV-PREFIX:GAIN_I

Integral gain in the control loop.

PV-PREFIX:GAIN_P

Proportional gain in the control loop, note that depending on the total latency of the system, the sign of the gain might need to be changed so that the correction happens in the right direction.

PV-PREFIX:MINSIG

Minimum BPM intensity signal average level so that the control loop kicks in.

PV-PREFIX:BPM:INTEN

Current BPM intensity signal average level.

PV-PREFIX:BPM:AMP

BPM intensity (A+B+C+D) waveform.

PV-PREFIX:BPM:FFT:AMP

Waveform containing the amplitude of the FFT of the BPM intensity.

PV-PREFIX:BPM:FFT:FREQ

Waveform cotaining the FFT frequncy scale for BPM:FFT:AMP.

PV-PREFIX:MOD:AMP

Modulation signal waveform.

PV-PREFIX:MOD:FFT:AMP

Waveform containing the amplitude of the FFT of the modulation signal generated.

PV-PREFIX:PM:MOD:FFT:FREQ

Wavefor containing the FFT frequency scale for MOD:FFT:AMP.

PV-PREFIX:DAC:SET

Manual control for the DAC output (in V units).

PV-PREFIX:DAC:SET_RBV

Readback PV for the DAC output (in V units).

PV-PREFIX:DAC_TWEAK

The tweak value to increment by when tweaking the DAC level up or down.

PV-PREFIX:DAC:TDOWN

Tweak the DAC level down by a DAC_TWEAK. Put a 0 or 1 value opposite to its current value for the record to be processed.

PV-PREFIX:DAC:TUP

Tweak the DAC level up by a DAC_TWEAK. Put a 0 or 1 value opposite to its current value for the record to be processed.

Architecture

The PID control loop is run in software (a python soft IOC to be precise), this obtains the QBPM signals and the modulation signal from the FPGA, then it calculates a correction and adjusts the DAC offset value to control the piezo motor position.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •