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:
The precompiled firmware:
**** 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
x = servo number (5 for yaw, 6 for tilt-rotor)So, to reverse the direction for the VTHRUST servo, but leave the other defaults, you'd type:
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.)
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.
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
VECTORED THRUST (VTHRUST) MODE EXPLAINED
- 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)
- 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.