AME 3623: Project 7: Rate Gyroscopes and Damping Control

Key to successful control in embedded systems is the ability to integrate information about the external state of your system into the control decisions that are being made. In this project, we will finally close a loop between sensing and actuation. We will add one more component to your circuit: an inertial measurement unit (IMU). The IMU contains three distinct sensors (with three degrees of freedom each): an accelerometer, a rate gyroscope and a magnetometer. The gyroscope will be used in this project to dampen rotational disturbances. In project 8, we will use all nine degrees-of-freedom to estimate the orientation of the hovercraft.

At the end of this project, you should be able to:

Component 0: Library Installation

The new IMU Utils library provides the following functions:

Component 1: Hardware and Circuit

If your craft isn't balanced yet, it is now time to do this.

Inertial Measurement Unit

The IMU is a MPU-9250. Mount the Inertial Measurement (IMU) on the mast that we provide. The advantage of the mast is that your sensor will be less subject to magnetic interference from the hovercraft motors and wires, as well as sources buried in the floor. Make sure that your mast is intact and be gentle with it (don't crush it and don't grab your hovercraft by it).

Connect the IMU to your circuit. The pins are:

Component 2: Software

  1. Copy the functions that you developed in project 6 into your current project.

  2. Implement a new PeriodicAction (called imu_task) that executes once per 5 ms The associated imu_step() function should:

  3. Implement a new finite state machine in fsm_step(). This state machine will:
    1. Wait for the switch to be pressed.

    2. Spin up the central fan.

    3. Wait in this state for 30 seconds.

    4. Turn off the central fan.

    5. Return to waiting for the switch.

  4. Implement a new PeriodicAction, called pd_task, that executes once per 10 ms. The associated pd_step() function will implement a damping rotation controller. Specifically:
    float fx = 0.0;
    float fy = 0.0;
    float torque = Kd * IMU.gz;   // gz = gyro about the Z axis (right-handed coord frame)
    set_hovercraft_forces(fx, fy, torque);
           

  5. Implement a new PeriodicAction, called report_task, that executes once per second. The associated report_step() function will print out the current rotation rate (IMU.gz).

  6. Add each of your tasks to your loop() function.

Component 3: Testing


What to Hand In

All components of the project are due by Tuesday, April 13th at 5:00 pm

Grading

Project lead credit:

For a successful project, we expect:


andrewhfagg -- gmail.com

Last modified: Sat Mar 27 15:29:40 2021