/* fileName: stand.c * purpose: Makes the robot stand with feedback * author: Jesse Pepper * version: v0.00a * bugs: * notes: Initial compensation only through Torso */ #include #include #include /* Local Headers */ #include "stand.h" #include "globalDefines.h" #include "biped.h" globals g; void balance( void ) { float fB=0.0; float lR=0.0; float actualLHipB=0.0; float actualRHipB=0.0; float currentErrorFB=0.0; float currentErrorLR=0.0; float previousErrorFB=0.0; float previousErrorLR=0.0; float adjustment=0.0; /* PID controller constants */ float kP = 0.1; float kI = 0.10; float kD = 0.05; float time = 0.1; int ticks = 1; int posture[cNumServos] = {0, 0, 0, 0, 0, 0, 0, 0, 0}; bool done=false; int i; LCDPrintf( "balance...\n" ); for (i=0; i