The subsystem design/basis for the final project
Dependencies: mbed-rtos mbed-src pixylib
Diff: global.h
- Revision:
- 19:05b8123905fb
- Parent:
- 18:501f1007a572
--- a/global.h Thu Apr 07 13:19:29 2016 +0000 +++ b/global.h Mon Apr 24 21:37:50 2017 +0000 @@ -10,27 +10,29 @@ // Preprocessor Definitions // ---------------------------------------------------------------- -#define SPEED_MAX 40 // rads/s +#define SPEED_MAX 2 // rads/s #define MAX_BLOCKS 1 #define X_SETPOINT 160 -#define HEIGHT_SETPOINT 90 -#define TARGET_DECIMAL 10 +#define HEIGHT_SETPOINT 120 +#define TARGET_DECIMAL 1 + +// #define DEBUG 1 #define PWM_PERIOD 0.001 -#define MOTOR_PERIOD 0.001 +#define MOTOR_PERIOD 0.01 #define NAVIGATION_PERIOD 0.0167 // 60 times/sec -#define MOTOR_KP 0.000120 -#define MOTOR_KI 0.0000001 +#define MOTOR_KP 0.0001 // 0.0001 +#define MOTOR_KI 0.0005 // 0.0001 //0.00001 //0.0000001 #define STEERING_KP 0.10 #define STEERING_KI 0 -#define SPEED_KP 0.6 +#define SPEED_KP 0.1 #define SPEED_KI 0 #define MOTOR_SAMPLES 300 -#define NAVIGATION_SAMPLES 240 +#define NAVIGATION_SAMPLES 200 // Global variables @@ -59,8 +61,7 @@ // Other extern PwmOut leftPwm; extern PwmOut rightPwm; -extern InterruptIn bumper; // External interrupt pin declared as Bumper // Method prototypes -char flushBuffer(void); -float QE2RadsPerSec(short counts, short time); \ No newline at end of file +void FlushBuffer(void); +float RadsPerSec(short counts, short time); \ No newline at end of file