A quadcopter control Software (Still in development). achieved single axis stability!!!!! released for others benefit. if you'd like to help co-develop this code, then please let me know
Dependencies: MovingAverageFilter MyI2C PID RC mbed-rtos mbed
Currently on hold, due to the fact that i don't own a RX/TX system
Diff: GlobalDefines.h
- Revision:
- 1:e08a4f517989
- Parent:
- 0:54b67cd15a5b
--- a/GlobalDefines.h Sun Dec 23 23:50:21 2012 +0000 +++ b/GlobalDefines.h Tue Aug 27 09:38:49 2013 +0000 @@ -1,23 +1,26 @@ -#include "mbed.h" -#include "PulseIn.h" -#include "FastPWM.h" - -#define ToRad(x) (x*0.01745329252) // *pi/180 -#define ToDeg(x) (x*57.2957795131) // *180/pi +#include "Std_Types.h" -//// Motor Pins ///// -FastPWM FrontMotor(p21); // Front Motor Pin -FastPWM RearMotor(p22); // Rear Motor Pin -FastPWM LeftMotor(p23); // Left Motor Pin -FastPWM RightMotor(p24);// Right Motor Pin -///////////////////// - +////////////////Motors.h ////////////////// +PwmOut FrontMotor(p24); // Front Motor Pin +PwmOut RearMotor(p21); // Rear Motor Pin +PwmOut LeftMotor(p23); // Left Motor Pin +PwmOut RightMotor(p22);// Right Motor Pin +uint16 Mspeed[4]; +uint16 Throttle= 1000; +int16 PitchSetpoint=0,RollSetpoint=0,YawSetpoint=0; +int16 PitchCorrection,RollCorrection,YawCorrection; +/////////////////////////////////////////// +Serial pc(USBTX, USBRX); DigitalOut one(LED1); -PulseIn Throttle(p11); - +DigitalOut two(LED2); Timer Global; +/* +RC Aileron(p11); +RC Elevator(p12); +RC Throttle(p13); +RC Rudder(p14); +*/ +//float pitch,roll; +float deltaTime; +float pitch,roll; -int16_t RX_Data[4]; -float pitch,roll,deltaTime; -/////PID Variables///// -float PID[3],error[3],I[3],D[3]; \ No newline at end of file