Thread: Discussion QTR Quad Tilt Rotor
View Single Post
Old Feb 08, 2013, 06:39 PM
RCvertt is offline
Find More Posts by RCvertt
Registered User
RCvertt's Avatar
Joined Aug 2007
4,534 Posts
Quote:
Originally Posted by tom-tom 1 View Post
Here is a video of my QTR...
Flown and crashed like a BOSS!

It's good to get that new plane smell off it quick so you don't mind crashing it some more as the development continues. Get a car inverter. It'll let you plug your glue gun and soldering iron into your car lighter port. I always have to glue my plane together at least 10 times before I get it all working smoothly.

Attached is new code that should let you use servo 1 and servo 2 on A0 and A1. Test it on the ground to make sure it works. I has the following new section where you can access the motor and servo commands. Change signs to reverse movement and use axisPID instead of rcCommand if you want the servo to respond to gyro movement.

Code:
///////////////////////////QTR Motor and Servo commands./////////////////////////////
void forwardFlightMotorCommands()
     {
      motor[0] = rcCommand[THROTTLE] +YAW_DIRECTION * rcCommand[YAW]; //REAR_R                                                  ForwardFlight motor command.
      motor[1] = rcCommand[THROTTLE] +YAW_DIRECTION * rcCommand[YAW]; //FRONT_R                                                 ForwardFlight motor command.
      motor[2] = rcCommand[THROTTLE] -YAW_DIRECTION * rcCommand[YAW]; //REAR_L                                                  ForwardFlight motor command.
      motor[3] = rcCommand[THROTTLE] -YAW_DIRECTION * rcCommand[YAW]; //FRONT_L                                                 ForwardFlight motor command. 
     }
     
void hoverMotorCommands()
     {
      motor[0] = rcCommand[THROTTLE] -axisPID[ROLL] +axisPID[PITCH] -YAW_DIRECTION * axisPID[YAW]; //REAR_R   //QTR- Motor 9    Hover motor command.
      motor[1] = rcCommand[THROTTLE] -axisPID[ROLL] -axisPID[PITCH] +YAW_DIRECTION * axisPID[YAW]; //FRONT_R  //QTR- Motor 10   Hover motor command.
      motor[2] = rcCommand[THROTTLE] +axisPID[ROLL] +axisPID[PITCH] +YAW_DIRECTION * axisPID[YAW]; //REAR_L   //QTR- Motor 11   Hover motor command.
      motor[3] = rcCommand[THROTTLE] +axisPID[ROLL] -axisPID[PITCH] -YAW_DIRECTION * axisPID[YAW]; //FRONT_L  //QTR- Motor 3    Hover motor command.
     }
     
void servoCommands()
     {
      servo[1] = constrain(1500 +rcCommand[ROLL] +rcCommand[PITCH], 1020, 2000);
      servo[2] = constrain(1500 +rcCommand[ROLL] +rcCommand[PITCH], 1020, 2000);
     }
///////////////////////////QTR Motor and Servo commands./////////////////////////////
RCvertt is offline Find More Posts by RCvertt
Last edited by RCvertt; Feb 08, 2013 at 07:01 PM.
Reply With Quote