The subsystem design/basis for the final project
Dependencies: mbed-rtos mbed-src pixylib
Diff: global.h
- Revision:
- 5:f655435d0782
- Parent:
- 3:dfb6733ae397
- Child:
- 6:52686c25e4af
--- a/global.h Fri Mar 18 17:05:22 2016 +0000 +++ b/global.h Fri Mar 25 13:36:14 2016 +0000 @@ -1,11 +1,32 @@ #include "mbed.h" #include "rtos.h" #include "Pixy.h" +#include "PI.h" // ---------------------------------------------------------------- // Contains common defintions share between modes // ---------------------------------------------------------------- +// Preprocessor Definitions +// ---------------------------------------------------------------- +#define MAX_BLOCKS 1 +#define TARGET_DECIMAL 10 +#define PWM_PERIOD 0.001 +#define MOTOR_PERIOD 0.001 +#define NAVIGATION_PERIOD 0.0167 // 60 times/sec + +#define MOTOR_KP 0.000120 +#define MOTOR_KI 0.0000000001 + +#define STEERING_KP 0.01 +#define STEERING_KI 0.005 + +#define SPEED_KP 0.01 +#define SPEED_KI 0.01 +#define SPEED_MAX 10 + +// Global variables +// ---------------------------------------------------------------- // IO Port extern DigitalOut led1; extern DigitalOut led2; @@ -22,6 +43,12 @@ extern Serial pc; // PC serial channel extern Serial bt; // Bluetooth serial channel +// Control +extern PI leftMotorPi; +extern PI rightMotorPi; +extern PI targetHeightPi; +extern PI targetXPi; + // Other extern PwmOut leftPwm; extern PwmOut rightPwm;