From 7b933645f701596470fde82ebea16d897306f89f Mon Sep 17 00:00:00 2001 From: damic014 Date: Tue, 29 Oct 2019 12:28:56 -0500 Subject: Add better limit handling to system: when a limit is triggered, return to the linear-zero position. Add an initialize function for startup: use the limit switches to find the track extent and then go to zero. With the above two additions, we should be able to assume that new tests will always start at the zero position. Also add an initialize file which just calls sys.initialize to find the zero position. This should only be run on power-up (eventually, we should configure the Pi to run this on OS startup). --- System_Python/initialize_system.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 System_Python/initialize_system.py (limited to 'System_Python/initialize_system.py') diff --git a/System_Python/initialize_system.py b/System_Python/initialize_system.py new file mode 100644 index 0000000..4eb287a --- /dev/null +++ b/System_Python/initialize_system.py @@ -0,0 +1,7 @@ +# This file should be run on system startup. It will initialize the linear position to the center so that all tests originate from a proper position. +# The center is found by using the hardware limit switches +from system import System + +# Main program +sys = System() +sys.initialize() -- cgit v1.2.3