Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed-rtos mbed-src pixylib
tuning.cpp
- Committer:
- balsamfir
- Date:
- 2016-03-25
- Revision:
- 9:62fbb69b612c
- Parent:
- 8:b0478286ad21
- Child:
- 11:a3accd7bbf16
File content as of revision 9:62fbb69b612c:
#include "tuning.h"
#include "robot.h"
#include "global.h"
void SystemTuning(void) {
InitializeRobot();
RunMotor();
RunNavigation();
char key;
float increment = 1;
while (1) {
ResetWatchDog();
if (pc.readable()) {
key = pc.getc();
switch(key) {
case 'e':
leftMotorPI.kP = leftMotorPI.kP + increment;
break;
case 'd':
leftMotorPI.kP = leftMotorPI.kP - increment;
break;
case 'r':
leftMotorPI.kI = leftMotorPI.kI + increment;
break;
case 'f':
leftMotorPI.kI = leftMotorPI.kI - increment;
break;
case 't':
xPI.kP = xPI.kP + increment;
break;
case 'g':
xPI.kP = xPI.kP - increment;
break;
case 'y':
xPI.kI = xPI.kI + increment;
break;
case 'h':
xPI.kI = xPI.kI - increment;
break;
case 'u':
heightPI.kP = heightPI.kP + increment;
break;
case 'j':
heightPI.kP = heightPI.kP - increment;
break;
case 'i':
heightPI.kI = heightPI.kI + increment;
break;
case 'k':
heightPI.kI = heightPI.kI - increment;
break;
case 'o':
increment = increment * 10;
break;
case 'l':
increment = increment / 10;
break;
}
leftMotorPI.kP = rightMotorPI.kP;
leftMotorPI.kI = rightMotorPI.kI;
pc.printf("Increment \t %f \r\n", increment);
pc.printf("Motor \t KP: %f, KI: %f \r\n", leftMotorPI.kP, leftMotorPI.kI);
pc.printf("Steering \t KP: %f, KI: %f \r\n", xPI.kP, xPI.kI);
pc.printf("Speed \t KP: %f, KI: %f \r\n\r\n\r\n", heightPI.kP, heightPI.kI);
}
Thread::wait(500); // Go to sleep for 500 ms
}
}
void MotorTuning(void) {
}
void SpeedTuning(void) {
}
void SteeringTuning(void) {
}
void TiltTuning(void) {
}
