added gy80 dcm
Dependencies: mbed DCM_AHRS_GY80 PID MMA8451Q
Fork of quadCommand by
Diff: quadCommand/quadCommand.h
- Revision:
- 55:bca9c9e92da6
- Parent:
- 53:cce34958f952
- Child:
- 56:a550127695b2
--- a/quadCommand/quadCommand.h Tue Jun 11 02:36:12 2013 +0000 +++ b/quadCommand/quadCommand.h Thu Jun 13 01:11:03 2013 +0000 @@ -11,11 +11,13 @@ #include "sensors.h" #include "PID.h" +#define TRIM_VALUE .05 + // Motor constants. #define MOTOR1 PTD4 // Pin used for motor 1. #define MOTOR2 PTA12 // Pin used for motor 2. #define MOTOR3 PTA4 // Pin used for motor 3. -#define MOTOR4 PTA5 // Pin used for motor 4. +#define MOTOR4 PTC8 // Pin used for motor 4. // Xbee constants. // Alternative Pins @@ -28,11 +30,13 @@ #define MMA8451_I2C_ADDRESS (0x1d<<1) // Address of I2C accelerometer. #define ACCSDA PTE25 // Pin for accelerometer SDA line. #define ACCSCL PTE24 // Pin for accelerometer SCL line. -#define SENSSOR_DELAY 100.0f // PID constants. #define DEFAULT_WINDUP_GUARD 20.0f -#define MOTOR_UPDATE 100.0f +#define PID_P 10.0 +#define PID_I 0.0 +#define PID_D 5.0 +#define MOTOR_UPDATE 50.0f class quadCommand { @@ -45,6 +49,8 @@ void sendTelemetry(); // Transmit the current telemetry. private: + //Serial *pc; // tx, rx + motor *myMotors[4]; // Array of motor objects. com *myCom; // The com object for Xbee communication. sensors *world; // Sensors used to observe the world. @@ -63,10 +69,13 @@ float currentRoll; // Current roll. float currentYaw; // Current yaw. + float pitchTrim; + float rollTrim; + float targetThrottle; // Desired throttle. float targetPitch; // Desired pitch. float targetRoll; // Desired roll. - float targetYaw; // Desired yaw. + float targetYaw; // Desired yaw. }; #endif \ No newline at end of file