Commit 48ce8a91 authored by Jan Pospisil's avatar Jan Pospisil

little bit of calibration

parent e938e57a
......@@ -470,7 +470,8 @@ RF_2_BUNCH_RATIO = 5
# delay - delay parameter to be set
def CalculateParams(t):
rfPeriod = 4.99
delayOffset = 3.739
delayOffset = 3.714
delayScale = 1.0362
if (t < 0) or (t > RF_2_BUNCH_RATIO * rfPeriod):
raise Exception("Parameter t can be just in one bunch clock period!")
......@@ -478,7 +479,7 @@ def CalculateParams(t):
bit = int(t/rfPeriod) # bit position
rest = t - bit * rfPeriod # in ns
rest += delayOffset
delay = int(round(rest * 100)) # delay IC value
delay = int(round(delayScale * rest * 100)) # delay IC value
return (bit, delay)
......@@ -497,11 +498,12 @@ def SetPulseShape(channel, delay, width):
def TestPulse(channel = 1, overflow = 17820):
# configure channel
WbWrite('overflow', overflow)
WbWrite('trig_latency', 10)
WbWrite('trig_latency', 12)
pulseDelay = 0 # inter-bunch pulse delay in [ns]
pulseWidth = 12.5 # inter-bunch pulse width in [ns]
pulseDelay = 10 # inter-bunch pulse delay in [ns]
pulseWidth = 10 # inter-bunch pulse width in [ns]
bunches = (0,1,2,10,50) # in which bunches pulse should be
bunches = range(overflow / RF_2_BUNCH_RATIO)
(setBit, resBit) = SetPulseShape(channel, pulseDelay, pulseWidth)
for bunch in bunches:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment