AME 30315 Pendulum Project

From Bill Goodwine's Wiki
Jump to navigationJump to search

Introduction

In this project you will design a feedback controller to stabilize an inverted pendulum. The basic steps are:

  1. system identification,
  2. controller design,
  3. implementation and verification.

The first and third steps require that you be able to program a microcontroller. The second step requires that you understand the course material.


The System

The pendulum and controller are shown in the figure on the right. It is comprised of

  1. the pendulum,
  2. a d.c. motor with optical encoder,
  3. an H-bridge current controller (the device with the heat sinks),
  4. a Freescale 68hc11 8-bit microcontroller with peripherals, and
  5. a usb-port logic analyzer.

The microcontroller is very inexpensive and has limited capability, as is realistic in industry where component costs are of significant importance.

You will need to use one of the desktop computers in XXXXX Stinson-Remick. Those computers should have the following software installed:

  • the 68hc11 port of the gcc compiler (look in xxxxxxx)
  • the bootloader
  • putty, to be able to communicate with the microcontroller over the serial port
  • notepadd++, for editing your programs
  • the logic analyzer (????) software.

There are 10 pendulum platforms and USB logic analyzers in the rooms. Return them to XXXXXXX when you are finished.

Getting Started

This section outlines the steps to write, compile, download and execute a program on the microcontroller. Until you have a controller designed that is supposed to stabilize the pendulum, make sure the pendulum is pointing down.

The file format that can be downloaded to the hc11 is called an "S-record" and has a filename that has a ".s19" suffex. Here is an example of an S-record that commands a square-wave torque to the pendulum with a period of approximately two seconds. It is a text file, so it is something you can look at and open in an editor, but it is not really decipherable.

The steps required to download the run this example square-wave program are

  1. ensure that the pendulum is hanging down,
  2. plug in both power plugs (one is for the hc11 board and the other is for the motor and controller XXXXXXX?)
  3. connect the serial port (elaborate XXXXXX, are there two comm ports on the PCs?)
  4. set the switches the right way and push the right buttons
  5. open a command window on the computer (how to do this?XXXXXX)
  6. cd to where XXXXXX?
  7. in the command window type
 whatever we type
  1. when it's downloaded you should see a prompt again. It takes between 30 seconds and two minutes, depending on how long the code is
  2. open putty and configure XXXXXX
  3. hit the right button
  4. you should see
     something
    in the putty window
  5. move the pendulum through the zero position
  6. etc