Vectored Thrust Tricopter mod for Cleanflight 1.8.0

Continuing work on my vectored thrust tricopter [see also: http://www.thingiverse.com/thing:825920] design required implementing some changes in the flight controller software to allow me better control of the aircraft.  As a "quick & dirty" method, I modified the existing "CUSTOM" model in the cleanflight source.  I remapped it back to the Tricopter mixer, but added in support for the vectoring servo and created a new flight mode for it.

I'm providing both the patch for cleanflight-1.8.0, cleanflight-configurator (optional, see below), and the compiled hex file for Naze / Flip32 based boards.

The cleanflight-configurator patch is required to make the two servos show up on the "Servos" tab for the CUSTOM model.  However, as of this writing, you can get away with just flashing the hex file to your board and using regular cleanflight-configurator, with the caveat that you must use the CLI for the servo configs instead of the Servos tab in the GUI.

**** DOWNLOAD AND USE AT YOUR OWN RISK ****

The patch files:
cleanflight-vthrust-1.8.0.patch
cleanflight-configurator-vthrust.patch

The precompiled firmware:
cleanflight-excelsior-naze-180-0.9.hex

**** DOWNLOAD AND USE AT YOUR OWN RISK ****


Instructions:

Connect the motors and tail servo as you would for a regular tricopter, with S2 being the output for the tilt-rotor servo.  As a refresher, in tricopter mode the Naze / Flip32 output pins M1 and M2 become S1 and S2, and M3 becomes M1 &etc.

Output pins (in order):

1: S1 - Tail Servo
2: S2 - Tilt-rotor / Thrust Vector Servo
3: M1 - Tail Motor output
4: M2 - Right Motor Output
5: M3 - Left Motor Output


Cleanflight Setup:

I'll assume you're familiar with the basics of cleanflight.  Set up your model, receiver, &etc as usual, following these customizations for the vectored thrust mode:

---------- Configuration Tab: ----------

Mixer: Custom  - this is the most important setting, as it enables VTHRUST mode.  The model picture will change to a giant question mark.  That's normal.

---------- PID Tuning Tab: ----------

PID Controller:  1 - MultiWii (rewrite)  <- MUST USE

PID controller 1 is the only one that currently supports VTHRUST mode at this time!!!  If you use a different PID controller VTHRUST mode will be inoperable and you will have very little control of your aircraft if you try and turn it on.

LEVEL PID: P = 2.0  <- make sure this is set appropriately, as VTHRUST mode uses the same logic as ANGLE mode to maintain pitch stability.  I've set the default to 2.0, which is a sane value for this PID controller.  The old Cleanflight default of 9.0 would cause wild oscillations and crash.


---------- Modes Tab: ----------

You should see a new flight mode: VTHRUST
(If it's missing, ensure that you've flashed the correct firmware, that you've enabled the CUSTOM mixer model, and that you've saved your changes in the prior tabs.)

You'll probably want to assign VTHRUST to an AUX switch.   In short, with this mode ON the pitch stick should move the tilt-rotor / vectored thrust servo.

Read more about it below.


---------- Servo config using CLI: ----------

(You can skip this if you patch cleanflight-configurator and just use the Servos Tab.)

You can change the behavior of the two servos in the CLI tab even though they don't show up in the Servos tab for the CUSTOM mixer.  The commands are in the format:

servo x min max mid dir -1

Where:
x = servo number (5 for yaw, 6 for tilt-rotor)
min = minimum position (default: 1020)
max = maximum position (default: 2000)
mid = mid position (default:1500)
dir = 100 for normal, 101 for reverse
-1 = (I don't know what this signifies, actually.)
So, to reverse the direction for the VTHRUST servo, but leave the other defaults, you'd type:
servo 6 1020 2000 1500 101 -1
(You'll want to do this if you used my model, as it mounts the servo in an orientation that requires reversal.)

Don't forget to save your changes by typing "save" after you're done.  The FC will reboot.


Miscellaneous:

I've found that you need to enable yaw_deadband on tricopters in cleanflight CLI, at least for my (DSM2) TX/RX combination.  Otherwise the aircraft tends to drift in yaw due to RX "jitter."

set yaw_deadband = 10
save


VECTORED THRUST (VTHRUST) MODE EXPLAINED


VTHRUST OFF:  

  • The tilt-rotor servo will be locked in the center position
  • All axis (pitch, roll, yaw) operate as per the normal flight modes.  (acro, angle, horizon, &etc)


VTHRUST ON:

  • Aircraft pitch is locked at 0° (level, using LEVEL PID in angle mode)
  • Pitch control sets the tilt-rotor servo position
  • All other axis (roll, yaw) operate as per the normal flight modes. 

Note that last bullet.  This means:
VTHRUST + GYRO ONLY mode:  Pitch is locked at 0 degrees (since you don't have any pitch control), but gyro only for roll.

VTHRUST + HORIZON mode:  Pitch is locked at 0 degrees, but horizon mode for roll

VTHRUST + ANGLE mode:  Behaves like regular Angle mode, except you control the fore/aft thrust instead of the aircraft pitch with the pitch stick.

And remember, if you turn VTHRUST off it should return the tilt-rotor servo to the center position and fly like a regular tricopter in whatever flight mode you have on.


Happy flying!  Let me know if you try it or have any comments / questions / suggestions.

 - K.C.

6 comments:

  1. Thanks for this! printing the parts now, gonna try with 2300kv motors and 5" props. otherwise ei have 920kv motors and 10" props.

    ReplyDelete
  2. I saw a VTOL project on flitest where they basically used something like this on a fixed wing body (A tail), but they modified cleanflight on a KK board, and instead of the way you have full control over the rotation with the TX in flight, they set up a button to execute a routine that went from VTOL to forward flight. I thought about this project when I saw that and thought using your method would be far better. Would make a really interesting aircraft. Of course they stopped the rear prop when in forward flight mode, but I was thinking instead, to have sort of an expo going where the rear prop fades power as the front motors tilt forward. And of course you'd want full 90 degree rotation of the front motors. You'd probably also want to tie yaw to both the rear motor servo and the A tail rudders.
    I have a friend who is thinking to do the overall design, but can't do the FC firmware. Would you be interested in helping with that?

    ReplyDelete
    Replies
    1. Not sure why it shows me as Unknown, and I could not check "Notify me". If interested, maybe just email me at mrsatov at gmail dot com.

      Delete
    2. Thanks! Yeah, there's lots of possibilities with the tilt-rotor concept. I'd love to try out some more advanced designs, but I'm pretty time constrained lately. :-P

      Delete
  3. Hey. Have you thought upgrading this to T5 (with coaxial tilt front arm) or T6 (coaxial tilt front arm and no tail servo) configuration? Or would it be too complicated to conf the setup?

    ReplyDelete
  4. Have you updated the hex file for the latest versions of Cleanflight? I think this is great.

    ReplyDelete

Note: Only a member of this blog may post a comment.