From 607da8a8222e00709b357a47a7d4b525eb83fc74 Mon Sep 17 00:00:00 2001 From: linuswck Date: Wed, 20 Mar 2024 17:24:29 +0800 Subject: [PATCH] ld: Add a delay before turning on LD PWR - DAC output might not drop to 0V before PWR is being turned on - Thus, it might drive nondeterministic current into the laser diode during pwr up --- src/laser_diode/laser_diode.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/laser_diode/laser_diode.rs b/src/laser_diode/laser_diode.rs index cc57b77..6143d5b 100644 --- a/src/laser_diode/laser_diode.rs +++ b/src/laser_diode/laser_diode.rs @@ -121,6 +121,8 @@ impl LdDrive{ let prev_i_set = self.settings.ld_drive_current; LdCurrentOutCtrlTimer::reset(); let _ = self.ctrl.set_i(ElectricCurrent::new::(0.0), Settings::LD_DRIVE_TRANSIMPEDANCE, Settings::DAC_OUT_V_MAX); + // Wait for the DAC to reset its voltage back to 0V + sleep(10); LdPwrExcProtector::pwr_on_and_arm_protection(); // Wait for LD Power Supply to start up before driving current to laser diode sleep(30);