diff --git a/mbtrack2/tracking/rf.py b/mbtrack2/tracking/rf.py
index 0b66593e9290c4dcd76ac38326123942bbf4afba..149b03e9953e68d98239e20d9ed0e7906f9020b4 100644
--- a/mbtrack2/tracking/rf.py
+++ b/mbtrack2/tracking/rf.py
@@ -1142,37 +1142,46 @@ class CavityResonator():
 
         return pos, voltage_rec
     
-    def to_pycolleff(self):
+    def to_pycolleff(self, Impedance=True):
         from pycolleff.longitudinal_equilibrium import ImpedanceSource
         
         cav = ImpedanceSource()
         cav.harm_rf = self.m
         cav.Q = self.QL
         RoverQ = self.RL/self.QL
-        cav.shunt_impedance = self.Ncav * RoverQ * cav.Q
+        cav.shunt_impedance = RoverQ * cav.Q
         cav.ang_freq_rf = self.ring.omega1
         cav.ang_freq = cav.harm_rf * cav.ang_freq_rf
         cav.detune_w = 2 * np.pi * self.detune
-        cav.calc_method = ImpedanceSource.Methods.ImpedanceDFT
         if self.Vg != 0:
             cav.active_passive = ImpedanceSource.ActivePassive.Active
-            # Define PID transfer function for control loop
-            def pid_transfer_func(w, wrf, gain=1, kp=1, ki=1, kd=0, delay=0):
-                # If you do not want to worry about the details of the voltage gap
-                # control system, you can use SIRIUS parameters in this function.
-                phase = wrf * delay
-                exp_delay = np.exp(-1j * delay * w)
-                exp_phase = np.exp(1j * phase)
-                eps = 1e-16
-                pid_ctrl = kp + ki / 1j / (w - wrf + eps) + kd * 1j * (w - wrf)
-                transfer = gain * pid_ctrl * exp_delay * exp_phase
-                return transfer
-            
-            cav.loop_ctrl_ang_freq = self.ring.omega1
-            cav.loop_ctrl_transfer = partial(pid_transfer_func, kp=1, ki=1, delay=0)
-            
+            if Impedance:
+                cav.calc_method = ImpedanceSource.Methods.ImpedanceDFT
+                # Define PID transfer function for control loop
+                def pid_transfer_func(w, wrf, gain=1, kp=1, ki=1, kd=0, delay=0):
+                    phase = wrf * delay
+                    exp_delay = np.exp(-1j * delay * w)
+                    exp_phase = np.exp(1j * phase)
+                    eps = 1e-16
+                    pid_ctrl = kp + ki / 1j / (w - wrf + eps) + kd * 1j * (w - wrf)
+                    transfer = gain * pid_ctrl * exp_delay * exp_phase
+                    return transfer
+                
+                delay = 1.9e-6
+                ki = 0.01
+                kp = 2.96e-6
+                kd = 0
+                cav.loop_ctrl_ang_freq = self.ring.omega1
+                cav.loop_ctrl_transfer = partial(pid_transfer_func, kp=kp, ki=ki, delay=delay)
+                # cav.loop_ctrl_transfer = partial(pid_transfer_func, kp=0, ki=1, delay=0)
+            else:
+                cav.calc_method = ImpedanceSource.Methods.Wake         
         else:
             cav.active_passive = ImpedanceSource.ActivePassive.Passive
+            if Impedance:
+                cav.calc_method = ImpedanceSource.Methods.ImpedanceDFT
+            else:
+                cav.calc_method = ImpedanceSource.Methods.Wake     
         return cav
         
 
diff --git a/mbtrack2/tracking/synchrotron.py b/mbtrack2/tracking/synchrotron.py
index 70b4f6308b27fe6450bd0f5116e3c6c00d3cfb5e..8a4dd02dcac8992471a1d5294f7498f0455e8ba8 100644
--- a/mbtrack2/tracking/synchrotron.py
+++ b/mbtrack2/tracking/synchrotron.py
@@ -585,7 +585,7 @@ class Synchrotron:
                                      TimeLag=TimeLag)
         return at_simple_ring
     
-    def to_pycolleff(self, I0, Vrf, bunch_number):
+    def to_pycolleff(self, I0, Vrf, bunch_number, delta=0):
         from pycolleff.colleff import Ring
         
         ring = Ring()
@@ -607,8 +607,9 @@ class Synchrotron:
         ring.damptx = self.tau[0]  # [s]
         ring.dampty = self.tau[1]  # [s]
         ring.dampte = self.tau[2]  # [s]
-        ring.en_lost_rad = self.U0  # [eV]
+        ring.en_lost_rad = self.U0 # [eV]
         ring.gap_voltage = Vrf  # [V]
+        ring.delta_HC = delta
         
         return ring