This is an old revision of the document!
Table of Contents
Lab rapport 4
Date: September 26th 2008
Duration of activity: 8-12
Participants: Kasper, Bent and Johnny
The Purpose of this exercise is too make a balancing robot, using the NXT.
Experiments with the LEGO sejway, legway.
Building the legway
First we set out to build a robot with two wheels, following the build instructions on http://www.philohome.com/nxtway/nxtway.htm
Programming
We used the code from Brian Bagnall, Maximum Lego NXTBuilding Robots with Java Brains, Chapter 11, 243 - 284. (http://www.variantpress.com/books/maximum-lego-nxt) as a basis for our own program.
The default values of the PID control parameters seemed to act too violently, so initially we tried changing the them and the scale factor:
// PID constants final int KP = 28; final int KI = 4; final int KD = 33; final int SCALE = 18;
We increased the D parameter to minimize the overshoot.
Tuning PID Parameters
The easiest way to tune the parameters would be if it was possible to do a simulation and see the phasemargin, but this is not available. Therefore we have observed the behaivor of Marvin and used the manual tuning methods listed on Wikipedia at http://en.wikipedia.org/wiki/PID_controller#Manual_tuning