From e71ca81feb688f4124200005d7ed6cd681fc919d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20=C3=96ster?= Date: Sun, 15 Dec 2024 14:07:58 +0200 Subject: [PATCH] Add startup delay for contactors (#673) --- Software/Software.ino | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Software/Software.ino b/Software/Software.ino index d7efe9c1..6696ee02 100644 --- a/Software/Software.ino +++ b/Software/Software.ino @@ -827,6 +827,13 @@ void handle_contactors() { } unsigned long currentTime = millis(); + + if (currentTime < INTERVAL_10_S) { + // Skip running the state machine before system has started up. + // Gives the system some time to detect any faults from battery before blindly just engaging the contactors + return; + } + // Handle actual state machine. This first turns on Negative, then Precharge, then Positive, and finally turns OFF precharge switch (contactorStatus) { case START_PRECHARGE: