|author||Franklin Wei <firstname.lastname@example.org>||2019-12-12 15:35:50 -0500|
|committer||Franklin Wei <email@example.com>||2019-12-12 15:35:50 -0500|
1 files changed, 28 insertions, 3 deletions
@@ -1,7 +1,16 @@
# Regenerative Braking Tester
-This sketch advances the states of pins 2 and 3 through the following
+This repo contains the Arduino code (C) and control software (Python)
+for a regenerative braking test stand. The Arduino code resides in
+`main/main.ino`, and the control software resides in `tools/`.
+The Arduino and control software communicate via a custom protocol
+## Arduino Code
+The Arduino maintains a state machine, which advances the states of
+pins 2 and 3 through the following states:
1. 2 high, 3 low
2. 2 low, 3 low
@@ -13,5 +22,21 @@ circuit will produce acceleration and regenerative braking of an
The program will also regularly poll the current detected by an ACS712
-Hall effect current probe attached to A0 and output the current (in
+Hall effect current probe attached to A1 and output the current (in
amperes) via serial.
+## Control Interface
+The primary control software for interfacing with the Arduino is
+`tools/controller.py`. To run it, attach the Arduino via USB and run
+it with root privileges. The software will attempt to connect to the
+Arduino and will run through the steps of a trial. Data will be output
+to standard output, from which it can be logged and processed.
+Speed sensing is done separately by `tools/tachometer.py` (requires
+OpenCV to be installed: `pip install opencv`). Run this with a webcam
+attached and pointed at the regions of interest, and it will prompt
+you to select the two regions of interest in a camera frame. The speed
+plots will then be displayed and updated in real time.