From f6677d874c5ee15c1ca1668094e1b2c397d06b24 Mon Sep 17 00:00:00 2001 From: linuswck Date: Fri, 26 Jan 2024 16:40:54 +0800 Subject: [PATCH] LD: Rst LD current at power_up for soft start --- src/laser_diode/laser_diode.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/laser_diode/laser_diode.rs b/src/laser_diode/laser_diode.rs index 57bd8e4..1fe5fd9 100644 --- a/src/laser_diode/laser_diode.rs +++ b/src/laser_diode/laser_diode.rs @@ -104,8 +104,12 @@ impl LdDrive{ self.ctrl.ld_short_disable(); } - pub fn power_up(&mut self){ + pub fn power_up(&mut self){ + let _ = self.ctrl.set_i(ElectricCurrent::new::(0.0), Settings::LD_DRIVE_TRANSIMPEDANCE, Settings::DAC_OUT_V_MAX); LdPwrExcProtector::pwr_on_and_arm_protection(); + // Wait for LD Power Supply to start up before driving current to laser diode + sleep(30); + self.ld_set_i(self.settings.ld_drive_current); } pub fn power_down(&mut self){