Notes on the hardware for KDC Assignment 4

In this assignment you are to operate a simple robot consisting of a motor with a piece of wood attached to form a single-joint pendulum. The stations is at the back of the REL to your right as you enter. If someone from another class is sitting at the desk, politely ask them to let you use it.

To operate the robot:

The pendulum motor and its amplifier are connected to a Sensoray 626 I/O board in several ways: This tarball contains sample code for operating the hardware for assignment 4.

Build and run the sample program by the following:

cd demo1dof
make
./sample -t 500

The options are:

-t
Target position encoder value. Note that 0 is set to the position of the pendulum when the program starts, and the value continues increasing (decreasing) cumulatively with each revolution - it does not wrap around to 0.
-k
Position servo gain. This should be at most 0.1 for safety.
-b
Velocity servo gain. This should be at most 0.01 for safety.
-l
File to log time, position, velocity, and applied voltage. Time is a floating point number in seconds.
-v
Enable verbose mode. Prints status to stderr once per second.

Safety is a real issue with this assignment. The amplifier puts out a lot of juice, and a buggy program can cause the pendulum to spin with frightening force. Try the following for a taste of what can go wrong:

./sample -t 4000

Always be ready with the power strip to turn off the amplifier. Do not rely on Control-C to kill a runaway program. If someone else in the lab has plugged their laptop in to the power bar at your pendulum station, tell them to plug in somewhere else. UNPLUG WHEN YOU ARE DONE. DO NOT GO NEAR THE PENDULUM WHEN IT IS RUNNING.

You can use the file demo1dof/sample.cc as a base for your own development. Find the comment

/* DO YOUR STUFF HERE */
...
/* FINISH YOUR STUFF */

Accounts

The machine has accounts in the form
user00 with passwords pw00. The machine is not connected to the network, so you must get your files on and off with a USB flash drive. -- Matthew McNaughton