diff options
author | Franklin Wei <franklin@rockbox.org> | 2019-12-12 15:35:50 -0500 |
---|---|---|
committer | Franklin Wei <franklin@rockbox.org> | 2019-12-12 15:35:50 -0500 |
commit | 4aa8ec11c9b149b5eaf523804fce27d87790b5b9 (patch) | |
tree | 2587e30c79194883b391387131f2b11fe5436418 | |
parent | e6ba5b15f5f4be010d679ac75fb2408c9f6c3f5a (diff) | |
download | regentester-master.zip regentester-master.tar.gz regentester-master.tar.bz2 regentester-master.tar.xz |
-rw-r--r-- | README.md | 31 |
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 -states: +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 +over serial. + +## 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 attached motor. 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. + +### Tachometer + +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. |