The point of this assignment is to give you experience controlling an actual robot. In this case it is a simple 1DOF robot.
Matthew McNaughton mmcnaugh@cs put the hardware together and has done the assignment. He is a good starting point for questions. Here are instructions. Please do not change the torque limits, for safety reasons. Keep the servo rate at 100Hz. An exciting movie from Matthew is here.
Part 1: Play with the example program sample.cc, so you can can set the position of the robot to any angle you command. Vary the position and velocity gains and see what effect they have. How high can you increase the gains before the robot goes unstable?.
Position gains should be no more than 1 and velocity gains should be no more than 0.1
Part 2: Get the fastest step response possible using a PD controller (only). Have the robot start out straight down. Then set the desired position to be horizontal. Record the robot's movements so you can analyze the data. Gradually increase the position and/or velocity gain to get the robot to the horizontal position as fast as possible. We will define the arrival time as when the robot gets within 0.1 radians of the goal and stays within that distance to the goal.
Part 3: Identify a model of the robot. The encoder should be easy to calibrate in radians by knowing the counts/revolution, or by moving the arm to straight down, and then straight up under program control, and seeing what the counts are. Calibrate velocity so it integrates to the position in radians. It is difficult to calibrate the torque in Newton-meters without touching the robot to apply a known force, so let's calibrate it in terms of amplifier-command-units. Identify the moment of inertia of the robot in terms of (amplifier-command-units)/(radians/sec^2). Identify a friction model. I would suggest considering a stiction force (static friction that holds the robot in place when it is not moving, this is what enables the robot in the straight up position to not fall down), Coulomb friction (a constant torque that resists movement), and viscous friction (a torque proportional to velocity).
Part 4: Given the model in part 3, plan a swingup trajectory that minimizes the sum_k ( ( amplifier-command-units - zero-torque-amplifier-command-units )^2 ) over 10 seconds. The arm must get to within 0.1 radian of the goal and stay there after the 10 seconds are up.
Part 5: Now make "optimal" swingup work on the robot. Consider using PD control in addition to a feedforward command. Consider making a better model using data from failed swingup attempts. Consider using trajectory learning if necessary.
Extra Credit: Explain (ideally with a model and simulation) why the robot goes unstable when it does.
Question: How do I log in?
Response:
Your group should have a number. If your number is 5, you log in as
user05
pw05
Change your password and make your files readable only to you.
Question: Should I turn in plots and data files for all parts?
Response: YES!!!!!!! It would be very helpful to you and us to provide plots of position and velocity vs. time for all parts. In part 3, you can plot predicted vs. actual commands for some interesting trajectories. In part 4 and 5, plotting planned and actual commands is interesting as well.