Servers by jDrones

Where would I change vectored thrust mixing in the source code?

you can just us the normal tilt output, 41:MotorTilt

Thanks David and Pete,

I agree David that the aft motor tilting for pitch control would be tricky to dial in and making it a binary would be a lot easier.

FYI “Kris”, the guy in China that made these mods work (and wont release the source), made a new function for the tail motor(#45) that did assist in position control (see the youtube link on the OP).

I believe the #41 servo function only serves as yaw control in tricopter frames which would require a left/right tilt.

the fore/aft tilt of the rear motor serves to add a lot of ability of the airframe to stabilize itself in wind and hold position better. The previous build I used in the px4 source was a standard tricopter VTOL (called the “convergence” airframe where only the 2 front tilted for yaw control in MC) wasn’t very good at dealing with the wind.

the video makes it very evident how much control authority aft motor tilt adds in wind.

Jeff

its for motor tilt if you don’t have separate left and right, like this for example

Yaw only output is Motor 7 on tri-copters

I looked at using 41, but the tricopter code didn’t seem to use it the way I was thinking. Defining a TailRotorVerticalTilt motor may not be necessary. I’ll look into the coding more tonight. I only spent 3 minutes looking at TiltRotor.cpp. I have an Frsky Telemetry problem I have been working on for days. The _port.write() gets called, but no data goes out on the TX pins. Its bizarre.

I have wanted to build a big tri-copter or quad vtol, so I hope I learn a few more thing looking at the code.

Thanks for looking at it David… Ive been seeing a lot of issues with telemetry lately.

If you want to build a tri, i recommend them. I like the way they fly vs. a quad.

If you come up with anything you want me to try out, I have a test bed built so i can try it right away and get back to you with the results.

I looked at the code some more, and there is no control of forward/back movement by tilting the motors at all. I suspect this is because it was never in copter, and the copter code was used for most of the MR flight. The tiltrotor code mostly deals with transition.

I think that needs to be added first, expanding the tilting to the tail rotor also. I flew my convergence yesterday in a 25+ mph wind and while it did ok, I had to keep the nose pointed into the wind or it would lose position. I was in QSTABILIZE and the altitude control felt weird to me. That was my first flight with ardupilot so maybe QHOVER will be better. I’m get can’t intialize barometer messages, so either my barometer or the whole FC is bad. My last Matek F405-Wing burned up, so I’m looking for an alternative.

David,
thats what i was thinking, that there was no way for the code to mix in vectoring for movement (or position) control … I wonder if the transition code could do it … maybe have 2 transition states where stage 1 is MC flight with vectoring and stage 2 is the transition…

The px4 code does have a mixer but I never could add the aft motor tilt

I dont know if you watched the video but “Kris” had ONLY the aft motor tilting when the airframe was pitched (front 2 did only yaw control) and tied to his radio’s pitch control. I dont have any use for the alternative modes where different combinations of the motors run in FW mode)

The plane Im building is a 2 meter flying wing with about 6 lbs AUW so the more control authority the better. When I flew it with px4’s “convergence” frame code it was pretty unstable (I didnt tune it so thats on me). It did seem to be a lot more sluggish than ardupilot’s code.

Ive had a couple of FCs get sketchy on me too… in fact I bought one of the very first pixhawks from 3DR (back in 2014 i think) and it never did work right… too bad I didnt mess with it for 2 years after i bought it, i could have returned it.

thanks for your thoughts

Jeff

I translated some of the readme’s of “Kris’s” code documentation and I picked out some interesting things. the whole document is attached… its from a January firmware release.

Firmware Name: ArduPlane-20180502 (V3.9.0-DEV)
=============================================================readme.txt (36.4 KB)
note:
This new version of the firmware code changes quite a bit, from the old version to this version may have to adjust the parameters
Can fly, so it is recommended that novices do not use for the time being, let the friends who are familiar with PID first try.

  1. Synchronize the official code

    Fixed a bug where the tangential angle was incorrect when lotto_to_alt (circled up or down) left.

    Modify the default installation orientation for Here GPS’s ICM-20948 compass.
    Correction of the tailstock type transition from FBWA to QSTABILIZE throttle sometimes suddenly pulls down the bug.

  2. Vertical takeoff and landing (VTOL) optimization
    Replace the old multi-axis attitude control with a new position control algorithm.
    Use a new rate attitude controller during the transition (transition) (the transition is smoother / the height control is better)
    The horizontal position controller runs at full speed of 400hz (old 50hz)
    New L1 distance calculation method (turning will be smoother)

    .New / Transaction parameters
    Q_A_INPUT_TC (attitude control input time constant), the smaller the value, the larger the response, the larger the value, the smaller the response
    Example: Q_A_INPUT_TC=0.5 is very soft, 0.2 soft, 0.15, 0.1 fast, 0.05 very fast

    Speed ??gain doubled, Q_P_VELXY_P, Q_P_VELXY_I, Q_P_VELXY_D parameters may have to be adjusted (tune up)

    .Q_P_ANGLE_MAX Position controller angle limit (0-45 degrees), if set to 0, use Q_ANGLE_MAX

    Multi-axis QLOITER adds brake control, parameters: WPNAV_BRK_JERK, BRK_ACCEL and BRK_DELAY
    Tilt angle Q_WP_LOIT_ANGM (0-45), if set to 0, 70% angle of Q_ANGLE_MAX

  • Added conversion back to multi-axis throttle scaling parameter. If it is converted back to multi-axis, it will increase the value. For example, 60 (%)
    TILT_UP_THR=0 is disabled, 1~99 is throttle zoom%

    • Added low height assistance parameters:
      ASSIST_ALT=0.5 seconds below this height triggers the rescue (0=disable, 1~300=1m~300m)
      ASSIST_ALT_MOD=What mode is used to save the machine (0=disable, 17=QSTABILIZE,18=QHOVER,19=QLOITER,20=QLAND)
      Note: At least the flight must have exceeded ASSIST_ALT + 5 meters in fixed-wing mode, if not, it will not trigger.

There is another thread looking at the same thing, at least for the front rotors. Im trying to think of what needs to be added. Obviously elevator mixing. What about throttle compensation as the tilt angle increases? I also think rear tilt should be limited to prevent problems with backwards flight. Do we also disable the control surfaces in MR? I would like more input on that.

Control surfaces are active in VTOL modes, but their deflection is scaled down at low airspeeds. See https://github.com/ArduPilot/ardupilot/blob/master/ArduPlane/Attitude.cpp#L26

but note that this only works if you have an airspeed sensor.

David…
Im not sure about throttle mixing with tilt angle but I would think that would be a part of thrust vectoring. alternatively, would the gyros want to change thrust (maybe with an angular tilt limiter/expander) depending on what the airframe’s orientation is?

agreed on the liniting of the rear tilt.

i would think the control surfaces should function in MR to help with wind shifts while the plane is weathervaning.

thanks for the info Mark.

OK, I have performed a full translation of Kris’s code documentation to see if we can figure out how he made these mods to the code. Its interesting that he says he “Synchronized the official code” with each new update. It appears that he did not but I could be wrong.

The readme is attached.

Kris Translated notes.txt (188.6 KB) thanks

Jeff

Where does Kris’s notes come from? Is this the source that we do no have available? I think we can use the code from kd0aij and mix the elevator to a throttle channel for tilting elevator in MR. It should be possible to add the tailrotor to the existing tiltrotor.cpp or quadplane.cpp code, I just need to figure out how to do that the best way, plus figure out how to test it in sitl. I haven’t felt that great lately, having had both heart and lung surgery 3 months ago, but I will try to get to it before the end of the year. Just FYI, heart surgery was no really big deal, lung surgery sux!!!

A heart and lung surgery??? What the heck happened? I hope your recovery goes well… Once again thank you very much for looking at this.

As far as Kris’s notes, I think he wrote them… they are in chinese/taiwanese and included with each of his releases. The source code has not been made available despite Philip Rowse (developer of the Cube) employing some of his associates in China to contact Kris.

Ive just moved so my life is in boxed chaos and I will be reading through the translated notes to see what clues are there. I would suggest starting at his first notes… could show you where to start.

I wish I could help more but I have no clue how the firmware processes flight control.

Thanks again and please let me know if I can help you with your recovery at all.

Jeff

High blood pressure caused my aorta to rupture (I’m 55). I felt a sharp pain between my shoulder blades. After about 20 minutes I had my gf take me to the ER. They stuck me in a heli for a flight to a another hospital that handle bad cardiac cases, and they did surgery in time. But something went wrong during the aortic resection and my right lung was damaged. About a week later they removed 2/3s of it, and a week later went back in to fix a couple of issues with my lung. You don’t ever want lung surgery. They kept me a month and I lost 30-40 lbs!! I could barely walk when I got home. After 3 months I’m getting lots better, but stairs still kill me. I wrote this off-topic reply mostly as a warning to others, as you get older watch that blood pressure!! There are some serious complications. I had no idea my aorta could rupture. Never heard of that before, and usually if it happens the pressure just blows a hole out the side and you die quickly. I got really lucky and my aorta separated into layers and just leaked, but if I had not been flown to the surgeon I would likely not have made it in an ambulance.

I’ still studying the code and wishing for either good weather, or some place to cut foam about the size of an X8. I live in a condo and the isn’t any good place to work, but I really want to build a tricopter vtol, mostly just scaling up a convergence to 2 meters. I’m still debating tilting the tail rotor for forward flight. What are the advantages over using more powerful wing motors? Control in the wind? If that is the case should it tilt in all 4 directions?

Well that is really lucky you made it. Im 57 so Im in the same boat. The business I own is boat canvas and awnings so it keeps me moving and I eat fairly healthy… I stay away from fast and fried food for the most part.

Where do you live? Im near Sarasota FL… maybe I can build you a plane or mail you my prototype wing… its got 2 of the tilt servos on the front and its all carbon fiber. I have a large table (8 x 20’) and a CNC so I can cut CF and other materials (My CNC is down due to my recent move).

As far as the aft motor, it only needs to tilt fore/aft due to the front motors still controlling yaw (like your convergence). Im rethinking the aft motor’s functions… maybe just have it tilt to stay level when the airframe is pitched and flip back for FW mode.

have you had a chance to read through Kris’s notes? I havent found anything very interesting in the earlier notes he made when his build was new.

Im glad you’re doing better and take it easy.

Jeff

I went through all of Kris’s notes and thought these were relevant:
(note, they start when the Y3x3 features were implemented)

20170810 (V3.8.1-DEV)

  1. Add three vector Y3 support, just put
    Q_TILT_MASK=11
    Servo*_Function=45 (post vector tilt steering gear)

20171006 (V3.8.2-DEV)

  1. Added Y6F model and corrected some GPS write log problems.
    Q_M_THST_EXPO (motor thrust curve) allows setting a negative value, close to 0 for linear, otherwise curve.
    Note: If the Q_M_THST_EXPO parameter is set to 0, please change it to 0.1 (minimum), the default is 0.65.

  2. The tilted double-difference sensitivity parameter is uniformly changed to RUDD_DT_GAIN (default is 10=10%), which will be used for fixed wings.
    All modes (including manual mode) usually have a good cornering effect of 20%~30%.

  3. Parameters similar to multi-axis CH?_OPT:
    RC7_TRIM ~ RC12_TRIM value:
    3=3 vector Y3 dedicated (low position = rear side single motor thrust, neutral = front side double motor thrust, high position = front and rear three motor thrust)


20171011 (V3.8.2-DEV)

*2. Added fixed wing vector parameters (default is off)
Q_TILT_FIX_ANGLE=10 (fixed wing vector angle, 0=off, 10=10 degrees)
Q_TILT_FIX_GAIN=100 (fixed wing vector sensitivity, 0=off, 100=100%)
Debugging method:

  1. First Q_TILT_FIX_ANGLE=10, Q_TILT_FIX_GAIN=100
  2. Switch the manual/QStabilize mode and set the Servo9_Min/Servo9_Max and Servo10_Min/Servo10_Max strokes.
    3.QStabilize mode, push the throttle (do not unlock), try the angle of YAW (the paddle will swing one after the other, but will not cut the wing)
  3. Manual mode, push the throttle (do not unlock), hit the elevator test angle (same as above), play the aileron test angle (will be one after the other),
  4. FBW* mode, push the throttle (do not unlock), the fuselage leans forward, the steering angle is upward, and the right is tilted to the steering angle.
  5. If you have adjusted it, put Q_TILT_FIX_GAIN=50 and lift it up. If you feel that it is not enough, increase it yourself (up to 100%).
    use:
    The vector is used to assist the fixed-wing rudder surface correction, and the rudder failure still has some control ability.

20171030 (V3.8.2-DEV)2.TECS: Improved support for VTOL conversion

  1. Added Q_MAV_TYPE parameter to send heartbeat type to some ground stations to avoid ground station disconnection. The values ​​are as follows:
    0: AUTO, 1: FIXED_WING, 2: QUADROTOR, 3: COAXIAL, 4: HELICOPTER, 7: AIRSHIP, 8: FREE_BALLOON,
    9: ROCKET, 10: GROUND_ROVER, 11: SURFACE_BOAT, 12: SUBMARINE, 16: FLAPPING_WING, 17: KITE,
    19: VTOL_DUOROTOR, 20: VTOL_QUADROTOR, 21: VTOL_TILTROTOR

  2. Added Q_OPTIONS parameter to allow the drooping model to choose to use the fixed wing to take off and land.
    Bit representation:
    Bit0: LevelTransition (the wing tilt must be within the LEVEL_ROLL_LIMIT angle when converting to a fixed wing)
    Bit1: AllowFWTakeoff (can take off with a fixed wing)
    Bit2: AllowFWLand (can be landed with a fixed wing)
    For example, 1 (bit0) means that the wing must remain within the LEVEL_ROLL_LIMIT angle during the transition.
    For example, 6 (bit1, bit2) indicates that the take-off and landing are allowed using the fixed-wing mode (instead of the sag mode).


20180127 (V3.9.0-DEV)

*2. Modify the Y3 conversion algorithm, mainly for Y3, when the crosswind transitions, the left and right wings will swing forward (not beautiful).
Can be modified by Q_WVANE_MINROLL=1~3 (usually a value between 1 and 3)
You can start with 0.5 (0.5 1 1.5 2 2.5 3) until the rocking phenomenon disappears.

*3. Modify the multi-axis attitude algorithm to integrate the high-speed tilt servo, if you use high-quality high-speed tilt servo
With reference to the new parameter tuning, multi-axis performance is better (hands and more wind resistant).


20180502 (V3.9.0-DEV) Version Identifier: fd4463

note:
This new version of the firmware code changes quite a bit, from the old version to this version may need to adjust the parameters
Can fly, so it is recommended that novices do not use for the time being, let the friends who are familiar with PID first try.

  1. Vertical takeoff and landing (VTOL) optimization
    Replace the old multi-axis attitude control with a new position control algorithm.
    Use a new rate attitude controller during the transition (transition) (the transition is smoother / the height control is better)
    The horizontal position controller runs at full speed of 400hz (old 50hz)
    New L1 distance calculation method (turning will be smoother)

20180713 (V3.10.0-DEV) Version Identifier: 08da22

*3.Q_TILT_DN_THR and Q_TILT_UP_THR are renamed to Q_TILT_THR_DN and Q_TILT_THR_UP
This way the parameter tables will be arranged together for easy viewing.


20180802 (V3.10.0-DEV) 版本识别码:5d923aed

*5. The remote control function switch is changed from RC?_TRIM to RC7_OPT ~ RC9_OPT, because TRIM will be troubled by zeroing each time the remote controller is calibrated.
The RC?_OPT function code is as follows:
0=disabled
3=3 vector Y3 dedicated (low position = rear side single motor thrust, neutral = front side double motor thrust, high position = front and rear three motor thrust)
4=4 tilting X4 dedicated (low position = rear side double motor thrust, medium position = front side double motor thrust, high position = front and rear four motor thrust)
104=switch center = LOITER (circle), switch high = RTL (self-return)
106=switch center = FBWB (FBWB fixed mode), switch high = CRUISE (cruise mode)
109=Camera shutter trigger
116=Auto mode (cancelled, because of doubts, the control and re-control will switch to the mode of the main mode switch instead of automatic)
118=QLand mode (in-situ multi-axis mode self-drop)
124=Air Mission Reset
128=Relay 1 (switch high = on, switch low = off)
134=Relay 2 (switch high = on, switch low = off)
135=Relay 3 (switch high = on, switch low = off)
136=Relay 4 (switch high = on, switch low = off)
E.g:
RC7_OPT=104, the remote control switch CH7 is in the Loiter mode when it is in the middle position, and it is RTL when it is turned on.
RC9_OPT=109, the remote control switch CH9 will take a photo when it hits the high position (and will store the CAM bit)


20180816 (V3.10.0-DEV) 版本识别码:0f7c837d

*4. Other minor modifications:
.THR_MAX Fixed wing maximum throttle limit changed to proportional scaling.
For three-turn type: switch height = 3 power / switch medium = double front pull / switch low = single push back
RC?_OPT=3 (In the same way, the motor that is not used will not automatically dump back)
RC?_OPT=31 (same function, but the tail motor will automatically dump back when double forward pull)
RC?_OPT=32 (same function, the tail motor will automatically dump back when double forward pull, the front pull motor will automatically dump back when single push back)


20181216 (V3.10.0-DEV) 版本识别码:1f8db08d

  1. Added multi-axis mode auto-tuning (QAUTOTUNE mode), automatic tuning steps:
    a) Set any flight mode to QAUTOTUNE mode
    Since the current Mission Planner does not recognize this mode (there will be an update later), so enter the full parameter list will
    FLTMODE?=22 (number of QAUTOTUNE mode), for example, temporarily change the original FBWA (number 5) to 22.
    b) Set the parameter Q_AUTOTUNE_AGGR=0.1 (0.1 = aggressive, 0.075 = medium, 0.050 = weak)
    This hopes to automatically adjust the results of the adjustments, the greater the value, the more aggressive (corrected and strong)
    c) Select the parameter Q_AUTOTUNE_AXES to select the combination of the axes (roll, pitch, yaw) to be adjusted.
    Q_AUTOTUNE_AXES=1 (only roll)
    Q_AUTOTUNE_AXES=2 (only the pitch axis is adjusted)
    Q_AUTOTUNE_AXES=4 (only adjust the yaw axis)
    Q_AUTOTUNE_AXES=7 (three axes are adjusted together, 1+2+4=7, of course, 1+4=5 only roll + yaw)
    The suggestion to hang up is adjusted by one axis to prevent the battery from running out, or to suspend the ESC for a long time.
    d) Find a windless or breezy sky and wide field to take off in multi-axis mode (QS/QH/QL mode), then cut the switch to just
    The specified QAUTOTUNE mode.
    Note: The adjustment mode is similar to QHOVER (the fixed height mode), the throttle is centered and the height is fixed, so pay attention to your throttle to be centered.
    e) At this time, the automatic adjustment will start. If you run too far, you can pull the rod back (you can get in at any time). After pulling back, the pole will continue to adjust.
    When it is no longer shaking, it means that the adjustment has been completed. At this time, you can try it with a shot. If you feel satisfied, you will land in QAUTOTUNE mode.
    And locking is memory, if you are not satisfied, cut to another mode and then lock (do not remember).

20190319 (V3.10.0-DEV) 版本识别码:3907466f

*5. Added support for the following variable pitch models (see HeliPlane.txt for details)
Pure pitch multi-axis (Q_ENABLE=2 will not change the aircraft, AUTO is still multi-axis mode), oil / electric can be.
.V44 variable pitch (can be tilted forward / backward tilted / fully tilted / not tilted 4 + x)
.Y3 variable pitch (can be tilted forward / full tilted)

Hello Jeff and David,

Have you had any luck with figuring out how to control the tail rotor tilt angle?

I am good at physics, have some understanding of control algorithms, and am a descent code modder. So I may be of help, but I am at the beginning of the road for this particular problem. If you can somehow inform me how far you have gone, where I should be looking at, I could pick up from there.

Thanks

Cem

Servers by jDrones