| Organization: | Project SCINI at Moss Landing Marine Labs |
|---|---|
| Date: | December, 2007 |
| Disclaimer: | This material is based on work supported by the National Science Foundation under Grant No. ANT-0619622 (http://www.nsf.gov). Any opinions, findings and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of the National Science Foundation. |
Follow this schematic to get all the computers plugged together correctly and power them all up:

A full resolution version of this diagram should be available as surface-setup-block.png in the img directory included with this documentation.
Note that you can bypass the router and just plug one laptop directly into the ethernet over power device with a regular (non-crossover) ethernet cable if you just want to test either controls or video streaming.
Once MILK is powered up in Windows XP and SCINI is powered up and it's lights are on, we can try to connect. Open the Silex driver utility (usually in start menu or on desktop) and wait for the electronics bottle device to pop up; this could take a minute or more. If it doesn't show up, check that the ethernet over power device is connecting to both "Powerline" and "Ethernet" (blue status LEDs), that the router shows connectivity to both the ethernet over power device and MILK, and that MILK can reach both the router web page (usually http://192.168.0.1) and the elphel camera page (usually http://cam2:81 or similar). When the device comes up, click to expand, chose the UART bridge subdevice, and connect to that.
Now find and open the python testdriver.py script by double clicking on it; usually this is in a folder called "python" or "python-controls" on the desktop. A simple shortcut won't work, the program must be run from it's folder in the repository. Once that is open and you can see the control panel, try pressing connect. If the disconnect button doesn't activate then the connection didn't work; look in the debug text window for more information. If the connection did work, first drag up the 7th slider (lights) to dim the lights out and prevent the camera bottle from overheating.
See ``software-overview.py`` for more info on developing this program further, and make sure the setup directions there were followed if you have problems

The prototype controls program, testdriver.py, is a single window with all the settings, calibration, and controls visible at all times.
The top grid is the joystick calibration matrix; the program takes the product of the joystick input vector and this matrix to get the thruster output vector. By editing the value at the intersection of any joystick control axis and any thruster output, you can control the magnitude and polarity (positive or negative) of the thruster response to that axis. To change the overall sensitivity, bring up the 3D connexion driver panel (usually one of the buttons on the joystick) and play with the sensitivity slider there.
The upper row of sliders allows manual thruster/PWM channel control; see rov-minimalist-protocol and scini-main-bottle-pins-markI for details. You can edit the channel names here (eg, "Lights", "Aft Vert"). Control commands are only sent when the sliders are changed, and the joystick input will overwrite any slider settings. The PWM signal you are sending to the microcontroller is indicated by the number between 0 and 255. There are "hard coded" thruster limits that prevent very high or low commands, these are edited by hand in test-driver.py itself.
The lower grid is the IMU calibration; each acceleration channel gets a recorded neutral value, then a "high" and "low", based on positive or negative acceleration of gravity (the bottle is held up, down, and horizontal along each axis to get these values). The gyros aren't really used so far. The sliders to the right of the calibration grid show the roll and pitch angles based off the acceleration input.
The row of bars near the bottom displays the raw values from the analog inputs (analog digital converter pins on the microcontroller), as well as the processed values. How each value gets handled is dependent on the name (which is edit-able) of that analog channel. These values aren't continuously updated; press the refresh button or any of the 3D controller buttons to refresh; a refresh also takes place while the 3D controller is being manipulated and is not in the idle position.
"Connect" and "Disconnect" start and stop communications with SCINI.
"Load Conf" and "Save Conf" let you save and reload configurations and calibrations; the most recently opened configuration file is displayed in the title bar (so you won't forget).
"Zero Thrusters" sets all the thruster PWM channels to 127 (neutral), but leaves the lights as they are.
The "Start Joystick" button tries to connect to the 3D controller and the "Stop Controller" button disconnects; you can not reconnect once disconnected.
The "Laser" and "Lights" buttons are non-functional.
"Exit" attempts to disconnect and quit the program; sometimes when it hangs you can still close the window and have the program quit even if this doesn't work. This does not save your configuration!
First load all the drivers and power up SCINI as mentioned above. Once testdriver.py is open and you have connection to SCINI, load the appropriate configuration file (usually the numbered files correspond to the electronics bottle number). Then start the joystick if you want it, and try sliding the lights slider to make sure SCINI responds. If controls are laggy or slow, the problem is usually the network connection being saturated by streaming video; try a lower resolution or engineer a solution?
When you wiggle the 3D controller, you should see the sliders move around in response, depending on how your controls matrix is set up.
If SCINI is disconnected physically or powered down while testdriver.py is connected, the program will probably freeze up; close the window and restart and everything should start working again.
It's good practice to save your configuration when you exit or disconnect, not just after you've made a change, because it's easy to forget that you tweaked the main thruster sensitivity, or corrected an accelerometer neutral, etc.