Thread: Discussion QTR Quad Tilt Rotor
View Single Post
Old Jan 25, 2013, 11:47 PM
RCvertt is offline
Find More Posts by RCvertt
Registered User
RCvertt's Avatar
Joined Aug 2007
4,538 Posts
Quote:
Originally Posted by leadfeather View Post
Yep, VTOL is not for sissies.


Quote:
Originally Posted by tom-tom 1 View Post
I got two short flights down the street-straight and low in forward flight mode. I still haven't got the thing to hover. My yaw control seems to be opposite in hover mode than in forward flight mode. It doesn't help to reverse my servo in the radio. It just reverses both. I have changed yaw direction in the code and that doesn't seem to be the answer either. RCvertt, do you have any ideas. Is there someplace in the code where I can control the variable thrust in forward mode- like reverse direction, increase or lessen or turn off? I am going to switch out the boards with my quad copter and see if I can get it to hover. I could have something hooked up wrong. I know my quad copter works so I'm interested in what that board wilol do in my quad vtol.
Now that sounds like progress.

To reverse the yaw for forward flight only, you need to change all the signs before the yaw command indicated below in red.

Code:
  #ifdef QTR                                                                                                               //QTR- Quad Tilt Rotor definition.                                     
    if (rcData[AUX1]>1000 && rcData[AUX1]<1300)                                                                            //QTR- Hover Flight mode.
	   {
	    forwardFlightDelay = 0;                                                                                        //QTR- Reset Forward Flight delay timer to zero.
	    hoverDelay++;                                                                                                  //QTR- Start hover delay timer.
	    if (hoverDelay >= userHoverDelay)                                                                              //QTR- If timer has reached 3 seconds...  (UserHoverDelay = 350 = 3seconds).       Timer based on MultiWii rcDelayCommand timer. //rcDelayCommand = 20 => 20x20ms = 0.4s = time to wait for a specific RC command to be acknowledged
               {                                                                                                           //QTR- ...use Hover motor commands. 
                hoverDelay = userHoverDelay;	                                                                           //QTR- Keep timer at 160 so commands stay in Hover mode.	
                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.
               }
	        else                                                                                                       //QTR- ...if timer has not reached 3.2 seconds keep doing Forward Flight motor controls.  	        
		    {
		         motor[0] = rcCommand[THROTTLE] - YAW_DIRECTION * rcCommand[YAW]; //REAR_R                             //QTR-            ForwardFlight motor command.
                     motor[1] = rcCommand[THROTTLE] - YAW_DIRECTION * rcCommand[YAW]; //FRONT_R                            //QTR-            ForwardFlight motor command.
                     motor[2] = rcCommand[THROTTLE] + YAW_DIRECTION * rcCommand[YAW]; //REAR_L                             //QTR-            ForwardFlight motor command.
                     motor[3] = rcCommand[THROTTLE] + YAW_DIRECTION * rcCommand[YAW]; //FRONT_L                            //QTR-            ForwardFlight motor command.
		    }
	    }
    if (rcData[AUX1]>1800 && rcData[AUX1]<2000)                                                                                //QTR- Forward Flight mode. 
       {
	hoverDelay = 0;                                                                                                        //QTR- Reset Hover delay timer to zero.
        forwardFlightDelay++;                                                                                                  //QTR- Start Forward Flight delay timer.                                                                              
	if (forwardFlightDelay >= userForwardFlightDelay)                                                                                         //QTR- If its been 3 seconds...
           {	 		                                                                                                    //QTR- ...use forward flight motor commands.
            forwardFlightDelay = userForwardFlightDelay;                                                                                          //QTR- Keep timer at 160 so commands stay in forward flight mode.
            motor[0] = rcCommand[THROTTLE] - YAW_DIRECTION * rcCommand[YAW]; //REAR_R                                          //QTR- ForwardFlight motor command.
            motor[1] = rcCommand[THROTTLE] - YAW_DIRECTION * rcCommand[YAW]; //FRONT_R                                         //QTR- ForwardFlight motor command.
            motor[2] = rcCommand[THROTTLE] + YAW_DIRECTION * rcCommand[YAW]; //REAR_L                                          //QTR- ForwardFlight motor command.
            motor[3] = rcCommand[THROTTLE] + YAW_DIRECTION * rcCommand[YAW]; //FRONT_L                                         //QTR- ForwardFlight motor command.
	   }
	    else                                                                                                               //QTR- ...if timer has not reached 3.2 seconds keep doing Hover motor controls.  	        
	        {
                 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.
		 }		   
        }
  #endif
If yaw is too strong in forward flight then you can change all the forward flight commands from
Code:
YAW_DIRECTION * axisPID[YAW]
to
Code:
YAW_DIRECTION * (axisPID[YAW]/2)
to make it half as strong or change it to
Code:
YAW_DIRECTION * (axisPID[YAW]*2)
to make it twice as strong.

------------------
If you want to turn off differential motor thrust for forward flight, delete the yaw command from all the forward flight motor commands like so...
Code:
motor[1] = rcCommand[THROTTLE] - YAW_DIRECTION * rcCommand[YAW]; //FRONT_R
would become...
Code:
motor[1] = rcCommand[THROTTLE]; //FRONT_R
RCvertt is offline Find More Posts by RCvertt
Last edited by RCvertt; Jan 26, 2013 at 12:07 AM.
Reply With Quote