Hi everyone !
After being trapped in a "digging/tweaking/tuning/flying/repeat" loop for 3 weeks, I've finally managed to have a stable yet fully aerobatic tricopter which loiters fine and can be flown FPV with no probs. However, I still have some issues regarding the RTL and Auto functions. It took ages to set everything up and solve some problems which jeopardized the whole flight capabilities of the plateform. So I tried to remember everyone of them, describe them and add the solution I've found to be able to help beginners tricopter builder in their firsts steps with Arducopter. I take absolutely no credit to any of the fixes mentionned here, since it's pretty much a compilation of solutions I found here and there, but I sincerely thank the numerous contributors of the DIYdrones community for helping people so much, without even knowing it.
To this day, using an APM2 to control a tricopter is a tricky thing to do. Setting up a more or less flyable tri is easily achieved, but having it fine-tuned and capable of performing sharp maneuvers without shaking like my grand-fathers hand as well as having a good yaw authority while keeping the heading smooth and precise require a lot more work. I will stubbornly stand against anyone daring to say the opposite. Arducopter (v2.4~2.6) might be PNF for other platforms, it absolutely ain't for the tricopter. However, a carefully tuned APM2 will deliver naza-like stability while remaining fully aerobatic if you take the time to show him love. So, it might be a very steep learning curve, but the result is IMO worth the hair loss. And after all, hairs are by far more disposable than the kidney you have to sell to buy a wookong anyway.
If you decide to take the plunge, hook the tricopter to a KKBoard and ensure everything is flying fine. This important step will rule out platform-dependant problems such as motors angle, yaw servo center and throw, yaw assembly wiggling, EM noise ... So don't skip it, it may save you a lot of time and some wig costs too. Once your tri is flying OK with the KKBoard, you'll know for sure that any issue encountered will be Arducopter-related. Time to install the APM2. Be sure to read the wiki thoroughly before, every aspect of the installation being perfectly described there.
Tip : it may be practical to glue some 3 pins male connectors through the cockpit, pointed outside (I use the infamous tupperware cockpits) so that the cockpit containing all the brains electronics (APM, OSD, telemetry...) remains watertight and can be mounted with velcro [yes, the blue one] on the platform. This way, exchanging platforms might just be as easy as exchanging cockpits, connecting ESCs and loading parameters or reflashing the firmware. Just be sure to tape the wires from servos and ESCs to the platform to avoid them getting disconnected in flight by vibrations and to punch a tiny hole on the bottom for the baro sensor.
- Hardware-related problems (APM2-specific, I presume) :
- Problem #1 : using a PPMsum receiver don't work. Easy fix : use the APM1 method described in the wiki instead, works a charm.
- Problem #2 : if the jumper connecting the in and out power rails is set and the APM refuse to boot (not even the power LED lights up) You've fried a diode. Don't freak out and connect the positives rails of the in and out buses together by soldering a wire in between [quick and dirty fix]. Remember to ALWAYS apply power from a battery before connecting the APM2 to USB, and disconnect the battery only while the USB cable is disconnected. Otherwise, very bad things can happen. (Not sure which of your computer usb bus or the APM2 will release the magic smoke first. My money is on the computer)
- Problem #3 [might be related to #2] : the 4pins serial interface don't work with telemetry/osd/whatever. You've possibly fried the serial mux (or a software bug ? To be confirmed) Fix : solder 4 pins to the serial 1 port on the side of the board and use it instead for your serial stuff.
- Tweak : You want to have battery voltage monitoring without buying expensive or crash prone hardware. Two possibilities : either solder a connector to the APM2 analog port 1 (like if it was the AttoPilot sensor [see the wiki]) which will be plugged into the first cell of your flight battery. Then, using the mission planner, set the BATT_MONITOR param to 3 and VOLT_DIVIDER to the number of cell your battery has. Pros : ultra easy to do, works with different batteries (3s, 4s...). Cons : inaccurate, especially if the battery is unbalanced, might blow your APM2 if reverse connected. Alternative [preferred] method : solder a resistor bridge across your main voltage input which goes into the analog input 1 in the APM2. Calculate the resistors value with an online calc [google resistor divider] to scale your maximum battery voltage to around 3.5-4V Set the BATT_MONITOR param to 3. Using a voltmeter, measure the voltage of your main battery, then the voltage of the divider out, divide the first one by the second one and set the VOLT_DIVIDER to this value. Pros : monitor the whole battery pack. Use only 2 cheap, widely available components. Cons : need to be changed if battery cell count is augmented.
- Tuning/flight behavior related issues:
- Problem #4 : Yaw is horrible. Either slow and quadcopterish or overshooting and seesawing like mad. Tried any combination of Yaw_S and Yaw_R PID without success [success isn't to be barely flyable for me. It should be at least as good as with a KKBoard]. Tried the "alternate yaw method" of Robert Lefebvre which was not bad, although a bit sluggish. Solution : compile arducopter from Robert Lefebvre's git clone, yaw branch (). Big thumbs up for him, he has made my tricopter flyable. Side effect : Acro mode is gone (seems unflyable for me, don't know why) Before compiling this version of the firmware, my tri was very unstable each time I yawed. After that, it became both precise at slow speed and acrobatic at full stick deflection. So Robert, you are the man. Warning : always disconnect the props while uploading a new firmware ! [had some surprises in this domain, nearly fall out with my cat]
- Problem #5 : How to tune the PIDs ? Tried various methods with mixed results (first acro then stable, first P then I then D; first P, then D, the I, tuning at full moon, facing the Mecca...) Best method to me this day : using CH6 tuning, switch to acro mode (before fix #4) and tune the kP roughly under the oscillations. Then dial in I so that the copter will maintain the angle for more than one second. Then add some kD by small increments until it begin to twitch. Back off a bit. Switch to stable mode. Adjust kP so that it will return from a sharp bank to level without too much slow oscillation (depends on how do you intend to fly it). Some rapid "acro-like" (too much rate kP) oscillations are ok, we will eliminate them later by lowering the rate kP. Set stab I and stab Imax to 0 (really not needed). At this point, be sure to autotrim the copter in a windless environnement so that it flies without drifting at center stick. It may fly slightly on the side, as long as it doesn't drift in that direction. At last, add a little bit of stab kD until it twitches then go fly into the wind and back off the rate kP until the rapid oscillations are gone. And voila. Using PID to compensate for the wind in stable mode doesn't seems a good idea to me, since it's easier done manually, especially in gusty winds.
- Tip : on tricopters, the PIDs may be a little bit different on roll and pitch axis. I found mine to have lower Ps on the pitch than on the roll. Seems logical since three motors are controlling the pitch axis while only two take care of the roll axis. This difference is not very important for the overall flying behavior, so I keep those adjustments to the end, only after I had plenty of fun flying the tri.
- Tip 2 : telemetry helps a lot while tuning PIDs and debugging auto modes. Grab a pair of APC220, they are cheap, won't interfere with your 2.4g stuff and works very well with MP1.1.9x
- Tip 3 : before even attempting to tune, think about the type of flight you intend to do with that platform. Do you want it smooth and precise, sharp and agile ? What kind of wind do you expect it to handle ? Then, you will know what to look for (oscillating while recovering a 60 degree bank isn't a show stopper for an aerial photography platform). You can still have multiple PIDs stored in a computer for different occasions.
- Problem #6 : The copter is either sluggish but stable (low stab kP) or aerobatic but shaky (high stab kP). This is still a work in progress. A temporary fix for this one would be to tune it to the sluggish phase, then modify the radio.pde file at the lines "g.rc_1.set_angle(4500)" and "g.rc_2.set_angle(4500);" to 6500. This control the angle you want the copter to achieve at full stick deflection. Default is 45degrees, 65deg provide more control [thank you, emile !]. However, there was once in a day a rc_scale parameter that was wiped from new releases. A more permanent fix would be to revive it. If I have time, I might try that and putting it as a tunable parameter. I see no reason why the input from the user should be dependent on the kP of the accelerometer. To be improved...
- Problem #7 : Loiter doesn't work. Send the copter to hell, begin a toilet-bowl effect, attempt seppuku. Well. There is a lot of factors explaining this one. Loiter and Nav PID might be one. Lowering Nav P a lot and setting I to 0 might help. At least you can see what the copter is trying to do. One thing to keep in mind is to autotrim the damn thing correctly, to be sure it will fly without drifting at center stick. The smallest, sightliest amount of drift (in a windless environment) may reach havoc in loiter mode. I had a hard time figuring out that. So don't loose faith in the autotrim mode.
So there were the most tenacious problems I encountered until now. If I find new ones, I might update this post to keep it up to date. If I can persuade my sd-dvr to record fpv flights instead of obstinately corrupting my sd cards and my girlfriend to hold a camera instead of crashing a KK tricopter, I might add videos to [hopefully] help newcomers to motivate themselves into building an ardu-tri-copter. In the mean time, don't hesitate to post tricopter-related questions below.
Happy flying !