FastRobots

ECE4160/5160-MAE 4190/5190: Fast Robots course, offered at Cornell University in Spring 2024

This project is maintained by FastRobotsCornell

Fast Robots @ Cornell

Return to main page

Lab 6: Orientation Control

Objective

The purpose of this lab is to get experience with orientation PID using the IMU. In Lab 5, PID control was done on wall distance using the TOF sensors, this lab will involve controlling the yaw of your robot using the IMU. Like last lab, you can pick whatever controller works best for your system. 4000-level students can choose between P, PI, PID, PD; 5000-level students can choose between PI and PID controllers. Your hand-in will be judged upon your demonstrated understanding of PID control and practical implementation constraints, and the quality of your solution.

This lab is part of a series of labs (5-8) on PID control, sensor fusion, and stunts.

Parts Required

Lab Procedure

Orientation Control

For this lab, we will work on implementing stationary (in place) orientation control. The control signal (output from the PID controller) will be a differential drive value. The wheel should be driven at the same speed in opposite directions in order to control the orientation of the robot as shown in the video below. Some considerations to think about when implementing your controller:

Kick

PID Input Signal

Derivative Term

Programming Implementation

Include graphs of all appropriate measurements needed to debug your PID controller. Below is an example the set point, angle and motor offset plotted as a function of time. Observe the overshoot and settling time of the angle and the response of the motor values.

Tasks for 5000-level students

Implement wind-up protection for your integrator. Argue for why this is necessary (you may for example demonstrate how your controller works reasonably independent of floor surface).

Write-up

Word Limit: < 800 words

Webpage Sections

This is not a strict requirement, but may be helpful in understanding what should be included in your webpage. It also helps with the flow of your report to show your understanding to the lab graders. This lab is more open ended in terms of the steps taken to reach the end goal, so just make sure to document your process you take to complete your task, including testing and debugging steps!

  1. Prelab
    • Clearly describe how you handle sending and receiving data over Bluetooth
    • Consider adding code snippets as necessary to showcase how you implemented this on Arduino and Python
  2. Lab Tasks
    • P/I/D discussion (Kp/Ki/Kd values chosen, why you chose a combination of controllers, etc.)
    • Range/Sampling time discussion
    • Graphs, code, videos, images, discussion of reaching task goal
    • Graph data should at least include theta vs time (you can also consider angular velocity, motor input, etc)
    • (5000) Wind-up implementation and discussion

Add code (consider using GitHub Gists) where you think is relevant (DO NOT paste your entire code).