PLEASE TURN OFF THE POWER BAR WHEN YOU ARE DONE.
This tarball contains sample code for operating the hardware for assignment 6. It simply servos the shoulder and elbow to fixed positions, close to hanging straight down. The shoulder motor has an encoder with 1000 ticks per revolution. The elbow has 500. There is no way to read the velocity, as there was with assignment 4.
The current limit on the shoulder motor is high, but the elbow is low. If you run the elbow for a minute at high current, you should let it cool off for a minute.
Build and run the sample program by the following:
cd demo2dof make ./sampleThe options are
Always be ready with the power bar to turn off the amplifiers. 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, tell them to plug in somewhere else. TURN IT OFF WHEN YOU ARE DONE. DO NOT GO NEAR THE PENDULUM WHEN IT IS RUNNING.
You can use the file demo2dof/sample.cc as a base for your own development. Find the comment
/** * REPLACE THIS FUNCTION WITH YOUR STUFF. */
Control commands returned by your function must return voltages in the range [-1,1]. Those commands will be scaled to the correct range for each motor. -- Matthew McNaughton