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 |
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
Enable/disable for the control loop.
The modulation signal amplitude in Volts.
The modulation signal frequency in Hertz.
Integral gain in the control loop.
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.
Minimum BPM intensity signal average level so that the control loop kicks in.
Current BPM intensity signal average level.
BPM intensity (A+B+C+D) waveform.
Waveform containing the amplitude of the FFT of the BPM intensity.
Waveform cotaining the FFT frequncy scale for BPM:FFT:AMP.
Modulation signal waveform.
Waveform containing the amplitude of the FFT of the modulation signal generated.
Wavefor containing the FFT frequency scale for MOD:FFT:AMP.
Manual control for the DAC output (in V units).
Readback PV for the DAC output (in V units).
The tweak value to increment by when tweaking the DAC level up or down.
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.
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.
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.